/* PlantSwitch HQ.
   Light takes the 2026 site build (cream, forest, mint buttons, Inter);
   dark takes the hero preview (soil, mint, DM Mono labels). Chart colours were
   checked with the dataviz validator: #1F7A53 on white, #36A879 on #121916. */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/inter-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/inter-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url("fonts/manrope-latin-wght-normal.woff2") format("woff2"); }
@font-face { font-family: "DM Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/dm-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "DM Mono"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("fonts/dm-mono-latin-500-normal.woff2") format("woff2"); }

:root {
  color-scheme: light;
  --bg: #FAF7F2; --panel: #FFFFFF; --panel-2: #F3EEE5; --line: #E7DFD2; --line-strong: #D4CAB9;
  --ink: #14231C; --ink-2: #3F4E46; --muted: #66726A; --link: #1F7A53;
  --accent: #61D7A4; --accent-ink: #14231C; --kicker: #1F7A53;
  --series: #1F7A53; --grid: #EEE8DE;
  --good: #1F7A53; --bad: #A63D2A; --warn: #8A5A12;
  --shadow: 0 1px 2px rgba(20, 35, 28, .05), 0 6px 24px rgba(20, 35, 28, .05);
  --radius: 16px; --radius-sm: 9px; --btn-radius: 9px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --display: "Manrope", var(--font);
  --mono: "DM Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:where([data-theme="auto"]) {
    color-scheme: dark;
    --bg: #0A0E0C; --panel: #121916; --panel-2: #17201C; --line: #223029; --line-strong: #2E3F36;
    --ink: #EEF3F0; --ink-2: #C9D6CF; --muted: #94A59C; --link: #61D7A4;
    --accent: #61D7A4; --accent-ink: #062016; --kicker: #61D7A4;
    --series: #36A879; --grid: #1D2823;
    --good: #61D7A4; --bad: #F08A73; --warn: #E0A84A;
    --shadow: none; --btn-radius: 999px;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0A0E0C; --panel: #121916; --panel-2: #17201C; --line: #223029; --line-strong: #2E3F36;
  --ink: #EEF3F0; --ink-2: #C9D6CF; --muted: #94A59C; --link: #61D7A4;
  --accent: #61D7A4; --accent-ink: #062016; --kicker: #61D7A4;
  --series: #36A879; --grid: #1D2823;
  --good: #61D7A4; --bad: #F08A73; --warn: #E0A84A;
  --shadow: none; --btn-radius: 999px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink); font: 400 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: var(--link); text-underline-offset: 3px; }
h1, h2, h3 { margin: 0; letter-spacing: -.015em; text-wrap: balance; }
h1 { font: 800 clamp(24px, 3.2vw, 34px)/1.1 var(--display); }
h2 { font: 700 17px/1.3 var(--font); }
button, select, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 6px; }
.kicker { font: 500 12px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--kicker); }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px;
  border: 1px solid var(--line-strong); border-radius: var(--btn-radius); background: transparent;
  color: var(--ink); font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn:hover { border-color: var(--link); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.04); }
.btn.small { min-height: 32px; padding: 0 12px; font-size: 13px; }
.btn[disabled] { opacity: .55; cursor: default; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px;
  border: 1px solid var(--line); font-size: 12.5px; color: var(--ink-2); background: var(--panel-2);
}
.chip.waiting { border-color: var(--warn); color: var(--warn); }
.chip.active { border-color: var(--good); color: var(--good); }
.chip.disabled { border-color: var(--bad); color: var(--bad); }

/* Sign-in and plain notices */
body.plain, .gate { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.notice, .gate-card {
  width: min(440px, 100%); background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 32px 28px; box-shadow: var(--shadow); display: grid; gap: 16px;
}
.gate-card .lockup { width: 210px; }
.gate-card p { margin: 0; color: var(--ink-2); }

/* The wordmark: PLANT in mint (green on light), SWITCH in ink */
.lockup { width: 150px; height: auto; display: block; }
.lockup .w-mint { fill: var(--link); }
.lockup .w-ink { fill: var(--ink); }

/* Shell */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 24px;
  padding: 24px 16px; border-right: 1px solid var(--line); background: var(--panel);
}
.side nav { display: grid; gap: 2px; }
.side nav .group { margin: 14px 10px 6px; }
.side nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px;
  color: var(--ink-2); text-decoration: none; font-weight: 500;
}
.side nav a:hover { background: var(--panel-2); color: var(--ink); }
.side nav a[aria-current="page"] { background: var(--panel-2); color: var(--ink); font-weight: 650; }
.side nav a .count { margin-left: auto; font: 500 12px/1 var(--mono); color: var(--warn); }
.side .me { margin-top: auto; display: grid; gap: 10px; padding: 12px 10px 0; border-top: 1px solid var(--line); }
.side .me b { display: block; font-weight: 650; }
.side .me .prefs { display: flex; gap: 6px; flex-wrap: wrap; }
.topbar-m { display: none; }

