/* Santé Tracker — design tokens */

/* ================== LIGHT MODE (default) — motivational, warm, energetic ================== */
:root {
  /* Canvas: warm cream, sunrise feel */
  --canvas: #fbf6ed;
  --canvas-raised: #ffffff;
  --canvas-deep: #f5ecdc;

  /* Surface: soft cream with visible presence */
  --surface-grad-top: #ffffff;
  --surface-grad-bot: #fffaf0;
  --surface-border: #e8dcc3;
  --surface-hairline: rgba(180, 83, 9, 0.14);

  /* Amber accent — saturated, warm, motivational */
  --amber-50:  #fffbeb;
  --amber-100: #fef3c7;
  --amber-200: #fde68a;
  --amber-300: #fcd34d;
  --amber-400: #fbbf24;
  --amber-500: #f59e0b;
  --amber-600: #d97706;
  --amber-700: #b45309;
  --amber-800: #92400e;
  --amber-900: #78350f;

  /* Secondary warm for energy: terracotta accent */
  --sun-400: #fb923c;
  --sun-500: #f97316;

  /* Text: deep warm browns for strong contrast on cream */
  --text-primary: #1c1410;
  --text-strong:  #0f0a06;
  --text-meta:    #78604a;
  --text-faint:   #a08770;
  --text-inverse: #fbf6ed;

  /* Semantic */
  --emerald-400: #10b981;
  --emerald-500: #059669;
  --emerald-600: #047857;
  --red-400:     #ef4444;
  --red-500:     #dc2626;

  /* Shadows — warm, layered */
  --shadow-sm: 0 1px 2px rgba(120, 53, 15, 0.06);
  --shadow-md: 0 4px 12px rgba(120, 53, 15, 0.08), 0 2px 4px rgba(120, 53, 15, 0.04);
  --shadow-lg: 0 16px 40px rgba(120, 53, 15, 0.10), 0 4px 10px rgba(120, 53, 15, 0.05);
  --shadow-amber: 0 8px 24px rgba(245, 158, 11, 0.18);

  /* Type scale */
  --text-2xs: 11px; --text-xs: 12px; --text-sm: 14px; --text-base: 16px;
  --text-lg: 18px; --text-xl: 20px; --text-2xl: 24px;
  --text-kpi: 30px; --text-hero: 36px; --text-display: 48px;

  /* Space 4px grid */
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 20px; --space-6: 24px; --space-8: 32px; --space-10: 40px;

  /* Radius */
  --r-md: 8px; --r-lg: 10px; --r-xl: 14px; --r-2xl: 20px;

  --ease: cubic-bezier(.2,.6,.2,1);
}

/* ================== DARK MODE (optional) — warm editorial ================== */
:root[data-theme="dark"] {
  --canvas: #1e1814;
  --canvas-raised: #26201a;
  --canvas-deep: #14100c;

  --surface-grad-top: rgba(255, 236, 200, 0.06);
  --surface-grad-bot: rgba(255, 236, 200, 0.02);
  --surface-border: rgba(255, 225, 180, 0.14);
  --surface-hairline: rgba(217, 119, 6, 0.20);

  --text-primary: #faf7f2;
  --text-strong:  #ffffff;
  --text-meta:    #c4beb5;
  --text-faint:   #8a8378;
  --text-inverse: #1c1410;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.35);
  --shadow-lg: 0 16px 40px rgba(0,0,0,0.45);
  --shadow-amber: 0 8px 24px rgba(245, 158, 11, 0.22);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--canvas);
  color: var(--text-primary);
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}
body {
  font-size: var(--text-base);
  line-height: 1.5;
}

