:root {
  color-scheme: dark;
  --bg: #0e1014;
  --card: #171b22;
  --card-2: #212733;
  --line: #313846;
  --text: #f7f4ee;
  --muted: #b7c0cc;
  --gold: #f0b429;
  --gold-ink: #1a1406;
  --teal: #6ec4c0;
  --blue: #3e8eae;
  --red: #ff8f84;
  --green: #8ed39a;
  --nav: calc(72px + env(safe-area-inset-bottom));
  --header: calc(48px + env(safe-area-inset-top));
  font-family: "Segoe UI", "Helvetica Neue", system-ui, sans-serif;
  font-size: 18px;
  line-height: 1.45;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  min-height: 100dvh;
  background:
    radial-gradient(900px 320px at 50% -8%, rgba(240, 180, 41, 0.16), transparent 60%),
    var(--bg);
}
button, input { font: inherit; color: inherit; }
a { color: var(--gold); }
img, svg { max-width: 100%; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.top {
  position: sticky;
  top: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header);
  padding: env(safe-area-inset-top) 16px 0;
  background: rgba(14, 16, 20, 0.94);
  border-bottom: 1px solid var(--line);
}
.brand {
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: 1.25rem;
}
.brand span { color: var(--gold); }
.net {
  border: 1px solid var(--gold);
  color: var(--gold);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 16px;
}
.disclaimer {
  position: sticky;
  top: var(--header);
  z-index: 5;
  margin: 0;
  padding: 8px 16px;
  background: #2a2112;
  color: #f6e3b0;
  border-bottom: 1px solid #5a4318;
  font-size: 16px;
  line-height: 1.35;
}

main {
  max-width: 480px;
  margin: 0 auto;
  padding: 14px 16px var(--nav);
}

h1 { font-size: 1.7rem; line-height: 1.15; margin: 0 0 8px; letter-spacing: -0.03em; scroll-margin-top: 130px; }
h2 { font-size: 1.25rem; line-height: 1.2; margin: 0 0 8px; scroll-margin-top: 130px; }
#mistakes, #muscles, #maps, #setup, #steps, #breathing, #safety { scroll-margin-top: 130px; }
h3 { font-size: 1.05rem; margin: 0 0 6px; }
p { margin: 0 0 10px; }
.lede { color: var(--muted); margin-bottom: 12px; }
.muted { color: var(--muted); }
.fine { color: var(--muted); font-size: 16px; margin: 8px 0 0; }
.kicker {
  display: block;
  color: var(--gold);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.search input {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  min-height: 52px;
}
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 0 4px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip, .seg button, .ex-actions button, .w-actions button, .back, .text-btn {
  min-height: 48px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  padding: 8px 14px;
  white-space: nowrap;
}
.chip[aria-pressed="true"], .seg button[aria-pressed="true"] {
  background: var(--gold);
  color: var(--gold-ink);
  border-color: var(--gold);
  font-weight: 700;
}
.seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 8px 0;
}
.seg button { border-radius: 12px; }

