/* Vorynx trainer web app — token layer + Milestone 2 surfaces.
 *
 * Every value here is a named token from BRAND_GUIDELINES.md (§2 color,
 * §3 type, §12–13 cards/depth, §14 spacing) or DESIGN_SYSTEM.md (§4 radius,
 * §6 buttons, §7 inputs). No ad-hoc colors, spacing, or radii — if a value
 * isn't derivable from a token, it doesn't belong in this file.
 *
 * Fonts: licensing for the directional typefaces (Söhne/Neue Haas class
 * grotesk, GT Sectra class serif) is an open item (BRAND_GUIDELINES.md
 * Open Items) — until it resolves, system near-equivalents stand in. The
 * display serif is deliberately absent from this stylesheet: per
 * HIGH_FIDELITY_SCREENS.md it appears only on Intervention Approval (M4)
 * and the client Check-In (M9), never on routine data surfaces.
 */

:root {
  /* Color — BRAND_GUIDELINES.md §2 */
  --color-obsidian: #0e1013;
  --color-graphite: #1b1e23;
  --color-bone: #f3f0e9;
  --color-ash: #9ba0a8;
  --color-lime: #a4d820;
  --color-umber: #c4633f;
  /* Alert Umber is a fill/border colour: 4.14:1 on Graphite clears the 3:1
   * non-text bar (§10) but not the 4.5:1 text bar. For Umber AS TEXT we use
   * the same hue lifted in lightness only — 7.08:1 on Graphite, 8.07:1 on
   * Obsidian, which meets the AAA target §10 sets for risk flags. */
  --color-umber-text: #d99a82;
  /* Signal Lime is the single accent (BRAND_GUIDELINES §0a, 2026-10-24).
   * Bronze and Signal Cyan are retired. Obsidian text on a Lime fill. */

  /* Hairlines are Ash at low opacity (§12), never solid borders */
  --hairline: rgba(155, 160, 168, 0.25);

  /* Spacing — §14: 8px base scale */
  --space-4: 4px;
  --space-8: 8px;
  --space-16: 16px;
  --space-24: 24px;
  --space-32: 32px;
  --space-48: 48px;

  /* Radius — DESIGN_SYSTEM.md §4 as amended 2026-10-24: cards 20, inputs 12,
   * pills fully round, nothing else */
  --radius-card: 20px;
  --radius-input: 12px;
  --radius-pill: 999px;

  /* Type — §3's two registers, both self-hosted (fonts.css). The families
   * named there are open-licensed stand-ins for §3's directional references,
   * whose licensing is still open. */
  --font-interface: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-display: "Instrument Serif", "Hoefler Text", Georgia, serif;

  /* Motion — §7: ambient register only on this surface */
  --motion-ambient-easing: cubic-bezier(0.4, 0, 0.2, 1);
  --motion-ambient-duration: 180ms;

  /* Component Library §6: stale metric = reduced-opacity value.
   * 0.45 rendered the figure at 4.00:1 on Graphite — under the 4.5:1 AAA
   * bar §10 sets for metrics. 0.66 reads as 7.11:1 and is still visibly
   * dimmer than a live value (14.68:1); the .stale-marker label continues
   * to carry the meaning, so opacity is never the sole signal. */
  --stale-value-opacity: 0.66;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--color-obsidian);
  color: var(--color-bone);
  font-family: var(--font-interface);
  font-size: 15px;
  line-height: 1.5; /* §10: 1.5+ for a read-heavy professional tool */
}

/* §3: the display register carries page and section headings — the
 * "considered judgment" moments. It deliberately does not carry
 * .section-label, which is a small uppercase marker in the interface
 * register, nor anything operational: rosters, metrics and timestamps all
 * stay in the grotesk. */
h1,
h2:not(.section-label) {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.005em;
}

/* Data figures never jitter — §3 tabular numerals, everywhere */
body {
  font-variant-numeric: tabular-nums;
}

a {
  color: var(--color-bone);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-decoration-color: var(--color-ash);
}

/* §10: visible, on-brand focus — thin Lime outline, not browser blue */
:focus-visible {
  outline: 1px solid var(--color-lime);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  left: var(--space-16);
  top: var(--space-8);
  background: var(--glass);
  padding: var(--space-8) var(--space-16);
  z-index: 1;
}

/* ---- Shell ---- */

.shell {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 var(--space-24) var(--space-48);
}

.top-bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: var(--space-24) 0;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: var(--space-32);
}

.wordmark {
  /* Placeholder wordmark — the logo mark itself is an open brand item */
  font-size: 14px;
  letter-spacing: 0.35em;
  color: var(--color-bone);
}

.top-bar-meta {
  display: flex;
  align-items: baseline;
  gap: var(--space-16);
  color: var(--color-ash);
  font-size: 13px;
}

/* ---- Labels (§3: captions = grotesk, smaller, letter-spaced) ---- */

.section-label {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-ash);
  margin: 0 0 var(--space-16);
  font-weight: 400;
}

.section-label .count {
  color: var(--color-bone);
  letter-spacing: normal;
}

section + section {
  margin-top: var(--space-48);
}

/* ---- Cards (§12–13: Graphite, hairline, tonal depth) ---- */

.card {
  background: var(--glass);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  padding: var(--space-24);
}

@media (prefers-reduced-motion: no-preference) {
  /* DESIGN_SYSTEM.md §11 card entrance: one brief settle, no stagger */
  .settle {
    animation: settle var(--motion-ambient-duration)
      var(--motion-ambient-easing);
  }

  @keyframes settle {
    from {
      opacity: 0;
      transform: translateY(4px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

/* ---- Metric cards (Component Library §6) ---- */

.metric-row {
  display: grid;
  /* equal width "down to the pixel" — HIGH_FIDELITY_SCREENS.md §2 */
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-16);
}

@media (max-width: 640px) {
  .metric-row {
    grid-template-columns: 1fr;
  }
}

.metric-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  min-height: 128px;
}

.metric-label {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-ash);
}

.metric-value {
  font-size: 28px;
  color: var(--color-bone);
}

/* Stale: value present but old — dimmed AND labelled (§10: opacity alone
 * may never carry the meaning) */
.metric-card.is-stale .metric-value {
  opacity: var(--stale-value-opacity);
}

.stale-marker {
  font-size: 12px;
  color: var(--color-ash);
}

/* Empty state: legitimate information, dot-matrix placeholder register
 * (DESIGN_SYSTEM.md §15–16), plainly labelled */
.metric-empty {
  font-size: 28px;
  color: var(--color-ash);
  /* 0.5 put the placeholder at 2.61:1 — under the 3:1 large-text bar. */
  opacity: 0.6;
  letter-spacing: 0.2em;
}

.metric-empty-label {
  font-size: 13px;
  color: var(--color-ash);
}

.metric-footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-8);
}