/* Light-mode ambient sun wash behind content */
body::before {
  content: "";
  position: fixed;
  inset: -10% -10% auto -10%;
  height: 60vh;
  background:
    radial-gradient(ellipse at 20% 10%, rgba(251, 191, 36, 0.22) 0%, transparent 45%),
    radial-gradient(ellipse at 85% 0%, rgba(251, 146, 60, 0.14) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}
:root[data-theme="dark"] body::before {
  background:
    radial-gradient(ellipse at 20% 5%, rgba(217, 119, 6, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 85% 0%, rgba(251, 146, 60, 0.06) 0%, transparent 55%);
}

/* Typography */
.serif { font-family: 'Instrument Serif', 'Times New Roman', serif; font-style: italic; font-weight: 400; letter-spacing: -0.015em; color: var(--text-strong); }
.mono  { font-family: 'IBM Plex Mono', ui-monospace, Menlo, monospace; font-feature-settings: 'tnum'; }
.tnum  { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum'; }

/* Card */
.card {
  background: linear-gradient(180deg, var(--surface-grad-top) 0%, var(--surface-grad-bot) 100%);
  border: 1px solid var(--surface-border);
  border-radius: var(--r-xl);
  padding: var(--space-5);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.card--hero { border-radius: var(--r-2xl); padding: var(--space-6); box-shadow: var(--shadow-lg); }
.card::before {
  content: "";
  position: absolute;
  top: 0; left: var(--space-5); right: var(--space-5);
  height: 1px;
  background: var(--surface-hairline);
  pointer-events: none;
}

/* Card with amber glow — for headers/hero */
.card--amber {
  background: linear-gradient(180deg, #fffaef 0%, #fef3c7 100%);
  border-color: #f5d78e;
  box-shadow: var(--shadow-amber), var(--shadow-md);
}
:root[data-theme="dark"] .card--amber {
  background: linear-gradient(180deg, rgba(245,158,11,0.12) 0%, rgba(245,158,11,0.04) 100%);
  border-color: rgba(245,158,11,0.35);
}

/* Inputs */
.input, .select, .textarea {
  width: 100%;
  background: var(--canvas-raised);
  border: 1px solid var(--surface-border);
  border-radius: var(--r-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: var(--text-base);
  padding: 10px 12px;
  transition: border-color 150ms var(--ease), background 150ms var(--ease), box-shadow 150ms var(--ease);
  min-height: 44px;
  box-shadow: var(--shadow-sm) inset;
}
:root[data-theme="dark"] .input, :root[data-theme="dark"] .select, :root[data-theme="dark"] .textarea {
  background: rgba(255,240,210,0.04);
  box-shadow: none;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--amber-500);
  box-shadow: 0 0 0 3px rgba(245,158,11,0.22);
  background: var(--canvas-raised);
}
.input::placeholder, .textarea::placeholder { color: var(--text-faint); }
.textarea { min-height: 80px; resize: vertical; line-height: 1.5; }

input[type="date"].input, input[type="time"].input, input[type="number"].input { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: var(--text-sm); }
:root[data-theme="dark"] input[type="date"].input, :root[data-theme="dark"] input[type="time"].input { color-scheme: dark; }

/* Slider */
.slider {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 28px; background: transparent; cursor: pointer;
}
.slider::-webkit-slider-runnable-track {
  height: 6px; border-radius: 999px;
  background: linear-gradient(to right, var(--amber-500) var(--pct, 0%), var(--canvas-deep) var(--pct, 0%));
  border: 1px solid var(--surface-border);
}
.slider::-moz-range-track { height: 6px; border-radius: 999px; background: var(--canvas-deep); }
.slider::-moz-range-progress { height: 6px; border-radius: 999px; background: var(--amber-500); }
.slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--amber-500);
  border: 3px solid var(--canvas-raised);
  box-shadow: 0 2px 6px rgba(245,158,11,0.35), 0 0 0 1px var(--amber-600);
  margin-top: -9px;
  transition: transform 120ms var(--ease);
}
.slider::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--amber-500);
  border: 3px solid var(--canvas-raised);
  box-shadow: 0 2px 6px rgba(245,158,11,0.35), 0 0 0 1px var(--amber-600);
}
.slider:active::-webkit-slider-thumb { transform: scale(1.15); }
.slider:focus { outline: none; }
.slider:focus::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(245,158,11,0.30), 0 0 0 1px var(--amber-600); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: var(--r-lg);
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--surface-border);
  background: var(--canvas-raised);
  color: var(--text-primary);
  transition: all 150ms var(--ease);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}
