/* ============================================
   GARDENSYNC // FOOD NOT BOMBS CANTON
   Anarchist-punk aesthetic with emerald/teal
   ============================================ */

:root {
    /* OLED-true blacks */
    --bg-primary: #000000;
    --bg-secondary: #0a0a0a;
    --bg-tertiary: #111111;
    --bg-card: #0d0d0d;
    --bg-elevated: #141414;

    --emerald: #10b981;
    --emerald-dark: #059669;
    --emerald-glow: #34d399;
    --teal: #14b8a6;
    --teal-dark: #0d9488;
    --red-accent: #ef4444;
    --red-muted: #991b1b;
    --amber: #f59e0b;
    --amber-muted: #92400e;

    --text-primary: #e5e5e5;
    --text-secondary: #a3a3a3;
    --text-muted: #525252;
    --text-accent: var(--emerald);

    --border: #1e1e1e;
    --border-accent: #10b98133;
    --bg-dark: #080808;

    --font-display: 'Anton', sans-serif;
    --font-mono: 'Space Mono', monospace;
    --font-body: 'Barlow Condensed', sans-serif;

    --radius: 2px;
    --radius-lg: 4px;
    --radius-sm: 2px;

    /* RGB triplets — for use with rgba(var(--*-rgb), opacity) so accents
       can carry alpha while still respecting the design tokens. /polish
       pass replaced inline rgba literals in stages 2c-2g with these. */
    --emerald-rgb: 16, 185, 129;
    --emerald-glow-rgb: 52, 211, 153;
    --emerald-dark-rgb: 5, 150, 105;
    --amber-rgb: 245, 158, 11;
    --blue-rgb: 96, 165, 250;
    --red-rgb: 239, 68, 68;

    /* Gradients */
    --gradient-emerald: linear-gradient(135deg, #059669, #10b981, #14b8a6);
    --gradient-dark: linear-gradient(180deg, #0a0a0a, #000000);
    --gradient-card: linear-gradient(145deg, #0f0f0f, #0a0a0a);
    --gradient-accent-subtle: linear-gradient(135deg, rgba(var(--emerald-rgb),0.08), rgba(20,184,166,0.04));

    /* Glow presets */
    --glow-emerald-sm: 0 0 8px rgba(var(--emerald-rgb),0.3);
    --glow-emerald-md: 0 0 16px rgba(var(--emerald-rgb),0.25), 0 0 4px rgba(var(--emerald-rgb),0.4);
    --glow-emerald-lg: 0 0 24px rgba(var(--emerald-rgb),0.2), 0 0 8px rgba(var(--emerald-rgb),0.35), 0 0 2px rgba(var(--emerald-rgb),0.5);
}

/* Light theme — outdoor tablet readability */
:root[data-theme="light"] {
    --bg-primary: #f5f2ed;
    --bg-secondary: #ebe7e0;
    --bg-tertiary: #e0dbd3;
    --bg-card: #f0ece5;
    --bg-elevated: #ffffff;
    --bg-dark: #e5e0d8;

    --emerald: #059669;
    --emerald-dark: #047857;
    --emerald-glow: #10b981;
    --teal: #0d9488;
    --teal-dark: #0f766e;

    --text-primary: #1a1a1a;
    --text-secondary: #4a4a4a;
    --text-muted: #8a8a8a;
    --text-accent: var(--emerald);

    --border: #d4cfc7;
    --border-accent: #05966933;

    /* Light-theme RGB triplets — keep our rgba(var(--*-rgb), opacity) calls
       in sync with the light palette so accent washes don't drift. */
    --emerald-rgb: 5, 150, 105;
    --emerald-glow-rgb: 16, 185, 129;
    --emerald-dark-rgb: 4, 120, 87;
    /* amber/blue/red kept the same hue across themes — they're functional
       (warning/info/error) not branded. */
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { font-size: 16px; }

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Scrollbar - OLED-friendly thin rails */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #1a1a1a; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--emerald-dark); }
* { scrollbar-width: thin; scrollbar-color: #1a1a1a transparent; }

/* ---- HEADER ---- */
#main-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    background: var(--bg-secondary);
    border-bottom: 2px solid var(--emerald);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.fist-icon {
    width: 42px;
    height: 42px;
    color: var(--emerald);
}

.logo-text h1 {
    font-family: var(--font-display);
    /* Shrunk from 1.8rem — header brand should be a marker, not the loudest
       thing on the page. Functional labels (tool buttons, bed labels, stats)
       need the breathing room more than the wordmark does. */
    font-size: 1.15rem;
    letter-spacing: 2.5px;
    line-height: 1;
    color: var(--text-primary);
}
.logo-text h1 .accent { color: var(--emerald); }
.logo-text .tagline {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-muted);
    letter-spacing: 2px;
    margin-top: 2px;
}

.header-nav {
    display: flex;
    gap: 2px;
}

.nav-btn {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 0.5rem 1rem;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
}
.nav-btn:hover {
    color: var(--emerald);
    border-color: var(--border);
}
.nav-btn.active {
    color: var(--emerald-glow);
    border-color: var(--emerald);
    background: linear-gradient(180deg, rgba(var(--emerald-rgb),0.12), var(--bg-tertiary));
    box-shadow: 0 2px 0 var(--emerald), var(--glow-emerald-md);
    text-shadow: 0 0 12px rgba(var(--emerald-rgb),0.5);
}

.zone-badge {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.4rem 0.75rem;
    border: 2px solid var(--emerald);
    color: var(--emerald);
    letter-spacing: 2px;
    position: relative;
}
.zone-badge::before {
    content: '';
    position: absolute;
    top: -4px; left: -4px;
    right: -4px; bottom: -4px;
    border: 1px dashed var(--emerald-dark);
}

/* ---- TICKER BANNER ---- */
.ticker-banner {
    background: var(--red-accent);
    overflow: hidden;
    padding: 0.35rem 0;
    border-bottom: 1px solid var(--red-muted);
}
.ticker-content {
    display: flex;
    gap: 2rem;
    animation: ticker-scroll 30s linear infinite;
    white-space: nowrap;
    font-family: var(--font-display);
    font-size: 0.8rem;
    letter-spacing: 3px;
    color: #fff;
    text-transform: uppercase;
}
.ticker-sep { color: #fbbf24; }
@keyframes ticker-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ---- TAB CONTENT ---- */
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ---- COMMON UI ---- */
.section-title {
    font-family: var(--font-display);
    font-size: 1.4rem;
    letter-spacing: 2px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.title-icon { font-size: 1.2rem; }
.subsection-title {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 2px;
    color: var(--text-muted);
    margin: 1rem 0 0.5rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px dashed var(--border);
}
.section-intro {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    max-width: 800px;
    line-height: 1.5;
}
.muted-text { color: var(--text-muted); font-style: italic; font-size: 0.85rem; }
.helper-text { color: var(--text-muted); font-size: 0.8rem; text-align: center; margin-top: 0.5rem; }

.search-input, .text-input, .select-input {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 0.5rem 0.75rem;
    width: 100%;
    border-radius: var(--radius);
}
.search-input:focus, .text-input:focus, .select-input:focus {
    outline: none;
    border-color: var(--emerald);
    box-shadow: 0 0 0 1px var(--emerald-dark);
}
.select-input { cursor: pointer; }
.select-input option { background: var(--bg-primary); }

.tool-btn {
    font-family: var(--font-mono);
    /* Bumped from 0.7rem — tool labels were sub-10px on most viewports. */
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 0.25rem 0.5rem;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.15s;
    text-transform: uppercase;
}
.tool-btn:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border-color: var(--text-muted);
}
.tool-btn.accent {
    border-color: var(--emerald);
    color: var(--emerald);
}
.tool-btn.accent:hover {
    background: var(--emerald-dark);
    color: #fff;
}
.tool-btn.danger {
    border-color: var(--red-muted);
    color: var(--red-accent);
}
.tool-btn.danger:hover {
    background: var(--red-muted);
    color: #fff;
}
.large-btn {
    padding: 0.75rem 2rem;
    font-size: 0.85rem;
}

.close-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.3rem;
    cursor: pointer;
}
.close-btn:hover { color: var(--text-primary); }

.hidden { display: none !important; }

/* ---- FILTER BTNS ---- */
.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    margin: 0.5rem 0;
    align-items: center;
}
.filter-btn {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 0.3rem 0.6rem;
    background: var(--bg-primary);
    color: var(--text-muted);
    border: 1px solid var(--border);
    cursor: pointer;
    flex: 1;
    text-align: center;
    transition: all 0.15s ease;
}
.filter-btn:hover { color: var(--text-secondary); border-color: var(--text-muted); }
.filter-btn.active {
    background: var(--bg-tertiary);
    color: var(--emerald);
    border-color: var(--emerald);
}

/* ==========================
   BED PLANNER LAYOUT
   ========================== */
/* Planner tab: flex column so today-dashboard + planner-layout share vertical space */
#tab-planner.active {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 120px);
    overflow: hidden;
}
.today-dashboard {
    flex-shrink: 0; /* don't shrink the tasks bar */
}
.planner-layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr) 260px;
    gap: 0;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* Plant Palette */
.plant-palette {
    position: relative;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    padding: 1rem;
    overflow-y: auto;
}
.plant-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 0.5rem;
    max-height: calc(100vh - 340px);
    overflow-y: auto;
}
.plant-item {
    display: flex;
    /* Wrap so the badges drop to a second line in a narrow palette instead of
       squeezing the plant name (flex-basis 0) down to zero width. */
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem 0.5rem;
    padding: 0.5rem 0.6rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-left: 3px solid var(--emerald);
    cursor: grab;
    transition: all 0.15s;
    font-size: 0.85rem;
}
.plant-item:hover {
    border-color: var(--emerald);
    background: var(--bg-elevated);
}
.plant-item:active { cursor: grabbing; }
.plant-item .plant-emoji { font-size: 1.1rem; }
.plant-item .plant-name {
    font-weight: 600;
    /* basis auto + a floor, so the name keeps its width and the badges wrap */
    flex: 1 1 auto;
    min-width: 5.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.plant-item .plant-type-badge {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    padding: 0.15rem 0.35rem;
    background: var(--bg-primary);
    color: var(--text-muted);
    letter-spacing: 1px;
    border-radius: var(--radius);
    flex-shrink: 0;
}
/* Chevron always trails at the far right of whichever line it lands on. */
.plant-item .plant-expand-icon { margin-left: auto; }
.plant-item[data-type="vegetable"] { border-left-color: var(--emerald); }
.plant-item[data-type="fruit"] { border-left-color: #f59e0b; }
.plant-item[data-type="herb"] { border-left-color: var(--teal); }
.plant-item[data-type="flower"] { border-left-color: #ec4899; }

/* Plant expand icon */
.plant-expand-icon {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-left: 0.25rem;
    transition: transform 0.2s;
}
/* Plant expand panel (inline detail) */
.plant-expand-panel {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-top: none;
    padding: 0.6rem 0.75rem;
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--text-secondary);
}
.pex-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.5rem;
}
.pex-stat {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    padding: 0.15rem 0.4rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.pex-stat.pex-easy { color: var(--emerald); border-color: var(--emerald-dark); }
.pex-note {
    margin: 0.35rem 0;
    color: var(--text-secondary);
    font-size: 0.75rem;
}
.pex-note strong {
    color: var(--text-primary);
    font-size: 0.75rem;
    letter-spacing: 1px;
    font-family: var(--font-mono);
}
.pex-schedule {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin: 0.4rem 0;
}
.pex-sched-item {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    background: rgba(var(--emerald-rgb),0.08);
    border: 1px solid var(--emerald-dark);
    color: var(--emerald);
    letter-spacing: 0.5px;
}
.pex-relations {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin-top: 0.35rem;
    font-size: 0.7rem;
}
.pex-companions { color: var(--emerald); }
.pex-enemies { color: var(--red-accent); }
.pex-companions strong, .pex-enemies strong { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 1px; }

/* Sort row */
.sort-row {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0.25rem 0 0.5rem;
}
.sort-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-muted);
    letter-spacing: 1px;
    white-space: nowrap;
}
.sort-select {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 0.2rem 0.4rem;
    cursor: pointer;
    flex: 1;
}
.sort-select:focus {
    outline: none;
    border-color: var(--emerald);
}

/* Search highlight */
.search-match {
    background: rgba(var(--emerald-rgb),0.25);
    color: var(--emerald-glow);
    border-radius: 1px;
    padding: 0 1px;
}

/* Plant hover card (tooltip preview) */
.plant-hover-card {
    position: fixed;
    z-index: 10001;
    background: var(--bg-secondary);
    border: 1px solid var(--emerald-dark);
    padding: 0.6rem 0.8rem;
    min-width: 180px;
    max-width: 220px;
    pointer-events: none;
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
    opacity: 0;
    transition: opacity 0.15s ease;
}
.plant-hover-card.visible { opacity: 1; }
.plant-hover-card .hover-title {
    font-family: var(--font-display);
    font-size: 0.9rem;
    letter-spacing: 1px;
    margin-bottom: 0.3rem;
}
.plant-hover-card .hover-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px 8px;
}
.plant-hover-card .hover-stat {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}
.plant-hover-card .hover-stat span {
    color: var(--emerald);
    font-weight: 700;
}
.plant-hover-card .hover-companions {
    font-family: var(--font-mono);
    font-size: 0.5rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
    border-top: 1px dotted var(--border);
    padding-top: 0.3rem;
    letter-spacing: 0.5px;
}

/* In-season badge on plant palette items */
.season-badge {
    font-family: var(--font-mono);
    font-size: 0.45rem;
    letter-spacing: 0.5px;
    padding: 0.1rem 0.3rem;
    border-radius: var(--radius);
    white-space: nowrap;
    flex-shrink: 0;
    font-weight: 700;
}
.season-badge.in-season {
    background: rgba(var(--emerald-rgb),0.2);
    color: var(--emerald);
    border: 1px solid rgba(var(--emerald-rgb),0.3);
}
.season-badge.upcoming {
    background: rgba(var(--amber-rgb),0.15);
    color: var(--amber);
    border: 1px solid rgba(var(--amber-rgb),0.2);
}
.season-badge.off-season {
    background: rgba(82,82,82,0.15);
    color: var(--text-muted);
    border: 1px solid rgba(82,82,82,0.2);
}

.palette-footer {
    padding-top: 0.75rem;
    border-top: 1px dashed var(--border);
    margin-top: 0.5rem;
}
.shortcut-hints {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 6px;
    margin-top: 0.4rem;
    padding-top: 0.4rem;
    border-top: 1px dotted var(--border);
}
.shortcut-hint {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    white-space: nowrap;
}
.shortcut-hint kbd {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    padding: 0.05rem 0.25rem;
    border-radius: 2px;
    color: var(--text-secondary);
    margin-right: 1px;
}

/* Garden Canvas */
.garden-canvas-area {
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    min-height: 0;
}
.canvas-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.3rem 0.75rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    gap: 0.5rem;
}
.toolbar-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-primary);
}
.toolbar-sublabel {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-left: 0.75rem;
}
.toolbar-right {
    display: flex;
    gap: 3px;
    flex-wrap: wrap;
    align-items: center;
}
.toolbar-right .tool-btn {
    /* Bumped from 0.62rem (~10px) — was the squinty number live audit caught.
       Padding kept tight so we don't blow up button height. */
    font-size: 0.74rem;
    padding: 0.25rem 0.5rem;
    letter-spacing: 0.3px;
}

.garden-viewport {
    flex: 1;
    overflow: hidden;
    position: relative;
    cursor: grab;
    background: #0a0a0a;
}
.garden-viewport.panning {
    cursor: grabbing;
}

/* Container Shelf */
.container-shelf {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.shelf-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 1px;
}
.shelf-btn {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    padding: 2px 7px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 3px;
    color: var(--text-secondary);
    cursor: pointer;
    letter-spacing: 0.5px;
    transition: all 0.15s ease;
}
.shelf-btn:hover {
    background: var(--bg-elevated);
    border-color: var(--emerald);
    color: var(--emerald);
}

/* Zoom Controls */
.zoom-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
}
.zoom-level {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--text-muted);
    min-width: 36px;
    text-align: center;
}

/* Stats Dashboard */
.stats-dashboard {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 1rem;
    animation: tab-fade-in 0.2s ease-out;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 0.4rem;
}
.mini-stat {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-left: 2px solid var(--emerald-dark);
    padding: 0.35rem 0.5rem;
    text-align: center;
}
.mini-stat-val {
    display: block;
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 700;
    color: var(--emerald);
    line-height: 1.2;
}
.mini-stat-label {
    display: block;
    font-family: var(--font-mono);
    /* Bumped from 0.45rem (~7px) — was unreadable at typical viewing distance.
       0.62rem ~10px which is still small but legible. */
    font-size: 0.62rem;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin-top: 1px;
}

/* Harvest goals */
.harvest-goals-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-left: 3px solid var(--amber);
    padding: 1rem;
    margin-top: 1rem;
}
.harvest-goals-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}
.goal-display {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--amber);
    letter-spacing: 0.5px;
}
.goal-progress-wrap {
    margin-top: 0.5rem;
    height: 20px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}
.goal-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--emerald-dark), var(--emerald));
    transition: width 0.5s ease;
    width: 0%;
}
.goal-progress-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 1px;
}

.garden-canvas {
    position: relative;
    width: 4000px;
    height: 3000px;
    transform-origin: 0 0;
    /* transform set by JS: translate(X, Y) scale(Z) */
}
.garden-canvas::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(90deg, rgba(255,255,255,0.03) 0px, rgba(255,255,255,0.03) 1px, transparent 1px, transparent 40px),
        repeating-linear-gradient(0deg, rgba(255,255,255,0.03) 0px, rgba(255,255,255,0.03) 1px, transparent 1px, transparent 40px);
    pointer-events: none;
    z-index: 0;
}