/* Provenance tag: tiny, bottom-corner (Component Library §6) */
.provenance-tag {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-ash);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-input);
  padding: 1px var(--space-4);
}

.observed-date {
  font-size: 12px;
  color: var(--color-ash);
}

/* ---- Tables (roster list, history — §9 density with clarity) ---- */

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th {
  text-align: left;
  font-weight: 400;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-ash);
  padding: var(--space-8) var(--space-16) var(--space-8) 0;
  border-bottom: 1px solid var(--hairline);
}

.data-table td {
  padding: var(--space-16) var(--space-16) var(--space-16) 0;
  border-bottom: 1px solid var(--hairline);
  vertical-align: baseline;
}

.data-table .muted {
  color: var(--color-ash);
}

/* History is deliberately the least visually interesting element
 * (HIGH_FIDELITY_SCREENS.md §2) */
.history .data-table td {
  padding-top: var(--space-8);
  padding-bottom: var(--space-8);
  font-size: 13px;
  color: var(--color-ash);
}

/* ---- Forms (DESIGN_SYSTEM.md §7) ---- */

.intake-forms {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-16);
}

@media (max-width: 640px) {
  .intake-forms {
    grid-template-columns: 1fr;
  }
}

form div {
  margin-bottom: var(--space-16);
}

label {
  display: block;
  font-size: 13px;
  color: var(--color-ash);
  margin-bottom: var(--space-4);
}

.helptext {
  display: block;
  font-size: 12px;
  color: var(--color-ash);
  opacity: 0.8;
  margin-top: var(--space-4);
}

/* Some help text arrives as a list (Django's password rules). It is
 * guidance, not content — same size and colour, no bullet column. */
.helptext ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Field errors. Django renders these as ul.errorlist and nothing styled
 * them, so "The password is too similar to the username" arrived as an
 * unremarkable bullet in body text, indistinguishable from the help text
 * above it. Same alert vocabulary as the rest of the product (§7): Umber,
 * and a rule plus a "—" marker so the state does not rest on colour (§10).
 * --color-umber-text rather than raw Umber: 7.08:1 on Graphite. */
.errorlist {
  list-style: none;
  margin: var(--space-4) 0;
  padding: 0 0 0 var(--space-12);
  border-left: 2px solid var(--color-umber);
  font-size: 13px;
  color: var(--color-umber-text);
}

.errorlist li::before {
  content: "— ";
}

/* as_div already renders the list directly above the input it is about, and
 * sets aria-invalid + aria-describedby on that input, so this needs no
 * reordering — only to look like what it is. */

input[type="text"],
input[type="number"],
input[type="date"],
input[type="password"],
input[type="url"],
input[type="email"],
input[type="tel"],
input[type="search"],
input[type="file"],
textarea,
select {
  width: 100%;
  background: var(--glass);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-input);
  color: var(--color-bone);
  font: inherit;
  padding: var(--space-8);
}

input:focus,
textarea:focus,
select:focus {
  /* §7: Bronze hairline on focus — a color shift, no glow */
  outline: none;
  border-color: var(--color-lime);
}

/* §10/§16: keyboard focus gets the same Bronze outline as every other
 * control. The border shift alone was the weakest focus affordance here
 * and the only one that departed from the global rule. */
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 1px solid var(--color-lime);
  outline-offset: 2px;
}

::placeholder {
  color: var(--color-ash);
  /* 0.6 put placeholder text at 3.17:1 — under AA. 0.8 is 4.56:1 and still
   * reads as secondary against Bone input text at 14.68:1. */
  opacity: 0.8;
}

/* Native file inputs otherwise ship an OS-default white button that breaks
 * the dark surface — restyle the picker button as a Secondary control (§6)
 * so photo/video uploads read as part of the system. */
input[type="file"] {
  padding: var(--space-4);
  cursor: pointer;
}

input[type="file"]::file-selector-button {
  background: var(--glass);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-input);
  color: var(--color-bone);
  font: inherit;
  padding: var(--space-4) var(--space-16);
  margin-right: var(--space-16);
  cursor: pointer;
  transition: border-color var(--motion-ambient-duration)
    var(--motion-ambient-easing);
}

input[type="file"]::file-selector-button:hover {
  border-color: var(--color-lime);
}

/* Buttons — DESIGN_SYSTEM.md §6. Secondary is the default weight; the
 * single Primary (Bronze-filled) button in the whole system belongs to the
 * client check-in submit (M9), so it does not appear here. */
button,
.button {
  background: var(--glass);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  color: var(--color-bone);
  font: inherit;
  padding: var(--space-8) var(--space-16);
  cursor: pointer;
}

button:hover,
.button:hover {
  border-color: var(--color-lime);
}

.button-tertiary {
  background: none;
  border: none;
  color: var(--color-ash);
  padding: 0;
}

.button-tertiary:hover {
  color: var(--color-bone);
  border: none;
}

/* ---- Messages (Toast register, Component Library §16: confirms the
 * fact, nothing more — no success-green, no celebration) ---- */

.messages {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-24);
}

.messages li {
  background: var(--glass);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  padding: var(--space-8) var(--space-16);
  font-size: 13px;
  color: var(--color-ash);
  margin-bottom: var(--space-8);
}

/* Attention needs follow-up: Umber accent as a left mark, never a fill
 * (Flag-card principle), always alongside the message text itself */
.messages li.error {
  border-left: 4px solid var(--color-umber);
  color: var(--color-bone);
}

/* ---- Login ---- */

.login-card {
  max-width: 360px;
  margin: 96px auto 0; /* 96 is on the §14 scale */
}

/* ---- Detail header ---- */

