/* sprinkler.css — v1.23.41 */

.sprinkler-shell {
    background: linear-gradient(165deg, #1a9fff 0%, #0d7dde 42%, #0a6bc4 100%);
    min-height: 100vh;
    position: relative;
}

/* מקום לגלילה מלאה מתחת ל־בית/תוכניות + שורת המחשבונים */
.sprinkler-shell.has-bottom-nav {
    padding-bottom: calc(
        var(--app-bottom-nav-h, 52px)
        + 3.75rem
        + var(--live-run-h, 0px)
    );
}

.sprinkler-shell.has-bottom-nav > main {
    padding-bottom: 1.25rem;
}

/* כפתור תפריט משמאל ללוגו + צ׳יפ סטטוס קומפקטי */
.sprinkler-brand-bar {
    display: grid;
    grid-template-columns: 40px 1fr 40px;
    align-items: center;
    gap: 4px;
    margin-bottom: 8px;
    direction: ltr; /* כפתור תפריט פיזית משמאל ללוגו */
}

.sprinkler-brand-balance {
    width: 40px;
    height: 40px;
}

.app-menu-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    display: grid;
    place-items: center;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.app-menu-btn:active {
    transform: scale(0.96);
    background: rgba(255, 255, 255, 0.24);
}

.app-menu-icon {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 16px;
}

.app-menu-icon span {
    display: block;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
}

.app-menu-dot {
    position: absolute;
    top: 7px;
    left: 7px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fbbf24;
    box-shadow: 0 0 0 2px rgba(14, 116, 190, 0.85);
}

.app-menu-dot.is-danger {
    background: #ef4444;
}

.app-menu-dot.is-hidden,
.app-menu-dot[hidden] {
    display: none !important;
}

.home-status-chip {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 0 0 8px;
    padding: 7px 10px;
    border: 0;
    border-radius: 999px;
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    color: #0c4a6e;
    background: rgba(224, 242, 254, 0.95);
    box-shadow: 0 2px 10px rgba(3, 105, 161, 0.18);
    cursor: pointer;
}

.home-status-chip.is-off {
    color: #7f1d1d;
    background: rgba(254, 226, 226, 0.96);
    box-shadow: 0 2px 10px rgba(185, 28, 28, 0.2);
}

.home-status-chip.is-forecast {
    color: #075985;
    background: rgba(186, 230, 253, 0.96);
    box-shadow: 0 2px 10px rgba(3, 105, 161, 0.18);
}

.home-status-chip.is-hidden,
.home-status-chip[hidden] {
    display: none !important;
}

.app-menu-sheet {
    padding: 16px 16px 14px;
    margin: 0 6px 6px;
    border-radius: 18px;
    max-height: min(70vh, 420px);
    overflow: auto;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22);
}

/* התפריט נפתח מעל הסרגל החי + ניווט תחתון — לא מסתיר אותם */
.zone-edit-modal.app-menu-modal {
    z-index: 44; /* מתחת ל־live-run-banner (45) */
    padding-bottom: calc(var(--app-bottom-nav-h, 52px) + var(--live-run-h, 0px));
    align-items: flex-end;
}

.zone-edit-modal.app-menu-modal .zone-edit-backdrop {
    bottom: calc(var(--app-bottom-nav-h, 52px) + var(--live-run-h, 0px));
}

.app-menu-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.app-menu-close {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 10px;
    background: #f1f5f9;
    color: #334155;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.app-menu-status {
    margin: 0 0 10px;
    padding: 8px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    color: #0c4a6e;
    background: #e0f2fe;
}

.app-menu-status.is-off {
    color: #7f1d1d;
    background: #fee2e2;
}

.app-menu-status.is-hidden,
.app-menu-status[hidden] {
    display: none !important;
}

.app-menu-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.app-menu-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    width: 100%;
    text-align: start;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 12px 14px;
    background: #f8fafc;
    color: #0f172a;
    font: inherit;
    cursor: pointer;
}

.app-menu-item:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.app-menu-item:not(:disabled):active {
    transform: scale(0.99);
}

a.app-menu-item,
a.app-menu-item-link {
    text-decoration: none;
    color: inherit;
}