/* Garden Beds / Containers */
.garden-bed {
    /* width & height set by JS via inline styles based on container type */
    min-width: 60px;
    min-height: 60px;
    background: #1a1208;
    border: 3px solid #3d2b0f;
    border-radius: var(--radius-lg);
    position: absolute;
    overflow: visible;
    box-shadow: inset 0 0 30px rgba(0,0,0,0.5);
    z-index: 1;
    cursor: move;
}
.garden-bed::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(90deg, transparent, transparent 39px, #2a1f0a33 39px, #2a1f0a33 40px),
        repeating-linear-gradient(0deg, transparent, transparent 39px, #2a1f0a33 39px, #2a1f0a33 40px);
    pointer-events: none;
    border-radius: inherit;
}

/* ---- Container type-specific visuals ---- */

/* Circle containers (pots, grow bags, potato towers) */
.garden-bed.container-circle {
    border-radius: 50%;
    /* center plants inside circle */
    display: flex;
    align-items: center;
    justify-content: center;
}
.garden-bed.container-circle::before {
    border-radius: 50%;
    background:
        radial-gradient(ellipse at 35% 30%, rgba(255,255,255,0.04) 0%, transparent 60%);
}

/* Raised Bed — rounded metal tub look */
.garden-bed.container-type-raised-bed {
    border-width: 3px;
    border-style: solid;
    border-radius: 14px;
}

/* Planter Box — angular wood frame */
.garden-bed.container-type-planter {
    border-width: 2px;
    border-style: solid;
    border-radius: 2px;
}

/* Round Pot — terracotta tint, solid rim */
.garden-bed.container-type-pot-round {
    border-width: 4px;
    border-style: solid;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.5), 0 2px 10px rgba(107,79,46,0.35), 0 0 0 1px rgba(107,79,46,0.2);
}

/* Grow Bag — dashed border (fabric look) */
.garden-bed.container-type-grow-bag {
    border-width: 3px;
    border-style: dashed;
    box-shadow: inset 0 0 12px rgba(0,0,0,0.4), 0 0 6px rgba(90,80,70,0.25);
}

/* In-Ground Plot — dotted border (no physical frame) */
.garden-bed.container-type-in-ground {
    border-width: 3px;
    border-style: dotted;
    border-radius: 4px;
}
.garden-bed.container-type-in-ground::before {
    background:
        repeating-linear-gradient(90deg, transparent, transparent 39px, #2a200a22 39px, #2a200a22 40px),
        repeating-linear-gradient(0deg, transparent, transparent 39px, #2a200a22 39px, #2a200a22 40px);
}
.garden-bed.container-type-in-ground::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: inset 0 0 0 4px rgba(40,60,20,0.25);
    pointer-events: none;
}

/* Window Box — narrow, mounted planter */
.garden-bed.container-type-window-box {
    border-width: 2px;
    border-style: solid;
    border-radius: 3px;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5), 0 4px 6px rgba(0,0,0,0.3);
}

/* Potato Tower — stacked ring look */
.garden-bed.container-type-potato-tower {
    border-width: 3px;
    border-style: solid;
    box-shadow:
        inset 0 0 12px rgba(0,0,0,0.4),
        inset 0 -8px 0 rgba(122,104,64,0.4),
        inset 0 -16px 0 rgba(122,104,64,0.2),
        inset 0 -24px 0 rgba(122,104,64,0.1);
}

/* ============================================================
   ENHANCED VISUAL STYLES — toggled via .enhanced-visuals on canvas
   All rules scoped so removing the class reverts to plain look
   ============================================================ */

/* Raised Bed — corrugated galvanized metal */
.enhanced-visuals .container-type-raised-bed {
    border-color: #8a8a8a !important;
    border-width: 3px;
    box-shadow:
        inset 0 0 30px rgba(0,0,0,0.5),
        inset 0 1px 0 rgba(255,255,255,0.15),
        0 0 0 1px rgba(100,100,100,0.3);
}
.enhanced-visuals .container-type-raised-bed::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 7px,
            rgba(255,255,255,0.04) 7px,
            rgba(255,255,255,0.04) 8px
        );
    pointer-events: none;
    z-index: 0;
}

/* Planter Box — weathered wood planks */
.enhanced-visuals .container-type-planter {
    border-color: #9a7030 !important;
    border-width: 3px;
    border-radius: 3px;
    box-shadow:
        inset 0 0 20px rgba(0,0,0,0.5),
        inset 0 1px 0 rgba(180,140,60,0.2),
        0 2px 6px rgba(0,0,0,0.3);
}
.enhanced-visuals .container-type-planter::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 11px,
            rgba(154,112,48,0.12) 11px,
            rgba(154,112,48,0.12) 12px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 45%,
            rgba(154,112,48,0.06) 45%,
            rgba(154,112,48,0.06) 46%,
            transparent 46%
        );
    pointer-events: none;
    z-index: 0;
}

/* Round Pot — rich terracotta with rim */
.enhanced-visuals .container-type-pot-round {
    border-color: #c0603a !important;
    border-width: 4px;
    box-shadow:
        inset 0 0 20px rgba(0,0,0,0.5),
        inset 0 2px 0 rgba(220,140,90,0.3),
        0 0 0 2px #a0502a,
        0 0 0 4px rgba(160,80,42,0.3),
        0 3px 8px rgba(0,0,0,0.3) !important;
}
.enhanced-visuals .container-type-pot-round::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(
        ellipse at 40% 30%,
        rgba(220,160,100,0.08) 0%,
        transparent 60%
    );
    pointer-events: none;
    z-index: 0;
}

/* Grow Bag — dark fabric with crosshatch texture */
.enhanced-visuals .container-type-grow-bag {
    border-color: #555 !important;
    border-style: dashed;
    border-width: 2px;
    border-radius: 8px;
    box-shadow:
        inset 0 0 15px rgba(0,0,0,0.4),
        0 1px 4px rgba(0,0,0,0.25) !important;
}
.enhanced-visuals .container-type-grow-bag::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background:
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 3px,
            rgba(255,255,255,0.015) 3px,
            rgba(255,255,255,0.015) 4px
        ),
        repeating-linear-gradient(
            -45deg,
            transparent,
            transparent 3px,
            rgba(255,255,255,0.015) 3px,
            rgba(255,255,255,0.015) 4px
        );
    pointer-events: none;
    z-index: 0;
}

/* In-Ground Plot — earthy natural border */
.enhanced-visuals .container-type-in-ground {
    border-color: #5a6a30 !important;
    border-style: dotted;
    border-width: 3px;
    box-shadow:
        inset 0 0 25px rgba(0,0,0,0.4),
        0 0 8px rgba(90,106,48,0.15) !important;
}

/* Potato Tower — enhanced stacked rings */
.enhanced-visuals .container-type-potato-tower {
    border-color: #8a7840 !important;
    box-shadow:
        inset 0 0 12px rgba(0,0,0,0.4),
        inset 0 -6px 0 rgba(138,120,64,0.5),
        inset 0 -12px 0 rgba(138,120,64,0.35),
        inset 0 -18px 0 rgba(138,120,64,0.2),
        inset 0 -24px 0 rgba(138,120,64,0.1),
        0 0 0 1px rgba(138,120,64,0.3) !important;
}

/* Window Box — decorative planter */
.enhanced-visuals .container-type-window-box {
    border-color: #7a6a40 !important;
    border-width: 2px;
    box-shadow:
        inset 0 0 10px rgba(0,0,0,0.5),
        0 3px 6px rgba(0,0,0,0.3),
        0 0 0 1px rgba(122,106,64,0.2) !important;
}

/* Enhanced visuals — preserve selection glow */
.enhanced-visuals .garden-bed.selected {
    border-color: var(--emerald) !important;
}

/* ---- Enhanced visuals: Light Theme overrides ---- */
[data-theme="light"] .enhanced-visuals .container-type-raised-bed {
    border-color: #999 !important;
    box-shadow:
        inset 0 0 15px rgba(0,0,0,0.08),
        inset 0 1px 0 rgba(255,255,255,0.4),
        0 0 0 1px rgba(150,150,150,0.3) !important;
}
[data-theme="light"] .enhanced-visuals .container-type-planter {
    border-color: #b08840 !important;
    box-shadow:
        inset 0 0 12px rgba(0,0,0,0.08),
        0 2px 4px rgba(0,0,0,0.1) !important;
}
[data-theme="light"] .enhanced-visuals .container-type-pot-round {
    border-color: #d07040 !important;
    box-shadow:
        inset 0 0 12px rgba(0,0,0,0.08),
        0 0 0 2px #c06030,
        0 0 0 4px rgba(192,96,48,0.15),
        0 2px 6px rgba(0,0,0,0.15) !important;
}
[data-theme="light"] .enhanced-visuals .container-type-grow-bag {
    border-color: #888 !important;
    box-shadow:
        inset 0 0 10px rgba(0,0,0,0.06),
        0 1px 3px rgba(0,0,0,0.1) !important;
}
/* ============================================================
   END ENHANCED VISUAL STYLES
   ============================================================ */

/* Labels inside small containers */
.garden-bed.container-small .bed-label {
    font-size: 0.55rem;
    letter-spacing: 1px;
    max-width: calc(100% - 12px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.garden-bed.container-small .bed-count-badge {
    font-size: 0.5rem;
    padding: 0 3px;
}
.garden-bed.container-small .bed-dimensions {
    font-size: 0.5rem;
}
/* Small + circle: tighter layout with everything centered */
.garden-bed.container-small.container-circle .bed-label {
    font-size: 0.5rem;
    top: 15%;
    max-width: 55%;
}
.garden-bed.container-small.container-circle .bed-count-badge {
    font-size: 0.45rem;
    bottom: 20%;
}
.garden-bed.container-small.container-circle .bed-dimensions {
    font-size: 0.45rem;
    bottom: 8%;
}
.garden-bed.container-small .bed-empty-hint {
    font-size: 0.5rem;
}
.garden-bed.container-small .bed-empty-hint .hint-icon {
    font-size: 0.7rem;
}
.garden-bed.container-small .bed-empty-hint .hint-text {
    display: none;
}

/* Circle container label positioning — everything centered to avoid corner clipping */
.garden-bed.container-circle .bed-label {
    text-align: center;
    left: 50%;
    transform: translateX(-50%);
    top: 12%;
    max-width: 65%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.garden-bed.container-circle .bed-count-badge {
    left: 50%;
    transform: translateX(-50%);
    right: auto;
    top: auto;
    bottom: 16%;
}
.garden-bed.container-circle .bed-dimensions {
    left: 50%;
    transform: translateX(-50%);
    right: auto;
    bottom: 6%;
}
.garden-bed.container-circle .bed-empty-hint {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    position: absolute;
    text-align: center;
}
.garden-bed.selected {
    border-color: var(--emerald) !important;
    box-shadow: 0 0 0 2px var(--emerald), 0 0 20px rgba(var(--emerald-rgb),0.15), inset 0 0 30px rgba(0,0,0,0.5);
    z-index: 2;
}
/* Keyboard focus indicators */
.garden-bed:focus-visible {
    outline: 2px dashed var(--emerald);
    outline-offset: 3px;
    z-index: 3;
}
.garden-bed:focus:not(:focus-visible) {
    outline: none;
}
.placed-plant:focus-visible {
    outline: 2px solid #fbbf24;
    outline-offset: 2px;
    border-radius: 50%;
    z-index: 10;
}
.placed-plant:focus:not(:focus-visible) {
    outline: none;
}
.garden-bed.drag-over {
    border-color: var(--emerald);
    box-shadow: inset 0 0 30px rgba(16, 185, 129, 0.15), 0 0 15px rgba(16, 185, 129, 0.2);
}
/* Bed coverage visualization — green tint intensifies with fullness */
.garden-bed {
    transition: background 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}
.garden-bed.coverage-low {
    background: #1a150a;
    border-color: #3d2e10;
    box-shadow: inset 0 0 30px rgba(0,0,0,0.45), inset 0 0 50px rgba(var(--emerald-rgb),0.02);
}
.garden-bed.coverage-med {
    background: #181a0c;
    border-color: #3a3d12;
    box-shadow: inset 0 0 28px rgba(0,0,0,0.35), inset 0 0 60px rgba(var(--emerald-rgb),0.05);
}
.garden-bed.coverage-high {
    background: #161d0d;
    border-color: #344513;
    box-shadow: inset 0 0 24px rgba(0,0,0,0.3), inset 0 0 60px rgba(var(--emerald-rgb),0.09);
}
.garden-bed.coverage-full {
    background: #142010;
    border-color: #2d5015;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.25), inset 0 0 60px rgba(var(--emerald-rgb),0.13);
}
/* Companion placement indicators */
.companion-badge {
    position: absolute;
    bottom: 4px;
    right: 6px;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius);
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-muted);
    z-index: 5;
    pointer-events: none;
}
.companion-badge.has-friends {
    background: rgba(16, 185, 129, 0.12);
    border-color: var(--emerald-dark);
    color: var(--emerald);
}
.companion-badge.has-foes {
    background: rgba(239, 68, 68, 0.12);
    border-color: var(--red-accent);
    color: var(--red-accent);
}
.bed-label {
    position: absolute;
    top: 4px;
    left: 6px;
    font-family: var(--font-mono);
    /* Bumped from 0.6rem — bed labels need to be readable on canvas at 100%
       zoom. The bed itself can be tiny at low zoom but the label should
       carry. */
    font-size: 0.78rem;
    font-weight: 700;
    color: #5c4a2a;
    letter-spacing: 2px;
    z-index: 2;
    cursor: pointer;
    padding: 1px 4px;
    border-radius: 2px;
    transition: all 0.15s;
}
.bed-label:hover {
    color: var(--emerald);
    background: rgba(var(--emerald-rgb),0.1);
}
.bed-label-input {
    position: absolute;
    top: 2px;
    left: 4px;
    z-index: 10;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 1px;
    background: var(--bg-primary);
    color: var(--emerald);
    border: 1px solid var(--emerald);
    padding: 1px 4px;
    width: 120px;
    outline: none;
}

/* Plant count badge on beds */
.bed-count-badge {
    position: absolute;
    top: 4px;
    right: 6px;
    font-family: var(--font-mono);
    font-size: 0.5rem;
    font-weight: 700;
    color: var(--emerald);
    background: rgba(0,0,0,0.6);
    padding: 1px 5px;
    border: 1px solid rgba(var(--emerald-rgb),0.3);
    border-radius: 2px;
    z-index: 2;
    letter-spacing: 0.5px;
    pointer-events: none;
}
.bed-dimensions {
    position: absolute;
    bottom: 4px;
    right: 6px;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: #3d2b0f;
    letter-spacing: 1px;
    cursor: pointer;
    z-index: 2;
    padding: 2px 6px;
    border-radius: 3px;
    background: rgba(0,0,0,0.15);
    transition: background 0.15s, color 0.15s;
}
.bed-dimensions:hover {
    color: var(--emerald);
    background: rgba(0,0,0,0.35);
}
.dim-edit-row {
    position: absolute;
    bottom: 4px;
    right: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 10;
}
.dim-input {
    width: 44px;
    height: 26px;
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 2px solid var(--emerald);
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    padding: 3px 5px;
    text-align: center;
    -moz-appearance: textfield;
    cursor: text;
}
.dim-input::-webkit-outer-spin-button,
.dim-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
}

/* Template dropdown */
.template-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 100;
    background: var(--bg-primary);
    border: 1px solid var(--emerald);
    border-radius: 4px;
    width: calc(100% + 2px);
    min-width: 220px;
    max-height: 320px;
    overflow-y: auto;
    box-shadow: 0 8px 24px rgba(0,0,0,0.6);
    margin-top: 4px;
}
.template-dropdown-title {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    letter-spacing: 0.12em;
    color: var(--emerald);
    padding: 0.5rem 0.6rem 0.3rem;
    border-bottom: 1px solid var(--border-color);
}
.template-option {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0.45rem 0.6rem;
    cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    transition: background 0.15s;
}
.template-option:hover {
    background: rgba(var(--emerald-rgb),0.12);
}
.template-option:last-child { border-bottom: none; }
.template-name {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.03em;
}
.template-desc {
    font-size: 0.55rem;
    color: var(--text-muted);
    line-height: 1.3;
}

/* Plants placed in beds */
.placed-plant {
    position: absolute;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    cursor: move;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(30,30,30,0.6), rgba(0,0,0,0.5));
    border: 1.5px solid rgba(255,255,255,0.12);
    transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
    z-index: 3;
    user-select: none;
}
.placed-plant:hover {
    box-shadow: var(--glow-emerald-md);
    border-color: var(--emerald);
    z-index: 4;
    transform: scale(1.1);
}

/* Water need color-coding ring on placed plants */
.placed-plant[data-water="low"] {
    border-color: rgba(var(--emerald-rgb),0.4);
    box-shadow: 0 0 4px rgba(var(--emerald-rgb),0.2);
}
.placed-plant[data-water="medium"] {
    border-color: rgba(var(--amber-rgb),0.4);
    box-shadow: 0 0 4px rgba(var(--amber-rgb),0.2);
}
.placed-plant[data-water="high"] {
    border-color: rgba(220,38,38,0.4);
    box-shadow: 0 0 4px rgba(220,38,38,0.2);
}

/* Spacing radius circle on hover/drag */
.spacing-radius {
    position: absolute;
    border-radius: 50%;
    border: 2.5px dashed rgba(var(--emerald-rgb),0.65);
    background: rgba(var(--emerald-rgb),0.12);
    pointer-events: none;
    z-index: 2;
    transition: opacity 0.15s;
    box-shadow: 0 0 8px rgba(var(--emerald-rgb),0.15);
}

/* Companion planting lines */
.companion-line {
    position: absolute;
    pointer-events: none;
    z-index: 1;
}
.companion-line-good {
    stroke: rgba(var(--emerald-rgb),0.8);
    /* stroke-width and stroke-dasharray set dynamically in JS for zoom compensation */
}
.companion-line-bad {
    stroke: rgba(var(--red-rgb),0.85);
    /* stroke-width and stroke-dasharray set dynamically in JS for zoom compensation */
}

/* Snap-to-grid visual marker */
.garden-bed.show-grid::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(90deg, transparent, transparent 19px, rgba(var(--emerald-rgb),0.06) 19px, rgba(var(--emerald-rgb),0.06) 20px),
        repeating-linear-gradient(0deg, transparent, transparent 19px, rgba(var(--emerald-rgb),0.06) 19px, rgba(var(--emerald-rgb),0.06) 20px);
    pointer-events: none;
    z-index: 1;
}
.placed-plant .plant-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    white-space: nowrap;
    border: 1px solid var(--border);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
    margin-bottom: 4px;
    border-radius: var(--radius);
}
.placed-plant:hover .plant-tooltip { opacity: 1; }
/* Zoomed-in: subtler companion lines, no permanent name labels */
.canvas-zoomed-in .companion-line-good,
.canvas-zoomed-in .companion-line-bad {
    opacity: 0.5;
}
.canvas-zoomed-detail .companion-line-good,
.canvas-zoomed-detail .companion-line-bad {
    opacity: 0.35;
}
/* Never show name labels permanently — hover only */
.canvas-zoomed-in .placed-plant .plant-tooltip {
    opacity: 0;
}