.detail-header {
  display: flex;
  align-items: baseline;
  gap: var(--space-16);
  margin-bottom: var(--space-32);
}

.detail-header h1 {
  font-size: 22px;
  font-weight: 500;
  margin: 0;
}

.back-link {
  color: var(--color-ash);
  font-size: 13px;
}

/* ---- Hero: adherence read (M3) ---------------------------------------
 * The one Depth-3 / gradient moment on this screen (HIGH_FIDELITY_SCREENS.md
 * §2). An open 270° arc, never a closed progress ring (Component Library §4).
 * One accent only: Bronze carries on-track/watch, Umber is spent solely on an
 * at-risk flag — the two never appear together (Brand Guidelines §2). */

.hero {
  text-align: center;
}

.hero .section-label {
  text-align: left;
}

.hero-arc {
  --hero-accent: var(--color-lime);
  position: relative;
  width: 180px;
  height: 180px;
  margin: 0 auto;
}

.hero-arc.is-at-risk {
  --hero-accent: var(--color-umber);
}

/* Depth Level 3: one soft accent-tinted glow behind the focal number
 * (Brand Guidelines §13, Design System §1) — a low-opacity emanation, not a
 * fill. Absent on the insufficient dial: no reading, no glow. */
.hero-arc:not(.is-insufficient)::before {
  content: "";
  position: absolute;
  inset: var(--space-8);
  border-radius: 50%;
  background: radial-gradient(
    circle at 50% 50%,
    color-mix(in srgb, var(--hero-accent) 14%, transparent),
    transparent 62%
  );
}

.arc {
  display: block;
  width: 180px;
  height: 180px;
}

.arc-track {
  stroke: var(--color-ash);
  stroke-width: 3;
  opacity: 0.25;
}

.arc-value {
  stroke: var(--hero-accent);
  stroke-width: 4;
  stroke-linecap: round;
}

.arc-empty {
  stroke: var(--color-ash);
  stroke-width: 3;
  opacity: 0.6;
}

.hero-arc-center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

/* Signature hero numeral. Dot-matrix rendering (Design System §2) is the
 * intended treatment; until the licensed instrument face lands it stands in
 * as a large tabular figure — the open arc carries the signature meanwhile. */
.hero-score {
  font-size: 44px;
  line-height: 1;
  color: var(--color-bone);
}

.hero-score-max {
  align-self: flex-end;
  margin-bottom: var(--space-8);
  font-size: 14px;
  color: var(--color-ash);
}

.hero-empty-mark {
  font-size: 32px;
  letter-spacing: 0.2em;
  color: var(--color-ash);
  opacity: 0.6;
}

.hero-readout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-8);
  margin-top: var(--space-16);
}

/* Risk chip: color is never the sole signal (§10) — the label text is always
 * present; the accent bar only reinforces it. */
.risk-chip {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-bone);
  border-left: 3px solid var(--color-ash);
  padding-left: var(--space-8);
}

.risk-chip.is-on-track,
.risk-chip.is-watch {
  border-left-color: var(--color-lime);
}

.risk-chip.is-at-risk {
  border-left-color: var(--color-umber);
}

.hero-evidence {
  margin: 0;
  font-size: 13px;
  color: var(--color-ash);
}

/* ---- Intervention: the AI Card (M4) ----------------------------------
 * Component Library §10. Proposed vs. confirmed is carried by SHAPE and
 * LABEL, never by colour alone (§10 accessibility): a dashed left edge +
 * "Suggested" for a proposal, a solid edge + "Approved" for the committed
 * decision. The accent follows the current read (Bronze, or Umber when the
 * client is at risk) so this view still shows only one accent (§2). */

.ai-card,
.confirmed-card {
  --card-accent: var(--color-lime);
}

.ai-card.is-at-risk,
.confirmed-card.is-at-risk {
  --card-accent: var(--color-umber);
}

/* Dashed edge = proposed, not final (a redline annotation on the interface
 * itself, HIGH_FIDELITY_SCREENS.md §2). */
.ai-card.proposed {
  border-left: 3px dashed var(--card-accent);
}

/* Solid edge = confirmed: the same item migrated to committed state. */
.confirmed-card.confirmed {
  border-left: 3px solid var(--card-accent);
}

.ai-card-head,
.confirmed-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-16);
  margin-bottom: var(--space-16);
}

.suggested-label,
.confirmed-label {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--card-accent);
}

.ai-drafted-by,
.confirmed-meta {
  font-size: 12px;
  color: var(--color-ash);
}

/* Evidence as prose, not another data widget (WIREFRAMES.md §3) — shown
 * above the proposed action so the trainer evaluates before deciding. */
.ai-rationale,
.confirmed-message {
  margin: 0 0 var(--space-16);
  color: var(--color-bone);
}

.confirmed-message {
  margin-bottom: 0;
}

.ai-actions {
  display: flex;
  align-items: center;
  gap: var(--space-16);
  margin-top: var(--space-16);
}

/* ---- Programming delivery (M5) ---------------------------------------
 * The confirmed intervention carried to the trainer's tool. Status text is
 * neutral (delivery is expected, not an accent event); a failed delivery
 * marks its hand-off block with an Umber left edge — attention that needs
 * follow-up (Component Library §16), a mark not a fill. */

.delivery {
  margin-top: var(--space-16);
  padding-top: var(--space-16);
  border-top: 1px solid var(--hairline);
}

.delivery-status {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-ash);
}

.delivery-ref {
  color: var(--color-ash);
}

.handoff-instructions {
  margin: var(--space-8) 0 0;
  padding-left: var(--space-16);
  border-left: 1px solid var(--hairline);
  white-space: pre-wrap;
  color: var(--color-bone);
  font-size: 14px;
}

.delivery-failed .handoff-instructions {
  border-left-color: var(--color-umber);
}

.delivery-action {
  margin-top: var(--space-16);
}

/* ---- Carry-out rows: client message (M6) + programming push (M5) ------
 * The approved intervention goes two places — to the client, and to the
 * trainer's tool. Each row is labelled so the two deliveries are never
 * confused for one. */

.carry-out {
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
  margin-top: var(--space-16);
  padding-top: var(--space-16);
  border-top: 1px solid var(--hairline);
}

.carry-row {
  display: flex;
  align-items: baseline;
  gap: var(--space-16);
  flex-wrap: wrap;
}

