/* index.css — v1.23.30 */

/* ניווט תחתון — צמוד יותר לתחתית המסך (~חצי מהריווח הקודם) */
.app-bottom-nav {
    padding-bottom: calc(2px + env(safe-area-inset-bottom, 0px));
    background: #fff;
}

.app-bottom-nav .mobile-container {
    padding-top: 4px;
    padding-bottom: 4px;
}

.app-bottom-nav a,
.app-bottom-nav span {
    min-height: 40px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    font-size: 12px !important;
    line-height: 1.2 !important;
    padding-top: 6px !important;
    padding-bottom: 6px !important;
}

.mobile-container.has-bottom-nav {
    padding-bottom: calc(4.1rem + var(--live-run-h, 0px) + env(safe-area-inset-bottom, 0px));
}
body {
    font-family: 'Heebo', sans-serif;
    background-color: #e5e7eb;
}

.mobile-container {
    max-width: 430px;
    margin: 0 auto;
    background-color: #f8fafc;
    min-height: 100vh;
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow-x: hidden;
}

.hide-scrollbar::-webkit-scrollbar {
    display: none;
}

.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.fruit-icon {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.rec-below {
    border-color: #f87171 !important;
    background: rgba(127, 29, 29, 0.35) !important;
    color: #fecaca !important;
}

.rec-ok {
    border-color: rgba(255, 255, 255, 0.2);
}

.version-badge {
    font-size: 10px;
    opacity: 0.85;
    letter-spacing: 0.02em;
}

nav .mobile-container {
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
}

.header-top {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    column-gap: 8px;
}

.header-top-start {
    justify-self: stretch;
}

.header-top-end {
    justify-self: end;
}

.refresh-btn {
    width: 36px;
    height: 36px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    justify-self: center;
    backdrop-filter: blur(4px);
    transition: background 0.15s, transform 0.15s;
}

.refresh-btn:active {
    background: rgba(255, 255, 255, 0.35);
    transform: scale(0.96);
}

.refresh-btn.is-spinning .refresh-icon {
    animation: refresh-spin 0.7s linear;
}

/* מזג אוויר בכותרת — אייקון+מעלות, מצב שמים מתחת בגודל בולט */
.header-weather-chip {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    border-radius: 10px;
    padding: 6px 10px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    shrink: 0;
    min-width: 0;
}

.header-weather-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-weather-icon {
    font-size: 1.15rem;
    line-height: 1;
}

.header-weather-temp {
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    opacity: 0.95;
    font-variant-numeric: tabular-nums;
}

.header-weather-sky {
    font-size: 14px;
    font-weight: 800;
    line-height: 1.15;
    white-space: nowrap;
}

@keyframes refresh-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(-360deg); }
}

/* מתג קיזוז דשא — ממורכז באמצע שורת הכרטיס */
.tree-card-head {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    column-gap: 6px;
}

.tree-card-head-side {
    min-width: 0;
}

.tree-card-head-start {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-self: stretch;
}

.tree-card-title-block {
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-height: 40px;
    line-height: 1.15;
}

.tree-card-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1f2937;
}

.tree-card-age {
    font-size: 0.65rem;
    font-weight: 600;
    color: #6b7280;
    margin-top: 1px;
}

.tree-card-head-end {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-self: stretch;
    text-align: left;
}

.lawn-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 2px 4px;
    border: none;
    background: transparent;
    cursor: pointer;
    flex-shrink: 0;
    min-width: 48px;
    line-height: 1;
    justify-self: center;
    -webkit-tap-highlight-color: transparent;
}

.lawn-chip.is-on {
    border: none;
    background: transparent;
}

.lawn-chip .lawn-chip-label {
    font-size: 12px;
    font-weight: 800;
    color: #6b7280;
    white-space: nowrap;
}

.lawn-chip.is-on .lawn-chip-label {
    color: #15803d;
}

/* מתג ברור: מסלול אפור כבוי / ירוק דולק */
.lawn-chip .lawn-switch {
    display: block;
    box-sizing: border-box;
    width: 36px;
    height: 20px;
    border-radius: 9999px;
    background: #d1d5db;
    border: 1.5px solid #9ca3af;
    position: relative;
    transition: background 0.15s ease, border-color 0.15s ease;
    flex-shrink: 0;
}