/* Plant Info Panel */
.plant-info-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-top: 2px solid var(--emerald);
    padding: 1rem 1.5rem;
    z-index: 20;
    max-height: 40%;
    overflow-y: auto;
    font-size: 0.9rem;
    transition: transform 0.25s ease-out, opacity 0.25s ease-out;
    transform: translateY(0);
}
.plant-info-panel.hidden {
    transform: translateY(100%) !important;
    opacity: 0 !important;
    pointer-events: none !important;
    display: block !important;
}
.plant-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    margin-top: 0.75rem;
}
.info-item {
    background: var(--bg-tertiary);
    padding: 0.5rem 0.75rem;
    border-left: 2px solid var(--emerald-dark);
}
.info-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
}
.info-value {
    font-size: 1.05rem;
    color: var(--text-primary);
    margin-top: 0.15rem;
}
.info-title {
    font-family: var(--font-display);
    font-size: 1.4rem;
    letter-spacing: 1px;
}

/* Bed Details Sidebar */
.bed-details {
    background: var(--bg-secondary);
    border-left: 1px solid var(--border);
    padding: 1rem;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    min-width: 200px;
}
/* Sidebar resize handle — drag left edge to resize */
.sidebar-resize-handle {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    cursor: col-resize;
    z-index: 10;
    background: transparent;
    transition: background 0.15s;
}
.sidebar-resize-handle:hover,
.sidebar-resize-handle.active {
    background: var(--emerald);
    opacity: 0.5;
}
body.sidebar-resizing {
    cursor: col-resize !important;
    user-select: none !important;
}
body.sidebar-resizing * {
    cursor: col-resize !important;
}
/* Plant palette (left sidebar) resize handle — drag right edge */
.palette-resize-handle {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    cursor: col-resize;
    z-index: 10;
    background: transparent;
    transition: background 0.15s;
}
.palette-resize-handle:hover,
.palette-resize-handle.active {
    background: var(--emerald);
    opacity: 0.5;
}
body.palette-resizing {
    cursor: col-resize !important;
    user-select: none !important;
}
body.palette-resizing * {
    cursor: col-resize !important;
}
/* Section resize handles — horizontal bars between bed-details subsections */
.section-resize-handle {
    height: 7px;
    cursor: row-resize;
    position: relative;
    flex-shrink: 0;
    margin: 2px 0;
}
.section-resize-handle::after {
    content: '';
    position: absolute;
    left: 20%;
    right: 20%;
    top: 50%;
    height: 1px;
    background: var(--border);
    transition: background 0.15s, height 0.15s;
}
.section-resize-handle:hover::after,
.section-resize-handle.active::after {
    background: var(--emerald);
    height: 2px;
    top: calc(50% - 0.5px);
}
body.section-resizing {
    cursor: row-resize !important;
    user-select: none !important;
}
body.section-resizing * {
    cursor: row-resize !important;
}
.bed-selector {
    display: flex;
    gap: 2px;
    margin-bottom: 1rem;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}
.bed-tab {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 0.35rem 0.6rem;
    background: var(--bg-primary);
    color: var(--text-muted);
    border: 1px solid var(--border);
    cursor: pointer;
    flex: 0 0 auto;
    min-width: max-content;
    text-align: center;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.bed-tab:hover { color: var(--text-secondary); border-color: var(--text-muted); }
.bed-tab.active {
    background: var(--bg-tertiary);
    color: var(--emerald);
    border-color: var(--emerald);
}
.bed-tab-icon { font-size: 0.85em; margin-right: 2px; }
.bed-tab-count {
    display: inline-block;
    background: var(--bg-tertiary);
    color: var(--text-muted);
    font-size: 0.75em;
    padding: 0 4px;
    border-radius: 3px;
    margin-left: 3px;
    min-width: 14px;
    text-align: center;
}
.bed-tab.active .bed-tab-count {
    background: var(--emerald);
    color: var(--bg-primary);
}

.bed-info { margin-bottom: 1rem; }
.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
    border-bottom: 1px dotted var(--border);
}
.stat-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 1px;
}
.stat-value {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--emerald);
    font-weight: 700;
}

.bed-plant-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
    height: 200px;
    min-height: 60px;
    overflow-y: auto;
}
.bed-plant-entry {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.3rem 0.4rem;
    background: var(--bg-tertiary);
    font-size: 0.75rem;
    border-left: 2px solid var(--emerald-dark);
    overflow: hidden;
}
.bed-plant-entry .bed-plant-emoji {
    font-size: 0.85rem;
    flex-shrink: 0;
}
.bed-plant-entry .bed-plant-name {
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.8rem;
}
.bed-plant-entry .qty-controls {
    display: flex;
    align-items: center;
    gap: 1px;
    flex-shrink: 0;
}
.bed-plant-entry .qty-btn {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    cursor: pointer;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-family: var(--font-mono);
    padding: 0;
    transition: all 0.15s;
    line-height: 1;
}
.bed-plant-entry .qty-btn:hover {
    background: var(--emerald-dark);
    border-color: var(--emerald);
    color: #fff;
}
.bed-plant-entry .qty-value {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    min-width: 14px;
    text-align: center;
}
.bed-plant-entry .remove-plant {
    background: none;
    border: none;
    color: var(--red-accent);
    cursor: pointer;
    font-size: 0.85rem;
    opacity: 0.4;
    padding: 0 2px;
    flex-shrink: 0;
    line-height: 1;
}
.bed-plant-entry .remove-plant:hover { opacity: 1; }

/* Bed actions (clear / copy) — wrap rather than clip. The sidebar is narrow
   enough that three mono-spaced labels don't fit on one line. */
.bed-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0.5rem 0;
}
.bed-actions .tool-btn { flex: 1 1 auto; }
.tool-btn.small {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    letter-spacing: 0.5px;
}
.quick-add-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin: 0.4rem 0 0.6rem;
}
/* The select can shrink; the action buttons must keep their label. */
.quick-add-row .quick-add-select { min-width: 7rem; }
.quick-add-row .tool-btn { flex: 0 0 auto; }
.quick-add-select {
    flex: 1;
    background: var(--bg-dark);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 0.25rem 0.4rem;
    letter-spacing: 0.3px;
}
.quick-add-select:focus {
    border-color: var(--emerald);
    outline: none;
}

/* Undo/Redo disabled state */
.tool-btn.disabled {
    opacity: 0.3;
    pointer-events: none;
}

/* Plant selection */
.placed-plant.selected {
    box-shadow: 0 0 0 2px var(--emerald), 0 0 15px rgba(var(--emerald-rgb),0.5);
    border-color: var(--emerald);
    z-index: 5;
}
/* Multi-select indicator dot — uses ::before so it doesn't collide with the
   timeline harvest-stage amber ::after dot (both elements stack independently). */
.placed-plant.multi-selected::before {
    content: '';
    position: absolute;
    top: -3px;
    right: -3px;
    width: 8px;
    height: 8px;
    background: var(--teal);
    border-radius: 50%;
    border: 1px solid var(--bg-primary);
    z-index: 6;
    pointer-events: none;
}

/* Click-to-place mode */
.click-place-mode .garden-bed {
    cursor: crosshair;
}
.click-place-target {
    box-shadow: inset 0 0 20px rgba(var(--emerald-rgb),0.15);
}
.plant-item.click-place-active {
    background: var(--emerald-dark) !important;
    border-color: var(--emerald) !important;
    box-shadow: 0 0 10px rgba(var(--emerald-rgb),0.3);
}

/* Spacing warning */
.spacing-warning {
    position: absolute;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    z-index: 6;
    pointer-events: auto;
    cursor: help;
    transform: translate(-50%, -50%);
    animation: pulse-warning 1.5s ease-in-out infinite;
}
@keyframes pulse-warning {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* Context Menu */
.context-menu {
    position: fixed;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    min-width: 170px;
    z-index: 10000;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    font-family: var(--font-mono);
    font-size: 0.75rem;
}
.context-menu-header {
    padding: 0.5rem 0.75rem;
    color: var(--emerald);
    font-weight: 700;
    border-bottom: 1px solid var(--border);
    font-size: 0.8rem;
}
.context-menu-item {
    display: block;
    width: 100%;
    padding: 0.45rem 0.75rem;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    text-align: left;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    transition: background 0.1s;
}
.context-menu-item:hover {
    background: var(--emerald-dark);
    color: #fff;
}
.context-menu-divider {
    height: 1px;
    background: var(--border);
    margin: 2px 0;
}
.context-menu-danger {
    color: #ef4444 !important;
}
.context-menu-danger:hover {
    background: rgba(var(--red-rgb),0.15) !important;
}

/* Move Picker Modal */
.move-picker-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.12s ease;
}
.move-picker-modal {
    background: var(--bg-secondary);
    border: 1px solid var(--emerald-dark);
    border-radius: 6px;
    width: 320px;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.move-picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--emerald);
}
.move-picker-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
.move-picker-close:hover { color: var(--text-primary); }
.move-picker-list {
    overflow-y: auto;
    max-height: calc(70vh - 48px);
    scrollbar-width: thin;
    scrollbar-color: var(--emerald-dark) transparent;
}
.move-picker-list::-webkit-scrollbar { width: 5px; }
.move-picker-list::-webkit-scrollbar-thumb { background: var(--emerald-dark); border-radius: 3px; }
.move-picker-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.55rem 1rem;
    background: none;
    border: none;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    cursor: pointer;
    text-align: left;
    transition: background 0.1s;
}
.move-picker-item:hover {
    background: rgba(var(--emerald-rgb),0.1);
    color: var(--emerald);
}
.move-picker-item:last-child { border-bottom: none; }
.move-picker-icon { font-size: 1rem; flex-shrink: 0; }
.move-picker-name { flex: 1; }
.move-picker-count {
    font-size: 0.6rem;
    color: var(--text-muted);
    letter-spacing: 0.3px;
}
.context-menu-item.danger {
    color: #ef4444;
}
.context-menu-item.danger:hover {
    background: rgba(var(--red-rgb),0.15);
    color: #f87171;
}

/* Container resize handle */
.container-resize-handle {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    color: rgba(255,255,255,0.3);
    cursor: nwse-resize;
    z-index: 5;
    border-radius: 2px;
    transition: color 0.15s, background 0.15s;
    user-select: none;
}
.container-resize-handle:hover {
    color: var(--emerald);
    background: rgba(var(--emerald-rgb),0.15);
}
/* For circles, position resize handle at bottom-right of bounding box */
.container-circle .container-resize-handle {
    bottom: 10%;
    right: 10%;
}

/* Copy bed modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.modal-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    padding: 1.5rem;
    max-width: 350px;
    width: 90%;
}

.companion-alerts {
    height: 150px;
    min-height: 40px;
    overflow-y: auto;
}
/* Bed Journal */
.bed-journal {
    margin-top: 0.5rem;
}
.journal-input-row {
    display: flex;
    gap: 4px;
    margin-bottom: 0.5rem;
}
.journal-input-row .text-input {
    flex: 1;
    font-size: 0.75rem;
}
.journal-input-row .tool-btn {
    padding: 0.45rem 0.6rem;
    font-size: 0.85rem;
}
.journal-entries {
    height: 200px;
    min-height: 60px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.journal-entry {
    background: var(--bg-tertiary);
    padding: 0.4rem 0.5rem;
    border-left: 2px solid var(--teal-dark);
    font-size: 0.8rem;
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
}
.journal-entry-text {
    flex: 1;
    color: var(--text-secondary);
    line-height: 1.3;
}
.journal-entry-date {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    color: var(--text-muted);
    white-space: nowrap;
}
.journal-entry-delete {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0;
    opacity: 0.5;
    line-height: 1;
}
.journal-entry-delete:hover {
    opacity: 1;
    color: var(--red-accent);
}

.companion-good, .companion-bad {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 0.3rem 0.5rem;
    margin-bottom: 3px;
    border-left: 2px solid;
}
.companion-good { border-color: var(--emerald); color: var(--emerald); background: rgba(var(--emerald-rgb),0.05); }
.companion-bad { border-color: var(--red-accent); color: var(--red-accent); background: rgba(220,38,38,0.05); }

/* ==========================
   GROW SCHEDULE TAB
   ========================== */
.schedule-layout {
    padding: 1.5rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}
.schedule-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
}
.frost-badges {
    display: flex;
    gap: 0.75rem;
}
.frost-badge {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    padding: 0.5rem 1rem;
    text-align: center;
}
.frost-label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.55rem;
    color: var(--text-muted);
    letter-spacing: 2px;
}
.frost-date {
    display: block;
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--emerald);
    letter-spacing: 1px;
    margin-top: 0.15rem;
}
.schedule-intro {
    color: var(--text-secondary);
    margin: 1rem 0 1.5rem;
    font-size: 1rem;
}
.schedule-empty {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}
.empty-icon { font-size: 3rem; margin-bottom: 1rem; }

/* Timeline */
.schedule-timeline {
    position: relative;
    margin: 2rem 0;
}
.timeline-month-row {
    display: flex;
    align-items: stretch;
    min-height: 2.5rem;
    margin-bottom: 2px;
}
.timeline-month-label {
    width: 60px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 0.75rem;
    flex-shrink: 0;
}
.timeline-bar-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 2px 0;
}
.timeline-plant-bar {
    height: 20px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    padding: 0 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.timeline-plant-bar.seed-indoor { background: #7c3aed; }
.timeline-plant-bar.transplant { background: var(--emerald-dark); }
.timeline-plant-bar.direct-sow { background: var(--teal-dark); }
.timeline-plant-bar.harvest { background: var(--amber-muted); }

.timeline-legend {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding: 0.5rem 0;
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}
.legend-swatch {
    width: 14px;
    height: 14px;
    border-radius: var(--radius);
}

/* Schedule Instructions */
.schedule-instructions {
    margin-top: 2rem;
}
.instruction-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-left: 3px solid var(--emerald);
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
}
.instruction-card h4 {
    font-family: var(--font-display);
    font-size: 1rem;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.instruction-card .month-tag {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    padding: 0.15rem 0.5rem;
    background: var(--emerald-dark);
    color: #fff;
    letter-spacing: 1px;
}
.instruction-steps {
    list-style: none;
    padding: 0;
}
.instruction-steps li {
    padding: 0.3rem 0;
    padding-left: 1rem;
    position: relative;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.4;
}
.instruction-steps li::before {
    content: '\25B8';
    position: absolute;
    left: 0;
    color: var(--emerald);
}

/* ==========================
   HARVEST LOG TAB
   ========================== */
.harvest-layout {
    padding: 1.5rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}
.harvest-header-bar {
    margin-bottom: 1rem;
}
.harvest-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.harvest-stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    padding: 1rem;
    text-align: center;
}
.harvest-stat-card.accent {
    border-color: var(--emerald-dark);
    border-left: 3px solid var(--emerald);
}
.harvest-stat-label {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--text-muted);
    letter-spacing: 2px;
    margin-bottom: 0.25rem;
}
.harvest-stat-value {
    font-family: var(--font-display);
    font-size: 1.8rem;
    color: var(--text-primary);
    letter-spacing: 1px;
}
.harvest-stat-card.accent .harvest-stat-value {
    color: var(--emerald);
}
.harvest-form-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    padding: 1.25rem;
}
.harvest-form-row {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.harvest-field {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.harvest-field label {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--text-muted);
    letter-spacing: 1px;
}
.harvest-entries {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
/* Harvest Season Insights */
.harvest-insights { margin-bottom: 0.5rem; }
.insights-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-top: 0.5rem;
}
.insight-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    padding: 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.insight-label {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    letter-spacing: 1px;
    color: var(--text-muted);
}
.insight-value {
    font-family: var(--font-display);
    font-size: 0.95rem;
    letter-spacing: 1px;
    color: var(--emerald);
}
@media (max-width: 900px) {
    .insights-grid { grid-template-columns: repeat(2, 1fr); }
}

.harvest-entry {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-left: 3px solid var(--emerald-dark);
}
.harvest-entry .harvest-emoji {
    font-size: 1.3rem;
}
.harvest-entry-info {
    flex: 1;
}
.harvest-entry-title {
    font-weight: 600;
    font-size: 0.9rem;
}
.harvest-entry-meta {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}
.harvest-entry-notes {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-top: 0.15rem;
}
.harvest-entry-weight {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--emerald);
    white-space: nowrap;
}
.harvest-entry-donated {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    letter-spacing: 1px;
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius);
}
.harvest-entry-donated.yes {
    background: rgba(var(--emerald-rgb),0.15);
    color: var(--emerald);
}
.harvest-entry-donated.partial {
    background: rgba(var(--amber-rgb),0.15);
    color: var(--amber);
}
.harvest-entry-donated.no {
    background: rgba(163,163,163,0.1);
    color: var(--text-muted);
}
.harvest-entry-delete {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 0 4px;
    opacity: 0.5;
}
.harvest-entry-delete:hover {
    opacity: 1;
    color: var(--red-accent);
}
.harvest-empty {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

/* ==========================
   VOLUNTEERS TAB
   ========================== */
.volunteers-layout {
    padding: 1.5rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}
.volunteers-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1.5rem;
}
.volunteer-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 1rem;
}
.vol-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    padding: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.vol-avatar {
    width: 36px;
    height: 36px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}
.vol-info { flex: 1; }
.vol-name { font-weight: 700; font-size: 0.9rem; }
.vol-contact {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-muted);
}
.vol-avail {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    letter-spacing: 1px;
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius);
}
.vol-avail.high { background: rgba(var(--emerald-rgb),0.15); color: var(--emerald); }
.vol-avail.medium { background: rgba(var(--amber-rgb),0.15); color: var(--amber); }
.vol-avail.low { background: rgba(220,38,38,0.15); color: var(--red-accent); }
.vol-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 0 4px;
}
.vol-remove:hover { color: var(--red-accent); }

.add-volunteer-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.bed-assignments {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.assignment-row {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    padding: 0.75rem;
}
.assignment-bed-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--emerald);
    margin-bottom: 0.4rem;
}
.assignment-select {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 0.35rem 0.5rem;
    width: 100%;
    cursor: pointer;
}
.assignment-select option { background: var(--bg-primary); }

.weekly-tasks {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    padding: 1rem;
    min-height: 200px;
}
.task-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.4rem 0;
    border-bottom: 1px dotted var(--border);
    font-size: 0.85rem;
}
.task-item:last-child { border-bottom: none; }
.task-check {
    width: 14px;
    height: 14px;
    border: 1px solid var(--border);
    background: var(--bg-primary);
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    color: var(--emerald);
}
.task-check.done { background: var(--emerald-dark); border-color: var(--emerald); }
.task-text { color: var(--text-secondary); }
.task-text.done { text-decoration: line-through; color: var(--text-muted); }

/* ==========================
   CLIMATE TAB
   ========================== */
.climate-layout {
    padding: 1.5rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}
.climate-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
.climate-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    padding: 1.25rem;
}
.climate-card h3 {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--text-primary);
    margin-bottom: 1rem;
}
.chart-container {
    height: 200px;
    position: relative;
}
.card-note {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 1rem;
}