.carry-label {
  flex-shrink: 0;
  min-width: 96px;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-ash);
}

/* Inside a carry row the separator already comes from .carry-out, so the
 * delivery status/action sits flush. */
.carry-row .delivery,
.carry-row .delivery-action {
  margin: 0;
  padding: 0;
  border-top: none;
}

/* ---- Message log (M6): the trainer's visibility into client comms ---- */

.message-log {
  list-style: none;
  margin: var(--space-16) 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
}

.message-log-item {
  padding-left: var(--space-16);
  border-left: 1px solid var(--hairline);
}

.message-log-head {
  display: flex;
  align-items: baseline;
  gap: var(--space-16);
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--color-ash);
}

.message-kind {
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.message-when {
  margin-left: auto;
}

.message-body {
  margin: var(--space-4) 0 0;
  color: var(--color-bone);
  font-size: 14px;
}

/* ---- Roster Command View (M8) ----------------------------------------
 * One accent: Umber marks the at-risk state (Needs Attention flag cards, the
 * at-risk status, the risk segment); every calmer state stays neutral Ash, so
 * the view is quiet until someone actually needs the trainer (§2). The 48px
 * gap between the attention zone and the roster comes from section+section. */

.flag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-16);
}

/* Flag card: Graphite with an Umber left-edge bar only — colour marks, never
 * fills (Design System §5, HIGH_FIDELITY_SCREENS.md §1). */
.flag-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  border-left: 4px solid var(--color-umber);
  color: var(--color-bone);
}

.flag-card:hover {
  text-decoration: none;
  border-color: var(--color-umber);
}

.flag-name {
  font-size: 15px;
  color: var(--color-bone);
}

/* Key stat in the dot-matrix register (Design System §2) — a large tabular
 * figure stands in until the licensed instrument face lands. */
.flag-stat {
  font-size: 34px;
  line-height: 1;
  color: var(--color-bone);
}

.flag-stat-max {
  margin-left: 2px;
  font-size: 13px;
  color: var(--color-ash);
}

.flag-note {
  font-size: 12px;
  color: var(--color-ash);
}

/* Roster composition bar — one restrained segmented reading, precise counts
 * in the legend (Component Library §13). */
.composition-bar {
  display: flex;
  height: 8px;
  overflow: hidden;
  border-radius: var(--radius-input);
  background: var(--glass);
}

.composition-seg {
  height: 100%;
}

.composition-seg.is-at-risk {
  background: var(--color-umber);
}

.composition-seg.is-watch {
  background: var(--color-ash);
  opacity: 0.7;
}

.composition-seg.is-on-track {
  background: var(--color-ash);
  opacity: 0.45;
}

.composition-seg.is-insufficient {
  background: var(--color-ash);
  opacity: 0.22;
}

.composition-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-24);
  list-style: none;
  margin: var(--space-16) 0 0;
  padding: 0;
  font-size: 12px;
  color: var(--color-ash);
}

.composition-legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-ash);
  opacity: 0.6;
}

.composition-legend-item.is-at-risk .legend-dot {
  background: var(--color-umber);
  opacity: 1;
}

.composition-legend-item.is-watch .legend-dot {
  opacity: 0.7;
}

.composition-legend-item.is-on-track .legend-dot {
  opacity: 0.45;
}

.legend-count {
  color: var(--color-bone);
}

/* Roster table: status colour is reserved for the at-risk state (Umber),
 * everything calmer is neutral Ash — always paired with the label text,
 * never colour alone (§10). */
.status-mark {
  color: var(--color-ash);
}

.status-mark.is-at-risk {
  color: var(--color-umber-text);
}

.roster-table .roster-score {
  color: var(--color-bone);
}

/* ---- Billing (M7) ---------------------------------------------------- */

.billing-price {
  margin: 0 0 var(--space-8);
  color: var(--color-bone);
}

.billing-amount {
  color: var(--color-bone);
}

.billing-plus {
  color: var(--color-ash);
  margin: 0 var(--space-4);
}

.billing-current,
.billing-note {
  margin: 0;
  color: var(--color-ash);
  font-size: 14px;
}

.billing-status {
  margin: 0 0 var(--space-16);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-ash);
}

/* A live subscription reads calm (Ash); a lapsed one carries the Umber
 * attention mark — the one accent on this page, and only when it applies. */
.billing-status-active,
.billing-status-trialing {
  color: var(--color-ash);
}

.billing-status-canceled,
.billing-status-past_due {
  color: var(--color-umber-text);
}

.billing-note {
  margin-bottom: var(--space-16);
}

/* Destructive: Umber text on Graphite, never a full fill (Design System §6). */
.button-destructive {
  color: var(--color-umber-text);
}

.button-destructive:hover {
  border-color: var(--color-umber);
}

/* ---- Top navigation --------------------------------------------------- */

.top-nav {
  display: flex;
  gap: var(--space-24);
  font-size: 13px;
}

.top-nav a {
  color: var(--color-ash);
}

.top-nav a:hover {
  color: var(--color-bone);
  text-decoration: none;
}

/* ---- Exercise library (Training) ------------------------------------- */

.exercise-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-16);
}

.exercise-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  padding: 0;
  overflow: hidden;
}

.exercise-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--color-obsidian);
}

.exercise-thumb-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-ash);
  opacity: 0.4;
  letter-spacing: 0.2em;
  font-size: 22px;
}

.exercise-meta {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-16);
}

.exercise-name {
  color: var(--color-bone);
}

.exercise-category {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-ash);
}

.exercise-video {
  font-size: 13px;
  color: var(--color-lime);
}

/* ---- Workout detail --------------------------------------------------- */

.workout-assignment {
  margin: 0 0 var(--space-8);
  color: var(--color-ash);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.workout-notes {
  margin: 0 0 var(--space-24);
  color: var(--color-bone);
}

.workout-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
  counter-reset: item;
}

.workout-item {
  display: flex;
  align-items: center;
  gap: var(--space-16);
}

.workout-item-thumb {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  border-radius: var(--radius-input);
  object-fit: cover;
  background: var(--color-obsidian);
}

.workout-item-meta {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  flex: 1;
}

.workout-item-name {
  color: var(--color-bone);
}