.lawn-chip .lawn-switch::after {
    content: '';
    position: absolute;
    top: 1.5px;
    inset-inline-start: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid #9ca3af;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    transition: inset-inline-start 0.15s ease, border-color 0.15s ease;
}

.lawn-chip.is-on .lawn-switch {
    background: #22c55e;
    border-color: #16a34a;
}

.lawn-chip.is-on .lawn-switch::after {
    inset-inline-start: 17px;
    border-color: #ffffff;
}

/* ——— באנר «משקה עכשיו» גלובלי (מעל הניווט התחתון) ——— */
:root {
    --app-bottom-nav-h: calc(52px + env(safe-area-inset-bottom, 0px));
    --live-run-h: 0px;
}

body.has-live-run {
    /* fallback עד שמדידת live-banner.js מעדכנת את הגובה האמיתי */
    --live-run-h: 76px;
}

.live-run-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: var(--app-bottom-nav-h);
    z-index: 45;
    pointer-events: none;
    transform: translateY(110%);
    opacity: 0;
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
}

.live-run-banner.is-active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.live-run-banner.is-hidden {
    visibility: hidden;
}

.live-run-banner-link {
    pointer-events: auto;
    display: flex;
    align-items: stretch;
    max-width: 430px;
    margin: 0 auto;
    padding: 6px 6px 7px;
    text-decoration: none;
    color: #ecfdf5;
    position: relative;
    overflow: hidden;
    isolation: isolate;
    cursor: default;
    direction: rtl;
    background:
        radial-gradient(120% 180% at 100% 0%, rgba(167, 243, 208, 0.28) 0%, transparent 55%),
        linear-gradient(125deg, #064e3b 0%, #047857 40%, #059669 72%, #10b981 100%);
    background-size: 100% 100%, 200% 200%;
    animation: live-run-gradient 7s ease-in-out infinite;
    box-shadow:
        0 -8px 28px rgba(4, 120, 87, 0.45),
        0 0 0 1px rgba(167, 243, 208, 0.3) inset,
        0 0 40px rgba(16, 185, 129, 0.22);
}

.live-run-sheen {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        105deg,
        transparent 35%,
        rgba(255, 255, 255, 0.22) 48%,
        transparent 62%
    );
    transform: translateX(-120%);
    animation: live-run-sheen 3.6s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}

.live-run-slots {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: stretch;
    justify-content: flex-start;
    gap: 6px;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

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

.live-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;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 0 0 1px rgba(236, 253, 245, 0.22);
}

.live-run-slots.is-multi .live-run-slot {
    flex: 0 1 auto;
    width: max-content;
    max-width: 36%;
    min-width: 0;
}

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

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

.live-run-icon {
    position: relative;
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    color: #ecfdf5;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.12);
    box-shadow: inset 0 0 0 1.5px rgba(236, 253, 245, 0.45);
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.2));
    order: -1;
}

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

.live-drop {
    transform-origin: 50% 15%;
    animation: live-drop-bob 1.8s ease-in-out infinite;
}

.live-run-icon.is-lawn {
    color: #ecfdf5;
    overflow: visible;
}

/* מזרקה כ־HTML — transform עובד במובייל (בניגוד ל־SVG circle) */
.live-fountain {
    position: relative;
    display: block;
    width: 30px;
    height: 30px;
    overflow: visible;
    flex-shrink: 0;
}

.live-run-icon .live-fountain,
.next-run-icon .live-fountain {
    width: 86%;
    height: 86%;
}

.lf-stem {
    position: absolute;
    left: 50%;
    top: 44%;
    bottom: 14%;
    width: 2.6px;
    margin-left: -1.3px;
    border-radius: 2px;
    background: currentColor;
}

.lf-base {
    position: absolute;
    left: 50%;
    top: 84%;
    width: 42%;
    height: 2.4px;
    margin-left: -21%;
    border-radius: 2px;
    background: currentColor;
}

.lf-head {
    position: absolute;
    left: 50%;
    top: 41.5%;
    width: 28%;
    height: 28%;
    margin: -14% 0 0 -14%;
    border-radius: 50%;
    background: currentColor;
}