.map-card {
  background: linear-gradient(#1c212b, #12151b);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 8px;
}
.map-lg svg { height: 390px; width: auto; display: block; margin: 0 auto; }
.map-compact svg { height: 220px; width: auto; display: block; margin: 0 auto; }
.body-map .base { fill: #4e586a; }
.body-map .head { fill: #5c6778; }
.body-map .joint { stroke: #2a3140; stroke-width: 14; stroke-linecap: round; }
.body-map .shadow { fill: #000; opacity: 0.28; }
.body-map .crease { stroke: #12151c; stroke-width: 3; }
.body-map g.hot > * { fill: #8d98aa; stroke: #12151c; stroke-width: 3; }
.body-map g.hot.primary > * { fill: var(--gold); }
.body-map g.hot.secondary > * { fill: var(--blue); }
.body-map g.hot[aria-pressed="true"] > * { fill: var(--gold); stroke: #ffe7a3; }
.body-map[data-interactive="true"] g.hot { cursor: pointer; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 16px; margin: 8px 0 0; }
.swatch { width: 14px; height: 14px; border-radius: 4px; display: inline-block; margin-right: 6px; vertical-align: -2px; }
.swatch.primary { background: var(--gold); }
.swatch.secondary { background: var(--blue); }
.detail-maps { display: flex; justify-content: center; gap: 8px; }
.detail-maps figure { margin: 0; }
.detail-maps svg { height: 280px; width: auto; display: block; }
.detail-maps figcaption { text-align: center; color: var(--muted); font-size: 16px; }

.card, .ex, .mistake, .var {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  margin: 12px 0;
}
.ex { display: grid; gap: 10px; }
.ex-main { color: inherit; text-decoration: none; display: grid; gap: 4px; }
.ex-main strong { font-size: 1.15rem; }
.ex-actions, .actions, .w-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ex-actions button, .actions button, .w-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 12px;
}
button.primary, .actions button.primary {
  background: var(--gold);
  color: var(--gold-ink);
  border-color: var(--gold);
  font-weight: 700;
}
button[aria-pressed="true"].quiet, .ex-actions button[aria-pressed="true"] {
  border-color: var(--gold);
  color: var(--gold);
}
.heart { width: 18px; height: 18px; display: block; }

.seq { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.seq-frame {
  margin: 0;
  border: 2px solid #2c3340;
  border-radius: 14px;
  overflow: hidden;
  background: #101318;
  animation: step 3.6s infinite;
}
.seq-frame:nth-child(2) { animation-delay: 1.2s; }
.seq-frame:nth-child(3) { animation-delay: 2.4s; }
.seq-frame svg { width: 100%; height: auto; display: block; background: #101318; }
.seq figcaption { text-align: center; font-size: 16px; color: var(--muted); padding: 0 4px 8px; }
.seq .limb { stroke: #f4f1ea; stroke-width: 5; stroke-linecap: round; fill: none; }
.seq .head { fill: #101318; stroke: #f4f1ea; stroke-width: 3; }
.seq .bar, .seq .plate { stroke: var(--gold); stroke-width: 4; stroke-linecap: round; }
.seq .bell { fill: var(--gold); }
.seq .bench, .seq .seat { stroke: var(--teal); stroke-width: 5; stroke-linecap: round; }
.seq .cable { stroke: #8b95a8; stroke-width: 2; stroke-dasharray: 3 3; }
.seq .floor { stroke: #3c4454; stroke-width: 2; }
@keyframes step {
  0%, 28% { border-color: var(--gold); background: #241e12; }
  34%, 100% { border-color: #2c3340; background: #101318; }
}

.steps, .basics-list { list-style: none; padding: 0; margin: 0; }
.steps li { display: grid; grid-template-columns: 36px 1fr; gap: 10px; margin: 0 0 14px; }
.n {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #3a2d12;
  color: var(--gold);
  display: grid;
  place-items: center;
  font-weight: 800;
}
.callout {
  background: #142028;
  border: 1px solid #24515a;
  border-radius: 16px;
  padding: 14px;
  margin: 12px 0;
}
.callout strong { color: var(--teal); }
.mistake { border-left: 4px solid var(--red); }
.mistake h3 { display: flex; align-items: center; gap: 10px; }
.fix { color: var(--green); }
.var { display: grid; gap: 4px; color: inherit; text-decoration: none; }
.var strong { color: var(--text); }
.back { display: inline-flex; align-items: center; text-decoration: none; color: var(--text); margin-bottom: 8px; }

.w-top { display: flex; gap: 12px; align-items: center; }
.check {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 14px;
  border: 2px solid var(--line);
  background: transparent;
  padding: 0;
}
.check[aria-pressed="true"] { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); }
.bar { height: 10px; background: #2a3140; border-radius: 99px; overflow: hidden; margin: 8px 0 12px; }
.bar span { display: block; height: 100%; background: var(--gold); }
.row-link { color: inherit; text-decoration: none; display: grid; gap: 2px; flex: 1; }
ul.plain { padding-left: 1.1rem; }
ul.plain li { margin: 0 0 8px; }
.start { display: grid; gap: 8px; }
.start a, .basic-link {
  display: grid;
  gap: 2px;
  text-decoration: none;
  color: inherit;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  min-height: 48px;
}

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 6;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: #141820;
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
  position: relative;
  color: var(--muted);
  text-decoration: none;
  text-align: center;
  font-size: 16px;
  min-height: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.tabbar svg { width: 22px; height: 22px; }
.tabbar a[aria-current="page"] { color: var(--gold); }
.badge {
  position: absolute;
  top: 6px;
  right: calc(50% - 28px);
  background: var(--gold);
  color: var(--gold-ink);
  border-radius: 99px;
  min-width: 18px;
  font-size: 14px;
  font-weight: 800;
  padding: 0 4px;
}

.empty { color: var(--muted); }
.section-label { margin: 18px 0 8px; }

@media (prefers-reduced-motion: reduce) {
  .seq-frame { animation: none; }
}

.plan-cta { display: grid; gap: 2px; margin: 14px 0 4px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--teal); text-decoration: none; color: inherit; }
.plan-cta strong { color: var(--teal); }
.plan-day .start { margin-top: 8px; }
