/* the platform's look, the Pristine Growth app's: colours sampled from the artist's board, 18 Sep 2026: floor, canopy,
   leaf, lime; paper and rust are ours. What each ink means is declared once, under "the four inks" below. */
:root { color-scheme: dark; --floor: #16241a; --canopy: #34482f; --leaf: #4b613f; --lime: #b7d082; --paper: #eef3e2; --rust: #e07a5f; --sage: #a3b58e;
        --panel: #1c2e21; --edge: rgba(183, 208, 130, 0.16); --line: rgba(183, 208, 130, 0.28);
        --head: "Nunito", "Varela Round", ui-rounded, "Segoe UI", system-ui, sans-serif; --body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
        --mono: ui-monospace, "Cascadia Mono", Consolas, monospace; }
* { box-sizing: border-box; }
html, body { background: var(--floor); color: var(--paper); margin: 0; }
body { font: 17px/1.55 var(--body); -webkit-font-smoothing: antialiased; }
#canopy { position: absolute; top: 0; left: 0; width: 100%; height: 120px; z-index: 0; pointer-events: none; display: block; }
body.gated #canopy { height: min(42vh, 320px); }
body.gated header { justify-content: center; padding-top: calc(min(42vh, 320px) - 8px); }
body.gated header .brand { font-size: 44px; letter-spacing: -0.02em; }
body.gated main { max-width: 420px; padding-top: 24px; }
header { position: relative; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 24px; max-width: 1280px; margin: 0 auto; }
header .brand { font: 800 22px/1 var(--head); color: var(--lime); letter-spacing: -0.01em; }
header .who { display: flex; gap: 14px; align-items: center; font: 600 15px var(--head); }
header .who a { color: var(--paper); opacity: 0.8; }
header .who a:hover { opacity: 1; color: var(--lime); }
header .who button { white-space: nowrap; min-height: 0; padding: 6px 14px; font: 700 14px var(--head); background: rgba(22, 36, 26, 0.6); }
header .shell-nav { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; font: 700 15px var(--head); }
header .shell-nav a { color: var(--paper); opacity: 0.8; }
header .shell-nav a:hover, header .shell-nav a[aria-current="page"] { opacity: 1; color: var(--lime); }
header .shell-nav a.soon, header .shell-nav a.soon:hover { opacity: 1; color: var(--sage); }   /* off: a page coming soon to this level */
header .shell-nav select.client-pick { min-height: 0; padding: 5px 10px; font: 700 14px var(--head); background: rgba(22, 36, 26, 0.6); }
.row.person { gap: 8px; }
.row.person .acts input { flex: 1 1 160px; min-width: 0; max-width: 100%; font: 13px var(--mono); padding: 8px 10px; min-height: 0; }
.row.person .acts button { flex: 0 0 auto; min-height: 0; padding: 7px 12px; font: 700 13px var(--head); }
main { position: relative; z-index: 1; max-width: 680px; margin: 0 auto; padding: 48px 24px 80px; }
a { color: var(--lime); text-decoration: none; }
h1 { font: 800 30px/1.2 var(--head); margin: 0 0 18px; letter-spacing: -0.01em; }
h2 { font: 700 15px var(--head); color: var(--sage); margin: 32px 0 10px; }
button, input, select, textarea { font: inherit; color: var(--paper); background: var(--floor); border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; min-height: 46px; }
button { cursor: pointer; font: 800 15px var(--head); padding: 11px 20px; border-color: rgba(183, 208, 130, 0.32); background: none; }
button:hover:not(:disabled) { border-color: var(--lime); color: var(--lime); }
button:disabled { opacity: 0.6; cursor: not-allowed; }
/* buttons are paper outlines: a primary button (go) is not lime because it is primary, a stop is not rust; a button
   that sends or spends says what and how much in its label and asks once */