.settings-back-link {
    display: inline-flex;
    align-items: center;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 700;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.settings-back-link:active {
    background: rgba(255, 255, 255, 0.28);
}

.settings-sections {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.settings-card {
    background: #fff;
    border-radius: 1rem;
    border: 1px solid #f3f4f6;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    padding: 1rem;
}

.settings-card-title {
    font-size: 1rem;
    font-weight: 800;
    color: #111827;
    margin: 0 0 0.25rem;
}

.settings-card-desc {
    font-size: 0.75rem;
    color: #6b7280;
    line-height: 1.45;
    margin: 0 0 0.85rem;
}

.settings-row {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.settings-days-input {
    flex: 1;
    margin: 0 !important;
}

.settings-save-btn {
    flex: 0 0 auto;
    min-width: 5.5rem;
    border: 0;
    border-radius: 0.75rem;
    background: #0284c7;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 700;
    padding: 0 1rem;
    cursor: pointer;
}

.settings-save-btn:disabled {
    opacity: 0.65;
    cursor: default;
}

.settings-save-btn:not(:disabled):active {
    background: #0369a1;
}

.app-menu-item-title {
    font-size: 15px;
    font-weight: 800;
}

.app-menu-item-desc {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
}

.app-menu-item.is-stopped,
.app-menu-item.is-disabled-state {
    border-color: #fecaca;
    background: #fef2f2;
}

.app-menu-item.is-disabled-state .app-menu-item-title {
    color: #b91c1c;
}

.app-menu-item.is-armed {
    border-color: #fdba74;
    background: #fff7ed;
}

.app-menu-item.is-busy {
    opacity: 0.7;
    cursor: wait;
}

.app-menu-item-demo {
    border-style: dashed;
    background: #fffbeb;
}

.sprinkler-header {
    position: relative;
    z-index: 1;
}

.sprinkler-brand-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    margin-bottom: 0;
}

.sprinkler-logo {
    height: 32px;
    width: auto;
    max-width: 160px;
    object-fit: contain;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.sprinkler-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0 2px 4px;
}

.sprinkler-weather-compact {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    color: #fff;
    min-width: 0;
}

.sprinkler-weather-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-width: 0;
    line-height: 1.15;
}

.sprinkler-weather-emoji {
    font-size: 1.25rem;
    line-height: 1;
    flex-shrink: 0;
    animation: weather-bob 4s ease-in-out infinite;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

#sprinklerTemp {
    font-size: 1.05rem;
    font-weight: 800;
    opacity: 1;
    letter-spacing: 0.02em;
    font-variant-numeric: tabular-nums;
    line-height: 1.15;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.sprinkler-weather-sky,
#sprinklerWeatherLabel {
    font-size: 11px;
    font-weight: 600;
    line-height: 1.15;
    opacity: 0.85;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.sprinkler-datetime {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    color: #fff;
    line-height: 1.15;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.sprinkler-clock {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    font-variant-numeric: tabular-nums;
    min-width: 5.2rem;
}

.sprinkler-date {
    font-size: 11px;
    font-weight: 600;
    opacity: 0.85;
    margin-top: 2px;
}

@keyframes weather-bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
}

.sprinkler-zones {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* באנר «הפעלה הבאה» — זכוכית קומפקטית מתחת לאריחים */
.next-run-banner {
    position: relative;
    margin-top: 12px;
    border-radius: 16px;
    overflow: hidden;
    color: #fff;
    background: linear-gradient(
        145deg,
        rgba(255, 255, 255, 0.32) 0%,
        rgba(255, 255, 255, 0.14) 48%,
        rgba(255, 255, 255, 0.22) 100%
    );
    border: 1px solid rgba(255, 255, 255, 0.38);
    box-shadow:
        0 10px 28px rgba(8, 40, 80, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.45),
        inset 0 -1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(16px) saturate(1.35);
    -webkit-backdrop-filter: blur(16px) saturate(1.35);
    min-height: 0;
}

.next-run-banner-glow {
    position: absolute;
    inset: -40% auto auto -10%;
    width: 55%;
    height: 120%;
    background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.35), transparent 70%);
    pointer-events: none;
    opacity: 0.85;
    animation: next-run-sheen 7s ease-in-out infinite;
}

@keyframes next-run-sheen {
    0%, 100% { transform: translateX(0) rotate(8deg); opacity: 0.55; }
    50% { transform: translateX(28%) rotate(8deg); opacity: 0.9; }
}

.next-run-banner-inner {
    position: relative;
    z-index: 1;
    padding: 8px 10px 9px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.next-run-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    padding: 0 2px;
}

.next-run-kicker {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.78);
    flex-shrink: 0;
}

.next-run-when {
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.15;
    text-align: end;
    text-shadow: 0 1px 2px rgba(8, 40, 80, 0.25);
    direction: rtl;
    color: rgba(255, 255, 255, 0.95);
}

.next-run-slots {
    display: flex;
    align-items: stretch;
    justify-content: flex-start;
    gap: 6px;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}

.next-run-slots::-webkit-scrollbar {
    display: none;
}

.next-run-slots.is-message {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.35;
    padding: 2px 2px 0;
    overflow: visible;
}

.next-run-slot {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    flex: 0 1 auto;
    width: max-content;
    max-width: 42%;
    min-width: 0;
    padding: 6px 8px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    text-align: start;
    color: #fff;
    background: rgba(255, 255, 255, 0.16);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s ease, transform 0.15s ease;
}

.next-run-slot:active {
    background: rgba(255, 255, 255, 0.26);
    transform: scale(0.98);
}

.next-run-slots[data-count="1"] .next-run-slot {
    max-width: 100%;
    flex: 1 1 auto;
    width: auto;
}

.next-run-slots[data-count="2"] .next-run-slot {
    max-width: 48%;
}

.next-run-slots[data-count="3"] .next-run-slot,
.next-run-slots[data-count="4"] .next-run-slot {
    max-width: 31%;
    padding: 5px 6px;
    gap: 6px;
}

.next-run-slots.is-multi .next-run-slot {
    flex: 0 1 auto;
}

.next-run-icon {
    position: relative;
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    color: #fff;
    border-radius: 999px;
    background: rgba(0, 40, 80, 0.18);
    box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.4);
    order: -1;
}

.next-run-slots[data-count="3"] .next-run-icon,
.next-run-slots[data-count="4"] .next-run-icon {
    width: 30px;
    height: 30px;
}

.next-run-icon svg,
.next-run-icon .live-fountain {
    width: 22px;
    height: 22px;
}

.next-run-copy {
    flex: 0 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    justify-content: center;
    text-align: start;
}

.next-run-slots[data-count="1"] .next-run-copy {
    flex: 1 1 auto;
    max-width: none;
}

.next-run-name {
    display: block;
    font-size: 0.84rem;
    font-weight: 800;
    line-height: 1.15;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    text-shadow: 0 1px 2px rgba(8, 40, 80, 0.3);
}

