/* ── Dark mode — essential component overrides ──────────────── */
/* Forms: ensure inputs pick up dark surfaces */
:root.dark input, :root.dark select, :root.dark textarea {
  background: var(--bg-subtle); color: var(--text-primary); border-color: var(--border-mid);
}
:root.dark input:focus, :root.dark select:focus, :root.dark textarea:focus {
  border-color: var(--terra-text); box-shadow: 0 0 0 2px rgba(212,113,90,0.25);
}
:root.dark input[type=checkbox] { accent-color: var(--terra-text); }
/* Modals / overlays */
:root.dark .rl-settings-overlay { background: rgba(0,0,0,0.40); }
:root.dark .rl-modal, :root.dark .rl-settings-modal { background: var(--bg-modal); color: var(--text-primary); box-shadow: var(--shadow-lg); }
:root.dark .rl-modal-header { background: var(--bg-card); color: var(--text-primary); }
/* Buttons — dark mode overrides */
:root.dark .btn-primary   { color: #FAF7F2 !important; }
:root.dark .btn-green     { background: var(--green-tint); color: var(--green-text); border-color: rgba(200,216,180,0.2); }
:root.dark .btn-green:hover { background: rgba(100,130,70,0.35); }
:root.dark .btn-quiet     { background: var(--bg-subtle); color: var(--text-secondary); border-color: var(--border-mid); }
:root.dark .btn-quiet:hover { background: var(--bg-card); border-color: var(--border-tan); }
:root.dark .btn-ghost     { color: var(--terra-text); border-color: var(--border-tan); }
:root.dark .btn-ghost:hover { background: var(--terra-tint); }
:root.dark .btn-danger    { color: #FAF7F2 !important; }
:root.dark .btn-lib-add   { background: rgba(100,130,70,0.2); color: var(--green-text); border-color: rgba(180,210,140,0.25); }
:root.dark .btn-lib-add:hover { background: rgba(100,130,70,0.35); }
:root.dark .btn-lib-del   { color: var(--text-muted); border-color: var(--border-rule); }
:root.dark .btn-lib-del:hover { color: #D4715A; border-color: #D4715A; background: rgba(185,72,46,0.12); }
/* Pill dark overrides for non-token colors */
:root.dark .pill-spring    { background: var(--green-tint); color: var(--green-text); }
:root.dark .pill-summer    { background: var(--tan-tint); color: var(--amber-text); }
:root.dark .pill-fall      { background: var(--terra-tint); color: var(--terra-text); }
:root.dark .pill-indoor    { background: #161e2a; color: #7ab0cc; }
:root.dark .pill-direct    { background: var(--green-tint); color: var(--green-text); }
:root.dark .pill-transplant { background: #0f2a26; color: #6abca0; }
:root.dark .pill-harvest   { background: var(--tan-tint); color: var(--amber-text); }
/* Irrigation divider inline colors */
:root.dark [style*="background:#eff6ff"] { background: #161e2a !important; }
:root.dark [style*="background:#f0fdf4"] { background: #0d1f12 !important; }
/* Scope toggle active state */
:root.dark .scope-btn.active { background: var(--amber-text) !important; color: #111 !important; border-color: var(--amber-text) !important; }
/* Active tab — bg-card becomes near-black in dark, override to light */
:root.dark .tab-btn.active { color: #FAF7F2; }
/* Table row hover */
:root.dark .rl-table tbody tr:hover { background: var(--bg-subtle); }
/* In-plan badge inline color */
:root.dark [style*="background:#dcfce7"] { background: var(--green-tint) !important; color: var(--green-text) !important; }
/* Beds thead inline color + text */
:root.dark [style*="background:#f5f0e8"] { background: var(--bg-subtle) !important; }
:root.dark .beds-col-header tr { color: var(--text-secondary) !important; }
/* All rl-table olive-bg headers need white text in dark mode */
:root.dark .rl-table thead th { color: rgba(255,255,255,0.85); }
/* Tab bar — paper in both modes (v4.9.0); --paper flips with the theme */
/* Footer bar — olive becomes near-black in dark */
:root.dark .rl-footer { background: var(--bg-nav) !important; }
/* Hero header — paper in both modes (v4.9.0); the reversed wordmark swaps in */
/* Task cards — white bg becomes dark card */
:root.dark .task-card { background: var(--bg-card); border-color: var(--border-rule); }
:root.dark .tw-section-header { color: var(--text-muted); }
:root.dark .tw-section-header::after { background: var(--border-rule); }
:root.dark .tw-toolbar { border-bottom-color: var(--border-rule); }
/* Scope buttons (Week/Month) inactive state */
:root.dark .scope-btn { background: var(--bg-card) !important; border-color: var(--border-mid) !important; color: var(--text-primary) !important; }
/* Season Gantt toolbar — hardcoded light bg */
:root.dark .sg-toolbar { background: var(--bg-card) !important; border-bottom-color: var(--border-rule) !important; }
/* Season Gantt expand/collapse + pill toggles */
:root.dark .sg-expand-link { color: var(--text-muted); }
:root.dark .sg-pill { background: var(--bg-card); border-color: var(--border-mid); color: var(--text-primary); }
:root.dark .sg-pill.sg-pill-active { background: var(--bg-olive); color: #FAF7F2; border-color: var(--bg-olive); }
/* All tasks done banner */
:root.dark [style*="background:#EDF2EA"] { background: var(--green-tint) !important; color: var(--green-text) !important; }
/* Wizard dark mode */
:root.dark #wizBody { color: var(--text-primary); }

/* ── Spotlight Tour ───────────────────────────────────────── */
.tour-hi {
  position: relative !important;
  z-index: 1000 !important;
  border-radius: 6px !important;
  box-shadow: 0 0 0 3px var(--terra), 0 0 0 8px rgba(185,72,46,0.22), 0 4px 12px rgba(0,0,0,0.45) !important;
  transition: box-shadow 0.2s;
}
/* Parent stacking-context lift — the tabbar and top header both create their
   own stacking contexts via position:sticky + z-index, which TRAPS the
   highlighted child below the overlay no matter how high its z-index is.
   When a .tour-hi child is inside, lift the ancestor above the overlay (998). */
.rl-tabbar:has(.tour-hi),
header:has(.tour-hi),
.m-tabbar:has(.tour-hi) { z-index: 1005 !important; }
/* Force highlighted tab buttons to full-bright text so the spotlit tab reads
   clearly. Tab buttons normally use rgba(255,255,255,0.6) which looks muted. */
.tab-btn.tour-hi, .tab-btn.tour-hi *,
.m-tab.tour-hi, .m-tab.tour-hi * { color: #FAF7F2 !important; opacity: 1 !important; }
#tourCallout {
  background: var(--bg-card);
  border-radius: 10px;
  border: 1px solid var(--border-mid);
  box-shadow: var(--shadow-pop);
  color: var(--text-primary);
}

@media (max-width: 480px) { .nursery-btn-label { display: none; } .hidden-xs { display: none !important; } #authUserLabel { display: none !important; } #logoutBtn span { display: none; } #logoutBtn::before { content: '↩'; } }