.lf-core {
    position: absolute;
    left: 50%;
    top: 31.5%;
    width: 14%;
    height: 14%;
    margin: -7% 0 0 -7%;
    border-radius: 50%;
    background: rgba(236, 253, 245, 0.98);
    animation: live-fountain-core 1.15s ease-in-out infinite;
    will-change: transform, opacity;
}

.lf-dot {
    position: absolute;
    width: 12%;
    height: 12%;
    margin: -6% 0 0 -6%;
    border-radius: 50%;
    background: rgba(236, 253, 245, 0.98);
    box-shadow: 0 0 4px rgba(167, 243, 208, 0.85);
    animation: live-fountain-spray 1.15s ease-in-out infinite;
    will-change: transform, opacity;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.lf-dot.u.r2,
.lf-dot.u.l2,
.lf-dot.d.r2,
.lf-dot.d.l2 { background: rgba(167, 243, 208, 0.98); width: 11%; height: 11%; margin: -5.5% 0 0 -5.5%; }

.lf-dot.u.r3,
.lf-dot.u.l3,
.lf-dot.d.r3,
.lf-dot.d.l3 { width: 10%; height: 10%; margin: -5% 0 0 -5%; background: rgba(236, 253, 245, 0.9); }

.lf-dot.u.r4,
.lf-dot.u.l4,
.lf-dot.d.r4,
.lf-dot.d.l4 { width: 9%; height: 9%; margin: -4.5% 0 0 -4.5%; background: rgba(255, 255, 255, 0.85); }

/* שפריץ עליון */
.lf-dot.u.r1 { left: 59.5%; top: 26%; --dx: 2px; --dy: -2px; animation-delay: 0.02s; }
.lf-dot.u.r2 { left: 69%; top: 23.5%; --dx: 3px; --dy: -2px; animation-delay: 0.12s; }
.lf-dot.u.r3 { left: 76.5%; top: 27.5%; --dx: 4px; --dy: -1px; animation-delay: 0.22s; }
.lf-dot.u.r4 { left: 81%; top: 35%; --dx: 4px; --dy: 1px; animation-delay: 0.32s; }
.lf-dot.u.l1 { left: 40.5%; top: 26%; --dx: -2px; --dy: -2px; animation-delay: 0.02s; }
.lf-dot.u.l2 { left: 31%; top: 23.5%; --dx: -3px; --dy: -2px; animation-delay: 0.12s; }
.lf-dot.u.l3 { left: 23.5%; top: 27.5%; --dx: -4px; --dy: -1px; animation-delay: 0.22s; }
.lf-dot.u.l4 { left: 19%; top: 35%; --dx: -4px; --dy: 1px; animation-delay: 0.32s; }

/* שפריץ תחתון */
.lf-dot.d.r1 { left: 58.5%; top: 39%; --dx: 2px; --dy: 1px; animation-delay: 0.18s; }
.lf-dot.d.r2 { left: 67.5%; top: 42%; --dx: 3px; --dy: 2px; animation-delay: 0.28s; }
.lf-dot.d.r3 { left: 74.5%; top: 49%; --dx: 4px; --dy: 3px; animation-delay: 0.38s; }
.lf-dot.d.r4 { left: 78%; top: 56.5%; --dx: 4px; --dy: 4px; animation-delay: 0.48s; }
.lf-dot.d.l1 { left: 41.5%; top: 39%; --dx: -2px; --dy: 1px; animation-delay: 0.18s; }
.lf-dot.d.l2 { left: 32.5%; top: 42%; --dx: -3px; --dy: 2px; animation-delay: 0.28s; }
.lf-dot.d.l3 { left: 25.5%; top: 49%; --dx: -4px; --dy: 3px; animation-delay: 0.38s; }
.lf-dot.d.l4 { left: 22%; top: 56.5%; --dx: -4px; --dy: 4px; animation-delay: 0.48s; }

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

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

.live-run-slots[data-count="3"] .live-run-copy,
.live-run-slots[data-count="4"] .live-run-copy {
    max-width: 4.5rem;
}

.live-run-clock {
    display: block;
    font-size: 13px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
    color: #fff;
    line-height: 1.1;
    text-shadow: 0 0 12px rgba(167, 243, 208, 0.55);
    unicode-bidi: isolate;
}

.live-run-clock.is-pulse {
    animation: live-clock-pulse 0.45s ease;
}

.live-run-name {
    display: block;
    font-size: 14px;
    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(0, 40, 20, 0.35);
}

.live-run-meta {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: nowrap;
    margin-top: 1px;
    max-width: 100%;
    overflow: hidden;
}

.live-run-station {
    font-size: 10px;
    font-weight: 700;
    color: rgba(236, 253, 245, 0.9);
    white-space: nowrap;
}

.live-run-src {
    font-size: 9px;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
    color: #ecfdf5;
    white-space: nowrap;
    flex-shrink: 0;
}

.live-run-src.is-manual {
    background: #facc15;
    color: #422006;
}

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

.live-run-src.is-program {
    background: rgba(255, 255, 255, 0.92);
    color: #065f46;
}

.live-run-src.is-runonce {
    background: rgba(167, 139, 250, 0.95);
    color: #2e1065;
}

.live-run-slots.is-multi .live-run-clock {
    font-size: 12px;
}

.live-run-slots.is-multi .live-run-name {
    font-size: 13px;
}

.live-run-slots[data-count="3"] .live-run-clock,
.live-run-slots[data-count="4"] .live-run-clock {
    font-size: 11px;
}

.live-run-slots[data-count="3"] .live-run-name,
.live-run-slots[data-count="4"] .live-run-name {
    font-size: 12px;
}

@keyframes live-run-gradient {
    0%, 100% { background-position: 0% 50%, 0% 50%; }
    50% { background-position: 0% 50%, 100% 50%; }
}

@keyframes live-run-sheen {
    0%, 30% { transform: translateX(-130%); }
    55% { transform: translateX(130%); }
    100% { transform: translateX(130%); }
}

@keyframes live-drop-bob {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(2px) scale(1.06); }
}

