/* The working side (coaching and results): a light instrument. Gridded ground, crisp panels, monospace labels and readouts. Always light. See DESIGN.md. */

/* Zone tokens. Every coaching page is light, whatever the theme: the light values are set again here,
   so the dark theme on <html> doesn't reach them. The shared names (--ground, --surface, --ink …) are
   remapped so the components in site.css follow. */
body.zone-workbench, body.zone-readout {
  --bench: #EDF0F4;
  --grid: rgb(40 52 72 / .055);
  --tile: #FFFFFF;
  --seam: #C9CED4;
  --bench-ink: #1A1B1C;
  --bench-muted: #5C6168;
  --ground: var(--bench);
  --surface: var(--tile);
  --surface-sunk: #F3F5F8;
  --ink: var(--bench-ink);
  --muted: var(--bench-muted);
  --line: var(--seam);
  --line-strong: #9EA5AD;
  --link: #C0115F;
  --pink-10: #FFEAF2; --pink-20: #FED5E5; --pink-30: #FEC0D8; --pink-40: #FDABCB; --pink-50: #FD96BE;
  --violet-10: #F2E9FF; --violet-20: #E4D4FE; --violet-30: #D7BEFE; --violet-40: #C9A9FD; --violet-50: #BC93FD;
  --good-tint: var(--violet-10);
  --good-ink: #7927FB;
  --weak-tint: var(--pink-10);
  --weak-ink: #A0104C;
  --bubble: var(--violet-10);
  color-scheme: light;
}

body.zone-workbench, body.zone-readout {
  color: var(--ink); background-color: var(--bench);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px; background-attachment: fixed;
}
.zone-workbench code, .zone-readout code { font-family: var(--font-mono); }

/* The shell: sidebar and work area joined by one seam. */
.app { display: grid; grid-template-columns: 272px minmax(0, 1fr); min-height: 100vh; }
.rail { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--tile); border-right: 1px solid var(--seam); display: flex; flex-direction: column; }
.rail-head { padding: 0 var(--space-5); height: 48px; display: flex; align-items: center; border-bottom: 1px solid var(--seam); }
.rail-head .brand { color: var(--ink); text-decoration: none; font-weight: 800; font-size: 15px; letter-spacing: .04em; text-transform: uppercase; }
.rail-toggle { display: none; }
.rail-body { display: flex; flex-direction: column; flex: 1; }
.rail-status { padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--seam); }
.rail-confidence { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 8px var(--space-2); font-family: var(--font-mono); font-size: 11px; line-height: 16px; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.rail-confidence-value { font-size: 22px; line-height: 24px; font-weight: 600; letter-spacing: -.02em; color: var(--ink); }
.rail-scale { grid-column: 1 / -1; position: relative; display: flex; justify-content: space-between; margin: 0; font-size: 10px; line-height: 12px; letter-spacing: .04em; }
.rail-scale-ready { position: absolute; top: 0; transform: translateX(-50%); color: var(--ink); white-space: nowrap; }
.rail-scale-ready::before { content: ""; position: absolute; left: 50%; top: -20px; width: 1px; height: 18px; background: var(--ink); }
.rail-confidence .rail-bar { grid-column: 1 / -1; }
.rail-next { margin: var(--space-4) 0 0; font-size: 13px; line-height: 18px; font-weight: 600; color: var(--ink); }
.rail-next-label { color: var(--muted); }
.rail-next.is-ready { color: var(--good-ink); }
.rail-cell { padding: var(--space-5); border-bottom: 1px solid var(--seam); }
.nameplate { font-family: var(--font-mono); font-size: 11px; line-height: 16px; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 var(--space-3); font-variant-numeric: lining-nums tabular-nums; }

.rail-steps { list-style: none; margin: 0; padding: 0; border: 1px solid var(--seam); border-radius: var(--radius-md); overflow: hidden; }
.rail-step + .rail-step { border-top: 1px solid var(--seam); }
.rail-step > a, .rail-step > span { position: relative; display: flex; align-items: center; gap: var(--space-2); padding: 10px var(--space-2) 10px var(--space-3); font-size: 14px; line-height: 20px; font-weight: 600; color: var(--muted); text-decoration: none; }
.rail-step > a:hover { background: var(--surface-sunk); color: var(--ink); }
.rail-num { width: 28px; height: 24px; flex-shrink: 0; display: grid; place-items: center; border: 1px solid var(--seam); border-radius: var(--radius-sm); font-family: var(--font-mono); font-size: 11px; font-weight: 500; }
.rail-name { flex: 1; }
.rail-tick { color: var(--good-ink); font-weight: 800; }
.rail-step.is-done .rail-num { border-color: transparent; background: var(--good-tint); color: var(--good-ink); }
.rail-step.is-current > a { color: var(--ink); background: var(--surface-sunk); }
.rail-step.is-current > a::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--pink); }
.rail-step.is-current .rail-num { background: var(--ink); border-color: var(--ink); color: var(--tile); }
.rail-step.is-locked > span { opacity: .55; cursor: not-allowed; }
/* Reality checks: an unnumbered item under Coaching, indented to line up with the step names. */
.rail-sub > a, .rail-sub > span { padding-left: calc(var(--space-3) + 24px + var(--space-3)); font-size: 14px; font-weight: 600; }
.rail-sub-count { font-size: 12px; font-weight: 700; color: var(--weak-ink); background: var(--weak-tint); border-radius: var(--radius-sm); padding: 0 6px; font-variant-numeric: lining-nums; white-space: nowrap; }
.rail-pack { position: relative; display: flex; align-items: center; gap: var(--space-3); margin-top: var(--space-3); padding: 10px var(--space-3); border: 1px dashed var(--line-strong); border-radius: var(--radius-md); font-size: 14px; line-height: 20px; font-weight: 600; color: var(--ink); text-decoration: none; }
a.rail-pack:hover { border-style: solid; background: var(--surface-sunk); }
.rail-pack.is-ready { border-style: solid; border-color: var(--ink); }
.rail-pack.is-current { border-style: solid; border-color: var(--ink); background: var(--surface-sunk); }
.rail-pack.is-locked { opacity: .55; cursor: not-allowed; color: var(--muted); }
.rail-pack-icon { width: 28px; height: 28px; flex-shrink: 0; display: grid; place-items: center; border-radius: var(--radius-sm); background: var(--surface-sunk); color: var(--muted); transition: background .2s ease, color .2s ease; }
.rail-pack.is-ready .rail-pack-icon { background: var(--yellow); color: var(--on-yellow); }
.rail-pack.is-locked .rail-pack-icon { background: var(--surface-sunk); color: var(--muted); }