.btn:hover { background: var(--canvas-deep); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(245,158,11,0.30); }

/* Amber primary — motivational */
.btn--amber {
  background: linear-gradient(180deg, var(--amber-400) 0%, var(--amber-500) 100%);
  border-color: var(--amber-600);
  color: var(--amber-900);
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(245,158,11,0.28), 0 1px 2px rgba(120,53,15,0.15), inset 0 1px 0 rgba(255,255,255,0.4);
}
.btn--amber:hover {
  background: linear-gradient(180deg, var(--amber-300) 0%, var(--amber-500) 100%);
  box-shadow: 0 6px 18px rgba(245,158,11,0.38), 0 2px 4px rgba(120,53,15,0.2), inset 0 1px 0 rgba(255,255,255,0.5);
}
:root[data-theme="dark"] .btn--amber {
  color: var(--amber-900);
}

.btn--ghost { background: transparent; border-color: transparent; color: var(--text-meta); box-shadow: none; }
.btn--ghost:hover { color: var(--text-primary); background: var(--canvas-deep); box-shadow: none; transform: none; }
.btn--block { width: 100%; }

/* Pill */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: var(--text-2xs);
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--surface-border);
  color: var(--text-meta);
  background: var(--canvas-raised);
}
.pill--amber { color: var(--amber-800); border-color: var(--amber-400); background: var(--amber-100); }
.pill--emerald { color: var(--emerald-600); border-color: #a7f3d0; background: #d1fae5; }
:root[data-theme="dark"] .pill--amber { color: var(--amber-200); border-color: rgba(217,119,6,0.40); background: rgba(217,119,6,0.15); }
:root[data-theme="dark"] .pill--emerald { color: var(--emerald-400); border-color: rgba(16,185,129,0.35); background: rgba(16,185,129,0.10); }

.hr { height: 1px; background: var(--surface-hairline); border: 0; margin: var(--space-4) 0; }
:focus-visible { outline: none; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--surface-border); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--amber-400); }

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

/* App shell */
.shell {
  max-width: 1024px;
  margin: 0 auto;
  padding: 0 var(--space-4) 120px;
  position: relative;
  z-index: 1;
}
@media (min-width: 640px) { .shell { padding: 0 var(--space-6) 120px; } }

/* Tab bar */
.tabbar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--canvas-raised) 92%, transparent);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-top: 1px solid var(--surface-border);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 24px rgba(120, 53, 15, 0.06);
}
.tabbar__inner { display: flex; max-width: 1024px; margin: 0 auto; }
.tab {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 4px;
  background: transparent; border: 0;
  color: var(--text-faint);
  font-size: 10px;
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 150ms var(--ease), background 150ms var(--ease);
  min-height: 44px;
  border-radius: 10px;
}
.tab[aria-current="page"] {
  color: var(--amber-700);
}
.tab[aria-current="page"]::after {
  content: "";
  position: absolute; bottom: 2px;
  width: 20px; height: 3px;
  border-radius: 2px;
  background: var(--amber-500);
}
:root[data-theme="dark"] .tab[aria-current="page"] { color: var(--amber-200); }
:root[data-theme="dark"] .tab[aria-current="page"]::after { background: var(--amber-400); }
.tab { position: relative; }
.tab:hover { color: var(--text-primary); }
.tab svg { width: 20px; height: 20px; }

@media (min-width: 768px) {
  .tabbar {
    position: sticky;
    top: 0; bottom: auto;
    border-top: 0;
    border-bottom: 1px solid var(--surface-border);
    padding: 10px var(--space-6);
    box-shadow: var(--shadow-sm);
  }
  .tabbar__inner { gap: 4px; }
  .tab { flex: 0 0 auto; flex-direction: row; padding: 10px 14px; gap: 8px; font-size: 11px; }
  .tab svg { width: 16px; height: 16px; }
  .tab[aria-current="page"]::after { display: none; }
  .tab[aria-current="page"] { background: var(--amber-100); }
  :root[data-theme="dark"] .tab[aria-current="page"] { background: rgba(245,158,11,0.12); }
}

/* Animations */
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeIn 240ms var(--ease) both; }
@keyframes drawLine { from { stroke-dashoffset: var(--len, 1000); } to { stroke-dashoffset: 0; } }
.draw-line { stroke-dasharray: var(--len, 1000); animation: drawLine 900ms var(--ease) 100ms both; }

/* Progress bar */
.progress {
  width: 100%;
  height: 10px;
  background: var(--canvas-deep);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--surface-border);
}
.progress__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--amber-600) 0%, var(--amber-400) 70%, var(--amber-300) 100%);
  border-radius: 999px;
  transition: width 600ms var(--ease);
  box-shadow: 0 0 12px rgba(245,158,11,0.45);
}

/* Segmented */
.seg {
  display: inline-flex;
  background: var(--canvas-deep);
  border: 1px solid var(--surface-border);
  border-radius: var(--r-md);
  padding: 3px;
  gap: 2px;
}
.seg__btn {
  flex: 1;
  padding: 8px 12px;
  border-radius: 6px;
  background: transparent;
  border: 0;
  color: var(--text-meta);
  font: inherit;
  font-size: var(--text-sm);
  cursor: pointer;
  min-height: 36px;
  transition: all 150ms var(--ease);
}
.seg__btn[aria-pressed="true"] {
  background: var(--canvas-raised);
  color: var(--amber-700);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
:root[data-theme="dark"] .seg__btn[aria-pressed="true"] { color: var(--amber-200); background: rgba(245,158,11,0.15); }

/* List rows */
.row {
  display: grid;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--surface-hairline);
  font-size: var(--text-sm);
}
.row:last-child { border-bottom: 0; }

/* Utility */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-3); }
.grid-4-desk { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-3); }
@media (min-width: 768px) { .grid-4-desk { grid-template-columns: repeat(4, 1fr); gap: var(--space-4); } }
.row-gap-6 { display: grid; gap: var(--space-6); }
.row-gap-4 { display: grid; gap: var(--space-4); }
.stack-3 { display: grid; gap: var(--space-3); }
.stack-2 { display: grid; gap: var(--space-2); }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-center { display: flex; align-items: center; gap: 8px; }

/* Colors */
.c-meta { color: var(--text-meta); }
.c-faint { color: var(--text-faint); }
.c-amber { color: var(--amber-700); }
.c-amber-soft { color: var(--amber-800); }
.c-emerald { color: var(--emerald-600); }
.c-red { color: var(--red-500); }
:root[data-theme="dark"] .c-amber { color: var(--amber-300); }
:root[data-theme="dark"] .c-amber-soft { color: var(--amber-100); }
:root[data-theme="dark"] .c-emerald { color: var(--emerald-400); }
:root[data-theme="dark"] .c-red { color: var(--red-400); }

/* KPI */
.kpi {
  display: grid; gap: 4px;
  padding: 16px;
  background: var(--canvas-raised);
  border: 1px solid var(--surface-border);
  border-radius: var(--r-lg);
  position: relative;
  box-shadow: var(--shadow-sm);
  transition: transform 180ms var(--ease), box-shadow 180ms var(--ease);
}
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
:root[data-theme="dark"] .kpi { background: rgba(255, 240, 210, 0.035); }

.kpi__label {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-meta);
}
.kpi__value {
  font-family: 'Instrument Serif', serif; font-style: italic;
  font-size: 34px; line-height: 1.05;
  color: var(--text-strong);
}
.kpi__delta { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 11px; display: flex; align-items: baseline; gap: 6px; font-weight: 500; }
.kpi__spark { position: absolute; right: 14px; top: 16px; opacity: 0.9; }

/* Lock indicator */
.lockmark {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: 'IBM Plex Mono', monospace; font-size: 11px;
  color: var(--emerald-600); background: #d1fae5; border: 1px solid #a7f3d0;
  padding: 4px 9px; border-radius: 999px;
  font-weight: 500;
}
:root[data-theme="dark"] .lockmark { color: var(--emerald-400); background: rgba(16,185,129,0.10); border-color: rgba(16,185,129,0.25); }
.lockmark svg { width: 10px; height: 10px; }

/* Unlock */
.unlock-bg {
  position: fixed; inset: 0;
  display: grid; place-items: center;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(251,191,36,0.35) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(251,146,60,0.25) 0%, transparent 55%),
    var(--canvas);
  z-index: 100;
  padding: 24px;
}
:root[data-theme="dark"] .unlock-bg {
  background:
    radial-gradient(ellipse at 50% 25%, rgba(217,119,6,0.18) 0%, transparent 55%),
    var(--canvas);
}
.unlock-card { max-width: 420px; width: 100%; }

h1, h2, h3, h4 { margin: 0; font-weight: 400; }
h1 { font-size: 28px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }

.section-title { font-family: 'Instrument Serif', serif; font-style: italic; font-size: 24px; color: var(--text-strong); letter-spacing: -0.01em; }
.eyebrow { font-family: 'IBM Plex Mono', monospace; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--amber-700); font-weight: 500; }
:root[data-theme="dark"] .eyebrow { color: var(--amber-300); }

/* Dots */
.dots { display: flex; gap: 6px; }
.dots .dot { width: 12px; height: 12px; border-radius: 999px; background: var(--canvas-deep); border: 1px solid var(--surface-border); }
.dots .dot.on { background: currentColor; border-color: currentColor; box-shadow: 0 0 0 2px rgba(255,255,255,0.4) inset; }

/* Tweak panel */
.tweak-panel {
  position: fixed;
  right: 14px;
  bottom: 84px;
  z-index: 50;
  background: var(--canvas-raised);
  border: 1px solid var(--surface-border);
  border-radius: var(--r-xl);
  padding: 16px;
  width: 240px;
  box-shadow: var(--shadow-lg);
}
@media (min-width: 768px) { .tweak-panel { bottom: 14px; } }

/* Warn */
.warn {
  background: var(--amber-100);
  border: 1px solid var(--amber-300);
  color: var(--amber-900);
  border-radius: var(--r-md);
  padding: 12px 14px;
  font-size: var(--text-sm);
  display: flex;
  gap: 10px;
  line-height: 1.5;
}
.warn__icon { color: var(--amber-700); flex: 0 0 16px; margin-top: 2px; font-size: 16px; }
:root[data-theme="dark"] .warn { background: rgba(217,119,6,0.10); border-color: rgba(217,119,6,0.30); color: var(--amber-100); }
:root[data-theme="dark"] .warn__icon { color: var(--amber-300); }

.inline-ok { color: var(--emerald-600); font-family: 'IBM Plex Mono', monospace; font-size: 12px; font-weight: 500; }
.inline-err { color: var(--red-500); font-family: 'IBM Plex Mono', monospace; font-size: 12px; font-weight: 500; }
:root[data-theme="dark"] .inline-ok { color: var(--emerald-400); }
:root[data-theme="dark"] .inline-err { color: var(--red-400); }

/* Discrete delete button — opacity 0 by default, revealed on row hover (desktop)
   or when the parent row carries .row--revealed (mobile tap-to-reveal). */
.row__del {
  background: transparent;
  border: 0;
  color: var(--text-faint);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: color 150ms var(--ease), background 150ms var(--ease), opacity 150ms var(--ease);
  min-width: 32px; min-height: 32px;
  opacity: 0;
}
@media (hover: hover) {
  .row:hover .row__del { opacity: 0.55; }
  .row__del:hover { color: var(--red-500); background: #fee2e2; opacity: 1; }
}
.row.row--revealed .row__del { opacity: 0.7; }
.row.row--revealed .row__del:active,
.row.row--revealed .row__del:hover { color: var(--red-500); background: #fee2e2; opacity: 1; }
:root[data-theme="dark"] .row__del:hover,
:root[data-theme="dark"] .row.row--revealed .row__del:active,
:root[data-theme="dark"] .row.row--revealed .row__del:hover { color: var(--red-400); background: rgba(239,68,68,0.10); }
.row.row--clickable { cursor: pointer; }

/* Header */
.app-header {
  padding: 20px 0 12px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.app-header h1 { font-family: 'Instrument Serif', serif; font-style: italic; font-size: 28px; color: var(--text-strong); letter-spacing: -0.02em; line-height: 1.15; padding-bottom: 4px; }
@media (min-width: 640px) { .app-header h1 { font-size: 34px; } }

/* Recap — the motivational banner */
.recap {
  background:
    radial-gradient(circle at 90% 10%, rgba(251,191,36,0.35) 0%, transparent 45%),
    linear-gradient(135deg, #fff7e0 0%, #fef3c7 50%, #fde68a 100%);
  border: 1px solid var(--amber-400);
  box-shadow: var(--shadow-amber), var(--shadow-md);
  position: relative;
}
.recap > * { position: relative; z-index: 1; }
:root[data-theme="dark"] .recap {
  background: linear-gradient(135deg, rgba(245,158,11,0.18) 0%, rgba(217,119,6,0.10) 100%);
  border-color: rgba(245,158,11,0.4);
}

/* Chart helpers */
.chart-grid line { stroke: var(--surface-hairline); stroke-dasharray: 2 3; }
:root[data-theme="dark"] .chart-grid line { stroke: rgba(255,255,255,0.06); }
.chart-axis text { fill: var(--text-faint); font-family: 'IBM Plex Mono', monospace; font-size: 10px; }

/* Motivation callout — Direction C "aphorisme" : pull-quote inversé.
   Pas de fond, pas de contour. Phrase italique en serif + signature mono.
   Fluidité responsive : clamp(min, 1rem + Xvw, max) → respecte le zoom système. */
.callout-motiv {
  position: relative;
  padding: clamp(8px, 0.5rem + 0.5vw, 14px) 0 0;
  margin: 4px 0 8px;
}
.callout-motiv__mark {
  position: absolute;
  left: clamp(-12px, -1vw, -4px);
  top: clamp(8px, 0.5rem + 0.4vw, 14px);
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(48px, 3rem + 3vw, 84px);
  line-height: 0.6;
  color: var(--amber-500);
  opacity: 0.45;
  user-select: none;
  pointer-events: none;
}
.callout-motiv__mark::before { content: '\201C'; }
.callout-motiv__body {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(17px, 1rem + 0.6vw, 22px);
  line-height: 1.4;
  letter-spacing: -0.005em;
  color: var(--text-strong);
  margin: 0 0 10px;
  padding-left: clamp(24px, 1.5rem + 1.4vw, 40px);
  max-width: 56ch;
}
.callout-motiv__sig {
  font-family: 'IBM Plex Mono', monospace;
  font-size: clamp(10px, 0.5rem + 0.18vw, 11.5px);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-meta);
  padding-left: clamp(24px, 1.5rem + 1.4vw, 40px);
  display: flex;
  align-items: center;
  gap: 10px;
}
.callout-motiv__sig::before {
  content: '';
  width: 24px;
  height: 1px;
  background: currentColor;
  opacity: 0.45;
  flex-shrink: 0;
}
:root[data-theme="dark"] .callout-motiv__mark { color: var(--amber-400); opacity: 0.55; }

/* Autofill color */
input:-webkit-autofill, input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text-primary);
  box-shadow: 0 0 0 1000px var(--canvas-raised) inset;
}