/* Rainfall deficit calculator */
.rainfall-deficit-card { grid-column: span 2; }
.deficit-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.deficit-stat {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.deficit-label {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}
.deficit-value {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--emerald);
    font-weight: 700;
}
.deficit-month-bars {
    margin-bottom: 0.75rem;
}
.deficit-bars-row {
    display: flex;
    justify-content: space-between;
    gap: 6px;
    align-items: flex-end;
}
.deficit-bar-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}
.deficit-bar-diff {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: 700;
}
.deficit-bar-track {
    width: 100%;
    height: 60px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    position: relative;
    display: flex;
    align-items: flex-end;
}
.deficit-bar-fill {
    width: 100%;
    transition: height 0.3s ease;
}
.deficit-bar-label {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}
.deficit-verdict {
    padding: 0.75rem;
    margin-top: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    border: 1px dashed var(--emerald-dark);
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Rain needs mini chart */
.rain-needs-grid {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
    height: 120px;
    padding-bottom: 1.5rem;
    position: relative;
}
.rain-month {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    height: 100%;
}
.rm-label {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    color: var(--text-muted);
    letter-spacing: 1px;
    order: 3;
}
.rm-bar {
    flex: 1;
    width: 100%;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    display: flex;
    align-items: flex-end;
    order: 1;
}
.rm-fill {
    width: 100%;
    background: linear-gradient(to top, var(--teal-dark), var(--teal));
    transition: height 0.5s ease;
}
.rm-val {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--teal);
    order: 2;
}
.need-line-label {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--amber);
    margin-top: 0.5rem;
}

/* ==========================
   LIVE WEATHER DASHBOARD
   ========================== */
.weather-dashboard {
    margin-bottom: 1.5rem;
}
.weather-loading {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    padding: 2rem;
    text-align: center;
}
.weather-loading-text {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 2px;
    animation: pulse-text 1.5s ease-in-out infinite;
}
@keyframes pulse-text {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

.weather-current-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}
.weather-current-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    padding: 1.25rem;
}
.weather-current-card.main-temp {
    border-color: var(--emerald-dark);
    border-left: 3px solid var(--emerald);
}
.weather-label {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--text-muted);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 0.35rem;
}
.weather-big-value {
    font-family: var(--font-display);
    font-size: 2.5rem;
    letter-spacing: 1px;
    line-height: 1;
    color: var(--text-primary);
}
.weather-big-value .weather-unit {
    font-size: 1rem;
    color: var(--text-muted);
}
.weather-desc {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--emerald);
    margin-top: 0.25rem;
    letter-spacing: 0.5px;
}
.weather-detail-row {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.5rem;
}
.weather-detail {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-secondary);
}
.weather-detail span {
    color: var(--text-muted);
}
.weather-icon-large {
    font-size: 2.5rem;
    line-height: 1;
}

/* 7-Day Forecast */
.weather-forecast-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    padding: 1.25rem;
}
.weather-forecast-card h3 {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--text-primary);
    margin-bottom: 1rem;
}
.forecast-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}
.forecast-day {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    padding: 0.75rem 0.5rem;
    text-align: center;
    transition: border-color 0.15s;
}
.forecast-day:first-child {
    border-color: var(--emerald-dark);
}
.forecast-day-name {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin-bottom: 0.25rem;
}
.forecast-day-date {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}
.forecast-icon {
    font-size: 1.5rem;
    margin-bottom: 0.35rem;
}
.forecast-temps {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}
.forecast-high {
    color: var(--text-primary);
    font-weight: 700;
}
.forecast-low {
    color: var(--text-muted);
}
.forecast-precip {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    color: var(--teal);
    margin-top: 0.25rem;
}
.forecast-frost-warn {
    font-family: var(--font-mono);
    font-size: 0.5rem;
    color: var(--red-accent);
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-top: 0.25rem;
}

/* Frost Alert Banner */
.frost-alert-banner {
    background: rgba(220, 38, 38, 0.1);
    border: 2px solid var(--red-accent);
    border-left: 4px solid var(--red-accent);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-primary);
    line-height: 1.5;
}
.frost-alert-banner .frost-alert-title {
    font-family: var(--font-display);
    font-size: 1rem;
    letter-spacing: 1px;
    color: var(--red-accent);
    margin-bottom: 0.35rem;
}
.frost-alert-banner .frost-alert-detail {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

/* Watering alert banner */
.water-alert-banner {
    position: relative;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.4);
    border-left: 4px solid #3b82f6;
    padding: 0.6rem 2rem 0.6rem 0.8rem;
    margin-bottom: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-primary);
    line-height: 1.4;
    border-radius: 3px;
}
.water-alert-title {
    font-family: var(--font-display);
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    color: #60a5fa;
    margin-bottom: 0.2rem;
}
.water-alert-detail {
    color: var(--text-secondary);
    font-size: 0.65rem;
}
.water-alert-dismiss {
    position: absolute;
    top: 0.4rem;
    right: 0.5rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.8rem;
    padding: 2px;
}
.water-alert-dismiss:hover { color: var(--text-primary); }

/* Weather last updated */
.weather-updated {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--text-muted);
    letter-spacing: 1px;
    text-align: right;
    margin-top: 0.75rem;
}
.weather-updated button {
    background: none;
    border: 1px solid var(--border);
    color: var(--emerald);
    font-family: var(--font-mono);
    font-size: 0.6rem;
    padding: 0.15rem 0.5rem;
    cursor: pointer;
    margin-left: 0.5rem;
    letter-spacing: 0.5px;
}
.weather-updated button:hover {
    background: var(--bg-tertiary);
    border-color: var(--emerald);
}

/* ==========================
   VISUALIZE TAB
   ========================== */
.visualize-layout {
    padding: 1.5rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}
.viz-config {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}
.viz-api-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.viz-api-row label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 1px;
    color: var(--text-muted);
    white-space: nowrap;
}
.viz-api-row .text-input { flex: 1; }
.viz-bed-select {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.viz-bed-select label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 1px;
    color: var(--text-muted);
    white-space: nowrap;
}
.viz-bed-select .select-input { max-width: 300px; }

.viz-status {
    margin-top: 1rem;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
}
.viz-status.error { border-color: var(--red-accent); color: var(--red-accent); }
.viz-status.loading { border-color: var(--amber); color: var(--amber); }
.viz-status.success { border-color: var(--emerald); color: var(--emerald); }

.viz-prompts {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}
.viz-prompt-item {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.5;
}
.viz-prompt-label {
    font-weight: 700;
    color: var(--emerald);
    letter-spacing: 1px;
    font-size: 0.65rem;
    margin-bottom: 0.35rem;
    display: block;
}

.viz-gallery {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    padding: 1.25rem;
}
.viz-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}
.viz-image-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    overflow: hidden;
}
.viz-image-card img {
    width: 100%;
    height: auto;
    display: block;
}
.viz-image-card img.viz-enlargeable {
    cursor: zoom-in;
    transition: opacity 0.15s;
}
.viz-image-card img.viz-enlargeable:hover {
    opacity: 0.85;
}

/* Viz Lightbox */
.viz-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.viz-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.9);
    backdrop-filter: blur(8px);
}
.viz-lightbox-content {
    position: relative;
    max-width: 95vw;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.viz-lightbox-content img {
    max-width: 95vw;
    max-height: 88vh;
    object-fit: contain;
    border: 2px solid var(--emerald);
    border-radius: 4px;
}
.viz-lightbox-close {
    position: absolute;
    top: -2rem;
    right: -1rem;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    z-index: 1;
}
.viz-lightbox-close:hover { color: var(--red-accent); }
.viz-lightbox-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-top: 0.5rem;
}

.viz-image-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 0.5rem 0.75rem;
    text-transform: uppercase;
}

/* ---- FOOTER ---- */
.main-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.45rem 1rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-muted);
    letter-spacing: 1px;
    gap: 0.5rem;
    flex-wrap: wrap;
    min-height: 0;
}
.footer-left {
    display: flex;
    align-items: center;
    white-space: nowrap;
    flex-shrink: 0;
}
.footer-logo {
    color: var(--emerald);
    font-weight: 700;
}
.footer-sep {
    color: var(--text-muted);
    margin: 0 0.3rem;
}
.footer-center {
    display: flex;
    gap: 3px;
    flex-wrap: wrap;
    align-items: center;
}
.footer-action-btn {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 0.5px;
    padding: 0.25rem 0.5rem;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.15s;
    line-height: 1.2;
    white-space: nowrap;
}
.footer-action-btn:hover {
    color: var(--emerald);
    border-color: var(--emerald);
}
.footer-action-btn.demo-btn {
    border-color: var(--amber-muted);
    color: var(--amber);
}
.footer-action-btn.demo-btn:hover {
    background: var(--amber-muted);
    color: #fff;
    border-color: var(--amber);
}
.footer-right {
    white-space: nowrap;
    flex-shrink: 0;
    font-size: 0.55rem;
    opacity: 0.6;
}

/* ==========================
   SAVE INDICATOR
   ========================== */
.save-indicator {
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    opacity: 0.7;
    transition: opacity 0.3s;
    min-width: 60px;
}
.save-indicator.status-saving { opacity: 0.9; }
.save-indicator.status-error { opacity: 1; color: var(--rust); }
.save-dot {
    display: inline-block;
    width: 7px; height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}
.save-dot.saving {
    background: var(--amber);
    animation: save-pulse 1s ease-in-out infinite;
}
.save-dot.saved { background: var(--emerald); }
.save-dot.error { background: var(--rust); }
@keyframes save-pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* ==========================
   BACKUP BROWSER MODAL
   ========================== */
.backup-browser-modal {
    max-width: 520px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}
.backup-list {
    max-height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-right: 4px;
}
.backup-loading, .backup-empty {
    text-align: center;
    padding: 24px;
    opacity: 0.6;
    font-size: 0.85rem;
}
.backup-entry {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    transition: border-color 0.15s;
}
.backup-entry:hover {
    border-color: var(--emerald);
}
.backup-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.backup-date {
    font-size: 0.82rem;
    font-weight: 600;
    font-family: var(--font-mono);
}
.backup-ago {
    font-size: 0.7rem;
    opacity: 0.55;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.backup-stats {
    font-size: 0.75rem;
    opacity: 0.6;
    white-space: nowrap;
}
.backup-restore-btn {
    font-size: 0.7rem !important;
    padding: 4px 10px !important;
    flex-shrink: 0;
}

/* ==========================
   MOBILE NAV
   ========================== */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: 1px solid var(--border);
    padding: 8px;
    cursor: pointer;
    margin-left: 0.5rem;
}
.hamburger-line {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--emerald);
    transition: all 0.2s;
}
.mobile-menu-btn.open .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}
.mobile-menu-btn.open .hamburger-line:nth-child(2) {
    opacity: 0;
}
.mobile-menu-btn.open .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(4px, -4px);
}

.mobile-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.95);
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 2rem;
}
.mobile-nav.hidden {
    display: none;
}
.mobile-nav-btn {
    font-family: var(--font-display);
    font-size: 1.4rem;
    letter-spacing: 3px;
    padding: 1rem 2rem;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    width: 100%;
    max-width: 400px;
    text-align: center;
}
.mobile-nav-btn:hover,
.mobile-nav-btn:active {
    color: var(--emerald);
    border-color: var(--emerald);
    background: var(--bg-tertiary);
}
.mobile-nav-btn.active {
    color: var(--emerald);
    border-color: var(--emerald);
    background: var(--bg-secondary);
}

/* ---- MOBILE BOTTOM BAR (panel toggles) ---- */
.mobile-bottom-bar {
    display: none; /* shown at 900px */
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 56px;
    background: var(--bg-primary);
    border-top: 1px solid var(--border);
    z-index: 801;
    align-items: stretch;
    gap: 0;
}
.mobile-bar-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 1px;
    padding: 6px 0;
    transition: color 0.15s, background 0.15s;
}
.mobile-bar-btn:active,
.mobile-bar-btn.active {
    color: var(--emerald);
    background: var(--bg-secondary);
}
.mobile-bar-icon {
    font-size: 1.3rem;
    line-height: 1;
}
.mobile-bar-label {
    font-size: 0.55rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

/* ==========================
   RESPONSIVE
   ========================== */
@media (max-width: 1200px) {
    .planner-layout {
        grid-template-columns: 200px minmax(0, 1fr) 220px;
    }
}
@media (max-width: 900px) {
    #tab-planner.active {
        height: auto;
        overflow: visible;
    }
    .planner-layout {
        grid-template-columns: 1fr;
        height: auto;
        overflow: visible;
    }
    /* Hide sidebars by default — shown as overlays via JS */
    .plant-palette, .bed-details {
        display: none;
        border: none;
    }
    /* When toggled open, show as slide-up overlay */
    .plant-palette.mobile-open,
    .bed-details.mobile-open {
        display: flex;
        flex-direction: column;
        position: fixed;
        left: 0; right: 0;
        bottom: 56px; /* above bottom bar */
        z-index: 800;
        max-height: 65vh;
        background: var(--bg-secondary);
        border-top: 2px solid var(--emerald);
        box-shadow: 0 -4px 24px rgba(0,0,0,0.5);
        overflow-y: auto;
        padding: 1rem;
        animation: mobileSlideUp 0.2s ease-out;
    }
    .plant-palette.mobile-open .plant-list {
        max-height: 40vh;
    }
    @keyframes mobileSlideUp {
        from { transform: translateY(30px); opacity: 0.7; }
        to   { transform: translateY(0); opacity: 1; }
    }
    /* Backdrop when panel is open */
    .mobile-panel-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 799;
    }

    /* ---- TODAY DASHBOARD: collapsible on mobile ---- */
    .today-dashboard {
        border: 1px solid var(--border);
        border-radius: var(--radius);
        margin-bottom: 0.5rem;
    }
    .today-header {
        cursor: pointer;
        padding: 0.5rem 0.75rem;
    }
    .today-dashboard.mobile-collapsed .today-tasks-list {
        display: none;
    }
    .today-dashboard.mobile-collapsed .season-progress {
        display: none;
    }
    .today-title-row::after {
        content: '▾';
        margin-left: auto;
        font-size: 0.8rem;
        color: var(--text-muted);
        transition: transform 0.2s;
    }
    .today-dashboard.mobile-collapsed .today-title-row::after {
        content: '▸';
    }

    /* ---- TOOLBAR: compact on mobile ---- */
    .canvas-toolbar { flex-direction: column; gap: 0.3rem; padding: 0.4rem 0.5rem; }
    .toolbar-right { flex-wrap: wrap; gap: 3px; }
    /* Hide secondary toolbar buttons on mobile */
    #btn-stats-toggle, #btn-grid-toggle, #btn-save,
    #btn-load, #btn-export, #btn-print-map, #btn-share-url {
        display: none;
    }

    /* ---- CONTAINER SHELF: horizontal scroll ---- */
    .container-shelf {
        overflow-x: auto;
        flex-wrap: nowrap;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding: 4px 8px;
    }
    .container-shelf::-webkit-scrollbar { display: none; }

    /* ---- CANVAS: maximize space ---- */
    .garden-canvas-area {
        height: calc(100vh - 56px); /* full height minus bottom bar */
        overflow: hidden;
    }
    .garden-viewport {
        height: calc(100% - 80px); /* minus toolbar + shelf */
    }

    .palette-resize-handle,
    .sidebar-resize-handle,
    .section-resize-handle {
        display: none;
    }
    /* Show mobile bottom bar */
    .mobile-bottom-bar { display: flex; }
    /* Garden Buddy FAB: above bottom bar */
    .gb-fab { bottom: 72px; right: 16px; }
    .gb-panel { bottom: 136px; }
    /* canvas-based layout — no grid rules needed */
    .header-nav { display: none; }
    .mobile-menu-btn { display: flex; }
    .volunteers-grid { grid-template-columns: 1fr; }
    .harvest-layout { padding: 1rem; }
    .harvest-stats-row { grid-template-columns: repeat(2, 1fr); }
    .harvest-form-row { flex-direction: column; }
    .harvest-entry { flex-wrap: wrap; }
    .climate-grid { grid-template-columns: 1fr; }
    .rainfall-deficit-card { grid-column: span 1; }
    .deficit-summary { grid-template-columns: repeat(2, 1fr); }
    .deficit-verdict { grid-column: span 1; }
    .weather-current-row { grid-template-columns: 1fr; }
    .forecast-grid { grid-template-columns: repeat(4, 1fr); }
    .schedule-layout, .climate-layout, .volunteers-layout, .visualize-layout {
        padding: 1rem;
    }
    .frost-badges { flex-wrap: wrap; }
    #main-header { padding: 0.5rem 0.75rem; }
    .logo-text h1 { font-size: 1.3rem; }
    .zone-badge { font-size: 0.6rem; padding: 0.3rem 0.5rem; }
    /* Footer */
    .main-footer {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
        margin-bottom: 56px; /* above bottom bar */
    }
    .footer-center { flex-wrap: wrap; justify-content: center; }
}

