/* ── NURSERY DRAWER ─────────────────────────────────────────── */
#nurseryDrawer {
  position: fixed; top: 0; right: 0;
  width: 380px; height: 100vh; height: 100dvh;
  background: var(--bg-card);
  box-shadow: none;
  z-index: 300; overflow-y: hidden;
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 0.25s ease, visibility 0s linear 0.25s;
  display: flex; flex-direction: column;
}
/* v4.9.0 — the shadow only exists while open; closed, it used to leak a dark
   edge onto the right side of every screen. */
#nurseryDrawer.open { transform: translateX(0); visibility: visible; box-shadow: -4px 0 24px rgba(0,0,0,0.18); transition: transform 0.25s ease, visibility 0s; }
#nurseryBackdrop {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.3); z-index: 299; display: none;
}
#nurseryBackdrop.open { display: block; }
@media (max-width: 480px) { #nurseryDrawer { width: 100vw; } }

/* ── NURSERY DRAG-TO-BED DROP TARGETS ──────────────────────────── */
tr.nursery-drop-target {
  outline: 2px dashed var(--green) !important;
  outline-offset: -2px;
  background: rgba(76,175,80,0.06) !important;
  transition: background 0.15s, outline 0.15s;
}
tr.nursery-drop-target.drag-over {
  outline: 3px solid var(--green) !important;
  background: rgba(76,175,80,0.15) !important;
  box-shadow: inset 0 0 0 1px var(--green);
}
@keyframes nursery-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}
tr.nursery-drop-target::after {
  content: '🌱 Drop here';
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  font-size: 0.72rem; font-weight: 600; color: var(--green);
  animation: nursery-pulse 1.5s ease-in-out infinite;
  pointer-events: none;
}
tr.nursery-drop-target { position: relative; }