main { padding: 28px clamp(16px, 4vw, 44px) 64px; max-width: 1280px; width: 100%; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: 24px; }
.page-head .titles { display: grid; gap: 10px; }
.page-head .tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.asof { font-size: 13px; color: var(--muted); }
select.input {
  min-height: 40px; padding: 0 34px 0 12px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong);
  background: var(--panel) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8'><path d='M1 1l5 5 5-5' fill='none' stroke='%2366726A' stroke-width='1.6'/></svg>") no-repeat right 12px center;
  appearance: none;
}

/* Cards, tiles and the grid */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(12, 1fr); }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow); min-width: 0; animation: rise .45s ease both;
}
.span-12 { grid-column: span 12; } .span-8 { grid-column: span 8; } .span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; } .span-5 { grid-column: span 5; }
.span-4 { grid-column: span 4; } .span-3 { grid-column: span 3; }
a.card { color: inherit; text-decoration: none; transition: border-color .15s ease, transform .15s ease; }
a.card:hover { border-color: var(--line-strong); transform: translateY(-1px); }
a.card h2 { margin: 6px 0 14px; }
a.card p { margin: 0; }
.sheet:focus { outline: none; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.card-head .sub { font-size: 13px; color: var(--muted); }
.tile { display: grid; gap: 6px; align-content: start; }
.tile .label { font-size: 13.5px; color: var(--ink-2); }
.tile .value { font: 650 28px/1.1 var(--font); letter-spacing: -.01em; }
.tile .delta { font-size: 13px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.tile .delta.up { color: var(--good); } .tile .delta.down { color: var(--bad); }
.hero .value { font-size: clamp(40px, 6vw, 56px); }
.note { margin-top: 12px; font-size: 13px; color: var(--muted); }
.empty { padding: 28px; text-align: center; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: var(--radius); }

.chart { width: 100%; height: 280px; }
.chart.tall { height: 340px; }
.toggle { border: 0; background: none; color: var(--link); font: 500 12px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; cursor: pointer; padding: 4px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font: 500 11.5px/1.2 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
.nowrap { white-space: nowrap; }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover td { background: var(--panel-2); }

/* Admin */
.person { display: flex; align-items: center; gap: 12px; }
.person .who b { display: block; font-weight: 650; }
.person .who span { font-size: 13px; color: var(--muted); }
dialog {
  width: min(720px, calc(100% - 24px)); max-height: calc(100vh - 32px); padding: 0; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--panel); color: var(--ink); box-shadow: 0 24px 80px rgba(0,0,0,.25);
}
dialog::backdrop { background: rgba(10, 14, 12, .45); }
.sheet { display: grid; gap: 20px; padding: 24px; overflow-y: auto; max-height: calc(100vh - 34px); }
.sheet section { display: grid; gap: 10px; }
.sheet .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.sheet .actions { display: flex; gap: 8px; justify-content: flex-end; position: sticky; bottom: -24px; background: var(--panel); padding: 12px 0 0; }
.seg { display: inline-flex; justify-self: start; max-width: 100%; flex-wrap: wrap; border: 1px solid var(--line-strong); border-radius: var(--btn-radius); overflow: hidden; }
.seg button { border: 0; background: transparent; padding: 7px 12px; cursor: pointer; font-size: 13.5px; color: var(--ink-2); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); font-weight: 650; }
.roles-grid { display: grid; grid-template-columns: 140px 1fr; gap: 8px 16px; align-items: center; }
.areas-grid { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; align-items: center; font-size: 14px; }
.areas-grid .desc { font-size: 12.5px; color: var(--muted); }
label.check { display: inline-flex; gap: 8px; align-items: center; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); padding: 10px 16px; border-radius: 10px;
  background: var(--ink); color: var(--bg); font-size: 14px; z-index: 50;
}