/* The gauge: twenty segments, filled in violet up to the plan's confidence. */
.rail-bar { height: 12px; background: #DDE1E7; overflow: hidden; -webkit-mask: repeating-linear-gradient(90deg, #000 0 calc(5% - 2px), transparent calc(5% - 2px) 5%); mask: repeating-linear-gradient(90deg, #000 0 calc(5% - 2px), transparent calc(5% - 2px) 5%); }
.rail-bar span { display: block; height: 100%; background: var(--violet); transition: width .6s ease; }
@media (prefers-reduced-motion: reduce) { .rail-bar span { transition: none; } }

.rail-count { font-size: 12px; font-weight: 700; color: var(--muted); border: 1px solid var(--seam); border-radius: var(--radius-sm); padding: 0 6px; font-variant-numeric: lining-nums; }
.rail-foot { margin-top: auto; padding: var(--space-4) var(--space-5); display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); font-size: 14px; }
.rail-foot a { color: var(--ink); font-weight: 600; }

/* The work area. */
/* The work area sits under a status bar that says where you are and where the work is kept. */
.work { padding: 0 clamp(16px, 3.5vw, 48px) 96px; max-width: 944px; width: 100%; margin: 0 auto; }
.work-wide { max-width: 1320px; }
.statusbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); height: 48px; margin: 0 calc(-1 * clamp(16px, 3.5vw, 48px)) var(--space-7); padding: 0 clamp(16px, 3.5vw, 48px); background: var(--bench); border-bottom: 1px solid var(--seam); font-family: var(--font-mono); font-size: 12px; line-height: 16px; color: var(--muted); }
.statusbar p { margin: 0; min-width: 0; }
.crumbs { display: flex; align-items: center; gap: var(--space-2); white-space: nowrap; overflow: hidden; }
.crumbs span { overflow: hidden; text-overflow: ellipsis; }
.crumbs i { font-style: normal; color: var(--line-strong); }
.crumbs [aria-current] { color: var(--ink); font-weight: 600; }
.work .saved a { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--muted); text-decoration: none; white-space: nowrap; }
.work .saved a:hover { color: var(--ink); text-decoration: underline; }
.saved-dot { width: 8px; height: 8px; border-radius: 50%; background: #1FA971; box-shadow: 0 0 0 3px rgb(31 169 113 / .18); }
.work h1 { font-size: 32px; line-height: 40px; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 var(--space-3); }
.work .kicker, .work .nameplate { color: var(--muted); }
.work .lead { font-size: 18px; line-height: 28px; color: var(--muted); max-width: 62ch; margin: 0 0 var(--space-6); }
.work-head { margin-bottom: var(--space-6); }
.work a:not([class]) { color: var(--link); }
.work :focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }

/* Tiles: white panels that share one seam, no gaps, no shadows. */
.tiles { margin: 0 0 var(--space-6); }
.tile { background: var(--tile); border: 1px solid var(--seam); padding: var(--space-5) var(--space-6); margin: 0; }
.tile.tile-head { background: var(--surface-sunk); }
.tiles > .tile + .tile { border-top: none; }
.tiles > .tile:first-child { border-radius: var(--radius-md) var(--radius-md) 0 0; }
.tiles > .tile:last-child { border-radius: 0 0 var(--radius-md) var(--radius-md); }
.tiles > .tile:only-child { border-radius: var(--radius-md); }
.tile > :last-child { margin-bottom: 0; }
.tile h2 { font-size: 20px; line-height: 28px; font-weight: 700; margin: 0 0 var(--space-3); border: none; padding: 0; }
.tile h2.nameplate { font-size: 11px; line-height: 16px; font-weight: 500; }
.tile h3 { font-size: 15px; line-height: 22px; font-weight: 700; margin: var(--space-5) 0 var(--space-2); }
.tile-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); }
.tile-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; background: var(--surface-sunk); }
.tile-foot .actions { margin: 0; }
.tile-foot-end { justify-content: flex-end; }
.check-steps { margin: 0; padding-left: 1.4em; font-size: 17px; line-height: 28px; }
.check-steps li + li { margin-top: var(--space-3); }
.tile .field .small { margin: 0 0 var(--space-3); }
.tile .card { background: var(--surface-sunk); border: none; }