.workout-item-rx {
  font-size: 14px;
  color: var(--color-ash);
}

.workout-item-note {
  font-size: 13px;
  color: var(--color-ash);
}

/* ---- Client workouts + companion workout ----------------------------- */

.assigned-workouts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.assigned-workout {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: var(--space-16) 0;
  border-bottom: 1px solid var(--hairline);
}

.assigned-workout-count {
  color: var(--color-ash);
  font-size: 13px;
}

/* ---- Meal plan detail (Nutrition) ------------------------------------ */

.meal-group {
  margin-bottom: var(--space-24);
}

.meal-heading {
  margin: 0 0 var(--space-8);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-lime);
  font-weight: 400;
}

.meal-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.meal-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-16);
  padding: var(--space-8) 0;
  border-bottom: 1px solid var(--hairline);
}

.meal-item-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.meal-food {
  color: var(--color-bone);
}

.meal-macros {
  font-size: 13px;
  color: var(--color-ash);
}

.meal-note {
  font-size: 13px;
  color: var(--color-ash);
}

/* ---- Edit affordances (Training / Nutrition) ------------------------- */

.exercise-edit {
  font-size: 13px;
  color: var(--color-ash);
}

.workout-item-actions {
  display: flex;
  align-items: center;
  gap: var(--space-16);
  flex-shrink: 0;
}

.workout-item-actions a {
  font-size: 13px;
  color: var(--color-ash);
}

/* ---- Exercise library: find + built-in catalog ----------------------
 * A shipped catalog means the library is large from day one, so finding
 * comes first: search + muscle filter above the grid, and the catalog is
 * always one link away. */

.library-find {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-8);
  align-items: center;
}

.library-find input[type="search"] {
  flex: 1 1 200px;
  width: auto;
  background: var(--glass);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-input);
  color: var(--color-bone);
  font: inherit;
  padding: var(--space-8);
}

.library-find input[type="search"]:focus {
  outline: none;
  border-color: var(--color-lime);
}

.library-find input[type="search"]:focus-visible {
  outline: 1px solid var(--color-lime);
  outline-offset: 2px;
}

.library-find select {
  flex: 0 1 180px;
  width: auto;
}

.library-find > * {
  margin-bottom: 0;
}

.library-clear,
.library-catalog-link a {
  font-size: 13px;
  color: var(--color-ash);
}

.library-catalog-link {
  margin: var(--space-16) 0 0;
}

.library-catalog-link a {
  color: var(--color-lime);
}

.catalog-intro {
  margin: 0 0 var(--space-24);
  color: var(--color-ash);
  font-size: 14px;
  max-width: 60ch;
}

.catalog-add-all {
  margin-bottom: var(--space-48);
}

.catalog-group + .catalog-group {
  margin-top: var(--space-48);
}

.catalog-group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-16);
}

.catalog-group-head .section-label {
  margin-bottom: var(--space-16);
}

.catalog-group-head form {
  margin: 0;
}

.catalog-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

/* One compact row per exercise — 78 of them have to stay scannable. */
.catalog-row {
  display: flex;
  align-items: center;
  gap: var(--space-16);
  padding: var(--space-8) var(--space-16) var(--space-8) var(--space-8);
  background: var(--glass);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
}

/* Muscle artwork sits on black — show the whole figure, never crop it. */
.catalog-art {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  object-fit: contain;
  background: var(--color-obsidian);
  border-radius: var(--radius-input);
}

.catalog-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.catalog-meta form {
  margin: 0;
}

.catalog-name {
  color: var(--color-bone);
}

.catalog-tags {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-ash);
}

.catalog-how {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--color-ash);
}

.catalog-row form {
  margin: 0;
  flex-shrink: 0;
}

/* Dimming the row also dims its 11-13px text; 0.6 put that at 3.17:1,
 * under AA. 0.8 is 4.56:1 and still reads as already-added. */
.catalog-row.is-owned {
  opacity: 0.8;
}

@media (max-width: 640px) {
  .catalog-row {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .catalog-how {
    display: none;
  }
}

/* “Already in your library” is a confirmed state, not an attention signal:
 * Bronze means attention-worthy (§2) and this is the one row that needs
 * none, which is why it is dimmed. Ash is the right register (§11 Tier 2),
 * and it clears AA inside the dimmed row where Bronze did not (3.86:1).
 * The ✓ keeps the meaning off colour alone (§10). */
.catalog-owned {
  margin-top: var(--space-8);
  font-size: 13px;
  color: var(--color-ash);
}

/* Two links share the row under the library search. */
.library-catalog-link {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-24);
}

.exercise-card video.exercise-thumb {
  display: block;
}

/* ---- Footer + legal pages -------------------------------------------- */

.site-footer {
  display: flex;
  gap: var(--space-24);
  margin-top: var(--space-48);
  padding-top: var(--space-24);
  border-top: 1px solid var(--hairline);
  font-size: 12px;
  color: var(--color-ash);
}

.site-footer a {
  color: var(--color-ash);
}

.legal {
  max-width: 68ch;
}

.legal h1 {
  font-size: 26px;
  font-weight: 500;
  margin: 0 0 var(--space-4);
}

.legal-meta {
  margin: 0 0 var(--space-32);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-ash);
}

.legal h2 {
  font-size: 15px;
  font-weight: 500;
  margin: var(--space-32) 0 var(--space-8);
  color: var(--color-bone);
}

.legal p,
.legal li {
  color: var(--color-ash);
  font-size: 14px;
  line-height: 1.65;
}

.legal p {
  margin: 0 0 var(--space-16);
}

.legal ul {
  margin: 0 0 var(--space-16);
  padding-left: var(--space-24);
}

.legal li {
  margin-bottom: var(--space-8);
}

.legal strong {
  color: var(--color-bone);
  font-weight: 500;
}

.legal a {
  color: var(--color-lime);
}

/* ---- Cookie consent banner -------------------------------------------- */

.cookie-banner {
  position: fixed;
  left: var(--space-16);
  right: var(--space-16);
  bottom: var(--space-16);
  z-index: 50;
  max-width: 560px;
  margin: 0 auto;
  padding: var(--space-16) var(--space-24);
  background: var(--glass);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  font-size: 13px;
  color: var(--color-ash);
}

.cookie-banner p {
  margin: 0 0 var(--space-16);
}

