:root {
  --ak-color-background: #FAFAF7;
  --ak-color-surface: #FFFFFF;
  --ak-color-surface-muted: #F1F1EC;
  --ak-color-border: #DEDED7;
  --ak-color-text: #16181A;
  --ak-color-text-muted: #585D63;
  --ak-color-accent: #0B6E52;
  --ak-color-on-accent: #FFFFFF;
  --ak-color-accent-soft: #E3F2EC;
  --ak-color-success: #067647;
  --ak-color-warning: #9A4A06;
  --ak-color-danger: #B42318;
  --ak-color-info: #175CD3;
  --ak-color-focus: #175CD3;
  --ak-space-0: 0px;
  --ak-space-1: 4px;
  --ak-space-2: 8px;
  --ak-space-3: 12px;
  --ak-space-4: 16px;
  --ak-space-5: 20px;
  --ak-space-6: 24px;
  --ak-space-8: 32px;
  --ak-space-10: 40px;
  --ak-space-12: 48px;
  --ak-space-16: 64px;
  --ak-radius-sm: 6px;
  --ak-radius-md: 10px;
  --ak-radius-lg: 16px;
  --ak-radius-pill: 999px;
  --ak-font-size-xs: 12px;
  --ak-line-height-xs: 16px;
  --ak-font-size-sm: 14px;
  --ak-line-height-sm: 20px;
  --ak-font-size-md: 16px;
  --ak-line-height-md: 24px;
  --ak-font-size-lg: 18px;
  --ak-line-height-lg: 26px;
  --ak-font-size-xl: 22px;
  --ak-line-height-xl: 30px;
  --ak-font-size-2xl: 28px;
  --ak-line-height-2xl: 36px;
  --ak-font-size-3xl: 34px;
  --ak-line-height-3xl: 42px;
  --ak-font-sans: Inter, 'IBM Plex Sans Arabic', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ak-font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --ak-color-background: #0E0F10;
  --ak-color-surface: #17191B;
  --ak-color-surface-muted: #202326;
  --ak-color-border: #30353A;
  --ak-color-text: #F2F3F4;
  --ak-color-text-muted: #A5ABB2;
  --ak-color-accent: #3CCB9E;
  --ak-color-on-accent: #05251B;
  --ak-color-accent-soft: #12342A;
  --ak-color-success: #47CD89;
  --ak-color-warning: #FDB022;
  --ak-color-danger: #F97066;
  --ak-color-info: #84ADFF;
  --ak-color-focus: #84ADFF;
}

/* App styles. Colours, spacing and type sizes come from @ak/ui-tokens (injected above this
   file as --ak-* variables, dark palette). Layout: client = one phone column with a bottom
   tab bar; coach = sidebar + wide content that stacks on a phone. */

