/* ============================================================
   SCI — Force & Deceleration Profile Dashboard
   force-deceleration-dashboard.css
   Brand: SCI Red #9E1B32 · SCI Gold #D4A017
  Aesthetic: light-first, clinical, premium sports-science.
   Standalone — no external base CSS required.
   ============================================================ */

/* ── Reset + Tokens ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* SCI Brand */
  --sci-red:        #9E1B32;
  --sci-red-hover:  #7d1527;
  --sci-red-dark:   #5e0f1d;
  --sci-gold:       #D4A017;
  --sci-gold-light: #e8b93e;
  --sci-gold-faint: rgba(212,160,23,0.12);
  --sci-gold-glow:  rgba(212,160,23,0.20);

  /* Dashboard surfaces (light) */
  --dash-bg:        #f4f5f7;
  --dash-surface:   #ffffff;
  --dash-surface-2: #f8f9fb;
  --dash-surface-3: #eef1f5;
  --dash-border:    #e1e5eb;
  --dash-divider:   #e6e9ef;
  --dash-hover:     #f0f2f6;

  /* Status */
  --status-pass:    #22c55e;
  --status-pass-bg: rgba(34,197,94,0.10);
  --status-warn:    #f59e0b;
  --status-warn-bg: rgba(245,158,11,0.10);
  --status-fail:    #ef4444;
  --status-fail-bg: rgba(239,68,68,0.10);
  --status-neutral: #6b7280;

  /* Text */
  --text-primary:   #111827;
  --text-secondary: #4b5563;
  --text-muted:     #8b95a5;
  --text-inverse:   #ffffff;

  /* Type */
  --font-display: 'Cormorant Garamond', 'Palatino Linotype', Georgia, serif;
  --font-body:    'Inter', 'Helvetica Neue', Arial, sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

  /* Type scale */
  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.375rem;
  --text-2xl:  1.75rem;
  --text-3xl:  2.25rem;

  /* Spacing */
  --space-1: 0.25rem;  --space-2: 0.5rem;   --space-3: 0.75rem;
  --space-4: 1rem;     --space-5: 1.25rem;  --space-6: 1.5rem;
  --space-8: 2rem;     --space-10: 2.5rem;  --space-12: 3rem;
  --space-16: 4rem;

  /* Radius */
  --r-sm:   4px;
  --r-md:   8px;
  --r-lg:   12px;
  --r-xl:   16px;
  --r-full: 9999px;

  /* Shadows */
  --shadow-card: 0 1px 2px rgba(16,24,40,0.06), 0 6px 18px rgba(16,24,40,0.06);
  --shadow-lg:   0 10px 30px rgba(16,24,40,0.12);

  /* Transitions */
  --tx: 180ms cubic-bezier(0.16,1,0.3,1);
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  background: linear-gradient(180deg, #f8f9fb 0%, #f4f5f7 100%);
  color: var(--text-primary);
  min-height: 100dvh;
  line-height: 1.6;
}

/* ── Dashboard Shell ── */
.dash-shell {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 100dvh;
}

/* ── Top Bar ── */
.dash-topbar {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(14,15,18,0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding: 0 var(--space-6);
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  flex-shrink: 0;
}
.topbar-brand__mark { width: 34px; height: 34px; flex-shrink: 0; }
.topbar-brand__wordmark {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.topbar-brand__sci {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: var(--text-sm);
  color: #ffffff;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.topbar-brand__sub {
  font-size: 0.65rem;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar-center { display: flex; align-items: center; gap: var(--space-2); }
.topbar-pill {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: var(--r-full);
  padding: var(--space-1) var(--space-4);
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.75);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
}
.topbar-pill__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sci-gold);
  animation: pulse-dot 2.5s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.topbar-actions { display: flex; align-items: center; gap: var(--space-3); flex-shrink: 0; }

/* ── Main Content ── */
.dash-main {
  padding: var(--space-8) var(--space-6);
  max-width: 1360px;
  margin-inline: auto;
  width: 100%;
}

/* ── Section header ── */
.dash-section { margin-bottom: var(--space-8); }
.dash-section + .dash-section {
  padding-top: var(--space-8);
  border-top: 1px solid var(--dash-divider);
}
.dash-section-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}
.dash-section-eyebrow {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sci-gold);
}
.dash-section-eyebrow::before {
  content: '';
  display: block;
  width: 16px;
  height: 2px;
  background: var(--sci-gold);
  flex-shrink: 0;
}
.dash-section-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}
.dash-section-rule {
  flex: 1;
  height: 1px;
  background: var(--dash-border);
  margin-left: var(--space-4);
}