/* Forms inside tiles. */
.tile .field { margin: 0 0 var(--space-5); }
.tile .field:last-child { margin-bottom: 0; }
.tile .field label, .tile legend { font-size: 17px; font-weight: 600; }
.zone-workbench input[type="text"], .zone-workbench textarea { background: var(--tile); color: var(--ink); border-color: var(--line-strong); }
.tile .claim, .tile .mix { margin: 0; border: none; padding: 0; }
.restart { display: flex; gap: var(--space-3); align-items: flex-start; font-size: 15px; line-height: 22px; font-weight: 500; color: var(--weak-ink); }
.restart input { margin-top: 4px; }
.claim-locked .claim-text { color: var(--muted); }
.locked-answer { display: flex; align-items: baseline; gap: var(--space-3); margin: var(--space-2) 0 0 calc(24px + var(--space-3)); font-size: 17px; font-weight: 600; }
.locked-answer .nameplate { margin: 0; }
.tile .claim-text { font-size: 20px; line-height: 28px; font-weight: 600; }

/* Numbers first: stat tiles in a row. */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); border: 1px solid var(--seam); border-radius: var(--radius-md); background: var(--tile); margin: 0 0 var(--space-6); overflow: hidden; }
/* Four stats sit as one row of four, or two by two when the column is narrower; never three and one. */
.work { container: work / inline-size; }
.stats:has(> .stat:nth-child(4):last-child) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@container work (max-width: 760px) { .stats:has(> .stat:nth-child(4):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container work (max-width: 420px) { .stats:has(> .stat:nth-child(4):last-child) { grid-template-columns: minmax(0, 1fr); } }
.stat { padding: var(--space-5); border-left: 1px solid var(--seam); border-top: 1px solid var(--seam); margin: -1px 0 0 -1px; }
.stat-figure { font-family: var(--font-mono); font-size: 40px; line-height: 48px; font-weight: 500; letter-spacing: -0.04em; margin: 0 0 var(--space-2); font-variant-numeric: lining-nums tabular-nums; }
.stat-figure.is-word { font-size: 32px; }
.stat .nameplate { margin: 0; }
.stat-weak .stat-figure { color: var(--weak-ink); }
.stat-good .stat-figure { color: var(--good-ink); }

/* The readout board: pyramid beside its detail. */
.board { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); border: 1px solid var(--seam); border-radius: var(--radius-md); background: var(--tile); margin: 0 0 var(--space-6); }
.board > * { padding: var(--space-6); min-width: 0; }
.board > * + * { border-left: 1px solid var(--seam); }
.board .pyramid { margin: 0 auto; width: 100%; max-width: 400px; }
/* The pyramid is drawn on drawing paper: a finer grid than the ground. */
.board > :first-child, .readout-figure { background-color: #FAFBFC; background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 12px 12px; }
.board > :first-child { border-radius: var(--radius-md) 0 0 var(--radius-md); }
.board .pyramid-detail h2 { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; font-size: 24px; line-height: 32px; border: none; padding: 0; }
.legend { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: var(--space-4) 0 0; justify-content: center; }
/* The pyramid's colour scale: weak is the lightest pink, strong is full pink; not known is white. */
.legend-scale { align-items: center; font-size: 13px; font-weight: 700; }
.scale-bar { width: 120px; height: 12px; border-radius: var(--radius-sm); background: linear-gradient(to right, var(--pink-10), var(--pink)); box-shadow: inset 0 0 0 1px var(--line); }
.legend-scale .chip-none { margin-left: var(--space-3); }

.ready-missing { margin: calc(-1 * var(--space-3)) 0 var(--space-6); font-size: 17px; line-height: 28px; }
.danger { margin-top: var(--space-8); }
.danger .tile { border-color: var(--pink-30); }

/* The chat: a familiar AI chat, coach and user at the same size. */
.chat { display: flex; flex-direction: column; min-height: calc(100vh - 48px - var(--space-7)); }
.chat-log { flex: 1; display: flex; flex-direction: column; gap: var(--space-6); padding-bottom: var(--space-6); }
.msg { font-size: 17px; line-height: 28px; font-weight: 500; color: var(--ink); }
.msg p, .msg ul, .msg ol { margin: 0 0 var(--space-3); }
.msg > :last-child, .msg-text > :last-child { margin-bottom: 0; }
.msg h3 { font-size: 17px; line-height: 28px; margin: var(--space-3) 0 var(--space-2); }
.msg strong { font-weight: 700; }
.msg-me { align-self: flex-end; max-width: 80%; background: var(--tile); border: 1px solid var(--line-strong); padding: var(--space-3) var(--space-4); border-radius: var(--radius-xl) var(--radius-xl) var(--radius-sm) var(--radius-xl); white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-coach { align-self: stretch; }
.msg-who { display: flex; align-items: center; gap: var(--space-2); margin: 0 0 var(--space-2); font-family: var(--font-mono); font-size: 11px; line-height: 16px; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.avatar { width: 24px; height: 24px; border-radius: var(--radius-sm); background: var(--pink); display: grid; place-items: center; flex-shrink: 0; }
.avatar svg { display: block; }
.msg-thinking .msg-text { color: var(--muted); display: flex; align-items: center; gap: var(--space-2); }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 6px; height: 6px; border-radius: 1px; background: var(--muted); animation: dot 1.2s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .dots { display: none; } }

.suggest { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0 0 var(--space-3); }
.suggest button { font: inherit; font-size: 14px; font-weight: 600; color: var(--ink); background: var(--tile); border: 1px solid var(--seam); border-radius: var(--radius-md); padding: 8px 12px; cursor: pointer; text-align: left; }
.suggest button:hover { border-color: var(--line-strong); }

.chat-composer { position: sticky; bottom: 0; padding: var(--space-3) 0 var(--space-4); background: linear-gradient(to bottom, transparent, var(--bench) 24px); }
.composer-box { background: var(--tile); border: 1px solid var(--line-strong); border-radius: var(--radius-md); box-shadow: 0 6px 20px rgb(40 52 72 / .08); }
.composer-box:focus-within { border-color: var(--violet); box-shadow: 0 0 0 1px var(--violet); }
.composer-box textarea { display: block; width: 100%; min-height: 56px; max-height: 196px; resize: none; border: none; background: transparent; padding: var(--space-4); font: inherit; font-size: 17px; line-height: 28px; color: var(--ink); box-shadow: none; outline: none; }
.composer-bar { display: flex; align-items: center; justify-content: flex-end; gap: var(--space-3); padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4); border-top: 1px solid var(--seam); }
.composer-bar .btn-primary { min-height: 40px; padding: 0 var(--space-5); font-size: 16px; margin-left: auto; }
.mic { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 40px; padding: 0 var(--space-3); font: inherit; font-size: 14px; font-weight: 600; color: var(--muted); background: none; border: 1px solid transparent; border-radius: var(--radius-md); cursor: pointer; }
.mic[hidden] { display: none; }
.mic:hover { color: var(--ink); border-color: var(--seam); }
.mic[aria-pressed="true"] { color: var(--weak-ink); background: var(--weak-tint); border-color: var(--pink-30); }
.mic[aria-pressed="true"] svg { animation: listening 1.2s infinite ease-in-out; }
@keyframes listening { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .mic[aria-pressed="true"] svg { animation: none; } }
.composer-hint { font-family: var(--font-mono); font-size: 11px; line-height: 18px; color: var(--muted); margin: var(--space-2) 0 0; }
/* When a message doesn't get through: what happened, and a way to send it again. */
.chat-error { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); margin: 0 0 var(--space-3); padding: var(--space-3) var(--space-4); font-size: 15px; line-height: 22px; }
.chat-error[hidden] { display: none; }
.chat-error p { margin: 0; }
.chat-error .btn-secondary { flex: none; min-height: 36px; white-space: nowrap; }
.chat-error .btn-secondary[hidden], .chat-error .btn-link[hidden] { display: none; }
.chat-error-actions { display: flex; flex: none; align-items: center; gap: var(--space-3); }
/* The conversation has closed (a limit of the session), and the count of messages left. */
.chat-closed { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); margin: 0; padding: var(--space-3) var(--space-4); font-size: 15px; line-height: 22px; }
.chat-closed[hidden] { display: none; }
.chat-closed p { margin: 0; }
.chat-closed .btn-secondary { flex: none; min-height: 36px; white-space: nowrap; }
.composer-left { font-size: 14px; line-height: 20px; color: var(--ink); margin: var(--space-2) 0 0; }
.composer-left[hidden] { display: none; }
/* The visitor's own link back to the session, beside the conversation. */
.msg-thinking.is-slow .msg-text { color: var(--ink); }
.composer-bar .btn-primary[disabled] { opacity: 1; background: var(--surface-sunk); color: var(--muted); border-color: var(--seam); }

