/* Samson's Blueprint client hub.
   Matches the logo: black field, faint blueprint grid, electric blue as the only color,
   brushed-silver headings, wide-tracked labels. One dark theme on purpose. */
:root {
  --paper: #04070d; --surface: #0a1120; --surface-2: #0f1a30; --ink: #e9eef6; --silver: #c9d1dc; --muted: #8798b3;
  --line: #1b2b4a; --grid: rgba(60,120,255,.07); --blue: #1f5bff; --blue-hi: #4d82ff; --blue-ink: #ffffff;
  --glow: 0 0 0 1px rgba(77,130,255,.55), 0 0 18px rgba(31,91,255,.35);
  --good: #3fc38a; --bad: #ff6b6b;
  --display: "Saira Condensed", "Arial Narrow", Impact, sans-serif;
  --wide: "Saira", Arial, sans-serif;
  --body: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box }
html { -webkit-text-size-adjust: 100% }
body {
  margin: 0; background: var(--paper); color: var(--ink); font-family: var(--body); font-size: 15px; line-height: 1.55;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 28px 28px; min-height: 100vh;
}
img { max-width: 100% }
a { color: var(--blue-hi) }
.gutter { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)) }
.wrap { max-width: 780px; margin: 0 auto }
h1, h2, h3 { font-family: var(--display); text-wrap: balance; margin: 0; line-height: 1; text-transform: uppercase; letter-spacing: .01em }
h2 { font-size: 30px; font-weight: 800 }
h3 { font-size: 21px; font-weight: 800 }
.chrome { background: linear-gradient(180deg, #fff 0%, #c9d1dc 45%, #8b97a8 55%, #e6ebf2 100%); -webkit-background-clip: text; background-clip: text; color: transparent }
.label { font-family: var(--wide); font-weight: 600; font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted) }
.label.blue { color: var(--blue-hi) }
button, input, textarea, select { font: inherit; color: inherit }
:focus-visible { outline: 2px solid var(--blue-hi); outline-offset: 2px }
p { margin: 0 }
.muted { color: var(--muted) }
.note { font-size: 13px; color: var(--muted) }
.stack { display: grid; gap: 10px }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center }
.between { justify-content: space-between }
.pre { white-space: pre-wrap }

/* Header */
.top { position: sticky; top: 0; z-index: 5; background: rgba(4,7,13,.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top, 0px) }
.brand { display: flex; align-items: center; gap: 10px; padding-block: 10px 4px; text-decoration: none; color: var(--ink) }
.brand img { width: 38px; height: 38px; border-radius: 50%; box-shadow: var(--glow) }
.brand .wm { display: grid; line-height: 1 }
.brand .wm b { font-family: var(--display); font-weight: 900; font-size: 20px; letter-spacing: .03em }
.brand .wm span { font-family: var(--wide); font-weight: 600; font-size: 10px; letter-spacing: .42em; color: var(--blue-hi) }
.brand-row { display: flex; align-items: center; gap: 10px }
.brand-row .who { margin-left: auto; display: flex; gap: 10px; align-items: center }
nav.tabs { display: grid; grid-template-columns: repeat(5, 1fr) }
nav.tabs a { display: block; text-align: center; padding: 10px 2px 11px; color: var(--muted); text-decoration: none; font-family: var(--wide); font-weight: 600;
  font-size: 12px; letter-spacing: .06em; text-transform: uppercase; border-bottom: 2px solid transparent; position: relative; white-space: nowrap }
nav.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--blue); text-shadow: 0 0 12px rgba(77,130,255,.6) }
nav.tabs a .dot { position: absolute; top: 7px; margin-left: 2px; width: 7px; height: 7px; border-radius: 50%; background: var(--blue-hi); box-shadow: 0 0 8px var(--blue) }

main { padding-block: 22px 64px }
.view { display: grid; gap: 16px }
.plate { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 18px; min-width: 0 }
.plate-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 12px }