/* ── Card Base ── */
.card {
  background: var(--dash-surface);
  border: 1px solid var(--dash-border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-card);
  transition: border-color var(--tx), box-shadow var(--tx);
}
.card:hover { border-color: #cfd5df; }
.card--highlight { border-color: rgba(212,160,23,0.3); }
.card--mb { margin-bottom: var(--space-6); }

.card-header {
  padding: var(--space-5) var(--space-6);
  background: #f8f9fb;
  border-bottom: 1px solid var(--dash-divider);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.card-title {
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.card-title--gold { color: var(--sci-gold); }
.card-subtle {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: none;
}
.card-body { padding: var(--space-6); }
.card-body--sm { padding: var(--space-4) var(--space-5); }

.helper-text {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-3);
  line-height: 1.5;
  font-style: italic;
}

/* ── Patient Header ── */
.patient-header {
  background: #ffffff;
  border: 1px solid var(--dash-border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-card);
  padding: var(--space-6) var(--space-8);
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
  align-items: center;
  margin-bottom: var(--space-8);
  position: relative;
  overflow: hidden;
}
.patient-header::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--sci-red) 0%, var(--sci-gold) 100%);
  border-radius: var(--r-sm) 0 0 var(--r-sm);
}
.patient-fields {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6);
  padding-left: var(--space-4);
}
.patient-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 140px;
}
.patient-field label {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.patient-field input,
.patient-field select {
  background: #ffffff;
  border: 1px solid #d7dce3;
  border-radius: var(--r-md);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  transition: border-color var(--tx), box-shadow var(--tx);
  -webkit-appearance: none;
  appearance: none;
}
.patient-field input:focus,
.patient-field select:focus {
  outline: none;
  border-color: var(--sci-red);
  box-shadow: 0 0 0 3px rgba(158,27,50,0.10);
}
.patient-field--wide input { min-width: 200px; }

/* ── Tabs ── */
.dash-tabs {
  display: flex;
  gap: 2px;
  background: #ffffff;
  border: 1px solid var(--dash-border);
  box-shadow: var(--shadow-card);
  border-radius: var(--r-lg);
  padding: 4px;
  margin-bottom: var(--space-8);
  width: fit-content;
  flex-wrap: wrap;
}
.dash-tab {
  padding: var(--space-2) var(--space-5);
  border-radius: calc(var(--r-lg) - 2px);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  border: none;
  background: transparent;
  transition: background var(--tx), color var(--tx);
  white-space: nowrap;
  font-family: var(--font-body);
}
.dash-tab:hover { background: #f1f3f6; color: var(--text-primary); }
.dash-tab.active {
  background: var(--sci-red);
  color: #fff;
  box-shadow: 0 2px 8px rgba(158,27,50,0.4);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-5);
  border-radius: var(--r-md);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background var(--tx), box-shadow var(--tx), transform var(--tx);
  text-decoration: none;
  font-family: var(--font-body);
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn--primary {
  background: var(--sci-red);
  color: #fff;
  box-shadow: 0 2px 8px rgba(158,27,50,0.35);
}
.btn--primary:hover {
  background: var(--sci-red-hover);
  box-shadow: 0 4px 16px rgba(158,27,50,0.45);
}
.btn--gold {
  background: var(--sci-gold);
  color: var(--text-inverse);
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(212,160,23,0.3);
}
.btn--gold:hover {
  background: var(--sci-gold-light);
  box-shadow: 0 4px 16px rgba(212,160,23,0.4);
}
.btn--ghost {
  background: var(--dash-surface-2);
  color: var(--text-secondary);
  border: 1px solid var(--dash-border);
}
.btn--ghost:hover { background: var(--dash-hover); color: var(--text-primary); }
.dash-topbar .btn--ghost {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.82);
  border: 1px solid rgba(255,255,255,0.14);
}
.dash-topbar .btn--ghost:hover {
  background: rgba(255,255,255,0.14);
  color: #ffffff;
}
.btn--sm { padding: var(--space-1) var(--space-3); font-size: var(--text-xs); }
.btn--lg { padding: var(--space-3) var(--space-8); font-size: var(--text-base); }

/* ──────────────────────────────────────────────────
   FORCE & DECELERATION-SPECIFIC COMPONENTS
   ────────────────────────────────────────────────── */

/* ── Trial input table ── */
.trials-table-wrapper { overflow-x: auto; }
.trials-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--text-sm);
  min-width: 640px;
}
.trials-table thead th {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #667085;
  text-align: left;
  border-bottom: 1px solid var(--dash-border);
  background: #eef1f5;
  white-space: nowrap;
}
.trials-table thead th:first-child { border-radius: var(--r-sm) 0 0 0; min-width: 200px; }
.trials-table thead th:last-child  { border-radius: 0 var(--r-sm) 0 0; text-align: center; }
.trials-table thead th.col-trial { text-align: center; width: 90px; }
.trials-table thead th.col-median { text-align: center; width: 100px; color: var(--sci-gold); }
.trials-table tbody tr { transition: background var(--tx); }
.trials-table tbody tr:hover { background: #f8f9fb; }
.trials-table tbody td {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--dash-divider);
  color: var(--text-primary);
  vertical-align: middle;
}
.trials-table tbody td:first-child {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: var(--text-sm);
}
.trials-table .metric-name { display: flex; flex-direction: column; gap: 2px; }
.trials-table .metric-name__unit {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.trials-table input[type="number"] {
  width: 76px;
  background: #ffffff;
  border: 1px solid #d7dce3;
  border-radius: var(--r-sm);
  padding: 5px 8px;
  font-size: var(--text-sm);
  color: var(--text-primary);
  font-family: var(--font-mono);
  text-align: center;
  transition: border-color var(--tx), box-shadow var(--tx);
  -moz-appearance: textfield;
}
.trials-table input[type="number"]::-webkit-inner-spin-button,
.trials-table input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; }
.trials-table input[type="number"]:focus {
  outline: none;
  border-color: var(--sci-red);
  box-shadow: 0 0 0 3px rgba(158,27,50,0.10);
}
.trials-table .median-cell {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--sci-gold);
  text-align: center;
  font-size: var(--text-sm);
}

