/* =====================================================================
   ViMove — Design System
   Light / clinical theme, accessibility-first (large type, high contrast,
   generous touch targets) for older adults and their caregivers.
   ===================================================================== */

/* -------------------------------------------------------------------
   1. Design tokens
   ------------------------------------------------------------------- */
:root {
  /* Brand — calm medical teal */
  --brand-50:  #f0fdfa;
  --brand-100: #ccfbf1;
  --brand-200: #99f6e4;
  --brand-300: #5eead4;
  --brand-400: #2dd4bf;
  --brand-500: #14b8a6;
  --brand-600: #0d9488;   /* primary */
  --brand-700: #0f766e;
  --brand-800: #115e59;
  --brand-900: #134e4a;

  /* Secondary accent — trust blue */
  --accent-500: #3b82f6;
  --accent-600: #2563eb;

  /* Neutrals (slate) */
  --ink-900: #0f172a;     /* primary text */
  --ink-800: #1e293b;
  --ink-700: #334155;
  --ink-600: #475569;
  --ink-500: #64748b;     /* muted text */
  --ink-400: #94a3b8;
  --ink-300: #cbd5e1;
  --ink-200: #e2e8f0;     /* borders */
  --ink-100: #f1f5f9;
  --ink-50:  #f8fafc;     /* page background */
  --surface: #ffffff;

  /* Semantic */
  --success: #16a34a;
  --success-bg: #dcfce7;
  --warning: #b45309;
  --warning-bg: #fef3c7;
  --danger:  #dc2626;
  --danger-bg: #fee2e2;

  /* Typography */
  --font-head: "Lexend", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --fs-base: 18px;        /* larger base for readability */

  /* Radius */
  --radius-sm: 10px;
  --radius:    16px;
  --radius-lg: 24px;
  --radius-pill: 999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .08);
  --shadow:    0 4px 6px -1px rgba(15, 23, 42, .07), 0 2px 4px -2px rgba(15, 23, 42, .06);
  --shadow-lg: 0 12px 24px -6px rgba(15, 23, 42, .12), 0 8px 16px -8px rgba(15, 23, 42, .08);
  --shadow-brand: 0 10px 30px -8px rgba(13, 148, 136, .45);

  /* Layout */
  --maxw: 1180px;
  --nav-h: 76px;
}

/* -------------------------------------------------------------------
   2. Reset & base
   ------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.65;
  color: var(--ink-900);
  background: var(--ink-50);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg, video, canvas { display: block; max-width: 100%; }

a { color: var(--brand-700); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.15;
  color: var(--ink-900);
  letter-spacing: -0.02em;
  margin: 0 0 .5em;
}
h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); }
p  { margin: 0 0 1rem; }

:focus-visible {
  outline: 3px solid var(--brand-400);
  outline-offset: 2px;
  border-radius: 6px;
}

::selection { background: var(--brand-200); color: var(--ink-900); }

/* -------------------------------------------------------------------
   3. Layout helpers
   ------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: clamp(18px, 4vw, 40px);
}

.section { padding-block: clamp(56px, 8vw, 110px); }
.section--tight { padding-block: clamp(40px, 5vw, 64px); }
.section--alt { background: var(--surface); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: .8rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--brand-700);
  margin-bottom: 14px;
}

.section-head { max-width: 720px; margin: 0 auto clamp(36px, 5vw, 60px); text-align: center; }
.section-head p { color: var(--ink-500); font-size: 1.12rem; }

.lead { font-size: 1.18rem; color: var(--ink-600); }
.muted { color: var(--ink-500); }
.text-center { text-align: center; }

/* -------------------------------------------------------------------
   4. Buttons
   ------------------------------------------------------------------- */
.btn {
  --btn-bg: var(--brand-600);
  --btn-fg: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.02rem;
  line-height: 1;
  padding: 16px 26px;
  min-height: 56px;            /* generous touch target */
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: var(--btn-bg);
  color: var(--btn-fg);
  cursor: pointer;
  text-decoration: none;
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn--primary { box-shadow: var(--shadow-brand); }
.btn--primary:hover { background: var(--brand-700); }

.btn--secondary {
  --btn-bg: var(--surface);
  --btn-fg: var(--ink-800);
  border-color: var(--ink-200);
  box-shadow: var(--shadow-sm);
}
.btn--secondary:hover { --btn-bg: var(--ink-50); border-color: var(--ink-300); }

.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--brand-700);
}
.btn--ghost:hover { --btn-bg: var(--brand-50); }