/* A reality check the coach suggested, under its reply. */
.check-card { margin-top: var(--space-4); background: var(--tile); border: 1px solid var(--seam); border-left: 4px solid var(--pink); border-radius: var(--radius-md); padding: var(--space-4) var(--space-5); }
.check-card .nameplate { margin: 0 0 var(--space-1); }
.practice-card { border-left-color: var(--violet); }
.check-title { font-size: 18px; line-height: 26px; font-weight: 700; margin: 0 0 var(--space-1); }
.check-card .check-line { font-size: 15px; line-height: 24px; color: var(--muted); margin: 0 0 var(--space-3); }
.check-actions { display: flex; align-items: center; gap: var(--space-4); flex-wrap: wrap; margin: 0; }
.check-actions a:not(.btn-secondary) { font-size: 14px; font-weight: 600; color: var(--muted); }
.check-actions .btn-secondary { min-height: 36px; padding: 0 var(--space-4); font-size: 15px; }

/* The list of reality checks. */
.check-list { list-style: none; margin: 0; padding: 0; }
.check-list li { padding: var(--space-3) 0; border-top: 1px solid var(--seam); }
.check-list li:first-child { border-top: none; padding-top: 0; }
.work .check-list a { color: var(--ink); text-decoration: none; }
.check-list a:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.check-list .check-line { display: block; font-size: 15px; line-height: 24px; color: var(--muted); margin-top: 2px; }

/* Phones: the sidebar folds into a strip that opens as a sheet. */
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .rail { position: sticky; top: 0; z-index: 10; height: auto; max-height: 100vh; border-right: none; border-bottom: 1px solid var(--seam); }
  .rail-head { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-bottom: none; }
  .rail-js .rail-toggle { display: flex; align-items: center; gap: var(--space-2); font: inherit; font-size: 13px; font-weight: 700; color: var(--ink); background: var(--surface-sunk); border: 1px solid var(--seam); border-radius: var(--radius-md); padding: 6px 10px; cursor: pointer; text-align: left; }
  .rail-toggle-word { display: none; }
  .rail-head .brand { font-size: 15px; white-space: nowrap; flex: none; }
  .rail-js .rail-toggle { min-width: 0; }
  .rail-where { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .rail-js .rail-body { display: none; border-top: 1px solid var(--seam); }
  .rail-js.is-open .rail-body { display: flex; }
  .rail-js.is-open { overflow-y: auto; }
  .work { padding: 0 var(--space-4) 64px; }
  .statusbar { position: static; margin: 0 calc(-1 * var(--space-4)) var(--space-5); padding: 0 var(--space-4); }
  .saved { display: none; }
  .work h1 { font-size: 28px; line-height: 36px; }
  .board { grid-template-columns: minmax(0, 1fr); }
  .board > * + * { border-left: none; border-top: 1px solid var(--seam); }
  .board > * { padding: var(--space-5); }
  .tile { padding: var(--space-5) var(--space-4); }
  .stat { padding: var(--space-4); }
  .stat-figure { font-size: 34px; line-height: 40px; }
  .stat-figure.is-word { font-size: 26px; }
  .msg-me { max-width: 88%; }
  .chat { min-height: calc(100vh - 120px); }
}
/* On a phone the strip names the step and leaves out its number, so the name fits beside the wordmark. */
@media (max-width: 480px) {
  .rail-where-step { display: none; }
  .rail-head .brand { font-size: 13px; }
}

