/* Hallmark · checked form · app screen (founder portal), the project's own system: founders.css tokens, mono first, colour as a theme · fixes: 4px spacing scale, shadows and band colours as tokens, sentence-case labels, hairline notices, pills only on controls, pressed states, reduced motion */
/* Hallmark · pre-emit critique: P4 H4 E4 S4 R4 V3 · weakest: V, an app shell keeps the shape founders already learned; the five sections and one focal band carry it */
/* Hallmark · waive 49b · the wrapping links are task titles on Today, each one heading its own card · a task title is the headline of a founder's task and may take two lines on a phone */
/* Hallmark · waive 72 · the closed withdraw-preview disclosure on Money, measured with its hidden content; open, its last line sits 16px inside the card · the preview stays folded on the payout screen so founders read one number first */
/* Hallmark · dismissed 58 · word counts on app screens are gated per area by tests/walk-states.mjs (≤120 words of prose) */

/* Portal tokens (beside founders.css): elevation and the dark band, one source for both themes */
:root, [data-theme="mono"] {
  --shadow-rest: rgb(0 0 0 / .04); --shadow-hover: rgb(0 0 0 / .07); --shadow-lift: rgb(0 0 0 / .08);
  --shadow-band: rgb(0 0 0 / .14); --shadow-bar: rgb(0 0 0 / .06); --band-rule: rgb(255 255 255 / .22); --band-end: #111111;
}
[data-theme="colour"] { --shadow-lift: rgb(8 20 49 / .12); --band-end: #12245a; }
/* Founder portal shell. Mono first: state is told by shape, weight, border and words, never by colour. */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: calc(100vh - 120px); }
.app > * { min-width: 0; }
@media (max-width: 860px) { .app { grid-template-columns: 1fr; min-height: 0; align-content: start; } }
.rail { background: var(--paper); border-right: 1px solid var(--line-soft); padding: 20px 12px; display: grid; align-content: start; gap: 4px; }
@media (max-width: 860px) { .rail { border-right: 0; border-bottom: 1px solid var(--line-soft); grid-auto-flow: column; overflow-x: auto; } }
.rail a { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border-radius: 10px; font-weight: 700; color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.rail a[aria-current] { color: var(--ink); background: var(--surface); box-shadow: inset 4px 0 0 var(--ink); }
.rail .count { font-size: 13px; font-weight: 800; border: 2px solid var(--ink); border-radius: 6px; min-width: 24px; text-align: center; color: var(--ink); }
.pane { padding: 32px clamp(16px, 4vw, 48px) 64px; max-width: 1040px; display: grid; gap: 20px; align-content: start; }
.pane h1 { font-size: clamp(30px, 4vw, 44px); margin: 0; line-height: 1.05; }
.pane h1:focus { outline: none; }
.pane h2 { font-size: 22px; margin: 12px 0 0; }
.lede { margin: 0; color: var(--ink-2); font-size: 18px; }
.status-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 0; }
.status-row > div { background: var(--paper); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 16px 16px; }
.status-row dt { font-size: 15px; color: var(--ink-2); }
.status-row dd { margin: 4px 0 0; font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.status-row small { display: block; font-size: 14px; font-weight: 400; color: var(--ink-2); }
.status-row a { font-size: 15px; font-weight: 700; }
.needs { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; counter-reset: need; }
.need { counter-increment: need; display: grid; grid-template-columns: 40px 1fr; gap: 16px; background: var(--paper); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 16px; }
.need::before { content: counter(need); width: 34px; height: 34px; display: grid; place-items: center; border: 2px solid var(--ink); border-radius: 50%; font-weight: 800; }
.need.is-high { border: 2px solid var(--ink); }
.need b { font-size: 18px; }
.need p { margin: 4px 0 12px; color: var(--ink-2); }
.tag { display: inline-block; font-size: 13px; font-weight: 700; border: 1px solid var(--ink); border-radius: 6px; padding: 0 8px; vertical-align: middle; }
.tag--soft { border-style: dashed; }
.tag--solid { background: var(--ink); color: var(--paper); }
.list { display: grid; gap: 12px; }
.card { background: var(--paper); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 16px 16px; display: grid; gap: 8px; }
.card-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.card-head b { font-size: 18px; }
.seg { display: inline-flex; border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; }
.seg button { font: inherit; font-weight: 700; min-height: 44px; padding: 0 16px; border: 0; background: var(--paper); color: var(--ink); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
table { width: 100%; border-collapse: collapse; background: var(--paper); font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 12px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
th { font-size: 15px; color: var(--ink-2); }
td.num, th.num { text-align: right; white-space: nowrap; }
.scroll { overflow-x: auto; }
.notice-line { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; background: var(--paper); font-weight: 700; margin: 0; }
.chooser { display: grid; gap: 20px; }
.chooser fieldset { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.chooser legend { font-weight: 800; font-size: 18px; margin-bottom: 8px; }
.type { text-align: left; font: inherit; color: var(--ink); background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius); padding: 16px; cursor: pointer; display: grid; gap: 4px; }
.type:hover, .type:focus-visible { border-color: var(--ink); }
.type[aria-disabled="true"] { border-style: dashed; cursor: not-allowed; color: var(--ink-2); }
.type span { font-size: 15px; color: var(--ink-2); }
.bar { height: 8px; border: 2px solid var(--ink); border-radius: 4px; overflow: hidden; min-width: 80px; }
.bar span { display: block; height: 100%; background: var(--ink); }
.offer { border: 2px solid var(--ink); border-radius: 20px; padding: clamp(20px, 3vw, 28px); background: var(--paper); display: grid; gap: 12px; }
.offer > .tag { justify-self: start; }
.offer-price { font-size: 36px; font-weight: 800; margin: 0; font-variant-numeric: tabular-nums; }
.check { display: flex; gap: 12px; align-items: flex-start; }
.check input { width: 22px; height: 22px; accent-color: var(--ink); margin-top: 2px; }
.stuck { border-top: 1px solid var(--line-soft); padding-top: 16px; margin: 8px 0 0; color: var(--ink-2); }
.stuck a { font-weight: 700; color: var(--ink); }
.steps-path { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.steps-path .is-here { border: 2px solid var(--ink); }
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }

/* ---- States and detail screens (PORTAL-STATES.md). Mono: each state reads by its edge, weight and words. ---- */
.notice-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; }
.checking { border: 2px dashed var(--ink); border-radius: var(--radius); padding: 12px 16px; background: var(--paper); }
.stale { border: 2px dashed var(--ink-2); border-radius: var(--radius); padding: 12px 16px; background: var(--surface); }
.confirm { border: 3px solid var(--ink); border-radius: var(--radius); padding: 16px; background: var(--paper); display: grid; gap: 4px; }
.confirm p { margin: 0; }
.empty { border: 2px dashed var(--line); border-radius: var(--radius); padding: 24px; background: var(--paper); display: grid; gap: 8px; }
.empty b { font-size: 20px; }
.empty p { margin: 0; color: var(--ink-2); max-width: 60ch; }
.empty .actions { margin-top: 8px; }
.back { margin: 0; }
.back a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; color: var(--ink); }
.card.is-urgent { border: 2px solid var(--ink); box-shadow: inset 6px 0 0 var(--ink); }
.card > b, .card .card-head b { overflow-wrap: anywhere; }
.card a:not(.btn), .need a:not(.btn), td a { color: var(--ink); font-weight: 700; text-underline-offset: 3px; }
td a, .card-head b a { display: inline-flex; align-items: center; min-height: 44px; }
.need .actions { align-items: center; }
.need .actions > a:not(.btn) { display: inline-flex; align-items: center; min-height: 44px; }
.record { margin: 0; padding: 12px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 15px; white-space: pre-wrap; overflow-wrap: anywhere; }
.week { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin: 0; }
.week > div { border: 1px solid var(--line-soft); border-radius: 10px; padding: 12px 12px; background: var(--paper); }
.week dt { font-weight: 800; }
.week dd { margin: 2px 0 0; color: var(--ink-2); }
.grid3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .grid3 { grid-template-columns: 1fr; } }
.inline { font-weight: 700; align-self: center; }
.actions select { min-height: 44px; border: 2px solid var(--ink); border-radius: 10px; padding: 0 12px; font: inherit; background: var(--paper); color: var(--ink); }
.type.is-gated { border-style: dashed; color: var(--ink-2); }
details.card > summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; }
.proto-in select { min-height: 44px; font: inherit; border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; }
.state-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; }
.state-list a { display: flex; gap: 12px; align-items: center; min-height: 48px; padding: 8px 12px; border: 1px solid var(--line-soft); border-radius: 10px; background: var(--paper); color: var(--ink); font-weight: 700; text-decoration: none; }
.state-list a:hover { border-color: var(--ink); }