.btn--danger { --btn-bg: var(--danger); }
.btn--danger:hover { --btn-bg: #b91c1c; }

.btn--lg { font-size: 1.12rem; padding: 18px 32px; min-height: 62px; }
.btn--block { width: 100%; }
.btn .ic { width: 20px; height: 20px; flex: none; }

/* -------------------------------------------------------------------
   5. Cards
   ------------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--ink-200);
  border-radius: var(--radius);
  padding: clamp(22px, 3vw, 32px);
  box-shadow: var(--shadow-sm);
}
.card--soft { background: var(--ink-50); border-color: transparent; box-shadow: none; }
.card--raised { box-shadow: var(--shadow-lg); }

/* -------------------------------------------------------------------
   6. Header / navigation
   ------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--ink-200);
}
.nav {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--ink-900);
  letter-spacing: -0.02em;
}
.brand:hover { text-decoration: none; }
.brand-mark { width: 38px; height: 38px; flex: none; }
.brand b { color: var(--brand-600); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  display: inline-block;
  padding: 10px 14px;
  border-radius: var(--radius-pill);
  color: var(--ink-700);
  font-weight: 500;
  transition: background .15s ease, color .15s ease;
}
.nav-links a:hover { background: var(--ink-100); color: var(--ink-900); text-decoration: none; }
.nav-links a[aria-current="page"] { color: var(--brand-700); background: var(--brand-50); }

.nav-cta { display: flex; align-items: center; gap: 12px; }
.lang-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 46px; height: 46px; padding: 0 12px;
  border: 1px solid var(--ink-200); background: var(--surface);
  border-radius: var(--radius-pill); font-family: var(--font-head); font-weight: 700;
  font-size: .85rem; color: var(--ink-700); cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.lang-toggle:hover { background: var(--ink-100); border-color: var(--ink-300); }

.nav-toggle {
  display: none;
  width: 48px; height: 48px;
  align-items: center; justify-content: center;
  border: 1px solid var(--ink-200);
  background: var(--surface);
  border-radius: 12px;
  cursor: pointer;
}
.nav-toggle svg { width: 24px; height: 24px; }

@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .nav-links {
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 14px clamp(18px, 4vw, 40px) 22px;
    background: var(--surface);
    border-bottom: 1px solid var(--ink-200);
    box-shadow: var(--shadow-lg);
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
  }
  .nav-links a { padding: 14px 16px; font-size: 1.08rem; }
  .site-header.open .nav-links { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .nav-cta .btn--desktop { display: none; }
}

/* -------------------------------------------------------------------
   7. Hero
   ------------------------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(1100px 480px at 78% -8%, var(--brand-100), transparent 60%),
    radial-gradient(760px 420px at 6% 10%, #eff6ff, transparent 55%),
    var(--ink-50);
}
.hero .container {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
  padding-block: clamp(56px, 8vw, 104px);
}
.hero h1 { margin-bottom: 18px; }
.hero h1 .grad {
  background: linear-gradient(120deg, var(--brand-600), var(--accent-600));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-lead { font-size: 1.22rem; color: var(--ink-600); max-width: 560px; margin-bottom: 28px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 26px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 22px; color: var(--ink-500); font-size: .98rem; }
.hero-meta span { display: inline-flex; align-items: center; gap: 8px; }
.hero-meta svg { width: 20px; height: 20px; color: var(--brand-600); }

/* Hero visual card */
.hero-visual {
  position: relative;
  background: linear-gradient(160deg, var(--brand-600), var(--brand-800));
  border-radius: var(--radius-lg);
  padding: 30px;
  color: #fff;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.hero-visual::after {
  content: "";
  position: absolute;
  inset: auto -40px -60px auto;
  width: 240px; height: 240px;
  background: radial-gradient(circle, rgba(255,255,255,.18), transparent 70%);
}
.hero-visual h3 { color: #fff; }
.hero-screen {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.22);
  border-radius: var(--radius);
  padding: 18px;
  backdrop-filter: blur(4px);
}
.hero-screen .scan {
  aspect-ratio: 16 / 11;
  border-radius: 12px;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,.05) 0 2px, transparent 2px 22px),
    linear-gradient(180deg, rgba(255,255,255,.16), rgba(255,255,255,.04));
  border: 1px dashed rgba(255,255,255,.35);
  display: grid;
  place-items: center;
  position: relative;
}
.hero-progress { height: 12px; border-radius: 999px; background: rgba(255,255,255,.22); margin-top: 16px; overflow: hidden; }
.hero-progress i { display: block; height: 100%; width: 68%; border-radius: 999px; background: var(--brand-200); }
.hero-screen .rep { display: flex; justify-content: space-between; margin-top: 12px; font-weight: 600; }