/* Status chips: state wears the reserved status colours, always with words. */
.chip.bad, .chip.warn, .chip.good { white-space: nowrap; }
.chip.bad { border-color: var(--bad); color: var(--bad); }
.chip.warn { border-color: var(--warn); color: var(--warn); }
.chip.good { border-color: var(--good); color: var(--good); }
.late { color: var(--bad); font-weight: 600; }
.strong { font-weight: 650; }
.small { font-size: 12.5px; }
.clip { max-width: 34ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Today: what needs someone now */
.needs .card-head { margin-bottom: 4px; }
.needs-list { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.need { display: grid; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  color: inherit; text-decoration: none; background: var(--panel-2); }
.need:hover { border-color: var(--line-strong); }
.need { min-width: 0; }
.need-head { display: flex; gap: 8px; align-items: baseline; }
.need ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 13.5px; }
.need li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.need li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; align-self: center; }
.dot.bad { background: var(--bad); } .dot.warn { background: var(--warn); }

/* Boards: one column per stage */
.board-card { padding: 12px; }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 1fr); gap: 12px;
  overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 4px; }
.col { display: grid; align-content: start; gap: 8px; scroll-snap-align: start; min-width: 0;
  background: var(--panel-2); border-radius: var(--radius-sm); padding: 10px; }
.col-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.col-foot { font-size: 12.5px; margin-top: -4px; }
.col-cards { display: grid; gap: 8px; }
.col-empty { font-size: 13px; padding: 6px 2px; }
.kcard { display: grid; gap: 4px; text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel); color: inherit; font: inherit; cursor: pointer; text-decoration: none; }
.kcard:hover { border-color: var(--line-strong); }
.kcard:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.kmeta { display: flex; gap: 10px; flex-wrap: wrap; font-size: 13px; align-items: center; }

/* Detail sheets */
dialog:has(.sheet-body) { width: min(980px, calc(100% - 24px)); }
.sheet:focus { outline: none; }
.sheet-body { display: grid; gap: 16px; min-width: 0; }
.sheet-body h2 { margin: 8px 0 0; font-size: 16px; }
.sheet-body > p { margin: 0; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px 20px; margin: 0; }
.facts dt { font-size: 12.5px; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Dense tables: forecast grid, quote lines */
table.dense { font-size: 13px; }
table.dense th, table.dense td { padding: 7px 8px; }
.grid-table th.sticky, .grid-table td.sticky { position: sticky; left: 0; background: var(--panel); z-index: 1; min-width: 200px; }
td.locked { background: var(--panel-2); color: var(--muted); }
tr.neg td:last-child { color: var(--bad); font-weight: 600; }
input.search { min-height: 38px; padding: 0 12px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong);
  background: var(--panel); color: var(--ink); font: inherit; width: min(280px, 100%); }

@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Phone first where it matters */
@media (max-width: 960px) {
  .span-8, .span-7, .span-6, .span-5 { grid-column: span 12; }
  .span-4, .span-3 { grid-column: span 6; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 25% 0 0; z-index: 40; transform: translateX(-100%); transition: transform .2s ease; height: 100dvh; }
  .app.nav-open .side { transform: none; box-shadow: 0 0 60px rgba(0,0,0,.3); }
  .topbar-m {
    display: flex; position: sticky; top: 0; z-index: 30; align-items: center; justify-content: space-between;
    padding: 12px 16px; background: var(--panel); border-bottom: 1px solid var(--line);
  }
  .topbar-m .lockup { width: 128px; }
  main { padding: 20px 16px 56px; }
}
@media (max-width: 520px) {
  .span-4, .span-3 { grid-column: span 12; }
  .tile .value { font-size: 24px; }
  .roles-grid { grid-template-columns: 1fr; }
  .hide-s { display: none; }
  .board { grid-auto-columns: 82%; }
  .need li { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .tile.span-3 { grid-column: span 6; }
  .tile .label { font-size: 12.5px; }
  .clip { max-width: 20ch; }
}