/* Section subdivider inside a trials table */
.trials-table tbody tr.row-divider td {
  background: #f1f3f6;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sci-red);
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--dash-border);
}

/* ── Limb-split row (R / L) ── */
.row-rl td:first-child { padding-left: var(--space-6); position: relative; }
.row-rl td:first-child::before {
  content: '';
  position: absolute;
  left: var(--space-3);
  top: 50%;
  width: 8px;
  height: 1px;
  background: var(--dash-border);
}
.side-tag {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  padding: 2px 6px;
  border-radius: var(--r-sm);
  margin-right: var(--space-2);
}
.side-tag--R { background: rgba(158,27,50,0.18); color: #f87171; border: 1px solid rgba(158,27,50,0.35); }
.side-tag--L { background: rgba(212,160,23,0.15); color: var(--sci-gold); border: 1px solid rgba(212,160,23,0.3); }

/* ── Results grid / stat cards ── */
.results-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}
@media (max-width: 1100px) { .results-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 540px)  { .results-grid { grid-template-columns: 1fr; } }

.stat-card {
  background: #ffffff;
  border: 1px solid var(--dash-border);
  border-radius: var(--r-lg);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  transition: border-color var(--tx);
}
.stat-card--pass { border-color: rgba(34,197,94,0.35); background: rgba(34,197,94,0.06); }
.stat-card--warn { border-color: rgba(245,158,11,0.35); background: rgba(245,158,11,0.07); }
.stat-card--fail { border-color: rgba(239,68,68,0.35); background: rgba(239,68,68,0.07); }
.stat-card--gold { border-color: rgba(212,160,23,0.35); background: rgba(212,160,23,0.08); }