@media (max-width: 860px) {
  .hero .container { grid-template-columns: 1fr; }
  .hero-visual { order: -1; }
}

/* -------------------------------------------------------------------
   8. "How it works" steps
   ------------------------------------------------------------------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.step { position: relative; background: var(--surface); border: 1px solid var(--ink-200); border-radius: var(--radius); padding: 30px 26px; box-shadow: var(--shadow-sm); }
.step-num {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: var(--brand-50);
  color: var(--brand-700);
  font-family: var(--font-head); font-weight: 700; font-size: 1.3rem;
  margin-bottom: 16px;
}
.step h3 { margin-bottom: 8px; }
.step p { color: var(--ink-500); margin: 0; }
@media (max-width: 820px) { .steps { grid-template-columns: 1fr; } }

/* -------------------------------------------------------------------
   9. Feature grid
   ------------------------------------------------------------------- */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.feature { padding: 30px 26px; }
.feature-icon {
  width: 56px; height: 56px;
  display: grid; place-items: center;
  border-radius: 16px;
  background: linear-gradient(150deg, var(--brand-100), var(--brand-50));
  color: var(--brand-700);
  margin-bottom: 18px;
}
.feature-icon svg { width: 28px; height: 28px; }
.feature h3 { margin-bottom: 8px; }
.feature p { color: var(--ink-500); margin: 0; }
@media (max-width: 900px) { .features { grid-template-columns: 1fr; } }

/* -------------------------------------------------------------------
   10. Condition cards (library / supported conditions)
   ------------------------------------------------------------------- */
.conditions { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 22px; }
.condition {
  position: relative;
  display: flex; flex-direction: column;
  padding: 28px 26px;
}
.condition.is-soon { opacity: .92; }
.condition-top { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.condition-icon {
  width: 52px; height: 52px; flex: none;
  display: grid; place-items: center;
  border-radius: 14px;
  background: var(--brand-50); color: var(--brand-700);
}
.condition-icon svg { width: 28px; height: 28px; }
.condition h3 { margin: 0; font-size: 1.25rem; }
.condition p { color: var(--ink-500); flex: 1; }
.condition .btn { margin-top: 18px; }

/* Exercise library rows */
.ex-groups { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px 40px; }
.ex-group h3 { font-size: 1.1rem; margin-bottom: 10px; }
.ex-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.ex-rows li {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 4px; border-bottom: 1px solid var(--ink-100);
  color: var(--ink-700);
}
.ex-rows li:last-child { border-bottom: 0; }
.ex-target {
  font-family: var(--font-head); font-weight: 600; font-size: .82rem;
  color: var(--brand-700); background: var(--brand-50);
  padding: 4px 10px; border-radius: var(--radius-pill); white-space: nowrap;
}
/* detailed library rows with rationale */
.ex-rows.detailed li { align-items: flex-start; padding: 15px 4px; gap: 18px; }
.ex-info { display: flex; flex-direction: column; gap: 4px; }
.ex-why { color: var(--ink-500); font-size: .92rem; line-height: 1.55; }
.sources { margin-top: 20px; }
.sources-label {
  font-family: var(--font-head); font-weight: 600; font-size: .78rem;
  letter-spacing: .1em; text-transform: uppercase; color: var(--ink-500);
}
.sources ul { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 7px; }
.sources li { position: relative; padding-left: 18px; }
.sources li::before { content: "›"; position: absolute; left: 4px; color: var(--brand-500); font-weight: 700; }
.sources a { font-size: .92rem; }
@media (max-width: 700px) { .ex-groups { grid-template-columns: 1fr; gap: 22px; } }
@media (max-width: 820px) { .tech-split { grid-template-columns: 1fr !important; } }

/* -------------------------------------------------------------------
   11. Badges / pills
   ------------------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-head); font-weight: 600; font-size: .76rem;
  letter-spacing: .04em; text-transform: uppercase;
  padding: 5px 12px; border-radius: var(--radius-pill);
}
.badge--ok { background: var(--success-bg); color: #166534; }
.badge--soon { background: var(--ink-100); color: var(--ink-500); }
.badge--brand { background: var(--brand-100); color: var(--brand-800); }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* -------------------------------------------------------------------
   12. Forms (setup page)
   ------------------------------------------------------------------- */
.form-shell {
  max-width: 620px;
  margin-inline: auto;
}
.form-grid { display: grid; gap: 22px; }
.field { display: grid; gap: 9px; }
.field > label, .field-label {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.04rem;
  color: var(--ink-800);
}
.field .help { font-size: .92rem; color: var(--ink-500); margin: 0; }

.input, .select {
  width: 100%;
  font: inherit;
  font-size: 1.08rem;
  padding: 15px 16px;
  min-height: 58px;
  color: var(--ink-900);
  background: var(--surface);
  border: 1.5px solid var(--ink-300);
  border-radius: var(--radius-sm);
  transition: border-color .15s ease, box-shadow .15s ease;
  appearance: none;
}
.input::placeholder { color: var(--ink-400); }
.input:focus, .select:focus {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: 0 0 0 4px var(--brand-100);
}
.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 48px;
}

