/* ══════════════════════════════════════════════════════════════════
   20 — SCREENS (v4.9.0): This Week · My Crops · Season · Land · Export
   Screen-level layout for the brand sweep. Shared components (chips,
   sheets, buttons, segmented control) live in 19-brand.css.
══════════════════════════════════════════════════════════════════ */

/* ═════════ THIS WEEK ═════════ */
#tab-thisweek { padding-top: 24px; }
.tw-layout { display: grid; grid-template-columns: minmax(0, 760px) 320px; gap: 32px; justify-content: center; align-items: start; }
.tw-main { min-width: 0; }
.tw-rail { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 124px; padding-top: 6px; }
.tw-rail.is-empty { display: none; }
@media (max-width: 1180px) {
  .tw-layout { grid-template-columns: minmax(0, 760px); }
  .tw-rail { display: none; }
}
@media (min-width: 1181px) { .tw-chip-rail-dup { display: none; } }

.tw-scope { display: inline-flex; align-items: center; gap: 8px; font: 500 13px var(--f-body); color: var(--quiet); }
.tw-scope select { min-height: 40px; border-radius: 8px; padding: 0 10px; font: 500 14px var(--f-body); color: var(--ink); background: var(--bg-card); border: 1px solid var(--line); }

/* status chips + filter chips: one row each, scroll sideways on phones */
.tw-chips, .tw-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tw-chips { margin: 0 0 12px; }
.tw-filters { gap: 6px; margin: 0 0 6px; }
.tw-fchip { min-height: 36px; }
.tw-fchip .mono { font-size: 12.5px; opacity: .8; font-weight: 500; }
.tw-fmore-wrap { position: relative; display: inline-flex; }
.chip-ask { padding: 0; gap: 0; }
.chip-ask button { border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; min-height: inherit; }
.chip-ask__go { padding: 0 6px 0 14px; }
.chip-ask__x { padding: 0 12px 0 6px; color: var(--quiet) !important; }
.chip-ask__short { display: none; }
.chip-ask svg { color: var(--need-text); }
@media (max-width: 768px) {
  .tw-chips, .tw-filters { flex-wrap: nowrap; overflow-x: auto; margin-left: -16px; margin-right: -16px; padding: 0 16px 2px; scrollbar-width: none; }
  .tw-chips::-webkit-scrollbar, .tw-filters::-webkit-scrollbar { display: none; }
  .chip-ask__long { display: none; }
  .chip-ask__short { display: inline; }
  .tw-scope__lbl { display: none; }
  #tab-thisweek .pg-head__right { margin-left: 0; width: 100%; justify-content: space-between; }
}