/* ---- PHONE-SPECIFIC (iPhone 16 / Galaxy S24) ---- */
@media (max-width: 480px) {
    /* Canvas-based layout — containers are absolutely positioned by JS */
    .garden-viewport {
        padding: 0;
    }
    .container-shelf {
        padding: 3px 6px;
        gap: 4px;
    }
    .shelf-btn {
        font-size: 0.5rem;
        padding: 2px 5px;
    }
    /* Header: compact */
    #main-header {
        padding: 0.4rem 0.5rem;
        gap: 0.25rem;
    }
    .fist-icon { width: 28px; height: 28px; }
    .logo-text h1 { font-size: 1.1rem; letter-spacing: 1px; }
    .logo-text .tagline { font-size: 0.5rem; letter-spacing: 1px; }
    .zone-badge { font-size: 0.5rem; padding: 0.2rem 0.4rem; }
    .zone-badge::before { display: none; }
    /* Toolbar: tighter */
    .canvas-toolbar { padding: 0.4rem 0.5rem; }
    .toolbar-sublabel { display: none; }
    .tool-btn {
        /* Bumped from 0.55rem on mobile — was unreadable + untappable. */
        font-size: 0.72rem;
        padding: 0.45rem 0.6rem;
        letter-spacing: 0.5px;
    }
    /* Hide desktop-only things */
    .shortcut-hints { display: none; }
    .plant-hover-card { display: none !important; }
    /* Plant palette: more compact */
    .plant-palette { padding: 0.5rem; }
    .plant-list { max-height: 25vh; }
    .section-title { font-size: 0.85rem; }
    /* Bed details sidebar */
    .bed-details { padding: 0.5rem; }
    .bed-details .subsection-title { font-size: 0.7rem; }
    /* Stats dashboard: 2-col on phone */
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .mini-stat { padding: 0.25rem 0.35rem; }
    .mini-stat-val { font-size: 1rem; }
    .mini-stat-label { font-size: 0.6rem; /* bumped from 0.45 */ }
    /* Harvest stats cards */
    .harvest-stats-row { grid-template-columns: 1fr 1fr; gap: 0.5rem; }
    .harvest-stat-card { padding: 0.5rem; }
    .harvest-stat-value { font-size: 1.3rem; }
    .harvest-stat-label { font-size: 0.55rem; }
    /* Harvest goals */
    .harvest-goals-form { flex-wrap: wrap; }
    /* Weather */
    .forecast-grid { grid-template-columns: repeat(3, 1fr); }
    .forecast-day:nth-child(n+7) { display: none; }
    .weather-big-value { font-size: 2rem; }
    /* Mobile nav buttons: bigger touch targets */
    .mobile-nav-btn { font-size: 1.1rem; padding: 0.75rem 1.5rem; }
    /* Footer: full-width buttons */
    .footer-center {
        flex-direction: column;
        width: 100%;
    }
    .footer-action-btn {
        width: 100%;
        padding: 0.5rem;
        font-size: 0.65rem;
    }
    .footer-left, .footer-right {
        font-size: 0.55rem;
    }
    /* Forms: prevent iOS zoom on focus */
    input[type="text"],
    input[type="number"],
    input[type="date"],
    input[type="password"],
    select,
    textarea {
        font-size: 16px !important;
    }
    /* Toast: full-width on phone */
    .toast-notification {
        left: 0.75rem;
        right: 0.75rem;
        max-width: none;
        text-align: center;
    }
    /* Modals: ensure they fit */
    .modal-content {
        max-width: calc(100vw - 1.5rem);
        max-height: 85vh;
        overflow-y: auto;
    }
    .confirm-modal {
        max-width: calc(100vw - 1.5rem);
    }
    /* Frost badges */
    .frost-badges { gap: 0.25rem; }
    .frost-badge { padding: 0.35rem 0.5rem; }
    /* Viz tab */
    .viz-config { padding: 0; }
    .viz-api-row { flex-direction: column; }
    /* Schedule */
    .schedule-header-bar { flex-direction: column; gap: 0.5rem; }
    .filter-btn { font-size: 0.6rem; padding: 0.3rem 0.5rem; }
}

/* ==========================
   SQUARE FOOT GRID OVERLAY
   ========================== */
.garden-bed.show-grid::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(90deg, transparent, transparent calc(100% / 10 - 1px), rgba(var(--emerald-rgb),0.25) calc(100% / 10 - 1px), rgba(var(--emerald-rgb),0.25) calc(100% / 10)),
        repeating-linear-gradient(0deg, transparent, transparent calc(100% / 5 - 1px), rgba(var(--emerald-rgb),0.25) calc(100% / 5 - 1px), rgba(var(--emerald-rgb),0.25) calc(100% / 5));
    pointer-events: none;
    z-index: 1;
}
.garden-bed.show-grid .bed-label {
    color: var(--emerald);
}

/* ==========================
   SCHEDULE TASK TRACKER
   ========================== */
.schedule-tasks {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.task-month-group {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-left: 3px solid var(--emerald);
    overflow: hidden;
}
.task-month-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 1rem;
    background: var(--bg-tertiary);
    cursor: pointer;
    user-select: none;
}
.task-month-header:hover { background: var(--bg-elevated); }
.task-month-name {
    font-family: var(--font-display);
    font-size: 1rem;
    letter-spacing: 1px;
}
.task-month-progress {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}
.task-month-progress .done-count { color: var(--emerald); }
.task-month-body {
    padding: 0;
}
.task-month-body.collapsed { display: none; }

.sched-task-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    border-bottom: 1px dotted var(--border);
    transition: background 0.1s;
}
.sched-task-item:last-child { border-bottom: none; }
.sched-task-item:hover { background: rgba(var(--emerald-rgb),0.03); }

.sched-task-check {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    background: var(--bg-primary);
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: var(--emerald);
    transition: all 0.15s;
}
.sched-task-check:hover { border-color: var(--emerald); }
.sched-task-check.done {
    background: var(--emerald-dark);
    border-color: var(--emerald);
}
.sched-task-content { flex: 1; }
.sched-task-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}
.sched-task-title.done {
    text-decoration: line-through;
    color: var(--text-muted);
}
.sched-task-date {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--teal);
    letter-spacing: 0.5px;
    margin-top: 0.15rem;
}
.sched-task-detail {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-top: 0.25rem;
}
.sched-task-detail.done { color: var(--text-muted); }
.sched-task-type {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    letter-spacing: 1px;
    padding: 0.1rem 0.4rem;
    border-radius: var(--radius);
    white-space: nowrap;
    flex-shrink: 0;
    margin-top: 2px;
}
.sched-task-type.seed-indoor { background: rgba(124,58,237,0.2); color: #a78bfa; }
.sched-task-type.transplant { background: rgba(var(--emerald-rgb),0.2); color: var(--emerald); }
.sched-task-type.direct-sow { background: rgba(20,184,166,0.2); color: var(--teal); }
.sched-task-type.harvest { background: rgba(var(--amber-rgb),0.2); color: var(--amber); }

/* ==========================
   MODAL
   ========================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.modal-content {
    background: var(--bg-secondary);
    border: 2px solid var(--emerald);
    padding: 1.5rem 2rem;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}
.preset-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.preset-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    padding: 1rem;
    cursor: pointer;
    transition: all 0.15s;
}
.preset-card:hover {
    border-color: var(--emerald);
    background: var(--bg-elevated);
}
.preset-card h3 {
    font-family: var(--font-display);
    font-size: 1rem;
    letter-spacing: 1px;
    margin-bottom: 0.25rem;
}
.preset-card .preset-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}
.preset-card .preset-plants {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.4rem;
    letter-spacing: 0.5px;
}

/* ==========================
   CONFIRMATION MODAL
   ========================== */
.confirm-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fade-in 0.15s ease-out;
}
@keyframes fade-in {
    0% { opacity: 0; }
    100% { opacity: 1; }
}
.confirm-modal {
    background: var(--bg-secondary);
    border: 2px solid var(--red-accent);
    padding: 1.5rem 2rem;
    max-width: 380px;
    width: 90%;
    text-align: center;
    animation: modal-pop 0.2s ease-out;
}
@keyframes modal-pop {
    0% { transform: scale(0.9); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}
.confirm-modal h3 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    letter-spacing: 1px;
    color: var(--red-accent);
    margin-bottom: 0.5rem;
}
.confirm-modal p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    line-height: 1.4;
}
.confirm-modal .confirm-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

/* Qty flyup animation */
.qty-flyup {
    position: absolute;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--emerald);
    pointer-events: none;
    z-index: 100;
    animation: flyup 0.6s ease-out forwards;
}
.qty-flyup.minus { color: var(--red-accent); }
@keyframes flyup {
    0% { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(-30px); opacity: 0; }
}

/* ==========================
   ANIMATIONS
   ========================== */
/* Plant placement pop-in */
@keyframes plant-pop-in {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}
@keyframes plant-fade-out {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(0.5); opacity: 0; }
}
.placed-plant {
    animation: plant-pop-in 0.25s ease-out;
}
.placed-plant.removing {
    animation: plant-fade-out 0.2s ease-in forwards;
    pointer-events: none;
}

/* Bed highlight pulse when selected in sidebar */
@keyframes bed-pulse {
    0% { box-shadow: 0 0 0 0 rgba(var(--emerald-rgb),0.4); }
    70% { box-shadow: 0 0 0 8px rgba(var(--emerald-rgb),0); }
    100% { box-shadow: 0 0 0 0 rgba(var(--emerald-rgb),0); }
}
.garden-bed.active-highlight {
    border-color: var(--emerald) !important;
    animation: bed-pulse 0.6s ease-out;
}

/* Toast slide-in */
@keyframes toast-slide-in {
    0% { transform: translateX(100%); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}
@keyframes toast-slide-out {
    0% { transform: translateX(0); opacity: 1; }
    100% { transform: translateX(100%); opacity: 0; }
}
.toast-notification {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    background: var(--emerald);
    color: #000;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.65rem 1.25rem;
    z-index: 9999;
    letter-spacing: 1px;
    border-left: 4px solid #000;
    animation: toast-slide-in 0.3s ease-out;
    max-width: 320px;
}
.toast-notification.toast-leaving {
    animation: toast-slide-out 0.3s ease-in forwards;
}

/* Empty bed overlay */
.bed-empty-hint {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 1;
    opacity: 0.4;
    transition: opacity 0.2s;
}
.garden-bed:hover .bed-empty-hint {
    opacity: 0.6;
}
.bed-empty-hint .hint-icon {
    font-size: 1.8rem;
    margin-bottom: 0.25rem;
}
.bed-empty-hint .hint-text {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--text-muted);
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Plant info panel slide-up animation */
.plant-info-panel {
    transition: transform 0.25s ease-out, opacity 0.25s ease-out;
    transform: translateY(0);
}
.plant-info-panel.hidden {
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
}

/* Total plant count badge in toolbar */
.total-plant-count {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 1px;
    color: var(--emerald);
    padding: 0.3rem 0.6rem;
    border: 1px solid var(--border);
    background: var(--bg-tertiary);
}
.total-plant-count .count-num {
    font-weight: 700;
    font-size: 0.8rem;
}

/* Drag ghost preview */
.drag-ghost {
    position: fixed;
    pointer-events: none;
    z-index: 10001;
    font-size: 2rem;
    opacity: 0.85;
    filter: drop-shadow(0 2px 8px rgba(var(--emerald-rgb),0.4));
    transition: none;
}

/* Bed hover highlight during drag */
.garden-bed.drag-over {
    border-color: var(--emerald);
    box-shadow: inset 0 0 30px rgba(16, 185, 129, 0.15), 0 0 15px rgba(16, 185, 129, 0.2);
    transition: box-shadow 0.15s, border-color 0.15s;
}

/* Soil texture variations per bed */
.garden-bed:nth-child(1) {
    background: #1a1208;
    background-image: radial-gradient(ellipse at 20% 30%, rgba(45,35,15,0.5) 0%, transparent 50%),
                       radial-gradient(ellipse at 80% 70%, rgba(50,38,18,0.4) 0%, transparent 45%);
}
.garden-bed:nth-child(2) {
    background: #1c1409;
    background-image: radial-gradient(ellipse at 70% 20%, rgba(55,40,15,0.5) 0%, transparent 55%),
                       radial-gradient(ellipse at 30% 80%, rgba(40,30,12,0.4) 0%, transparent 40%);
}
.garden-bed:nth-child(3) {
    background: #19110a;
    background-image: radial-gradient(ellipse at 50% 50%, rgba(48,36,16,0.5) 0%, transparent 60%),
                       radial-gradient(ellipse at 10% 10%, rgba(42,32,14,0.3) 0%, transparent 35%);
}
.garden-bed:nth-child(4) {
    background: #1b130b;
    background-image: radial-gradient(ellipse at 30% 60%, rgba(52,40,18,0.5) 0%, transparent 50%),
                       radial-gradient(ellipse at 90% 30%, rgba(38,28,12,0.4) 0%, transparent 45%);
}

/* Smooth tab transitions */
.tab-content {
    display: none;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.25s ease-out, transform 0.25s ease-out;
}
.tab-content.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
    animation: tab-fade-in 0.25s ease-out;
}
@keyframes tab-fade-in {
    0% { opacity: 0; transform: translateY(6px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Grungy texture overlays for anarchist feel */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='100' height='100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100' height='100' filter='url(%23n)' opacity='0.02'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 9999;
}

/* ==========================
   TODAY'S TASKS DASHBOARD
   ========================== */
.today-dashboard {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1.25rem;
}
.today-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.5rem;
}
.today-title-row {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
}
.today-title {
    font-family: var(--font-display);
    font-size: 1rem;
    letter-spacing: 2px;
    color: var(--emerald);
    white-space: nowrap;
}
.today-date {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-muted);
    letter-spacing: 1px;
}
/* Season progress bar */
.season-progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}
.season-progress-bar {
    width: 120px;
    height: 6px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    overflow: hidden;
}
.season-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--emerald-dark), var(--emerald), var(--amber));
    transition: width 0.3s ease;
}
.season-progress-label {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    white-space: nowrap;
}
/* Tasks collapse toggle */
.tasks-toggle-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.75rem;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: all 0.15s;
}
.tasks-toggle-btn:hover {
    border-color: var(--emerald);
    color: var(--emerald);
}
.today-dashboard.tasks-collapsed .today-tasks-list {
    display: none;
}
.today-dashboard.tasks-collapsed .season-progress {
    display: none;
}
.today-dashboard.tasks-collapsed .today-header {
    margin-bottom: 0;
}

/* Task list */
.today-tasks-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.today-task-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.6rem;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    border: 1px solid var(--border);
    background: var(--bg-tertiary);
    cursor: default;
    transition: all 0.15s;
}
.today-task-chip:hover {
    border-color: var(--text-muted);
}
.today-task-chip .chip-emoji {
    font-size: 0.85rem;
}
.today-task-chip.chip-seed-indoor {
    border-left: 3px solid #7c3aed;
}
.today-task-chip.chip-transplant {
    border-left: 3px solid var(--emerald);
}
.today-task-chip.chip-direct-sow {
    border-left: 3px solid var(--teal);
}
.today-task-chip.chip-harvest {
    border-left: 3px solid var(--amber);
}
.today-task-chip.chip-water {
    border-left: 3px solid #3b82f6;
}
.today-task-chip.chip-overdue {
    border-color: var(--red-accent);
    background: rgba(var(--red-rgb),0.08);
}
.today-task-chip.chip-overdue .chip-label {
    color: var(--red-accent);
}
.today-task-chip .chip-label {
    color: var(--text-primary);
}
.today-task-chip .chip-type {
    font-size: 0.5rem;
    color: var(--text-muted);
}
.today-no-tasks {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-secondary);
    padding: 0.25rem 0;
}
.today-no-tasks .all-good {
    color: var(--emerald);
}
@media (max-width: 900px) {
    .today-header { flex-direction: column; align-items: flex-start; gap: 0.4rem; }
}
@media (max-width: 480px) {
    .today-dashboard { padding: 0.5rem 0.75rem; }
    .today-title { font-size: 0.85rem; }
    .season-progress-bar { width: 80px; }
}

/* ============================================
   LIGHT THEME OVERRIDES
   ============================================ */
:root[data-theme="light"] body {
    background: var(--bg-primary);
}
[data-theme="light"] #main-header {
    background: var(--bg-secondary);
    border-bottom-color: var(--border);
}
[data-theme="light"] .nav-btn {
    color: var(--text-primary);
}
[data-theme="light"] .nav-btn.active,
[data-theme="light"] .nav-btn:hover {
    background: var(--emerald);
    color: #fff;
}
[data-theme="light"] .zone-badge {
    border-color: var(--emerald);
}
[data-theme="light"] .marquee-banner {
    background: var(--emerald);
    color: #fff;
}
[data-theme="light"] .garden-viewport {
    background: #e8e4dc;
}
[data-theme="light"] .garden-canvas::before {
    background:
        repeating-linear-gradient(90deg, rgba(0,0,0,0.04) 0px, rgba(0,0,0,0.04) 1px, transparent 1px, transparent 40px),
        repeating-linear-gradient(0deg, rgba(0,0,0,0.04) 0px, rgba(0,0,0,0.04) 1px, transparent 1px, transparent 40px);
}
[data-theme="light"] .garden-bed {
    background: #c9b896 !important;
    border-color: #a89070;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.1) !important;
    background-image: none !important;
}
[data-theme="light"] .garden-bed::before {
    background:
        repeating-linear-gradient(90deg, transparent, transparent 39px, rgba(0,0,0,0.06) 39px, rgba(0,0,0,0.06) 40px),
        repeating-linear-gradient(0deg, transparent, transparent 39px, rgba(0,0,0,0.06) 39px, rgba(0,0,0,0.06) 40px);
}
[data-theme="light"] .garden-bed.coverage-low {
    background: #c9bc98 !important;
}
[data-theme="light"] .garden-bed.coverage-med {
    background: #b8be90 !important;
}
[data-theme="light"] .garden-bed.coverage-high {
    background: #a4b885 !important;
}
[data-theme="light"] .garden-bed.coverage-full {
    background: #92b47a !important;
}
[data-theme="light"] .placed-plant .plant-tooltip {
    background: rgba(255,255,255,0.95);
    color: #1a1a1a;
    border-color: var(--border);
}
[data-theme="light"] .bed-label {
    color: #333;
    text-shadow: 0 1px 2px rgba(255,255,255,0.5);
}
[data-theme="light"] .bed-count-badge {
    background: rgba(255,255,255,0.85);
    color: #333;
}
[data-theme="light"] .tool-btn {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border-color: var(--border);
}
[data-theme="light"] .tool-btn:hover {
    border-color: var(--emerald);
}
[data-theme="light"] .tool-btn.accent {
    background: var(--emerald);
    color: #fff;
}
[data-theme="light"] .section-title,
[data-theme="light"] .subsection-title {
    color: var(--text-primary);
    border-bottom-color: var(--border);
}
[data-theme="light"] .plant-item {
    background: var(--bg-elevated);
    border-color: var(--border);
}
[data-theme="light"] .plant-item:hover {
    border-color: var(--emerald);
}
[data-theme="light"] .plant-expand-panel {
    background: var(--bg-secondary);
    border-color: var(--border);
}
[data-theme="light"] .bed-tab {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border);
}
[data-theme="light"] .bed-tab.active {
    background: var(--emerald);
    color: #fff;
}
[data-theme="light"] .today-dashboard {
    background: var(--bg-elevated);
    border-color: var(--border);
}
[data-theme="light"] .today-task-chip {
    background: var(--bg-secondary);
    border-color: var(--border);
    color: var(--text-primary);
}
[data-theme="light"] .stat-row {
    border-bottom-color: var(--border);
}
[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: #c0bbb3;
}
[data-theme="light"] .text-input,
[data-theme="light"] .quick-add-select,
[data-theme="light"] select {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border-color: var(--border);
}
/* Link across to the other edition of the same app (/fable/). */
.edition-link {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-decoration: none;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.3rem 0.5rem;
    white-space: nowrap;
    transition: color 0.15s, border-color 0.15s;
}
.edition-link:hover {
    color: var(--emerald);
    border-color: var(--emerald);
}
/* On phones the header is already tight — the almanac lives in the nav drawer
   instead (.mobile-nav-link). */