.next-run-time {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.88);
    line-height: 1.1;
    unicode-bidi: isolate;
}

.next-run-slots.is-multi .next-run-name {
    font-size: 0.78rem;
}

.next-run-slots.is-multi .next-run-time {
    font-size: 0.68rem;
}

.next-run-banner.is-empty .next-run-when,
.next-run-banner.is-loading .next-run-when {
    font-size: 0.82rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.88);
}

.next-run-banner.is-clickable {
    cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
    .next-run-banner-glow {
        animation: none;
    }
}

/* באנר תחזית 3 ימים — מתחת להפעלה הבאה */
.forecast-banner {
    --fx-sky-0: #0b4f8a;
    --fx-sky-1: #1270b8;
    --fx-sky-2: #1a9ad9;
    position: relative;
    margin-top: 10px;
    border-radius: 18px;
    overflow: hidden;
    color: #f0f9ff;
    background: linear-gradient(160deg, var(--fx-sky-0) 0%, var(--fx-sky-1) 48%, var(--fx-sky-2) 100%);
    border: 1px solid rgba(186, 230, 253, 0.35);
    box-shadow:
        0 12px 30px rgba(8, 47, 90, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.28);
    min-height: 0;
}

.forecast-banner.has-rain {
    --fx-sky-0: #0c3d66;
    --fx-sky-1: #0e5f8c;
    --fx-sky-2: #147a9e;
    border-color: rgba(125, 211, 252, 0.45);
    box-shadow:
        0 14px 34px rgba(7, 89, 133, 0.35),
        inset 0 1px 0 rgba(186, 230, 253, 0.25);
}

.forecast-banner-sky {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 15% 0%, rgba(255, 255, 255, 0.22), transparent 55%),
        radial-gradient(ellipse 50% 40% at 90% 20%, rgba(56, 189, 248, 0.35), transparent 60%);
    pointer-events: none;
}

.forecast-banner-rain {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    background-image: repeating-linear-gradient(
        -18deg,
        transparent 0,
        transparent 10px,
        rgba(186, 230, 253, 0.07) 10px,
        rgba(186, 230, 253, 0.07) 11px
    );
    animation: forecast-rain-drift 9s linear infinite;
}

.forecast-banner.has-rain .forecast-banner-rain {
    opacity: 1;
}

@keyframes forecast-rain-drift {
    from { background-position: 0 0; }
    to { background-position: 40px 60px; }
}

.forecast-banner-inner {
    position: relative;
    z-index: 1;
    padding: 11px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.forecast-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.forecast-title-block {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.forecast-title,
.forecast-kicker,
.forecast-sub {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.01em;
    line-height: 1.25;
    opacity: 0.95;
}

.forecast-badge {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 800;
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.22);
    white-space: nowrap;
}

.forecast-banner.has-rain .forecast-badge {
    background: rgba(14, 165, 233, 0.35);
    border-color: rgba(125, 211, 252, 0.55);
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.35);
}

.forecast-days {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
}

.forecast-day {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 10px 6px 9px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.16);
    text-align: center;
    min-width: 0;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.forecast-day.is-today {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.35);
}

.forecast-day.is-rain {
    background: linear-gradient(180deg, rgba(56, 189, 248, 0.28) 0%, rgba(14, 116, 144, 0.35) 100%);
    border-color: rgba(125, 211, 252, 0.55);
    box-shadow: inset 0 0 0 1px rgba(186, 230, 253, 0.15);
}

.forecast-day.is-rain::after {
    content: '';
    position: absolute;
    top: 6px;
    left: 8px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #7dd3fc;
    box-shadow: 0 0 8px #38bdf8;
}

.fd-label {
    font-size: 11px;
    font-weight: 800;
    opacity: 0.9;
}

.fd-emoji {
    font-size: 22px;
    line-height: 1.1;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.fd-temp {
    font-size: 15px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}

.fd-rain {
    font-size: 10px;
    font-weight: 700;
    opacity: 0.82;
    line-height: 1.2;
    min-height: 1.2em;
}

.forecast-day.is-rain .fd-rain {
    opacity: 1;
    color: #e0f2fe;
}

.forecast-rain-action {
    width: 100%;
    border: 0;
    border-radius: 12px;
    padding: 10px 12px;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    color: #0c4a6e;
    background: linear-gradient(180deg, #e0f2fe 0%, #bae6fd 100%);
    box-shadow: 0 4px 14px rgba(7, 89, 133, 0.25);
    cursor: pointer;
}

.forecast-rain-action:active {
    transform: scale(0.98);
}

.forecast-rain-action.is-hidden,
.forecast-rain-action[hidden] {
    display: none !important;
}

.forecast-banner.is-loading .forecast-days {
    opacity: 0.55;
}

@media (prefers-reduced-motion: reduce) {
    .forecast-banner-rain {
        animation: none;
    }
}

.zone-card {
    position: relative;
    aspect-ratio: 16 / 10;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 6px 16px rgba(8, 40, 80, 0.16);
    border: none;
    padding: 0;
    text-align: start;
    cursor: default;
    -webkit-tap-highlight-color: transparent;
}

.sprinkler-zones.is-first-paint .zone-card {
    animation: zone-in 0.4s ease both;
}

.sprinkler-zones.is-first-paint .zone-card:nth-child(1) { animation-delay: 0.02s; }
.sprinkler-zones.is-first-paint .zone-card:nth-child(2) { animation-delay: 0.06s; }
.sprinkler-zones.is-first-paint .zone-card:nth-child(3) { animation-delay: 0.1s; }
.sprinkler-zones.is-first-paint .zone-card:nth-child(4) { animation-delay: 0.14s; }

@keyframes zone-in {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.zone-card.has-photo {
    background-size: cover;
    background-position: center;
}

.zone-card.has-photo::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, 0.55) 100%);
    pointer-events: none;
}