/* buckets */
.tw-bucket { display: flex; align-items: center; gap: 10px; margin: 22px 0 10px; }
.tw-bucket:first-of-type { margin-top: 14px; }
.tw-bucket .tw-bucket-label { margin: 0; font: 800 13px var(--f-body); letter-spacing: .08em; text-transform: uppercase; color: var(--ink); }
.tw-bucket.tw-bucket-overdue .tw-bucket-label { color: var(--late-text); }
.tw-bucket .tw-bucket-cnt { font: 500 12px var(--f-mono); background: var(--line-soft); color: var(--ink-2); border-radius: 99px; padding: 2px 8px; }
.tw-bucket.tw-bucket-overdue .tw-bucket-cnt { background: var(--late-tint); color: var(--late-text); }
.tw-bucket .tw-bucket-range { font: 400 12.5px var(--f-mono); color: var(--quiet); font-style: normal; margin-left: 0; }
.tw-bucket .tw-bucket-all { margin-left: auto; }
.tw-cards { display: flex; flex-direction: column; gap: 8px; }
.tw-done-sec > summary { list-style: none; cursor: pointer; }
.tw-done-sec > summary::-webkit-details-marker { display: none; }
.tw-done-sec > summary::after { content: '▸'; color: var(--quiet); font-size: 12px; }
.tw-done-sec[open] > summary::after { content: '▾'; }
.tw-allclear { display: flex; align-items: center; gap: 8px; padding: 16px; border-radius: var(--r-card); background: var(--soil-tint); color: var(--soil-text); border: 1px solid var(--soil-line); font-weight: 600; }
.tw-empty { text-align: center; padding: 48px 16px; }
.tw-empty__t { font: 400 24px var(--f-serif); color: var(--ink); margin-bottom: 6px; }
.tw-empty__s { color: var(--quiet); margin-bottom: 18px; }
.tw-setup { list-style: none; padding: 0; margin: 0 auto; display: inline-flex; flex-direction: column; gap: 6px; text-align: left; }
.tw-setup__step { display: flex; align-items: center; gap: 10px; color: var(--ink-2); }
.tw-setup__n { width: 26px; height: 26px; border-radius: 99px; border: 1.5px solid var(--line); display: inline-flex; align-items: center; justify-content: center; font: 500 12px var(--f-mono); color: var(--quiet); }
.tw-setup__step.done .tw-setup__n { background: var(--forest); border-color: var(--forest); color: #fff; }
.tw-banner { margin-bottom: 10px; padding: 10px 14px; background: var(--need-tint); border: 1px solid var(--need-line); border-radius: 12px; font-size: 13px; color: var(--need-text); }

/* compact task card */
.task-card.tc {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto 44px; align-items: center; gap: 8px;
  min-height: 64px; padding: 6px 4px 6px 4px; margin: 0;
  background: var(--bg-card); border: 1px solid var(--line); border-left: 1px solid var(--line); border-radius: var(--r-card);
}
.task-card.tc.is-tappable { cursor: pointer; transition: border-color .12s, box-shadow .12s; }
.task-card.tc.is-tappable:hover { border-color: var(--quiet); }
.task-card.tc:focus-visible { outline: 2px solid var(--terra); outline-offset: 2px; }
.task-card.tc.tc--soil { background: var(--soil-tint); border-color: var(--soil-line); }
.task-card.tc.tc--soil .tc-kind { color: var(--soil-text); }
.task-card.tc.tc--soil .tc-check span { border-color: var(--forest); }
.task-card.tc.is-done { opacity: .62; background: transparent; }
.task-card.tc.is-done .tc-crop { text-decoration: line-through; text-decoration-thickness: 1px; }
.tc-check { width: 44px; height: 44px; border: 0; padding: 0; background: transparent; display: flex; align-items: center; justify-content: center; cursor: pointer; border-radius: 12px; }
.tc-check span { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #B3ADA2; display: flex; align-items: center; justify-content: center; color: #fff; transition: background .12s, border-color .12s; }
.tc-check:hover span { border-color: var(--forest); }
.tc-check.is-done span { background: var(--forest); border-color: var(--forest); }
:root.dark .tc-check.is-done span { color: #191816; }
.tc-check--none { cursor: default; }
.tc-body { min-width: 0; padding: 4px 0; }
.tc-kind { font: 700 11px var(--f-body); letter-spacing: .06em; text-transform: uppercase; color: var(--quiet); display: flex; align-items: center; flex-wrap: wrap; gap: 0 4px; }
.tc-kind .task-moon-chip { text-transform: uppercase; }
.tc-kdate { display: none; font-family: var(--f-mono); letter-spacing: 0; text-transform: none; font-weight: 500; }
.tc-kdate.late { color: var(--late-text); }
.tc-kdate.today { color: var(--terra-text); }
.tc-moon { text-transform: none; letter-spacing: 0; font-weight: 400; }
.tc-title { margin-top: 1px; line-height: 1.25; }
.tc-crop { font: 400 18px/1.25 var(--f-serif); color: var(--ink); }
.tc-cv { font: italic 400 15px var(--f-body); color: var(--ink-2); }
.tc-meta { font: 400 13px/1.4 var(--f-mono); color: var(--quiet); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-meta .tc-note { font-family: var(--f-body); font-style: italic; }
.tc-tag { font-family: var(--f-body); font-size: 12px; color: var(--soil-text); }
.tc-warn { color: var(--late-text); font-family: var(--f-body); font-weight: 600; }
.tc-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.tc-date { font: 500 13px var(--f-mono); padding: 4px 10px; border-radius: 99px; background: var(--bg-subtle); color: var(--ink-2); white-space: nowrap; }
.tc-date.late { background: var(--late-tint); color: var(--late-text); }
.tc-date.today { background: var(--need-tint); color: var(--need-text); }
.tc-date.done { background: transparent; color: var(--quiet); }
.tc-menu-gap { width: 44px; }
.task-card.tc .tw-menu-wrap { position: relative; display: inline-flex; }
.task-card.tc .tw-menu-btn { width: 44px; height: 44px; border-radius: 10px; color: var(--quiet); }
.task-card.tc .tw-menu-btn .ico { width: 20px; height: 20px; }
.tw-menu-pop { border-color: var(--line); border-radius: 12px; min-width: 170px; }
.tw-menu-item { font-size: 14px; padding: 0 12px; min-height: 40px; border-radius: 8px; }
@media (pointer: coarse) { .tw-menu-item { min-height: 44px; } }
@media (max-width: 640px) {
  .task-card.tc { grid-template-columns: 44px minmax(0, 1fr) 44px; min-height: 72px; gap: 4px; }
  .task-card.tc .tc-date { display: none; }
  .tc-kdate { display: inline; }
}

/* right rail */
.rail-card { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--r-card); padding: 16px; }
.rail-card__h { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.rail-card__h h3 { margin: 0; flex: 1; font: 800 12px var(--f-body); letter-spacing: .08em; text-transform: uppercase; color: var(--ink); }
.rail-card__h .linkbtn { min-height: 30px; font-size: 13px; }
.rail-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 14px; color: var(--ink); padding: 4px 0; }
.rail-row__t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-row .cv, .ysheet .cv { font-style: italic; color: var(--ink-2); font-size: 13px; }
.rail-row__d, .rail-row .mono { font-size: 12.5px; color: var(--quiet); flex: none; }
.rail-row__d.late { color: var(--late-text); }
.rail-bar { height: 6px; border-radius: 4px; background: var(--line-soft); overflow: hidden; margin: 2px 0 6px; }
.rail-bar span { display: block; height: 100%; background: var(--forest); border-radius: 4px; }
.rail-card__btn { width: 100%; margin-top: 8px; }
.mono.quiet, .quiet { color: var(--quiet); }

/* sheets reuse the old strip sections — give them room */
.ysheet__lede { margin: 0 0 12px; color: var(--ink-2); font-size: 14px; }
.ysheet__more { margin-top: 14px; }
.ysheet .cs-detail--sheet { display: flex; flex-direction: column; gap: 14px; padding: 0; border: 0; background: transparent; }
.ysheet .lapsed-tray { border: 0; background: transparent; margin: 0; }
.ysheet .lapsed-tray .lt-head { display: none; }
.ysheet .lapsed-tray .lt-body { display: block !important; max-height: none; padding: 0; }
.ysheet #seasonalChecklistContainer > div { margin-bottom: 0 !important; }

/* ═════════ EXPORT ═════════ */
#tab-export { padding-top: 24px; }
#exportTabBody { max-width: 1136px; margin: 0 auto; }
.exp-pg-head { margin-bottom: 14px; }
.exp-hero {
  display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 20px; align-items: center; width: 100%;
  text-align: left; cursor: pointer; font: inherit; color: var(--ink);
  background: var(--bg-card); border: 2px solid var(--line); border-radius: 16px; padding: 18px 20px; margin-bottom: 18px;
  transition: border-color .12s, box-shadow .12s;
}
.exp-hero:hover { border-color: var(--quiet); }
.exp-hero.active { border-color: var(--ink); }
.exp-hero__main { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.exp-hero__top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.exp-hero__top .ico { width: 24px; height: 24px; }
.exp-hero__name { font: 400 22px var(--f-serif); }
.exp-hero__pill { margin-left: auto; font: 600 12px var(--f-body); background: var(--soil-tint); color: var(--soil-text); border-radius: 99px; padding: 4px 10px; }
.exp-hero__desc { font-size: 15px; line-height: 1.45; color: var(--ink-2); max-width: 52ch; }
.exp-hero__cover { display: flex; flex-direction: column; gap: 6px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; min-height: 130px; box-shadow: 0 6px 18px rgba(34,33,30,.08); }
.exp-hero__logo { font: 400 20px var(--f-serif); transform: skewX(-10deg); transform-origin: left bottom; display: inline-block; }
.exp-hero__logo span { color: var(--forest); }
.exp-hero__plan { font: 700 13px var(--f-body); text-transform: capitalize; }
.exp-hero__meta { font: 400 11.5px var(--f-mono); color: var(--quiet); }
.exp-hero__bars { display: flex; flex-direction: column; gap: 5px; margin-top: 6px; }
.exp-hero__bars span { display: block; height: 6px; border-radius: 3px; background: var(--g-leafy-bg); }
.exp-hero__bars span:nth-child(2) { background: var(--g-nightshade-bg); }
.exp-hero__bars span:nth-child(3) { background: var(--g-root-bg); }
.exp-other-lbl { font: 800 12px var(--f-body); letter-spacing: .08em; text-transform: uppercase; color: var(--ink); margin: 0 0 8px; }
.exp-cards { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.exp-card { font: inherit; text-align: left; color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-card); padding: 12px; min-height: 44px; }
.exp-card > span, .exp-card-name, .exp-card-fmt { display: block; }
.exp-card-icon { background: var(--bg-subtle); color: var(--ink); }
.exp-card-icon .ico { width: 20px; height: 20px; }
.exp-card-name { font: 700 14px var(--f-body); color: var(--ink); }
.exp-card-fmt { font-size: 11px; letter-spacing: .06em; color: var(--quiet); }
.exp-card-desc { font-size: 12.5px; color: var(--ink-2); }
.exp-card.active { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.exp-panel, .exp-summary { border-color: var(--line); border-radius: var(--r-card); }
.exp-section-lbl, .exp-summary-lbl { font: 800 12px var(--f-body); letter-spacing: .08em; color: var(--ink); }
.exp-scope-chip { min-height: 36px; padding: 0 14px; border-radius: 99px; font-size: 14px; border-color: var(--line); color: var(--ink); }
.exp-scope-chip.on, :root.dark .exp-scope-chip.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.exp-opts label, .exp-radio-row label { font-size: 14px; min-height: 32px; }
.exp-go-btn { min-height: 50px; border-radius: var(--r-btn); font-size: 16px; }
.exp-sum-compact { display: none; }
@media (max-width: 1000px) { .exp-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 768px) {
  #tab-export { padding-top: 16px; padding-bottom: 96px; }
  .exp-hero { grid-template-columns: 1fr; gap: 12px; padding: 16px; }
  .exp-hero__cover { min-height: 0; }
  /* "Other formats" scroll sideways as compact tiles */
  .exp-cards { display: flex; overflow-x: auto; margin: 0 -16px 16px; padding: 0 16px 4px; scrollbar-width: none; }
  .exp-cards::-webkit-scrollbar { display: none; }
  .exp-card { flex: none; width: 112px; min-height: 92px; padding: 10px; justify-content: space-between; }
  .exp-card-desc, .exp-card-fmt, .exp-card-badge { display: none !important; }
  /* sticky summary + Download above the tab bar */
  .exp-summary {
    position: fixed; left: 0; right: 0; bottom: calc(68px + max(env(safe-area-inset-bottom), 8px)); top: auto; z-index: 210;
    display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-radius: 0; border: 0; border-top: 1px solid var(--line);
    background: var(--bg-card); box-shadow: 0 -4px 14px rgba(0,0,0,.06);
  }
  .exp-summary > :not(.exp-sum-compact):not(.exp-go-btn) { display: none; }
  .exp-sum-compact { display: block; font: 400 13px/1.4 var(--f-mono); color: var(--ink-2); }
  .exp-sum-compact b { color: var(--ink); }
  .exp-go-btn { width: auto; margin: 0 0 0 auto; padding: 0 22px; min-height: 50px; }
}

/* ═════════ MY CROPS ═════════ */
#tab-mycrops { padding-top: 24px; }
#tab-mycrops > * { max-width: 1136px; margin-left: auto; margin-right: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.split-btn .btn { min-height: 44px; }
.split-btn .btn:first-child { padding: 0 18px; font-size: 15px; }
.lib-add-menu { right: 0; left: auto; top: calc(100% + 6px); min-width: 250px; }
.lib-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 0 0 10px; }
.lib-views { flex-wrap: nowrap; }
.lib-search { position: relative; display: flex; align-items: center; margin-left: auto; }
.lib-search .ico { position: absolute; left: 12px; color: var(--quiet); width: 16px; height: 16px; }
.lib-search input { min-height: 42px; width: 240px; padding: 0 12px 0 36px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; background: var(--bg-card); }
.lib-filters-btn { min-height: 42px; border-radius: 8px; }
.lib-filters-btn .ico { width: 16px; height: 16px; }
.lib-active-filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 10px; }
.lib-active-filters:empty { display: none; }
.lib-count { display: block; font: 400 12.5px var(--f-mono); color: var(--quiet); margin: -4px auto 8px; }
.lib-count:empty { display: none; }
.lib-filters-body { display: flex; flex-direction: column; gap: 14px; }
.lib-f-row { display: grid; grid-template-columns: 140px minmax(0, 1fr); align-items: center; gap: 12px; }
.lib-f-lbl { font: 700 13px var(--f-body); color: var(--ink); }
.lib-f-row select { min-height: 44px; width: 100%; font-size: 15px; }
.lib-f-btns { display: flex; gap: 8px; }
.lib-filters-sheet[hidden], #libFiltersScrim[hidden] { display: none; }

/* family sections → headings with a rule; crops as cards in a grid */
.lib-fam { border: 0; background: transparent; border-radius: 0; margin: 0 0 6px; overflow: visible; }
.lib-fam::before { display: none; }
.lib-fam .lib-fam-head { background: transparent; padding: 14px 0 10px; gap: 10px; border-radius: 8px; }
.lib-fam .lib-fam-head:hover { background: transparent; }
.lib-fam .lib-fam-head::after { content: ''; flex: 1; height: 1px; background: var(--line); order: 9; }
.lib-fam .lib-fam-chip { width: 12px; height: 12px; border-radius: 4px; box-shadow: none; }
.lib-fam .lib-fam-name { font: 800 12.5px var(--f-body); letter-spacing: .08em; text-transform: uppercase; color: var(--ink); }
.lib-fam .lib-fam-count { background: transparent; padding: 0; font: 400 12px var(--f-mono); color: var(--quiet); }
.lib-fam .lib-fam-inplan { margin-left: 0; background: var(--soil-tint); color: var(--soil-text); font-size: 12px; order: 8; }
.lib-fam .lib-fam-hint { order: 7; }
.lib-fam .lib-fam-chev { order: 10; }
.lib-fam .lib-fam-body { padding: 0 0 10px; background: transparent; }
.lib-fam.open .lib-fam-body { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1100px) { .lib-fam.open .lib-fam-body { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px)  { .lib-fam.open .lib-fam-body { grid-template-columns: minmax(0, 1fr); } }
.lib-row.is-editing, .lib-row.is-deleting { grid-column: 1 / -1; }
.lib-row.lib-card {
  display: flex; flex-direction: column; align-items: stretch; gap: 8px; margin: 0;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--bg-card);
}
.lib-card .lc-top { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.lib-card .lr-fam-dot { align-self: center; flex: none; }
.lib-card .lc-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-card .lc-crop { font: 400 18px var(--f-serif); color: var(--ink); }
.lib-card .lc-cv { font: italic 14px var(--f-body); color: var(--ink-2); }
.lib-card .lr-method { flex: none; font: 600 11px var(--f-body); padding: 2px 7px; border-radius: 99px; }
.lib-card .lc-when { font: 400 13px var(--f-mono); color: var(--ink-2); }
.lib-card .lc-when .quiet { font-family: var(--f-body); font-style: italic; }
.lib-card .lc-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.lib-card .lc-chips:empty { display: none; }
.lib-card .lr-stat { font: 400 12px var(--f-mono); color: var(--quiet); }
.lib-card .lc-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; }
.lib-card .lc-beds { font: 500 12px var(--f-mono); background: var(--soil-tint); color: var(--ink); border-radius: 99px; padding: 3px 9px; }
.lib-card .lc-beds.none { background: var(--late-tint); color: var(--late-text); }
.lib-card .lr-actions { margin-left: auto; }
.lib-card .lr-actions button { font-size: 12.5px; padding: 0 10px; min-height: 32px; border-radius: 8px; border-color: var(--line); }
@media (pointer: coarse) { .lib-card .lr-actions button { min-height: 44px; min-width: 44px; } }
.lib-row .lr-actions button.lr-plan-btn { background: var(--soil-tint); color: var(--soil-text); border-color: var(--soil-line); }

/* Table view: plain numeric cells */
#libraryTable td { vertical-align: middle; }
#libraryTable input[type=text], #libraryTable select { border: 0; background: transparent; font-size: 13px; padding: 4px 2px; width: 100%; min-width: 0; }
#libraryTable .lib-num { width: 4.5em; text-align: right; font-family: var(--f-mono); }
#libraryTable .lib-num:focus, #libraryTable input[type=text]:focus { background: var(--bg-card); box-shadow: inset 0 0 0 1px var(--terra); }

@media (max-width: 768px) {
  #tab-mycrops { padding-top: 16px; }
  .lib-views { width: calc(100% + 32px); margin: 0 -16px; padding: 3px 16px; overflow-x: auto; border-radius: 0; scrollbar-width: none; }
  .lib-views::-webkit-scrollbar { display: none; }
  .lib-search { flex: 1; margin-left: 0; }
  .lib-search input { width: 100%; }
  .lib-f-row { grid-template-columns: 1fr; gap: 6px; }
}
#libraryTable td:nth-child(1) input, #libraryTable td:nth-child(2) input { min-width: 9em; }
#libraryTable td:nth-child(13) input { min-width: 10em; }
#libraryTable select { min-width: 6.8em; }

/* ═════════ SEASON ═════════ */
#tab-season { padding-top: 24px; --sg-top: 109px; }
.sg-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 10px; }
.sg-tools .btn { min-height: 40px; }
.sg-tools__right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.sg-tools .sg-legend { display: flex; gap: 12px; align-items: center; }
.sg-tools .sg-leg-item { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--quiet); }
.sg-tools .sg-leg-swatch { width: 14px; height: 10px; border-radius: 3px; display: inline-block; }
.sg-tools .sg-leg-hatched { background: repeating-linear-gradient(-45deg, var(--quiet), var(--quiet) 2px, transparent 2px, transparent 5px); }
.sg-tools .sg-leg-today { background: var(--terra); width: 3px; height: 12px; border-radius: 0; }
.sg-tools .sg-leg-frost { border: 1.5px dashed var(--frost); width: 0; height: 12px; border-width: 0 0 0 1.5px; }
.sg-group-btn { gap: 6px; }
.sg-group-menu { border-color: var(--line); border-radius: 12px; }
.sg-scroll { position: relative; }
.sg-inner { position: relative; min-width: 560px; }
.sg-axis { position: sticky; top: var(--sg-top); z-index: 7; background: var(--paper); }
.sg-axis > div:last-child { background: var(--bg-card); border-radius: 8px 8px 0 0; }
.sg-today-pill { position: absolute; top: 4px; transform: translateX(-50%); z-index: 3; pointer-events: none;
  height: 20px; padding: 0 7px; border-radius: 99px; background: var(--terra); color: #fff;
  font: 500 11px/20px var(--f-mono); text-transform: uppercase; white-space: nowrap; }
.sg-blk { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 0 10px; min-height: 34px; user-select: none;
  background: var(--bg-subtle); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sg-blk__chev { font-size: 11px; color: var(--quiet); }
.sg-blk__name { font: 800 12px var(--f-body); letter-spacing: .08em; text-transform: uppercase; color: var(--ink); }
.sg-blk__n { font: 400 12px var(--f-mono); color: var(--quiet); }
.sg-bedname { font: 500 13px var(--f-mono); color: var(--ink); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; flex: 1; }
.sg-hh { color: var(--soil-text); display: inline-flex; }
.sg-check span:last-child { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.sg-check input { width: 20px; height: 20px; }
@media (max-width: 768px) {
  #tab-season { padding-top: 14px; --sg-top: 56px; }
  .sg-tools .sg-legend { display: none; }
  .sg-plan-btn { position: fixed; right: 16px; bottom: calc(86px + env(safe-area-inset-bottom)); z-index: 215;
    min-height: 52px; padding: 0 18px 0 14px; border-radius: 99px; background: var(--ink); color: var(--paper); box-shadow: 0 6px 18px rgba(0,0,0,.22); }
  :root.dark .sg-plan-btn { color: #191816; }
}
@media (max-width: 640px) {
  .sg-inner { min-width: 0; }
  .sg-tools__right { margin-left: auto; }
  .sg-label { gap: 0 !important; padding-right: 4px !important; }
  .sg-label .sg-dot, .sg-label .sg-count, .sg-label .sg-hh { display: none !important; }
  .sg-bedname { font-size: 12.5px; }
  .sg-bed-row { margin-bottom: 4px; }
  .sg-frost-flag { display: none; }
  /* Detail: the chart scrolls both ways inside its own box — sticky axis + sticky bed column */
  .sg-scroll.is-detail { overflow: auto; max-height: calc(100dvh - 56px - 84px - 150px); border-top: 1px solid var(--line); }
  .sg-scroll.is-detail .sg-inner { min-width: 900px; }
  .sg-scroll.is-detail .sg-axis { top: 0; }
  .sg-scroll.is-detail .sg-label { position: sticky; left: 0; z-index: 6; background: var(--paper); align-self: stretch; }
  .sg-scroll.is-detail .sg-blk { position: sticky; left: 0; }
}
@media (max-width: 640px) {
  .sg-tools { flex-wrap: nowrap; gap: 6px; }
  .sg-tools .btn { padding: 0 10px; min-height: 44px; }
  .sg-tools__right { gap: 6px; }
  .sg-zoom button { padding: 0 10px; }
  #tab-season:has(.sg-scroll:not(.is-detail)) .sg-today-btn { display: none; }
  .sg-tools .sg-sb-link { display: none; }
}

/* ═════════ LAND ═════════ */
#tab-beds { padding-top: 20px; }
.land-newblock { display: none; background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--r-card); margin-bottom: var(--s4); }
.land-newblock[open] { display: block; }
.land-newblock__sum { display: none; }
.land-newblock__body { padding: 8px 20px 18px; }
.land-newblock__h { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.land-newblock__t { margin: 0; flex: 1; font: 400 22px var(--f-serif); color: var(--ink); }
.land-newblock label { color: var(--ink) !important; font-size: 13px !important; }
.land-newblock input { min-height: 40px; }
.beds-tb-title { font-size: 28px; }
.bed-sz { width: 64px; white-space: nowrap; font-size: 12px; }
.bed-sz-u { margin-left: 2px; opacity: .7; }
.bed-more-btn { width: 40px; height: 40px; border: 0; background: none; cursor: pointer; color: var(--quiet); border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; }
.bed-more-btn:hover { background: var(--bg-subtle); color: var(--ink); }
@media (pointer: coarse) { .bed-more-btn { width: 44px; height: 44px; } .bed-ea-add, .bed-ea-regen, .slot-ln { min-height: 44px; } }

/* ═════════ SLOT WIZARD ═════════ */
/* step 1's chip groups sat flush against the modal edge (the body is "flush") */
@media (min-width: 768px) { .sm-step1 { padding: 16px 24px 8px; } }
.sm-step1 #smCropSearch { min-height: 42px; border-radius: 8px !important; font-size: 15px !important; }
.sm-crop-btn { border-radius: 99px; border-color: var(--line); min-height: 34px; }
@media (pointer: coarse) { .sm-crop-btn { min-height: 44px; } }

/* touch: the few controls above that are drawn smaller than 44px on desktop */
@media (pointer: coarse) {
  .tw-fchip, .tw-scope select, .lib-filters-btn, .lib-search input, .sg-tools .btn { min-height: 44px; }
  .avatar { width: 44px; height: 44px; }
  .qc-btnp, .qc-btng, #nurseryDrawer button { min-height: 44px; }
  #nurseryDrawer button { min-width: 44px; }
}
#tab-inputs { padding-top: 24px; }
#tab-inputs .tw-toolbar, #tab-beds .tw-toolbar { border-bottom: 0; padding-top: 0; }
.beds-tb-title { font-size: 22px; }
@media (max-width: 768px) {
  .beds-filter-row > div:first-child { flex-wrap: nowrap !important; overflow-x: auto; margin: 0 -16px; padding: 0 16px 2px; scrollbar-width: none; }
  .beds-filter-row > div:first-child > * { flex: none; }
  .bl-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
}
