/* Robotics Lab — interface styles.
   Warm paper, ink text, serif headings; the accent is the colour of the active board.
   The hero is a full-bleed photographic 3D scene, so everything on top of it sits on frosted warm-paper panels. */

:root {
  --paper: #f1eadc;
  --paper-hi: #fbf7ee;
  --paper-lo: #e8dfcc;
  --ink: #1d1b16;
  --ink-2: rgba(29, 27, 22, .78);
  --ink-3: rgba(29, 27, 22, .62);
  --rule: rgba(29, 27, 22, .16);
  --rule-soft: rgba(29, 27, 22, .09);
  --accent: #0d7d8a;
  --accent-ink: #0d7d8a;
  --accent-soft: rgba(13, 125, 138, .10);
  --ok: #2c7a4b;
  --ok-soft: rgba(44, 122, 75, .12);
  --bad: #b24a2c;
  --bad-soft: rgba(178, 74, 44, .11);

  --k-pwr: #c8402f; --k-gnd: #2b2823; --k-dig: #2f6fb5; --k-ana: #2e8b57;
  --k-com: #7a4fb3; --k-ctl: #d9822b; --k-nc: #9a958a;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Cascadia Code", Consolas, "Liberation Mono", Menlo, monospace;

  --header-h: 56px;
  --gutter: clamp(16px, 3.4vw, 48px);
  --radius: 14px;

  /* frosted warm paper: readable on top of a busy, mostly light photo */
  --frost-bg: rgba(250, 246, 238, .8);
  --frost-blur: blur(22px) saturate(1.25);
  --frost-edge: rgba(255, 255, 255, .62);
  --frost-shadow: 0 0 0 1px rgba(29, 27, 22, .07), 0 1px 0 rgba(255, 255, 255, .75) inset, 0 24px 46px -26px rgba(40, 28, 10, .55), 0 3px 10px -4px rgba(40, 28, 10, .2);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root { --frost-bg: rgba(250, 246, 238, .95); }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
[hidden] { display: none !important; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--accent-soft); }

.sprite { position: absolute; }
.ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.mono { font-family: var(--mono); }
.muted { color: var(--ink-3); }
.kicker { font: 500 12px/1.3 var(--mono); letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); }
.kicker__n { color: var(--accent-ink); }
.kicker__n::after { content: ""; display: inline-block; width: 26px; height: 1px; margin: 0 12px; vertical-align: middle; background: currentColor; opacity: .55; }

.frost {
  background: var(--frost-bg);
  -webkit-backdrop-filter: var(--frost-blur); backdrop-filter: var(--frost-blur);
  border: 1px solid var(--frost-edge);
  box-shadow: var(--frost-shadow);
}

/* numbered chip — the same on the 3D callouts, in the legend and in the lesson list */
.chip {
  display: inline-grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 50%;
  background: var(--paper-hi); color: var(--ink); border: 1px solid var(--ink);
  font: 600 12px/1 var(--mono); transition: background-color .16s, color .16s;
}
.chip--sm { width: 22px; height: 22px; font-size: 11px; }

.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 8px; text-decoration: none; font-size: 14px; }
.skip:focus { top: 10px; }

/* ───────────── Buttons ───────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 22px; border-radius: 999px;
  background: var(--ink); color: var(--paper-hi); font-weight: 550; font-size: 15px; letter-spacing: .005em;
  border: 1px solid var(--ink); transition: background-color .16s, color .16s, border-color .16s, transform .16s, filter .16s;
  white-space: nowrap;
}
.btn:hover { background: #38342d; border-color: #38342d; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn--sm { min-height: 38px; padding: 0 15px 0 12px; font-size: 13.5px; }
.btn--ghost { background: transparent; color: var(--ink); border-color: rgba(29, 27, 22, .28); }
.btn--ghost:hover { background: rgba(29, 27, 22, .07); border-color: rgba(29, 27, 22, .45); }
.btn--ghost[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper-hi); }
.btn--accent { background: var(--accent-ink); border-color: var(--accent-ink); color: #fffdf7; }
.btn--accent:hover { background: var(--accent-ink); border-color: var(--accent-ink); filter: brightness(1.14); }
.btn--accent[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); filter: none; }

.iconbtn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  color: var(--ink-2); border: 1px solid transparent; transition: background-color .16s, border-color .16s, color .16s;
}
.iconbtn:hover { background: rgba(29, 27, 22, .08); color: var(--ink); }
.iconbtn--line { border-color: var(--rule); }
.iconbtn[disabled] { opacity: .35; cursor: default; }

/* ───────────── Header: transparent over the hero, solid paper below it ───────────── */
.top {
  position: sticky; top: 0; z-index: 40; height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 var(--gutter);
  background: rgba(241, 234, 220, 0); border-bottom: 1px solid transparent;
  transition: background-color .3s, border-color .3s;
}
.top.is-solid {
  background: rgba(241, 234, 220, .88); border-bottom-color: var(--rule-soft);
  -webkit-backdrop-filter: saturate(1.2) blur(14px); backdrop-filter: saturate(1.2) blur(14px);
}
/* assembly mode: its panel reaches up under the transparent header, so the nav steps aside until the page is scrolled */
.top.is-asm:not(.is-solid) .nav { visibility: hidden; }
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; font: 600 18px/1 var(--serif); letter-spacing: .005em; white-space: nowrap; }
.brand__mark { width: 22px; height: 22px; color: var(--accent-ink); transition: color .4s; }
.nav { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 30px); font-size: 14.5px; }
.nav a { position: relative; padding: 8px 0; text-decoration: none; color: var(--ink-2); transition: color .16s; white-space: nowrap; }
.nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 1.5px; background: var(--accent-ink); transform: scaleX(0); transform-origin: left; transition: transform .22s ease; }
.nav a:hover, .nav a.is-active { color: var(--ink); }
.nav__short { display: none; }
.nav a.is-active::after, .nav a:hover::after { transform: scaleX(1); }

/* ───────────── Stage: full-bleed 3D scene ───────────── */
.stage {
  position: relative; margin-top: calc(-1 * var(--header-h));
  height: 100vh; height: 100svh; min-height: 680px; max-height: 1240px; overflow: hidden;
  /* fallback while the lab scene loads (and if it never does): the same warm tone as the photo */
  background: #e9e0cf radial-gradient(120% 92% at 62% 40%, #fbf7ee 0%, #f1eadc 50%, #e1d6c0 100%);
}
.stage__view, .viewer { position: absolute; inset: 0; }
.viewer canvas { display: block; }
.stage__scrim {
  position: absolute; inset: 0 0 auto 0; height: clamp(120px, 20vh, 190px); z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, rgba(243, 237, 225, .95) 0%, rgba(243, 237, 225, .7) 36%, rgba(243, 237, 225, 0) 100%);
}

/* left column: title block + one sub-panel */
.info {
  position: absolute; z-index: 5; left: var(--gutter); top: calc(var(--header-h) + clamp(8px, 2.2vh, 24px));
  bottom: calc(var(--dock-h, 184px) + 30px); width: clamp(330px, 29vw, 424px);
  display: flex; flex-direction: column; gap: 10px; pointer-events: none;
}
.info > * { pointer-events: auto; }

.head { flex: none; padding: 20px 24px 20px; border-radius: 20px; }
.head__meta { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.head__count { font: 500 12px/1.3 var(--mono); letter-spacing: .06em; color: var(--ink-3); white-space: nowrap; }
.head__name { margin-top: 10px; font: 500 clamp(34px, 3.3vw, 50px)/1.04 var(--serif); letter-spacing: -.015em; text-wrap: balance; }
.head__tagline { margin-top: 10px; font-size: clamp(16px, 1.25vw, 18px); line-height: 1.4; color: var(--ink-2); text-wrap: balance; }
.head__actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.head__intro { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--rule-soft); font-size: 13.5px; line-height: 1.5; color: var(--ink-3); text-wrap: pretty; }
.level { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px 0 12px; border: 1px solid var(--rule); border-radius: 999px; font-size: 13px; color: var(--ink-2); background: rgba(255, 253, 247, .55); }
.level__bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.level__bars i { width: 3px; border-radius: 1px; background: rgba(29, 27, 22, .2); }
.level__bars i:nth-child(1) { height: 5px; } .level__bars i:nth-child(2) { height: 8.5px; } .level__bars i:nth-child(3) { height: 12px; }
.level__bars i.on { background: var(--accent-ink); }
.head.is-swap > * { animation: headIn .5s cubic-bezier(.2, .7, .2, 1) both; }
.head.is-swap > :nth-child(2) { animation-delay: .04s; } .head.is-swap > :nth-child(3) { animation-delay: .08s; }
.head.is-swap > :nth-child(4) { animation-delay: .12s; } .head.is-swap > :nth-child(5) { animation-delay: .16s; }
@keyframes headIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* a sub-panel is open (labels legend, part card, quiz): the title block shrinks to its name */
@media (min-width: 861px) {
  .stage.is-compact .head { padding: 14px 22px 15px; }
  .stage.is-compact .head__name { margin-top: 6px; font-size: clamp(24px, 2vw, 30px); }
  .stage.is-compact .head__tagline, .stage.is-compact .head__actions, .stage.is-compact .head__intro { display: none; }
}

.sub { flex: 0 1 auto; min-height: 0; overflow: auto; padding: 14px 22px 16px; border-radius: 18px; animation: panelIn .28s cubic-bezier(.2, .7, .2, 1) both; scrollbar-width: thin; scrollbar-color: rgba(29, 27, 22, .25) transparent; }
@keyframes panelIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.sub:focus-visible { outline: none; }   /* focused programmatically; only the buttons inside need a ring */
.panel__top { display: flex; align-items: center; gap: 10px; min-height: 34px; margin: -2px -8px 6px 0; }
.panel__top .kicker { margin-right: auto; }
.panel__count { font: 500 12px/1 var(--mono); color: var(--ink-3); letter-spacing: .04em; white-space: nowrap; }

.partcard__name { font: 600 22px/1.2 var(--serif); letter-spacing: -.005em; text-wrap: balance; }
.partcard__text { margin-top: 10px; font-size: 14.5px; line-height: 1.55; color: var(--ink-2); }
.partcard__nav { display: flex; align-items: center; gap: 8px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--rule-soft); }
.partcard__nav .hint { margin-left: auto; font-size: 12px; line-height: 1.4; color: var(--ink-3); text-align: right; }

.legend { padding-bottom: 10px; }
.legend__list { margin: 0 -10px; }
.legend__item { display: flex; align-items: center; gap: 11px; width: 100%; padding: 3px 10px; border-radius: 10px; text-align: left; font-size: 14px; line-height: 1.3; color: var(--ink-2); transition: background-color .14s, color .14s; }
.legend__item:hover, .legend__item.is-hot { background: rgba(29, 27, 22, .07); color: var(--ink); }
.legend__item.is-far { color: var(--ink-3); }
.legend__item.is-far .chip { border-style: dashed; color: var(--ink-3); background: transparent; }
.legend__item:hover .chip, .legend__item.is-hot .chip { background: var(--ink); color: var(--paper-hi); }

/* quiz panel */
.quiz__progress { display: flex; gap: 4px; margin: 2px 0 14px; }
.quiz__progress i { flex: 1; height: 3px; border-radius: 2px; background: rgba(29, 27, 22, .16); transition: background-color .2s; }
.quiz__progress i.is-cur { background: var(--ink); }
.quiz__progress i.is-ok { background: var(--ok); }
.quiz__progress i.is-late { background: #c9a14a; }
.quiz__progress i.is-skip { background: var(--bad); }
.quiz__q { font: 600 22px/1.25 var(--serif); letter-spacing: -.005em; text-wrap: balance; }
.quiz__fb { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; padding: 9px 12px; border-radius: 10px; font-size: 14px; line-height: 1.4; }
.quiz__fb .ico { margin-top: 1px; }
.quiz__fb.is-ok { background: var(--ok-soft); color: #1f5c38; }
.quiz__fb.is-bad { background: var(--bad-soft); color: #8a3519; animation: nudge .3s; }
@keyframes nudge { 0% { transform: translateX(0); } 30% { transform: translateX(-4px); } 65% { transform: translateX(3px); } 100% { transform: none; } }
.quiz__hint { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; font-size: 14px; line-height: 1.4; color: var(--ink-2); }
.quiz__hint .ico { margin-top: 1px; color: #a67a1c; }
.quiz__idle { margin-top: 10px; font-size: 13.5px; color: var(--ink-3); }
.quiz__foot { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--rule-soft); }
.quiz__score { margin-left: auto; font: 500 12.5px/1 var(--mono); color: var(--ink-3); white-space: nowrap; }
.quiz__score b { color: var(--ink); font-weight: 600; }
.quiz__big { font: 500 64px/1 var(--serif); letter-spacing: -.02em; margin-top: 2px; }
.quiz__big span { font-size: 22px; color: var(--ink-3); letter-spacing: 0; margin-left: 6px; }
.quiz__verdict { margin-top: 10px; font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.quiz__legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; font-size: 12px; color: var(--ink-3); }
.quiz__legend span { display: inline-flex; align-items: center; gap: 6px; }
.quiz__legend i { width: 10px; height: 3px; border-radius: 2px; }

/* bottom dock: toolbar + board rail */
.dock {
  position: absolute; z-index: 5; left: var(--gutter); right: var(--gutter); bottom: 14px;
  display: flex; flex-direction: column; align-items: center; gap: 10px; pointer-events: none;
}
.dock > * { pointer-events: auto; max-width: 100%; }

.toolbar { display: flex; align-items: center; gap: 6px; padding: 5px; border-radius: 999px; }
.toolbar__group, .toolbar__cta, .seg { display: flex; gap: 2px; }
.toolbar__cta { gap: 6px; }
.toolbar__sep { width: 1px; height: 20px; background: var(--rule); margin: 0 4px; flex: none; }
.seg__btn, .tgl {
  display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 13px; border-radius: 999px;
  font-size: 13.5px; color: var(--ink-2); white-space: nowrap; transition: background-color .16s, color .16s;
}
.seg__btn:hover, .tgl:hover { background: rgba(29, 27, 22, .07); color: var(--ink); }
.seg__btn[aria-pressed="true"] { background: rgba(29, 27, 22, .1); color: var(--ink); font-weight: 600; }
.tgl .ico { width: 17px; height: 17px; color: var(--ink-3); transition: color .16s; }
.tgl[aria-pressed="true"] { color: var(--ink); font-weight: 600; background: var(--accent-soft); }
.tgl[aria-pressed="true"] .ico { color: var(--accent-ink); }
.tgl[disabled] { opacity: .4; cursor: default; }
.stage.no-3d .toolbar { opacity: .45; pointer-events: none; }

.rail { position: relative; border-radius: 22px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; scroll-snap-type: x proximity; }
.rail::-webkit-scrollbar { display: none; }
.rail__list { display: flex; gap: 2px; width: max-content; margin: 0 auto; padding: 7px; }
.rail__item { flex: none; display: flex; scroll-snap-align: center; }
.rcard {
  position: relative; display: flex; flex-direction: column; justify-content: flex-start; align-items: stretch;
  width: clamp(108px, 9.7vw, 150px); padding: 6px 8px 9px; border-radius: 16px; text-align: center;
  transition: background-color .18s, box-shadow .18s;
}
.rcard:hover { background: rgba(255, 253, 247, .6); }
.rcard[aria-current="true"] { background: rgba(255, 253, 247, .96); box-shadow: 0 0 0 1px var(--rule), 0 10px 20px -14px rgba(40, 28, 10, .6); }
.rcard[aria-current="true"]::after { content: ""; position: absolute; left: 50%; bottom: 3px; width: 22px; height: 2px; margin-left: -11px; border-radius: 2px; background: var(--card-accent, var(--accent)); }
.rcard__thumb { position: relative; display: grid; place-items: center; height: 56px; margin-bottom: 5px; border-radius: 10px; }
.rcard__thumb img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; transform: scale(1.42); transition: transform .3s cubic-bezier(.2, .7, .2, 1); animation: fade .35s both; pointer-events: none; filter: drop-shadow(0 5px 5px rgba(40, 28, 10, .22)); }
.rcard:hover .rcard__thumb img, .rcard[aria-current="true"] .rcard__thumb img { transform: scale(1.54); }
.rcard__thumb .ico { width: 56px; height: 38px; stroke-width: 1.2; color: var(--ink-3); opacity: .55; }
.is-skel { background: linear-gradient(100deg, rgba(29, 27, 22, .05) 30%, rgba(29, 27, 22, .11) 50%, rgba(29, 27, 22, .05) 70%); background-size: 220% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { from { background-position: 120% 0; } to { background-position: -100% 0; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.rcard__name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; font-size: 12.5px; font-weight: 600; line-height: 1.25; color: var(--ink); text-wrap: balance; }

/* assembly mode: the assembly module owns the stage; only the exit button stays */
.stage.is-asm .info, .stage.is-asm .rail, .stage.is-asm .markers,
.stage.is-asm .toolbar > :not(.toolbar__cta), .stage.is-asm #btn-quiz { display: none !important; }
.stage.is-asm .dock { align-items: flex-start; }

/* tooltip */
.tip {
  position: absolute; left: 0; top: 0; z-index: 8; pointer-events: none; max-width: 280px;
  padding: 7px 11px 8px; border-radius: 9px; background: rgba(29, 27, 22, .94); color: #f6f1e6;
  font-size: 13px; line-height: 1.35; box-shadow: 0 10px 24px -10px rgba(29, 27, 22, .6);
  opacity: 0; transition: opacity .12s; will-change: transform;
}
.tip.is-on { opacity: 1; }
.tip__pin { display: flex; align-items: center; gap: 8px; }
.tip__pin b { font: 600 13.5px/1.2 var(--mono); letter-spacing: .01em; }
.tip__kind { margin-left: auto; padding-left: 12px; font: 500 10.5px/1 var(--mono); letter-spacing: .07em; text-transform: uppercase; color: rgba(246, 241, 230, .6); white-space: nowrap; }
.tip__fn { margin-top: 3px; color: rgba(246, 241, 230, .82); }
.tip__more { margin-top: 3px; font-size: 11.5px; color: rgba(246, 241, 230, .55); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--k-nc); box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .75); }
.dot[data-kind="pwr"] { background: var(--k-pwr); } .dot[data-kind="gnd"] { background: var(--k-gnd); }
.dot[data-kind="dig"] { background: var(--k-dig); } .dot[data-kind="ana"] { background: var(--k-ana); }
.dot[data-kind="com"] { background: var(--k-com); } .dot[data-kind="ctl"] { background: var(--k-ctl); }
.dot[data-kind="nc"] { background: var(--k-nc); }

/* callout markers */
.markers { position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }
.marker { position: absolute; left: 0; top: 0; width: 0; height: 0; will-change: transform; transition: opacity .18s; }
.marker.is-off { opacity: 0; visibility: hidden; }
.marker::before { content: ""; position: absolute; left: -.75px; top: -30px; width: 1.5px; height: 30px; background: var(--ink); box-shadow: 0 0 0 1px rgba(251, 247, 238, .7); }
.marker::after { content: ""; position: absolute; left: -3.5px; top: -3.5px; width: 7px; height: 7px; border-radius: 50%; background: var(--paper-hi); border: 1.5px solid var(--ink); box-shadow: 0 0 0 1px rgba(251, 247, 238, .6); }
.marker__btn {
  position: absolute; left: -13px; top: -55px; width: 26px; height: 26px; border-radius: 50%; pointer-events: auto;
  display: grid; place-items: center; font: 600 12px/1 var(--mono);
  background: var(--paper-hi); color: var(--ink); border: 1px solid var(--ink);
  box-shadow: 0 0 0 2px rgba(251, 247, 238, .55), 0 6px 12px -4px rgba(29, 27, 22, .55); transition: transform .16s, background-color .16s, color .16s;
}
.marker__btn:hover, .marker__btn:focus-visible { transform: scale(1.14); background: var(--ink); color: var(--paper-hi); }
.marker__name {
  position: absolute; left: 20px; top: -53px; padding: 4px 9px; border-radius: 7px; white-space: nowrap;
  background: rgba(29, 27, 22, .94); color: #f6f1e6; font-size: 12.5px; line-height: 1.3;
  opacity: 0; transform: translateX(-4px); transition: opacity .14s, transform .14s; pointer-events: none;
}
.marker__btn:hover + .marker__name, .marker__btn:focus-visible + .marker__name, .marker.is-named .marker__name { opacity: 1; transform: none; }
.marker.is-active .marker__btn, .marker.is-hot .marker__btn { background: var(--ink); color: var(--paper-hi); }
.marker.is-active { z-index: 2; } .marker:hover, .marker.is-hot { z-index: 3; }

/* loading / toasts / error */
.loader {
  position: absolute; left: 50%; top: 50%; z-index: 6; transform: translate(-50%, -50%);
  display: flex; align-items: center; gap: 10px; padding: 9px 16px 9px 12px; border-radius: 999px;
  background: var(--frost-bg); border: 1px solid var(--frost-edge); font-size: 13.5px; color: var(--ink-2);
  -webkit-backdrop-filter: var(--frost-blur); backdrop-filter: var(--frost-blur);
  box-shadow: var(--frost-shadow); pointer-events: none; opacity: 0; visibility: hidden; transition: opacity .2s, visibility 0s .2s;
}
.loader.is-on { opacity: 1; visibility: visible; transition: opacity .2s .12s, visibility 0s .12s; }
.loader__ring { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--rule); border-top-color: var(--accent-ink); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast {
  position: absolute; left: 50%; top: 50%; z-index: 9; transform: translate(-50%, -50%); width: max-content; max-width: min(440px, 84%);
  padding: 10px 16px; border-radius: 12px; background: rgba(29, 27, 22, .92); color: #f6f1e6; font-size: 14px; line-height: 1.4; text-align: center;
  box-shadow: 0 14px 30px -14px rgba(29, 27, 22, .7); pointer-events: none; opacity: 0; transition: opacity .25s;
}
.toast--low { top: auto; bottom: calc(var(--dock-h, 184px) + 34px); transform: translateX(-50%); }
.toast.is-on { opacity: 1; }
.toast kbd { font: 600 12px/1 var(--mono); padding: 2px 6px; border-radius: 5px; border: 1px solid rgba(246, 241, 230, .4); }
.scene__error {
  position: absolute; left: 50%; top: 50%; z-index: 4; transform: translate(-50%, -50%); width: min(440px, 86%); padding: 18px 22px; border-radius: 16px;
  text-align: center; color: var(--ink-2); font-size: 15px; background: var(--frost-bg); border: 1px solid var(--frost-edge); box-shadow: var(--frost-shadow);
}

/* ───────────── Sections ───────────── */
.section { padding: clamp(72px, 9vw, 128px) 0; border-top: 1px solid var(--rule-soft); scroll-margin-top: var(--header-h); }
.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 var(--gutter); }
.wrap--wide { max-width: 1480px; }
.sec-head { max-width: 760px; }
.sec-head h2 { margin-top: 14px; font: 500 clamp(32px, 4vw, 54px)/1.05 var(--serif); letter-spacing: -.015em; text-wrap: balance; }
.lead { margin-top: 18px; font-size: clamp(17px, 1.45vw, 19px); line-height: 1.55; color: var(--ink-2); max-width: 62ch; text-wrap: pretty; }

/* Lab: the 3D workbench is mounted into #lab-root by js/lab/lab.js */
.labsec { background: linear-gradient(180deg, rgba(232, 223, 204, .42), rgba(232, 223, 204, 0) 420px); }
#lab { scroll-margin-top: var(--header-h); }
.sec-top { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 32px clamp(32px, 6vw, 96px); align-items: end; }
.feats { border-top: 1px solid var(--rule); }
.feats li { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--rule-soft); }
.feats .ico { width: 20px; height: 20px; margin-top: 2px; color: var(--accent-ink); }
.feats h3 { font-size: 15.5px; font-weight: 600; line-height: 1.35; }
.feats p { margin-top: 2px; font-size: 14.5px; line-height: 1.5; color: var(--ink-2); }
.feats b { font-weight: 600; color: var(--ink); }
.lab__frame { position: relative; margin-top: clamp(28px, 3.6vw, 48px); }
#lab-root {
  position: relative; height: min(86vh, 900px); min-height: 640px; overflow: hidden;
  border: 1px solid var(--rule); border-radius: 22px;
  background: radial-gradient(120% 90% at 50% 38%, #fbf7ee 0%, #f1eadc 55%, #e6dcc8 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .7) inset, 0 40px 70px -50px rgba(70, 50, 20, .6), 0 4px 14px -8px rgba(70, 50, 20, .25);
}
.lab__note {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(440px, 84%);
  text-align: center; font-size: 15px; line-height: 1.55; color: var(--ink-3); pointer-events: none;
}

/* Lesson: editorial grid — heading on the left, content on the right */
.lesson__body { margin-top: clamp(32px, 4vw, 56px); }
.block { display: grid; grid-template-columns: minmax(180px, 250px) minmax(0, 1fr); gap: 20px clamp(24px, 5vw, 72px); padding: clamp(28px, 3.4vw, 44px) 0; border-top: 1px solid var(--rule); }
.block__side h3 { font: 600 clamp(21px, 2vw, 25px)/1.2 var(--serif); letter-spacing: -.005em; }
.block__side p { margin-top: 8px; font-size: 13.5px; line-height: 1.5; color: var(--ink-3); max-width: 30ch; }
.summary { font: 400 clamp(20px, 2.1vw, 27px)/1.42 var(--serif); letter-spacing: -.003em; max-width: 34em; text-wrap: pretty; }

/* key numbers: a hairline grid of big serif figures */
.tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1px; margin-top: clamp(24px, 3vw, 36px); background: var(--rule-soft); border: 1px solid var(--rule-soft); border-radius: 16px; overflow: hidden; }
.tile { display: flex; flex-direction: column; gap: 8px; padding: 16px 16px 15px; background: var(--paper-hi); }
.tile dt { font: 500 11px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.tile dd { font: 500 clamp(19px, 1.7vw, 24px)/1.15 var(--serif); letter-spacing: -.01em; text-wrap: balance; }

.specs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(24px, 4vw, 56px); border-top: 1px solid var(--rule-soft); }
.specs__row { display: grid; grid-template-columns: minmax(96px, 38%) minmax(0, 1fr); align-items: baseline; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--rule-soft); }
.specs dt { font-size: 14px; color: var(--ink-3); }
.specs dd { font: 400 13.5px/1.45 var(--mono); color: var(--ink); text-wrap: pretty; }

.parts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(16px, 3vw, 40px); margin: -4px -12px 0; }
.parts > li { display: flex; border-bottom: 1px solid var(--rule-soft); }
.part { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 14px; width: 100%; padding: 15px 12px 16px; border-radius: 12px; text-align: left; transition: background-color .16s; }
.part:hover { background: rgba(253, 250, 243, .8); }
.part.is-active { background: var(--paper-hi); box-shadow: 0 0 0 1px var(--rule) inset; }
.part:hover .chip, .part.is-active .chip { background: var(--ink); color: var(--paper-hi); }
.part__name { display: block; font-weight: 600; font-size: 15.5px; line-height: 1.35; }
.part__text { display: block; margin-top: 3px; font-size: 14.5px; line-height: 1.55; color: var(--ink-2); }
.part__go { display: grid; place-items: center; width: 26px; height: 26px; color: var(--accent-ink); opacity: 0; transform: translateY(3px); transition: opacity .16s, transform .16s; }
.part:hover .part__go, .part:focus-visible .part__go, .part.is-active .part__go { opacity: 1; transform: none; }

.duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px clamp(24px, 4vw, 56px); }
.duo h4 { display: flex; align-items: center; gap: 8px; font: 600 12px/1.3 var(--mono); letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); padding-bottom: 8px; border-bottom: 1px solid var(--rule); }
.ticks li { position: relative; padding: 11px 0 11px 30px; border-bottom: 1px solid var(--rule-soft); font-size: 15px; line-height: 1.5; }
.ticks li:last-child { border-bottom: 0; }
.ticks .ico { position: absolute; left: 0; top: 13px; }
.ticks--good .ico { color: var(--accent-ink); }
.ticks--warn .ico { color: var(--bad); }

.notes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px clamp(24px, 4vw, 56px); }
.note { padding-top: 14px; border-top: 1px solid var(--rule); }
.note h4 { font-size: 15.5px; font-weight: 600; line-height: 1.35; }
.note p { margin-top: 4px; font-size: 14.5px; line-height: 1.55; color: var(--ink-2); }
.pinbox { margin-top: 28px; padding: 14px 18px 16px; border: 1px solid var(--rule); border-radius: 14px; background: rgba(253, 250, 243, .55); }
.pinhint { display: flex; align-items: center; gap: 10px; font-size: 14.5px; color: var(--ink-2); }
.pinhint .ico { color: var(--accent-ink); }
.kinds { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--rule-soft); font-size: 13px; color: var(--ink-2); }
.kinds li { display: inline-flex; align-items: center; gap: 7px; }
.kinds .dot { box-shadow: none; }

.code { border-radius: 18px; background: #211f1a; color: #ece5d6; overflow: hidden; border: 1px solid #14120f; box-shadow: 0 1px 0 rgba(255, 255, 255, .08) inset, 0 30px 54px -34px rgba(40, 28, 10, .75); }
.code__bar { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 20px; border-bottom: 1px solid rgba(255, 255, 255, .08); background: rgba(255, 255, 255, .025); }
.code__title { font-size: 13.5px; color: rgba(236, 229, 214, .86); margin-right: auto; }
.code__lang { font: 500 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: rgba(236, 229, 214, .5); padding: 5px 8px; border: 1px solid rgba(255, 255, 255, .12); border-radius: 6px; }
.code__copy { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px 0 10px; border-radius: 8px; font-size: 13px; color: rgba(236, 229, 214, .9); border: 1px solid rgba(255, 255, 255, .16); transition: background-color .16s, border-color .16s; }
.code__copy:hover { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .3); }
.code__copy:focus-visible { outline-color: #ece5d6; }
.code__copy .ico { width: 15px; height: 15px; }
.code pre { margin: 0; padding: 18px 0 20px; max-height: 560px; overflow: auto; font: 400 13.5px/1.7 var(--mono); tab-size: 2; counter-reset: ln; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .25) transparent; }
.code code { display: block; width: max-content; min-width: 100%; font: inherit; }
.code .ln { display: block; padding: 0 22px 0 0; white-space: pre; counter-increment: ln; }
.code .ln::before { content: counter(ln); display: inline-block; width: 46px; padding-right: 18px; text-align: right; color: rgba(236, 229, 214, .28); -webkit-user-select: none; user-select: none; }
.code .ln:empty::after { content: " "; }
.t-com { color: #8f8875; font-style: italic; }
.t-kw { color: #e6b566; }
.t-str { color: #a9c58b; }
.t-num { color: #e39b7d; }
.t-fn { color: #9cc4dd; }
.t-pre { color: #c9a0d6; }

.uses { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(24px, 4vw, 56px); counter-reset: use; border-top: 1px solid var(--rule-soft); }
.uses li { counter-increment: use; display: flex; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--rule-soft); font-size: 15px; line-height: 1.5; }
.uses li::before { content: counter(use, decimal-leading-zero); font: 500 12px/1.9 var(--mono); color: var(--accent-ink); }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 28px clamp(24px, 4vw, 48px); }
.fact { position: relative; padding-left: 20px; font: italic 400 18px/1.5 var(--serif); color: var(--ink); text-wrap: pretty; }
.fact::before { content: ""; position: absolute; left: 0; top: 5px; bottom: 5px; width: 2px; border-radius: 2px; background: var(--accent); }

/* Practice: quiz + assembly cards */
.practice { background: linear-gradient(180deg, rgba(232, 223, 204, .5), rgba(232, 223, 204, .16)); }
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(16px, 2.2vw, 28px); margin-top: clamp(32px, 4vw, 52px); }
.pcard { position: relative; display: flex; flex-direction: column; padding: clamp(22px, 2.8vw, 36px); border: 1px solid var(--rule); border-radius: 22px; background: var(--paper-hi); box-shadow: 0 1px 0 rgba(255, 255, 255, .8) inset, 0 30px 50px -40px rgba(70, 50, 20, .5); scroll-margin-top: calc(var(--header-h) + 16px); }
.pcard--accent::before { content: ""; position: absolute; left: 28px; right: 28px; top: -1px; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); }
.pcard__top { display: flex; align-items: center; gap: 12px; }
.pcard__ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--ink); color: var(--paper-hi); }
.pcard--accent .pcard__ico { background: var(--accent-ink); color: #fffdf7; }
.pcard h3 { margin-top: 18px; font: 500 clamp(24px, 2.5vw, 33px)/1.12 var(--serif); letter-spacing: -.01em; text-wrap: balance; }
.pcard__text { margin-top: 10px; font-size: 15.5px; line-height: 1.55; color: var(--ink-2); max-width: 46ch; }
.steps { margin: 22px 0 26px; border-top: 1px solid var(--rule); }
.steps li { display: flex; align-items: baseline; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--rule-soft); font-size: 14.5px; line-height: 1.5; color: var(--ink-2); }
.steps__n { flex: none; width: 18px; font: 500 20px/1 var(--serif); color: var(--accent-ink); }
.steps b { font-weight: 600; color: var(--ink); }
.pcard__cta { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 18px; margin-top: auto; }
.pcard__info { font-size: 13.5px; color: var(--ink-3); }
.pcard__info b { color: var(--ink); font-weight: 600; }

/* Comparison */
.table-wrap { margin-top: clamp(28px, 4vw, 48px); overflow-x: auto; border: 1px solid var(--rule); border-radius: 18px; background: rgba(253, 250, 243, .45); scrollbar-width: thin; scrollbar-color: rgba(29, 27, 22, .25) transparent; }
.table-wrap:focus-visible { outline-offset: 4px; border-radius: 18px; }
.ctable { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.ctable th, .ctable td { padding: 12px 11px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--rule-soft); }
.ctable thead th { padding-top: 15px; padding-bottom: 13px; font: 500 11.5px/1.3 var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; border-bottom-color: var(--rule); background: #f4eee1; }
.ctable tbody tr { cursor: pointer; }
.ctable tbody tr:last-child > * { border-bottom: 0; }
.ctable tbody tr > * { transition: background-color .14s; }
.ctable tbody tr:hover > * { background-color: #f8f3e8; }
.ctable td { font-family: var(--mono); font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.ctable td.is-wide { white-space: normal; min-width: 112px; max-width: 190px; }
.ctable tbody th { position: sticky; left: 0; z-index: 1; min-width: 228px; padding: 8px 14px 8px 16px; background: #f6f0e4; font-weight: 400; box-shadow: inset 3px 0 0 transparent, 1px 0 0 var(--rule-soft); transition: background-color .14s, box-shadow .2s; }
.ctable thead th:first-child { position: sticky; left: 0; z-index: 2; padding-left: 16px; box-shadow: 1px 0 0 var(--rule-soft); }
.ctable tbody tr.is-active > * { background-color: var(--paper-hi); color: var(--ink); }
.ctable tbody tr.is-active > td { font-weight: 600; }
.ctable tbody tr.is-active > th { box-shadow: inset 3px 0 0 var(--accent), 1px 0 0 var(--rule-soft); }
.rowbtn { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; }
.rowbtn__thumb { position: relative; flex: none; width: 62px; height: 44px; border-radius: 8px; display: grid; place-items: center; }
.rowbtn__thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; transform: scale(1.3); animation: fade .35s both; pointer-events: none; }
.rowbtn__thumb .ico { width: 44px; height: 30px; stroke-width: 1.2; color: var(--ink-3); opacity: .5; }
.rowbtn__text b { display: block; font: 600 15.5px/1.25 var(--serif); }
.rowbtn__text span { display: block; margin-top: 2px; font-size: 12px; line-height: 1.3; color: var(--ink-3); }
.ctable tr.is-active .rowbtn__text::after { content: "on the bench"; display: inline-block; margin-top: 5px; padding: 1px 6px; border-radius: 4px; font: 500 10px/1.5 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--accent-ink); background: var(--accent-soft); white-space: nowrap; }
.table-note { margin-top: 14px; font-size: 13px; line-height: 1.5; color: var(--ink-3); max-width: 80ch; }

/* Footer */
.foot { border-top: 1px solid var(--rule); padding: clamp(36px, 5vw, 56px) 0 clamp(36px, 5vw, 56px); font-size: 13.5px; color: var(--ink-3); background: rgba(232, 223, 204, .35); }
.foot__in { display: grid; grid-template-columns: minmax(0, 1.4fr) auto auto; gap: 28px clamp(32px, 7vw, 110px); align-items: start; }
.foot__brand p { margin-top: 12px; max-width: 54ch; line-height: 1.55; }
.foot__brand .brand { color: var(--ink); }
.foot__nav { display: grid; gap: 7px; font-size: 14px; }
.foot__nav a, .foot__top { color: var(--ink-2); text-decoration: none; transition: color .16s; }
.foot__nav a:hover, .foot__top:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.foot__end { display: grid; gap: 14px; justify-items: end; }
.foot__top { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.foot__top .ico { width: 16px; height: 16px; }
.foot__meta { font-family: var(--mono); font-size: 12px; letter-spacing: .05em; white-space: nowrap; }
.noscript { padding: 16px var(--gutter); text-align: center; }

/* ───────────── Responsive ───────────── */
@media (max-width: 1180px) {
  .seg__btn, .tgl { padding: 0 11px; }
  .toolbar .btn--sm { padding: 0 13px 0 10px; }
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1040px) {
  .toolbar .tgl span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .toolbar .tgl { width: 38px; padding: 0; justify-content: center; }
}

@media (max-width: 980px) {
  .block { grid-template-columns: 1fr; gap: 16px; }
  .block__side p { max-width: none; }
  .sec-top { grid-template-columns: 1fr; align-items: start; }
  .cards { grid-template-columns: 1fr; }
  .foot__in { grid-template-columns: 1fr 1fr; }
  .foot__brand { grid-column: 1 / -1; }
  .foot__end { justify-items: start; }
}

/* narrow screens: title block pinned under the header, sub-panels become a bottom sheet over the dock */
@media (max-width: 860px) {
  .stage { min-height: 640px; }
  .info { display: contents; }
  .head { position: absolute; z-index: 5; left: 10px; right: 10px; top: calc(var(--header-h) + 2px); padding: 12px 16px 14px; border-radius: 18px; }
  .head__name { margin-top: 5px; font-size: clamp(26px, 7.4vw, 36px); }
  .head__tagline { margin-top: 4px; font-size: 15px; }
  .head__actions { margin-top: 11px; flex-wrap: nowrap; }
  .head__actions .level { margin-left: auto; height: 34px; font-size: 12.5px; }
  .head__actions .btn { min-height: 36px; }
  .head__intro { display: none; }
  .legend { display: none !important; }
  .sub { position: absolute; z-index: 6; left: 8px; right: 8px; bottom: 8px; max-height: 60%; }
  .stage.has-sheet .dock { visibility: hidden; }
  .stage.is-asm .dock { display: none; }   /* the assembly sheet has its own Exit */

  .dock { left: 10px; right: 10px; bottom: 10px; gap: 8px; align-items: stretch; }
  .toolbar { flex-wrap: wrap; gap: 8px; padding: 0; background: none; border: 0; border-radius: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .toolbar__sep { display: none; }
  .toolbar .seg, .toolbar__group, .toolbar__cta .btn--ghost {
    background: var(--frost-bg); border: 1px solid var(--frost-edge); box-shadow: var(--frost-shadow);
    -webkit-backdrop-filter: var(--frost-blur); backdrop-filter: var(--frost-blur);
  }
  .toolbar .seg, .toolbar__group { padding: 4px; border-radius: 999px; }
  .toolbar .seg { flex: 1 0 100%; }
  .toolbar .seg__btn { flex: 1 1 auto; justify-content: center; height: 36px; }
  .toolbar .tgl { height: 36px; width: 36px; }
  .toolbar__cta { flex: 1 1 auto; gap: 8px; }
  .toolbar__cta .btn { flex: 1 1 0; min-height: 46px; padding: 0 10px; }
  .toolbar__cta .btn--ghost[aria-pressed="true"] { background: var(--ink); }
  .rail { border-radius: 18px; }
  .rail__list { margin: 0; padding: 6px; }
  .rcard { width: 104px; padding: 5px 6px 8px; }
  .rcard__thumb { height: 46px; }
  .marker__name { display: none; }
  .marker::before { top: -22px; height: 22px; }
  .marker__btn { left: -11px; top: -43px; width: 22px; height: 22px; font-size: 10.5px; }
  .toast--low { bottom: calc(var(--dock-h, 220px) + 22px); }
}
@media (max-width: 860px) and (min-height: 800px) {
  .head__intro { display: block; margin-top: 12px; padding-top: 10px; font-size: 12.5px; }
}

@media (max-width: 640px) {
  :root { --header-h: 52px; }
  .top { gap: 10px; }
  .nav { gap: 11px; font-size: 13px; }
  .nav__boards, .nav__long { display: none; }
  .nav__short { display: inline; }
  .brand { font-size: 15px; gap: 6px; }
  .brand__mark { width: 20px; height: 20px; }
  #lab-root { border-radius: 16px; }
  .specs, .parts, .duo, .notes, .uses { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .specs__row { grid-template-columns: minmax(88px, 34%) minmax(0, 1fr); }
  .summary { font-size: 20px; }
  .code pre { font-size: 12.5px; }
  .code .ln::before { width: 34px; padding-right: 12px; }
  .code__lang { display: none; }
  .pinhint { align-items: flex-start; }
  .fact { font-size: 17px; }
  .pcard__cta .btn { width: 100%; }
  .ctable tbody th { min-width: 178px; padding-left: 12px; }
  .rowbtn__thumb { width: 44px; height: 32px; }
  .rowbtn { gap: 9px; }
  .foot__in { grid-template-columns: 1fr; }
}

@media (max-width: 370px) {
  .brand__name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .nav { gap: 16px; font-size: 14px; }
  .toolbar .seg__btn { padding: 0 6px; }
  .toolbar__cta .btn { font-size: 13px; gap: 6px; }
}

@media (max-height: 760px) and (min-width: 861px) {
  .head { padding: 16px 22px 16px; }
  .head__name { font-size: clamp(30px, 2.9vw, 42px); }
  .head__intro { display: none; }
  .rcard__thumb { height: 46px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .is-skel { animation: none; }
}

@media print {
  .top, .dock, .sub, .tip, .loader, .toast, .labsec { display: none !important; }
  .stage { height: 420px; min-height: 0; margin-top: 0; }
}