:root {
  /* The app is dark only (AK Method look): ui-tokens' dark palette is the base,
     so the phone's light/dark setting doesn't change it. */
  color-scheme: dark;
  --font-display: 'Archivo', 'Arial Narrow', system-ui, sans-serif;
  --review-bg: #4A2C0A; --review-fg: #FFD6A3; --row-review: #241A0E;
  --good-bg: #12342A; --good-fg: #8BE3C2;
  --hold-bg: #F97066; --hold-fg: #2A0603; --row-hold: #2A1514;
  --neutral-bg: #2A2F33; --neutral-fg: #D3D8DC;
  --ink: #F2F3F4; --on-ink: #0E0F10; --on-ink-muted: #3A4045;
  --chart-dot: #6B7480;
  --chart-fill: rgb(60 203 158 / 0.14);
  --chart-avg: #8C96A0;
  /* App chrome (demo bar, coach sidebar, toasts). */
  --chrome: #1C1F22;
  --on-chrome: #FFFFFF;
  --on-chrome-muted: #AEB6B2;
  --chrome-line: #353B40;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ak-color-background);
  color: var(--ak-color-text);
  font-family: var(--ak-font-sans);
  font-size: var(--ak-font-size-md);
  line-height: var(--ak-line-height-md);
}
h1, h2, h3 { font-family: var(--font-display); text-wrap: balance; margin: 0; }
h1 { font-size: 28px; line-height: 1.15; font-weight: 800; letter-spacing: -0.3px; }
p { margin: 0; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.55; }
:focus-visible { outline: 3px solid var(--ak-color-focus); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---- shared bits ---- */
.muted { color: var(--ak-color-text-muted); }
.small { font-size: var(--ak-font-size-sm); line-height: var(--ak-line-height-sm); }
.normal { font-weight: 400; font-family: var(--ak-font-sans); }
.center { text-align: center; }
.accent-text { color: var(--ak-color-accent); font-weight: 600; }
.warn-text { color: var(--ak-color-warning); }
.danger-text { color: var(--ak-color-danger); }
.nums, .big-num, .tile-num { font-variant-numeric: tabular-nums; }
.eyebrow { font-size: 13px; font-weight: 600; color: var(--ak-color-text-muted); margin-bottom: 4px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 10px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.align-end { align-items: flex-end; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.page-head.wrap { flex-wrap: wrap; }
.section-title { font-size: 18px; font-weight: 700; margin-top: 4px; }
.card {
  background: var(--ak-color-surface);
  border: 1px solid var(--ak-color-border);
  border-radius: var(--ak-radius-lg);
  padding: 16px;
  text-align: left;
  min-width: 0;
}
.card-link { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.card-link:hover, .session:hover { border-color: var(--ak-color-accent); }
.card-title { font-size: 18px; font-weight: 700; }
.tile { display: flex; flex-direction: column; gap: 6px; }
.tile-num { font-family: var(--font-display); font-size: 24px; font-weight: 800; line-height: 1.1; }
.big-num { font-family: var(--font-display); font-size: 28px; font-weight: 800; }
.big-line { display: flex; align-items: baseline; gap: 6px; }
.metric-row { display: flex; justify-content: space-between; font-size: var(--ak-font-size-sm); }
.bar { height: 8px; border-radius: 999px; background: var(--ak-color-surface-muted); overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--ak-color-accent); border-radius: 999px; }
.pill { font-size: 12px; font-weight: 700; padding: 6px 10px; border-radius: 999px; white-space: nowrap; }
.pill-accent { background: var(--ak-color-accent-soft); color: var(--ak-color-accent); }
.note-card { background: var(--ak-color-accent-soft); border-radius: var(--ak-radius-lg); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.note-title { font-weight: 700; color: var(--ak-color-accent); }
.callout { background: var(--ink); color: var(--on-ink); border-radius: 12px; padding: 12px 16px; font-size: var(--ak-font-size-sm); }
.done-line { display: flex; align-items: center; gap: 8px; color: var(--ak-color-accent); font-weight: 600; font-size: var(--ak-font-size-sm); }
.error { color: var(--ak-color-danger); font-weight: 600; font-size: var(--ak-font-size-sm); }
.quote { margin: 0; padding: 10px 14px; background: var(--ak-color-surface-muted); border-radius: 10px; font-size: var(--ak-font-size-sm); }

.btn { min-height: 48px; padding: 0 18px; border-radius: 14px; border: 0; font-weight: 700; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn-sm { min-height: 44px; font-size: 14px; border-radius: 12px; }
.btn-lg { min-height: 54px; font-size: 16px; }
.btn-primary { background: var(--ak-color-accent); color: var(--ak-color-on-accent); }
.btn-dark { background: var(--ink); color: var(--on-ink); }
.btn-danger { background: var(--ak-color-danger); color: var(--ak-color-surface); }
.btn-outline-danger { background: transparent; color: var(--ak-color-danger); border: 1.5px solid var(--ak-color-danger); }
.btn-ghost { background: transparent; border: 1.5px solid var(--ak-color-border); }
.link-btn { background: none; border: 0; padding: 4px 0; color: var(--ak-color-accent); font-weight: 600; text-align: left; min-height: 32px; }
.link-btn.danger { color: var(--ak-color-danger); }
.link-btn.strong { font-weight: 700; font-size: 15px; }
.dashed-btn { min-height: 44px; border: 1.5px dashed var(--ak-color-accent); color: var(--ak-color-accent); background: transparent; border-radius: 12px; font-weight: 700; }
.back { align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; background: none; border: 0; padding: 6px 0; color: var(--ak-color-accent); font-weight: 600; font-size: 14px; min-height: 36px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.actions .grow { flex: 2 1 200px; }
.actions .btn { flex: 1 1 120px; }
.input {
  width: 100%;
  padding: 11px 12px;
  border: 1.5px solid var(--ak-color-border);
  border-radius: 12px;
  background: var(--ak-color-surface);
  font-size: 16px;
}
.input:focus { border-color: var(--ak-color-accent); outline: none; box-shadow: 0 0 0 3px var(--ak-color-accent-soft); }
textarea.input { resize: vertical; line-height: 1.5; }
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 15px; }
.field .input { font-weight: 400; }

/* ---- demo bar, toast ---- */
.demo-bar {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px;
  background: var(--chrome); color: var(--on-chrome); border-bottom: 1px solid var(--chrome-line);
  font-size: 13px;
  padding-block: 8px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.demo-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.demo-btn { background: transparent; color: var(--on-chrome); border: 1px solid var(--chrome-line); border-radius: 999px; padding: 6px 12px; font-size: 12px; font-weight: 600; min-height: 32px; }
.toast-region { position: fixed; left: 0; right: 0; bottom: calc(96px + env(safe-area-inset-bottom, 0px)); display: flex; justify-content: center; pointer-events: none; z-index: 30; padding-inline: 16px; }
.toast { background: var(--chrome); color: var(--on-chrome); border: 1px solid var(--chrome-line); padding: 12px 18px; border-radius: 12px; font-weight: 600; font-size: 14px; box-shadow: 0 8px 24px rgb(0 0 0 / 0.18); animation: toast-in 0.2s ease-out; max-width: 480px; }
.toast-error { background: var(--ak-color-danger); color: var(--ak-color-surface); }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0.4; } to { transform: none; opacity: 1; } }

/* ---- welcome ---- */
.welcome { padding-block: 48px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.welcome-inner { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
.welcome h1 { font-size: clamp(32px, 7vw, 52px); font-weight: 800; letter-spacing: -1px; }
.lede { font-size: 18px; line-height: 1.5; max-width: 58ch; color: var(--ak-color-text-muted); }
.brand { font-family: var(--font-display); font-weight: 800; letter-spacing: 1.5px; font-size: 18px; }
.brand-dark { color: var(--ak-color-accent); }
.role-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.role { display: flex; flex-direction: column; gap: 10px; text-align: left; padding: 22px; border-radius: 20px; border: 1.5px solid var(--ak-color-border); background: var(--ak-color-surface); min-height: 190px; }
.role strong { font-family: var(--font-display); font-size: 24px; }
.role span { color: var(--ak-color-text-muted); }
.role .role-go { margin-top: auto; color: var(--ak-color-accent); font-weight: 700; }
.role:hover { border-color: var(--ak-color-accent); }
.role-dark { background: var(--chrome); color: var(--on-chrome); border-color: var(--chrome-line); }
.role-dark span { color: var(--on-chrome-muted); }
.role-dark .role-go { color: var(--on-chrome); }

/* ---- client app ---- */
.client-main {
  max-width: 520px; margin: 0 auto;
  padding-top: 24px;
  padding-bottom: calc(110px + env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
  background: var(--ak-color-surface); border-top: 1px solid var(--ak-color-border);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}
.tab { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 0 12px; background: none; border: 0; font-size: 11px; font-weight: 600; color: var(--ak-color-text-muted); min-height: 60px; }
.tab[aria-current='page'] { color: var(--ak-color-accent); }
.banner { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--ak-color-accent); color: var(--ak-color-on-accent); border: 0; padding: 14px 16px; border-radius: var(--ak-radius-lg); }
.banner > span { display: flex; flex-direction: column; gap: 2px; }
.banner > span > span { font-size: 13px; opacity: 0.9; }
.session { display: flex; align-items: center; gap: 14px; width: 100%; }
.slot { width: 50px; height: 50px; flex: none; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; background: var(--ak-color-accent-soft); color: var(--ak-color-accent); }
.slot span { font-size: 13px; }
.slot-dark { background: var(--ink); color: var(--on-ink); }
.session-text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.session-state { font-size: 13px; font-weight: 700; color: var(--ak-color-accent); display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.session-state.done { color: var(--ak-color-success); }
.target { color: var(--ak-color-accent); font-weight: 700; font-size: 15px; }
.pain-note { color: var(--ak-color-danger); font-weight: 600; }
.sets { display: flex; flex-direction: column; gap: 8px; }
.set-row { display: grid; grid-template-columns: 28px repeat(3, minmax(0, 1fr)) 46px; gap: 8px; align-items: center; }
.set-head { font-size: 12px; color: var(--ak-color-text-muted); font-weight: 600; }
.set-n { font-weight: 700; }
.input-cell { padding: 10px 8px; text-align: center; font-variant-numeric: tabular-nums; }
.set-row.is-done .input-cell { background: var(--ak-color-surface-muted); border-color: transparent; }
.done-btn { width: 46px; height: 46px; border-radius: 12px; border: 2px solid var(--ak-color-accent); background: transparent; color: var(--ak-color-on-accent); display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.done-btn.on { background: var(--ak-color-accent); }
.done-btn.wide { width: auto; min-width: 88px; padding: 0 14px; color: var(--ak-color-accent); font-weight: 700; }
.done-btn.wide.on { color: var(--ak-color-on-accent); }
.simple-sets { display: flex; flex-wrap: wrap; gap: 8px; }
.macro-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.macro { background: var(--ak-color-surface); border: 1px solid var(--ak-color-border); border-radius: 14px; padding: 10px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.macro strong { font-family: var(--font-display); font-size: 18px; font-variant-numeric: tabular-nums; }
.macro-label { font-size: 11px; color: var(--ak-color-text-muted); }
.macro-main { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.macro-main .macro-label { color: var(--on-ink-muted); }
.meal-done { display: flex; align-items: center; gap: 12px; }
.tick { width: 30px; height: 30px; flex: none; border-radius: 999px; background: var(--ak-color-accent); color: var(--ak-color-on-accent); display: flex; align-items: center; justify-content: center; }
.meal-text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.meal-side { display: flex; flex-direction: column; align-items: flex-end; gap: 0; }
.options { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.option { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 12px; border: 1.5px solid var(--ak-color-border); cursor: pointer; }
.option.on { border-color: var(--ak-color-accent); background: var(--ak-color-accent-soft); }
.option input { margin: 3px 0 0; width: 18px; height: 18px; accent-color: var(--ak-color-accent); flex: none; }
.option-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.choice { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.choice legend { font-weight: 600; font-size: 15px; padding: 0 0 8px; }
.seg { display: grid; gap: 6px; }
.seg-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.seg-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.seg-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.seg-item { position: relative; min-height: 46px; display: flex; align-items: center; justify-content: center; border: 1.5px solid var(--ak-color-border); border-radius: 10px; font-weight: 700; cursor: pointer; }
.seg-item input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg-item.on { background: var(--ak-color-accent); border-color: var(--ak-color-accent); color: var(--ak-color-on-accent); }
.seg-item:focus-within { outline: 3px solid var(--ak-color-focus); outline-offset: 2px; }
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--ak-color-border); stroke-width: 1; }
.chart .axis { fill: var(--ak-color-text-muted); font-size: 11px; font-family: var(--ak-font-sans); }
.chart .dot { fill: var(--chart-dot); }
.chart .trend { fill: none; stroke: var(--ak-color-accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.chart .trend-end { fill: var(--ak-color-accent); stroke: var(--ak-color-surface); stroke-width: 2; }

/* ---- coach ---- */
.coach { display: flex; flex-wrap: wrap; min-height: 100vh; }
.sidebar {
  flex: 1 1 220px; max-width: 100%;
  background: var(--chrome); color: var(--on-chrome); border-right: 1px solid var(--chrome-line);
  padding: 24px 16px; display: flex; flex-direction: column; gap: 6px;
}
.sidebar .brand { padding: 0 10px 16px; }
.side-link { display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left; background: transparent; color: var(--on-chrome); border: 0; padding: 10px 12px; border-radius: 10px; font-size: 14px; font-weight: 600; min-height: 44px; opacity: 0.8; }
.side-link[aria-current='page'] { background: var(--ak-color-accent); color: var(--ak-color-on-accent); opacity: 1; }
.side-link:hover { opacity: 1; }
.side-switch { margin-top: auto; justify-content: flex-start; border: 1px solid var(--chrome-line); }
.side-soon { font-size: 12px; color: var(--on-chrome-muted); padding: 8px 12px; }
.count { background: var(--review-bg); color: var(--review-fg); font-size: 12px; font-weight: 800; padding: 1px 8px; border-radius: 999px; }
.coach-main {
  flex: 999 1 560px; min-width: 0;
  padding-block: 28px 48px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
@media (min-width: 900px) { .coach-main { padding-left: 40px; padding-right: 40px; } .sidebar { max-width: 240px; } }
@media (max-width: 799px) {
  .sidebar { flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px 16px; }
  .sidebar .brand { padding: 0 8px 0 0; }
  .side-soon { display: none; }
  .side-switch { margin-top: 0; }
}
.coach-main h1 { font-size: 30px; }
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filter { min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--ak-color-border); background: var(--ak-color-surface); font-size: 13px; font-weight: 700; }
.filter[aria-pressed='true'] { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.table-wrap { overflow-x: auto; background: var(--ak-color-surface); border: 1px solid var(--ak-color-border); border-radius: 14px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 720px; }
.table.compact { min-width: 340px; font-size: 15px; }
.table th, .table td { padding: 12px 16px; text-align: left; vertical-align: middle; }
.table thead th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--ak-color-text-muted); font-weight: 700; }
.table tbody tr { border-top: 1px solid var(--ak-color-border); }
.table tbody th { font-weight: 700; }
.table.compact .input-cell { max-width: 110px; }
.row-review { background: var(--row-review); }
.row-hold { background: var(--row-hold); }
.chip { display: inline-block; border: 0; font-size: 12px; font-weight: 800; padding: 5px 10px; border-radius: 999px; white-space: nowrap; }
.chip-review { background: var(--review-bg); color: var(--review-fg); }
.chip-good { background: var(--good-bg); color: var(--good-fg); }
.chip-neutral { background: var(--neutral-bg); color: var(--neutral-fg); }
.chip-hold { background: var(--hold-bg); color: var(--hold-fg); }
.chip-done { background: var(--ak-color-accent); color: var(--ak-color-on-accent); }
.crumbs { font-size: 13px; color: var(--ak-color-text-muted); display: flex; align-items: center; gap: 6px; }
.two-col { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; }
.two-col .col { flex: 1 1 380px; min-width: 0; }
.evidence { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.ev { background: var(--ak-color-surface-muted); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.ev strong { font-family: var(--font-display); font-size: 20px; font-variant-numeric: tabular-nums; }
.flags { margin: 0; padding-left: 18px; font-size: var(--ak-font-size-sm); color: var(--ak-color-danger); }

/* ---- libraries ---- */
.howto-toggle { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; }
.howto { display: flex; flex-direction: column; gap: 10px; padding: 12px; background: var(--ak-color-surface-muted); border-radius: 12px; }
.pics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.pics img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; background: var(--ak-color-surface); max-width: 100%; }
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: var(--ak-font-size-sm); line-height: 1.5; max-width: 68ch; }
.watch { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; min-height: 44px; padding: 0 16px; border-radius: 12px; background: var(--ink); color: var(--on-ink); font-weight: 700; font-size: 14px; text-decoration: none; }
.watch-compact { min-height: 36px; padding: 0 12px; font-size: 13px; }
.search { position: relative; display: flex; align-items: center; color: var(--ak-color-text-muted); }
.search svg { position: absolute; left: 12px; pointer-events: none; }
.search-input { padding-left: 38px; }
.results { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; border: 1px solid var(--ak-color-border); border-radius: 12px; overflow: hidden; }
.results li + li { border-top: 1px solid var(--ak-color-border); }
.result { width: 100%; text-align: left; background: var(--ak-color-surface); border: 0; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; min-height: 48px; }
.result:hover { background: var(--ak-color-surface-muted); }
.result-name { font-weight: 600; font-size: 15px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn { min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1.5px solid var(--ak-color-border); background: var(--ak-color-surface); font-size: 13px; font-weight: 600; }
.chip-btn[aria-pressed='true'] { border-color: var(--ak-color-accent); background: var(--ak-color-accent-soft); color: var(--ak-color-accent); }
.extra { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--ak-color-border); }
.icon-btn { width: 40px; height: 40px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; border: 1px solid var(--ak-color-border); background: var(--ak-color-surface); color: var(--ak-color-text-muted); }
.lib-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.lib-item { padding: 0; overflow: hidden; }
.lib-row { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; background: transparent; border: 0; text-align: left; flex-wrap: wrap; }
.lib-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 220px; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; }
.lib-detail { padding: 0 16px 16px; }
.food-name { font-weight: 600; min-width: 240px; }
a.btn { text-decoration: none; color: inherit; }
a.btn-primary { color: var(--ak-color-on-accent); }

/* ---- progress graphs ---- */
.wrap-row { flex-wrap: wrap; }
.align-start { align-items: flex-start; }
.tiny { font-size: 12px; line-height: 16px; }
.seg-mini { display: inline-flex; border: 1px solid var(--ak-color-border); border-radius: 999px; padding: 3px; gap: 2px; }
.seg-mini button { min-height: 32px; padding: 0 12px; border-radius: 999px; border: 0; background: transparent; color: var(--ak-color-text-muted); font-size: 13px; font-weight: 700; }
.seg-mini button[aria-pressed='true'] { background: var(--ak-color-surface-muted); color: var(--ak-color-text); }
.metric-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px; }
.metric-card { display: flex; flex-direction: column; gap: 8px; }
.metric-title { font-family: var(--ak-font-sans); font-size: 14px; font-weight: 600; color: var(--ak-color-text-muted); }
.metric-value { font-family: var(--font-display); font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.delta { font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--neutral-bg); color: var(--neutral-fg); white-space: nowrap; font-variant-numeric: tabular-nums; }
.delta.good { background: var(--good-bg); color: var(--good-fg); }
.delta.bad { background: var(--review-bg); color: var(--review-fg); }
.chart .area { fill: var(--chart-fill); stroke: none; }
.chart .pt { fill: var(--ak-color-accent); stroke: var(--ak-color-surface); stroke-width: 1.5; }
.chart .target-line { stroke: var(--chart-avg); stroke-width: 1.5; stroke-dasharray: 4 4; }

/* ---- coach profile ---- */
.coach-card { display: flex; align-items: center; gap: 14px; width: 100%; }
.coach-photo { flex: none; border-radius: 999px; object-fit: cover; background: var(--ak-color-accent-soft); }
.coach-photo-sm { width: 48px; height: 48px; }
.coach-photo-lg { width: 120px; height: 120px; border-radius: 24px; }
.monogram { display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 800; color: var(--ak-color-accent); letter-spacing: -0.5px; }
.coach-photo-sm.monogram { font-size: 16px; }
.coach-photo-lg.monogram { font-size: 40px; }
.coach-profile { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; background: var(--ak-color-surface); border: 1px solid var(--ak-color-border); border-radius: 20px; padding: 20px; }
.coach-text { flex: 1 1 260px; min-width: 0; }
.coach-name { font-size: 26px; font-weight: 800; }
.coach-intro { font-size: 15px; line-height: 1.6; max-width: 62ch; color: var(--ak-color-text); }
.highlights { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.highlights li { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--ak-color-accent-soft); color: var(--ak-color-accent); }
.coach-gallery { flex: 1 1 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.coach-gallery img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; object-position: center 30%; border-radius: 12px; max-width: 100%; }

/* ---- coach's cues ---- */
.cue-block { border: 1px solid var(--ak-color-border); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; background: var(--ak-color-surface); }
.cue-head { font-size: 13px; color: var(--ak-color-text-muted); }
.cue-head strong { color: var(--ak-color-accent); }
.cue-facts { display: flex; flex-wrap: wrap; gap: 6px; }
.cue-facts span { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--ak-color-surface-muted); font-variant-numeric: tabular-nums; }
.cue-lines { margin: 0; display: flex; flex-direction: column; gap: 4px; font-size: 14px; line-height: 1.45; }
.cue-lines div { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 8px; }
.cue-lines dt { color: var(--ak-color-text-muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; padding-top: 2px; }
.cue-lines dd { margin: 0; }

/* ---- live app: sign-in, invites, logging ---- */
.welcome-inner.narrow { max-width: 440px; }
.auth { min-height: 100vh; }
.auth-title { font-size: clamp(28px, 7vw, 36px) !important; letter-spacing: -0.5px; }
.auth-links { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.narrow-form { max-width: 560px; }
.log-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.input-unit { position: relative; display: block; }
.input-unit .input { width: 100%; padding-right: 64px; }
.input-unit .unit { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 13px; font-weight: 500; color: var(--ak-color-text-muted); pointer-events: none; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px !important; }
.track-field { max-width: 320px; }
.invite-card { border-color: var(--ak-color-accent); }

/* ---- onboarding questionnaire ---- */
fieldset.q { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset.q legend { padding: 0 0 8px; font-weight: 600; font-size: 15px; }
.q-label { font-weight: 600; }
.req { color: var(--ak-color-accent); }
.textarea { min-height: 88px; padding-block: 12px; resize: vertical; font: inherit; font-size: 16px; }
.choice-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; }
.choice-list { display: flex; flex-direction: column; gap: 8px; }
.opt { min-height: 48px; padding: 10px 14px; border-radius: 12px; border: 1.5px solid var(--ak-color-border); background: var(--ak-color-surface); color: var(--ak-color-text); font-weight: 600; font-size: 15px; text-align: left; }
.choice-row .opt, .scale-row .opt { text-align: center; }
.opt[aria-pressed='true'] { border-color: var(--ak-color-accent); background: var(--ak-color-accent-soft); color: var(--ak-color-accent); }
.scale-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(42px, 1fr)); gap: 6px; }
.scale-ends { display: flex; justify-content: space-between; }
.onboarding .page-head h1 { font-size: 28px; }

/* ---- client training ---- */
.week-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 600; font-size: 14px; }
.icon-btn:disabled { opacity: 0.35; }
.pill-muted { background: var(--ak-color-surface-muted); color: var(--ak-color-text-muted); }
.session-card { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; color: var(--ak-color-text); }
.session-card:hover { border-color: var(--ak-color-accent); }
.session-day { flex: none; width: 46px; height: 46px; border-radius: 12px; background: var(--ak-color-surface-muted); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; color: var(--ak-color-accent); }
.session-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.set-table { display: flex; flex-direction: column; gap: 6px; }
.set-row { display: flex; align-items: flex-end; gap: 8px; }
.set-row.on .input { border-color: var(--ak-color-accent); }
.set-n { flex: none; width: 22px; padding-bottom: 14px; font-weight: 700; color: var(--ak-color-text-muted); font-variant-numeric: tabular-nums; }
.mini { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--ak-color-text-muted); flex: 1 1 70px; min-width: 0; }
.mini .input { min-height: 44px; padding: 8px 10px; font-variant-numeric: tabular-nums; width: 100%; }
.done-btn { flex: none; width: 48px; height: 44px; border-radius: 12px; border: 1.5px solid var(--ak-color-border); background: var(--ak-color-surface); color: var(--ak-color-text-muted); display: inline-flex; align-items: center; justify-content: center; }
.done-btn[aria-pressed='true'] { background: var(--ak-color-accent); border-color: var(--ak-color-accent); color: var(--ak-color-on-accent); }
.check-line { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; }
.check-line input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--ak-color-accent); flex: none; }

/* ---- coach program ---- */
.program-name { font-size: 18px; font-weight: 800; }
.warn-card { background: var(--review-bg); color: var(--review-fg); border-radius: 12px; padding: 12px 14px; font-size: 14px; }
.warn-card ul, .why ul, .suggestions { margin: 6px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.suggestions { list-style: none; padding-left: 0; gap: 10px; }
.why summary { cursor: pointer; font-weight: 600; color: var(--ak-color-accent); }
.why { font-size: 14px; }
.phase-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.phase-tab { flex: 0 0 auto; min-width: 140px; max-width: 180px; display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--ak-color-border); background: var(--ak-color-surface); color: var(--ak-color-text); }
.phase-tab[aria-selected='true'] { border-color: var(--ak-color-accent); background: var(--ak-color-accent-soft); }
.phase-n { font-size: 11px; font-weight: 800; letter-spacing: 0.6px; text-transform: uppercase; color: var(--ak-color-accent); }
.phase-t { font-weight: 700; font-size: 14px; line-height: 1.25; }
.ex-edit { border-top: 1px solid var(--ak-color-border); padding-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.ex-name { font-weight: 600; min-width: 0; }
.ex-tools { display: flex; gap: 12px; flex: none; }
.dose-row { display: flex; flex-wrap: wrap; gap: 8px; }
.dose-row .mini { flex: 0 1 76px; }
.picker { border: 1px solid var(--ak-color-border); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 8px; background: var(--ak-color-surface-muted); }
.pick-row { text-align: left; border: 0; background: var(--ak-color-surface); color: var(--ak-color-text); border-radius: 10px; padding: 10px 12px; min-height: 44px; font-weight: 600; }
.sticky-actions { position: sticky; bottom: 0; padding-block: 10px; background: var(--ak-color-background); z-index: 2; }
.select-sm { min-height: 40px; width: auto; }
.answers { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px 16px; margin: 0; }
.answers dt { font-size: 12px; font-weight: 700; color: var(--ak-color-text-muted); }
.answers dd { margin: 2px 0 0; font-size: 14px; overflow-wrap: anywhere; }
.add-ex { border-color: var(--ak-color-accent); }
.dose-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.dose-row .mini { flex: none; }
.dose-row .mini .input { padding: 8px 6px; text-align: center; }
.steps-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; color: var(--ak-color-text-muted); }
.steps-list strong { color: var(--ak-color-text); }
.other-field { margin-top: 4px; }
.upload { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 12px 14px; border-radius: 12px; border: 1.5px dashed var(--ak-color-border); color: var(--ak-color-accent); font-weight: 600; cursor: pointer; position: relative; }
.upload.done { border-style: solid; border-color: var(--ak-color-accent); background: var(--ak-color-accent-soft); }
.upload:focus-within { outline: 3px solid var(--ak-color-focus); outline-offset: 2px; }
.file-input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.upload-preview { max-width: 100%; max-height: 240px; border-radius: 12px; object-fit: contain; align-self: flex-start; }
.file-row { display: flex; flex-wrap: wrap; gap: 10px; }
.file-thumb { display: flex; flex-direction: column; gap: 4px; width: 120px; color: var(--ak-color-text); text-decoration: none; }
.file-thumb img, .file-pdf { width: 120px; height: 150px; object-fit: cover; border-radius: 10px; border: 1px solid var(--ak-color-border); background: var(--ak-color-surface-muted); }
.file-pdf { display: flex; align-items: center; justify-content: center; font-weight: 800; color: var(--ak-color-text-muted); }
.day-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.day-tab { flex: 1 0 64px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 8px; border-radius: 12px; border: 1.5px solid var(--ak-color-border); background: var(--ak-color-surface); color: var(--ak-color-text); }
.day-tab[aria-selected='true'] { border-color: var(--ak-color-accent); background: var(--ak-color-accent-soft); color: var(--ak-color-accent); }
.day-n { font-weight: 800; font-size: 14px; }
.group-title { margin: 6px 0 -2px; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ak-color-accent); }
.split-opt { display: flex; flex-direction: column; gap: 6px; width: 100%; text-align: left; color: var(--ak-color-text); border: 1.5px solid var(--ak-color-border); }
.split-opt.on { border-color: var(--ak-color-accent); background: var(--ak-color-accent-soft); }
.split-days { display: flex; flex-wrap: wrap; gap: 6px; }
.mini-label { font-size: 13px; font-weight: 600; color: var(--ak-color-text-muted, inherit); }
.session-card.is-off { opacity: .6; }
.food-row { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--ak-color-border); padding-top: 8px; }
.food-name { flex: 1; min-width: 0; font-weight: 600; font-size: 15px; }
.food-row .grams { flex: none; width: 84px; }
.macro-off { color: var(--review-fg); font-weight: 700; }
.macro-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; text-align: center; }
.macro-grid div { display: flex; flex-direction: column; gap: 2px; }
.macro-grid strong { font-size: 18px; }
.option-name { font-weight: 700; }
.food-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.food-list li { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--ak-color-border); padding-bottom: 6px; }
.tabbar .tab { min-width: 0; }