.zone-card.is-empty {
    display: flex;
    flex-direction: column;
    padding: 10px;
}

.zone-faucet {
    width: 24px;
    height: 24px;
    color: #94a3b8;
}

.zone-edit-btn,
.zone-settings-btn,
.zone-program-btn {
    position: absolute;
    top: 6px;
    z-index: 3;
    width: 28px;
    height: 28px;
    border-radius: 9999px;
    border: none;
    background: rgba(15, 23, 42, 0.45);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.zone-edit-btn {
    right: 6px;
}

.zone-settings-btn {
    left: 6px;
}

.zone-program-btn {
    left: 50%;
    transform: translateX(-50%);
}

.zone-edit-btn:active,
.zone-settings-btn:active {
    transform: scale(0.94);
    background: rgba(15, 23, 42, 0.62);
}

.zone-program-btn:active {
    transform: translateX(-50%) scale(0.94);
    background: rgba(15, 23, 42, 0.62);
}

.zone-hit {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 52px;
    z-index: 1;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0;
}

.zone-footer {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 8px 10px 10px;
    pointer-events: auto;
    background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.35) 30%);
}

.zone-footer .zone-toggle {
    pointer-events: auto;
    position: relative;
    z-index: 5;
    touch-action: manipulation;
}

.zone-labels {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.zone-station {
    font-size: 10px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.zone-countdown {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 6px;
    margin-top: 3px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
}

.zone-countdown.is-idle:empty {
    display: none;
}

.zone-run-source {
    font-size: 10px;
    font-weight: 900;
    border-radius: 9999px;
    padding: 1px 7px;
    line-height: 1.35;
    letter-spacing: 0.01em;
}

.zone-run-source.is-manual {
    background: rgba(14, 165, 233, 0.95);
    color: #fff;
}

.zone-run-source.is-queued {
    background: rgba(103, 232, 249, 0.95);
    color: #083344;
}

.zone-run-source.is-program {
    background: rgba(34, 197, 94, 0.95);
    color: #fff;
}

.zone-run-source.is-runonce {
    background: rgba(249, 115, 22, 0.95);
    color: #fff;
}

.zone-run-source.is-unknown {
    background: rgba(148, 163, 184, 0.95);
    color: #fff;
}

.zone-run-remain {
    font-size: 13px;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    color: #fef08a;
    letter-spacing: 0.02em;
}

.zone-card.is-empty .zone-station {
    color: #94a3b8;
    text-shadow: none;
}

.zone-card.is-empty .zone-run-remain {
    color: #0369a1;
    text-shadow: none;
}

.zone-card.is-empty .zone-footer {
    position: absolute;
}

.zone-name {
    font-size: 0.78rem;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
    line-height: 1.15;
}

.zone-card.is-empty .zone-name {
    color: #64748b;
    text-shadow: none;
}

.zone-toggle {
    flex-shrink: 0;
    width: 42px;
    height: 24px;
    border-radius: 9999px;
    border: none;
    background: #cbd5e1;
    position: relative;
    cursor: pointer;
    transition: background 0.18s ease;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.zone-toggle::after {
    content: '';
    position: absolute;
    top: 2.5px;
    inset-inline-start: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
    transition: inset-inline-start 0.18s ease, transform 0.18s ease;
}

.zone-toggle.is-on {
    background: #2f80ed;
}

.zone-toggle.is-on::after {
    inset-inline-start: 20px;
}

.zone-toggle:active::after {
    transform: scale(0.92);
}

.zone-card.is-running .zone-toggle.is-on {
    box-shadow: 0 0 0 3px rgba(47, 128, 237, 0.35);
}

.sprinkler-history-card {
    background: #fff;
    border-radius: 18px;
    padding: 18px 16px;
    box-shadow: 0 8px 20px rgba(8, 40, 80, 0.12);
}

.programs-shell {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.programs-cal-card,
.programs-day-card,
.program-card {
    background: #fff;
    border-radius: 18px;
    padding: 12px 14px 10px;
    box-shadow: 0 8px 20px rgba(8, 40, 80, 0.12);
}

button.program-card {
    border: none;
    width: 100%;
    text-align: inherit;
    cursor: pointer;
    font: inherit;
    color: inherit;
    display: block;
}

button.program-card.is-off {
    opacity: 0.72;
    background: #f3f5f7;
}

.cal-view-toggle {
    display: flex;
    gap: 4px;
    background: #eef5fc;
    border-radius: 12px;
    padding: 3px;
    margin-bottom: 10px;
}

.cal-view-btn {
    flex: 1;
    border: none;
    background: transparent;
    border-radius: 10px;
    padding: 7px 8px;
    font-size: 12px;
    font-weight: 800;
    color: #5f738a;
    cursor: pointer;
}

.cal-view-btn.is-active {
    background: #fff;
    color: #0a6bc4;
    box-shadow: 0 1px 4px rgba(8, 40, 80, 0.12);
}

.cal-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 10px;
}

.cal-month-label {
    margin: 0;
    font-size: 15px;
    font-weight: 800;
    color: #1e3a5f;
    text-align: center;
    flex: 1;
    min-width: 0;
}

.cal-today-btn {
    flex-shrink: 0;
    border: none;
    border-radius: 10px;
    padding: 7px 11px;
    background: #0a6bc4;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    font-family: inherit;
    cursor: pointer;
    line-height: 1;
}

.cal-today-btn:active {
    transform: scale(0.96);
}

.cal-nav-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 12px;
    background: #eef5fc;
    color: #0a6bc4;
    font-size: 22px;
    line-height: 1;
    font-weight: 700;
    cursor: pointer;
}

.cal-nav-btn:active {
    transform: scale(0.96);
}

.cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 4px;
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    color: #7a8fa8;
}

.cal-weekdays.is-hidden {
    display: none;
}

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
}