.cookie-banner a {
  color: var(--color-lime);
}

.cookie-actions {
  display: flex;
  gap: var(--space-8);
  justify-content: flex-end;
}

.cookie-accept {
  border-color: var(--color-lime);
}

/* ---- Mobile: the trainer shell -------------------------------------------
 * The top bar is wordmark + five nav links + account; in one unwrapped row
 * it forced every page to ~520px on a phone. It wraps now, and on narrow
 * screens the nav becomes a full-width strip that scrolls sideways itself
 * instead of pushing the page wider. Wide tables scroll inside their own
 * box for the same reason. */
.top-bar {
  flex-wrap: wrap;
  gap: var(--space-8) var(--space-24);
}

@media (max-width: 640px) {
  .shell {
    padding-left: var(--space-16);
    padding-right: var(--space-16);
  }

  .top-nav {
    order: 3;
    flex-basis: 100%;
    display: flex;
    gap: var(--space-24);
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: var(--space-4);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .top-nav::-webkit-scrollbar {
    display: none;
  }

  .data-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .intake-forms,
  .metric-row {
    grid-template-columns: 1fr;
  }
}

/* ---- Progress photos (Client Detail) ---------------------------------- */

.photo-late {
  margin: 0 0 var(--space-16);
  font-size: 13px;
  color: var(--color-umber);
}

.before-after-trainer {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 220px));
  gap: var(--space-16);
}

.before-after-trainer.single {
  grid-template-columns: minmax(0, 220px);
}

.before-after-trainer figure {
  margin: 0;
}

.before-after-trainer img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: var(--radius-card);
  background: var(--glass);
}

.before-after-trainer figcaption {
  margin-top: var(--space-4);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-ash);
}

.photo-strip-trainer {
  list-style: none;
  margin: var(--space-16) 0 0;
  padding: 0 0 var(--space-8);
  display: flex;
  gap: var(--space-8);
  overflow-x: auto;
}

.photo-strip-trainer li {
  flex: 0 0 72px;
  font-size: 11px;
  color: var(--color-bone);
  text-align: center;
}

.photo-strip-trainer img {
  display: block;
  width: 72px;
  height: 96px;
  object-fit: cover;
  border-radius: var(--radius-input);
  margin-bottom: 2px;
}

.photo-strip-trainer .muted {
  display: block;
  color: var(--color-ash);
}

/* ---- Accounts: sign-up, invites, roster admin ------------------------- */

.roster-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-16);
  margin-bottom: var(--space-32);
}

.roster-title {
  margin: 0;
  font-size: 22px;
  font-weight: 500;
}

.signup-intro {
  margin: 0 0 var(--space-24);
  font-size: 14px;
  color: var(--color-ash);
}

.auth-alt {
  margin: var(--space-16) 0 0;
  font-size: 13px;
  color: var(--color-ash);
}

.auth-alt a {
  color: var(--color-lime);
}

.admin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-16);
  flex-wrap: wrap;
  padding: var(--space-16) 0;
  border-bottom: 1px solid var(--hairline);
}

.admin-row:first-child {
  padding-top: 0;
}

.admin-row form {
  margin: 0;
  display: flex;
  gap: var(--space-8);
  align-items: center;
}

.admin-row select {
  width: auto;
  margin: 0;
}

.admin-label {
  display: block;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-ash);
}

.admin-value {
  color: var(--color-bone);
  font-size: 14px;
}

.admin-pending {
  color: var(--color-lime);
}

.invite-link-label {
  margin: var(--space-16) 0 var(--space-4);
  font-size: 13px;
  color: var(--color-ash);
}

.invite-link {
  width: 100%;
  font-size: 13px;
  color: var(--color-lime);
}

.avatar-link {
  display: block;
  margin-bottom: var(--space-8);
  font-size: 14px;
}

/* A destructive action sits apart from the form it follows. */
.danger-form {
  margin-top: var(--space-24);
  padding-top: var(--space-16);
  border-top: 1px solid var(--hairline);
}

/* ---- Roster panels: awaiting approval, today, waiting to join --------- */

.panel-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

/* A panel row is one line of a list, not a card of its own; the card or the
 * ai-card around the list carries the surface. */
.panel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-16);
}

.ai-card.panel-row {
  padding: var(--space-16) var(--space-24);
}

/* On the roster the one accent is Umber, spent on at-risk flags. A draft
 * waiting for approval is distinguished by its dashed edge and its "Suggested"
 * label, not by a second colour: Ash, so the view still has a single accent. */
.awaiting .ai-card {
  --card-accent: var(--color-ash);
}

.panel-main {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-width: 0;
  color: var(--color-bone);
}

.panel-main:hover {
  text-decoration: none;
}

.panel-name {
  font-size: 15px;
  color: var(--color-bone);
}

.panel-note {
  font-size: 12px;
  color: var(--color-ash);
}

.panel-more {
  margin: var(--space-8) 0 0;
  font-size: 12px;
  color: var(--color-ash);
}

.panel-subhead {
  margin: 0 0 var(--space-16);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-ash);
}

.today-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: var(--space-16);
}

.week-line {
  margin: var(--space-16) 0 0;
  font-size: 14px;
  color: var(--color-bone);
}

.week-line strong {
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.panel-source {
  display: block;
  margin-top: var(--space-4);
  font-size: 11px;
  color: var(--color-ash);
}

.panel-note .provenance-tag {
  white-space: nowrap;
}


/* ==== Glass / Lime direction (founder, 2026-10-24; BRAND_GUIDELINES §0a) ====
 * Cards become translucent glass with a faint top highlight, figures that are
 * the point of a card go dot-matrix (Doto), and buttons are pills. No
 * gradient is introduced here: the signal surface on this app is the client
 * hero card, which already carries the one allowed.
 */

:root {
  --glass: rgba(27, 30, 35, 0.62);
  --glass-edge: inset 0 1px 0 rgba(255, 255, 255, 0.07);
  --glass-blur: blur(16px) saturate(1.15);
  --font-readout: "Doto", var(--font-interface);
}

.card {
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-edge);
}

.metric-value,
.hero-score {
  font-family: var(--font-readout);
  font-weight: 800;
  letter-spacing: 0;
}

