/* SomaVista — editorial reading pages + a dark, spacious anatomy workspace.
   Fonts: Lora and Inter (SIL OFL 1.1), self-hosted. */

@font-face { font-family: "Lora"; src: url("/somavista-anatomy/assets/fonts/lora-var.woff") format("woff"); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Lora"; src: url("/somavista-anatomy/assets/fonts/lora-italic-var.woff") format("woff"); font-weight: 400 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/somavista-anatomy/assets/fonts/inter-400.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/somavista-anatomy/assets/fonts/inter-500.woff") format("woff"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/somavista-anatomy/assets/fonts/inter-600.woff") format("woff"); font-weight: 600; font-display: swap; }

:root {
  --ink: #16171a; --char: #1d1e21; --char-2: #26272b; --char-3: #34353a; --char-line: rgba(238, 234, 226, .12);
  --paper: #f4f1ea; --paper-2: #ebe6db; --stone: #d6cfc0; --line: rgba(22, 23, 26, .14); --line-2: rgba(22, 23, 26, .3);
  --text-d: #eeeae2; --muted: #5c5850; --muted-d: #aaa59b;
  --red: #b8322a; --red-h: #9c2922; --red-b: #f0675d;
  --serif: "Lora", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --wrap: 1280px; --pad: clamp(16px, 4vw, 48px); --top: 56px; --ease: cubic-bezier(.2, .7, .2, 1);
  --sw-skeletal: #e6dccb; --sw-cardiovascular: #b8473f; --sw-respiratory: #d99a96;
  --sw-digestive: #c48a5c; --sw-urinary: #c9a948; --sw-nervous: #a596c8;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1.0625rem/1.62 var(--sans); }
img, svg, canvas { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3, p, ul, ol, dl, dd, figure, fieldset { margin: 0; }
ul, ol { padding: 0; }
a { color: inherit; text-underline-offset: 3px; }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
.app-page :focus-visible, .topbar :focus-visible, .band-dark :focus-visible, .footer :focus-visible { outline-color: var(--red-b); }
.sr-only { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--red); color: #fff; padding: 10px 14px; text-decoration: none; font-weight: 600; }
.skip:focus { top: 10px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding-inline: var(--pad); }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
main { outline: none; }

/* type */
.kicker { font: 600 .74rem/1.4 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: .9rem; }
.display { font: 500 clamp(2.6rem, 6.4vw, 5.6rem)/1.02 var(--serif); letter-spacing: -.02em; max-width: 13ch; }
.display em, .brand-word em { font-style: italic; color: var(--red); }
.display-s { font: 500 clamp(2.2rem, 5vw, 4rem)/1.05 var(--serif); letter-spacing: -.015em; max-width: 18ch; }
.h2 { font: 500 clamp(1.6rem, 2.8vw, 2.4rem)/1.15 var(--serif); letter-spacing: -.01em; margin-bottom: .7rem; }
.h3 { font: 600 1.15rem/1.3 var(--sans); margin-bottom: .4rem; }
.lede { font-size: clamp(1.1rem, 1.5vw, 1.3rem); line-height: 1.55; max-width: 60ch; margin-top: 1.2rem; }
.section-lede { color: var(--muted); max-width: 60ch; margin-bottom: 2rem; }

/* buttons */
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 2rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; min-height: 48px; padding: 12px 22px; border-radius: 999px; border: 1.5px solid transparent; font-weight: 600; font-size: 1rem; text-decoration: none; cursor: pointer; transition: background-color .2s, color .2s, border-color .2s; }
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { background: var(--red-h); }
.btn-line { border-color: var(--line-2); background: transparent; }
.btn-line:hover { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.btn-s { min-height: 40px; padding: 8px 16px; font-size: .92rem; }

/* header */
.topbar { position: sticky; top: 0; z-index: 40; background: var(--char); color: var(--text-d); border-bottom: 1px solid var(--char-line); }
.topbar-inner { max-width: var(--wrap); margin: 0 auto; padding-inline: var(--pad); min-height: var(--top); display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.app-page .topbar-inner { max-width: none; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-word { font: 500 1.25rem/1 var(--serif); letter-spacing: -.01em; }
.topbar .brand-word em, .footer .brand-word em { color: var(--red-b); }
.mark-dot { fill: var(--red-b); }
.site-nav ul { list-style: none; display: flex; gap: 6px 26px; flex-wrap: wrap; }
.site-nav a { display: inline-block; padding: 8px 0; text-decoration: none; color: var(--muted-d); font-size: .95rem; position: relative; }
.site-nav a:hover, .site-nav a[aria-current] { color: var(--text-d); }
.site-nav a[aria-current]::after { content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 2px; background: var(--red-b); }
.menu-btn { display: none; }
@media (max-width: 760px) {
  .js .menu-btn { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 14px; background: none; border: 1px solid var(--char-line); border-radius: 999px; color: var(--text-d); cursor: pointer; font-size: .85rem; }
  .menu-bars, .menu-bars::before { display: block; width: 16px; height: 1.5px; background: currentColor; position: relative; }
  .menu-bars::before { content: ""; position: absolute; top: 5px; }
  .js .site-nav { position: absolute; top: var(--top); left: 0; right: 0; background: var(--char); border-bottom: 1px solid var(--char-line); padding: 8px var(--pad) 16px; display: none; }
  .js .site-nav.is-open { display: block; }
  .js .site-nav ul { flex-direction: column; gap: 0; }
  .js .site-nav a { display: block; padding: 14px 0; font-size: 1.1rem; border-top: 1px solid var(--char-line); }
  .js .site-nav a[aria-current]::after { bottom: 8px; width: 24px; right: auto; }
}

/* home */
.hero { padding: clamp(48px, 7vw, 104px) 0 clamp(40px, 6vw, 80px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 64px); align-items: center; }
.hero-figure { background: var(--char); border-radius: 18px; overflow: hidden; }
.hero-figure img { width: 100%; }
.hero-figure figcaption { color: var(--muted-d); font-size: .8rem; padding: 10px 16px 14px; }
.band { background: var(--paper-2); padding: clamp(56px, 7vw, 96px) 0; }
.band-dark { background: var(--char); color: var(--text-d); }
.band-dark .section-lede { color: var(--muted-d); }
.systems-grid { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.sys-card { background: var(--paper); padding: 22px 22px 26px; }
.sys-card p:last-child { color: var(--muted); font-size: .95rem; }
.sys-count { font: 500 2.6rem/1 var(--serif); margin: 14px 0 6px; }
.sys-name { font: 600 1.05rem/1.3 var(--sans); margin-bottom: .5rem; }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .25); flex: none; vertical-align: middle; }
.swatch-skeletal { background: var(--sw-skeletal); } .swatch-cardiovascular { background: var(--sw-cardiovascular); }
.swatch-respiratory { background: var(--sw-respiratory); } .swatch-digestive { background: var(--sw-digestive); }
.swatch-urinary { background: var(--sw-urinary); } .swatch-nervous { background: var(--sw-nervous); }
.how { padding-block: clamp(56px, 7vw, 96px); }
.steps { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; margin-top: 1.4rem; }
.steps li { border-top: 2px solid var(--ink); padding-top: 16px; }
.steps p { color: var(--muted); font-size: .97rem; }
.ico { width: 30px; height: 30px; color: var(--red); margin-bottom: 12px; }
.limits { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 40px; }
.limit-list { list-style: none; }
.limit-list li { padding: 14px 0 14px 28px; border-top: 1px solid var(--char-line); position: relative; }
.limit-list li::before { content: ""; position: absolute; left: 0; top: 1.35em; width: 14px; height: 1.5px; background: var(--red-b); }
.notice { margin: clamp(40px, 6vw, 72px) 0; border-left: 4px solid var(--red); background: #fff; padding: 20px 24px; border-radius: 0 12px 12px 0; }
.notice-title { font-weight: 600; margin-bottom: .4rem; }
.notice p:last-child { color: var(--muted); }

/* page heads, text view */
.page-head { padding: clamp(44px, 6vw, 88px) 0 clamp(28px, 4vw, 48px); border-bottom: 1px solid var(--line); margin-bottom: clamp(28px, 4vw, 48px); }
.toc ul { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 1.6rem; }
.toc a { display: inline-block; padding: 8px 14px; border: 1px solid var(--line-2); border-radius: 999px; text-decoration: none; font-size: .95rem; }
.toc a:hover { border-color: var(--ink); }
.tv-system { margin-bottom: clamp(48px, 6vw, 80px); scroll-margin-top: calc(var(--top) + 16px); }
.tv-system .h2 { display: flex; align-items: center; gap: 12px; }
.coverage, .refs { max-width: 72ch; margin-bottom: .6rem; }
.refs { font-size: .95rem; color: var(--muted); }
.tv-group { margin-top: 2rem; }
.tv-list { border-top: 1px solid var(--line-2); }
.tv-item { display: grid; grid-template-columns: minmax(0, 18rem) minmax(0, 1fr); gap: 6px 24px; padding: 12px 0; border-bottom: 1px solid var(--line); scroll-margin-top: calc(var(--top) + 16px); }
.tv-item:target { background: #fff; box-shadow: -8px 0 0 #fff, 8px 0 0 #fff; }
.tv-item dt { font-weight: 600; }
.tv-meta { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 4px; font-size: .85rem; color: var(--muted); }
.ref-inline { display: block; font-size: .85rem; color: var(--muted); }

/* lessons */
.lesson-list { list-style: none; border-top: 1px solid var(--line-2); }
.lesson-row a { display: grid; grid-template-columns: 4rem minmax(0, 1fr) auto; gap: 4px 20px; padding: 22px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.lesson-row a:hover .lesson-title { color: var(--red); }
.lesson-num { font: 500 1.6rem/1 var(--serif); color: var(--red); grid-row: span 2; }
.lesson-title { font: 500 1.5rem/1.2 var(--serif); }
.lesson-dek { grid-column: 2; color: var(--muted); }
.lesson-meta { grid-column: 3; grid-row: 1; font-size: .85rem; color: var(--muted); }
.progress-box { margin-top: 48px; padding: 24px; background: #fff; border-radius: 14px; display: grid; gap: 12px; justify-items: start; }
.toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.toggle input { width: 18px; height: 18px; accent-color: var(--red); }
.crumbs ol { list-style: none; display: flex; gap: 8px; font-size: .88rem; color: var(--muted); margin-bottom: 1.4rem; }
.crumbs li + li::before { content: "/"; margin-right: 8px; }
.lesson-grid { display: grid; grid-template-columns: minmax(0, 16rem) minmax(0, 1fr); gap: clamp(24px, 5vw, 72px); }
.lesson-aside { position: sticky; top: calc(var(--top) + 24px); align-self: start; }
.obj-list { list-style: none; }
.obj-list li { padding: 10px 0; border-top: 1px solid var(--line); font-size: .95rem; }
.lesson-body { max-width: 44rem; }
.lesson-sec { margin-bottom: 3rem; }
.lesson-sec p + p { margin-top: 1rem; }
.view-links { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 1.2rem; }
.mcq { border: 1px solid var(--line-2); border-radius: 14px; padding: 18px 20px 20px; margin-top: 16px; }
.mcq legend { font-weight: 600; padding: 0 6px; }
.opt { display: flex; align-items: flex-start; gap: 10px; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.opt input { margin-top: .3em; width: 18px; height: 18px; accent-color: var(--red); flex: none; }
.opt:hover { background: var(--paper-2); }
.opt.is-right { background: #e3efe2; } .opt.is-wrong { background: #f6e1de; }
.mcq-why { margin-top: 10px; padding: 10px 12px; background: #fff; border-radius: 8px; font-size: .95rem; }
.mcq-why strong { display: block; }
.ref-list { list-style: none; }
.ref-list li { padding: 8px 0; border-top: 1px solid var(--line); }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 2rem; }
.pager a { display: block; padding: 18px 0; border-top: 2px solid var(--ink); text-decoration: none; font: 500 1.2rem/1.3 var(--serif); }
.pager .kicker { margin-bottom: .3rem; }
.pager-next { text-align: right; }

/* quiz */
.quiz { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(20px, 4vw, 48px); align-items: start; }
.quiz-stage { background: var(--char); border-radius: 18px; min-height: 420px; position: relative; overflow: hidden; display: grid; place-items: center; color: var(--text-d); }
.quiz-canvas { width: 100%; height: 520px; touch-action: none; }
.quiz-desc { padding: 32px; font: 500 1.4rem/1.45 var(--serif); }
.quiz-stage .stage-msg-sub { position: absolute; inset: auto 0 16px; text-align: center; color: var(--muted-d); }
.quiz-feedback { margin-top: 14px; }
.quiz-feedback .verdict { font-weight: 600; }

/* credits */
.credits section { margin-bottom: 3rem; max-width: 60rem; }
.kv > div { display: grid; grid-template-columns: 12rem minmax(0, 1fr); gap: 6px 24px; padding: 12px 0; border-top: 1px solid var(--line); }
.kv dt { font-weight: 600; }
.kv ul { padding-left: 1.1rem; }
.kv li + li { margin-top: .4rem; }
code { font-size: .9em; background: var(--paper-2); padding: 1px 5px; border-radius: 4px; overflow-wrap: anywhere; }

/* footer */
.footer { background: var(--ink); color: var(--text-d); padding: 56px 0 24px; margin-top: 40px; }
.footer .kicker { color: var(--muted-d); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, .6fr); gap: 32px; }
.footer-brand { margin-bottom: 16px; }
.footer-note { color: var(--muted-d); font-size: .92rem; max-width: 46ch; }
.footer-note + .footer-note { margin-top: .6rem; }
.footer-note strong { color: var(--text-d); font-weight: 600; }
.footer-links { list-style: none; }
.footer-links a { display: inline-block; padding: 4px 0; text-decoration: none; }
.footer-links a:hover { color: var(--red-b); }
.footer-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--char-line); font-size: .82rem; color: var(--muted-d); }

/* ============================ EXPLORER ============================ */
.app-page { background: var(--char); color: var(--text-d); }
.app { display: grid; grid-template-columns: 300px minmax(0, 1fr) 340px; grid-template-areas: "left stage right"; height: calc(100dvh - var(--top)); outline: none; }
.app-tabs { display: none; }
.panel { background: var(--char-2); min-height: 0; overflow: auto; }
.panel-left { grid-area: left; border-right: 1px solid var(--char-line); display: flex; flex-direction: column; overflow: hidden; }
.panel-right { grid-area: right; border-left: 1px solid var(--char-line); padding: 20px; display: flex; flex-direction: column; gap: 20px; }
.panel-section { padding: 16px 16px 12px; }
.panel-list { flex: 1; min-height: 0; display: flex; flex-direction: column; border-top: 1px solid var(--char-line); }
.panel-h { font: 600 .74rem/1.4 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted-d); margin-bottom: 10px; }
.sys-toggles { list-style: none; display: grid; gap: 2px; }
.sys-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px; border-radius: 8px; }
.sys-row:hover { background: var(--char-3); }
.sys-row .toggle { flex: 1; min-height: 32px; font-size: .95rem; }
.sys-status { font-size: .78rem; color: var(--muted-d); text-align: right; }
.sys-status button { background: none; border: 1px solid var(--red-b); color: var(--red-b); border-radius: 999px; padding: 2px 10px; cursor: pointer; font-size: .78rem; }
.search input { width: 100%; min-height: 44px; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--char-line); background: var(--char); color: var(--text-d); font-size: 1rem; }
.search input::placeholder { color: #8d887f; }
.search input:focus { border-color: var(--red-b); outline: none; box-shadow: 0 0 0 3px rgba(240, 103, 93, .3); }
.list-status { font-size: .82rem; color: var(--muted-d); margin: 8px 2px; min-height: 1.2em; }
.struct-list { flex: 1; overflow: auto; margin: 0 -8px; padding: 0 8px 16px; outline: none; }
.sl-sys { margin-top: 10px; }
.sl-sys > h3 { display: flex; align-items: center; gap: 8px; font: 600 .8rem/1.4 var(--sans); color: var(--text-d); padding: 8px 4px 4px; position: sticky; top: 0; background: var(--char-2); z-index: 1; }
.sl-sys.is-off > h3 { color: var(--muted-d); }
.sl-group > h4 { font: 500 .72rem/1.4 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted-d); padding: 8px 4px 2px; }
.sl-items { list-style: none; }
.sl-item { display: block; width: 100%; text-align: left; background: none; border: 0; border-radius: 6px; padding: 7px 8px; font-size: .92rem; line-height: 1.3; color: var(--text-d); cursor: pointer; }
.sl-item:hover { background: var(--char-3); }
.sl-item[aria-pressed="true"] { background: var(--red); color: #fff; }
.sl-item.is-hidden { color: var(--muted-d); text-decoration: line-through; }
.sl-item.is-off { color: var(--muted-d); }
.sl-item mark { background: rgba(240, 103, 93, .28); color: inherit; border-radius: 2px; }
.sl-empty { padding: 16px 4px; color: var(--muted-d); font-size: .92rem; }
.sl-empty button { background: none; border: 0; color: var(--red-b); text-decoration: underline; cursor: pointer; padding: 0; }

.stage { grid-area: stage; position: relative; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.viewport { position: relative; flex: 1; min-height: 0; background: radial-gradient(120% 90% at 50% 35%, #2c2d31 0%, #1d1e21 70%); }
.gl { width: 100%; height: 100%; touch-action: none; cursor: grab; }
.gl:active { cursor: grabbing; }
.gl:focus-visible { outline: 3px solid var(--red-b); outline-offset: -3px; }
.label3d { position: absolute; left: 0; top: 0; transform: translate(-50%, -100%); pointer-events: none; padding: 6px 10px; background: rgba(22, 23, 26, .9); border: 1px solid var(--red-b); border-radius: 8px; font-size: .85rem; font-weight: 600; white-space: nowrap; }
.label3d::after { content: ""; position: absolute; left: 50%; bottom: -7px; width: 1px; height: 7px; background: var(--red-b); }
.hover-tip { position: absolute; pointer-events: none; padding: 4px 8px; background: rgba(22, 23, 26, .85); border-radius: 6px; font-size: .8rem; color: var(--text-d); transform: translate(12px, 12px); white-space: nowrap; }
.stage-msg { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; padding: 24px; pointer-events: none; }
.stage-msg.is-error, .stage-msg.is-unsupported { pointer-events: auto; background: rgba(29, 30, 33, .94); }
.stage-msg-title { font: 500 1.4rem/1.3 var(--serif); margin-bottom: .4rem; }
.stage-msg-sub { color: var(--muted-d); font-size: .95rem; max-width: 46ch; margin-inline: auto; }
.stage-msg a { color: var(--red-b); }
.stage-msg .btn { margin-top: 14px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; padding: 10px 12px; border-top: 1px solid var(--char-line); background: var(--char); }
.tool { min-height: 40px; min-width: 40px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--char-line); background: var(--char-2); color: var(--text-d); font-size: .9rem; cursor: pointer; }
.tool:hover:not(:disabled) { border-color: var(--text-d); }
.tool[aria-pressed="true"] { background: var(--red); border-color: var(--red); color: #fff; }
.tool:disabled { opacity: .45; cursor: not-allowed; }
.tool-sep { width: 1px; height: 24px; background: var(--char-line); margin: 0 4px; }

.info { display: grid; gap: 12px; }
.info-name { font: 500 1.7rem/1.15 var(--serif); }
.info-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: var(--char-3); font-size: .8rem; color: var(--text-d); }
.info p { color: var(--text-d); }
.info .muted, .info-ref { color: var(--muted-d); font-size: .88rem; }
.info a { color: var(--text-d); }
.info-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.info .tool { font-size: .85rem; }
.app-disclaimer { margin-top: auto; font-size: .8rem; color: var(--muted-d); border-top: 1px solid var(--char-line); padding-top: 14px; }
.app-disclaimer a { color: var(--text-d); }
.app-msg { padding: 24px; grid-column: 1 / -1; }

/* ============================ RESPONSIVE ============================ */
@media (max-width: 1100px) {
  .app { grid-template-columns: 260px minmax(0, 1fr) 300px; }
  .systems-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .hero-grid, .limits, .quiz, .lesson-grid, .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-figure { max-width: 520px; }
  .lesson-aside { position: static; }
  .app { display: flex; flex-direction: column; height: auto; min-height: calc(100dvh - var(--top)); }
  .stage { order: 1; height: min(62dvh, 560px); flex: none; }
  .js .app-tabs { order: 2; display: flex; gap: 4px; padding: 8px 12px; background: var(--char); border-bottom: 1px solid var(--char-line); position: sticky; top: var(--top); z-index: 5; }
  .app-tabs [role="tab"] { flex: 1; min-height: 44px; border: 0; border-radius: 999px; background: transparent; color: var(--muted-d); font-weight: 600; cursor: pointer; }
  .app-tabs [role="tab"][aria-selected="true"] { background: var(--char-3); color: var(--text-d); }
  .panel-left { order: 3; display: contents; }
  .panel-left > .panel-section, .panel-right { background: var(--char-2); border: 0; }
  #panel-sys { order: 3; } #panel-list { order: 3; } .panel-right { order: 3; }
  .panel-list { min-height: 50dvh; }
  .js .app [role="tabpanel"][data-inactive] { display: none; }
  .struct-list { overflow: visible; }
  .sl-sys > h3 { top: calc(var(--top) + 60px); }
  .toolbar { gap: 4px; padding: 8px; }
  .tool { padding: 8px 12px; font-size: .85rem; }
  .tool-sep { display: none; }
}
@media (max-width: 640px) {
  body { font-size: 1rem; }
  .systems-grid, .steps { grid-template-columns: minmax(0, 1fr); }
  .tv-item, .kv > div { grid-template-columns: minmax(0, 1fr); }
  .lesson-row a { grid-template-columns: 2.6rem minmax(0, 1fr); }
  .lesson-meta { grid-column: 2; grid-row: auto; }
  .actions .btn { flex: 1 1 auto; }
  .quiz-canvas { height: 360px; }
  .pager { grid-template-columns: minmax(0, 1fr); }
  .pager-next { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