.stat-card__label {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.stat-card__value {
  font-family: var(--font-mono);
  font-size: var(--text-2xl);
  font-weight: 700;
  line-height: 1;
  color: var(--text-primary);
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.stat-card__value--pass { color: var(--status-pass); }
.stat-card__value--warn { color: var(--status-warn); }
.stat-card__value--fail { color: var(--status-fail); }
.stat-card__value--gold { color: var(--sci-gold); }
.stat-card__suffix {
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-weight: 500;
}
.stat-card__sub {
  font-size: var(--text-xs);
  color: var(--text-muted);
}
.stat-card__badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: var(--r-full);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  width: fit-content;
}
.stat-card__badge--pass { background: var(--status-pass-bg); color: var(--status-pass); }
.stat-card__badge--warn { background: var(--status-warn-bg); color: var(--status-warn); }
.stat-card__badge--fail { background: var(--status-fail-bg); color: var(--status-fail); }
.stat-card__badge--gold { background: var(--sci-gold-faint); color: var(--sci-gold); }
.stat-card__badge--neutral { background: rgba(107,114,128,0.15); color: var(--status-neutral); }

/* ── Score progress strip on stat cards ── */
.stat-card__bar {
  margin-top: var(--space-2);
  background: #e9edf3;
  border-radius: var(--r-full);
  height: 6px;
  overflow: hidden;
}
.stat-card__bar-fill {
  height: 100%;
  border-radius: var(--r-full);
  transition: width 0.8s cubic-bezier(0.16,1,0.3,1), background 0.4s;
}
.stat-card__bar-fill--pass { background: linear-gradient(90deg, var(--status-pass), #16a34a); }
.stat-card__bar-fill--warn { background: linear-gradient(90deg, var(--status-warn), #d97706); }
.stat-card__bar-fill--fail { background: linear-gradient(90deg, var(--status-fail), #dc2626); }
.stat-card__bar-fill--gold { background: linear-gradient(90deg, var(--sci-gold), var(--sci-gold-light)); }

/* ── Risk / Interpretation Banner ── */
.risk-banner {
  border-radius: var(--r-lg);
  padding: var(--space-5) var(--space-6);
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}
.risk-banner--none { background: #ffffff; border: 1px solid var(--dash-border); }
.risk-banner--low  { background: rgba(34,197,94,0.08); border: 1px solid rgba(34,197,94,0.28); }
.risk-banner--mod  { background: rgba(245,158,11,0.09); border: 1px solid rgba(245,158,11,0.32); }
.risk-banner--high { background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.32); }
.risk-icon {
  width: 40px; height: 40px;
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.risk-icon--low  { background: rgba(34,197,94,0.15); }
.risk-icon--mod  { background: rgba(245,158,11,0.15); }
.risk-icon--high { background: rgba(239,68,68,0.15); }
.risk-icon--none { background: var(--dash-surface-3); }
.risk-content__title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-1);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.risk-content__text {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 80ch;
}

/* ── Archetype card ── */
.archetype-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fb 100%);
  border: 1px solid var(--dash-border);
  box-shadow: var(--shadow-card);
  border-radius: var(--r-xl);
  padding: var(--space-6) var(--space-8);
  margin-bottom: var(--space-6);
  position: relative;
  overflow: hidden;
}
.archetype-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--sci-red) 0%, var(--sci-gold) 100%);
}
.archetype-card__eyebrow {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sci-gold);
  margin-bottom: var(--space-2);
}
.archetype-card__name {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.15;
  margin-bottom: var(--space-3);
}
.archetype-card__desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 78ch;
}
.archetype-card__limiter {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-4);
  padding: var(--space-2) var(--space-4);
  background: var(--dash-surface-3);
  border: 1px solid var(--dash-border);
  border-radius: var(--r-full);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sci-gold);
}
.archetype-card__limiter::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sci-gold);
}