@media (max-width: 900px) {
    .header-right .edition-link { display: none; }
}
.mobile-nav-link {
    text-decoration: none;
    display: block;
}

/* Theme toggle button */
.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.6rem;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius);
    cursor: pointer;
    letter-spacing: 0.5px;
    transition: border-color 0.2s;
}
.theme-toggle:hover {
    border-color: var(--emerald);
    color: var(--text-primary);
}

/* ---- CUSTOM SEED MODAL ---- */
.modal-overlay {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(0,0,0,0.75); backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    padding: 1rem;
}
.modal-overlay.hidden { display: none; }
.custom-seed-modal {
    background: var(--bg-secondary); border: 1px solid var(--emerald);
    border-radius: 6px; width: 100%; max-width: 580px; max-height: 90vh;
    display: flex; flex-direction: column; overflow: hidden;
    box-shadow: 0 12px 48px rgba(0,0,0,0.7);
}
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.75rem 1rem; border-bottom: 1px solid rgba(var(--emerald-rgb),0.2);
}
.modal-title {
    font-family: var(--font-display); font-size: 1rem;
    letter-spacing: 1px; color: var(--emerald); margin: 0;
}
.modal-close {
    background: none; border: none; color: var(--text-muted);
    font-size: 1.4rem; cursor: pointer; line-height: 1;
}
.modal-close:hover { color: var(--text-primary); }
.modal-tabs {
    display: flex; gap: 0; border-bottom: 1px solid rgba(var(--emerald-rgb),0.15);
}
.modal-tab {
    flex: 1; padding: 0.5rem; background: none; border: none;
    font-family: var(--font-mono); font-size: 0.7rem; font-weight: 600;
    letter-spacing: 0.5px; color: var(--text-muted); cursor: pointer;
    border-bottom: 2px solid transparent; transition: all 0.2s;
}
.modal-tab:hover { color: var(--text-primary); }
.modal-tab.active {
    color: var(--emerald); border-bottom-color: var(--emerald);
}
.modal-body {
    flex: 1; overflow-y: auto; padding: 0.75rem 1rem;
}
.modal-footer {
    display: flex; align-items: center; justify-content: flex-end;
    gap: 0.5rem; padding: 0.6rem 1rem;
    border-top: 1px solid rgba(var(--emerald-rgb),0.15);
}

/* Photo upload */
.photo-upload-area {
    border: 2px dashed rgba(var(--emerald-rgb),0.3); border-radius: 6px;
    padding: 1.5rem; text-align: center; margin-bottom: 0.75rem;
    transition: border-color 0.2s; min-height: 120px;
    display: flex; align-items: center; justify-content: center;
}
.photo-upload-area.drag-active { border-color: var(--emerald); background: rgba(var(--emerald-rgb),0.05); }
.upload-prompt { color: var(--text-muted); }
.upload-icon { font-size: 2rem; display: block; margin-bottom: 0.4rem; }
.upload-prompt p { font-family: var(--font-mono); font-size: 0.7rem; margin: 0.3rem 0; }
.upload-hint { font-size: 0.6rem !important; opacity: 0.6; }
.link-btn {
    background: none; border: none; color: var(--emerald);
    text-decoration: underline; cursor: pointer; font-family: var(--font-mono);
    font-size: 0.7rem;
}
.photo-preview { position: relative; }
.photo-preview img {
    width: 100%; max-height: 250px; object-fit: contain;
    border-radius: 4px; border: 1px solid rgba(var(--emerald-rgb),0.2);
}
.photo-preview .tool-btn {
    position: absolute; top: 0.3rem; right: 0.3rem;
}

/* OCR */
.ocr-status { margin: 0.5rem 0; }
.ocr-progress-bar {
    height: 4px; background: rgba(var(--emerald-rgb),0.15); border-radius: 2px;
    overflow: hidden; margin-bottom: 0.3rem;
}
.ocr-progress-fill {
    height: 100%; background: var(--emerald); border-radius: 2px;
    width: 0%; transition: width 0.3s;
}
.ocr-status-text {
    font-family: var(--font-mono); font-size: 0.65rem; color: var(--text-muted);
}
.ocr-raw { margin: 0.6rem 0; }
.ocr-raw textarea {
    width: 100%; background: var(--bg-primary); color: var(--text-secondary);
    border: 1px solid rgba(var(--emerald-rgb),0.2); border-radius: 4px;
    font-family: var(--font-mono); font-size: 0.65rem; padding: 0.4rem;
    resize: vertical;
}

/* Form */
.form-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem;
}
.form-group { display: flex; flex-direction: column; gap: 0.2rem; }
.form-group.full-width { grid-column: 1 / -1; }
.form-label {
    font-family: var(--font-mono); font-size: 0.6rem; font-weight: 600;
    letter-spacing: 0.5px; color: var(--text-muted);
}
.form-input {
    background: var(--bg-primary); color: var(--text-primary);
    border: 1px solid rgba(var(--emerald-rgb),0.2); border-radius: 3px;
    font-family: var(--font-mono); font-size: 0.7rem;
    padding: 0.35rem 0.5rem; outline: none; transition: border-color 0.2s;
}
.form-input:focus { border-color: var(--emerald); }
.form-input::placeholder { color: var(--text-muted); opacity: 0.5; }
select.form-input { cursor: pointer; }
textarea.form-input { resize: vertical; }

/* Custom plant badge in palette */
.custom-badge {
    font-family: var(--font-mono); font-size: 0.5rem; font-weight: 600;
    background: rgba(168,85,247,0.2); color: #c084fc; padding: 0.1rem 0.3rem;
    border-radius: 2px; letter-spacing: 0.3px; margin-left: 0.3rem;
}
.seed-pkt-badge {
    background: rgba(var(--emerald-rgb),0.2); color: #6ee7b7;
}
.plant-item .custom-actions {
    display: none; margin-left: auto; gap: 0.2rem;
}
.plant-item:hover .custom-actions { display: flex; }
.custom-action-btn {
    background: none; border: none; color: var(--text-muted);
    cursor: pointer; font-size: 0.7rem; padding: 0.1rem 0.2rem;
}
.custom-action-btn:hover { color: var(--text-primary); }

/* ==================== GARDEN BUDDY AI CHAT ==================== */
.gb-fab {
    position: fixed; bottom: 24px; right: 24px; z-index: 9000;
    width: 56px; height: 56px; border-radius: 50%;
    background: var(--emerald); border: 2px solid var(--emerald-dark);
    color: white; font-size: 1.5rem; cursor: pointer;
    box-shadow: 0 4px 20px rgba(var(--emerald-rgb),0.4);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex; align-items: center; justify-content: center;
}
.gb-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 28px rgba(var(--emerald-rgb),0.6);
}
.gb-fab.active {
    background: var(--bg-tertiary); border-color: var(--border);
    color: var(--text-secondary);
}

.gb-panel {
    position: fixed; bottom: 90px; right: 24px; z-index: 9001;
    width: 400px; height: 560px;
    background: var(--bg-secondary); border: 1px solid var(--emerald-dark);
    border-radius: 12px; overflow: hidden;
    display: flex; flex-direction: column;
    box-shadow: 0 8px 40px rgba(0,0,0,0.5);
    animation: gbSlideUp 0.25s ease-out;
}
.gb-panel.hidden { display: none; }

@keyframes gbSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.gb-panel-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.6rem 0.8rem;
    background: linear-gradient(135deg, var(--emerald-dark), var(--emerald));
    flex-shrink: 0;
}
.gb-header-left { display: flex; align-items: center; gap: 0.5rem; }
.gb-logo { font-size: 1.2rem; }
.gb-title {
    font-family: var(--font-display); font-size: 0.95rem;
    color: white; letter-spacing: 1px;
}
.gb-header-right { display: flex; align-items: center; gap: 0.2rem; }
.gb-token-display {
    font-family: var(--font-mono); font-size: 0.55rem;
    color: rgba(255,255,255,0.5); letter-spacing: 0.3px;
    margin-left: 0.3rem;
}
.gb-clear-btn {
    background: none; border: none; color: rgba(255,255,255,0.5);
    font-size: 0.9rem; cursor: pointer; padding: 0 0.3rem;
    transition: color 0.15s;
}
.gb-clear-btn:hover { color: rgba(255,200,200,0.9); }
.gb-close-btn {
    background: none; border: none; color: rgba(255,255,255,0.8);
    font-size: 1.3rem; cursor: pointer; padding: 0 0.3rem;
    transition: color 0.15s;
}
.gb-close-btn:hover { color: white; }

.gb-key-row {
    display: flex; gap: 0.3rem; padding: 0.5rem 0.6rem;
    background: var(--bg-primary); border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.gb-key-row.saved { display: none; }
.gb-key-input {
    flex: 1; background: var(--bg-tertiary); border: 1px solid var(--border);
    color: var(--text-primary); font-family: var(--font-mono); font-size: 0.7rem;
    padding: 0.3rem 0.5rem; border-radius: 4px; outline: none;
}
.gb-key-input:focus { border-color: var(--emerald); }
.gb-key-btn {
    background: var(--emerald-dark); border: none; color: white;
    font-family: var(--font-condensed); font-size: 0.7rem; font-weight: 600;
    padding: 0.3rem 0.6rem; border-radius: 4px; cursor: pointer;
    letter-spacing: 0.5px;
}
.gb-key-btn:hover { background: var(--emerald); }

.gb-messages {
    flex: 1; overflow-y: auto; padding: 0.6rem;
    display: flex; flex-direction: column; gap: 0.5rem;
    scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}

.gb-msg { max-width: 92%; animation: gbFadeIn 0.2s ease-out; }
@keyframes gbFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}
.gb-msg-user {
    align-self: flex-end;
    background: var(--emerald-dark); color: white;
    padding: 0.5rem 0.7rem; border-radius: 12px 12px 2px 12px;
}
.gb-msg-bot {
    align-self: flex-start;
    background: var(--bg-tertiary); color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 0.5rem 0.7rem; border-radius: 12px 12px 12px 2px;
}
.gb-msg-text {
    font-family: var(--font-mono); font-size: 0.75rem;
    line-height: 1.5; word-wrap: break-word;
}
.gb-msg-text strong { color: var(--emerald-light); }
.gb-msg-text em { color: var(--text-secondary); font-style: italic; }

.gb-msg-action {
    align-self: center; text-align: center;
    background: rgba(var(--emerald-rgb),0.1); border: 1px dashed var(--emerald-dark);
    color: var(--emerald-light); padding: 0.3rem 0.6rem;
    border-radius: 6px; font-family: var(--font-mono); font-size: 0.65rem;
    letter-spacing: 0.3px; max-width: 100%;
}

.gb-typing {
    align-self: flex-start; padding: 0.5rem 0.7rem;
    background: var(--bg-tertiary); border: 1px solid var(--border);
    border-radius: 12px 12px 12px 2px;
    display: flex; gap: 4px; align-items: center;
}
.gb-typing-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--emerald); animation: gbBounce 1.4s infinite;
}
.gb-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.gb-typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes gbBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

.gb-input-row {
    display: flex; gap: 0.3rem; padding: 0.5rem 0.6rem;
    background: var(--bg-primary); border-top: 1px solid var(--border);
    flex-shrink: 0; align-items: flex-end;
}
.gb-input {
    flex: 1; background: var(--bg-tertiary); border: 1px solid var(--border);
    color: var(--text-primary); font-family: var(--font-mono); font-size: 0.75rem;
    padding: 0.4rem 0.6rem; border-radius: 8px; outline: none;
    resize: none; max-height: 80px; line-height: 1.4;
}
.gb-input:focus { border-color: var(--emerald); }
.gb-input::placeholder { color: var(--text-muted); opacity: 0.5; }
.gb-send-btn {
    background: var(--emerald); border: none; color: white;
    width: 34px; height: 34px; border-radius: 50%;
    font-size: 1rem; cursor: pointer; display: flex;
    align-items: center; justify-content: center;
    transition: background 0.15s;
    flex-shrink: 0;
}
.gb-send-btn:hover { background: var(--emerald-light); }
.gb-send-btn:disabled { background: var(--bg-tertiary); color: var(--text-muted); cursor: not-allowed; }

/* Attach / image upload */
.gb-attach-btn {
    background: transparent; border: 2px solid var(--border-color);
    color: var(--text-secondary); width: 34px; height: 34px; border-radius: 50%;
    font-size: 1.2rem; font-weight: bold; cursor: pointer; display: flex;
    align-items: center; justify-content: center; flex-shrink: 0;
    transition: all 0.15s ease;
}
.gb-attach-btn:hover { border-color: var(--emerald); color: var(--emerald); }

/* Image preview strip */
.gb-image-preview {
    display: flex; align-items: center; gap: 0.4rem;
    padding: 0.4rem 0.6rem; border-top: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}
.gb-image-preview.hidden { display: none; }
.gb-image-thumb-wrap {
    position: relative; display: inline-block;
}
.gb-image-thumb {
    width: 48px; height: 48px; object-fit: cover;
    border-radius: 6px; border: 1px solid var(--border-color);
}
.gb-image-remove {
    position: absolute; top: -6px; right: -6px;
    width: 18px; height: 18px; border-radius: 50%;
    background: var(--danger, #e74c3c); color: white; border: none;
    font-size: 0.65rem; cursor: pointer; display: flex;
    align-items: center; justify-content: center; line-height: 1;
    padding: 0;
}
.gb-image-remove:hover { background: #c0392b; }
.gb-image-label {
    font-size: 0.7rem; color: var(--text-muted);
    font-family: var(--font-mono); overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap; max-width: 200px;
}

/* Mobile responsive */
@media (max-width: 500px) {
    .gb-panel {
        width: calc(100vw - 16px); height: calc(100vh - 180px);
        bottom: 136px; right: 8px; left: 8px;
        border-radius: 12px;
    }
    .gb-fab { bottom: 72px; right: 16px; }
}

/* ============================================
   ELEVATED PUNK — Visual Polish Layer
   ============================================ */

/* --- Header gradient accent line --- */
.header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--emerald), var(--teal), var(--emerald), transparent);
    opacity: 0.6;
}

/* --- Section title gradient underline --- */
.section-title::after {
    content: '';
    display: block;
    width: 40px;
    height: 2px;
    background: var(--gradient-emerald);
    margin-top: 4px;
    border-radius: 1px;
    transition: width 0.3s ease;
}
.section-title:hover::after {
    width: 80px;
}

/* --- Card hover lift --- */
.bg-card, [class*="card"], .plant-info-panel, .confirm-modal {
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

/* --- Toast upgrade with gradient --- */
.toast-notification {
    background: linear-gradient(135deg, var(--emerald), var(--teal));
    box-shadow: 0 4px 20px rgba(var(--emerald-rgb),0.3), 0 0 40px rgba(var(--emerald-rgb),0.1);
    border-left: 4px solid rgba(0,0,0,0.3);
    border-radius: var(--radius);
}

/* --- Drag ghost glow upgrade --- */
.drag-ghost {
    filter: drop-shadow(0 0 12px rgba(var(--emerald-rgb),0.5)) drop-shadow(0 4px 8px rgba(0,0,0,0.4));
}

/* --- Bed drag-over glow upgrade --- */
.garden-bed.drag-over {
    box-shadow: inset 0 0 30px rgba(16, 185, 129, 0.15), var(--glow-emerald-lg);
}

/* --- Active highlight pulse upgrade --- */
@keyframes bed-glow-pulse {
    0% { box-shadow: 0 0 0 0 rgba(var(--emerald-rgb),0.5), 0 0 15px rgba(var(--emerald-rgb),0.2); }
    50% { box-shadow: 0 0 0 6px rgba(var(--emerald-rgb),0.15), 0 0 25px rgba(var(--emerald-rgb),0.15); }
    100% { box-shadow: 0 0 0 0 rgba(var(--emerald-rgb),0), 0 0 15px rgba(var(--emerald-rgb),0); }
}
.garden-bed.active-highlight {
    animation: bed-glow-pulse 0.8s ease-out;
}

/* --- Smooth page transitions for tab content --- */
@keyframes content-reveal {
    0% { opacity: 0; transform: translateY(8px); }
    100% { opacity: 1; transform: translateY(0); }
}
.tab-content-area > *:not([style*="display: none"]) {
    animation: content-reveal 0.3s ease-out;
}

/* --- Zone badge glow --- */
.zone-badge {
    text-shadow: 0 0 8px rgba(var(--emerald-rgb),0.4);
    box-shadow: inset 0 0 12px rgba(var(--emerald-rgb),0.08);
}

/* --- Button press effect --- */
.tool-btn:active {
    transform: scale(0.96);
    transition: transform 0.05s;
}
.tool-btn.accent:hover {
    box-shadow: var(--glow-emerald-sm);
}

/* --- Scrollbar styling --- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* --- Spacing radius glow upgrade --- */
.spacing-radius {
    box-shadow: 0 0 12px rgba(var(--emerald-rgb),0.2), inset 0 0 8px rgba(var(--emerald-rgb),0.08);
}

/* --- Companion line glow --- */
.companion-line-good {
    filter: drop-shadow(0 0 3px rgba(var(--emerald-rgb),0.4));
}
.companion-line-bad {
    filter: drop-shadow(0 0 3px rgba(var(--red-rgb),0.4));
}

/* --- Save/sync indicator polish --- */
#cloud-sync-indicator {
    transition: color 0.3s ease, opacity 0.3s ease;
}

/* --- Plant selected glow upgrade --- */
.placed-plant.selected {
    box-shadow: 0 0 0 3px var(--emerald), var(--glow-emerald-md) !important;
}

/* --- Focus visible glow for accessibility --- */
.nav-btn:focus-visible,
.tool-btn:focus-visible {
    outline: 2px solid var(--emerald);
    outline-offset: 2px;
    box-shadow: var(--glow-emerald-sm);
}

/* --- Smooth canvas transform --- */
#garden-canvas-wrapper {
    transition: transform 0.15s ease-out;
}

/* ============================================
   ELEVATED PUNK — Phase 2: Animations & Depth
   ============================================ */

/* --- Staggered plant library load --- */
@keyframes plant-slide-in {
    0% { opacity: 0; transform: translateX(-12px); }
    100% { opacity: 1; transform: translateX(0); }
}
.plant-item {
    animation: plant-slide-in 0.25s ease-out both;
}
.plant-item:nth-child(2) { animation-delay: 0.03s; }
.plant-item:nth-child(3) { animation-delay: 0.06s; }
.plant-item:nth-child(4) { animation-delay: 0.09s; }
.plant-item:nth-child(5) { animation-delay: 0.12s; }
.plant-item:nth-child(6) { animation-delay: 0.15s; }
.plant-item:nth-child(7) { animation-delay: 0.18s; }
.plant-item:nth-child(8) { animation-delay: 0.21s; }