/* ── THIS WEEK TAB — TASK CARDS ──────────────────────────────── */
.week-group { margin-bottom: 1.5rem; }
.week-header { font-family: var(--f-display); font-weight: 700; font-size: 0.85rem; color: var(--green-text); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.5rem; display: flex; align-items: center; gap: 0.5rem; }
.week-current .week-header { color: var(--terra-text); }
.this-week-badge { background: var(--terra-tint); color: var(--terra-text); font-size: 0.7rem; padding: 0.1rem 0.4rem; border-radius: 3px; font-weight: 600; }
.task-card { display: flex; flex-direction: column; padding: 11px 14px; background: #fff; border: 1px solid var(--border-rule); border-left: 3px solid var(--border-rule); border-radius: 8px; margin-bottom: 8px; }
/* v3.44.0 — quiet action label: lowercase, untinted, muted. The !important neutralizes
   the per-type inline background/white-color set in each buildTaskCard branch so the
   pill reads as calm text in both light and dark mode (type is conveyed by the label
   text itself + the card structure, not a loud uppercase chip). */
.task-badge { font-size: 11px; font-weight: 700; letter-spacing: 0.02em; padding: 0; border-radius: 0; white-space: nowrap; text-transform: lowercase; background: none !important; color: var(--text-secondary) !important; }
/* v3.44.0 — ⋯ secondary-action menu on task cards */
.tw-menu-btn { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 22px; padding: 0; background: transparent; border: none; border-radius: 6px; cursor: pointer; color: var(--text-muted); }
.tw-menu-btn:hover { background: var(--bg-subtle); color: var(--text-primary); }
.tw-menu-btn svg { width: 18px; height: 18px; }
.tw-menu-pop { position: absolute; top: calc(100% + 4px); right: 0; z-index: 300; background: var(--bg-card); border: 1px solid var(--border-mid); border-radius: 10px; box-shadow: var(--shadow-pop); padding: 4px; min-width: 140px; display: flex; flex-direction: column; gap: 2px; }
.tw-menu-item { text-align: left; background: transparent; border: none; border-radius: 6px; padding: 7px 10px; font-size: 0.8rem; font-family: var(--f-body); color: var(--text-primary); cursor: pointer; white-space: nowrap; }
.tw-menu-item:hover { background: var(--bg-subtle); }
.task-crop { font-weight: 500; font-size: 0.875rem; flex: 1; min-width: 150px; }
.task-date { font-size: 0.8rem; color: var(--text-muted); }
.task-succ { font-size: 0.75rem; color: var(--text-muted); }
.task-bed { font-size: 0.72rem; background: var(--tan-tint); color: var(--text-primary); padding: 0.1rem 0.4rem; border-radius: 3px; }
.scope-btn { font-size: 12px; font-weight: 500; padding: 5px 12px; border: 1px solid var(--border-tan); background: #FAF7F2; border-radius: 20px; cursor: pointer; color: var(--ink); white-space: nowrap; font-family: var(--f-body); }
.scope-btn.active { background: #2C3A1E; color: #FAF7F2; border-color: #2C3A1E; }
.tw-toolbar { display: flex; justify-content: space-between; align-items: center; padding: 10px 0 8px; border-bottom: 1px solid var(--border-rule); margin-bottom: 12px; flex-wrap: wrap; gap: 8px; }
.tw-section-header { display: flex; align-items: center; gap: 10px; margin: 14px 0 8px; font-size: 10px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--ink); opacity: 0.60; }
.tw-section-header::after { content: ''; flex: 1; height: 1px; background: #E8DFD0; }
.tw-checkbox { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--border-tan); flex-shrink: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.ttf-btn { font-size: 0.7rem; padding: 0.2rem 0.55rem; border: 1px solid var(--border-rule); background: var(--bg-base); border-radius: 4px; cursor: pointer; color: var(--text-muted); }
.ttf-btn.active { border-color: var(--green); color: var(--green-text); background: var(--green-tint); font-weight: 600; }
/* v3.44.0 — 4-superset filter chips (lapsed-action-chip color treatment) + More popover */
.ttf-chip { font-family: var(--f-body); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; padding: 3px 11px; border-radius: 99px; cursor: pointer; border: 1px solid transparent; background: transparent; color: var(--text-muted); transition: background 0.12s, color 0.12s, border-color 0.12s; }
.ttf-chip:hover { color: var(--text-secondary); }
.ttf-chip.active.ss-sow     { color: #4A7C59; background: color-mix(in srgb, #4A7C59 14%, transparent); border-color: color-mix(in srgb, #4A7C59 32%, transparent); }
.ttf-chip.active.ss-plant   { color: #5B8FA8; background: color-mix(in srgb, #5B8FA8 14%, transparent); border-color: color-mix(in srgb, #5B8FA8 32%, transparent); }
.ttf-chip.active.ss-harvest { color: #C5822A; background: color-mix(in srgb, #C5822A 14%, transparent); border-color: color-mix(in srgb, #C5822A 32%, transparent); }
.ttf-chip.active.ss-care    { color: #6B7280; background: color-mix(in srgb, #6B7280 14%, transparent); border-color: color-mix(in srgb, #6B7280 32%, transparent); }
.ttf-more { font-family: var(--f-body); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; padding: 3px 11px; border-radius: 99px; cursor: pointer; border: 1px dashed var(--border-mid); background: transparent; color: var(--text-secondary); }
.ttf-more:hover { border-color: var(--terra); color: var(--terra-text); }
.ttf-more-pop { position: absolute; top: calc(100% + 6px); left: 0; z-index: 300; background: var(--bg-card); border: 1px solid var(--border-mid); border-radius: 10px; box-shadow: var(--shadow-pop); padding: 8px; display: flex; flex-wrap: wrap; gap: 5px; width: max-content; max-width: 260px; }

/* ── TOOLTIP SYSTEM ──────────────────────────────────────────── */
.rl-tooltip {
  position: fixed; z-index: 89;
  background: var(--bg-olive); color: #FAF7F2;
  border-radius: 6px; padding: 0.65rem 2rem 0.65rem 0.875rem;
  font-size: 0.78rem; max-width: 280px; line-height: 1.5;
  box-shadow: var(--shadow-pop);
}
.rl-tooltip-close {
  position: absolute; top: 4px; right: 8px;
  background: none; border: none; color: rgba(255,255,255,0.6);
  cursor: pointer; font-size: 1rem; line-height:1;
}

/* ── EMPTY STATES ────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 3rem 1rem; }
.empty-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.empty-title { font-family: var(--f-display); font-weight: 700; font-size: 1rem; color: var(--text-primary); margin-bottom: 0.25rem; }
.empty-body { color: var(--text-muted); font-size: 0.875rem; margin-bottom: 1rem; }
.empty-links { font-size: 0.8rem; color: var(--text-muted); }
.empty-links a { color: var(--terra-text); text-decoration: underline; margin: 0 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }

/* ── LIBRARY DROP ZONE ───────────────────────────────────────── */
.lib-drop-zone { border: 2px dashed var(--border-rule); border-radius: 8px; padding: 2rem; text-align: center; cursor: pointer; transition: border-color 0.2s, background 0.2s; margin-bottom: 1rem; }
.drag-handle { color: var(--border-rule); cursor: grab; padding: 0 6px; font-size: 1rem; user-select: none; }
.drag-handle:active { cursor: grabbing; }
tr.drag-over td { background: var(--terra-tint) !important; outline: 2px dashed var(--terra); outline-offset: -2px; }
.bed-r.drag-over { background: var(--terra-tint) !important; outline: 2px dashed var(--terra); outline-offset: -2px; }
.lib-drop-zone:hover, .lib-drop-zone.dragging { border-color: var(--terra); background: var(--terra-tint); }
.lib-drop-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.lib-drop-title { font-weight: 600; font-size: 0.875rem; margin-bottom: 0.25rem; }
.lib-drop-sub { font-size: 0.75rem; color: var(--text-muted); }

/* ── LIBRARY SCHEDULE CARDS ──────────────────────────────────── */
.lib-card { background: var(--bg-card); border: 1px solid var(--border-rule); border-radius: 8px; padding: 0.875rem; }
.lib-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 0.5rem; }
.lib-card-type { font-weight: 600; font-size: 0.9rem; display: block; }
.lib-card-variety { font-style: italic; font-size: 0.8rem; color: var(--text-muted); }
.lib-card-seasons { display: flex; gap: 0.25rem; flex-wrap: wrap; }
.lib-card-sched { font-size: 0.78rem; color: var(--text-primary); margin-bottom: 0.5rem; }
.lib-card-sched-line { margin-bottom: 0.2rem; }
.lib-card-footer { border-top: 1px solid var(--border-rule); padding-top: 0.5rem; margin-top: 0.5rem; }

/* ── GANTT A11Y PATTERNS (colorblind) ───────────────────────── */
/* Subtle repeating patterns as secondary visual cue per rotation family */
[data-rot="Nightshade"] { background-image: repeating-linear-gradient(45deg, transparent, transparent 4px, rgba(0,0,0,0.04) 4px, rgba(0,0,0,0.04) 5px) !important; }
[data-rot="Cucurbit"]   { background-image: repeating-linear-gradient(-45deg, transparent, transparent 4px, rgba(0,0,0,0.04) 4px, rgba(0,0,0,0.04) 5px) !important; }
[data-rot="Brassica"]   { background-image: repeating-linear-gradient(90deg, transparent, transparent 5px, rgba(0,0,0,0.04) 5px, rgba(0,0,0,0.04) 6px) !important; }
[data-rot="Root"]       { background-image: radial-gradient(circle 1px, rgba(0,0,0,0.06) 1px, transparent 1px); background-size: 6px 6px !important; }
[data-rot="Legume"]     { background-image: repeating-linear-gradient(0deg, transparent, transparent 5px, rgba(0,0,0,0.04) 5px, rgba(0,0,0,0.04) 6px) !important; }

/* ── SEASON GANTT ────────────────────────────────────────────── */
.gantt-row { display: flex; align-items: center; margin-bottom: 3px; min-height: 26px; }
.gantt-label { width: 190px; flex-shrink: 0; font-size: 0.75rem; font-weight: 500; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 0.5rem; text-align: right; }
.gantt-bar-wrap { flex: 1; height: 22px; background: #f9fafb; border-radius: 3px; position: relative; overflow: visible; }
.gantt-month-label { position: absolute; top: 0; font-size: 11px; color: var(--text-primary); opacity: 0.6; transform: translateY(-100%); }
.gantt-gridline { position: absolute; top: 0; bottom: 0; width: 1px; background: #e5e7eb; z-index: 0; }

/* ── SLOT DATE DISPLAY ───────────────────────────────────────── */
.slot-date-display { font-size: 0.75rem; color: var(--text-primary); }
.slot-date-auto { color: var(--text-muted); font-style: italic; }

/* ── MOBILE TAB LABELS ───────────────────────────────────────── */
.tab-long { display: inline; }
.tab-short { display: none; }
@media (max-width: 480px) {
  .tab-btn { font-size: 0.7rem; padding: 0.5rem 0.6rem; }
  .tab-long { display: none; }
  .tab-short { display: inline; }
}