.cal-grid.is-week {
    gap: 6px;
}

.cal-cell {
    aspect-ratio: 1;
    border: none;
    border-radius: 12px;
    background: transparent;
    padding: 2px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    cursor: pointer;
    color: #1e3a5f;
    font-size: 13px;
    font-weight: 600;
    min-height: 42px;
}

.cal-grid.is-week .cal-cell {
    aspect-ratio: auto;
    min-height: 64px;
    padding: 8px 4px 6px;
    background: #f5f9fd;
    gap: 4px;
}

.cal-cell-dow {
    font-size: 10px;
    font-weight: 700;
    color: #7a8fa8;
    line-height: 1;
}

.cal-cell-num {
    font-size: 16px;
    font-weight: 800;
    line-height: 1;
}

.cal-cell.is-muted {
    color: #b7c4d4;
    cursor: default;
}

.cal-cell.is-today {
    background: #e8f3ff;
}

.cal-grid.is-week .cal-cell.is-today {
    background: #e8f3ff;
    box-shadow: inset 0 0 0 1.5px #7eb6e8;
}

.cal-cell.is-selected {
    background: #0a6bc4;
    color: #fff;
}

/* שבוע: רקע תא חזק יותר מ־is-selected הכללי — חייבים לדרוס במפורש */
.cal-grid.is-week .cal-cell.is-selected {
    background: #0a6bc4;
    color: #fff;
    box-shadow: none;
}

.cal-grid.is-week .cal-cell.is-selected .cal-cell-dow,
.cal-cell.is-selected .cal-cell-dow {
    color: rgba(255, 255, 255, 0.85);
}

.cal-grid.is-week .cal-cell.is-selected .cal-cell-num {
    color: #fff;
}

.cal-cell.is-selected .cal-dot {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.55);
}

.cal-dots {
    position: relative;
    display: flex;
    gap: 2px;
    height: 6px;
    min-height: 6px;
    max-height: 6px;
    justify-content: center;
    align-items: flex-start;
    flex-wrap: nowrap;
    max-width: 100%;
    overflow: visible;
}

.cal-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    flex-shrink: 0;
}

.cal-dot.is-off {
    opacity: 0.55;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.9);
}

/* קו «בוצע בפועל» — מעט מתחת לנקודות, רחב יותר, בלי להגדיל את התא */
.cal-dots.has-actual::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: -4px;
    width: 18px;
    height: 2px;
    border-radius: 1px;
    background: #059669;
    pointer-events: none;
}

.cal-cell.is-selected .cal-dots.has-actual::after {
    background: #a7f3d0;
}

.day-section {
    margin-top: 12px;
}

.day-section:first-child {
    margin-top: 0;
}

.day-section-title {
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 800;
    color: #1e3a5f;
    letter-spacing: 0.01em;
}

.day-plan-tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.02em;
    line-height: 1.2;
}

.day-plan-tag.is-planned {
    background: #ffedd5;
    color: #c2410c;
    box-shadow: inset 0 0 0 1px rgba(194, 65, 12, 0.2);
}

.day-plan-tag.is-done {
    background: #d1fae5;
    color: #047857;
    box-shadow: inset 0 0 0 1px rgba(4, 120, 87, 0.18);
}

.day-plan-tag.is-fail {
    background: #fee2e2;
    color: #b91c1c;
    box-shadow: inset 0 0 0 1px rgba(185, 28, 28, 0.2);
}

.day-section-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    border: none;
    background: transparent;
    padding: 0;
    margin: 0 0 8px;
    cursor: pointer;
    font: inherit;
    color: inherit;
    text-align: inherit;
}

.day-section-toggle .day-section-title {
    margin: 0;
}

.day-section-chevron {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 800;
    color: #64748b;
    line-height: 1;
}

.day-history-body.is-collapsed,
.day-history-body[hidden] {
    display: none;
}

.day-filter-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px 0 4px;
}

.day-filter-row label {
    font-size: 12px;
    font-weight: 700;
    color: #5a6f88;
    white-space: nowrap;
}

.day-filter-select {
    flex: 1;
    min-width: 0;
    border: 1px solid #d5e3f2;
    border-radius: 10px;
    padding: 7px 10px;
    font-size: 13px;
    font-family: inherit;
    background: #f7fbff;
    color: #1e3a5f;
}

.log-run-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.log-run-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 12px;
    background: #f4f8fc;
}

.log-run-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.log-run-name {
    font-size: 13px;
    font-weight: 800;
    color: #1e3a5f;
}

.log-run-meta {
    font-size: 11px;
    color: #6b7c90;
    font-weight: 600;
}

.log-run-dur {
    font-size: 12px;
    font-weight: 800;
    color: #0a6bc4;
    white-space: nowrap;
    direction: ltr;
}

.log-src {
    display: inline-block;
    font-size: 10px;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 999px;
    margin-inline-start: 4px;
    vertical-align: middle;
}

.log-src.is-manual {
    background: #fef3c7;
    color: #92400e;
}