/* --- Plant expand panel smooth reveal --- */
.plant-expand-panel {
    animation: content-reveal 0.2s ease-out;
}

/* --- Nav tab ink-spread effect --- */
.nav-btn {
    position: relative;
    overflow: hidden;
}
.nav-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(var(--emerald-rgb),0.15), transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.nav-btn:hover::before {
    opacity: 1;
}

/* --- Garden bed gradient overlay for depth --- */
.garden-bed {
    transition: box-shadow 0.25s ease, border-color 0.25s ease;
}
.garden-bed:hover:not(.selected) {
    box-shadow: inset 0 0 20px rgba(0,0,0,0.3), 0 0 12px rgba(var(--emerald-rgb),0.08);
    border-color: rgba(var(--emerald-rgb),0.4);
}

/* --- Bed tab active indicator slide --- */
.bed-tab {
    position: relative;
    overflow: hidden;
}
.bed-tab::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--emerald);
    transition: width 0.2s ease, left 0.2s ease;
}
.bed-tab.active::after {
    width: 100%;
    left: 0;
}

/* --- Placed plant hover glow ring --- */
.placed-plant {
    transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.placed-plant:hover {
    box-shadow: 0 0 0 2px rgba(var(--emerald-rgb),0.25), 0 0 10px rgba(var(--emerald-rgb),0.15);
}

/* --- Stats dashboard counter pop-in --- */
@keyframes stat-pop {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}
.stats-dashboard .mini-stat {
    animation: stat-pop 0.3s ease-out both;
}
.stats-dashboard .mini-stat:nth-child(2) { animation-delay: 0.08s; }
.stats-dashboard .mini-stat:nth-child(3) { animation-delay: 0.16s; }
.stats-dashboard .mini-stat:nth-child(4) { animation-delay: 0.24s; }

/* --- Filter button group — active state gradient --- */
.filter-btn.active {
    background: linear-gradient(180deg, rgba(var(--emerald-rgb),0.15), var(--bg-tertiary));
    box-shadow: 0 1px 0 var(--emerald);
    text-shadow: 0 0 8px rgba(var(--emerald-rgb),0.3);
}

/* --- Tool button ripple-like hover --- */
.tool-btn {
    position: relative;
    overflow: hidden;
}
.tool-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.04), transparent);
    opacity: 0;
    transition: opacity 0.15s ease;
}
.tool-btn:hover::after {
    opacity: 1;
}

/* --- Subsection title glow on hover --- */
.subsection-title {
    transition: color 0.2s ease, text-shadow 0.2s ease;
}
.subsection-title:hover {
    color: var(--text-secondary);
    text-shadow: 0 0 6px rgba(var(--emerald-rgb),0.15);
}

/* --- Today's Tasks banner gradient --- */
.today-tasks-bar {
    background: linear-gradient(135deg, rgba(var(--emerald-rgb),0.06), rgba(20,184,166,0.03), transparent) !important;
    border-bottom: 1px solid rgba(var(--emerald-rgb),0.15);
}

/* --- Plant palette sidebar gradient fade at bottom --- */
.plant-palette {
    position: relative;
}
.plant-palette::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: linear-gradient(transparent, var(--bg-secondary));
    pointer-events: none;
    z-index: 2;
}

/* --- Bed details stat rows — subtle emerald accent on hover --- */
.stat-row {
    transition: background 0.15s ease, padding-left 0.15s ease;
    border-radius: 2px;
}
.stat-row:hover {
    background: rgba(var(--emerald-rgb),0.04);
    padding-left: 4px;
}

/* --- Bed plant entry hover slide --- */
.bed-plant-entry {
    transition: border-left-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}
.bed-plant-entry:hover {
    border-left-color: var(--emerald);
    background: rgba(var(--emerald-rgb),0.06);
    transform: translateX(2px);
}

/* --- Container shelf button shine on hover --- */
.shelf-btn {
    position: relative;
    overflow: hidden;
}
.shelf-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(var(--emerald-rgb),0.12), transparent);
    transition: left 0.4s ease;
}
.shelf-btn:hover::before {
    left: 100%;
}

/* --- Modal backdrop blur --- */
.confirm-modal-overlay,
.modal-overlay {
    backdrop-filter: blur(4px);
}

/* --- Demo button special glow --- */
.footer-action-btn.demo-btn {
    position: relative;
}
.footer-action-btn.demo-btn::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(var(--amber-rgb),0.15), transparent);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.footer-action-btn.demo-btn:hover::after {
    opacity: 1;
}

/* --- Floating action button pulse (Garden Buddy) --- */
@keyframes fab-breathe {
    0%, 100% { box-shadow: 0 4px 20px rgba(var(--emerald-rgb),0.3); }
    50% { box-shadow: 0 4px 30px rgba(var(--emerald-rgb),0.5), 0 0 40px rgba(var(--emerald-rgb),0.15); }
}
.gb-fab {
    animation: fab-breathe 3s ease-in-out infinite;
}

/* --- Header logo shimmer --- */
@keyframes logo-shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}
.logo-text h1 .accent {
    background: linear-gradient(90deg, var(--emerald) 0%, var(--teal) 25%, #a7f3d0 50%, var(--teal) 75%, var(--emerald) 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: logo-shimmer 8s linear infinite;
}

/* --- Zoom level indicator glow at extremes --- */
.zoom-level {
    transition: color 0.2s ease, text-shadow 0.2s ease;
}

/* --- Bed details sidebar gradient top edge --- */
.bed-details::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--emerald), transparent);
    opacity: 0.3;
    z-index: 1;
}

/* --- Today's Tasks overdue items glow --- */
.today-task-item.overdue {
    border-left-color: var(--red-accent);
    box-shadow: inset 3px 0 8px rgba(var(--red-rgb),0.1);
}

/* --- Marquee ticker gradient mask edges --- */
.marquee-banner {
    -webkit-mask-image: linear-gradient(90deg, transparent, black 5%, black 95%, transparent);
    mask-image: linear-gradient(90deg, transparent, black 5%, black 95%, transparent);
}

/* --- Quick add dropdown glow --- */
.quick-add-select:focus {
    box-shadow: var(--glow-emerald-sm);
}

/* --- Search input focus glow --- */
.search-input:focus {
    box-shadow: 0 0 0 1px var(--emerald-dark), var(--glow-emerald-sm);
}

/* --- Water alert banner pulse --- */
@keyframes water-pulse {
    0%, 100% { border-left-color: var(--amber); }
    50% { border-left-color: var(--red-accent); }
}
.water-alert-banner:not(.hidden) {
    animation: water-pulse 2s ease-in-out infinite;
}

/* =======================================================================
   COMPANION NETWORK — persistent threads (friend/foe)
   ======================================================================= */