/* ---- Builder, store preview, earnings (J-9, J-10). Mono: done ✓, current ● with a heavy edge, to do ○. ---- */
.build-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.build-steps li { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 12px; border: 1px solid var(--line-soft); border-radius: 8px; font-size: 15px; color: var(--ink-2); background: var(--paper); }
.build-steps li.is-done { color: var(--ink); border-color: var(--line); }
.build-steps li.is-here { color: var(--ink); border: 2px solid var(--ink); font-weight: 800; }
.build-steps .mark { font-weight: 800; }
.build-form { display: grid; gap: 16px; }
.pack { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 16px; margin: 0; display: grid; gap: 12px; background: var(--paper); }
.pack legend { font-weight: 800; padding: 0 8px; }
.field .hint { margin: 0; }
fieldset.field { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
fieldset.field legend { font-weight: 700; margin-bottom: 8px; }
.store-frame { margin: 0; border: 2px solid var(--ink); border-radius: 14px; overflow: hidden; background: var(--paper); width: 100%; }
.store-frame.is-phone { max-width: 390px; }
.store-bar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); background: var(--surface); font-size: 15px; flex-wrap: wrap; }
.store-bar .dots { display: flex; gap: 8px; } .store-bar .dots i { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--line); display: block; }
.store-bar .url { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.store-page { padding: clamp(16px, 3vw, 28px); display: grid; gap: 12px; }
.store-cover { aspect-ratio: 16 / 9; border-radius: 10px; background: repeating-linear-gradient(135deg, var(--surface) 0 14px, var(--surface-2) 14px 28px); display: grid; place-content: center; gap: 8px; text-align: center; font-weight: 700; color: var(--ink-2); }
.store-by { margin: 0; color: var(--ink-2); font-size: 15px; }
.store-title { margin: 0; font-size: clamp(24px, 3vw, 32px); line-height: 1.15; overflow-wrap: anywhere; }
.store-tags { margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.store-packs { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.store-frame.is-phone .store-packs { grid-template-columns: 1fr; }
.store-pack { border: 1px solid var(--line); border-radius: 10px; padding: 16px; display: grid; gap: 4px; align-content: start; }
.store-pack p { margin: 0; }
.store-price { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.store-page h3 { margin: 8px 0 0; font-size: 18px; }
.store-page details summary { min-height: 44px; display: flex; align-items: center; font-weight: 700; cursor: pointer; }
.store-fine { font-size: 13px; color: var(--ink-2); border-top: 1px solid var(--line-soft); padding-top: 12px; margin: 0; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }
.tabs a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; font-weight: 700; color: var(--ink-2); text-decoration: none; border-bottom: 3px solid transparent; }
.tabs a[aria-current] { color: var(--ink); border-bottom-color: var(--ink); }
.balances { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 12px; }
@media (max-width: 960px) { .balances { grid-template-columns: 1fr 1fr; } .bal--main { grid-column: 1 / -1; } }
@media (max-width: 480px) { .balances { grid-template-columns: 1fr; } }
.bal { border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 16px 16px; background: var(--paper); display: grid; gap: 4px; align-content: start; }
.bal p { margin: 0; }
.bal--main { border: 2px solid var(--ink); }
.bal-n { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; }
.bal--main .bal-n { font-size: 40px; }
.track { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; font-weight: 700; }
.track [aria-current] { font-weight: 800; text-decoration: underline; text-underline-offset: 4px; }
.seg--wrap { flex-wrap: wrap; border-radius: 22px; }
/* Builder form: the landing page's form card style doesn't apply inside the portal */
.build-form { border: 0; padding: 0; background: none; border-radius: 0; }
.pane .seg { justify-self: start; }
/* Step marks drawn in CSS (fonts lack the symbols): done = filled with a tick, current = ring with a dot, to do = ring */
.build-steps .mark { width: 16px; height: 16px; border: 2px solid currentColor; border-radius: 50%; position: relative; flex: none; }
.build-steps li.is-done .mark { background: var(--ink); border-color: var(--ink); }
.build-steps li.is-done .mark::after { content: ""; position: absolute; left: 4px; top: 1px; width: 4px; height: 8px; border: solid var(--paper); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.build-steps li.is-here .mark::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--ink); }
/* Activity on phones: one stacked row per line, amount on the right */
@media (max-width: 640px) {
  table.activity thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  table.activity, table.activity tbody { display: block; }
  table.activity tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
  table.activity td { border: 0; padding: 0; }
  table.activity .a-date { grid-column: 1; color: var(--ink-2); font-size: 14px; }
  table.activity .a-what { grid-column: 1; }
  table.activity td:nth-child(3) { grid-column: 1; }
  table.activity td.num { grid-column: 2; grid-row: 1 / span 3; align-self: center; font-weight: 700; }
}
.build-form > .btn { justify-self: start; }
.queued { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; } .queued li { border: 2px dashed var(--ink); border-radius: var(--radius); padding: 12px 16px; background: var(--paper); font-weight: 700; }
.queued li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
/* White-label: a pill with a heavy outline and a corner mark, so it reads in mono without colour */
.tag--wl { border: 2px solid var(--ink); border-radius: 999px; padding: 0 8px; font-weight: 800; letter-spacing: .02em; }
.tag--wl::before { content: "◆ "; font-size: 10px; vertical-align: 1px; }
.lib { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.lib-card p { margin: 0; }
.lib-card details summary { min-height: 44px; display: flex; align-items: center; font-weight: 700; cursor: pointer; }
.lib-card ol { margin: 0 0 8px; padding-left: 20px; }
.status-row a { display: inline-flex; align-items: center; min-height: 44px; }
.proposal > summary { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-height: 44px; font-weight: 700; cursor: pointer; }
.proposal { border-style: dashed; }
.bal--main .track { margin-top: 8px; font-size: 15px; }

/* ===== Hi-fi finish (raised-design-bar rung 4), 2026-11-26. Same markup in both themes; mono reads by fill, weight
   and edge; the colour theme only re-tints tokens and adds one meaning per hue (orange = do this, blue = where you are). */
.pane { gap: 24px; }
.pane h1 { font-weight: 800; letter-spacing: -0.025em; text-wrap: balance; }
.pane h2 { letter-spacing: -0.01em; }
.lede { max-width: 62ch; }

/* Today at a glance: the one focal point of Home */
.today { background: var(--ink); color: var(--on-dark); border-radius: 22px; padding: clamp(20px, 3vw, 28px); box-shadow: 0 18px 50px var(--shadow-band); }
.today dl { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 0; margin: 0; }
.today dl > div { padding: 4px clamp(16px, 2.4vw, 28px); border-left: 1px solid var(--band-rule); display: grid; gap: 2px; align-content: start; min-width: 0; }
.today dl > div:first-child { border-left: 0; padding-left: 0; }
.today dt { font-size: 15px; font-weight: 700; color: var(--on-dark-2); }
.today dd { margin: 0; font-size: clamp(26px, 3.2vw, 34px); font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.today .today-lead dd { font-size: clamp(44px, 6vw, 64px); line-height: 1; }
.today p { margin: 4px 0 0; color: var(--on-dark-2); font-size: 16px; overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .today dl { grid-template-columns: 1fr 1fr; gap: 16px 0; }
  .today .today-lead { grid-column: 1 / -1; padding-left: 0; }
  .today dl > div:nth-child(2) { border-left: 0; padding-left: 0; }
}

/* Needs: a ranked queue. The first is the focus: lifted and wider; the rest are calm. */
.need { transition: box-shadow .15s ease, transform .15s ease; }
.needs > .need:first-child { padding: 24px; box-shadow: 0 10px 30px var(--shadow-lift); border: 2px solid var(--ink); }
.needs > .need:first-child b { font-size: 21px; }
.need .tag { border-radius: 6px; padding: 1px 8px; }
.need .actions { display: flex; flex-wrap: wrap; gap: 8px 16px; }

/* Cards and status tiles: one soft elevation, a lift on hover for the ones that open something */
.status-row > div, .bal, .card, .lib-card { box-shadow: 0 1px 2px var(--shadow-rest); }
.status-row > div { display: grid; gap: 2px; align-content: start; border-radius: 16px; padding: 16px 20px; }
.status-row > div:hover { box-shadow: 0 8px 24px var(--shadow-hover); }

/* Money: the payout is a statement-style hero, filled, so it reads first in mono too */
.bal--main { background: var(--ink); color: var(--on-dark); border-color: var(--ink); box-shadow: 0 18px 50px var(--shadow-band); border-radius: 20px; }
.bal--main .small, .bal--main p { color: var(--on-dark-2); }
.bal--main > p:first-child { color: var(--on-dark); font-weight: 700; }
.bal--main .bal-n { color: var(--on-dark); font-size: clamp(38px, 5vw, 52px); letter-spacing: -0.02em; }
.bal--main a { color: var(--on-dark); }
.bal--main .track { color: var(--on-dark); }
.bal--main .track [aria-current] { color: var(--on-dark); }
.bal--main.is-urgent { box-shadow: inset 8px 0 0 var(--on-dark), 0 18px 50px var(--shadow-band); }
.bal { border-radius: 16px; }

/* Rail: the current area is filled; counts are solid pills */
.rail a { transition: background .15s ease; }
.rail a:hover { background: var(--surface); color: var(--ink); }
.rail .count { background: var(--ink); color: var(--paper); border-color: var(--ink); padding: 0 8px; }

/* Header: who is signed in, as a chip with initials */
#who { display: inline-flex; align-items: center; gap: 12px; font-weight: 700; color: var(--ink-2); }
#who::before { content: attr(data-initials); width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--paper); font-weight: 800; font-size: 14px; flex: none; }

/* Colour theme: tokens from the landing; each hue has one meaning */
[data-theme="colour"] .pane { background: var(--surface); }
[data-theme="colour"] .rail a[aria-current] { background: var(--mark); color: var(--ink); box-shadow: inset 4px 0 0 var(--link); }
[data-theme="colour"] .today { background: linear-gradient(135deg, var(--ink) 0%, var(--band-end) 100%); }
[data-theme="colour"] .today .today-lead dd { color: var(--on-dark); }
[data-theme="colour"] .today .today-lead dd::after { content: ""; display: block; width: 56px; height: 6px; border-radius: 6px; background: var(--action); margin-top: 12px; }
[data-theme="colour"] .needs > .need:first-child { border-color: var(--ink); box-shadow: 0 12px 34px var(--shadow-lift); }
[data-theme="colour"] .need::before { border-color: var(--ink); }
[data-theme="colour"] .needs > .need:first-child::before { background: var(--ink); color: var(--on-dark); }
[data-theme="colour"] .status-row a, [data-theme="colour"] .card a:not(.btn), [data-theme="colour"] td a { color: var(--link); }
[data-theme="colour"] .tabs a[aria-current], [data-theme="colour"] .seg button[aria-pressed="true"] { border-bottom-color: var(--link); }
[data-theme="colour"] .bal--main { background: linear-gradient(135deg, var(--ink) 0%, var(--band-end) 100%); }
[data-theme="colour"] .bar span { background: var(--progress); }
[data-theme="colour"] #who::before { background: var(--link); color: var(--on-dark); }
/* Minimal Home: the rest of the queue behind one disclosure */
.more-needs > summary { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-height: 44px; font-weight: 700; cursor: pointer; }
.more-needs[open] > summary { margin-bottom: 12px; }
.more-needs > summary .small { font-size: 16px; font-weight: 400; }

/* ===== Simplest dashboard (owner, 26 Nov): five sections, one decision per screen ===== */
.rail { gap: 8px; }
.rail a { min-height: 48px; font-size: 17px; }
.top-right { display: inline-flex; align-items: center; gap: 20px; }
.help-link a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 2px solid var(--ink); color: var(--ink); font-weight: 700; text-decoration: none; }
.help-link a[aria-current] { background: var(--ink); color: var(--paper); }
/* Phone: the five sections as a bottom tab bar, always in thumb reach */
@media (max-width: 860px) {
  .rail { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 0; padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); border-bottom: 0; background: var(--paper); overflow: visible; box-shadow: 0 -6px 20px var(--shadow-bar); }
  .rail a { flex-direction: column; justify-content: center; gap: 2px; min-height: 56px; padding: 4px 2px; font-size: 13px; text-align: center; white-space: normal; line-height: 1.15; border-radius: 10px; box-shadow: none !important; }
  .rail .count { position: absolute; transform: translate(18px, -14px); font-size: 11px; min-width: 20px; }
  .rail a { position: relative; }
  body.portal { padding-bottom: 72px; }
  #who { font-size: 0; gap: 0; }
  #who::before { font-size: 14px; }
}
/* Add a course: three big choices first; everything else behind one disclosure (Hick) */
.choose3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.type--big { padding: 20px; border-width: 2px; border-color: var(--ink); min-height: 120px; align-content: start; }
.type--big b { font-size: 19px; }
.more-kinds > summary { min-height: 44px; display: flex; align-items: center; font-weight: 700; cursor: pointer; }
.more-kinds[open] > summary { margin-bottom: 12px; }
/* AI tutor: a switch on each course */
.switches, .rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; background: var(--paper); border: 1px solid var(--line-soft); border-radius: 16px; overflow: hidden; }
.switches li, .rows li { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 20px; border-top: 1px solid var(--line-soft); }
.switches li:first-child, .rows li:first-child { border-top: 0; }
.switches li > span, .rows li > span { display: grid; gap: 2px; min-width: 0; }
.switches .small, .rows .small { font-size: 16px; overflow-wrap: anywhere; }
.rows li > a { flex: none; display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; color: var(--ink); }
.switch { flex: none; min-width: 72px; min-height: 44px; border-radius: 999px; border: 2px solid var(--ink); background: var(--paper); color: var(--ink); font: inherit; font-weight: 800; cursor: pointer; }
.switch[aria-checked="true"] { background: var(--ink); color: var(--paper); }
.switch[aria-checked="true"]::before { content: "● "; }
.switch[aria-checked="false"]::before { content: "○ "; }
.switch:disabled { border-style: dashed; cursor: not-allowed; color: var(--ink-2); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[data-theme="colour"] .help-link a { border-color: var(--link); color: var(--link); }
[data-theme="colour"] .help-link a[aria-current] { background: var(--link); color: var(--on-dark); }
[data-theme="colour"] .switch[aria-checked="true"] { background: var(--link); border-color: var(--link); color: var(--on-dark); }
[data-theme="colour"] .rows li > a { color: var(--link); }
/* Money: the payout first; every other line on demand */
.pane > .bal--main { max-width: 560px; }
.balances--3 { grid-template-columns: repeat(3, 1fr); margin-bottom: 16px; }
@media (max-width: 760px) { .balances--3 { grid-template-columns: 1fr; } }
.every-line > summary { min-height: 48px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-weight: 800; font-size: 18px; cursor: pointer; }
.every-line > summary .small { font-size: 16px; font-weight: 400; }
.every-line[open] > summary { margin-bottom: 12px; }
.lib-rows details summary { min-height: 44px; display: flex; align-items: center; font-weight: 700; cursor: pointer; }
.lib-rows li { align-items: flex-start; }
.lib-rows li > .btn, .lib-rows li > span:last-child:not(:first-child) { margin-top: 4px; }
.need b a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.need b a:hover { text-decoration-thickness: 2px; }
.empty .actions { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; } .empty .actions a:not(.btn) { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; color: var(--ink); }
/* Your courses as cards (a gallery) or a list (owner, 26 Nov) */
.gallery { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.gcard { background: var(--paper); border: 1px solid var(--line-soft); border-radius: 16px; overflow: hidden; display: grid; box-shadow: 0 1px 2px var(--shadow-rest); }
.gbody { padding: 12px 16px 16px; display: grid; gap: 8px; }
.gbody b a { color: var(--ink); text-decoration: none; font-size: 18px; }
.gbody b a:hover { text-decoration: underline; }
.gmeta { display: flex; flex-wrap: wrap; gap: 8px; }
.gdeliv { color: var(--ink); }
/* Messages with a client */
.msgs { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.msg { max-width: 85%; padding: 12px 16px; border-radius: 14px; border: 1px solid var(--line-soft); background: var(--surface); }
.msg p { margin: 0 0 2px; overflow-wrap: anywhere; }
.msg--you { justify-self: end; background: var(--paper); border: 2px solid var(--ink); }
.thread textarea { width: 100%; }

/* Pressed: every control answers the press, instantly */
.btn:active, .rail a:active, .tabs a:active, .seg button:active, .switch:active, .type:active, .help-link a:active, summary:active { transform: translateY(1px); }
@media (prefers-reduced-motion: reduce) {
  .need, .rail a, .status-row > div, .btn, .switch { transition: none; }
  .btn:active, .rail a:active, .tabs a:active, .seg button:active, .switch:active, .type:active, .help-link a:active, summary:active { transform: none; }
}

/* The skip link sits above the page until focused, instead of 9999px off to the side (no hidden overflow on phones) */
.skip { left: 12px; top: 12px; transform: translateY(-200%); }
.skip:focus { transform: none; }
/* Narrow phones (≤400px): the task number sits above the task, so its button keeps one line */
.need .actions .btn { white-space: nowrap; }
@media (max-width: 400px) { .need { grid-template-columns: 1fr; gap: 8px; } .needs > .need:first-child { padding: 16px; } }
/* Fields inside the portal stand at the app's 44px, not the landing's taller form fields */
.pane .field input:not([type="checkbox"]):not([type="radio"]) { min-height: 44px; padding: 8px 12px; }
.gbody b a { display: inline-flex; align-items: center; min-height: 44px; }
/* Course cards: no empty cover wash; the kind is a quiet first line; equal rows */
.gcard { align-content: start; }
.gkind { font-size: 15px; color: var(--ink-2); }
.gbody { padding: 16px; gap: 8px; }
/* Phone header: one row; the band's money and website stack, so nothing breaks mid-word */
@media (max-width: 860px) {
  .portal-bar { flex-wrap: nowrap; gap: 12px; }
  .top-right { gap: 8px; }
  .help-link a { min-height: 44px; padding: 0 12px; }
}
@media (max-width: 480px) {
  .today dl { grid-template-columns: 1fr; gap: 16px; }
  .today dl > div, .today dl > div:nth-child(2) { border-left: 0; padding-left: 0; }
  .today dl > div + div { border-top: 1px solid var(--band-rule); padding-top: 12px; }
  .today p { overflow-wrap: break-word; }
}