/* Diagnostic claims are numbered 1 to 12, so a block's pair sits six apart. */
.claim-num { flex: 0 0 auto; width: 28px; height: 24px; margin-top: 2px; display: grid; place-items: center; border: 1px solid var(--seam); border-radius: var(--radius-sm); font-family: var(--font-mono); font-size: 11px; font-weight: 500; color: var(--muted); }
.tile-head .nameplate { white-space: nowrap; }

/* Diagnostic results: each block, what the user said and its state. */
.block-read { list-style: none; margin: var(--space-4) 0 0; padding: 0; border-top: 1px solid var(--seam); }
.block-read li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--space-3); padding: var(--space-2) 0; border-bottom: 1px solid var(--seam); margin: 0; }
.block-read .small { margin: 0; }

/* Take-aways: practice cards the coach recommended, as a row of cards with empty slots. */
.shelf { margin-top: var(--space-6); container: shelf / inline-size; }
.tile .shelf { margin-top: 0; }
.shelf h2.nameplate { display: flex; align-items: center; gap: var(--space-2); font-size: 11px; line-height: 16px; font-weight: 500; letter-spacing: .08em; margin: 0 0 var(--space-2); }
.shelf-count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: var(--radius-md); background: var(--ink); color: var(--tile); letter-spacing: 0; }
.shelf-note { font-size: 15px; line-height: 24px; color: var(--muted); margin: 0 0 var(--space-4); max-width: 62ch; }
.takeaway-row { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--space-4); }
/* Narrower shelves: three cards a row, then two; empty slots only fill out the first row. */
@container shelf (max-width: 720px) { .takeaway-row { grid-template-columns: repeat(3, minmax(0, 1fr)); } .takeaway-slot:nth-child(n+4) { display: none; } }
@container shelf (max-width: 440px) { .takeaway-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } .takeaway-slot:nth-child(n+3) { display: none; } }
.takeaway-row > li { aspect-ratio: 5 / 6; margin: 0; min-width: 0; }
.takeaway-slot { border: 2px dashed var(--line); border-radius: 8px; }
.takeaway { appearance: none; margin: 0; font: inherit; color: inherit; text-align: inherit; display: block; width: 100%; height: 100%; padding: 8px; background: var(--tile); border: 3px solid var(--ink); border-radius: 8px; cursor: pointer; transition: transform .15s ease; }
.takeaway-face { display: flex; flex-direction: column; justify-content: space-between; height: 100%; padding: var(--space-3) var(--space-2); background: var(--pink-30); border-radius: var(--radius-md); text-align: center; }
.takeaway-title { font-size: 16px; line-height: 21px; font-weight: 800; color: var(--ink); }
.takeaway-block { font-family: var(--font-mono); font-size: 11px; line-height: 16px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--ink); }
.takeaway:hover { transform: translateY(-3px); }
.takeaway:focus-visible { outline: 3px solid var(--violet); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .takeaway { transition: none; } .takeaway:hover { transform: none; } }
.takeaway-sheet { width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 64px); overflow-y: auto; margin: auto; padding: var(--space-6); background: var(--tile); color: var(--ink); border: 3px solid var(--ink); border-radius: 8px; }
.takeaway-sheet::backdrop { background: rgba(26, 27, 28, .45); }
.takeaway-sheet h2 { margin: 0 0 var(--space-4); }
.takeaway-sheet ul { list-style: disc; }
.takeaway-sheet-foot { margin: var(--space-5) 0 0; }
.practice-card .check-actions button.btn-secondary { cursor: pointer; }

/* The chat page on a laptop: the conversation, with the reality checks beside it. The pyramid of topics and the pack build-up are in the sidebar. */
.chat-layout { display: grid; grid-template-columns: minmax(0, 1fr) 328px; gap: var(--space-7); align-items: start; }
.chat-main { min-width: 0; max-width: 800px; width: 100%; margin: 0 auto; }
/* Until the coach has raised a reality check, the column beside the chat is empty, so the chat takes the width. */
.chat-layout:has(.checks-shelf[hidden]) { grid-template-columns: minmax(0, 1fr); }
.chat-instruments { position: sticky; top: calc(48px + var(--space-5)); max-height: calc(100vh - 48px - 2 * var(--space-5)); overflow-y: auto; display: grid; gap: var(--space-4); }
/* The three state counts sit side by side: the figure, then its key and name. */
.key { width: 12px; height: 12px; border: 1px solid var(--ink); border-radius: 1px; }
.key-good { background: var(--pink); } .key-weak { background: var(--pink-20); } .key-none { background: var(--tile); }
.chat-side .checks-shelf { margin-top: 0; }
.chat-side .checks-head { gap: var(--space-3); align-items: center; }
.chat-side .checks-head p { display: none; }
.chat-side .checks-head h2 { font-size: 16px; line-height: 24px; margin: 0; }
.chat-side .checks-sign { width: 28px; height: auto; margin: 0; }
.chat-side .check-row { grid-template-columns: minmax(0, 1fr); }
@container work (max-width: 900px) {
  .chat-layout { grid-template-columns: minmax(0, 1fr); }
  .chat-instruments { position: static; max-height: none; }
}