/* Flash */
.flash { padding: 10px 14px; border-radius: 4px; border: 1px solid var(--line); background: var(--surface-2); font-weight: 600 }
.flash.notice { border-color: var(--blue) }
.flash.alert { border-color: var(--bad); color: #ffd6d6 }
.access-link { border: 1px solid var(--blue); box-shadow: var(--glow) }
.access-link input { font-family: var(--mono); font-size: 12px }

/* Hero */
.hero { display: grid; grid-template-columns: 132px 1fr; gap: 20px; align-items: center; padding: 22px; border: 1px solid var(--line); border-radius: 6px;
  background: radial-gradient(120% 140% at 0% 50%, rgba(31,91,255,.22), transparent 60%), var(--surface) }
.hero img { width: 132px; height: 132px; border-radius: 50%; box-shadow: var(--glow) }
.hero h1 { font-size: clamp(38px, 8vw, 56px); font-weight: 900 }
.hero .tag { display: flex; align-items: center; gap: 10px; margin-top: 8px }
.hero .tag::before, .hero .tag::after { content: ""; height: 2px; width: 22px; background: var(--blue) }
.hero p { margin-top: 10px; max-width: 52ch; color: var(--silver) }
@media (max-width: 560px) { .hero { grid-template-columns: 1fr; text-align: center; justify-items: center } .hero .tag { justify-content: center } }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 4px; padding: 10px 16px; font-family: var(--wide); font-weight: 600;
  font-size: 13px; letter-spacing: .1em; text-transform: uppercase; cursor: pointer; background: var(--blue); color: var(--blue-ink); text-decoration: none; box-shadow: 0 0 14px rgba(31,91,255,.35) }
.btn:hover { background: var(--blue-hi) }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); box-shadow: none }
.btn.ghost:hover { border-color: var(--blue-hi) }
.btn.small { padding: 6px 10px; font-size: 11px }
.btn.wide { width: 100% }
.btn:disabled { opacity: .45; cursor: not-allowed }
.link { background: none; border: 0; color: var(--muted); font-size: 12px; cursor: pointer; padding: 0; text-decoration: underline }
form.inline { display: inline }

.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px }
@media (max-width: 560px) { .quick { grid-template-columns: 1fr } }
.quick a { display: grid; gap: 4px; padding: 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); text-decoration: none; color: var(--ink) }
.quick a strong { font-family: var(--display); font-size: 24px; font-weight: 800; text-transform: uppercase }
.quick a:hover { box-shadow: var(--glow); border-color: transparent }

/* Fields */
.field { display: grid; gap: 4px; min-width: 0 }
.field label { font-weight: 600; font-size: 13px; color: var(--silver) }
input:not([type=radio]):not([type=checkbox]):not([type=submit]):not([type=button]):not([type=file]), textarea, select { width: 100%; min-width: 0; border: 1px solid var(--line); background: var(--paper); border-radius: 4px; padding: 10px 12px }
textarea { resize: vertical }
textarea.code { font-family: var(--mono); font-size: 13px }
.composer { display: flex; gap: 8px; align-items: flex-end; margin-top: 12px }
.composer textarea { flex: 1 1 auto; width: auto; min-width: 0; min-height: 46px; max-height: 160px }
.composer .btn { flex: none; align-self: stretch; min-width: 88px }
.composer > label[hidden] { display: none }
.chat > .empty:not(:last-child), .thread > .empty:not(:last-child) { display: none }
.empty { padding: 20px; text-align: center; border: 1px dashed var(--line); border-radius: 6px; color: var(--muted) }
.errors { color: #ffd6d6; border: 1px solid var(--bad); border-radius: 4px; padding: 10px 12px; font-size: 14px }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px }
.grid3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 10px }
@media (max-width: 560px) { .grid2, .grid3 { grid-template-columns: 1fr } }

/* Plan */
.day-card { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--surface-2) }
.day-card header { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(31,91,255,.18), transparent) }
.day-card .note { padding: 8px 14px 0 }
.ex { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 10px 14px; border-bottom: 1px dashed var(--line) }
.ex:last-child { border-bottom: 0 }
.ex .nm { font-weight: 600 }
.ex .rx { font-family: var(--mono); color: var(--blue-hi); font-variant-numeric: tabular-nums; white-space: nowrap }
.ex .tip { grid-column: 1 / -1; font-size: 13px; color: var(--muted) }
.plan-notes { white-space: pre-wrap; color: var(--silver); border-left: 2px solid var(--blue); padding-left: 12px }
pre.fmt { margin: 0; font-family: var(--mono); font-size: 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 4px; padding: 10px; overflow-x: auto; color: var(--silver) }