.metric-value { font-size: 36px; }
.hero-score { font-size: 56px; }

button,
.button {
  border-radius: var(--radius-pill);
}

.flag-stat {
  font-family: var(--font-readout);
  font-weight: 800;
  font-size: 40px;
  letter-spacing: 0;
}

.button-primary {
  background: var(--color-lime);
  border-color: var(--color-lime);
  color: var(--color-obsidian);
  font-weight: 600;
}

.button-primary:hover {
  background: var(--color-lime);
  filter: brightness(1.08);
}

.flag-stat-max,
.hero-score-max {
  font-family: var(--font-interface);
  font-weight: 400;
}

.renewal-notice { margin: 0 0 var(--space-24); padding: var(--space-16) var(--space-24); }
.renewal-notice p { margin: 0; font-size: 14px; }
.renewal-notice a { color: var(--color-lime); text-decoration: underline; }
.legal-meta a { color: var(--color-ash); text-transform: none; letter-spacing: 0; }

/* ==== Roster at a glance (2026-11-04) ====================================
 * Four tiles and a week of check-ins, from the founder's second reference:
 * dark rounded tiles, a quiet label, a big readout figure, the source beneath.
 * Lime stays the single accent; no rings, no photos, no extra hues.
 */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-16);
  margin-bottom: var(--space-24);
}

@media (max-width: 760px) {
  .tiles {
    grid-template-columns: repeat(2, 1fr);
  }
}

.tile {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-16) var(--space-24);
  background: var(--glass);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  box-shadow: var(--glass-edge);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  color: var(--color-bone);
  text-decoration: none;
}

.tile:hover {
  border-color: var(--color-lime);
  text-decoration: none;
}

.tile-label {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-ash);
}

.tile-value {
  font-family: var(--font-readout);
  font-weight: 800;
  font-size: 44px;
  line-height: 1.1;
  letter-spacing: 0;
}

.tile-of {
  font-family: var(--font-interface);
  font-weight: 400;
  font-size: 16px;
  color: var(--color-ash);
}

.tile-sub {
  font-size: 13px;
  color: var(--color-ash);
}

.week-card {
  margin-bottom: var(--space-24);
}

.week-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-16);
  margin-bottom: var(--space-16);
}

.week-title {
  margin: 0;
  font-family: var(--font-interface);
  font-size: 16px;
  font-weight: 600;
}

.week-meta,
.week-source {
  font-size: 12px;
  color: var(--color-ash);
}

.week-source {
  margin: var(--space-8) 0 0;
}

.wk-bars {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: var(--space-16);
  height: 150px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.wk-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  height: 100%;
}

.wk-value,
.wk-day {
  font-size: 12px;
  color: var(--color-ash);
}

.wk-bar.is-today .wk-value,
.wk-bar.is-today .wk-day {
  color: var(--color-bone);
  font-weight: 600;
}

.wk-track {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  background: rgba(155, 160, 168, 0.12);
  border-radius: 12px;
  overflow: hidden;
}

.wk-fill {
  display: block;
  width: 100%;
  background: rgba(164, 216, 32, 0.45);
  border-radius: 12px;
}

.wk-bar.is-today .wk-fill {
  background: var(--color-lime);
}

/* A day under 70% checked in: Alert Umber, the risk state, never an accent.
 * The ▾ beside the count carries it without colour (§10). */
.wk-bar.is-short .wk-fill {
  background: rgba(196, 99, 63, 0.6);
}

.wk-bar.is-short.is-today .wk-fill {
  background: var(--color-umber);
}

.wk-short {
  color: var(--color-umber-text);
}

.week-card .week-title {
  font-family: var(--font-interface);
  font-size: 16px;
  font-weight: 600;
}

/* ==== Period reads (2026-11-04): Yesterday / Today / Week / Month ==========
 * One chart card shared by the client's Today and the trainer's Client Detail
 * (signal_intake/_period_reads.html). Lime is the single accent; no rings, no
 * photos. A day with no check-in is an empty track, never a zero-height bar.
 */

.pc-card {
  margin: var(--space-24) 0;
  padding: var(--space-24);
  background-color: var(--glass);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  box-shadow: var(--glass-edge);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}

.pc-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-16);
  margin-bottom: var(--space-16);
}

.pc-head-sub { margin: var(--space-16) 0 var(--space-8); }

.pc-title,
.pc-sub {
  margin: 0;
  font-family: var(--font-interface);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0;
}

.pc-sub { font-size: 14px; }

.pc-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
}

.pc-tab {
  padding: 4px 12px;
  border-radius: 999px;
  color: var(--color-ash);
  font-size: 13px;
  text-decoration: none;
}

.pc-tab:hover { color: var(--color-bone); text-decoration: none; }

.pc-tab.is-active {
  background: var(--color-lime);
  color: var(--color-obsidian);
  font-weight: 600;
}

.pc-meta,
.pc-source {
  margin: var(--space-8) 0 0;
  color: var(--color-ash);
  font-size: 12px;
}

.pc-empty,
.pc-note {
  margin: 0;
  color: var(--color-ash);
  font-size: 14px;
}

.pc-note { margin-top: var(--space-16); color: var(--color-bone); }

.pc-tiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-16);
}

.pc-tile {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--space-16) var(--space-16);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-input);
}

.pc-tile-label {
  color: var(--color-ash);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.pc-tile-value {
  font-family: var(--font-readout);
  font-weight: 800;
  font-size: 36px;
  line-height: 1.1;
  letter-spacing: 0;
}

.pc-tile-of {
  font-family: var(--font-interface);
  font-weight: 400;
  font-size: 14px;
  color: var(--color-ash);
}

.pc-bars {
  display: grid;
  grid-template-columns: repeat(var(--cols, 7), 1fr);
  gap: 6px;
  height: 150px;
  margin: var(--space-16) 0 0;
  padding: 0;
  list-style: none;
}

.pc-bars.is-dense { gap: 3px; }

.pc-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
  height: 100%;
}

.pc-bar-value,
.pc-bar-day {
  min-height: 1em;
  color: var(--color-ash);
  font-size: 12px;
  line-height: 1;
}

.pc-bar.is-today .pc-bar-value,
.pc-bar.is-today .pc-bar-day {
  color: var(--color-bone);
  font-weight: 600;
}