/* Reality checks the coach raised, marked with a warning sign. */
.checks-shelf { margin-top: var(--space-6); padding: var(--space-4); background: var(--tile); border: 1px solid var(--seam); border-top: 3px solid var(--ink); border-radius: var(--radius-md); }
.checks-head { display: flex; gap: var(--space-4); align-items: flex-start; margin-bottom: var(--space-4); }
.checks-sign { flex: none; margin-top: 2px; }
.checks-head h2 { font-size: 20px; line-height: 28px; font-weight: 800; margin: 0 0 var(--space-1); }
.checks-head p { font-size: 15px; line-height: 24px; color: var(--muted); margin: 0; max-width: 62ch; }
.check-row { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--space-3); }
.check-row .check-card { margin: 0; display: flex; flex-direction: column; }
.check-row .check-card .check-actions { margin-top: auto; }
.check-row .check-card.is-done { border-left-color: var(--line-strong); }
.check-row .nameplate .chip { margin-left: var(--space-1); letter-spacing: 0; text-transform: none; }

/* Your plan: the status line, the two call-outs, and each block's then, now and so. */
.plan-status { margin: 0; font-size: 15px; font-weight: 600; }
.plan-status .small { color: var(--muted); }
.plan-status.is-ready { color: var(--good-ink); }
.plan-board { align-items: center; }
.callouts { display: grid; gap: var(--space-4); }
.callout { border-left: 4px solid var(--seam); padding: var(--space-1) 0 var(--space-1) var(--space-4); }
.callout-good { border-left-color: var(--pink); }
.callout-weak { border-left-color: var(--pink-30); }
.callout .nameplate { margin: 0 0 var(--space-1); }
.callout h2 { font-size: 24px; line-height: 32px; margin: 0 0 var(--space-2); border: none; padding: 0; }
.work .callout h2 a { color: var(--ink); text-decoration: none; }
.callout p:last-child { margin: 0; }
.block-story h3 { font-size: 20px; line-height: 28px; margin: 0 0 var(--space-3); }
.block-story dl { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: var(--space-3) var(--space-4); margin: 0; }
.block-story dt { font-family: var(--font-mono); font-size: 11px; line-height: 28px; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.block-story dd { margin: 0; }
.block-story dd p, .block-story dd ul { margin: 0 0 var(--space-2); }
.block-story dd > :last-child { margin-bottom: 0; }
.heard { padding-left: 1.2em; }
.heard .small { margin-left: var(--space-1); }
.so-links { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); font-size: 15px; font-weight: 600; }
.not-explored summary { cursor: pointer; font-weight: 600; }
.not-explored[open] summary { margin-bottom: var(--space-4); }
.not-explored .block-story + .block-story { margin-top: var(--space-5); padding-top: var(--space-5); border-top: 1px solid var(--seam); }
@media (max-width: 600px) { .block-story dl { grid-template-columns: minmax(0, 1fr); gap: var(--space-1); } .block-story dd { margin-bottom: var(--space-3); } }

/* The pack page: what would make it stronger, the files, how to use them. */
.boost .tile:first-child { border-left: 4px solid var(--pink); }
.boost-list { margin: 0 0 var(--space-3); padding-left: 1.4em; }
.boost-list li { margin: 0 0 var(--space-1); font-weight: 600; }
.boost-checks { margin: 0 0 var(--space-3); padding-left: 1.2em; }
.file-rows { border-top: 1px solid var(--seam); margin-top: var(--space-4); }
.file-row { border-bottom: 1px solid var(--seam); }
.file-row summary { display: flex; align-items: baseline; gap: var(--space-3); flex-wrap: wrap; padding: var(--space-3) 0; cursor: pointer; list-style: none; }
.file-row summary::-webkit-details-marker { display: none; }
.file-row summary::before { content: '+'; width: 16px; flex: none; font-weight: 700; color: var(--muted); }
.file-row[open] summary::before { content: '–'; }
.file-name { font-weight: 700; }
.file-path { font-family: var(--font-mono); font-size: 12px; color: var(--muted); background: none; padding: 0; }
.file-body { padding: 0 0 var(--space-4) calc(16px + var(--space-3)); }
.file-body p { margin: 0 0 var(--space-2); max-width: 62ch; }
.file-get, .file-list a { display: inline-flex; align-items: center; gap: var(--space-2); font-weight: 600; }
.file-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-1); }
.tab-list { display: flex; flex-wrap: wrap; gap: var(--space-1); margin: var(--space-4) 0 0; border-bottom: 1px solid var(--seam); }
.tab-list [role="tab"] { appearance: none; font: inherit; font-size: 15px; font-weight: 600; color: var(--muted); background: none; border: none; border-bottom: 3px solid transparent; padding: var(--space-2) var(--space-3); margin-bottom: -1px; cursor: pointer; }
.tab-list [role="tab"][aria-selected="true"] { color: var(--ink); border-bottom-color: var(--pink); }
.tab-panel { padding: var(--space-4) 0 0; }
.tab-panel ol { margin: 0 0 var(--space-3); padding-left: 1.4em; }
.tab-panel li { margin: 0 0 var(--space-2); max-width: 62ch; }
.tab-panel-title { font-size: 17px; margin: var(--space-3) 0 var(--space-2); }
.tabs-js .tab-panel-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Chips on the working side read as labels on an instrument. */
.zone-workbench .chip, .zone-readout .chip { font-family: var(--font-mono); font-size: 11px; line-height: 16px; font-weight: 500; text-transform: uppercase; letter-spacing: .04em; padding: 3px 8px; border-radius: var(--radius-sm); white-space: nowrap; }
.zone-workbench .legend, .zone-readout .legend { margin-top: var(--space-5); }
.zone-workbench .notice, .zone-readout .notice { background: var(--tile); border: 1px solid var(--seam); border-left: 3px solid var(--violet); border-radius: var(--radius-md); }
.zone-workbench .notice-warn, .zone-readout .notice-warn { border-left-color: var(--pink); background: var(--weak-tint); }
.zone-workbench .slider-value, .zone-workbench .mix-input output, .zone-workbench .mix-total { font-family: var(--font-mono); }
.zone-workbench .btn-primary, .zone-readout .btn-primary { min-height: 44px; font-size: 16px; }
.rail .brand { display: inline-flex; align-items: center; gap: var(--space-2); }