/* Goals */
.goal { display: grid; gap: 8px; padding: 12px 0; border-bottom: 1px dashed var(--line) }
.goal:last-child { border-bottom: 0 }
.goal .top-line { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; flex-wrap: wrap }
.goal .nm { font-weight: 600 }
.goal.done .nm { text-decoration: line-through; color: var(--muted) }
.goal .num { font-family: var(--mono); font-variant-numeric: tabular-nums; color: var(--silver) }
.bar { height: 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 3px; overflow: hidden }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), var(--blue-hi)); box-shadow: 0 0 10px var(--blue) }
.goal .ctl { display: flex; gap: 8px; align-items: center; flex-wrap: wrap }
.goal .ctl input { width: 110px }
.pill { font-family: var(--wide); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; padding: 2px 8px; border-radius: 20px; border: 1px solid var(--good); color: var(--good) }
.pill.off { border-color: var(--bad); color: var(--bad) }
.pill.wait { border-color: var(--muted); color: var(--muted) }

/* Meals */
.meal-day { margin-top: 12px }
.meal-day h4 { margin: 0 0 6px; font-family: var(--wide); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--blue-hi); display: flex; justify-content: space-between }
.meal { display: grid; grid-template-columns: 88px 1fr auto; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); align-items: baseline }
.meal .mt { font-family: var(--wide); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted) }
.meal .tx { overflow-wrap: anywhere; min-width: 0 }
.meal .pr { font-family: var(--mono); font-size: 12px; color: var(--silver); white-space: nowrap }
.seg { display: flex; flex-wrap: wrap; gap: 6px; border: 0; padding: 0; margin: 0 }
.seg label { cursor: pointer }
.seg input { position: absolute; opacity: 0; pointer-events: none }
.seg span { display: inline-block; border: 1px solid var(--line); background: var(--paper); border-radius: 20px; padding: 6px 12px; font-size: 13px }
.seg input:checked + span { background: var(--blue); border-color: var(--blue); color: var(--blue-ink) }
.seg input:focus-visible + span { outline: 2px solid var(--blue-hi); outline-offset: 2px }

/* Challenge */
.ch-title { font-size: clamp(36px, 8vw, 54px); font-weight: 900 }
.spec { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-top: 14px }
.spec > div { padding: 10px 8px; border-right: 1px dashed var(--line); min-width: 0 }
.spec > div:last-child { border-right: 0 }
.spec .v { font-family: var(--display); font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 12px }
.days form { display: contents }
.day { aspect-ratio: 1; width: 100%; max-width: 100%; border: 1px solid var(--line); border-radius: 4px; background: var(--paper); display: grid; place-items: center;
  font-family: var(--mono); font-size: 13px; cursor: pointer; font-variant-numeric: tabular-nums; padding: 0 }
.day.done { background: var(--blue); border-color: var(--blue-hi); color: var(--blue-ink); font-weight: 700; box-shadow: 0 0 10px rgba(31,91,255,.5) }
.day.today { outline: 2px solid var(--silver); outline-offset: -2px }
.day:disabled { cursor: default; opacity: .4 }
.board { list-style: none; margin: 0; padding: 0; display: grid }
.board li { display: grid; grid-template-columns: 28px 32px 1fr auto; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px dashed var(--line) }
.board li:last-child { border-bottom: 0 }
.rank { font-family: var(--mono); color: var(--muted) }
.av { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-family: var(--wide); font-weight: 600; font-size: 12px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--silver); flex: none }
.av.coach { background: var(--blue); border-color: var(--blue-hi); color: var(--blue-ink) }
.score { font-family: var(--display); font-weight: 800; font-size: 20px; font-variant-numeric: tabular-nums }
ul.rules { margin: 0; padding-left: 18px; display: grid; gap: 4px; color: var(--silver) }