.log-src.is-runonce {
    background: #ede9fe;
    color: #5b21b6;
}

.log-src.is-program {
    background: #dbeafe;
    color: #1d4ed8;
}

.compare-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.compare-table th,
.compare-table td {
    padding: 7px 6px;
    text-align: right;
    border-bottom: 1px solid #e8eef6;
}

.compare-table th {
    font-weight: 800;
    color: #5a6f88;
    font-size: 11px;
}

.compare-table td {
    color: #1e3a5f;
    font-weight: 600;
}

.compare-table .cmp-num {
    direction: ltr;
    text-align: left;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.compare-table .is-match {
    color: #047857;
}

.compare-table .is-short {
    color: #b45309;
}

.compare-table .is-extra {
    color: #1d4ed8;
}

.compare-table .is-miss {
    color: #b91c1c;
}

.compare-hint {
    margin: 6px 0 0;
    font-size: 11px;
    color: #8a9bb0;
}

.programs-status {
    margin: 10px 0 0;
    font-size: 12px;
    color: #6b7c90;
    text-align: center;
    min-height: 1.2em;
}

.programs-status.is-error {
    color: #c0392b;
    font-weight: 600;
}

.programs-day-title {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 800;
    color: #1e3a5f;
}

.programs-day-events {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 28px;
}

.programs-empty {
    font-size: 13px;
    color: #8a9bb0;
    margin: 0;
}

.tl-axis {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    font-weight: 700;
    color: #8a9bb0;
    margin: 0 0 4px;
    padding: 0 2px;
    direction: ltr;
}

.tl-track {
    position: relative;
    height: auto;
    min-height: 20px;
    background: linear-gradient(90deg, rgba(10, 107, 196, 0.06), rgba(10, 107, 196, 0.02));
    border-radius: 8px;
    overflow: hidden;
    direction: ltr;
}

.tl-now {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    margin-left: -1px;
    background: #ef4444;
    z-index: 5;
    pointer-events: none;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.55);
}

.tl-now-dot {
    position: absolute;
    top: -3px;
    left: 50%;
    width: 8px;
    height: 8px;
    margin-left: -4px;
    border-radius: 50%;
    background: #ef4444;
    border: 1.5px solid #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.tl-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tl-station {
    border-radius: 12px;
    background: #f5f9fd;
    padding: 8px 10px;
    border: none;
    width: 100%;
    text-align: inherit;
    cursor: pointer;
    display: block;
    font: inherit;
    color: inherit;
}

.tl-station.is-off {
    opacity: 0.72;
    background: #eef1f4;
}

.tl-station-meta.is-off {
    color: #9aa8b8;
}

.tl-bar.is-off {
    opacity: 0.75;
}

.tl-item {
    display: flex;
    gap: 6px;
    align-items: center;
    font-size: 10px;
    color: #5f738a;
    line-height: 1.3;
    border: none;
    background: transparent;
    padding: 0;
    width: 100%;
    text-align: inherit;
    cursor: pointer;
    font: inherit;
}

.tl-item.is-off {
    opacity: 0.7;
}

.tl-station-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 5px;
    flex-wrap: wrap;
}

.tl-station-name {
    font-size: 12px;
    font-weight: 800;
    color: #1e3a5f;
}

.tl-station-meta {
    font-size: 10px;
    font-weight: 700;
    color: #7a8fa8;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.tl-station-meta.is-overlap {
    color: #c0392b;
}

.tl-lane {
    position: relative;
    height: 20px;
    margin-bottom: 3px;
}

.tl-lane:last-child {
    margin-bottom: 0;
}

.tl-bar {
    position: absolute;
    top: 1px;
    bottom: 1px;
    border-radius: 6px;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    overflow: hidden;
    display: flex;
    align-items: center;
    padding: 0 6px;
    box-sizing: border-box;
    white-space: nowrap;
    transition: background 0.7s ease;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12), 0 1px 2px rgba(8, 40, 80, 0.16);
    direction: ltr;
    text-align: left;
}

.tl-bar.is-past {
    filter: saturate(0.55);
}

.tl-bar.is-active-now {
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.22),
        0 0 0 1px rgba(255, 255, 255, 0.25),
        0 1px 2px rgba(8, 40, 80, 0.16);
}

.tl-bar.is-overlap {
    outline: 1.5px solid #fff;
    box-shadow: 0 0 0 1.5px rgba(192, 57, 43, 0.55), 0 1px 2px rgba(8, 40, 80, 0.16);
}

.tl-bar-label {
    overflow: hidden;
    text-overflow: ellipsis;
}

.tl-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 5px;
}

.tl-item-swatch {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 0;
    flex-shrink: 0;
}

.tl-item-time {
    font-weight: 800;
    color: #1e3a5f;
    direction: ltr;
    unicode-bidi: isolate;
    flex-shrink: 0;
}

.cal-event {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 10px 10px;
    border-radius: 14px;
    background: #f5f9fd;
}

.cal-event-bar {
    width: 4px;
    align-self: stretch;
    border-radius: 4px;
    flex-shrink: 0;
}

.cal-event-body {
    flex: 1;
    min-width: 0;
}

.cal-event-name {
    font-size: 13px;
    font-weight: 800;
    color: #1e3a5f;
}

.cal-event-meta {
    font-size: 11px;
    color: #5f738a;
    margin-top: 2px;
    line-height: 1.45;
}

.cal-event-disabled {
    opacity: 0.55;
}

