/* Fonts matched to resetphysiotherapybrunswick.com:
   body = Familjen Grotesk (same as the website);
   headings = Noto Serif Display, condensed and heavy, the closest free match to HWT Aetna Extra Condensed. */
@font-face { font-family: "Familjen Grotesk"; src: url("fonts/familjen-grotesk.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Reset Display"; src: url("fonts/display-serif.woff2") format("woff2"); font-weight: 100 900; font-stretch: 62.5% 100%; font-display: swap; }

:root {
  --bg: #FEFFE9; --card: #FFFFFF; --ink: #23260A; --muted: #5C6040; --line: #E4E7C4; --line-strong: #B8BC7F;
  --accent: #2E3105; --accent-ink: #FFFFFF; --accent-soft: #DFE777; --accent-soft-ink: #2E3105; --accent-bar: #B8BC7F;
  --warm: #FFFDC1; --warm-ink: #3E420A; --warm-strong: #6A6E1E;
  --cool: #E9EBCB; --cool-ink: #3E420A;
  --alert-bg: #2E3105; --alert-ink: #FFFFFF; --alert-muted: #EEF0D6; --alert-icon: #DFE777;
  --focus: #2F6FD0;
  --radius: 18px; --nav-h: 72px;
  --font-body: "Familjen Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Reset Display", "Iowan Old Style", Georgia, serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16180A; --card: #22250F; --ink: #F3F5DC; --muted: #B6BA98; --line: #353919; --line-strong: #5C602C;
    --accent: #DFE777; --accent-ink: #23260A; --accent-soft: #3B4012; --accent-soft-ink: #F1F4B8; --accent-bar: #6A6E2E;
    --warm: #34371A; --warm-ink: #FFFDC1; --warm-strong: #DFE777;
    --cool: #2A2D16; --cool-ink: #E9EBCB;
    --alert-bg: #3B3F12; --alert-ink: #FFFFFF; --alert-muted: #EEF0D6; --alert-icon: #DFE777;
    --focus: #8DB8FF;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: 17px; line-height: 1.5;
}
main { max-width: 560px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 20px) 16px calc(var(--nav-h) + env(safe-area-inset-bottom) + 28px); min-height: 100vh; outline: none; }
body.no-nav main { padding-bottom: calc(env(safe-area-inset-bottom) + 28px); }
h1, h2, h3 { font-family: var(--font-body); letter-spacing: -0.01em; margin: 0; text-wrap: balance; }
h1, h2 { font-family: var(--font-display); font-stretch: 75%; font-weight: 800; letter-spacing: 0; line-height: 1.12; }
h1 { font-size: 27px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; font-weight: 700; }
p { margin: 0; text-wrap: pretty; }
a { color: var(--accent); }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 8px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--card); padding: 8px 12px; z-index: 20; }
.skip:focus { left: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.loading { color: var(--muted); padding-top: 40px; text-align: center; }

.muted { color: var(--muted); }
.small { font-size: 14px; }
.tiny { font-size: 13px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.section { margin-top: 24px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.section-head a { font-size: 14px; font-weight: 600; }

.top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.top .sub { font-size: 14px; color: var(--muted); margin-top: 2px; }
.top-actions { display: flex; gap: 6px; flex-shrink: 0; }
.back-bar { display: flex; align-items: center; justify-content: space-between; margin: -8px -8px 8px; }
.back-bar span { font-size: 14px; font-weight: 600; color: var(--muted); }

.icon-btn { width: 44px; height: 44px; border-radius: 22px; border: none; background: var(--card); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; text-decoration: none; flex-shrink: 0; }
.icon-btn.plain { background: transparent; }
.icon-btn svg { width: 22px; height: 22px; }

.card { background: var(--card); border-radius: var(--radius); padding: 16px; }
.card.tight { padding: 12px 14px; }
.card.accent { background: var(--accent); color: var(--accent-ink); }
.card.soft { background: var(--accent-soft); color: var(--accent-soft-ink); }
.card.warm { background: var(--warm); color: var(--warm-ink); }
.card.cool { background: var(--cool); color: var(--cool-ink); }
.card.alert { background: var(--alert-bg); color: var(--alert-ink); }
.card.alert p { color: var(--alert-muted); }
.card.outline { background: transparent; border: 1.5px dashed var(--line-strong); }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
a.card { display: block; text-decoration: none; color: inherit; }
a.card.accent .go { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 15px; margin-top: 10px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 22px; border-radius: 26px; border: none; background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: 16px; cursor: pointer; text-decoration: none; text-align: center; }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); }
.btn.quiet { background: var(--card); color: var(--ink); }
.btn.small { min-height: 40px; padding: 0 16px; font-size: 14px; }
.btn.danger { background: transparent; color: #B3261E; border: 1.5px solid #B3261E; }
@media (prefers-color-scheme: dark) { .btn.danger { color: #FF8A80; border-color: #FF8A80; } }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row > * { flex: 1 1 140px; }

.item { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 16px; padding: 10px 14px; min-height: 60px; text-decoration: none; color: inherit; }
.item .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.item .title { font-size: 15px; font-weight: 600; }
.item .meta { font-size: 13px; color: var(--muted); }
.item .time { font-family: var(--font-body); font-weight: 800; font-size: 15px; width: 68px; flex-shrink: 0; white-space: nowrap; }
.item .time .tiny { margin-left: 3px; }
.item.current { outline: 2px solid var(--accent); }
.tick { width: 30px; height: 30px; border-radius: 15px; border: 2px solid var(--line-strong); background: transparent; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; cursor: pointer; padding: 0; }
.tick.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.tick svg { width: 16px; height: 16px; }
button.tick { width: 44px; height: 44px; border-radius: 22px; }
.chev { color: var(--muted); flex-shrink: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 40px; padding: 0 14px; border-radius: 20px; border: 1.5px solid var(--line); background: var(--card); font-size: 14px; cursor: pointer; }
.chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-soft-ink); font-weight: 600; }
.chip.warmchip[aria-pressed="true"] { border-color: var(--warm-strong); background: var(--warm); color: var(--warm-ink); }
.seg { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.seg .chip { padding: 0 4px; border-radius: 12px; min-height: 44px; font-size: 13px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .field .label { font-size: 15px; font-weight: 600; }
.field .hint { font-size: 13px; color: var(--muted); }
input[type="text"], input[type="number"], input[type="time"], textarea, select {
  width: 100%; min-height: 46px; border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--card); font-size: 16px;
}
textarea { resize: vertical; min-height: 84px; line-height: 1.45; }
fieldset { border: none; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.range-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.range-val { font-family: var(--font-body); font-weight: 800; font-size: 24px; color: var(--accent); min-width: 2ch; text-align: right; }
input[type="range"] { width: 100%; height: 36px; accent-color: var(--accent); margin: 0; }
.range-ends { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.check { display: flex; gap: 12px; align-items: flex-start; background: var(--card); border: 2px solid var(--line); border-radius: 16px; padding: 12px 14px; cursor: pointer; }
.check:has(input:checked) { border-color: var(--accent); }
.check input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--accent); flex-shrink: 0; }
.check .t { font-weight: 700; display: block; }
.check .d { font-size: 13px; color: var(--muted); display: block; margin-top: 2px; }

.lesson p, .lesson li { font-size: 16px; line-height: 1.6; }
.lesson ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.lesson h2 { margin-top: 8px; }
.callout { border-radius: 14px; padding: 14px 16px; font-size: 15px; line-height: 1.5; }
.callout.tip { background: var(--accent-soft); color: var(--accent-soft-ink); }
.callout.key { background: var(--accent); color: var(--accent-ink); font-family: var(--font-body); font-weight: 700; font-size: 16px; }
.callout.key .eyebrow { opacity: .85; font-family: var(--font-body); }
.dial { position: relative; width: 220px; height: 112px; margin: 6px auto 0; }
.dial-arc { position: absolute; inset: 0; border-radius: 110px 110px 0 0; background: conic-gradient(from 270deg at 50% 100%, #B8BC7F 0deg 60deg, #FFFDC1 60deg 120deg, #8A8E3C 120deg 180deg, transparent 180deg); }
.dial-hole { position: absolute; left: 34px; right: 34px; bottom: 0; height: 76px; border-radius: 76px 76px 0 0; background: var(--card); }
.dial-needle { position: absolute; left: 108px; bottom: 0; width: 4px; height: 92px; border-radius: 2px; background: var(--ink); transform-origin: 50% 100%; transition: transform .4s ease; }
.dial-hub { position: absolute; left: 101px; bottom: -9px; width: 18px; height: 18px; border-radius: 9px; background: var(--ink); }
.callout.warn { background: var(--alert-bg); color: var(--alert-ink); }
.callout .eyebrow { display: block; margin-bottom: 4px; }

.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: flex; flex-direction: column; gap: 8px; }
.steps li { counter-increment: s; display: flex; gap: 12px; background: var(--card); border-radius: 14px; padding: 12px 14px; font-size: 15px; line-height: 1.45; }
.steps li::before { content: counter(s); flex-shrink: 0; width: 26px; height: 26px; border-radius: 13px; background: var(--accent-soft); color: var(--accent-soft-ink); font-family: var(--font-body); font-weight: 800; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; }

.stat { display: flex; flex-direction: column; gap: 2px; }
.stat .n { font-family: var(--font-body); font-weight: 800; font-size: 26px; line-height: 1.1; }
.stat .l { font-size: 13px; color: var(--muted); }
.bars { display: grid; gap: 8px; align-items: end; height: 120px; border-bottom: 1px solid var(--line); }
.bars .b { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; }
.bars .b span { font-size: 11px; color: var(--muted); }
.bars .b i { display: block; width: 100%; background: var(--accent-bar); border-radius: 6px 6px 0 0; min-height: 2px; }
.bars .b.now i { background: var(--accent); }
.bars .b.now span { color: var(--accent); font-weight: 700; }
.bar-labels { display: grid; gap: 8px; text-align: center; font-size: 11px; color: var(--muted); padding-top: 6px; }
.meter { display: grid; gap: 6px; }
.meter i { height: 8px; border-radius: 4px; background: var(--line); }
.meter i.on { background: var(--accent); }

.pacer-wrap { display: flex; justify-content: center; padding: 18px 0 6px; }
.pacer { width: 220px; height: 220px; border-radius: 50%; border: 2px solid var(--accent-bar); display: flex; align-items: center; justify-content: center; }
.pacer .orb { width: 200px; height: 200px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-soft-ink); display: flex; align-items: center; justify-content: center; text-align: center; font-family: var(--font-body); font-weight: 700; font-size: 19px; transform: scale(0.7); transition-property: transform; transition-timing-function: ease-in-out; padding: 20px; }
.timer { font-family: var(--font-body); font-weight: 800; font-size: 34px; text-align: center; }

.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: var(--card); border-top: 1px solid var(--line); display: flex; justify-content: center; padding-bottom: env(safe-area-inset-bottom); }
.nav .in { display: flex; width: 100%; max-width: 560px; justify-content: space-around; height: var(--nav-h); align-items: center; }
.nav[hidden] { display: none; }
.nav a { flex: 1; min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; color: var(--muted); text-decoration: none; }
.nav a svg { width: 23px; height: 23px; }
.nav a[aria-current="page"] { color: var(--accent); font-weight: 700; }

.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 14px); transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 22px; font-size: 14px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 30; max-width: calc(100% - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.dots { display: flex; gap: 6px; margin: 4px 0 18px; }
.dots i { flex: 1; height: 5px; border-radius: 3px; background: var(--line); }
.dots i.on { background: var(--accent); }

.paper-wrap { overflow-x: auto; }
.paper { background: #fff; color: #23260A; width: 1060px; padding: 28px; border-radius: 8px; }
.paper h1 { font-size: 26px; }
.paper table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 12px; }
.paper th, .paper td { border: 1px solid #B8BC7F; padding: 7px; text-align: left; vertical-align: top; }
.paper th { background: #DFE777; }
.paper td.day { font-weight: 700; }
.paper .opt { font-size: 11px; color: #4C5033; }
.paper .boxes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.paper .box { border: 1px solid #B8BC7F; border-radius: 8px; padding: 10px; min-height: 90px; font-size: 13px; font-weight: 600; }
.summary-sheet { background: var(--card); border-radius: var(--radius); padding: 20px; }
.summary-sheet h2 { margin-top: 16px; font-size: 16px; }
.summary-sheet ul { padding-left: 20px; margin: 6px 0 0; }

/* welcome page */
.welcome-hero { background: var(--accent); color: var(--accent-ink); border-radius: 28px; padding: 28px 22px 26px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.welcome-hero img { width: 72px; height: 72px; }
.welcome-hero h1 { font-size: 31px; line-height: 1.08; }
.welcome-hero p { font-size: 16px; line-height: 1.55; opacity: .92; max-width: 34ch; }
.welcome-note { margin-top: 14px; border-left: none; }
.welcome-note p { font-size: 16px; line-height: 1.6; }
.welcome-note .sig { margin-top: 10px; font-family: var(--font-body); font-weight: 700; font-size: 14px; color: var(--muted); }
.welcome-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.welcome-tile { display: flex; flex-direction: column; gap: 4px; padding: 14px; }
.welcome-tile svg { color: var(--accent); margin-bottom: 4px; }
.welcome-tile b { font-size: 15px; }

/* tap-through lessons */
body.lesson-mode main { padding-bottom: calc(100px + env(safe-area-inset-bottom)); overflow-x: clip; }
.lesson-top { display: flex; align-items: center; gap: 8px; margin: -8px -8px 4px; }
.seg-progress { flex: 1; display: grid; gap: 4px; }
.seg-progress i { height: 5px; border-radius: 3px; background: var(--line); }
.seg-progress i.on { background: var(--accent); }
.lesson-card { background: var(--card); border-radius: 24px; padding: 24px 20px; min-height: calc(100vh - 230px); display: flex; flex-direction: column; gap: 14px; }
.lesson-card p, .lesson-card li { font-size: 17px; line-height: 1.6; }
.lesson-card h1 { font-size: 28px; }
.lesson-card h2 { font-size: 22px; margin-top: 0; }
.lesson-card .card { padding: 0; background: transparent; }
.lesson-card .callout { font-size: 16px; }
.keycard { background: var(--accent); color: var(--accent-ink); justify-content: center; }
.keycard .eyebrow { opacity: .8; }
.keycard p { font-family: var(--font-display); font-stretch: 75%; font-weight: 800; font-size: 26px; line-height: 1.18; text-wrap: balance; }
.lesson-card[data-dir="fwd"] { animation: cardIn .28s ease-out; }
.lesson-card[data-dir="back"] { animation: cardBack .28s ease-out; }
@keyframes cardIn { from { opacity: .3; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes cardBack { from { opacity: .3; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
.lesson-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: var(--bg); border-top: 1px solid var(--line); padding: 12px max(16px, env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
.lesson-bar .in { max-width: 528px; margin: 0 auto; display: flex; gap: 10px; }
.lesson-bar .in > * { flex: 1; }
.quiz-q { font-weight: 700; font-size: 20px !important; line-height: 1.4 !important; }
.quiz-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.flips { display: grid; gap: 10px; }
.flip { text-align: left; border: 2px solid var(--line-strong); background: var(--card); border-radius: 16px; padding: 14px 16px; min-height: 80px; cursor: pointer; font-size: 16px; line-height: 1.45; color: var(--ink); transition: background .2s, border-color .2s; }
.flip .lbl { display: block; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; margin-bottom: 4px; color: var(--muted); }
.flip .back { display: none; }
.flip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-soft-ink); }
.flip[aria-pressed="true"] .front { display: none; }
.flip[aria-pressed="true"] .back { display: block; }
.flip[aria-pressed="true"] .lbl { color: var(--accent-soft-ink); }
.sort-item { background: var(--bg); border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; font-size: 15px; }
.sort-item .chip { min-height: 36px; font-size: 13px; }
.chip:disabled { cursor: default; opacity: .85; }
.quiz-opt { min-height: 60px; border-radius: 16px; border: 2px solid var(--line-strong); background: var(--card); font-size: 17px; font-weight: 700; cursor: pointer; }
.quiz-opt:hover { border-color: var(--accent); }

@media print {
  @page { size: A4 landscape; margin: 10mm; }
  body { background: #fff; color: #000; }
  .nav, .no-print, .toast, .skip { display: none !important; }
  main { padding: 0; max-width: none; }
  .paper-wrap { overflow: visible; }
  .paper { width: auto; padding: 0; }
  .summary-sheet { padding: 0; }
}
body.print-portrait { }
@media print { body.print-portrait { } }

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

.rem-row { justify-content: space-between; align-items: center; gap: 12px; padding: 4px 0; cursor: pointer; }
.rem-row input { width: 22px; height: 22px; margin: 0; accent-color: var(--accent); flex-shrink: 0; }

.lib-q { width: 100%; min-height: 48px; border: 2px solid var(--line); border-radius: 14px; background: var(--card); color: var(--ink); font: inherit; padding: 0 14px; }
.lib-q:focus { border-color: var(--accent); outline: none; }
.lib-areas { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.lib-areas::-webkit-scrollbar { display: none; }
.lib-areas .chip { flex-shrink: 0; }
.lib-items > [hidden] { display: none !important; }

.fold { background: var(--card); border-radius: 18px; border: 1.5px solid var(--line); }
.fold > summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; min-height: 56px; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fold > summary .title { font-weight: 700; font-size: 17px; }
.fold > summary .meta { font-size: 13px; color: var(--muted); }
.fold-kicker { font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.fold-chev { transform: rotate(90deg); transition: transform .2s; color: var(--muted); flex-shrink: 0; }
.fold[open] > summary .fold-chev { transform: rotate(-90deg); }
.fold-in { padding: 0 14px 14px; display: flex; flex-direction: column; }
.fold-in .item { background: var(--bg); }

/* Calm wave (replaces the countdown timer) */
.wave { position: relative; height: 300px; border-radius: 28px; overflow: hidden; background: linear-gradient(180deg, var(--card) 0%, var(--bg) 100%); border: 1.5px solid var(--line); }
.wave svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.wave .tide { transform: translateY(110px); }
.wave .w { animation: wave-drift 14s linear infinite; }
.wave .w1 { fill: var(--accent-soft); opacity: .95; animation-duration: 11s; }
.wave .w2 { fill: var(--accent-bar); opacity: .55; animation-duration: 16s; animation-direction: reverse; }
.wave .w3 { fill: var(--accent-bar); opacity: .3; animation-duration: 23s; }
.wave:not(.on) .w { animation-duration: 30s; }
@keyframes wave-drift { from { transform: translateX(0); } to { transform: translateX(-400px); } }
.wave-text { position: absolute; left: 0; right: 0; top: 22px; padding: 0 22px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.wave-label { font-family: var(--font-display); font-stretch: 75%; font-weight: 800; font-size: 28px; line-height: 1.15; color: var(--ink); min-height: 0; }
.wave-label:empty { display: none; }
.wave-step { font-size: 19px; line-height: 1.4; color: var(--ink); max-width: 30ch; opacity: 1; transform: translateY(0); transition: opacity .7s ease, transform .7s ease; }
.wave-step.out { opacity: 0; transform: translateY(6px); }
.wave-sound { position: absolute; right: 12px; bottom: 12px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--card); color: var(--ink); display: flex; align-items: center; justify-content: center; cursor: pointer; opacity: .9; z-index: 2; }
.wave.done .wave-label { color: var(--accent-soft-ink, var(--ink)); }
@media (prefers-reduced-motion: reduce) { .wave .w { animation: none; } .wave-step { transition: none; } }
.wave-label:empty + .wave-step { font-size: 23px; line-height: 1.35; margin-top: 14px; font-weight: 500; }

/* Pictures in lessons */
.lesson-img { margin: 4px 0; }
.lesson-img img { display: block; width: 100%; height: auto; border-radius: 18px; background: var(--card); }
.lesson-img figcaption { font-size: 14px; color: var(--muted); margin-top: 6px; text-align: center; }

/* First-open intro pages */
.intro { min-height: calc(100vh - 140px); display: flex; flex-direction: column; }
.intro-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.intro-top .dots { margin: 0; }
.link-btn { background: none; border: 0; color: var(--muted); font: inherit; font-weight: 600; padding: 8px 4px; cursor: pointer; }
.intro-page { display: flex; flex-direction: column; gap: 14px; animation: intro-in .45s ease; }
@keyframes intro-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.intro-hero { background: var(--accent); color: var(--accent-ink); border-radius: 28px; padding: 40px 24px 36px; text-align: center; align-items: center; margin-top: 4vh; }
.intro-hero img { width: 112px; height: 112px; }
.intro-hero h1 { font-size: 36px; line-height: 1.05; color: inherit; }
.intro-hero .lead { font-family: var(--font-display); font-stretch: 75%; font-weight: 800; font-size: 22px; line-height: 1.2; }
.intro-hero p { max-width: 32ch; opacity: .94; }
@media (prefers-reduced-motion: reduce) { .intro-page { animation: none; } }
.intro-top .dots { flex: 1; max-width: 200px; }
.intro .lesson-bar [data-act="intro-back"] { flex: 0 0 56px; width: 56px; padding: 0; justify-content: center; }
.intro .lesson-bar .btn:last-child { flex: 1; }
.intro-top { min-height: 40px; }

.lib-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.lib-filters select { min-height: 44px; font-size: 15px; }

.mail-alt { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.mail-alt .btn { flex: 1; }

/* Exercise logging */
.ex-card { background: var(--card); border-radius: 18px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; border: 1.5px solid transparent; }
.ex-card.done { border-color: var(--accent-bar); }
.ex-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.ex-head > span { display: flex; flex-direction: column; gap: 2px; }
.ex-head .meta { font-size: 13px; color: var(--muted); }
.ex-sets { display: flex; flex-wrap: wrap; gap: 6px; }
.set-chip { border: 0; background: var(--accent-soft); color: var(--accent-soft-ink); border-radius: 999px; padding: 6px 11px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.ex-log { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ex-log .btn { margin-left: auto; }
.stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--line-strong); border-radius: 999px; overflow: hidden; }
.stepper button { width: 40px; height: 40px; border: 0; background: transparent; font-size: 20px; font-weight: 700; color: var(--ink); cursor: pointer; }
.stepper output { min-width: 34px; text-align: center; font-weight: 800; font-size: 17px; }
.pill { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .03em; background: var(--accent-soft); color: var(--accent-soft-ink); border-radius: 999px; padding: 2px 8px; vertical-align: 2px; margin-left: 4px; }
.week-card { margin-bottom: 12px; }
.week-dots { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); }
.week-dots span { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.week-dots i { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line-strong); display: flex; align-items: center; justify-content: center; }
.week-dots .on i { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.week-dots .today { color: var(--ink); }
.week-stats { display: flex; gap: 10px; }
.week-stats > div { flex: 1; background: var(--bg); border-radius: 14px; padding: 8px 10px; display: flex; flex-direction: column; }
.week-stats b { font-size: 22px; font-weight: 800; line-height: 1.1; }
.week-stats span { font-size: 12px; color: var(--muted); }
.week-list { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--line); padding-top: 8px; }

/* Breathing circle: grows on the in-breath, shrinks on the out-breath */
.wave.has-orb { height: 340px; }
.breath-orb { position: absolute; left: 50%; top: 64%; width: 170px; height: 170px; border-radius: 50%; z-index: 1;
  background: radial-gradient(circle at 50% 45%, rgba(255,253,193,.95) 0%, rgba(223,231,119,.9) 60%, rgba(184,188,127,.85) 100%);
  box-shadow: 0 0 0 10px rgba(223,231,119,.25), 0 0 40px rgba(184,188,127,.35);
  transform: translate(-50%, -50%) scale(.45); pointer-events: none; }
.wave.has-orb .wave-text { z-index: 2; }

.week-link { margin-top: 14px; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 16px; text-decoration: none; color: inherit; }
.week-link-go { font-weight: 700; white-space: nowrap; }
.cat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.cat-tile { background: var(--card); border: 1.5px solid var(--line); border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: inherit; }
.fold-in .cat-tile { background: var(--bg); }
.cat-tile b { font-size: 15px; }
.cat-tile span { font-size: 12px; color: var(--muted); }
.added-tag { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: var(--muted); white-space: nowrap; }
a.card.week-link { display: flex; justify-content: space-between; align-items: center; gap: 16px; }

.factors > summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.factors > summary::-webkit-details-marker { display: none; }
.factors > summary::after { content: "+"; font-size: 22px; color: var(--muted, #777); }
.factors[open] > summary::after { content: "–"; }
.factor { display: grid; gap: 6px; }
.factor .seg .chip { font-size: 12.5px; min-height: 40px; line-height: 1.15; }

.week-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 10px; font-size: 14px; font-weight: 600; }
.week-nav a { color: var(--ink); text-decoration: none; }
.delta { font-size: 13px; font-weight: 700; color: var(--warm-strong); margin-left: 6px; }
.delta.good { color: var(--accent-soft-ink); }
.week-list { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.bars a.b { text-decoration: none; color: inherit; }