/* The starting point's fuller reading under the pyramid. */
.reading-grid { columns: 2; column-gap: var(--space-7); margin-top: var(--space-2); }
.reading-part { break-inside: avoid; margin: 0 0 var(--space-5); }
.reading-part:last-child { margin-bottom: 0; }
.reading-part h3 { font-size: 18px; line-height: 26px; margin: 0 0 var(--space-2); }
.reading-part p, .reading-part ul { margin: 0 0 var(--space-3); }
.reading-part > :last-child { margin-bottom: 0; }
@container work (max-width: 760px) { .reading-grid { columns: 1; } }
.pyramid-intro { font-size: 18px; line-height: 28px; color: var(--ink); margin: 0 0 var(--space-3); }
.next-step h2 { margin-bottom: var(--space-2); }
.next-step p { max-width: 68ch; }

/* The payment page: two prices side by side. */
.pay-tiers { list-style: none; padding: 0; margin: 0 0 var(--space-6); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-5); }
.pay-tier { margin: 0; padding: var(--space-6); background: var(--tile); border: 1px solid var(--seam); border-radius: var(--radius-md); display: flex; flex-direction: column; }
.pay-tier-main { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.pay-tier h2 { font-size: 20px; line-height: 28px; font-weight: 700; margin: 0; border: none; padding: 0; }
.pay-price { font-size: 48px; line-height: 56px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: lining-nums; margin: var(--space-2) 0 var(--space-4); }
.pay-tier ul { list-style: disc; padding-left: var(--space-5); margin: 0 0 var(--space-5); flex: 1; }
.pay-tier li { margin-bottom: var(--space-2); }
@media (max-width: 720px) { .pay-tiers { grid-template-columns: 1fr; } }

/* An empty take-aways shelf: one dashed slot that says what will come. */
.takeaway-none { margin: 0; padding: var(--space-5); border: 2px dashed var(--line); border-radius: 8px; font-size: 15px; line-height: 24px; color: var(--muted); max-width: 62ch; }

/* The seller's details under the work on every coaching page. */
.work-foot { margin-top: var(--space-8); padding-top: var(--space-4); border-top: 1px solid var(--seam); font-family: var(--font-mono); font-size: 11px; line-height: 18px; color: var(--muted); font-variant-numeric: lining-nums; }
.work-foot p { margin: 0; }
.work .work-foot a { color: var(--muted); }
.work .work-foot a:hover { color: var(--ink); }

/* The call that comes with the call tier, in the sidebar. */
.rail-call .rail-call-text { font-size: 14px; line-height: 20px; margin: 0 0 var(--space-3); }
.rail-call .btn-secondary { width: 100%; }

/* The snapshot form: the claims still to answer, and the note on privacy above the button. */
.tile-note > .notice { margin-bottom: var(--space-3); }
.tile-note > .notice[hidden] { display: none; }
.tile-note .privacy-short { margin: 0; max-width: 68ch; }
.claim.is-unanswered input[type="range"] { --thumb: var(--line-strong); }
.claim.is-unanswered .slider-value { color: var(--muted); }
.claim.is-missing .slider-value { color: var(--weak-ink); }
.tile:has(> .claim.is-missing) { box-shadow: inset 4px 0 0 var(--pink); }

/* Making the pack: the tick that confirms it, and the line that says to wait. */
.finish-confirm { margin: var(--space-4) 0 var(--space-3); color: var(--ink); font-weight: 600; }
#finish-wait.is-waiting { color: var(--ink); font-weight: 600; }

.tile-note .notice { font-variant-numeric: lining-nums; }

/* Pack build-up scale: only the two ends. */
.rail-scale-ready { position: static; transform: none; }
.rail-scale-ready::before { display: none; }

/* The pyramid of topics covered, in the sidebar. */
.rail-topics { padding: var(--space-5); border-bottom: 1px solid var(--seam); }
.topics-figure { background-color: #FAFBFC; background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 12px 12px; border: 1px solid var(--seam); border-radius: var(--radius-md); padding: var(--space-3); }
.topics-figure .pyramid { display: block; margin: 0 auto; max-width: 100%; height: auto; }
.topics-note { margin: var(--space-3) 0; font-size: 13px; line-height: 18px; color: var(--muted); }
.topics-checks { display: flex; justify-content: space-between; align-items: baseline; margin: 0; padding-top: var(--space-3); border-top: 1px solid var(--seam); font-size: 14px; font-weight: 600; }
.topics-checks strong { font-family: var(--font-mono); }

/* The link back: the quietest thing in the sidebar, at its foot. */
.rail-link { margin-top: auto; padding: var(--space-4) var(--space-5); font-size: 12px; line-height: 17px; color: var(--muted); }
.rail-link p { margin: 0 0 var(--space-2); }
.rail-link .rail-link-title { font-weight: 700; }
.rail-link-row { display: flex; gap: var(--space-2); }
.rail-link-row input { flex: 1; min-width: 0; font-family: var(--font-mono); font-size: 11px; padding: 4px 6px; border: 1px solid var(--seam); border-radius: var(--radius-sm); background: transparent; color: var(--muted); }
.rail-link-row button { flex: none; font: inherit; font-size: 12px; font-weight: 600; padding: 4px 8px; border: 1px solid var(--seam); border-radius: var(--radius-sm); background: transparent; color: var(--muted); cursor: pointer; }
.rail-link-row button:hover { color: var(--ink); border-color: var(--line-strong); }
.rail-link-done { margin: var(--space-2) 0 0; }
.rail-link-done[hidden] { display: none; }

/* A reality check that is done folds down to two rows. */
.check-card.is-compact { padding: var(--space-2) var(--space-3); border-left-width: 2px; background: var(--surface-sunk); }
.check-compact-title { display: flex; gap: var(--space-2); margin: 0; font-size: 14px; line-height: 20px; font-weight: 600; color: var(--muted); }
.check-tick { color: var(--good-ink); font-weight: 800; }
.check-compact-line { display: flex; justify-content: space-between; gap: var(--space-3); margin: 0; padding-left: 22px; font-size: 12px; line-height: 18px; color: var(--muted); }
.check-compact-line a { color: var(--muted); }

/* Beside the chat: what kind of work a reality check is, and the exercise cards added to the pack. */
.check-tags { display: flex; flex-wrap: wrap; gap: var(--space-1); margin: 0 0 var(--space-2); }
.zone-workbench .chip-kind { background: var(--ink); color: #FFFFFF; }
.checks-note { font-size: 13px; line-height: 20px; color: var(--muted); margin: 0 0 var(--space-3); }
.side-exercises h2 { font-size: 16px; line-height: 24px; font-weight: 800; margin: 0 0 var(--space-1); }
.side-exercises p { font-size: 13px; line-height: 20px; color: var(--muted); margin: 0 0 var(--space-2); }
.side-exercises ul { margin: 0; padding-left: 1.2em; font-size: 14px; line-height: 22px; font-weight: 600; }
.check-row + .side-exercises { margin-top: var(--space-5); padding-top: var(--space-4); border-top: 1px solid var(--seam); }

/* Under the conversation once the plan is ready: the way to the plan and the pack, without breaking into the chat. */
.chat-ready { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--space-3); margin: 0 0 var(--space-3); padding: var(--space-3) var(--space-4); background: var(--tile); border: 1px solid var(--seam); border-radius: var(--radius-md); font-size: 15px; line-height: 22px; }
.chat-ready[hidden] { display: none; }
.chat-ready p { margin: 0; font-weight: 600; }
.chat-ready div { display: flex; gap: var(--space-2); }
.chat-ready .btn-secondary { min-height: 36px; white-space: nowrap; }

/* A reality check's page: one box per person asked, and what was shared earlier. */
.voice { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: var(--space-4); padding: var(--space-4) 0; border-top: 1px solid var(--seam); }
.voice:first-child { border-top: none; padding-top: 0; }
.voice .field { margin: 0; }
.voice textarea, .voice input { width: 100%; }
@container work (max-width: 640px) { .voice { grid-template-columns: minmax(0, 1fr); } }
.shared-findings { padding: var(--space-3) 0; border-top: 1px solid var(--seam); }
.shared-findings h3 { font-size: 15px; line-height: 22px; margin: var(--space-3) 0 var(--space-1); }
.shared-findings p { margin: 0 0 var(--space-2); }

/* Your plan: each topic in two parts. */
.story-part + .story-part { margin-top: var(--space-4); }
.story-part h4 { font-family: var(--font-mono); font-size: 11px; line-height: 16px; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 var(--space-2); }
.story-part p, .story-part ul { margin: 0 0 var(--space-2); max-width: 70ch; }
.story-part > :last-child { margin-bottom: 0; }

/* The download page: how to use the pack is the part that matters most, so it looks unlike the tiles around it. */
.howto { margin: 0 0 var(--space-6); background: var(--ink); color: #FFFFFF; border-radius: var(--radius-md); }
.howto-inner { padding: var(--space-6); }
.howto .nameplate { color: var(--yellow); }
.howto h2 { font-size: 28px; line-height: 36px; font-weight: 800; margin: 0 0 var(--space-3); color: #FFFFFF; border: none; padding: 0; }
.howto p { color: #FFFFFF; max-width: 62ch; }
.howto .small { color: rgba(255, 255, 255, .72); }
.howto code { background: rgba(255, 255, 255, .14); color: #FFFFFF; }
.howto .tab-list { border-bottom-color: rgba(255, 255, 255, .28); }
.howto .tab-list [role="tab"] { color: rgba(255, 255, 255, .72); }
.howto .tab-list [role="tab"][aria-selected="true"] { color: #FFFFFF; border-bottom-color: var(--yellow); }
.howto .tab-panel li { font-size: 17px; line-height: 28px; }
.howto .tab-panel-title { color: #FFFFFF; }

/* The button that adds a file to the conversation sits with Speak, left of Send. */
.add-file:disabled { opacity: .5; cursor: default; }