.thread-persistent {
    stroke-dasharray: 6 4;
    opacity: 0.75;
    animation: thread-dash 3s linear infinite;
    filter: drop-shadow(0 0 1.5px currentColor);
}
.thread-persistent.thread-foe { opacity: 0.9; }
.thread-friend { stroke: var(--emerald, #10b981); }
.thread-foe    { stroke: var(--red-accent, #ef4444); }
@keyframes thread-dash { to { stroke-dashoffset: -20; } }

/* === COMPANIONS toolbar toggle with LED === */
.tool-btn.companion-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.tool-btn.companion-toggle .led {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #333;
    box-shadow: inset 0 0 2px rgba(0,0,0,0.8);
    display: inline-block;
}
.tool-btn.companion-toggle.on {
    color: var(--emerald, #10b981);
    border-color: var(--emerald, #10b981);
    background: rgba(var(--emerald-rgb),0.08);
}
.tool-btn.companion-toggle.on .led {
    background: #34d399;
    box-shadow: 0 0 6px #34d399, 0 0 12px rgba(var(--emerald-rgb),0.6);
    animation: led-pulse 1.8s ease-in-out infinite;
}
@keyframes led-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.55; }
}

/* === LIVING / idle sway — selected plants never sway ===
   Sway includes scale(var(--stage-scale, 1)) so growth-stage scaling from
   the TIMELINE tweak survives. Without this, sway's transform overrides
   the data-stage transform and growth scaling silently disappears when
   both LIVING and TIMELINE are on (the MAX preset). */
body.tweak-living-on .placed-plant.living:not(.selected) {
    animation: sway var(--sway-dur, 3.5s) ease-in-out infinite;
    animation-delay: var(--sway-delay, 0s);
    transform-origin: 50% 90%;
}
@keyframes sway {
    0%, 100% { transform: rotate(-3deg) translateY(0)  scale(var(--stage-scale, 1)); }
    50%      { transform: rotate(3deg)  translateY(-1px) scale(var(--stage-scale, 1)); }
}

/* Reserved: ripe glow for timeline harvest stage */
@keyframes ripe-glow {
    0%, 100% { filter: drop-shadow(0 0 0 rgba(var(--amber-rgb),0)) brightness(1); }
    50%      { filter: drop-shadow(0 0 8px rgba(var(--amber-rgb),0.9)) brightness(1.2); }
}

/* === BLOOM burst === */
.bloom-burst {
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 20;
    transform: translate(-50%, -50%) scale(0);
    background: radial-gradient(circle, rgba(var(--emerald-rgb),0.85) 0%, rgba(var(--emerald-rgb),0.3) 40%, transparent 70%);
    animation: bloom-pop 0.6s ease-out forwards;
}
@keyframes bloom-pop {
    0%   { transform: translate(-50%,-50%) scale(0);   opacity: 1; }
    60%  { transform: translate(-50%,-50%) scale(1.4); opacity: 0.6; }
    100% { transform: translate(-50%,-50%) scale(2);   opacity: 0; }
}

/* === TWEAKS gear + panel === */
.tweaks-gear {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--bg-secondary, #1a1a1a);
    color: var(--emerald, #10b981);
    border: 2px solid var(--emerald, #10b981);
    box-shadow: 0 0 18px rgba(var(--emerald-rgb),0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    z-index: 299;
    transition: transform 0.2s;
}
.tweaks-gear:hover { transform: rotate(60deg); }
.tweaks-gear.hidden { display: none; }

.tweaks-panel {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    width: 340px;
    max-height: 75vh;
    background: var(--bg-secondary, #141414);
    border: 2px solid var(--emerald, #10b981);
    box-shadow: 0 0 40px rgba(var(--emerald-rgb),0.3);
    z-index: 300;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 6px;
    animation: panel-in 0.3s ease-out;
}
.tweaks-panel.hidden { display: none; }
@keyframes panel-in {
    0%   { transform: translateY(20px) scale(0.95); opacity: 0; }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}
.tweaks-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0.85rem;
    font-family: var(--font-display, 'Anton', sans-serif);
    font-size: 1.1rem;
    letter-spacing: 3px;
    color: var(--emerald, #10b981);
    background: linear-gradient(180deg, rgba(var(--emerald-rgb),0.15), transparent);
    border-bottom: 1px solid var(--border, #2a2a2a);
}
.tweaks-close {
    background: transparent;
    border: 1px solid var(--border, #2a2a2a);
    color: var(--text-muted, #888);
    cursor: pointer;
    font-size: 1rem;
    width: 24px;
    height: 24px;
    line-height: 1;
}
.tweaks-close:hover {
    color: var(--red-accent, #ef4444);
    border-color: var(--red-accent, #ef4444);
}
.tweaks-sub {
    font-family: var(--font-mono, 'Space Mono', monospace);
    font-size: 0.7rem;
    color: var(--text-muted, #888);
    padding: 0.5rem 0.85rem;
    border-bottom: 1px dashed var(--border, #2a2a2a);
}
.tweaks-presets {
    display: flex;
    gap: 4px;
    padding: 0.55rem 0.85rem;
    border-bottom: 1px dashed var(--border, #2a2a2a);
}
.tweak-preset {
    flex: 1;
    font-family: var(--font-mono, 'Space Mono', monospace);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 0.4rem;
    background: var(--bg-tertiary, #222);
    color: var(--text-secondary, #ccc);
    border: 1px solid var(--border, #2a2a2a);
    cursor: pointer;
}
.tweak-preset:hover {
    color: var(--text-primary, #fff);
    border-color: var(--text-muted, #888);
}
.tweaks-list {
    overflow-y: auto;
    flex: 1;
    padding: 0.35rem 0;
}
.tweak-row {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 0.55rem 0.85rem;
    border-bottom: 1px dashed var(--border, #2a2a2a);
    cursor: pointer;
}
.tweak-row:hover { background: rgba(var(--emerald-rgb),0.04); }
.tweak-row.on    { background: rgba(var(--emerald-rgb),0.06); }
.tweak-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.tweak-title {
    font-family: var(--font-mono, 'Space Mono', monospace);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--text-primary, #fff);
}
.tweak-desc {
    font-family: var(--font-mono, 'Space Mono', monospace);
    font-size: 0.68rem;
    color: var(--text-muted, #888);
    line-height: 1.4;
}
.tweak-switch {
    width: 34px;
    height: 18px;
    background: var(--bg-dark, #0a0a0a);
    border: 1px solid var(--border, #2a2a2a);
    border-radius: 999px;
    position: relative;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    padding: 0;
}
.tweak-switch .knob {
    position: absolute;
    top: 1px;
    left: 1px;
    width: 14px;
    height: 14px;
    background: var(--text-muted, #888);
    border-radius: 50%;
    transition: all 0.2s;
}
.tweak-switch.on {
    background: rgba(var(--emerald-rgb),0.25);
    border-color: var(--emerald, #10b981);
}
.tweak-switch.on .knob {
    left: 17px;
    background: var(--emerald-glow, #34d399);
    box-shadow: 0 0 8px var(--emerald-glow, #34d399);
}

/* Wind-gust was removed — it was decorative scanline noise, not state.
   NOTE: do NOT add `.garden-bed { position: relative; }` here — the base
   rule at styles.css line ~847 already sets `position: absolute`, which is
   required for canvas-coordinate positioning via inline top/left. The old
   `position: relative;` override here broke bed dragging. */

/* Pause animations for beds that are offscreen — the .offscreen class is
   added by an IntersectionObserver in containers.js. Cuts CPU/GPU cost
   when many beds exist and only some are visible. */
.garden-bed.offscreen .heatmap-overlay,
.garden-bed.offscreen .placed-plant.living {
    animation-play-state: paused !important;
}

/* ===== Soil texture — interim layered gradients to give beds visual
   depth so they read as filled-with-dirt rather than flat dark blocks.
   Cheap and CSS-only; no images. Will likely be replaced when the user
   does a Claude-design pass for proper dirt textures. */
.garden-bed::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    /* Multi-layer:
       1. Coarse speckle from offset radial gradients ("clods of dirt").
       2. Soft brown wash to break up the flat soil color.
       3. Vignette inset shadow at edges for depth. */
    background:
        radial-gradient(ellipse 8% 6% at 18% 22%, rgba(120,82,45,0.18), transparent 70%),
        radial-gradient(ellipse 6% 5% at 62% 14%, rgba(90,60,32,0.22), transparent 70%),
        radial-gradient(ellipse 10% 7% at 78% 56%, rgba(110,76,42,0.16), transparent 70%),
        radial-gradient(ellipse 7% 6% at 32% 78%, rgba(80,54,28,0.20), transparent 70%),
        radial-gradient(ellipse 9% 7% at 88% 88%, rgba(100,68,38,0.14), transparent 70%),
        radial-gradient(ellipse at 50% 50%, transparent 55%, rgba(0,0,0,0.45) 100%);
    z-index: 0;
    mix-blend-mode: overlay;
    opacity: 0.85;
}
[data-theme="light"] .garden-bed::after {
    /* Lighter wash on the warm-paper light theme so the texture doesn't
       look like grime over a beige bed. */
    background:
        radial-gradient(ellipse 8% 6% at 18% 22%, rgba(110,72,38,0.10), transparent 70%),
        radial-gradient(ellipse 6% 5% at 62% 14%, rgba(90,60,28,0.12), transparent 70%),
        radial-gradient(ellipse 10% 7% at 78% 56%, rgba(100,68,34,0.09), transparent 70%),
        radial-gradient(ellipse 7% 6% at 32% 78%, rgba(80,54,24,0.11), transparent 70%),
        radial-gradient(ellipse 9% 7% at 88% 88%, rgba(95,64,30,0.08), transparent 70%),
        radial-gradient(ellipse at 50% 50%, transparent 60%, rgba(0,0,0,0.20) 100%);
    opacity: 0.75;
}

/* ===== STAGE 2b — PALETTE HOVER THREADS =======================
   Hovering a plant in the Plant Library highlights its placed
   friends (emerald outline) and foes (pulsing red outline) across
   every bed. When the hovered plant is already placed, dashed
   hover-threads connect those instances to their companions.
   Gated by state.tweaks.companion (independent of companionAlways). */
.placed-plant.hover-friend {
    outline: 2px solid var(--emerald, #10b981);
    outline-offset: 2px;
    filter: drop-shadow(0 0 8px rgba(var(--emerald-glow-rgb),0.85));
    z-index: 6;
}
.placed-plant.hover-foe {
    outline: 2px solid var(--red-accent, #ef4444);
    outline-offset: 2px;
    animation: foe-pulse 1.2s ease-in-out infinite;
    z-index: 6;
}
/* Override LIVING sway when hovering a foe so foe-pulse wins. */
body.tweak-living-on .placed-plant.living.hover-foe:not(.selected) {
    animation: foe-pulse 1.2s ease-in-out infinite;
}
@keyframes foe-pulse {
    0%, 100% {
        filter: drop-shadow(0 0 2px rgba(var(--red-rgb),0.45));
        outline-color: rgba(var(--red-rgb),0.65);
    }
    50% {
        filter: drop-shadow(0 0 12px rgba(var(--red-rgb),0.95));
        outline-color: rgba(var(--red-rgb),1);
    }
}

/* hover-threads overlay — same SVG pattern as persistent threads
   but thicker / faster dashes so they pop above the persistent layer. */
.hover-threads-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 4;
}
.hover-threads-svg .thread-hover {
    opacity: 0.95;
    filter: drop-shadow(0 0 3px currentColor);
    animation: thread-dash 2s linear infinite;
}
.hover-threads-svg .thread-hover.thread-foe {
    animation-duration: 1.2s;
}

/* ===== STAGE 2c — TIMELINE SCRUBBER + GROWTH STAGES ==========
   Hidden by default; revealed when body.tweak-timeline-on. The
   scrubber lives directly under the planner toolbar and writes
   state.seasonDay (0-365) on input. Plants render with a per-stage
   transform/opacity, with 'harvest' adding an amber pulse + dot. */
.timeline-scrubber {
    display: none;
    margin: 6px 0 8px 0;
    padding: 8px 12px;
    background: linear-gradient(180deg, var(--bg-secondary, #0e1612) 0%, rgba(var(--emerald-rgb),0.04) 100%);
    border: 1px solid var(--emerald, #10b981);
    border-radius: 4px;
    font-family: 'Space Mono', monospace;
    box-shadow: 0 0 14px rgba(var(--emerald-rgb),0.18);
    position: relative;
    z-index: 5;
}
body.tweak-timeline-on .timeline-scrubber {
    display: block;
}
.timeline-scrubber.hidden { display: none !important; }
.timeline-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}
.timeline-title {
    font-family: 'Anton', sans-serif;
    letter-spacing: 0.08em;
    color: var(--emerald, #10b981);
    font-size: 0.95rem;
}
.timeline-date {
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
    color: var(--text-primary, #e0e6e3);
    background: rgba(var(--emerald-rgb),0.08);
    padding: 2px 8px;
    border-radius: 2px;
    border: 1px solid rgba(var(--emerald-rgb),0.3);
}
.timeline-today-btn {
    margin-left: auto;
    background: transparent;
    border: 1px solid var(--emerald, #10b981);
    color: var(--emerald, #10b981);
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    padding: 3px 9px;
    cursor: pointer;
    border-radius: 2px;
    letter-spacing: 0.05em;
}
.timeline-today-btn:hover {
    background: rgba(var(--emerald-rgb),0.12);
    box-shadow: 0 0 8px rgba(var(--emerald-rgb),0.4);
}
.timeline-track-wrap {
    position: relative;
    height: 38px;
    padding-top: 4px;
}
.timeline-range {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    height: 18px;
    margin: 0;
    cursor: pointer;
    position: relative;
    z-index: 3;
}
.timeline-range::-webkit-slider-runnable-track {
    height: 4px;
    background: linear-gradient(90deg,
        rgba(var(--blue-rgb),0.55) 0%,
        rgba(var(--blue-rgb),0.55) 25%,
        rgba(var(--emerald-rgb),0.55) 30%,
        rgba(var(--emerald-rgb),0.55) 75%,
        rgba(var(--amber-rgb),0.55) 80%,
        rgba(var(--blue-rgb),0.55) 100%);
    border-radius: 2px;
}
.timeline-range::-moz-range-track {
    height: 4px;
    background: linear-gradient(90deg,
        rgba(var(--blue-rgb),0.55) 0%,
        rgba(var(--blue-rgb),0.55) 25%,
        rgba(var(--emerald-rgb),0.55) 30%,
        rgba(var(--emerald-rgb),0.55) 75%,
        rgba(var(--amber-rgb),0.55) 80%,
        rgba(var(--blue-rgb),0.55) 100%);
    border-radius: 2px;
}
.timeline-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--emerald-glow, #34d399);
    border: 2px solid var(--emerald, #10b981);
    margin-top: -5px;
    cursor: pointer;
    box-shadow: 0 0 8px rgba(var(--emerald-glow-rgb),0.7);
}
.timeline-range::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--emerald-glow, #34d399);
    border: 2px solid var(--emerald, #10b981);
    cursor: pointer;
    box-shadow: 0 0 8px rgba(var(--emerald-glow-rgb),0.7);
}
.timeline-ticks {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 14px;
    pointer-events: none;
}
.timeline-tick {
    position: absolute;
    transform: translateX(-50%);
    font-size: 0.55rem;
    color: rgba(224,230,227,0.45);
    font-family: 'Space Mono', monospace;
    letter-spacing: 0.04em;
}
.timeline-frost {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    font-size: 0.5rem;
    color: rgba(var(--blue-rgb),0.85);
    font-family: 'Space Mono', monospace;
    pointer-events: none;
    letter-spacing: 0.03em;
}
.timeline-frost::before {
    content: '';
    position: absolute;
    top: 14px;
    left: 50%;
    width: 1px;
    height: 14px;
    background: rgba(var(--blue-rgb),0.55);
}
.timeline-frost-fall { color: rgba(var(--amber-rgb),0.85); }
.timeline-frost-fall::before { background: rgba(var(--amber-rgb),0.55); }

/* Growth-stage transforms — only apply when timeline tweak is on.
   Stages set the --stage-scale CSS var; the actual `transform: scale()` is
   applied via this rule (when not swaying) AND inside the sway keyframes
   (when LIVING is also on). This keeps growth scaling visible under MAX. */
body.tweak-timeline-on .placed-plant {
    transition: transform 360ms cubic-bezier(.22,.61,.36,1), opacity 360ms ease;
    transform-origin: 50% 80%;
    transform: scale(var(--stage-scale, 1));
}
body.tweak-timeline-on .placed-plant[data-stage="seed"]    { --stage-scale: 0.35; opacity: 0.5; }
body.tweak-timeline-on .placed-plant[data-stage="sprout"]  { --stage-scale: 0.55; opacity: 0.78; }
body.tweak-timeline-on .placed-plant[data-stage="leaf"]    { --stage-scale: 0.80; opacity: 0.92; }
body.tweak-timeline-on .placed-plant[data-stage="mature"]  { --stage-scale: 1.0;  opacity: 1; }
body.tweak-timeline-on .placed-plant[data-stage="harvest"] {
    --stage-scale: 1.05;
    opacity: 1;
    animation: ripe-glow 1.6s ease-in-out infinite;
}
body.tweak-timeline-on .placed-plant[data-stage="harvest"]::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--amber, #f59e0b);
    box-shadow: 0 0 6px rgba(var(--amber-rgb),0.85);
    pointer-events: none;
}
@keyframes ripe-glow {
    0%, 100% { filter: drop-shadow(0 0 0 rgba(var(--amber-rgb),0)) brightness(1); }
    50%      { filter: drop-shadow(0 0 8px rgba(var(--amber-rgb),0.9)) brightness(1.18); }
}

/* ===== STAGE 2d — HARVEST YOINK + CONFETTI ===================
   Click a harvest-stage plant -> .yoink class triggers a 540ms
   scale-pop + fly-up while .confetti-layer spawns 10 emoji pieces. */
.placed-plant.yoink {
    pointer-events: none;
    animation: plant-yoink 540ms cubic-bezier(.36,.07,.19,.97) forwards !important;
    z-index: 8;
}
@keyframes plant-yoink {
    0%   { transform: scale(1) translateY(0); opacity: 1; }
    35%  { transform: scale(1.4) translateY(-6px); opacity: 1; filter: drop-shadow(0 0 14px rgba(var(--amber-rgb),0.9)); }
    100% { transform: scale(0) translateY(-26px); opacity: 0; }
}
.confetti-layer {
    position: absolute;
    width: 0;
    height: 0;
    pointer-events: none;
    z-index: 9;
}
.confetti-particle {
    position: absolute;
    left: 0;
    top: 0;
    font-size: 1.05rem;
    transform: translate(-50%, -50%);
    animation: confetti-fly 900ms cubic-bezier(.18,.62,.36,1) forwards;
    animation-delay: var(--delay, 0s);
    will-change: transform, opacity;
}
@keyframes confetti-fly {
    0%   { transform: translate(-50%, -50%) rotate(0deg) scale(0.6); opacity: 0; }
    20%  { opacity: 1; }
    100% {
        transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy) + 28px))
                   rotate(var(--rot)) scale(1);
        opacity: 0;
    }
}

/* ===== STAGE 2e — HEATMAP OVERLAY ============================
   The .heatmap-overlay div is injected into every bed by
   containers.js. Hidden by default; visible on body.tweak-heatmap-on.
   Two ::before / ::after radial gradients = breathing moisture pools.
   The .sun-arc child = an amber radial that crosses L→R every 12s. */
.heatmap-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    opacity: 0;
    mix-blend-mode: screen;
    overflow: hidden;
    transition: opacity 280ms ease;
}
body.tweak-heatmap-on .heatmap-overlay {
    opacity: 1;
}
.heatmap-overlay::before,
.heatmap-overlay::after {
    content: '';
    position: absolute;
    width: 60%;
    height: 60%;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(6px);
}
.heatmap-overlay::before {
    left: var(--pool-a-x, 25%);
    top:  var(--pool-a-y, 30%);
    background: radial-gradient(closest-side, rgba(var(--blue-rgb),0.55), rgba(var(--blue-rgb),0) 70%);
    animation: heatmap-breath-a 4s ease-in-out infinite;
}
.heatmap-overlay::after {
    left: var(--pool-b-x, 65%);
    top:  var(--pool-b-y, 55%);
    background: radial-gradient(closest-side, rgba(var(--blue-rgb),0.45), rgba(var(--blue-rgb),0) 70%);
    animation: heatmap-breath-b 6s ease-in-out infinite;
}
@keyframes heatmap-breath-a {
    0%, 100% { transform: translate(-50%, -50%) scale(0.85); opacity: 0.55; }
    50%      { transform: translate(-50%, -50%) scale(1.1);  opacity: 0.9;  }
}
@keyframes heatmap-breath-b {
    0%, 100% { transform: translate(-50%, -50%) scale(1.1);  opacity: 0.85; }
    50%      { transform: translate(-50%, -50%) scale(0.85); opacity: 0.45; }
}
.sun-arc {
    position: absolute;
    top: 8%;
    left: 0;
    width: 14%;
    height: 14%;
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(var(--amber-rgb),0.85), rgba(var(--amber-rgb),0) 70%);
    filter: blur(4px);
    pointer-events: none;
    transform: translate(-50%, -50%);
    animation: sun-arc-cross 12s linear infinite;
}
@keyframes sun-arc-cross {
    0%   { left: 0%;   top: 30%; opacity: 0; }
    8%   {              top: 18%; opacity: 1; }
    50%  {              top: 5%;  opacity: 1; }
    92%  {              top: 18%; opacity: 1; }
    100% { left: 100%; top: 30%; opacity: 0; }
}

/* ===== STAGE 2f — TICKER STATS ===============================
   When body.tweak-ticker-stats-on (or via JS gate), stat numbers
   render as digit columns that translateY to land on the right
   digit. Non-digit characters render as static separators. */
.stat-value {
    /* Be a flex row so digit columns line up on the baseline. */
    display: inline-flex;
    align-items: baseline;
    line-height: 1;
}
.ticker-col {
    display: inline-block;
    overflow: hidden;
    width: 0.62em;
    height: 1em;
    line-height: 1;
    vertical-align: baseline;
    position: relative;
}
.ticker-strip {
    display: flex;
    flex-direction: column;
    transition: transform 480ms cubic-bezier(.22,.61,.36,1);
    transform: translateY(0);
}
.ticker-cell {
    display: block;
    height: 1em;
    line-height: 1;
    text-align: center;
}
.ticker-sep {
    display: inline-block;
    line-height: 1;
}

/* ===== /HARDEN + /DISTILL =====================================
   Toolbar dropdown menus (FILE ▾, + CONTAINER ▾), drawer-pattern
   sidebar, touch-target normalization, danger-zone confirmation. */

/* --- Touch target floor — primary interactive controls ≥32px high
   (WCAG 2.5.8 AA) so they're tappable on tablets/phones. */
.tool-btn,
.filter-btn,
.footer-action-btn {
    min-height: 32px;
}
.tool-btn.compact-icon,
.zoom-controls .tool-btn {
    min-width: 32px;
}

/* --- Dropdown menu component (FILE ▾, + CONTAINER ▾) --- */
.menu-wrap {
    position: relative;
    display: inline-block;
}
.menu-trigger {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.menu-trigger::after {
    content: '\25BE'; /* ▾ */
    font-size: 0.75em;
    line-height: 1;
    margin-left: 2px;
    transition: transform 0.15s ease;
}
.menu-wrap.open .menu-trigger::after {
    transform: rotate(180deg);
}
/* Chrome + closed state live on the base rule so EVERY popup gets them.
   These used to sit only in the #container-menu override below, which left
   the FILE popup unstyled and permanently open on top of the canvas. */
.menu-popup {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 220px;
    background: var(--bg-secondary, #0e1612);
    border: 1px solid var(--emerald, #10b981);
    border-radius: 3px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.6), 0 0 12px rgba(var(--emerald-rgb),0.18);
    padding: 4px 0;
    z-index: 50;
    font-family: var(--font-mono);
    display: none;
}
/* Container picker sits on the LEFT side of the shelf, so its popup should
   align left (not right) so it doesn't extend off the canvas viewport. */
#container-menu .menu-popup {
    right: auto;
    left: 0;
}
.menu-wrap.open .menu-popup {
    display: block;
    animation: menu-pop-in 140ms cubic-bezier(.22,.61,.36,1);
}
@keyframes menu-pop-in {
    from { opacity: 0; transform: translateY(-4px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    background: none;
    border: 0;
    padding: 8px 14px;
    color: var(--text-primary, #e0e6e3);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    letter-spacing: 0.4px;
    text-align: left;
    cursor: pointer;
    text-decoration: none;
    text-transform: uppercase;
    min-height: 36px;
}
.menu-item:hover,
.menu-item:focus-visible {
    background: rgba(var(--emerald-rgb),0.12);
    color: var(--emerald-glow, #34d399);
    outline: none;
}
.menu-item .menu-icon {
    width: 18px;
    text-align: center;
    flex-shrink: 0;
    opacity: 0.85;
}
.menu-item .menu-shortcut {
    margin-left: auto;
    font-size: 0.7em;
    opacity: 0.5;
    letter-spacing: 0.5px;
}
.menu-divider {
    height: 1px;
    background: var(--border, #2a3530);
    margin: 4px 0;
}
.menu-section-label {
    padding: 6px 14px 2px;
    font-size: 0.6rem;
    color: var(--text-muted, #7a8983);
    letter-spacing: 1.4px;
    text-transform: uppercase;
}
.menu-item.danger {
    color: var(--red-accent, #ef4444);
}
.menu-item.danger:hover,
.menu-item.danger:focus-visible {
    background: rgba(var(--red-rgb),0.15);
    color: #ff6b6b;
}

/* --- Compact zoom segmented control --- */
.zoom-controls {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border, #2a3530);
    border-radius: 2px;
    overflow: hidden;
}
.zoom-controls .tool-btn {
    border: none;
    border-radius: 0;
    margin: 0;
    padding: 0 8px;
    min-width: 30px;
}
.zoom-controls .tool-btn + .tool-btn {
    border-left: 1px solid var(--border, #2a3530);
}
.zoom-controls .zoom-level {
    padding: 0 8px;
    min-width: 48px;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-muted, #7a8983);
    border-left: 1px solid var(--border, #2a3530);
    border-right: 1px solid var(--border, #2a3530);
    background: var(--bg-tertiary, #131a17);
    line-height: 1.9;
}

/* --- Sidebar drawer pattern (both panels) --- */
.bed-details,
.plant-palette {
    transition: transform 280ms cubic-bezier(.22,.61,.36,1), opacity 220ms ease;
    position: relative; /* drawer-tab anchor */
}
.bed-details.drawer-collapsed {
    transform: translateX(calc(100% - 28px));
}
.bed-details.drawer-collapsed > *:not(.drawer-tab) {
    opacity: 0.15;
    pointer-events: none;
}
.plant-palette.drawer-collapsed {
    transform: translateX(calc(-100% + 28px));
}
.plant-palette.drawer-collapsed > *:not(.drawer-tab) {
    opacity: 0.15;
    pointer-events: none;
}
.drawer-tab {
    position: absolute;
    top: 50%;
    width: 28px;
    height: 80px;
    background: var(--bg-secondary, #0e1612);
    border: 1px solid var(--emerald, #10b981);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--emerald, #10b981);
    font-family: var(--font-mono);
    writing-mode: vertical-lr;
    font-size: 0.6rem;
    letter-spacing: 1.2px;
    z-index: 5;
}
.bed-details .drawer-tab {
    left: 0;
    transform: translate(-100%, -50%);
    transform-origin: 0 50%;
    border-right: 0;
    border-radius: 4px 0 0 4px;
}
.plant-palette .drawer-tab {
    right: 0;
    transform: translate(100%, -50%);
    transform-origin: 100% 50%;
    border-left: 0;
    border-radius: 0 4px 4px 0;
    writing-mode: vertical-rl;
}
.drawer-tab:hover {
    background: rgba(var(--emerald-rgb),0.12);
    color: var(--emerald-glow, #34d399);
}
.drawer-tab .arrow {
    writing-mode: horizontal-tb;
    margin-bottom: 4px;
    font-size: 0.85rem;
}
.bed-details.drawer-collapsed .drawer-tab .arrow,
.plant-palette.drawer-collapsed .drawer-tab .arrow {
    transform: rotate(180deg);
}

/* --- Compact slim footer (no center toolbar) --- */
.main-footer.compact .footer-center {
    display: none;
}

/* --- Restore focus-visible where outline:none was used in raw state --- */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
    outline: 2px solid var(--emerald, #10b981);
    outline-offset: 2px;
}

/* --- Confirmation modal "type CLEAR to confirm" --- */
.danger-confirm-input {
    width: 100%;
    padding: 8px 10px;
    background: var(--bg-tertiary, #131a17);
    border: 1px solid var(--red-muted, #991b1b);
    color: var(--red-accent, #ef4444);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin: 12px 0;
    text-align: center;
}
.danger-confirm-input:focus {
    outline: none;
    border-color: var(--red-accent, #ef4444);
    box-shadow: 0 0 12px rgba(var(--red-rgb),0.3);
}

/* ===== STAGE 2g — PAGE-TURN 3D TAB TRANSITION ================
   Wrapped in navigation.js switchTab. Outgoing tab fades + skews
   off; incoming tab fades + skews in. Perspective on parent so the
   3D rotation reads correctly. */
body.tweak-page-turn-on {
    perspective: 1200px;
}
.tab-content.page-out {
    animation: page-out 280ms cubic-bezier(.4,.0,.2,1) forwards;
    transform-origin: 50% 50%;
}
.tab-content.page-in {
    animation: page-in 360ms cubic-bezier(.2,.7,.3,1) forwards;
    transform-origin: 50% 50%;
}
@keyframes page-out {
    0%   { transform: translateX(0)    skewX(0)    rotateY(0deg);  opacity: 1; filter: hue-rotate(0deg); }
    100% { transform: translateX(-4%)  skewX(-2deg) rotateY(-8deg); opacity: 0; filter: hue-rotate(15deg); }
}
@keyframes page-in {
    0%   { transform: translateX(4%)   skewX(2deg)  rotateY(8deg);  opacity: 0; filter: hue-rotate(-15deg); }
    50%  {                                                          filter: hue-rotate(8deg); }
    100% { transform: translateX(0)    skewX(0)     rotateY(0deg);  opacity: 1; filter: hue-rotate(0deg); }
}