.programs-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.program-card-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.program-swatch {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.program-card-name {
    font-size: 14px;
    font-weight: 800;
    color: #1e3a5f;
    flex: 1;
    min-width: 0;
    line-height: 1.25;
}

.program-card-orig,
.program-card-dur {
    font-weight: 700;
    color: #7a8a9c;
}

.program-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    background: #e8f6ee;
    color: #1b7a45;
}

.program-badge.is-off {
    background: #f1f3f5;
    color: #7a8694;
}

.program-card-line {
    font-size: 12px;
    color: #5f738a;
    line-height: 1.45;
}

.prog-pick-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 50vh;
    overflow: auto;
}

.prog-pick-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    border: none;
    background: #f5f9fd;
    border-radius: 14px;
    padding: 12px 12px;
    cursor: pointer;
    text-align: right;
    font: inherit;
}

.prog-pick-item.is-off {
    opacity: 0.7;
    background: #eef1f4;
}

.prog-pick-name {
    flex: 1;
    font-size: 14px;
    font-weight: 800;
    color: #1e3a5f;
    text-align: right;
}

.prog-edit-sheet {
    max-height: min(88vh, 720px);
    overflow: auto;
    padding-top: 14px;
}

.prog-interval-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 6px;
}

.zone-edit-input.is-compact {
    padding: 8px 10px;
    font-size: 14px;
    border-radius: 12px;
}

.time-inline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
    background: #f5f9fd;
    border-radius: 12px;
    padding: 8px 10px;
}

.time-inline-unit {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.time-side-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 8px;
    background: #e8f1fa;
    color: #0a6bc4;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.time-side-btn:active {
    transform: scale(0.96);
    background: #d7e8f7;
}

.time-inline-val {
    width: 40px;
    height: 32px;
    border: 1px solid #d5e2ef;
    border-radius: 8px;
    text-align: center;
    font-size: 15px;
    font-weight: 800;
    color: #1e3a5f;
    background: #fff;
    padding: 0;
    -moz-appearance: textfield;
}

.time-inline-val:focus {
    outline: none;
    border-color: #0a6bc4;
    box-shadow: 0 0 0 2px rgba(10, 107, 196, 0.15);
}

.time-inline-val::-webkit-outer-spin-button,
.time-inline-val::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.time-inline-colon {
    font-size: 16px;
    font-weight: 800;
    color: #7a8fa8;
    padding: 0 1px;
}

.time-inline-label {
    font-size: 10px;
    font-weight: 700;
    color: #8a9bb0;
    min-width: 22px;
}

.time-inline.is-duration {
    justify-content: flex-start;
    gap: 4px;
    padding: 6px 8px;
}

.time-inline.is-duration .time-inline-val {
    width: 34px;
    height: 28px;
    font-size: 13px;
}

.time-inline.is-duration .time-side-btn {
    width: 24px;
    height: 24px;
    font-size: 14px;
    border-radius: 7px;
}

.prog-edit-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 4px;
}

.prog-enable-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 800;
    color: #1b7a45;
    cursor: pointer;
    user-select: none;
    position: relative;
    border: none;
    background: transparent;
    padding: 4px 2px;
    font-family: inherit;
}

.prog-enable-btn.is-off {
    color: #8a9bb0;
}

.prog-enable-btn:disabled {
    opacity: 0.6;
    cursor: wait;
}

.prog-enable-input {
    display: none !important;
}

.prog-enable-switch {
    width: 42px;
    height: 24px;
    border-radius: 999px;
    background: #c5cdd6;
    position: relative;
    transition: background 0.15s ease;
    flex-shrink: 0;
    pointer-events: none;
}

.prog-enable-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    inset-inline-start: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: inset-inline-start 0.15s ease;
}

.prog-enable-btn.is-on .prog-enable-switch {
    background: #16a34a;
}

.prog-enable-btn.is-on .prog-enable-switch::after {
    inset-inline-start: 21px;
}

.prog-weekdays {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.prog-wd {
    min-width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #eef5fc;
    color: #5f738a;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.prog-wd.is-on {
    background: #0a6bc4;
    color: #fff;
}

.prog-durations {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.prog-dur-row {
    background: #f5f9fd;
    border-radius: 12px;
    padding: 8px;
}

.prog-dur-name {
    font-size: 11px;
    font-weight: 800;
    color: #1e3a5f;
    margin-bottom: 6px;
}

.dur-time-grid {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 4px;
}

.dur-stepper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 52px;
}

.dur-arrow {
    width: 36px;
    height: 22px;
    border: none;
    border-radius: 7px;
    background: #e8f1fa;
    color: #0a6bc4;
    font-size: 10px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.dur-arrow:active {
    transform: scale(0.96);
    background: #d7e8f7;
}

.dur-val {
    width: 40px;
    height: 30px;
    border: 1px solid #d5e2ef;
    border-radius: 8px;
    text-align: center;
    font-size: 15px;
    font-weight: 800;
    color: #1e3a5f;
    background: #fff;
    padding: 0;
    -moz-appearance: textfield;
}

.dur-val:focus {
    outline: none;
    border-color: #0a6bc4;
    box-shadow: 0 0 0 2px rgba(10, 107, 196, 0.15);
}

.dur-val::-webkit-outer-spin-button,
.dur-val::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.dur-colon {
    font-size: 15px;
    font-weight: 800;
    color: #7a8fa8;
    padding-top: 26px;
}

.dur-label {
    font-size: 10px;
    font-weight: 700;
    color: #8a9bb0;
    margin-top: 1px;
}

.sprinkler-subnav {
    position: fixed;
    left: 0;
    right: 0;
    /* צמוד מעל שורת המחשבונים; עולה מעל באנר ברזים כשהוא פעיל */
    bottom: calc(var(--app-bottom-nav-h, 52px) + var(--live-run-h, 0px));
    z-index: 19;
    pointer-events: none;
    transition: bottom 0.35s ease;
}

.sprinkler-subnav-inner {
    max-width: 430px;
    margin: 0 auto;
    pointer-events: auto;
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 6px 12px 4px;
    background: #0a6bc4;
    box-shadow: 0 -1px 0 rgba(255, 255, 255, 0.12) inset;
}

.history-day-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.history-day-title {
    flex: 1;
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    color: #0f2744;
    text-align: center;
    line-height: 1.3;
}

.history-day-body {
    min-height: 120px;
}

.sprinkler-subnav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.55);
    font-size: 11px;
    font-weight: 700;
    font-family: inherit;
    padding: 4px 10px;
    cursor: pointer;
    transition: color 0.15s ease, transform 0.15s ease;
}