/* ── Asymmetry bars ── */
.asym-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--dash-divider);
}
.asym-row:last-child { border-bottom: none; }
.asym-label {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
  width: 220px;
  flex-shrink: 0;
}
.asym-track {
  flex: 1;
  height: 8px;
  background: #e9edf3;
  border-radius: var(--r-full);
  overflow: hidden;
  position: relative;
}
.asym-fill {
  height: 100%;
  border-radius: var(--r-full);
  transition: width 0.6s cubic-bezier(0.16,1,0.3,1), background 0.4s;
}
.asym-fill--pass { background: linear-gradient(90deg, var(--status-pass), #16a34a); }
.asym-fill--warn { background: linear-gradient(90deg, var(--status-warn), #d97706); }
.asym-fill--fail { background: linear-gradient(90deg, var(--status-fail), #dc2626); }
.asym-value {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  width: 56px;
  text-align: right;
  flex-shrink: 0;
}
.asym-value--pass { color: var(--status-pass); }
.asym-value--warn { color: var(--status-warn); }
.asym-value--fail { color: var(--status-fail); }
.asym-side {
  font-size: var(--text-xs);
  color: var(--text-muted);
  width: 84px;
  text-align: right;
  flex-shrink: 0;
  font-family: var(--font-mono);
}

@media (max-width: 720px) {
  .asym-label { width: 130px; }
  .asym-side  { display: none; }
}

/* ── Asymmetry interpretation cards (3-col) ── */
.asym-explain-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  margin-top: var(--space-6);
}
@media (max-width: 1000px) { .asym-explain-grid { grid-template-columns: 1fr; } }

.explain-card {
  background: #ffffff;
  border: 1px solid var(--dash-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.explain-card__title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--sci-gold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.explain-card__row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.explain-card__row-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.explain-card__row-text {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ── Basketball Application cards ── */
.app-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}
@media (max-width: 900px) { .app-grid { grid-template-columns: 1fr; } }

.app-card {
  background: #ffffff;
  border: 1px solid var(--dash-border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: border-color var(--tx), box-shadow var(--tx);
}
.app-card:hover { box-shadow: var(--shadow-lg); border-color: #363947; }
.app-card--pass { border-color: rgba(34,197,94,0.30); }
.app-card--warn { border-color: rgba(245,158,11,0.30); }
.app-card--fail { border-color: rgba(239,68,68,0.30); }
.app-card--gold { border-color: rgba(212,160,23,0.30); }

.app-card__header {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--dash-divider);
  background: #f8f9fb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.app-card__title-block {
  display: flex; align-items: center; gap: var(--space-3);
}
.app-card__icon {
  width: 32px; height: 32px;
  border-radius: var(--r-md);
  background: var(--dash-surface-3);
  display: flex; align-items: center; justify-content: center;
  color: var(--sci-gold);
  flex-shrink: 0;
}
.app-card__title {
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--text-primary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.app-card__body { padding: var(--space-5); }

.app-card__metrics {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.metric-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  background: var(--dash-surface-3);
  border: 1px solid var(--dash-border);
  color: var(--text-secondary);
}

.app-card__interpretation {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.65;
}

/* Court Translation Box */
.court-box {
  margin-top: var(--space-6);
  background: linear-gradient(135deg, rgba(158,27,50,0.06) 0%, rgba(212,160,23,0.08) 100%);
  border: 1px solid rgba(212,160,23,0.35);
  border-radius: var(--r-xl);
  padding: var(--space-6) var(--space-8);
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: var(--space-6);
}
.court-box__icon {
  width: 56px; height: 56px;
  border-radius: var(--r-lg);
  background: var(--sci-red);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(158,27,50,0.4);
  flex-shrink: 0;
}
.court-box__content { display: flex; flex-direction: column; gap: var(--space-1); }
.court-box__eyebrow {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sci-gold);
}
.court-box__text {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
}
@media (max-width: 640px) {
  .court-box { grid-template-columns: 1fr; }
}

/* ── Notes textareas ── */
.notes-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}
@media (max-width: 900px) { .notes-grid { grid-template-columns: 1fr; } }

.notes-block {
  background: #ffffff;
  border: 1px solid var(--dash-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.notes-block__label {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sci-gold);
}
.notes-textarea {
  width: 100%;
  background: #ffffff;
  border: 1px solid #d7dce3;
  border-radius: var(--r-md);
  padding: var(--space-4);
  font-size: var(--text-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  resize: vertical;
  min-height: 110px;
  line-height: 1.6;
  transition: border-color var(--tx), box-shadow var(--tx);
}
.notes-textarea:focus {
  outline: none;
  border-color: var(--sci-red);
  box-shadow: 0 0 0 3px rgba(158,27,50,0.10);
}
.notes-textarea::placeholder { color: var(--text-muted); }

/* ── References ── */
.ref-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}
@media (max-width: 900px) { .ref-grid { grid-template-columns: 1fr; } }

.ref-card {
  background: #ffffff;
  border: 1px solid var(--dash-border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-card);
  padding: var(--space-4) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.ref-card__topic {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sci-gold);
}
.ref-card__text {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.55;
}

.disclaimer-banner {
  margin-top: var(--space-6);
  padding: var(--space-5) var(--space-6);
  background: var(--dash-surface-2);
  border: 1px solid var(--dash-border);
  border-left: 3px solid var(--sci-gold);
  border-radius: var(--r-md);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.6;
  font-style: italic;
}

/* ── Footer ── */
.dash-footer {
  border-top: 1px solid var(--dash-divider);
  padding: var(--space-5) var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-12);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.card,
.stat-card,
.explain-card,
.app-card,
.notes-block,
.ref-card {
  background: #ffffff;
  border: 1px solid var(--dash-border);
  box-shadow: var(--shadow-card);
}

.card-header,
.app-card__header {
  background: #f8f9fb;
  border-bottom: 1px solid var(--dash-divider);
}
.dash-footer a { color: var(--sci-gold); text-decoration: none; }
.dash-footer a:hover { text-decoration: underline; }

/* ── Visibility helpers ── */
.hidden { display: none !important; }
.divider {
  height: 1px;
  background: var(--dash-divider);
  margin-block: var(--space-6);
}

/* ── Action row (CTA) ── */
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
  margin-top: var(--space-6);
}
.action-row .spacer { flex: 1; }

/* ──────────────────────────────────────────────────
   PRINT
   ────────────────────────────────────────────────── */
@media print {
  body { background: #fff; color: #000; }
  .dash-topbar, .dash-tabs, .topbar-actions, .btn { display: none !important; }
  .tab-panel { display: block !important; page-break-inside: avoid; margin-bottom: 1.5rem; }
  .dash-main { padding: 1rem; max-width: 100%; }
  .card, .stat-card, .app-card, .archetype-card,
  .notes-block, .ref-card, .risk-banner, .court-box, .explain-card {
    background: #fff !important;
    border: 1px solid #ccc !important;
    color: #000 !important;
    box-shadow: none !important;
    page-break-inside: avoid;
  }
  .stat-card__value, .median-cell, .archetype-card__name,
  .court-box__text, .card-title, .stat-card__label, .dash-section-title {
    color: #000 !important;
  }
  .dash-section-eyebrow, .archetype-card__eyebrow,
  .court-box__eyebrow, .ref-card__topic,
  .notes-block__label, .explain-card__title { color: var(--sci-red) !important; }
  .asym-track { background: #eee !important; }
  .dash-footer { color: #555 !important; border-top: 1px solid #ccc; }
  .dash-footer a { color: var(--sci-red) !important; }
  input, select, textarea {
    background: #fff !important;
    color: #000 !important;
    border: 1px solid #ccc !important;
  }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Mobile shell tweaks ── */
@media (max-width: 640px) {
  .dash-main { padding: var(--space-5) var(--space-4); }
  .patient-fields { gap: var(--space-4); }
  .results-grid { grid-template-columns: 1fr 1fr; }
  .topbar-center { display: none; }
}