.pc-bar-track {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  background: rgba(155, 160, 168, 0.12);
  border-radius: 8px;
  overflow: hidden;
}

.pc-bar-fill {
  display: block;
  width: 100%;
  background: rgba(164, 216, 32, 0.45);
  border-radius: 8px;
}

.pc-bar.is-today .pc-bar-fill { background: var(--color-lime); }

.pc-line {
  display: block;
  width: 100%;
  height: 80px;
  overflow: visible;
}

.pc-line polyline {
  fill: none;
  stroke: var(--color-lime);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.pc-card .pc-title { font-family: var(--font-interface); font-weight: 600; }


/* ==== All glass (founder, 2026-11-10) =====================================
 * Every surface on the trainer side is the same translucent glass: the cards
 * already were; the top bar, tables, inputs and panels now are too. No new
 * colour and no gradient — one token, --glass, used everywhere.
 */
.top-bar {
  position: sticky;
  top: var(--space-8);
  z-index: 5;
  margin-top: var(--space-8);
  padding: var(--space-16) var(--space-24);
  background: var(--glass);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-pill);
  box-shadow: var(--glass-edge);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}

.table-glass {
  padding: var(--space-8) var(--space-24);
  background: var(--glass);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  box-shadow: var(--glass-edge);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  overflow-x: auto;
}

.table-glass .data-table tr:last-child td { border-bottom: 0; }

input, select, textarea {
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}


/* ==== Frosted glass over a lime glow (founder approved the mock-up, 2026-11-11)
 * Glass reads as glass only with light behind it, so the page gets ONE backdrop
 * glow (Lime and Ash, the brand's own colours) and every surface becomes clear
 * frosted glass: a strong blur, a bright top edge, a soft shadow. This is the
 * second and last permitted gradient (BRAND_GUIDELINES §0a): the backdrop, on
 * `body` only. Fixed, so it does not scroll with the content.
 */
:root {
  --glass: rgba(255, 255, 255, 0.07);
  --glass-blur: blur(28px) saturate(1.5);
  --glass-edge: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 12px 40px rgba(0, 0, 0, 0.35);
  --hairline: rgba(255, 255, 255, 0.16);
}

body {
  background: radial-gradient(60% 45% at 12% 8%, rgba(164, 216, 32, 0.30), transparent 70%),
    radial-gradient(50% 40% at 92% 30%, rgba(164, 216, 32, 0.16), transparent 70%),
    radial-gradient(70% 50% at 50% 100%, rgba(155, 160, 168, 0.20), transparent 70%),
    var(--color-obsidian);
  background-attachment: fixed;
}

.card,
.tile,
.table-glass,
.top-bar,
.pc-card {
  background: var(--glass);
  border-color: var(--hairline);
  box-shadow: var(--glass-edge);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}


/* First-run steps on an empty roster, and the invite link's copy button. */
.first-run-title { margin: 0 0 var(--space-16); font-family: var(--font-interface); font-size: 16px; font-weight: 600; }
.first-run-steps { margin: 0; padding: 0; list-style: none; }
.first-run-step {
  display: flex;
  align-items: center;
  gap: var(--space-16);
  padding: var(--space-16) 0;
  border-top: 1px solid var(--hairline);
}
.first-run-mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--hairline);
  border-radius: 50%;
  color: var(--color-ash);
}
.first-run-step.is-done .first-run-mark { border-color: var(--color-lime); color: var(--color-lime); }
.first-run-text { flex: 1; }
.first-run-hint { display: block; color: var(--color-ash); font-size: 13px; }
.first-run-done { color: var(--color-ash); }
.invite-link-row { display: flex; gap: var(--space-8); align-items: center; }
.invite-link-row .invite-link { flex: 1; }

.legal-agree { color: var(--color-ash); font-size: 13px; }
.legal-agree a { color: var(--color-bone); text-decoration: underline; }


/* ==== Photography on the front door (founder, 2026-11-15) ==================
 * Sign-in, self sign-up and invite acceptance sit on a full-screen
 * photograph, the card frosted over it (BRAND_GUIDELINES §0a). It is our own,
 * generated for Vorynx Lab, never stock. The photographs of a trainer were
 * removed on 2026-11-22 at the founder's direction; this is the one left. Their edges are faded to Obsidian in the file itself, so no CSS
 * gradient is needed and the page keeps its one.
 *
 * On a phone the photo fills the screen and the card starts below the face.
 * On a desktop the photo stands at the right and the card moves left of it.
 */
body.auth-page {
  background: var(--color-obsidian) center top / cover no-repeat fixed;
}

body.auth-signin { background-image: url("photos/signin.ab74c6c1eae0.jpg"); }

.auth-page .login-card {
  margin-top: 40vh;
}

@media (min-width: 900px) {
  body.auth-page {
    background-size: auto 100%;
    background-position: right 6vw center;
  }

  .auth-page .login-card {
    margin: var(--space-64) 0 0 clamp(24px, 8vw, 160px);
  }
}


/* ==== Blended glass, carried over from the client app (founder, 2026-11-15) =
 * The founder approved the client app's softer blend and asked for the trainer
 * dashboard and admin to match. Same change, same limits (BRAND_GUIDELINES
 * §0a): the one body backdrop becomes a wash across the whole screen instead
 * of a glow in two corners, and the glass loses its hard edge. Lime stays at
 * or under ~0.17 so Ash text clears 4.5:1 through a card. The sign-in and
 * sign-up pages keep their photograph (body.auth-page outranks this rule).
 */
:root {
  --glass: rgba(255, 255, 255, 0.06);
  --glass-blur: blur(36px) saturate(1.4);
  --glass-edge: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 18px 48px rgba(0, 0, 0, 0.18);
  --hairline: rgba(255, 255, 255, 0.10);
}

body {
  background: radial-gradient(90% 60% at 10% 0%, rgba(164, 216, 32, 0.06), transparent 75%),
    radial-gradient(80% 55% at 95% 55%, rgba(164, 216, 32, 0.05), transparent 75%),
    linear-gradient(180deg, rgba(164, 216, 32, 0.11) 0%, rgba(164, 216, 32, 0.07) 55%, rgba(155, 160, 168, 0.10) 100%),
    var(--color-obsidian);
  background-attachment: fixed;
}