.sprinkler-subnav-btn.is-active {
    color: #fff;
}

.sprinkler-subnav-btn:active {
    transform: scale(0.96);
}

/* Edit modal — מעל באנר חי (z=45) וניווט תחתון */
.zone-edit-modal {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.zone-edit-modal.is-centered {
    align-items: center;
    padding: 16px;
}

.zone-edit-modal.hidden {
    display: none;
}

.zone-edit-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
}

.zone-edit-sheet {
    position: relative;
    width: 100%;
    max-width: 430px;
    background: #fff;
    border-radius: 20px 20px 0 0;
    padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.18);
    animation: sheet-up 0.22s ease;
}

.zone-edit-sheet.is-centered-sheet {
    border-radius: 20px;
    padding: 20px 18px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
    animation: sheet-pop 0.2s ease;
    max-width: 360px;
}

@keyframes sheet-pop {
    from { transform: scale(0.94); opacity: 0.5; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes sheet-up {
    from { transform: translateY(24px); opacity: 0.6; }
    to { transform: translateY(0); opacity: 1; }
}

.zone-edit-input {
    width: 100%;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: inherit;
    color: #0f172a;
}

.zone-edit-input:focus {
    outline: none;
    border-color: #38bdf8;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25);
}

.zone-edit-input[dir="ltr"] {
    text-align: left;
    direction: ltr;
    unicode-bidi: isolate;
}

.zone-edit-photo-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.zone-edit-preview {
    width: 72px;
    height: 44px;
    border-radius: 10px;
    background: #e2e8f0 center/cover no-repeat;
    flex-shrink: 0;
    border: 1px solid #cbd5e1;
}

.zone-edit-file-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 10px;
    background: #eff6ff;
    color: #0369a1;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

/* Login — רק בתוך מסך OpenSprinkler, מעל התוכן ומתחת לניווט האפליקציה */
.login-gate {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: calc(62px + 8px + env(safe-area-inset-bottom, 0px));
    z-index: 25;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 16px 14px 20px;
    overflow-y: auto;
    background: linear-gradient(165deg, #1a9fff 0%, #0a6bc4 100%);
}

.login-gate.hidden {
    display: none;
}

.login-card {
    width: 100%;
    max-width: 380px;
    margin-top: 8px;
    background: #fff;
    border-radius: 20px;
    padding: 22px 18px;
    box-shadow: 0 16px 40px rgba(8, 40, 80, 0.25);
}

.login-logo {
    height: 36px;
    width: auto;
    display: block;
    margin: 0 auto 12px;
}

.sprinkler-conn-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 4px;
    padding: 0 2px;
}

.conn-badge {
    font-size: 11px;
    font-weight: 800;
    color: #fff;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 9999px;
    padding: 4px 10px;
    max-width: 75%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conn-badge.is-on {
    background: rgba(22, 163, 74, 0.85);
}

.conn-badge.is-off {
    background: rgba(0, 0, 0, 0.25);
}

.conn-logout {
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    font-family: inherit;
    border-radius: 9999px;
    padding: 4px 10px;
    cursor: pointer;
}

.run-time-grid {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 4px;
    direction: ltr;
}

.run-stepper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 64px;
}

.run-arrow {
    width: 48px;
    height: 40px;
    border-radius: 12px;
    border: 2px solid #0284c7;
    background: #e0f2fe;
    color: #0369a1;
    font-size: 18px;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 0 #0284c7;
    -webkit-tap-highlight-color: transparent;
}

.run-arrow:active {
    transform: translateY(1px);
    box-shadow: none;
    background: #bae6fd;
}

.run-value {
    width: 56px;
    text-align: center;
    font-size: 1.65rem;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    font-family: inherit;
    color: #0f172a;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 6px 2px;
    line-height: 1.1;
    direction: ltr;
    -moz-appearance: textfield;
}

.run-value:focus {
    outline: none;
    border-color: #38bdf8;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25);
    background: #fff;
}

.run-value::-webkit-outer-spin-button,
.run-value::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.run-unit-label {
    font-size: 11px;
    font-weight: 800;
    color: #64748b;
}

.run-colon {
    font-size: 1.6rem;
    font-weight: 900;
    color: #94a3b8;
    padding-bottom: 18px;
}

.action-toast {
    margin-top: 10px;
    background: rgba(255, 255, 255, 0.95);
    color: #0f172a;
    font-size: 12px;
    font-weight: 800;
    text-align: center;
    border-radius: 12px;
    padding: 8px 10px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.action-toast.is-error {
    color: #b91c1c;
    background: #fef2f2;
}