@keyframes live-fountain-core {
    0%, 100% { opacity: 0.55; transform: scale(0.85); }
    45% { opacity: 1; transform: scale(1.25); }
}

@keyframes live-fountain-spray {
    0% {
        opacity: 0.2;
        transform: translate(0, 0) scale(0.55);
    }
    35% {
        opacity: 1;
        transform: translate(var(--dx, 0px), var(--dy, 0px)) scale(1.25);
    }
    100% {
        opacity: 0.15;
        transform: translate(0, 0) scale(0.6);
    }
}

@keyframes live-clock-pulse {
    0% { transform: scale(1); }
    40% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .live-run-banner-link,
    .live-run-sheen,
    .live-drop,
    .lf-core,
    .lf-dot,
    .live-run-clock.is-pulse {
        animation: none !important;
    }
}

/* שליחת המלצת דשא למחשב ההשקיה */
.lawn-send-btn {
    display: block;
    padding: 8px 12px;
    border-radius: 10px;
    background: #facc15;
    color: #111827;
    font-size: 13px;
    font-weight: 800;
    border: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.lawn-send-btn:active {
    transform: scale(0.98);
}

.lawn-send-btn.hidden,
.lawn-send-modal.hidden,
.lawn-send-offline.hidden,
.lawn-send-toast.hidden {
    display: none !important;
}

.lawn-send-modal {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

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

.lawn-send-sheet {
    position: relative;
    width: 100%;
    max-width: 360px;
    max-height: min(90vh, 560px);
    overflow: auto;
    background: #fff;
    border-radius: 20px;
    padding: 18px 16px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
}

.lawn-send-input {
    width: 100%;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
}

.lawn-send-input:focus {
    outline: none;
    border-color: #14b8a6;
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.2);
}

.lawn-send-zone {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    cursor: pointer;
}

.lawn-send-zone input {
    width: 18px;
    height: 18px;
    accent-color: #059669;
}

.lawn-send-zone-label {
    flex: 1;
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
}

.lawn-send-zone-meta {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
}

.lawn-send-offline {
    padding: 12px;
    border-radius: 12px;
    background: #fffbeb;
    border: 1px solid #fde68a;
}

.lawn-send-toast {
    position: fixed;
    left: 50%;
    bottom: 88px;
    transform: translateX(-50%);
    z-index: 60;
    max-width: min(90vw, 360px);
    padding: 10px 14px;
    border-radius: 12px;
    background: #0f172a;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.lawn-send-toast.is-error {
    background: #b91c1c;
}