/* Chat + messages */
.chat { display: flex; flex-direction: column; gap: 12px; max-height: 60vh; overflow-y: auto; padding-right: 4px }
.msg { display: grid; grid-template-columns: 32px 1fr; gap: 10px; min-width: 0 }
.msg .meta { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap }
.msg .who { font-weight: 700 }
.msg .when { font-family: var(--mono); font-size: 11px; color: var(--muted) }
.msg .text { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--silver) }
.msg .del { display: none }
.ctag { font-family: var(--wide); font-size: 9px; letter-spacing: .16em; text-transform: uppercase; background: var(--blue); color: var(--blue-ink); padding: 2px 7px; border-radius: 2px }
.thread { display: flex; flex-direction: column; gap: 8px; max-height: 55vh; overflow-y: auto }
.bubble { max-width: 82%; padding: 9px 12px; border-radius: 12px; white-space: pre-wrap; overflow-wrap: anywhere;
  background: var(--surface-2); border: 1px solid var(--line); align-self: flex-start; border-bottom-left-radius: 3px }
.bubble small { display: block; font-family: var(--mono); font-size: 10px; opacity: .75; margin-top: 3px }
/* Which side a bubble sits on depends on who is looking, so live updates render the same HTML for both. */
body.role-client .bubble[data-from="client"], body.role-coach .bubble[data-from="coach"] {
  background: var(--blue); border-color: var(--blue); color: var(--blue-ink); align-self: flex-end; border-bottom-left-radius: 12px; border-bottom-right-radius: 3px }
.list { list-style: none; margin: 0; padding: 0 }
.list a { display: grid; grid-template-columns: 32px 1fr auto; gap: 10px; align-items: center; text-decoration: none; color: var(--ink); border-bottom: 1px dashed var(--line); padding: 10px 0 }
.list a:hover .nm { color: var(--blue-hi) }
.list .pv { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.list .min0 { min-width: 0 }
.unread { width: 9px; height: 9px; border-radius: 50%; background: var(--blue-hi); box-shadow: 0 0 8px var(--blue) }

/* Auth pages */
.auth { min-height: 100vh; display: grid; place-items: center; padding-block: 32px }
.auth-card { width: 100%; max-width: 420px; display: grid; gap: 18px }
.auth-card .logo { width: 140px; height: 140px; border-radius: 50%; box-shadow: var(--glow); justify-self: center }
.auth-card h1 { font-size: 34px; font-weight: 900; text-align: center }
.auth-card .tag { text-align: center }
.secure { display: flex; gap: 8px; align-items: center; justify-content: center; font-size: 12px; color: var(--muted) }
.secure svg { color: var(--blue-hi) }

/* Footer */
.foot { padding-block: 0 32px }
.foot .wrap { border-top: 1px solid var(--line); padding-top: 16px }
.foot a { color: var(--muted); font-size: 13px }

/* Public pages */
.public-nav { display: flex; gap: 14px; align-items: center }
.public-nav a:not(.btn) { color: var(--silver); text-decoration: none; font-family: var(--wide); font-weight: 600; font-size: 12px; letter-spacing: .08em; text-transform: uppercase }
.public-nav a[aria-current="page"] { color: var(--blue-hi) }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px }
@media (max-width: 640px) { .features { grid-template-columns: 1fr 1fr } }
@media (max-width: 420px) { .features { grid-template-columns: 1fr } }
.features > div { display: grid; gap: 6px; align-content: start; padding: 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2) }
.features p { color: var(--silver); font-size: 14px }
ol.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 12px }
ol.steps li { counter-increment: step; display: grid; grid-template-columns: 36px 1fr; gap: 12px; align-items: start; color: var(--silver) }
ol.steps li::before { content: counter(step, decimal-leading-zero); font-family: var(--display); font-weight: 800; font-size: 26px; line-height: 1; color: var(--blue-hi) }
ol.steps li > div { min-width: 0; display: grid; gap: 2px; padding-top: 2px }
ol.steps strong { color: var(--ink) }
.about-head { display: flex; gap: 18px; align-items: center; margin-bottom: 18px }
.about-logo { width: 96px; height: 96px; border-radius: 50%; box-shadow: var(--glow); flex: none }
@media (max-width: 480px) { .about-head { flex-direction: column; align-items: flex-start } }
.about-body { display: grid; gap: 14px; max-width: 64ch; color: var(--silver); font-size: 16px }
.about-body p:first-child { color: var(--ink); font-size: 18px }