/* Segmented choice (gender) */
.choice-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.choice {
  position: relative;
}
.choice input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.choice span {
  display: flex; align-items: center; justify-content: center;
  min-height: 58px; padding: 12px;
  border: 1.5px solid var(--ink-300);
  border-radius: var(--radius-sm);
  font-weight: 600; color: var(--ink-700);
  background: var(--surface);
  transition: all .15s ease;
  cursor: pointer;
}
.choice input:hover + span { border-color: var(--brand-400); }
.choice input:checked + span {
  border-color: var(--brand-600);
  background: var(--brand-50);
  color: var(--brand-800);
  box-shadow: 0 0 0 3px var(--brand-100);
}
.choice input:focus-visible + span { outline: 3px solid var(--brand-400); outline-offset: 2px; }
@media (max-width: 480px) { .choice-row { grid-template-columns: 1fr; } }

.form-note {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--brand-50);
  border: 1px solid var(--brand-100);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  color: var(--brand-900);
  font-size: .96rem;
}
.form-note svg { width: 22px; height: 22px; color: var(--brand-600); flex: none; margin-top: 2px; }

/* -------------------------------------------------------------------
   13. Notice / alert
   ------------------------------------------------------------------- */
.notice {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 16px 18px; border-radius: var(--radius);
  border: 1px solid var(--ink-200); background: var(--surface);
}
.notice svg { width: 24px; height: 24px; flex: none; }
.notice--warn { background: var(--warning-bg); border-color: #fcd9a3; color: #7c4a03; }
.notice--warn svg { color: var(--warning); }
.notice--danger { background: var(--danger-bg); border-color: #fbb4b4; color: #991b1b; }
.notice--danger svg { color: var(--danger); }

/* -------------------------------------------------------------------
   14. Footer
   ------------------------------------------------------------------- */
.site-footer {
  background: var(--ink-900);
  color: var(--ink-300);
  padding-block: clamp(48px, 7vw, 72px) 28px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 40px;
}
.footer-brand .brand { color: #fff; margin-bottom: 14px; }
.footer-brand .brand b { color: var(--brand-300); }
.footer-brand p { color: var(--ink-400); max-width: 340px; }
.footer-col h4 { color: #fff; font-family: var(--font-head); font-size: 1rem; margin-bottom: 14px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer-col a { color: var(--ink-300); }
.footer-col a:hover { color: #fff; }
.footer-bottom {
  margin-top: 40px; padding-top: 22px;
  border-top: 1px solid rgba(255,255,255,.1);
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between;
  font-size: .9rem; color: var(--ink-400);
}
.footer-disclaimer {
  margin-top: 18px;
  font-size: .85rem; color: var(--ink-500); line-height: 1.6;
  max-width: 760px;
}
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; gap: 28px; } }

/* -------------------------------------------------------------------
   15. Exercise session screen
   ------------------------------------------------------------------- */
.session {
  background:
    radial-gradient(900px 380px at 85% -10%, var(--brand-100), transparent 60%),
    var(--ink-50);
  min-height: calc(100vh - var(--nav-h));
}
.session .container { padding-block: clamp(28px, 4vw, 48px); }

.session-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.session-head h1 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin: 0; }
.session-status { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.session-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr);
  gap: 24px;
  align-items: start;
}
@media (max-width: 980px) { .session-grid { grid-template-columns: 1fr; } }

/* Camera stage — overlay canvas on top of video */
.stage {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #0b1220;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--ink-200);
}
.stage #video, .stage #overlay {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  transform: scaleX(-1);   /* natural selfie / mirror view */
}
.stage #overlay { z-index: 2; }
.stage-empty {
  position: absolute; inset: 0; z-index: 3;
  display: grid; place-content: center; justify-items: center;
  gap: 14px; text-align: center; padding: 24px;
  color: #cbd5e1;
}
.stage-empty svg { width: 56px; height: 56px; color: var(--brand-300); }
.stage.is-live .stage-empty { display: none; }

.pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-head); font-weight: 600; font-size: .9rem;
  padding: 8px 14px; border-radius: var(--radius-pill);
  background: var(--surface); border: 1px solid var(--ink-200); color: var(--ink-700);
}
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pill.ok    { background: var(--success-bg); color: #166534; border-color: #bbf7d0; }
.pill.warn  { background: var(--warning-bg); color: #92400e; border-color: #fde2a3; }
.pill.bad   { background: var(--danger-bg);  color: #991b1b; border-color: #fbb4b4; }
.pill-btn   { cursor: pointer; font: inherit; font-family: var(--font-head); }
.pill-btn[aria-pressed="false"] { opacity: .5; }

/* Panel */
.panel { display: grid; gap: 18px; }
.panel .card { padding: 22px; }
.now-ex { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.now-ex .label { font-size: .82rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-500); font-weight: 600; }
.now-ex .name { font-family: var(--font-head); font-weight: 700; font-size: 1.45rem; color: var(--brand-700); }

.progress { height: 14px; background: var(--ink-100); border-radius: 999px; overflow: hidden; margin: 12px 0; }
.progress .bar { height: 100%; width: 0%; border-radius: 999px; background: linear-gradient(90deg, var(--brand-500), var(--brand-700)); transition: width .25s ease; }

.rep-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rep-count { font-family: var(--font-head); font-weight: 700; font-size: 1.1rem; }
.rep-count b { font-size: 1.5rem; color: var(--ink-900); }
.hint { color: var(--ink-500); font-size: .96rem; margin-top: 8px; }

.plan-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.plan-list li {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: 10px;
  color: var(--ink-600); font-weight: 500;
}
.plan-list li .tick {
  width: 24px; height: 24px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%; border: 2px solid var(--ink-300);
  font-size: .8rem; color: transparent;
}
.plan-list li.done { color: var(--ink-500); }
.plan-list li.done .tick { background: var(--success); border-color: var(--success); color: #fff; }
.plan-list li.active { background: var(--brand-50); color: var(--brand-900); font-weight: 600; }
.plan-list li.active .tick { border-color: var(--brand-500); }
.plan-list li .ex-target { margin-left: auto; font-size: .85rem; color: var(--ink-400); font-weight: 500; }

.hands-state { display: flex; flex-wrap: wrap; gap: 10px; }
.state-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 10px;
  background: var(--ink-50); border: 1px solid var(--ink-200);
  font-size: .92rem;
}
.state-chip b { color: var(--ink-800); }
.state-chip.is-on { background: var(--success-bg); border-color: #bbf7d0; color: #166534; }
.state-chip.is-on b { color: #166534; }
.state-chip.warn { background: var(--warning-bg); border-color: #fde2a3; color: #92400e; }

.diag { white-space: pre-wrap; font-size: .82rem; color: var(--ink-400); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* -------------------------------------------------------------------
   16. Simple message page (error / 404 / stopped)
   ------------------------------------------------------------------- */
.msg-page {
  min-height: calc(100vh - var(--nav-h));
  display: grid; place-items: center;
  padding: clamp(40px, 8vw, 90px) 0;
}
.msg-card { max-width: 560px; text-align: center; }
.msg-icon {
  width: 80px; height: 80px; margin: 0 auto 20px;
  display: grid; place-items: center; border-radius: 24px;
}
.msg-icon svg { width: 42px; height: 42px; }
.msg-icon.warn { background: var(--warning-bg); color: var(--warning); }
.msg-icon.brand { background: var(--brand-50); color: var(--brand-600); }
.msg-card .actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 26px; }

/* -------------------------------------------------------------------
   17. Utilities
   ------------------------------------------------------------------- */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.stack-sm { display: grid; gap: 10px; }
.divider { height: 1px; background: var(--ink-200); border: 0; margin: 4px 0; }

/* -------------------------------------------------------------------
   18. Movement-quality report
   ------------------------------------------------------------------- */
.report { margin-top: 28px; scroll-margin-top: calc(var(--nav-h) + 16px); }
.report-card { padding: clamp(22px, 3vw, 34px); }
.report-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.score-badge {
  flex: none; width: 92px; height: 92px; border-radius: 50%;
  display: grid; place-content: center; text-align: center; line-height: 1.05;
  background: linear-gradient(160deg, var(--brand-500), var(--brand-700));
  color: #fff; box-shadow: var(--shadow-brand);
}
.score-badge b { font-family: var(--font-head); font-size: 1.9rem; }
.score-badge span { font-size: .78rem; opacity: .85; }

.report-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.tile { background: var(--ink-50); border: 1px solid var(--ink-200); border-radius: var(--radius-sm); padding: 16px; text-align: center; }
.tile-val { display: block; font-family: var(--font-head); font-weight: 700; font-size: 1.35rem; color: var(--ink-900); }
.tile-lab { display: block; font-size: .82rem; color: var(--ink-500); margin-top: 4px; }
@media (max-width: 640px) { .report-tiles { grid-template-columns: repeat(2, 1fr); } }

.report-h { margin: 24px 0 10px; font-size: 1.1rem; }
.report-rows { border: 1px solid var(--ink-200); border-radius: var(--radius-sm); overflow: hidden; }
.rrow { display: grid; grid-template-columns: 2fr 1fr 1.1fr 1.2fr 1.2fr; gap: 10px; padding: 12px 14px; align-items: center; border-bottom: 1px solid var(--ink-100); font-size: .92rem; }
.rrow:last-child { border-bottom: 0; }
.rrow-head { background: var(--ink-50); font-family: var(--font-head); font-weight: 600; font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-500); }
.rrow-name { font-weight: 600; color: var(--ink-800); }
.rrow-cell { color: var(--ink-600); }
.rrow-cell.is-flag { color: var(--warning); font-weight: 600; }
@media (max-width: 640px) {
  .rrow { grid-template-columns: 1fr 1fr; }
  .rrow-head { display: none; }
  .rrow-name { grid-column: 1 / -1; }
}

.report-notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.note { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); font-size: .95rem; line-height: 1.5; }
.note-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; flex: none; }
.note--good { background: var(--success-bg); color: #166534; } .note--good .note-dot { background: #16a34a; }
.note--warn { background: var(--warning-bg); color: #7c4a03; } .note--warn .note-dot { background: var(--warning); }
.note--info { background: var(--brand-50); color: var(--brand-900); } .note--info .note-dot { background: var(--brand-500); }
.report-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }

/* Progress dashboard charts */
.charts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 860px) { .charts-grid { grid-template-columns: 1fr; } }
.chart-card { padding: 18px; }
.chart-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.chart-label { font-family: var(--font-head); font-weight: 600; font-size: .92rem; color: var(--ink-600); }
.chart-last { font-family: var(--font-head); font-weight: 700; font-size: 1.15rem; color: var(--ink-900); }
.chart { width: 100%; height: auto; display: block; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