button.go, button.stop { background: none; color: var(--paper); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--lime); box-shadow: 0 0 0 3px rgba(183, 208, 130, 0.18); }
button:focus-visible, a:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; }
::placeholder { color: var(--sage); opacity: 0.75; }
small { color: var(--sage); font-size: 14px; }
.red { color: var(--rust); }
.green { color: var(--lime); }
.quiet { color: var(--sage); }
.login { max-width: 420px; }
.cell { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.cell label { font-size: 14px; color: var(--sage); }
.cell input { width: 100%; }
.cell .again { background: none; border: 0; padding: 0; min-height: 0; font: 600 15px var(--head); color: var(--sage); }
.rows { border-top: 1px solid var(--edge); }
.row { display: flex; flex-direction: column; gap: 4px; padding: 14px 0; border-bottom: 1px solid var(--edge); color: var(--paper); }
.row:hover span { color: var(--lime); }
.start { display: grid; grid-template-columns: 1fr 2fr auto; gap: 8px; align-items: center; margin: 8px 0; }
.start small { grid-column: 1 / -1; }
.card { display: flex; flex-direction: column; gap: 14px; background: var(--panel); border: 1px solid var(--edge); border-radius: 16px; padding: 20px 22px; }
.card h1 { margin: 0; font-size: 24px; }
.card pre { white-space: pre-wrap; word-break: break-word; max-height: 40vh; overflow: auto; margin: 0; padding: 12px; border: 1px solid var(--edge); border-radius: 12px; background: var(--floor); font: 13px/1.5 var(--mono); color: var(--sage); }
.card label { display: flex; flex-direction: column; gap: 6px; }
.card label span { color: var(--sage); font-size: 14px; }
.acts { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.acts button { flex: 1 1 120px; }

/* ---- the four inks, one meaning each, on every screen (rules of 6 Oct 2026: colour is who acts next, read from the
   seat of the person looking). A screen names the ink, never a hue: rust yours (you or your side must act, a failure to
   fix, a refusal); lime live and not on you (the other side's move, a switch on, a check proven); paper held by us or the
   machine, nobody to chase; sage finished or off (done, closed, off by choice, zero, quiet). No fifth ink. */
.ink-rust { color: var(--rust); }
.ink-lime { color: var(--lime); }
.ink-paper { color: var(--paper); }
.ink-sage { color: var(--sage); }
.pill { display: inline-block; padding: 0 8px; border: 1px solid currentColor; border-radius: 999px; font: 700 12px/18px var(--head); white-space: nowrap; vertical-align: 1px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: currentColor; vertical-align: 1px; }
.mono { font: 13px/1.5 var(--mono); }

/* ---- a wide screen: tables full width to 1400 px; the house screens keep 680 */
main:has(> .wide) { max-width: 1400px; }

/* ---- the state line: loading (sage "reading"), empty (sage, what is empty and the next action), error or refusal (rust,
   the server's words) where the act was; empty, it takes no room */
.state { margin: 10px 0; font: 600 15px/1.5 var(--body); overflow-wrap: anywhere; }
.state:empty { display: none; }

/* ---- the bar over a table: filter, chips, then one "+" at the right edge */
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; }
.bar input[type="search"] { flex: 0 1 260px; min-width: 0; min-height: 0; padding: 7px 12px; font-size: 15px; }
.bar .spacer { flex: 1 1 auto; }
.chip { min-height: 0; padding: 4px 12px; border-radius: 999px; font: 700 13px var(--head); border-color: var(--edge); }
.chip[aria-pressed="true"] { border-color: var(--paper); background: rgba(238, 243, 226, 0.1); }
.chip .n { margin-left: 6px; color: var(--sage); font-weight: 600; }
button.plus { min-height: 0; width: 38px; height: 38px; padding: 0; border-radius: 10px; font: 800 22px/1 var(--head); }
.tabs { display: flex; gap: 18px; flex-wrap: wrap; align-items: baseline; margin: 0 0 14px; font: 700 15px var(--head); }
.tabs a { color: var(--paper); opacity: 0.7; padding: 4px 0; border-bottom: 2px solid transparent; }
.tabs a:hover { opacity: 1; }
.tabs a[aria-current="page"] { opacity: 1; border-bottom-color: var(--paper); }
.tabs .n { color: var(--sage); font-weight: 600; margin-left: 5px; }

/* ---- the shared table (app.js table()): a row is one line, 42 px; every header sorts (its button), the sorted one
   wears a triangle; a row that acts (tr.go) opens in place or goes to its view */
.tbl { width: 100%; border-collapse: collapse; font-size: 15px; }
.tbl th { text-align: left; padding: 0 12px 0 0; border-bottom: 1px solid var(--line); vertical-align: bottom; white-space: nowrap; }
.tbl th button.sort { min-height: 0; padding: 6px 0; border: 0; border-radius: 0; background: none; font: 700 13px var(--head); color: var(--sage); }
.tbl th button.sort:hover { color: var(--paper); }
.tbl th[aria-sort] button.sort { color: var(--paper); }
.tbl th[aria-sort="ascending"] button.sort::after { content: " \25B2"; font-size: 10px; }
.tbl th[aria-sort="descending"] button.sort::after { content: " \25BC"; font-size: 10px; }
.tbl td { height: 42px; padding: 0 12px 0 0; border-bottom: 1px solid var(--edge); vertical-align: middle; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 360px; }
.tbl td.wrap { white-space: normal; overflow-wrap: anywhere; }
/* a link in a cell is the value itself (a name, a client): paper, never lime, which means the other side's move */
.tbl a:not([class]) { color: inherit; }
.tbl a:not([class]):hover { text-decoration: underline; text-underline-offset: 3px; }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl td.state { height: 42px; margin: 0; }
.tbl tr.go { cursor: pointer; }
.tbl tbody tr:hover, .tbl tr.go:focus-visible { background: rgba(238, 243, 226, 0.04); outline: none; }
.tbl tr.opened, .tbl tr.opened:hover { background: var(--panel); }
.tbl tr.form td { height: 52px; overflow: visible; }
.tbl tr.form input, .tbl tr.form select { min-height: 0; padding: 6px 10px; font-size: 15px; width: 100%; }
.tbl tr.form button { min-height: 0; padding: 6px 14px; font-size: 14px; }
.tbl tr.drawer > td { height: auto; padding: 12px 14px 16px; white-space: normal; overflow: visible; max-width: none; background: var(--panel); }
/* row actions sit at the row's right, quiet until the row is hovered or holds focus */
.row-acts { display: flex; gap: 6px; justify-content: flex-end; opacity: 0.55; }
.tbl tr:hover .row-acts, .tbl tr:focus-within .row-acts { opacity: 1; }
.row-acts button, .row-acts a.btn { min-height: 0; padding: 4px 10px; border-radius: 8px; font: 700 13px var(--head); white-space: nowrap; }
.tbl td.end { text-align: right; overflow: visible; }

/* ---- a phone, 390 wide: a table is two-line rows, the l1 cells on line 1, the rest muted on line 2; actions at thumb
   height, 44 px; no sideways page scroll */
@media (max-width: 720px) {
  .tbl thead { display: none; }
  .tbl, .tbl tbody { display: block; }
  .tbl tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding: 9px 0; border-bottom: 1px solid var(--edge); }
  .tbl tr::after { content: ""; order: 1; flex-basis: 100%; height: 0; }
  .tbl td { display: block; order: 2; height: auto; padding: 0; border: 0; max-width: 100%; font-size: 14px; color: var(--sage); }
  .tbl td.l1 { order: 0; font-size: 16px; color: var(--paper); }
  .tbl td.l1:first-child { flex: 1 1 0; min-width: 0; }
  .tbl td.end { order: 3; flex-basis: 100%; text-align: left; }
  .tbl td.state, .tbl tr.drawer > td { flex-basis: 100%; }
  .tbl tr.form { gap: 8px; }
  .tbl tr.form td { flex-basis: 100%; order: 0; }
  .row-acts { opacity: 1; justify-content: flex-start; flex-wrap: wrap; }
  .row-acts button, .row-acts a.btn { flex: 0 0 auto; padding: 0 16px; }
  .row-acts button, .row-acts a.btn, .tbl tr.form button, .tbl tr.form input, .tbl tr.form select { min-height: 44px; }
  /* the filter and the "+" share the top line, at thumb height; the chips wrap under them */
  .bar > * { order: 2; }
  .bar input[type="search"] { flex: 1 1 0; order: 0; min-height: 44px; }
  .bar button.plus { order: 1; width: 44px; height: 44px; }
  .bar .spacer { display: none; }
  .tbl td.blank { display: none; }
  /* a bare number on line 2 says what it counts */
  .tbl td.num:not(.l1)::before { content: attr(data-k) " "; }
  .start { grid-template-columns: 1fr; } .start input, .start select, .start button { width: 100%; }
}
@media (max-width: 480px) { main { padding: 40px 16px 64px; } .start { grid-template-columns: 1fr; } }

/* ---- the header on a phone (north star default, 6 Oct 2026): one 56 px bar, the ui's title and Menu; Menu opens the
   nav, the client picker and who is logged in as a list under the bar, links at thumb height */
header button.menu { display: none; }
@media (max-width: 720px) {
  header { flex-wrap: wrap; gap: 0 12px; padding: 0 16px; min-height: 56px; }
  header .brand { line-height: 56px; font-size: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  header button.menu { display: inline-flex; align-items: center; margin-left: auto; min-height: 44px; padding: 0 16px; font: 700 15px var(--head); }
  header .shell-nav, header .who { display: none; }
  header.menu-open .shell-nav { display: flex; flex-direction: column; align-items: stretch; flex-basis: 100%; order: 3; gap: 0; border-top: 1px solid var(--edge); }
  header.menu-open .shell-nav a { display: flex; align-items: center; min-height: 44px; border-bottom: 1px solid var(--edge); }
  header.menu-open .shell-nav select.client-pick { min-height: 44px; margin: 8px 0; }
  header.menu-open .who { display: flex; flex-basis: 100%; order: 4; justify-content: space-between; padding: 6px 0 12px; }
  header.menu-open .who a { min-height: 44px; display: inline-flex; align-items: center; }
}