/* Coach photo: cutout on a blue glow, like the logo */
.about-layout { display: grid; grid-template-columns: minmax(0, 260px) 1fr; gap: 24px; align-items: start }
.about-main { min-width: 0; display: grid; gap: 0 }
.about-main .about-body { margin-top: 16px }
.coach-photo { margin: 0; position: relative; border-radius: 6px; overflow: hidden; border: 1px solid var(--line);
  background: radial-gradient(70% 60% at 50% 38%, rgba(31,91,255,.45), rgba(31,91,255,.08) 60%, transparent 75%), var(--paper);
  background-image: radial-gradient(70% 60% at 50% 38%, rgba(31,91,255,.45), rgba(31,91,255,.08) 60%, transparent 75%),
    linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: auto, 20px 20px, 20px 20px; box-shadow: var(--glow) }
.coach-photo img { display: block; width: 100%; height: auto; padding-top: 12px }
.coach-photo::after { content: ""; position: absolute; inset: auto 0 0; height: 2px; background: var(--blue); box-shadow: 0 0 12px var(--blue) }
@media (max-width: 600px) { .about-layout { grid-template-columns: 1fr } .coach-photo { max-width: 300px } }
.about-teaser { display: grid; grid-template-columns: 150px 1fr; gap: 18px; align-items: center }
.coach-photo.small { max-width: 150px }
@media (max-width: 480px) { .about-teaser { grid-template-columns: 1fr } }

/* Intake answers, applicants, plan drafts, library */
.answers { margin: 0; display: grid; gap: 10px }
.answers .answer { display: grid; gap: 2px; padding-bottom: 10px; border-bottom: 1px dashed var(--line) }
.answers .answer:last-child { border-bottom: 0 }
.answers dt { font-family: var(--wide); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted) }
.answers dd { margin: 0; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere }
.answers .answer.flag dd { color: #ffd6a0 }
.answers .answer.flag dt::after { content: " · check"; color: #f2b84b }
.applicants { border-color: var(--blue); box-shadow: var(--glow) }
.draft-banner { border: 1px solid #f2b84b; border-radius: 4px; padding: 12px 14px; margin-bottom: 12px; color: #ffe2b0; background: rgba(242,184,75,.06) }
.draft-banner em { color: var(--ink); font-style: normal }
.seg input[type=checkbox] { position: absolute; opacity: 0; pointer-events: none }
.table-wrap { overflow-x: auto }
table.lib { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 640px }
table.lib th { text-align: left; font-family: var(--wide); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding: 8px; border-bottom: 1px solid var(--line) }
table.lib td { padding: 8px; border-bottom: 1px dashed var(--line); vertical-align: top; color: var(--silver) }
table.lib td strong { color: var(--ink) }

/* Intake form */
.intake-form fieldset { margin: 0; min-width: 0 }
.intake-form legend.section-title { padding: 0; margin-bottom: 4px; float: left; width: 100% }
.intake-form legend.section-title + * { clear: both }
.q { gap: 6px; padding-top: 6px }
.q-title { font-weight: 600; color: var(--ink) }
.q.has-error .q-title { color: #ffd6d6 }
.q.has-error input:not([type=radio]):not([type=checkbox]), .q.has-error textarea { border-color: var(--bad) }
.q-error { color: var(--bad); font-size: 13px }
.choices { display: grid; gap: 6px }
.choices label { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 4px; background: var(--paper); cursor: pointer; min-width: 0 }
.choices label:has(input:checked) { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue) inset }
.choices input[type=radio], .choices input[type=checkbox] { accent-color: var(--blue); width: 16px; height: 16px; flex: none; margin: 0 }
.choices label.other input[type=text] { flex: 1; min-width: 0; padding: 6px 8px }
.seg.scale { gap: 4px }
.seg.scale span { min-width: 36px; text-align: center; padding: 6px 0 }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden }

/* Exercise demo videos */
.ex .demo { grid-column: 1 / -1; justify-self: start; display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; padding: 4px 10px;
  border: 1px solid var(--line); border-radius: 20px; font-family: var(--wide); font-size: 11px; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: var(--blue-hi); text-decoration: none }
.ex .demo:hover { border-color: var(--blue-hi); box-shadow: 0 0 10px rgba(31,91,255,.35) }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap }
