/* ============================================================
   Load Warrior — Warm Dusk design system
   One file. No framework. Built for focus + calm.
   ============================================================ */

:root {
  /* Warm dusk palette */
  --bg:            #1a120c;
  --bg-grain:      #1f1610;
  --surface:       #261b14;
  --surface-2:     #2e221a;
  --surface-3:     #3a2a1f;
  --border:        #3d2d21;
  --border-strong: #55402f;

  --ink:           #f6ede0;
  --ink-2:         #d3c3ae;
  --ink-3:         #9f8e79;
  --ink-4:         #6e5f4e;

  --amber:         #ff9a3c;
  --amber-soft:    #ffb974;
  --amber-deep:    #c97522;
  --ember:         #ff6b4a;
  --sage:          #8fc99a;
  --rose:          #e5789b;

  /* Pain scale colors (0-10 gradient) */
  --p-0: #8fc99a;
  --p-3: #e9c46a;
  --p-6: #f0883a;
  --p-8: #e76f51;
  --p-10: #c93e2f;

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

  --shadow-1: 0 1px 0 rgba(255,218,170,.04), 0 2px 6px rgba(0,0,0,.35);
  --shadow-2: 0 1px 0 rgba(255,218,170,.05), 0 10px 28px -8px rgba(0,0,0,.55);
  --shadow-glow: 0 0 0 1px rgba(255,154,60,.35), 0 8px 28px -6px rgba(255,154,60,.25);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: ui-serif, "Iowan Old Style", "Apple Garamond", Garamond, "Times New Roman", Georgia, serif;

  --tap: 44px;
}

/* ============================================================
   Reset + base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { background: var(--bg); }
body {
  font-family: var(--font-sans);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(255,154,60,.10), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(229,120,155,.07), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern", "liga", "ss01";
  line-height: 1.5;
  overscroll-behavior-y: none;
  padding-bottom: calc(80px + env(safe-area-inset-bottom));
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; margin: 0; }
h1 { font-size: clamp(2rem, 1.4rem + 3vw, 3rem); line-height: 1.05; }
h2 { font-size: clamp(1.3rem, 1.1rem + 1vw, 1.6rem); line-height: 1.15; }
h3 { font-size: 1.05rem; line-height: 1.2; }
p { margin: 0; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
input, select, textarea { font: inherit; color: inherit; }

/* ============================================================
   Layout
   ============================================================ */
#app {
  max-width: 560px;
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 18px 24px;
  padding-top: calc(env(safe-area-inset-top, 0) + 16px);
}

.stack > * + * { margin-top: 14px; }
.stack-sm > * + * { margin-top: 8px; }
.stack-lg > * + * { margin-top: 22px; }
.row { display: flex; gap: 10px; align-items: center; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ============================================================
   Header & greeting
   ============================================================ */
.greeting {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 2px 0;
  margin-bottom: 18px;
}
.greeting .hello {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--ink-2);
  letter-spacing: -0.01em;
}
.greeting .date {
  color: var(--ink-3);
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .12em;
}

/* ============================================================
   Streak badge (hero element)
   ============================================================ */
.streak {
  position: relative;
  padding: 22px 20px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(600px 200px at 110% -20%, rgba(255,154,60,.22), transparent 60%),
    linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border);
  box-shadow: var(--shadow-2);
  overflow: hidden;
}
.streak::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(80% 70% at 50% 0%, rgba(255,255,255,.04), transparent);
  pointer-events: none;
}
.streak .label {
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .72rem;
}
.streak .number {
  font-family: var(--font-display);
  font-size: 3.6rem;
  line-height: 1;
  color: var(--ink);
  font-weight: 600;
  letter-spacing: -0.02em;
  display: flex; align-items: baseline; gap: 10px;
}
.streak .unit {
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--ink-3);
  font-weight: 400;
}
.streak .sub {
  margin-top: 6px;
  color: var(--ink-2);
  font-size: .9rem;
}
.streak .flame {
  position: absolute; right: 18px; top: 18px;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: var(--radius-pill);
  background: linear-gradient(180deg, rgba(255,154,60,.2), rgba(255,154,60,.06));
  border: 1px solid rgba(255,154,60,.35);
  box-shadow: 0 6px 20px -8px rgba(255,154,60,.45);
}
.streak .flame svg { width: 22px; height: 22px; color: var(--amber); filter: drop-shadow(0 0 6px rgba(255,154,60,.5)); }

/* ============================================================
   Cards
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 16px;
  box-shadow: var(--shadow-1);
}
.card.clickable { cursor: pointer; transition: transform .12s ease, border-color .12s ease; }
.card.clickable:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.card.clickable:active { transform: translateY(0); }
.card h2 { margin-bottom: 4px; }
.card .eyebrow {
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .7rem;
  margin-bottom: 6px;
}
.card .meta { color: var(--ink-3); font-size: .86rem; }

/* Tier cards */
.tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tier {
  padding: 14px 10px;
  border-radius: var(--radius);
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink-2);
  transition: border-color .12s, transform .12s, background .12s;
}
.tier .num { font-family: var(--font-display); font-size: 1.3rem; color: var(--ink); }
.tier .name { font-size: .8rem; color: var(--ink-3); margin-top: 2px; }
.tier .mins { font-size: .72rem; color: var(--ink-4); margin-top: 2px; }
.tier.selected {
  border-color: rgba(255,154,60,.6);
  background: linear-gradient(180deg, rgba(255,154,60,.12), rgba(255,154,60,.02));
  box-shadow: var(--shadow-glow);
}
.tier.selected .num { color: var(--amber-soft); }

/* ============================================================
   Exercise checklist
   ============================================================ */
.checklist { margin: 0; padding: 0; list-style: none; }
.checklist li {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.checklist li:first-child { border-top: 0; padding-top: 4px; }
.checklist .check {
  flex: 0 0 auto;
  width: 24px; height: 24px;
  border-radius: 8px;
  border: 1.5px solid var(--border-strong);
  display: grid; place-items: center;
  background: var(--surface-2);
  transition: all .12s;
  margin-top: 1px;
}
.checklist li.done .check {
  background: linear-gradient(180deg, var(--amber), var(--amber-deep));
  border-color: var(--amber-deep);
  box-shadow: 0 0 0 3px rgba(255,154,60,.12);
}
.checklist .check svg { width: 14px; height: 14px; color: var(--bg); opacity: 0; }
.checklist li.done .check svg { opacity: 1; }
.checklist .body { flex: 1; min-width: 0; }
.checklist .title { font-weight: 500; color: var(--ink); }
.checklist .detail { color: var(--ink-3); font-size: .86rem; margin-top: 2px; }
.checklist li.done .title { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--ink-4); }

/* ============================================================
   Pain sliders
   ============================================================ */
.pain-grid { display: grid; gap: 10px; }
.pain-row {
  display: grid;
  grid-template-columns: 1fr 44px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.pain-row .name { color: var(--ink-2); font-size: .92rem; }
.pain-row .value {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-display);
  font-size: 1.2rem;
}
.pain-row input[type=range] {
  grid-column: 1 / -1;
  -webkit-appearance: none; appearance: none;
  width: 100%;
  height: 30px;
  background: transparent;
  margin: 2px 0 0;
}
.pain-row input[type=range]::-webkit-slider-runnable-track {
  height: 6px; border-radius: 999px;
  background: linear-gradient(90deg, var(--p-0), var(--p-3) 30%, var(--p-6) 60%, var(--p-8) 80%, var(--p-10));
}
.pain-row input[type=range]::-moz-range-track {
  height: 6px; border-radius: 999px;
  background: linear-gradient(90deg, var(--p-0), var(--p-3) 30%, var(--p-6) 60%, var(--p-8) 80%, var(--p-10));
}
.pain-row input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--ink); border: 2px solid var(--bg);
  box-shadow: 0 2px 8px rgba(0,0,0,.5);
  margin-top: -8px;
}
.pain-row input[type=range]::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--ink); border: 2px solid var(--bg);
  box-shadow: 0 2px 8px rgba(0,0,0,.5);
}

/* Color the value number by intensity */
.pain-row[data-v="0"] .value, .pain-row[data-v="1"] .value { color: var(--p-0); }
.pain-row[data-v="2"] .value, .pain-row[data-v="3"] .value, .pain-row[data-v="4"] .value { color: var(--p-3); }
.pain-row[data-v="5"] .value, .pain-row[data-v="6"] .value { color: var(--p-6); }
.pain-row[data-v="7"] .value, .pain-row[data-v="8"] .value { color: var(--p-8); }
.pain-row[data-v="9"] .value, .pain-row[data-v="10"] .value { color: var(--p-10); }

/* ============================================================
   Buttons & inputs
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 0 20px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  color: var(--ink);
  font-weight: 500;
  transition: background .12s, border-color .12s, transform .08s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: scale(.98); }
.btn-primary {
  background: linear-gradient(180deg, var(--amber), var(--amber-deep));
  border-color: var(--amber-deep);
  color: #1a120c;
  font-weight: 600;
  box-shadow: 0 6px 20px -6px rgba(255,154,60,.5);
}
.btn-primary:hover { background: linear-gradient(180deg, var(--amber-soft), var(--amber)); }
.btn-ghost { background: transparent; border-color: var(--border); }
.btn-block { width: 100%; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: .9rem; }

.input, .textarea, .select {
  width: 100%;
  min-height: var(--tap);
  padding: 10px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--ink);
  outline: none;
  transition: border-color .12s;
}
.input:focus, .textarea:focus, .select:focus { border-color: var(--amber-deep); }
.textarea { min-height: 72px; resize: vertical; font-family: var(--font-sans); line-height: 1.5; }

.label {
  display: block;
  font-size: .8rem;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: .12em;
  margin-bottom: 6px;
}

/* ============================================================
   Chips & badges
   ============================================================ */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: .78rem;
  color: var(--ink-2);
}
.chip.amber { background: rgba(255,154,60,.1); border-color: rgba(255,154,60,.3); color: var(--amber-soft); }
.chip.sage  { background: rgba(143,201,154,.08); border-color: rgba(143,201,154,.28); color: var(--sage); }

/* ============================================================
   History (spark chart)
   ============================================================ */
.spark {
  display: grid;
  grid-template-columns: repeat(14, 1fr);
  gap: 3px;
  height: 72px;
  align-items: end;
}
.spark .bar {
  background: var(--surface-3);
  border-radius: 3px 3px 0 0;
  min-height: 4px;
  transition: all .2s;
}

.day-row {
  display: grid;
  grid-template-columns: 60px 50px 1fr 48px;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}
.day-row:first-child { border-top: 0; }
.day-row .d { color: var(--ink-3); font-size: .8rem; font-variant-numeric: tabular-nums; }
.day-row .t { font-family: var(--font-display); color: var(--amber-soft); }
.day-row .n { color: var(--ink-2); font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.day-row .p { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--font-display); color: var(--ink); }

/* ============================================================
   Tabbar (bottom nav)
   ============================================================ */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0;
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  z-index: 50;
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px;
  padding: 10px 4px 12px;
  color: var(--ink-3);
  font-size: .68rem;
  letter-spacing: .04em;
  -webkit-tap-highlight-color: transparent;
}
.tabbar svg { width: 22px; height: 22px; color: currentColor; }
.tabbar a.active { color: var(--amber-soft); }
.tabbar a.active svg { filter: drop-shadow(0 0 6px rgba(255,185,116,.5)); }

/* ============================================================
   Toast
   ============================================================ */
.toast {
  position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(10px);
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  color: var(--ink);
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  font-size: .9rem;
  opacity: 0;
  transition: opacity .2s, transform .2s;
  pointer-events: none;
  z-index: 60;
  box-shadow: var(--shadow-2);
  max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.ok { border-color: rgba(143,201,154,.4); }
.toast.warn { border-color: rgba(255,154,60,.5); }

/* ============================================================
   Misc
   ============================================================ */
.muted { color: var(--ink-3); }
.center { text-align: center; }
.divider { height: 1px; background: var(--border); margin: 18px 0; }
.section-h {
  display: flex; justify-content: space-between; align-items: baseline;
  margin: 20px 2px 10px;
}
.section-h h2 { font-size: 1.15rem; }
.section-h .hint { color: var(--ink-3); font-size: .82rem; }

.kicker {
  color: var(--amber-soft);
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .16em;
  font-weight: 500;
}

.exercise-card { padding: 14px 16px; }
.exercise-card .name { font-weight: 500; color: var(--ink); }
.exercise-card .cue { color: var(--ink-3); font-size: .88rem; margin-top: 4px; }
.exercise-card .why { color: var(--ink-2); font-size: .84rem; margin-top: 6px; font-style: italic; }
.exercise-card.warn { border-color: rgba(231,111,81,.4); background: linear-gradient(180deg, rgba(231,111,81,.06), transparent); }

/* ============================================================
   Exercise illustrations
   ============================================================ */

/* Hero image for the Moves library card */
.ex-illustration {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background:
    radial-gradient(60% 80% at 50% 40%, rgba(255, 154, 60, .06), transparent 70%),
    linear-gradient(180deg, #f4ece0 0%, #ece2d3 100%);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 12px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06);
}
.ex-illustration img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
  transition: opacity .4s ease;
}
/* Multi-phase: smoothly cross-fade the 2nd image over the 1st */
.ex-illustration.phased img.alt {
  opacity: 0;
  animation: ex-phase 4.5s linear infinite;
}
/* 4.5s cycle: 2s cat hold → 0.25s fade → 2s cow hold → 0.25s fade back */
@keyframes ex-phase {
  0%,   44.44% { opacity: 0; }
  50%,  94.44% { opacity: 1; }
  100%         { opacity: 0; }
}

/* Compact thumbnail next to items in the Today checklist */
.ex-thumb {
  flex: 0 0 auto;
  width: 56px;
  height: 42px;
  border-radius: 8px;
  background: linear-gradient(180deg, #f4ece0, #ece2d3);
  overflow: hidden;
  margin-top: 2px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06);
  position: relative;
}
.ex-thumb img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  transition: opacity .4s ease;
}
.ex-thumb.phased img.alt {
  opacity: 0;
  animation: ex-phase 4.5s linear infinite;
}
.ex-thumb.missing { display: none; }

@media (prefers-reduced-motion: reduce) {
  .ex-illustration.phased img.alt,
  .ex-thumb.phased img.alt { animation: none; opacity: 1; }
}

.done-celebration {
  text-align: center; padding: 30px 20px;
  background: linear-gradient(180deg, rgba(143,201,154,.1), transparent);
  border: 1px solid rgba(143,201,154,.3);
  border-radius: var(--radius-lg);
}
.done-celebration h2 { color: var(--sage); margin-bottom: 4px; }

/* ============================================================
   Exercise detail modal (sheet-style, mobile-first)
   ============================================================ */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(10, 6, 3, .6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 100;
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; transition: opacity .18s ease;
  padding: 0;
}
.modal-backdrop.show { opacity: 1; }
.modal-sheet {
  width: 100%;
  max-width: 560px;
  max-height: 92dvh;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: 0 -20px 40px -10px rgba(0, 0, 0, .6);
  overflow-y: auto;
  overflow-x: hidden;
  transform: translateY(20px);
  transition: transform .24s cubic-bezier(.2,.9,.3,1);
  padding-bottom: calc(28px + env(safe-area-inset-bottom));
  position: relative;
}
.modal-backdrop.show .modal-sheet { transform: translateY(0); }

@media (min-width: 640px) {
  .modal-backdrop { align-items: center; padding: 20px; }
  .modal-sheet { border-radius: var(--radius-lg); max-height: 88dvh; }
}

.modal-close {
  position: absolute; top: 12px; right: 12px;
  width: 36px; height: 36px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--ink-2);
  font-size: 1.3rem; line-height: 1;
  z-index: 2;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.modal-close:hover { background: var(--surface-3); color: var(--ink); }

.modal-hero {
  padding: 16px 16px 0;
}

.modal-header {
  padding: 14px 20px 0;
}
.modal-header h2 {
  font-size: 1.5rem;
  margin-top: 2px;
}

.modal-body {
  padding: 14px 20px 4px;
}
.modal-p {
  color: var(--ink-2);
  line-height: 1.55;
  margin: 4px 0;
}
.modal-warn {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(231, 111, 81, .1);
  border: 1px solid rgba(231, 111, 81, .3);
  color: #f3b59e;
  font-size: .9rem;
}

/* Timer + counter block */
.modal-tools {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 18px 20px 6px;
}
@media (min-width: 540px) {
  .modal-tools { grid-template-columns: 1fr 1fr; }
}
.timer-block {
  padding: 14px 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
}
.timer-display {
  font-family: var(--font-display);
  font-size: 2.8rem;
  letter-spacing: -.02em;
  color: var(--amber-soft);
  margin-top: 6px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  transition: color .2s;
}
.timer-done { color: var(--sage) !important; text-shadow: 0 0 20px rgba(143, 201, 154, .6); }

.rep-display {
  font-family: var(--font-display);
  font-size: 2.4rem;
  color: var(--ink);
  min-width: 80px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.rep-row {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  margin-top: 6px;
}
.rep-btn {
  width: 48px; height: 48px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--ink);
  font-size: 1.6rem; line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .08s, background .12s;
}
.rep-btn:active { transform: scale(.92); }
.rep-btn.plus { background: linear-gradient(180deg, var(--amber), var(--amber-deep)); border-color: var(--amber-deep); color: #1a120c; font-weight: 700; }
.rep-btn.minus { background: var(--surface-2); }

.modal-actions {
  padding: 20px;
}

/* ============================================================
   Install prompt
   ============================================================ */
.install-banner {
  position: fixed;
  left: 16px; right: 16px;
  bottom: calc(90px + env(safe-area-inset-bottom));
  z-index: 55;
  padding: 12px 14px;
  background: linear-gradient(180deg, var(--surface-3), var(--surface-2));
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px -6px rgba(0, 0, 0, .55);
  display: flex; align-items: center; gap: 12px;
  opacity: 0; transform: translateY(10px);
  transition: opacity .25s, transform .25s;
  max-width: 560px;
  margin: 0 auto;
}
.install-banner.show { opacity: 1; transform: translateY(0); }
.install-banner .msg { flex: 1; color: var(--ink-2); font-size: .88rem; line-height: 1.4; }
.install-banner .msg strong { color: var(--ink); }
.install-banner .actions { display: flex; gap: 8px; }
.install-banner .actions button { min-height: 36px; padding: 0 14px; font-size: .85rem; }

/* ============================================================
   Onboarding
   ============================================================ */
.onboarding-overlay {
  position: fixed; inset: 0;
  background: radial-gradient(ellipse at center, var(--bg-grain) 0%, var(--bg) 70%);
  z-index: 110;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  padding: 32px 20px;
  overflow-y: auto;
}
.onboarding-overlay h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 1.4rem + 3vw, 3.2rem);
  background: linear-gradient(180deg, var(--amber-soft), var(--amber));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-align: center;
  margin-bottom: 8px;
}
.onboarding-overlay p {
  max-width: 440px;
  color: var(--ink-2);
  text-align: center;
  line-height: 1.6;
  margin: 0 auto 10px;
}
.onboarding-overlay .points {
  max-width: 440px;
  margin: 22px auto;
  padding: 20px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.onboarding-overlay .points li {
  margin: 8px 0;
  color: var(--ink-2);
  line-height: 1.5;
}
.onboarding-overlay .cta {
  margin-top: 10px;
  display: flex; flex-direction: column; gap: 10px;
  width: 100%; max-width: 340px;
  margin-left: auto; margin-right: auto;
}

/* ============================================================
   Streak milestone celebration
   ============================================================ */
.milestone-burst {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 90;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .3s;
}
.milestone-burst.show { opacity: 1; }
.milestone-burst .card {
  padding: 34px 40px;
  background: linear-gradient(180deg, var(--surface-3), var(--surface));
  border: 1px solid var(--amber-deep);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-glow), 0 20px 40px -10px rgba(0,0,0,.6);
  text-align: center;
  transform: scale(.85);
  transition: transform .35s cubic-bezier(.2, 1.2, .4, 1);
}
.milestone-burst.show .card { transform: scale(1); }
.milestone-burst h2 {
  font-family: var(--font-display);
  font-size: 2.4rem;
  color: var(--amber-soft);
}
.milestone-burst p {
  color: var(--ink-2);
  margin-top: 6px;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* PWA standalone fine-tuning */
@media (display-mode: standalone) {
  body { padding-bottom: calc(78px + env(safe-area-inset-bottom)); }
}
