/* Human Praxis warehouse-safety course.
   Controlled glassmorphism over environmental light that follows the module subject.
   Glass is always ≥ 68% opaque behind text; text never sits on raw ambient colour. */

:root {
  --ink: #0f2a2f;
  --ink-2: #24464c;
  --muted: #4b6569;
  --teal: #00929e;
  --teal-d: #00707a;
  --teal-dd: #0b5560;
  --mint: #5ac4be;
  --mint-l: #d8f1ee;
  --amber: #f2b33d;
  --red: #c9302f;
  --green: #137a4c;
  --bg: #edf6f5;
  --glass: rgba(255, 255, 255, 0.7);
  --glass-strong: rgba(255, 255, 255, 0.86);
  --hair: rgba(15, 42, 47, 0.08);
  --spec: rgba(255, 255, 255, 0.9);
  --shadow: 0 1px 0 var(--spec) inset, 0 0 0 1px rgba(15, 42, 47, 0.05), 0 24px 60px -30px rgba(15, 42, 47, 0.38), 0 8px 22px -14px rgba(15, 42, 47, 0.2);
  --r-xl: 30px;
  --r-l: 22px;
  --r-m: 16px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --spring: cubic-bezier(0.34, 1.4, 0.64, 1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", "Noto Sans", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-d: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI Variable Display", "Segoe UI", "Noto Sans", Roboto, "Helvetica Neue", Arial, sans-serif;
  /* ambient light (overridden per module) */
  --a1: rgba(90, 196, 190, 0.55);
  --a2: rgba(0, 146, 158, 0.28);
  --a3: rgba(198, 236, 231, 0.9);
  color-scheme: light;
}

body[data-module="M1"] { --a1: rgba(90, 196, 190, 0.5); --a2: rgba(242, 179, 61, 0.26); --a3: rgba(214, 238, 232, 0.9); }
body[data-module="M2"] { --a1: rgba(110, 170, 230, 0.32); --a2: rgba(255, 194, 14, 0.24); --a3: rgba(205, 236, 232, 0.9); }
body[data-module="M3"] { --a1: rgba(255, 150, 110, 0.3); --a2: rgba(242, 179, 61, 0.24); --a3: rgba(214, 238, 232, 0.9); }
body[data-module="M4"] { --a1: rgba(150, 140, 230, 0.28); --a2: rgba(90, 196, 190, 0.32); --a3: rgba(220, 232, 245, 0.9); }
body[data-module="M5"] { --a1: rgba(90, 196, 190, 0.55); --a2: rgba(31, 157, 106, 0.22); --a3: rgba(214, 240, 232, 0.9); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 88px; }
body {
  margin: 0;
  min-height: 100vh;
  font: 400 1rem/1.55 var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
img, svg { max-width: 100%; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: var(--teal-dd); }
h1, h2, h3 { margin: 0; font-family: var(--font-d); letter-spacing: -0.02em; line-height: 1.12; }
p { margin: 0; }
[hidden] { display: none !important; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.sprite-holder { position: absolute; width: 0; height: 0; overflow: hidden; }
.skip-link { position: absolute; left: 12px; top: 12px; transform: translateY(calc(-100% - 24px)); z-index: 100; padding: 10px 16px; border-radius: 999px; background: var(--ink); color: #fff; text-decoration: none; font-weight: 600; }
.skip-link:focus { transform: none; }

:focus-visible { outline: 3px solid var(--teal-dd); outline-offset: 3px; box-shadow: 0 0 0 7px rgba(90, 196, 190, 0.35); border-radius: 10px; }
main:focus, h1:focus, [tabindex="-1"]:focus { outline: none; box-shadow: none; }
h1:focus-visible { outline: 3px solid var(--teal-dd); outline-offset: 6px; }

/* ── environmental light ── */
.ambient { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; background: linear-gradient(180deg, #f6fbfa 0%, var(--bg) 60%, #e5f1ef 100%); }
.amb { position: absolute; border-radius: 50%; transition: background 1.4s var(--ease); will-change: transform; }
.amb-a { width: 70vmax; height: 70vmax; left: -22vmax; top: -30vmax; background: radial-gradient(closest-side, var(--a1), transparent 72%); animation: drift-a 38s ease-in-out infinite alternate; }
.amb-b { width: 60vmax; height: 60vmax; right: -20vmax; top: 10vh; background: radial-gradient(closest-side, var(--a2), transparent 70%); animation: drift-b 46s ease-in-out infinite alternate; }
.amb-c { width: 80vmax; height: 50vmax; left: 10vw; bottom: -30vmax; background: radial-gradient(closest-side, var(--a3), transparent 70%); animation: drift-a 52s ease-in-out infinite alternate-reverse; }
@keyframes drift-a { to { transform: translate3d(6vmax, 4vmax, 0) scale(1.06); } }
@keyframes drift-b { to { transform: translate3d(-5vmax, 6vmax, 0) scale(0.94); } }

/* ── glass ── */
.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(24px) saturate(1.7);
  backdrop-filter: blur(24px) saturate(1.7);
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow: var(--shadow);
  border-radius: var(--r-xl);
  position: relative;
}
.glass::before { /* specular rim */
  content: "";
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  padding: 1px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0) 38%, rgba(255, 255, 255, 0) 70%, rgba(90, 196, 190, 0.35));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .glass, .glass-bar { background: var(--glass-strong); } }
.card { padding: clamp(22px, 3.2vw, 38px); }

/* ── top bar ── */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 14px;
  min-height: 78px; padding: 12px max(16px, calc((100vw - 1320px) / 2));
}
.glass-bar { background: rgba(246, 251, 250, 0.72); -webkit-backdrop-filter: blur(22px) saturate(1.8); backdrop-filter: blur(22px) saturate(1.8); border-bottom: 1px solid var(--hair); }
.brand { display: block; line-height: 0; border-radius: 10px; flex: 0 0 auto; }
.brand img { height: 48px; width: auto; }
body[data-view="welcome"] .brand { opacity: 0; pointer-events: none; transition: opacity 0.3s; }
.topbar-progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; overflow: hidden; display: none; }
body[data-view="course"] .topbar-progress { display: block; }
.topbar-progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--teal), var(--mint)); transform-origin: left; transform: scaleX(0); transition: transform 0.6s var(--ease); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.icon-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; min-width: 44px; padding: 0 12px; justify-content: center; border-radius: 999px; border: 1px solid rgba(15, 42, 47, 0.1); background: rgba(255, 255, 255, 0.78); color: var(--ink); font-weight: 600; font-size: 0.9375rem; transition: background 0.2s, transform 0.2s var(--spring); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover { background: #fff; }
.icon-btn:active { transform: scale(0.96); }
.icon-btn[aria-pressed="true"] { background: var(--teal-dd); color: #fff; border-color: transparent; }

/* ── buttons ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 50px; padding: 0 22px; border-radius: 999px; border: 1px solid transparent; font-weight: 650; font-size: 1rem; letter-spacing: -0.005em; text-decoration: none; transition: transform 0.25s var(--spring), box-shadow 0.25s, background 0.2s, filter 0.2s; }
.btn svg { width: 20px; height: 20px; flex: 0 0 auto; }
.btn-primary { color: #fff; background: linear-gradient(180deg, #0aa6b1, #007f8a); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.35) inset, 0 10px 24px -10px rgba(0, 112, 122, 0.75); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-primary:active, .btn-ghost:active { transform: scale(0.97); }
.btn-ghost { color: var(--ink); background: rgba(255, 255, 255, 0.78); border-color: rgba(15, 42, 47, 0.12); }
.btn-ghost:hover { background: #fff; }
.btn:disabled { opacity: 0.45; filter: grayscale(0.4); transform: none; }
.btn-wide { width: 100%; }
.btn-link { background: none; border: 0; padding: 6px 2px; color: var(--teal-dd); font-weight: 650; text-decoration: underline; text-underline-offset: 3px; min-height: 44px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; margin-top: 26px; }

/* ── views ── */
main { display: block; padding: 0 max(16px, calc((100vw - 1320px) / 2)); }
.view { padding: clamp(18px, 3vw, 40px) 0 140px; animation: view-in 0.6s var(--ease) backwards; }
.view.narrow { max-width: 820px; margin: 0 auto; }
@keyframes view-in { from { opacity: 0; transform: translateY(14px); } }
.eyebrow { font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--teal-dd); margin-bottom: 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.display { font-size: clamp(2.75rem, 6.4vw, 5.375rem); font-weight: 750; letter-spacing: -0.045em; line-height: 0.98; background: linear-gradient(180deg, #0f2a2f 30%, #0b5560); -webkit-background-clip: text; background-clip: text; color: transparent; padding-bottom: 0.06em; }
.display-s { font-size: clamp(1.875rem, 4.2vw, 3.125rem); font-weight: 720; letter-spacing: -0.035em; margin-bottom: 14px; }
.lead { font-size: clamp(1.125rem, 1.7vw, 1.375rem); color: var(--ink-2); margin: 16px 0 0; max-width: 34ch; line-height: 1.4; }
.lead-s { font-size: 1.125rem; color: var(--ink-2); line-height: 1.5; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.center { text-align: center; }
.h-s { font-size: 1.125rem; margin: 26px 0 10px; }

/* ── welcome ── */
.welcome { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
.hero-logo { width: min(440px, 88%); height: auto; margin: 6px 0 30px; display: block; }
.facts { list-style: none; padding: 0; margin: 30px 0 0; display: flex; flex-wrap: wrap; gap: 10px; }
.facts li { padding: 12px 18px; border-radius: 18px; background: rgba(255, 255, 255, 0.66); border: 1px solid rgba(255, 255, 255, 0.8); box-shadow: 0 8px 20px -16px rgba(15, 42, 47, 0.4); }
.facts strong { display: block; font: 700 1.625rem/1.05 var(--font-d); letter-spacing: -0.03em; }
.facts span { font-size: 0.8125rem; color: var(--muted); }
.hero-art { margin-top: 18px; }
.hero-art .dg { width: 100%; height: auto; display: block; }
.module-strip { list-style: none; padding: 0; margin: 18px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.module-strip li { position: relative; display: grid; grid-template-columns: 1fr; gap: 2px; padding: 12px; border-radius: 20px; background: rgba(255, 255, 255, 0.66); border: 1px solid rgba(255, 255, 255, 0.85); box-shadow: 0 10px 24px -20px rgba(15, 42, 47, 0.5); }
.module-strip img { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: contain; border-radius: 12px; background: linear-gradient(180deg, #f6fbfa, #e2f2ef); margin-bottom: 6px; }
.module-strip .ms-n { position: absolute; top: 18px; left: 20px; font: 700 0.75rem/1 var(--font-d); color: var(--teal-dd); background: rgba(255, 255, 255, 0.9); padding: 4px 7px; border-radius: 999px; }
.module-strip strong { font-size: 0.9062rem; line-height: 1.25; }
.module-strip small { color: var(--muted); font-size: 0.7812rem; }
.form-card { position: sticky; top: 92px; }
.form-card h2 { font-size: 1.625rem; margin-bottom: 4px; }
.field { margin-top: 18px; }
.field label { display: block; font-weight: 650; font-size: 0.9375rem; margin-bottom: 7px; }
.optional { float: right; font-weight: 500; color: var(--muted); font-size: 0.8125rem; }
.field input { width: 100%; min-height: 52px; padding: 12px 16px; border-radius: 15px; border: 1px solid rgba(15, 42, 47, 0.16); background: rgba(255, 255, 255, 0.9); font-size: 1.0625rem; transition: border-color 0.2s, box-shadow 0.2s; }
.field input:focus { outline: none; border-color: var(--teal-d); box-shadow: 0 0 0 4px rgba(90, 196, 190, 0.35); }
.field input[aria-invalid="true"] { border-color: var(--red); }
.field-err, .form-error { color: var(--red); font-weight: 650; font-size: 0.875rem; min-height: 0; }
.field-err:not(:empty) { margin-top: 6px; }
.form-card .btn-wide { margin-top: 24px; }
.form-error:not(:empty) { margin-top: 14px; }
.resume { margin-top: 14px; font-size: 0.875rem; color: var(--muted); }
.notice { display: flex; gap: 14px; align-items: flex-start; margin-top: 40px; padding: 18px 22px; border-radius: var(--r-l); background: rgba(255, 246, 222, 0.82); }
.notice svg { width: 30px; height: 30px; flex: 0 0 auto; }
.notice p { font-size: 0.9375rem; }

/* ── deck ── */
.deck { display: grid; grid-template-columns: 272px minmax(0, 1fr); gap: 26px; align-items: start; }
.rail { position: sticky; top: 90px; padding: 10px; border-radius: var(--r-l); max-height: calc(100vh - 210px); overflow: auto; }
.rail-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.rail-btn { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px; border: 0; border-radius: 16px; background: transparent; text-align: left; transition: background 0.2s; }
.rail-btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.7); }
.rail-btn[aria-current="step"] { background: #fff; box-shadow: 0 6px 18px -12px rgba(15, 42, 47, 0.5); }
.rail-btn:disabled { opacity: 0.5; }
.rail-t { display: grid; min-width: 0; }
.rail-t strong { font-size: 0.875rem; line-height: 1.25; font-weight: 650; }
.rail-t small { font-size: 0.75rem; color: var(--muted); }
.ring { --p: 0; flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--teal) calc(var(--p) * 360deg), rgba(15, 42, 47, 0.1) 0); transition: background 0.6s; }
.ring span { width: 30px; height: 30px; border-radius: 50%; background: #fff; display: grid; place-items: center; font: 700 0.8125rem/1 var(--font-d); color: var(--teal-dd); }

.slide { min-width: 0; touch-action: auto; container: slide / inline-size; }
.slide-head { margin-bottom: 16px; }
.slide-head .eyebrow { text-transform: none; letter-spacing: 0.01em; font-size: 0.875rem; font-weight: 650; }
.eb-mod { color: var(--muted); }
.eb-sep { color: var(--muted); }
.eb-chip { margin-left: 4px; padding: 3px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.8); border: 1px solid rgba(0, 112, 122, 0.25); font-size: 0.7812rem; }
.slide-head h1 { font-size: clamp(1.6875rem, 3.3vw, 2.75rem); font-weight: 720; letter-spacing: -0.03em; max-width: 26ch; }
.sub-dots { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 2px; }
.dot { width: 26px; height: 26px; border: 0; background: none; padding: 0; display: grid; place-items: center; border-radius: 8px; }
.dot::before { content: ""; width: 8px; height: 8px; border-radius: 99px; background: rgba(15, 42, 47, 0.22); transition: width 0.35s var(--spring), background 0.3s; }
.dot:not(:disabled):hover::before { background: var(--teal); }
.dot[aria-current="true"] { width: 34px; }
.dot[aria-current="true"]::before { width: 24px; background: var(--teal); }
.dot:disabled::before { background: rgba(15, 42, 47, 0.1); }

.slide-body { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr); gap: 20px; align-items: start; }
.slide-body[data-layout="gallery"] { grid-template-columns: minmax(0, 1fr); }
.slide-body[data-layout="gallery"] .rules { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 6px 22px; }
.stage { margin: 0; padding: clamp(12px, 1.6vw, 20px); min-width: 0; }
.stage-art { min-width: 0; }
.stage-art .dg { display: block; width: 100%; height: auto; }
.stage-controls { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }


.lesson { padding: clamp(18px, 2.4vw, 28px); min-width: 0; }
.rules { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.rules > li { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; align-items: start; padding: 10px 10px; border-radius: 16px; transition: background 0.25s; }
.rules > li.is-active { background: var(--mint-l); }
.rules p { font-size: 1.1875rem; line-height: 1.65; color: var(--ink); }
.rule-n { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--teal-d); background: #fff; color: var(--ink); font: 800 0.875rem/1 var(--font-d); display: grid; place-items: center; transition: transform 0.25s var(--spring), background 0.2s; margin-top: 1px; }
.rule-n:hover { transform: scale(1.08); }
.rule-n[aria-pressed="true"] { background: var(--teal-dd); color: #fff; border-color: var(--teal-dd); }
.correction { display: flex; gap: 12px; align-items: flex-start; margin-top: 16px; padding: 14px 16px; border-radius: 16px; background: rgba(255, 241, 205, 0.9); border: 1px solid rgba(201, 134, 18, 0.35); color: #6e4a07; }
.correction svg { width: 26px; height: 26px; flex: 0 0 auto; color: #a76d0a; }
.correction-k { font-size: 0.75rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 2px; }
.correction p:last-child { color: #4a3205; font-size: 1.0625rem; line-height: 1.6; }
.sources { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--hair); }
.sources h2 { font-size: 0.75rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; font-family: var(--font); }
.sources ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.sources a, .src-local { display: flex; gap: 8px; align-items: baseline; font-size: 0.9375rem; line-height: 1.45; color: var(--teal-dd); text-decoration: none; padding: 3px 4px; border-radius: 8px; }
.sources a:hover .src-t { text-decoration: underline; }
.src-local { color: var(--ink-2); }
.src-id { flex: 0 0 auto; min-width: 26px; text-align: center; font: 700 0.7188rem/1.6 var(--font-d); padding: 0 6px; border-radius: 999px; background: rgba(0, 146, 158, 0.12); color: var(--teal-dd); }

/* beat linking: rule ↔ diagram */
#stage [data-b] { transition: opacity 0.35s var(--ease), filter 0.35s var(--ease); }
#stage [data-b].is-dim { opacity: 0.26; }
#stage .dg [data-b].is-lit { filter: drop-shadow(0 0 8px rgba(90, 196, 190, 0.9)); }
#stage .hs { cursor: pointer; }
#stage .hs.is-lit .hs-face { fill: var(--teal-dd); }
#stage .hs.is-lit text { fill: #fff; }
.stage[data-guide="auto"][data-beat="1"] .hazard-truck { animation: hazard-approach 1.55s var(--ease) both; transform-box: fill-box; transform-origin: center; }
.stage[data-guide="auto"][data-beat="1"] .hazard-ped { animation: hazard-avoid 1.55s var(--ease) both; transform-box: fill-box; transform-origin: center; }
@keyframes hazard-approach { 0% { transform: translateX(-22px); } 58%, 100% { transform: translateX(22px); } }
@keyframes hazard-avoid { 0%, 42% { transform: translateX(0); } 72%, 100% { transform: translateX(32px); } }
.gear-fixed { transform-box: fill-box; transform-origin: center; }
.hs-ring { transform-box: fill-box; transform-origin: center; animation: hs-ring 2.6s var(--ease) 2 both; }
@keyframes hs-ring { 0% { transform: scale(1); opacity: 0.9; } 70% { transform: scale(1.7); opacity: 0; } 100% { transform: scale(1); opacity: 0; } }
.hs-in { transform: translate(var(--hs-dx, 0px), var(--hs-dy, 0px)) scale(var(--hs-s, 1)); transform-box: fill-box; transform-origin: center; }
.hs-hit { pointer-events: all; }

body:not([data-view="course"]) .dock { display: none; }
.dock { position: fixed; z-index: 35; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(720px, calc(100% - 24px)); display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.8); }
.dock-count { font: 650 0.875rem/1 var(--font-d); color: var(--ink-2); font-variant-numeric: tabular-nums; text-align: center; }
.dock .btn { min-width: 120px; }

/* slide transitions — orient direction, never block reading */
.slide.enter-next .slide-head, .slide.enter-next .stage, .slide.enter-next .lesson { animation: in-next 0.5s var(--ease) both; }
.slide.enter-prev .slide-head, .slide.enter-prev .stage, .slide.enter-prev .lesson { animation: in-prev 0.5s var(--ease) both; }
.slide.enter-next .stage, .slide.enter-prev .stage { animation-delay: 0.05s; }
.slide.enter-next .lesson, .slide.enter-prev .lesson { animation-delay: 0.1s; }
.slide.enter-module .stage { animation-name: in-module; animation-duration: 0.7s; }
@keyframes in-next { from { opacity: 0; transform: translateX(14px); } }
@keyframes in-prev { from { opacity: 0; transform: translateX(-14px); } }
@keyframes in-module { from { opacity: 0; transform: translateY(18px) scale(0.97); } }
.slide.enter-next .rules > li, .slide.enter-prev .rules > li { animation: rise 0.5s var(--ease) both; animation-delay: calc(0.12s + var(--d, 0) * 0.05s); }

/* ── equipment, signs & galleries ── */
.equip-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11.25rem), 1fr)); gap: 12px; }
.equip-card { margin: 0; padding: 10px 10px 14px; border-radius: 20px; background: rgba(255, 255, 255, 0.78); border: 1px solid rgba(255, 255, 255, 0.9); box-shadow: 0 10px 26px -20px rgba(15, 42, 47, 0.5); }
.equip-card figcaption { display: grid; gap: 1px; text-align: center; }
.equip-card strong { font-size: 0.9375rem; }
.equip-card span { font-size: 0.8125rem; color: var(--muted); }

.sign-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 8.25rem), 1fr)); gap: 12px; }
.sign-card { margin: 0; padding: 16px 10px 12px; border-radius: 20px; background: rgba(255, 255, 255, 0.82); border: 1px solid rgba(255, 255, 255, 0.95); box-shadow: 0 10px 26px -20px rgba(15, 42, 47, 0.55); text-align: center; display: grid; gap: 8px; justify-items: center; transition: transform 0.35s var(--spring), box-shadow 0.3s; }
.sign-card:hover { transform: translateY(-3px); box-shadow: 0 18px 32px -22px rgba(15, 42, 47, 0.6); }
.sign-wrap { width: 92px; height: 92px; display: grid; place-items: center; }
.sign-wrap .sign { width: 100%; height: 100%; filter: drop-shadow(0 4px 6px rgba(15, 42, 47, 0.16)); }
.sign-card figcaption { font-size: 0.875rem; line-height: 1.3; font-weight: 600; color: var(--ink); }
.sign-card figcaption small { display: block; font-weight: 600; font-size: 0.75rem; color: var(--muted); margin-top: 2px; }
.sign-card.is-focus { outline: 2px solid var(--amber); outline-offset: -2px; background: rgba(255, 248, 228, 0.95); }
.sign-card.is-focus small { color: #8a5a00; }

.family-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.family-card { margin: 0; display: flex; gap: 14px; align-items: center; padding: 16px; border-radius: 22px; background: rgba(255, 255, 255, 0.84); border: 1px solid rgba(255, 255, 255, 0.95); box-shadow: 0 12px 28px -22px rgba(15, 42, 47, 0.55); }
.family-card .sign-wrap { width: 76px; height: 76px; flex: 0 0 auto; }
.family-card figcaption { display: grid; gap: 2px; min-width: 0; }
.family-card strong { font-size: 0.9688rem; line-height: 1.25; }
.family-card span { font-size: 0.8438rem; color: var(--muted); }
.fam-prohibition { box-shadow: inset 4px 0 0 #d3212c, 0 12px 28px -22px rgba(15, 42, 47, 0.55); }
.fam-warning { box-shadow: inset 4px 0 0 #ffc20e, 0 12px 28px -22px rgba(15, 42, 47, 0.55); }
.fam-mandatory { box-shadow: inset 4px 0 0 #1460a8, 0 12px 28px -22px rgba(15, 42, 47, 0.55); }
.fam-emergency { box-shadow: inset 4px 0 0 #13844b, 0 12px 28px -22px rgba(15, 42, 47, 0.55); }
.fam-fire, .fam-alarm { box-shadow: inset 4px 0 0 #d3212c, 0 12px 28px -22px rgba(15, 42, 47, 0.55); }
.a-reveal { animation: reveal 0.7s var(--ease) both; animation-delay: calc(var(--d, 0) * 0.09s); }
.a-reveal .sign-wrap { animation: sign-pop 0.7s var(--spring) both; animation-delay: calc(0.15s + var(--d, 0) * 0.09s); }
@keyframes reveal { from { opacity: 0; transform: translateY(14px) scale(0.98); clip-path: inset(0 0 100% 0 round 22px); } to { clip-path: inset(0 0 0 0 round 22px); } }
@keyframes sign-pop { from { transform: scale(0.6) rotate(-8deg); opacity: 0; } }

.combo { display: flex; gap: 16px; align-items: center; margin-top: 12px; padding: 14px 16px; border-radius: 20px; background: rgba(255, 255, 255, 0.8); border: 1px solid rgba(255, 255, 255, 0.95); }
.combo-pair { display: flex; gap: 6px; flex: 0 0 auto; }
.combo-pair .sign { width: 64px; height: 64px; }
.combo .dg.mini { width: 200px; flex: 0 0 auto; }
.combo p { font-size: 0.9375rem; }
.swatches { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.swatches figure { margin: 0; display: grid; gap: 6px; font-size: 0.8125rem; color: var(--ink-2); text-align: center; }
.sw { display: block; height: 34px; border-radius: 10px; }
.sw-yb { background: repeating-linear-gradient(45deg, #15191b 0 12px, #ffc20e 12px 24px); }
.sw-rw { background: repeating-linear-gradient(45deg, #d3212c 0 12px, #fff 12px 24px); border: 1px solid #e3cfcf; }
.sw-line { background: linear-gradient(#9fb1b4, #9fb1b4) center/100% 100%; position: relative; }
.sw-line::before, .sw-line::after { content: ""; position: absolute; left: 0; right: 0; height: 6px; background: #ffc20e; }
.sw-line::before { top: 6px; } .sw-line::after { bottom: 6px; background: #fff; }
.assembly-note { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 12px 14px; border-radius: 18px; background: rgba(255, 255, 255, 0.8); }
.assembly-note .sign { width: 54px; height: 54px; flex: 0 0 auto; }
.assembly-note p { font-size: 0.9375rem; }

/* CLP */
.clp { display: grid; gap: 14px; }
.sign-grid.is-ghs .sign-card figcaption small { font-variant-numeric: tabular-nums; letter-spacing: 0.04em; }
.clp-row { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 14px; }
.clp-label { background: #fff; border-radius: 18px; border: 2px solid #1d2a2c; padding: 14px 16px; box-shadow: 0 14px 30px -24px rgba(15, 42, 47, 0.6); }
.clp-label header { display: grid; gap: 6px; border-bottom: 1px dashed #c7d3d4; padding-bottom: 10px; margin-bottom: 10px; }
.slot { display: block; font-size: 0.8125rem; font-weight: 650; padding: 6px 10px; border-radius: 8px; background: repeating-linear-gradient(-45deg, #f3f7f7 0 8px, #ebf1f1 8px 16px); color: var(--ink-2); }
.slot-s { font-weight: 500; }
.clp-body { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: start; }
.clp-picts { display: grid; gap: 6px; }
.clp-picts .sign { width: 62px; height: 62px; }
.signal { font: 800 1.25rem/1.2 var(--font-d); color: #b4262b; margin-bottom: 6px; }
.signal small { font-weight: 500; color: var(--muted); font-size: 0.875rem; }
.stmts { font-size: 0.875rem; line-height: 1.55; margin-bottom: 8px; }
.legacy { padding: 14px; border-radius: 18px; background: rgba(240, 240, 236, 0.85); border: 1px dashed #b8b2a2; }
.legacy-tag { display: inline-block; font-size: 0.75rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: #6d5a2a; background: #f6e8bd; padding: 4px 10px; border-radius: 999px; margin-bottom: 10px; }
.legacy-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; filter: saturate(0.55); opacity: 0.85; }
.legacy-grid figure { margin: 0; text-align: center; font: 700 0.75rem/1.2 var(--font-d); color: var(--ink-2); }
.legacy-grid .sign { width: 100%; height: auto; aspect-ratio: 1; }
.legacy-note { font-size: 0.8438rem; color: #4f4a3e; margin-top: 10px; }

/* signals */
.signals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.sig-panel { padding: 14px 16px; border-radius: 20px; background: rgba(255, 255, 255, 0.82); border: 1px solid rgba(255, 255, 255, 0.95); box-shadow: 0 10px 26px -22px rgba(15, 42, 47, 0.55); min-width: 0; }
.sig-panel.wide { grid-column: 1 / -1; }
.sig-panel h3 { font-size: 1rem; margin-bottom: 8px; display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.sig-panel h3 small { font: 500 0.8125rem var(--font); color: var(--muted); letter-spacing: 0; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { padding: 7px 14px; border-radius: 999px; background: var(--mint-l); color: var(--teal-dd); font-weight: 700; font-size: 0.9062rem; }
.hand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 7.4rem), 1fr)); gap: 8px; }
.hand-card { margin: 0; padding: 8px 6px 10px; border-radius: 16px; background: linear-gradient(180deg, #f7fbfb, #eef6f5); text-align: center; }
.hand-card .sig { width: 76px; height: auto; margin: 0 auto; display: block; }
.hand-card figcaption { display: grid; gap: 2px; }
.hand-card strong { font-size: 0.875rem; }
.hand-card span { font-size: 0.75rem; line-height: 1.3; color: var(--muted); }

/* decision checklist */
.decide { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); gap: 14px; align-items: stretch; }
.decide-list { margin: 0; padding: 10px; border: 0; border-radius: 20px; background: rgba(255, 255, 255, 0.82); display: grid; gap: 4px; }
.decide-list legend { font: 700 1.0625rem var(--font-d); padding: 6px 8px 0; float: left; width: 100%; margin-bottom: 4px; }
.decide-list legend em { font-style: normal; color: var(--teal-dd); }
.switch { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 12px; align-items: center; padding: 10px; border-radius: 14px; cursor: pointer; transition: background 0.2s; }
.switch:hover { background: rgba(216, 241, 238, 0.6); }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sw-track { width: 52px; height: 32px; border-radius: 999px; background: rgba(15, 42, 47, 0.18); position: relative; transition: background 0.25s; }
.sw-knob { position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25); transition: transform 0.3s var(--spring); }
.switch input:checked + .sw-track { background: var(--green); }
.switch input:checked + .sw-track .sw-knob { transform: translateX(20px); }
.switch input:focus-visible + .sw-track { outline: 3px solid var(--teal-dd); outline-offset: 3px; }
.sw-text { font-size: 0.9688rem; line-height: 1.4; }
.decide-out { border-radius: 20px; padding: 18px; display: grid; gap: 14px; align-content: center; background: rgba(229, 245, 236, 0.92); border: 1px solid rgba(19, 122, 76, 0.25); transition: background 0.4s; }
.decide-out[data-all="true"] { background: rgba(255, 238, 233, 0.92); border-color: rgba(201, 48, 47, 0.25); }
.decide-out > div:not(.meter) { display: flex; gap: 14px; align-items: center; }
.decide-out .sign { width: 72px; height: 72px; flex: 0 0 auto; }
.decide-out p { display: grid; gap: 4px; }
.decide-out strong { font: 700 1.125rem/1.25 var(--font-d); }
.decide-out span { font-size: 0.9062rem; color: var(--ink-2); }
.decide-out .out-go, .decide-out[data-all="true"] .out-evac { display: none !important; }
.decide-out[data-all="true"] .out-go { display: flex !important; }
.meter { height: 8px; border-radius: 99px; background: rgba(15, 42, 47, 0.1); overflow: hidden; }
.meter span { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--teal), var(--mint)); transform-origin: left; transform: scaleX(var(--n)); transition: transform 0.45s var(--ease); }

/* summary tiles */
.decisions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.decision { margin: 0; padding: 12px; border-radius: 22px; background: rgba(255, 255, 255, 0.84); border: 1px solid rgba(255, 255, 255, 0.95); box-shadow: 0 12px 28px -22px rgba(15, 42, 47, 0.55); display: grid; gap: 8px; }
.decision-art { min-height: 120px; display: grid; place-items: center; border-radius: 14px; background: linear-gradient(180deg, #f7fbfb, #e6f3f1); overflow: hidden; }
.decision-art svg { aspect-ratio: 16 / 10; }
.decision-art svg { width: 100%; height: 100%; }
.mini-signs { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; padding: 8px; }
.mini-signs .sign { width: 42px; height: 42px; }
.decision figcaption { display: flex; gap: 8px; align-items: center; font: 700 1rem var(--font-d); }
.decision figcaption span { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--teal-dd); color: #fff; font-size: 0.8125rem; }

/* segmented control & stepper */
.seg { display: inline-flex; padding: 4px; border-radius: 999px; background: rgba(15, 42, 47, 0.07); gap: 2px; flex-wrap: wrap; }
.seg-btn { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 0; background: transparent; font-weight: 650; font-size: 0.9062rem; color: var(--ink-2); transition: background 0.25s, color 0.25s, box-shadow 0.25s; }
.seg-btn[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 4px 14px -6px rgba(15, 42, 47, 0.35); }
.stepper { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.step-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px 0 6px; border-radius: 999px; border: 1px solid rgba(15, 42, 47, 0.12); background: rgba(255, 255, 255, 0.85); font-weight: 650; font-size: 0.9062rem; transition: background 0.25s, color 0.25s; }
.step-btn span { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--mint-l); color: var(--teal-dd); font: 800 0.875rem/1 var(--font-d); }
.step-btn em { font-style: normal; }
.step-btn[aria-pressed="true"] { background: var(--teal-dd); color: #fff; border-color: transparent; }
.step-btn[aria-pressed="true"] span { background: #fff; }
.play-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: linear-gradient(180deg, #0aa6b1, #007f8a); color: #fff; display: grid; place-items: center; box-shadow: 0 8px 18px -10px rgba(0, 112, 122, 0.8); }
.play-btn svg { width: 20px; height: 20px; fill: currentColor; }
.play-btn .i-pause, .play-btn[data-playing="true"] .i-play { display: none; }
.play-btn[data-playing="true"] .i-pause { display: inline; }
.step-live { flex-basis: 100%; font-size: 0.9375rem; color: var(--ink-2); margin-top: 6px; font-weight: 600; }
.dg [data-st] { transition: opacity 0.45s var(--ease); }
.dg .st:not(.on) { opacity: 0.28; }
.dg .st-only:not(.on) { opacity: 0; }
.dg .progress-line { transform-box: view-box; transform-origin: 86px 150px; transition: transform 0.6s var(--ease); transform: scaleX(0); }
.dg[data-step="2"] .progress-line { transform: scaleX(0.333); }
.dg[data-step="3"] .progress-line { transform: scaleX(0.666); }
.dg[data-step="4"] .progress-line { transform: scaleX(1); }

/* ── phase checkpoint and quiz ── */
.center-card { text-align: left; }
.recap-card { text-align: center; }
.recap-card .eyebrow { justify-content: center; }
.recap-sequence { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 26px 0; }
.recap-step { position: relative; display: grid; justify-items: center; gap: 10px; padding: 20px 12px; border-radius: 22px; background: rgba(255,255,255,.78); }
.recap-step > span { position: absolute; top: 10px; left: 12px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--teal-dd); color: #fff; font-weight: 800; }
.recap-step svg { width: 76px; height: 76px; fill: none; stroke: currentColor; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.recap-stop { color: var(--red); }
.recap-secure, .recap-report { color: var(--teal-dd); }
.recap-secure svg, .recap-report svg { width: 92px; height: 92px; }
.recap-step strong { color: var(--ink); font-size: 1.0625rem; }
.quiz-start { margin-top: 28px; min-height: 62px; font-size: 1.125rem; }
.quiz-top { display: grid; gap: 10px; margin-bottom: 14px; }
.quiz-card fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.quiz-card legend { font: 700 clamp(1.375rem, 2.6vw, 1.875rem)/1.25 var(--font-d); letter-spacing: -0.02em; padding: 0; margin-bottom: 8px; }
.q-cat { font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 18px; }
.options { display: grid; gap: 10px; }
.option { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 14px; align-items: center; padding: 16px 18px; border-radius: 18px; border: 1.5px solid rgba(15, 42, 47, 0.12); background: rgba(255, 255, 255, 0.88); cursor: pointer; transition: border-color 0.2s, background 0.2s, transform 0.25s var(--spring); }
.option:hover { border-color: var(--mint); }
.option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.opt-k { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; border: 2px solid rgba(15, 42, 47, 0.2); font: 800 0.875rem/1 var(--font-d); color: var(--ink-2); transition: all 0.2s; }
.opt-t { font-size: 1.0625rem; line-height: 1.4; }
.option:has(input:checked) { border-color: var(--teal-d); background: var(--mint-l); }
.option:has(input:checked) .opt-k { background: var(--teal-dd); border-color: var(--teal-dd); color: #fff; }
.option:has(input:focus-visible) { outline: 3px solid var(--teal-dd); outline-offset: 3px; }
.quiz-card.q-enter { animation: in-next 0.45s var(--ease) both; }

.score-ring { position: relative; width: 130px; height: 130px; margin: 0 0 14px; }
.score-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.score-ring circle { fill: none; stroke-width: 10; }
.ring-bg { stroke: rgba(15, 42, 47, 0.09); }
.ring-fg { --p: 0; stroke: var(--amber); stroke-linecap: round; stroke-dasharray: 326.7; stroke-dashoffset: calc(326.7 * (1 - var(--p))); transition: stroke-dashoffset 1.2s var(--ease); }
.score-ring span { position: absolute; inset: 0; display: grid; place-items: center; font: 750 1.875rem var(--font-d); letter-spacing: -0.03em; }
.cat-bars { display: grid; gap: 8px; margin: 20px 0 0; }
.cat-row { display: grid; grid-template-columns: minmax(0, 170px) minmax(0, 1fr) auto; gap: 12px; align-items: center; font-size: 0.9375rem; }
.cat-bar { height: 10px; border-radius: 99px; background: rgba(15, 42, 47, 0.08); overflow: hidden; }
.cat-bar i { display: block; height: 100%; width: calc(var(--p) * 100%); background: linear-gradient(90deg, var(--teal), var(--mint)); }
.wrong-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.wrong-list li { display: flex; flex-wrap: wrap; gap: 4px 12px; justify-content: space-between; align-items: center; padding: 10px 14px; border-radius: 14px; background: rgba(255, 255, 255, 0.75); font-size: 0.9375rem; }

/* ── Code of Conduct ── */
.conduct-head { max-width: 880px; margin-bottom: 22px; }
.pass-badge { display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border-radius: 999px; background: rgba(229, 245, 236, 0.95); color: #0d5c38; font-weight: 700; font-size: 0.9062rem; margin-bottom: 16px; }
.pb-check { width: 26px; height: 26px; border-radius: 50%; background: var(--green); position: relative; }
.pb-check::after { content: ""; position: absolute; left: 9px; top: 5px; width: 6px; height: 11px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.conduct { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 22px; align-items: start; }
.conduct-index { position: sticky; top: 90px; padding: 12px; border-radius: var(--r-l); }
.conduct-index ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; }
.conduct-index a { display: block; padding: 9px 10px; border-radius: 12px; text-decoration: none; color: var(--ink-2); font-size: 0.875rem; font-weight: 600; line-height: 1.3; }
.conduct-index a:hover { background: rgba(255, 255, 255, 0.85); color: var(--teal-dd); }
.conduct-body { display: grid; gap: 14px; }
.coc { padding: clamp(18px, 2.4vw, 28px); border-radius: var(--r-l); scroll-margin-top: 92px; }
.coc h2 { font-size: 1.3125rem; margin-bottom: 10px; }
.coc ul { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.coc li { font-size: 1.125rem; line-height: 1.65; }
.coc li::marker { color: var(--teal); }
.accept { margin-top: 22px; max-width: 880px; margin-left: auto; }
.check { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 14px; align-items: start; padding: 18px; border-radius: 18px; background: rgba(216, 241, 238, 0.65); border: 1px solid rgba(0, 112, 122, 0.25); cursor: pointer; font-size: 1.0312rem; line-height: 1.5; margin: 18px 0; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check-box { width: 28px; height: 28px; border-radius: 9px; border: 2px solid var(--teal-d); background: #fff; position: relative; transition: background 0.2s; margin-top: 1px; }
.check input:checked + .check-box { background: var(--teal-dd); border-color: var(--teal-dd); }
.check input:checked + .check-box::after { content: ""; position: absolute; left: 8px; top: 3px; width: 7px; height: 13px; border: solid #fff; border-width: 0 3px 3px 0; transform: rotate(45deg); }
.check input:focus-visible + .check-box { outline: 3px solid var(--teal-dd); outline-offset: 3px; }
.sources-inline { font-size: 0.8125rem; color: var(--muted); margin-bottom: 14px; }
.ack-list { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 8px; }
.ack-list li { position: relative; padding: 10px 14px 10px 44px; border-radius: 14px; background: rgba(255, 255, 255, 0.75); font-size: 0.9688rem; }
.ack-list li::before { content: ""; position: absolute; left: 14px; top: 50%; width: 20px; height: 20px; margin-top: -10px; border-radius: 50%; background: var(--green); }
.ack-list li::after { content: ""; position: absolute; left: 21px; top: 50%; width: 5px; height: 9px; margin-top: -7px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }

/* ── passed: success transition before Phase 2 (final frame is the base style; reduced motion shows it static) ── */
.pass-card { text-align: center; display: grid; justify-items: center; }
.pass-card .eyebrow { justify-content: center; }
.pass-card h1 { hyphens: manual; -webkit-hyphens: manual; }
.pass-card .lead-s { max-width: 38ch; margin: 0 auto 22px; }
.pass-mark { width: 132px; height: 132px; margin: 0 auto 10px; position: relative; }
.pass-mark::before { content: ""; position: absolute; inset: -18px; border-radius: 50%; background: radial-gradient(closest-side, rgba(31, 157, 106, 0.28), transparent); animation: bloom 1.6s var(--ease) both; }
.pass-mark svg { position: relative; width: 100%; height: 100%; overflow: visible; }
.pm-ring { fill: #e5f5ec; stroke: var(--green); stroke-width: 6; stroke-dasharray: 315; stroke-dashoffset: 0; transform: rotate(-90deg); transform-origin: center; animation: draw-ring 0.8s var(--ease) both 0.1s; }
.pm-check { fill: none; stroke: var(--green); stroke-width: 9; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 80; stroke-dashoffset: 0; animation: draw-check 0.5s var(--ease) both 0.7s; }
.pm-sparks path { fill: none; stroke: #f2b33d; stroke-width: 5; stroke-linecap: round; }
.pm-sparks { transform-origin: 80px 80px; animation: spark-burst 0.9s var(--ease) both 1s; }
@keyframes spark-burst { from { transform: scale(0.55); opacity: 0; } 60% { opacity: 1; } }
.pass-score { display: inline-flex; align-items: center; gap: 8px; margin: 2px 0 14px; padding: 8px 16px; border-radius: 999px; background: rgba(229, 245, 236, 0.95); color: #0d5c38; font-weight: 700; font-size: 1.0625rem; }
@media (max-width: 640px) { .pass-mark { width: 104px; height: 104px; } }

/* ── completion ── */
.done-wrap { text-align: center; display: grid; justify-items: center; gap: 4px; }
.done-mark { width: 120px; height: 120px; margin-bottom: 12px; position: relative; }
.done-mark::before { content: ""; position: absolute; inset: -40px; border-radius: 50%; background: radial-gradient(closest-side, rgba(90, 196, 190, 0.45), transparent); animation: bloom 2.2s var(--ease) both; }
.done-mark svg { position: relative; width: 100%; height: 100%; }
.dm-ring { fill: rgba(255, 255, 255, 0.85); stroke: var(--teal); stroke-width: 6; stroke-dasharray: 315; stroke-dashoffset: 0; animation: draw-ring 1s var(--ease) both 0.15s; transform: rotate(-90deg); transform-origin: center; }
.dm-check { fill: none; stroke: var(--teal-dd); stroke-width: 8; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 80; stroke-dashoffset: 0; animation: draw-check 0.6s var(--ease) both 0.9s; }
@keyframes draw-ring { from { stroke-dashoffset: 315; } }
@keyframes draw-check { from { stroke-dashoffset: 80; } }
@keyframes bloom { from { transform: scale(0.4); opacity: 0; } 60% { opacity: 1; } to { transform: scale(1); opacity: 0.7; } }
.cert { width: 100%; text-align: left; padding: clamp(22px, 3.4vw, 40px); margin: 18px 0 8px; border-radius: var(--r-xl); }
.cert-logo { height: 54px; width: auto; margin-bottom: 18px; }
.cert h2 { font-size: clamp(1.75rem, 4vw, 2.625rem); letter-spacing: -0.03em; margin-bottom: 6px; }
.cert-course { color: var(--ink-2); font-size: 1.0625rem; margin-bottom: 16px; }
.cert dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 0 0 16px; }
.cert dl div:first-child { grid-column: 1 / -1; }
.cert dl div { padding: 10px 12px; border-radius: 14px; background: rgba(255, 255, 255, 0.75); min-width: 0; }
.cert dl div:nth-child(3) { grid-column: 1 / -1; }
.cert dt { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.cert dd { margin: 2px 0 0; font-weight: 650; overflow-wrap: anywhere; min-width: 0; }
.cert-ack { color: var(--green); font-weight: 700; margin-bottom: 8px; }
.cert-note { font-size: 0.875rem; color: var(--muted); }
.downloads { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 10px 0; }

/* ── contents sheet ── */
.sheet { border: 0; padding: 0; background: transparent; max-width: min(820px, calc(100% - 24px)); width: 100%; max-height: calc(100vh - 48px); color: var(--ink); }
.sheet::backdrop { background: rgba(15, 42, 47, 0.25); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.sheet[open] { animation: sheet-in 0.45s var(--spring) both; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(24px) scale(0.98); } }
.sheet-inner { padding: 22px; max-height: calc(100vh - 48px); overflow: auto; background: rgba(255, 255, 255, 0.9); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; }
.sheet-head h2 { font-size: 1.375rem; }
.contents-list { display: grid; gap: 14px; margin-top: 14px; }
.toc-mod header { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.toc-mod header img { width: 96px; height: 60px; object-fit: contain; border-radius: 10px; background: linear-gradient(180deg, #f6fbfa, #e2f2ef); }
.toc-mod h3 { font-size: 1.0312rem; }
.toc-mod small { color: var(--muted); font-size: 0.8125rem; }
.toc-mod ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 4px; }
.toc-btn { width: 100%; display: flex; gap: 10px; align-items: center; text-align: left; min-height: 44px; padding: 6px 10px; border-radius: 12px; border: 0; background: transparent; font-size: 0.9062rem; }
.toc-btn:hover:not(:disabled) { background: var(--mint-l); }
.toc-btn[aria-current="true"] { background: var(--teal-dd); color: #fff; }
.toc-btn:disabled { opacity: 0.45; }
.toc-n { flex: 0 0 auto; width: 36px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--mint-l); color: var(--teal-dd); font: 750 0.875rem/1 var(--font-d); font-variant-numeric: tabular-nums; }
.toc-btn[aria-current="true"] .toc-n { background: rgba(255, 255, 255, 0.2); color: #fff; }
.toc-mod + .toc-mod { border-top: 1px solid rgba(15, 42, 47, 0.1); padding-top: 14px; }
.toc-btn[aria-current="true"] .toc-n { background: rgba(255, 255, 255, 0.25); }


/* ── responsive ── */
@media (max-width: 1100px) {
  .deck { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
  .family-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .decisions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .welcome { grid-template-columns: minmax(0, 1fr); }
  .form-card { position: static; }
  .slide-body { grid-template-columns: minmax(0, 1fr); }
  .conduct { grid-template-columns: minmax(0, 1fr); }
  .conduct-index { position: static; }
  .conduct-index ol { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  .clp-row, .decide { grid-template-columns: minmax(0, 1fr); }
  .module-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  body { font-size: 0.9688rem; }
  .topbar { flex-wrap: nowrap; gap: 8px; min-height: 72px; padding-top: 10px; padding-bottom: 10px; }
  .brand img { height: 36px; }
  .topbar-actions { display: contents; }
  #motion-toggle { margin-left: auto; }

  .icon-btn .btn-label { display: none; }
  .icon-btn { padding: 0; width: 44px; }
  html { scroll-padding-top: 110px; }
  .display { font-size: 2.875rem; }
  .lead { font-size: 1.125rem; }
  .facts { gap: 8px; }
  .facts li { padding: 10px 12px; flex: 1 1 calc(50% - 8px); }
  .facts strong { font-size: 1.375rem; }
  .module-strip { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
  .module-strip li { padding: 8px; }
  .module-strip strong { font-size: 0.8438rem; }
  .slide-head h1 { font-size: 1.625rem; }
  .stage { padding: 10px; border-radius: var(--r-l); }
  .lesson { border-radius: var(--r-l); padding: 14px; }
  .rules > li { grid-template-columns: 32px minmax(0, 1fr); gap: 10px; padding: 8px 6px; }
  .rules p { font-size: 1.125rem; }

  .slide-body[data-layout="gallery"] .rules { grid-template-columns: minmax(0, 1fr); }
  .sign-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 6.25rem), 1fr)); gap: 8px; }
  .sign-card { padding: 12px 6px 10px; border-radius: 16px; }
  .sign-wrap { width: 70px; height: 70px; }
  .sign-card figcaption { font-size: 0.8125rem; }
  .equip-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .equip-card:last-child { grid-column: 1 / -1; }
  .equip-card:last-child svg { max-width: 280px; margin: 0 auto; display: block; }
  .family-grid { grid-template-columns: minmax(0, 1fr); }
  .signals { grid-template-columns: minmax(0, 1fr); }
  .hand-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 6rem), 1fr)); }
  .combo { flex-direction: column; align-items: flex-start; }
  .combo .dg.mini { width: 100%; max-width: 260px; }
  .swatches { grid-template-columns: minmax(0, 1fr); }
  .legacy-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .clp-body { grid-template-columns: minmax(0, 1fr); }
  .clp-picts { grid-auto-flow: column; justify-content: start; }
  .decisions { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
  .decision figcaption { font-size: 0.875rem; }
  .dock { width: calc(100% - 16px); bottom: max(8px, env(safe-area-inset-bottom)); }
  .dock .btn { min-width: 0; padding: 0 16px; }
  .dock .btn-ghost span { display: none; }
  .dock-count { font-size: 0.8125rem; }
  .recap-sequence { grid-template-columns: minmax(0, 1fr); }
  .cat-row { grid-template-columns: minmax(0, 1fr) auto; }
  .cat-bar { grid-column: 1 / -1; grid-row: 2; }
  .option { padding: 14px; gap: 12px; }
  .opt-t { font-size: 1rem; }
  .row-actions .btn { flex: 1 1 auto; }
  .stepper .step-btn em { display: none; }
  .stepper .step-btn { padding: 0 6px; }
  .seg { width: 100%; }
  .seg-btn { flex: 1 1 auto; padding: 0 10px; font-size: 0.8438rem; }

}

/* ── reduced motion: everything settles into its final, static teaching state ── */
html[data-rm="true"] *, html[data-rm="true"] *::before, html[data-rm="true"] *::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}
html[data-rm="true"] .hs-ring { opacity: 0; }
html[data-rm="true"] .a-scan { opacity: 0; }
html[data-rm="true"] .a-drip { opacity: 1; transform: translateY(4px); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .amb { transform: none !important; }
  .hs-ring, .a-scan { opacity: 0; }
}

/* ── print: certificate only ── */
@media print {
  body { background: #fff; }
  .ambient, .topbar, .skip-link, .downloads, .done-mark, #d-review, .done-wrap > .eyebrow, .done-wrap > h1, .done-wrap > p, .dock, dialog { display: none !important; }
  .view { padding: 0; animation: none; }
  .cert { box-shadow: none; border: 1px solid #9fb1b4; background: #fff; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .cert::before { display: none; }
}

/* ════════════════════ iteration 2 · motion that explains, then settles ════════════════════
   Every lesson animation is finite. Base styles are the final teaching frame, so reduced motion,
   the stage "pause" control and a finished animation all land on the same correct picture. */
.a-rise { animation: rise 0.6s var(--ease) both; animation-delay: calc(var(--d, 0) * 0.08s); }
.dg .d2 { --d: 2; } .dg .d3 { --d: 3; } .dg .d4 { --d: 4; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
.a-drive { animation: drive 1.4s var(--ease) both; }
@keyframes drive { from { transform: translateX(-60px); opacity: 0; } }
.a-pop > * { transform-box: fill-box; transform-origin: center; animation: pop 0.6s var(--spring) both; }
.a-pop > *:nth-child(2n) { animation-delay: 0.15s; }
.a-pop > *:nth-child(3n) { animation-delay: 0.3s; }
@keyframes pop { from { transform: scale(0); opacity: 0; } }
.a-fill { transform-box: fill-box; transform-origin: left center; animation: fillx 1.4s var(--ease) both 0.2s; }
@keyframes fillx { from { transform: scaleX(0); } }
/* M0-2 — stop → move away → tell, in that order */
.a-seq { animation: seq 0.9s var(--ease) both; animation-delay: calc(0.3s + var(--d, 0) * 0.7s); transform-box: fill-box; transform-origin: center; }
@keyframes seq { 0% { opacity: 0.25; transform: scale(0.9); } 60% { opacity: 1; transform: scale(1.06); } 100% { opacity: 1; transform: none; } }
/* attention pulses (danger zones, anchors, ankle zone): three cycles */
.a-pulse { transform-box: fill-box; transform-origin: center; animation: pulse 2.4s ease-in-out 3; }
@keyframes pulse { 50% { transform: scale(1.12); opacity: 0.6; } }
.a-glow { animation: glow 2.8s ease-in-out 3; }
@keyframes glow { 50% { filter: drop-shadow(0 0 8px rgba(242, 179, 61, 0.9)); } }
.a-blink { animation: blink 1.6s steps(2, jump-none) 4; }
@keyframes blink { 50% { opacity: 0.25; } }
.a-flash { animation: flash 0.9s steps(2, jump-none) 8; }
@keyframes flash { 50% { opacity: 0.05; } }
/* M1-4 — inspection points are checked one after another */
.chk .hs-ring { animation: chk 1.1s var(--ease) 2 both; }
.chk1 .hs-ring { animation-delay: 0s; } .chk2 .hs-ring { animation-delay: 0.45s; } .chk3 .hs-ring { animation-delay: 0.9s; } .chk4 .hs-ring { animation-delay: 1.35s; } .chk5 .hs-ring { animation-delay: 1.8s; }
@keyframes chk { 0% { transform: scale(1); opacity: 1; } 90% { transform: scale(1.8); opacity: 0; } 100% { transform: scale(1); opacity: 0; } }
/* leak & noise (M1-5), battery (M1-10), cable spark (M4-5) */
.a-drip { animation: drip 2.2s ease-in 3; }
@keyframes drip { 0% { transform: translateY(-8px); opacity: 0; } 30% { opacity: 1; } 100% { transform: none; opacity: 1; } }
.a-airflow { animation: airflow 2.4s linear 3; }
@keyframes airflow { 0% { transform: translateX(-14px); opacity: 0; } 30% { opacity: 1; } 100% { transform: none; opacity: 1; } }
.a-spin { transform-box: fill-box; transform-origin: center; animation: spin 3s linear 2; }
@keyframes spin { to { transform: rotate(360deg); } }
/* M1-8 — the operator pushes forward (towards the danger zone in front of the load) */
.a-walk { animation: walk 3.2s ease-in-out 2 both; }
@keyframes walk { 0% { transform: translateX(-46px); } 100% { transform: none; } }
.a-needle { transform-box: view-box; transform-origin: 520px 116px; animation: needle 2.4s var(--ease) both 0.3s; }
@keyframes needle { 0% { transform: rotate(-150deg); } 60% { transform: rotate(-60deg); } 100% { transform: none; } }
/* M1-12 — approach aligned and slowly, then tines fully under the deck boards */
.a-insert { animation: insert 5.5s var(--ease) 2 both; }
@keyframes insert { 0% { transform: translateX(-210px); opacity: 0; } 10% { opacity: 1; } 62%, 100% { transform: none; opacity: 1; } }
/* M1-14 — decelerate to the stop line, wait, pedestrian crosses in front; sight line once stopped */
.a-approach { animation: approach 7s cubic-bezier(0.25, 0.7, 0.3, 1) 2 both; }
@keyframes approach { 0% { transform: translateX(-170px); opacity: 0; } 8% { opacity: 1; } 38%, 100% { transform: none; opacity: 1; } }
.a-ped { animation: ped 7s ease-in-out 2 both; }
@keyframes ped { 0%, 40% { transform: translateY(-122px); } 100% { transform: none; } }
.a-sightline { animation: sightline 7s linear 2 both; }
@keyframes sightline { 0%, 36% { opacity: 0; } 44%, 100% { opacity: 1; } }
/* fire */
.a-flow { animation: flow 1.6s linear 4; }
@keyframes flow { to { stroke-dashoffset: -48; } }
.a-flicker { transform-box: fill-box; transform-origin: 50% 100%; animation: flicker 1.2s ease-in-out 5; }
@keyframes flicker { 0%, 100% { transform: none; } 30% { transform: scale(0.97, 1.05); } 70% { transform: scale(1.02, 0.95); } }
.a-sweep { transform-box: view-box; transform-origin: 262px 214px; }
.dg[data-step="4"] .a-sweep { animation: sweep 1.6s ease-in-out 4; }
@keyframes sweep { 0%, 100% { transform: none; } 25% { transform: rotate(-3.5deg); } 75% { transform: rotate(3.5deg); } }
.a-windflow path { animation: windflow 1.8s linear 3; }
@keyframes windflow { 0% { transform: translateX(-16px); opacity: 0; } 35% { opacity: 1; } 100% { transform: none; opacity: 1; } }
.a-ring { transform-box: fill-box; transform-origin: center; animation: ringb 1.2s ease-in-out 3; }
@keyframes ringb { 25% { transform: rotate(-6deg); } 75% { transform: rotate(6deg); } }
.a-tick path { animation: blink 2.4s steps(2, jump-none) 2; animation-delay: calc(var(--d, 0) * 0.3s); }
.a-ember { animation: blink 2s ease-in-out 3; }
/* earthquake: shaking restarts with each Drop–Cover–Hold step, then stops */
.a-shake { animation: shake 0.6s ease-in-out 6; }
@keyframes shake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
.a-sway { transform-box: fill-box; transform-origin: 50% 0; animation: sway 1.2s ease-in-out 3; }
@keyframes sway { 0%, 100% { transform: none; } 25% { transform: rotate(-7deg); } 75% { transform: rotate(7deg); } }
.a-seismo { stroke-dasharray: 900; animation: seismo 4s linear 2; }
@keyframes seismo { from { stroke-dashoffset: 900; } to { stroke-dashoffset: 0; } }
/* signals */
.a-orbit { transform-box: view-box; animation: spin 3s linear 3; }
.a-wave path { animation: wave 1.8s ease-out 4; animation-delay: calc(var(--d, 0) * 0.25s); }
.a-wave.fast path { animation-duration: 0.9s; animation-iteration-count: 8; }
@keyframes wave { 0% { opacity: 0; } 30% { opacity: 1; } 100% { opacity: 1; } }
.dg .ghost { opacity: 0.45; }

/* step sequences */
.dg [data-st] { transition: opacity 0.35s var(--ease); }
.dg .st:not(.on) { opacity: 0.28; }
.dg .st-only:not(.on) { opacity: 0; }
.dg .progress-line { transform-box: view-box; transform-origin: 86px 150px; transition: transform 0.6s var(--ease); transform: scaleX(0); }
.dg[data-step="2"] .progress-line { transform: scaleX(0.333); }
.dg[data-step="3"] .progress-line { transform: scaleX(0.666); }
.dg[data-step="4"] .progress-line { transform: scaleX(1); }

/* M1-11 stability: load slides (cause) → stack tips about the pallet edge (effect); COG + plumb stay vertical */
.dg .stab-stack, .dg .stab-load, .dg .stab-cog { transform-box: view-box; }
.dg .stab-stack { transform-origin: 350px 330px; transition: transform 0.45s var(--ease); }
.dg .stab-load, .dg .stab-cog { transition: transform 0.55s var(--ease); }
.dg[data-state="off"] .stab-load { transform: translateX(96px); }
.dg[data-state="off"] .stab-cog { transform: translate(110px, -1px); }
.dg[data-state="off"] .stab-stack { transform: rotate(10deg); transition: transform 0.6s cubic-bezier(0.5, 0, 0.75, 0) 0.55s; }
.dg .plumb-ok, .dg .plumb-off { transition: opacity 0.3s; }
.dg .plumb-off, .dg[data-state="off"] .plumb-ok { opacity: 0; }
.dg[data-state="off"] .plumb-off { opacity: 1; transition-delay: 0.5s; }
.dg[data-state="off"] .stab-base { fill: var(--red); }
.dg .stab-verdict .v-bad, .dg[data-state="off"] .stab-verdict .v-ok { display: none; }
.dg[data-state="off"] .stab-verdict .v-bad { display: inline; }
/* M1-13 lift height */
.dg .stk-carriage { transition: transform 1s var(--spring); }
.dg[data-state="high"] .stk-carriage { transform: translateY(-138px); }
.dg .lift-ok, .dg .lift-bad { transition: opacity 0.4s; }
.dg .lift-bad, .dg[data-state="high"] .lift-ok { opacity: 0; }
.dg[data-state="high"] .lift-bad { opacity: 1; }
.lab-status { flex-basis: 100%; font-weight: 650; font-size: 0.95rem; line-height: 1.45; padding: 10px 14px; border-radius: 14px; background: rgba(229, 245, 236, 0.92); color: #0d5c38; }
.lab-status[data-s="off"], .lab-status[data-s="high"] { background: rgba(255, 236, 232, 0.95); color: #8e1f1f; }

/* stage motion control, pausing (offscreen, hidden tab) and the still frame */
.motion-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px 0 10px; margin-left: auto; border-radius: 999px; border: 1px solid rgba(15, 42, 47, 0.12); background: rgba(255, 255, 255, 0.85); font-weight: 650; font-size: 0.875rem; color: var(--ink-2); }
.motion-btn svg { width: 20px; height: 20px; fill: currentColor; }
.motion-btn .i-replay, .motion-btn[data-mode="replay"] .i-stop { display: none; }
.motion-btn[data-mode="replay"] .i-replay { display: inline; }
/* the owner itself is included: #stage carries its own slide-entrance animation (in-next / in-module) */
#stage[data-anim="still"], #stage[data-anim="still"] *, #stage[data-anim="still"] *::before, #stage[data-anim="still"] *::after { animation: none !important; transition: none !important; }
[data-offscreen="true"], [data-offscreen="true"] *, [data-offscreen="true"] *::before, [data-offscreen="true"] *::after,
html[data-hidden="true"] *, html[data-hidden="true"] *::before, html[data-hidden="true"] *::after { animation-play-state: paused !important; }
/* transitions cannot pause: a state change while offscreen (e.g. a mouse rule preview as the page scrolls) applies instantly */
[data-offscreen="true"], [data-offscreen="true"] *, [data-offscreen="true"] *::before, [data-offscreen="true"] *::after { transition: none !important; }

/* recomposed narrow stage */
.panels { display: grid; grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr)); gap: 8px; }
.panel-fig { margin: 0; grid-column: span var(--span, 1); border-radius: 16px; background: rgba(255, 255, 255, 0.55); padding: 4px; min-width: 0; }
.panel-fig > svg.dg { display: block; width: 100%; height: auto; }
.panel-cap { font-size: 0.8125rem; line-height: 1.35; color: var(--ink-2); padding: 4px 6px 6px; text-align: center; }
.dg text.lbl-off { display: none; }
.lg-x { display: block; flex-basis: 100%; margin-left: 30px; font-size: 0.8125rem; color: var(--muted); }
.legend li { flex-wrap: wrap; }
.legend li > .lg-t { flex: 1 1 0; min-width: 0; }
.moved-labels { margin-top: 8px; font-size: 0.8125rem; color: var(--muted); line-height: 1.4; }
.quiz-card.q-enter-prev { animation: in-prev 0.45s var(--ease) both; }

/* dock: progress hairline + tappable screen counter (opens contents) */
.dock { overflow: hidden; }
.dock-progress { position: absolute; left: 22px; right: 22px; top: 0; height: 3px; border-radius: 3px; background: rgba(15, 42, 47, 0.08); overflow: hidden; }
.dock-progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--teal), var(--mint)); transform-origin: left; transform: scaleX(0); transition: transform 0.6s var(--ease); }
.dock-count { min-height: 44px; min-width: 44px; padding: 0 12px; border-radius: 999px; border: 0; background: transparent; font: 650 0.875rem/1 var(--font-d); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.dock-count:hover { background: rgba(255, 255, 255, 0.85); }
body[data-view="course"] .view { padding-bottom: calc(var(--dock-h, 70px) + 40px + env(safe-area-inset-bottom)); }
body[data-view="course"] { scroll-padding-bottom: calc(var(--dock-h, 70px) + 28px); }
html { scroll-padding-bottom: calc(var(--dock-h, 70px) + 28px); }
.sources a, .src-local { min-height: 44px; align-items: center; }
.rule-n { position: relative; }
.rule-n::after { content: ""; position: absolute; inset: -7px; border-radius: 50%; }
.conduct-index a { min-height: 44px; display: flex; align-items: center; }
h1, h2, .rules p, .coc li, .opt-t, legend { hyphens: auto; -webkit-hyphens: auto; }

@media (max-width: 900px) {
  .dot { width: 44px; height: 44px; }
  .dot[aria-current="true"] { width: 52px; }
  .rule-n { width: 44px; height: 44px; }
  .rules > li { grid-template-columns: 44px minmax(0, 1fr); }
  .rules > li p { padding-top: 10px; }
}
@media (max-width: 640px) {
  .topbar { position: relative; flex-wrap: nowrap; padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
  #contents-open { display: none; }
  .topbar { gap: 6px; }
  #motion-toggle { margin-left: 0; }
  html { scroll-padding-top: 12px; }
  main { padding-left: max(14px, env(safe-area-inset-left)); padding-right: max(14px, env(safe-area-inset-right)); }
  .sub-dots { display: none; }
  .slide-head { margin-bottom: 12px; }
  .slide-head h1 { overflow-wrap: anywhere; }
  .stage { padding: 8px; }
  .rule-n { width: 44px; height: 44px; font-size: 0.9375rem; }
  .rule-n::after { display: none; }
  .rules > li { grid-template-columns: 44px minmax(0, 1fr); align-items: start; }
  .rules > li p { padding-top: 10px; }
  .dock { width: calc(100% - 16px - env(safe-area-inset-left) - env(safe-area-inset-right)); padding: 10px 8px 8px; bottom: max(8px, env(safe-area-inset-bottom)); }
  .dock .btn { min-height: 52px; }
  .dock .btn-ghost { min-width: 52px; padding: 0 14px; }
  .dock #next { flex: 1 1 auto; max-width: 62%; }
  .dock-count .dc-long { display: none; }

  .stepper .step-btn { min-width: 52px; justify-content: center; }
  .seg-btn { min-height: 48px; }
  .motion-btn { margin-left: 0; }
  .sheet { max-width: 100%; margin: auto auto 0; max-height: 88vh; border-radius: 26px 26px 0 0; }
  .sheet-inner { max-height: 88vh; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); border-radius: 26px 26px 0 0; }
  .toc-mod ol { grid-template-columns: minmax(0, 1fr); }
  .notice { margin-top: 24px; }
}
@media (max-width: 360px) {
  .brand img { height: 34px; }
  .display { font-size: 2.5rem; }
  .facts li { padding: 8px 10px; }
  .eb-chip { margin-left: 0; }
  .module-strip { grid-template-columns: minmax(0, 1fr); }
}
@media (max-height: 480px) and (orientation: landscape) {
  .topbar { position: relative; }
  .dock { width: min(560px, calc(100% - 24px)); padding-top: 6px; }
  .dock .btn { min-height: 44px; }
}

/* reduced motion (system or manual toggle): complete static frames */
html[data-rm="true"] .stab-stack, html[data-rm="true"] .stab-load, html[data-rm="true"] .stab-cog, html[data-rm="true"] .stk-carriage { transition: none !important; }

.sign-card figcaption, .hand-card figcaption, .family-card figcaption, .equip-card figcaption, .decision figcaption, .legacy-grid figcaption, .toc-btn, .rail-t, .cert dd { overflow-wrap: anywhere; hyphens: auto; }

/* welcome: first-viewport start action where the form is stacked below the hero (≤900px) */
.welcome-cta { display: none; }
@media (max-width: 900px) {
  .welcome-cta { display: inline-flex; margin-top: 18px; min-height: 52px; padding: 0 24px; }
  .welcome-cta svg { width: 20px; height: 20px; }
  #start-form { scroll-margin-top: 16px; }
}
@media (max-width: 640px) {
  .welcome-cta { width: 100%; }
  .hero-logo { margin: 2px 0 18px; }
}
@media (min-width: 641px) and (max-width: 900px) {
  #start-form { scroll-margin-top: 92px; }  /* the top bar is sticky here */
}


/* ════════════════════ iteration 3 · true vertical course (html[data-layout="vertical"]) ════════════════════
   Decided once by app.js (and the inline head script): vertical unless the course container is wider
   than 900px AND the device has no touch / coarse pointer. Desktop composition is untouched. */
.toc-inline, .nav-slot { display: none; }
.sources > summary { list-style: none; cursor: pointer; font: 800 0.75rem/1.2 var(--font); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; min-height: 28px; display: flex; align-items: center; gap: 6px; }
.sources > summary::-webkit-details-marker { display: none; }
.src-count { letter-spacing: 0; }
.cap-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; text-align: left; }
.cap-list li { display: flex; gap: 8px; align-items: baseline; }
.cap-n { flex: 0 0 auto; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px; display: inline-grid; place-items: center; background: #fff; border: 2px solid var(--teal-d); font: 800 0.8125rem/1 var(--font-d); }
.cap-t { font-size: 0.875rem; line-height: 1.4; color: var(--ink-2); }
.art-caps { padding: 8px 4px 0; }

html[data-layout="vertical"] body { min-height: 0; }
html[data-layout="vertical"] { scroll-padding: 12px 0 12px; }
html[data-layout="vertical"] .topbar { position: relative; }
html[data-layout="vertical"] #contents-open { display: none; }
html[data-layout="vertical"] .ambient .amb { animation: none; }
html[data-layout="vertical"] main { padding-left: max(14px, env(safe-area-inset-left)); padding-right: max(14px, env(safe-area-inset-right)); }
html[data-layout="vertical"] body[data-view="course"] .view { padding-bottom: 32px; }
html[data-layout="vertical"] .deck { display: block; max-width: 46rem; margin: 0 auto; }
html[data-layout="vertical"] .rail { display: none; }
html[data-layout="vertical"] .slide-body, html[data-layout="vertical"] .slide-body[data-layout="gallery"] { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
html[data-layout="vertical"] .slide-body[data-layout="gallery"] .rules, html[data-layout="vertical"] .legend { grid-template-columns: minmax(0, 1fr); }
html[data-layout="vertical"] .sub-dots { display: none; }
html[data-layout="vertical"] .slide-head h1 { overflow-wrap: anywhere; }
html[data-layout="vertical"] .stage { padding: 10px; border-radius: var(--r-l); }
html[data-layout="vertical"] .lesson { padding: 16px; border-radius: var(--r-l); }
html[data-layout="vertical"] .rules > li { grid-template-columns: 44px minmax(0, 1fr); }
html[data-layout="vertical"] .rule-n { width: 44px; height: 44px; }
html[data-layout="vertical"] .rules > li p { padding-top: 8px; font-size: max(1.125rem, 18px); line-height: 1.6; }
html[data-layout="vertical"] .panels { grid-template-columns: minmax(0, 1fr); }
html[data-layout="vertical"] .panel-fig { grid-column: auto; }
html[data-layout="vertical"] .stage-art .dg, html[data-layout="vertical"] .panel-fig > svg.dg { width: 100%; height: auto; }
/* sources: collapsible, in flow */
html[data-layout="vertical"] .sources > summary { min-height: 44px; font-size: 0.875rem; padding: 0 4px; border-radius: 12px; }
html[data-layout="vertical"] .sources > summary::after { content: "▾"; margin-left: auto; font-size: 1rem; transition: transform 0.2s; }
html[data-layout="vertical"] .sources[open] > summary::after { transform: rotate(180deg); }
/* navigation: in flow after the sources, never fixed */
html[data-layout="vertical"] .nav-slot { display: block; margin-top: 16px; }
html[data-layout="vertical"] .dock { position: static; transform: none; left: auto; bottom: auto; width: auto; max-width: none; margin: 0; padding: 12px; border-radius: var(--r-l); display: flex; flex-wrap: wrap; gap: 10px; overflow: visible; }
html[data-layout="vertical"] .dock-progress { position: static; flex: 1 0 100%; order: -1; }
html[data-layout="vertical"] .dock-count { display: none; }
html[data-layout="vertical"] .dock .btn { min-height: 54px; flex: 1 0 100%; min-width: 0; width: 100%; }
html[data-layout="vertical"] .dock .btn-ghost span { display: inline; }
html[data-layout="vertical"] .dock #next { max-width: none; order: 1; }
html[data-layout="vertical"] .dock #prev { order: 2; background: #fff; }
/* contents: in-flow accordion, one full-width row per lesson */
html[data-layout="vertical"] .toc-inline { display: block; margin-top: 12px; padding: 4px 12px 12px; border-radius: var(--r-l); background: var(--glass-strong); border: 1px solid rgba(255, 255, 255, 0.85); box-shadow: var(--shadow); }
html[data-layout="vertical"] .toc-inline > summary { list-style: none; cursor: pointer; min-height: 52px; display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1rem; padding: 0 4px; }
html[data-layout="vertical"] .toc-inline > summary::-webkit-details-marker { display: none; }
html[data-layout="vertical"] .toc-inline > summary::after { content: "▾"; margin-left: auto; transition: transform 0.2s; }
html[data-layout="vertical"] .toc-inline[open] > summary::after { transform: rotate(180deg); }
.toc-inline-pos { font-weight: 600; color: var(--muted); font-size: 0.875rem; }
html[data-layout="vertical"] .toc-inline .toc-mod { margin-top: 12px; }
html[data-layout="vertical"] .toc-inline .toc-mod h3 { font-size: 1rem; overflow-wrap: anywhere; }
html[data-layout="vertical"] .toc-inline .toc-meta { font-size: 0.875rem; color: var(--muted); margin: 2px 0 6px; }
html[data-layout="vertical"] .toc-rows { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }
html[data-layout="vertical"] .toc-rows .toc-btn { width: 100%; min-height: 48px; font-size: 0.9375rem; white-space: normal; overflow-wrap: anywhere; }
html[data-layout="vertical"] .toc-rows .toc-t { min-width: 0; overflow-wrap: anywhere; }
/* in-flow page furniture */
html[data-layout="vertical"] .conduct { grid-template-columns: minmax(0, 1fr); }
html[data-layout="vertical"] .conduct-index { position: static; }
html[data-layout="vertical"] .form-card { position: static; }
html[data-layout="vertical"] .welcome { grid-template-columns: minmax(0, 1fr); }
/* readable floors: captions and supporting text ≥ 14px */
html[data-layout="vertical"] :is(#view-course, .dock, #toc-inline) :is(small, .eb-chip, .seg-btn, .step-btn em, .motion-btn, .src-id, .panel-cap, .correction-k, .toc-n, .slot, figcaption, figcaption span, figcaption strong, .legacy-tag, .legacy-note, .swatches figure, .sig-panel h3 small, .moved-labels, .cap-t, .stmts, .chips li, .combo p, .clp-label header, .signal small, .lab-status, .step-live) { font-size: max(0.875rem, 14px); }
html[data-layout="vertical"] .cap-n { font-size: max(0.875rem, 14px); }
html[data-layout="vertical"] :is(.sources a, .src-local) { font-size: max(0.9375rem, 15px); }
/* galleries: one column, visual beside its words */
html[data-layout="vertical"] :is(.equip-grid, .sign-grid, .family-grid, .signals, .hand-grid, .legacy-grid, .decisions, .clp-row, .decide) { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
html[data-layout="vertical"] .sign-card { grid-template-columns: 76px minmax(0, 1fr); justify-items: start; align-items: center; text-align: left; padding: 10px 12px; }
html[data-layout="vertical"] .sign-card .sign-wrap { width: 72px; height: 72px; }
html[data-layout="vertical"] .equip-card { display: grid; grid-template-columns: minmax(120px, 42%) minmax(0, 1fr); align-items: center; gap: 10px; }
html[data-layout="vertical"] .equip-card figcaption { text-align: left; }
html[data-layout="vertical"] .hand-card { display: grid; grid-template-columns: 76px minmax(0, 1fr); align-items: center; gap: 10px; text-align: left; }
html[data-layout="vertical"] .hand-card .sig { width: 72px; }
html[data-layout="vertical"] .legacy-grid figure { display: grid; grid-template-columns: 56px minmax(0, 1fr); align-items: center; gap: 10px; text-align: left; }
html[data-layout="vertical"] .legacy-grid .sign { width: 52px; }
html[data-layout="vertical"] .decision { grid-template-columns: minmax(110px, 40%) minmax(0, 1fr); align-items: center; }
html[data-layout="vertical"] .sig-panel.wide { grid-column: auto; }
html[data-layout="vertical"] .clp-body { grid-template-columns: minmax(0, 1fr); }
html[data-layout="vertical"] .clp-picts { grid-auto-flow: column; justify-content: start; }
html[data-layout="vertical"] .combo { flex-direction: column; align-items: flex-start; }
html[data-layout="vertical"] .combo .dg.mini { width: 100%; max-width: 320px; }
html[data-layout="vertical"] .swatches { grid-template-columns: minmax(0, 1fr); }
html[data-layout="vertical"] .seg { width: 100%; }
html[data-layout="vertical"] .seg-btn { flex: 1 1 auto; min-height: 48px; }
/* motion on touch/vertical: transform & opacity only */
html[data-layout="vertical"] *, html[data-layout="vertical"] *::before, html[data-layout="vertical"] *::after { transition-property: transform, opacity !important; }
html[data-layout="vertical"] .a-reveal { animation-name: rise; }
html[data-layout="vertical"] :is(.a-glow, .a-flow, .a-seismo) { animation: none !important; }
html[data-layout="vertical"] .dm-ring, html[data-layout="vertical"] .dm-check { animation: none; }
html[data-layout="vertical"] .done-mark svg { animation: pop 0.6s var(--spring) both 0.1s; }
html[data-layout="vertical"] .slide.enter-next :is(.slide-head, .stage, .lesson), html[data-layout="vertical"] .slide.enter-prev :is(.slide-head, .stage, .lesson) { animation-name: view-in; }
html[data-layout="vertical"] .quiz-card.q-enter, html[data-layout="vertical"] .quiz-card.q-enter-prev { animation-name: view-in; }

/* fallbacks before / without the script decision: coarse pointers and narrow slide containers stack */
@media (any-pointer: coarse) {
  html:not([data-layout]) .slide-body, html:not([data-layout]) .deck { grid-template-columns: minmax(0, 1fr); }
  html:not([data-layout]) .dock { position: static; transform: none; width: auto; }
}
@container slide (max-width: 760px) {
  .slide-body { grid-template-columns: minmax(0, 1fr); }
  .panels { grid-template-columns: minmax(0, 1fr); }
  .panel-fig { grid-column: auto; }
}
html[data-layout="vertical"] .stepper .step-btn em { display: inline; }
html[data-layout="vertical"] .stepper .step-btn { padding: 0 14px 0 6px; }
html[data-layout="vertical"][data-fit="compensated"] { font-size: calc(100% * var(--fit-k, 1)); }
html[data-layout="vertical"] .sig-panel { padding: 12px; }
html[data-layout="vertical"] .module-strip { grid-template-columns: repeat(auto-fill, minmax(min(100%, 9rem), 1fr)); }
.module-strip strong, .module-strip small, .facts span, .facts strong { overflow-wrap: anywhere; hyphens: auto; }
html[data-layout="vertical"] .q-dot { width: 44px; height: 44px; }
html[data-layout="vertical"] .welcome-cta { display: inline-flex; margin-top: 18px; min-height: 52px; padding: 0 24px; }
html[data-layout="vertical"] #start-form { scroll-margin-top: 16px; }

/* touch-mode target sizing — independent of CSS width and of the layout decision */
html[data-input="touch"] :is(.dot, .rule-n, .q-dot) { min-width: 44px; min-height: 44px; }
html[data-input="touch"] .dot { width: 44px; height: 44px; }
html[data-input="touch"] .rule-n { width: 44px; height: 44px; }
html[data-input="touch"] .q-dot { width: 44px; height: 44px; }
html[data-input="touch"] :is(.seg-btn, .step-btn, .play-btn, .motion-btn, .toc-btn, .btn-link, .icon-btn, .dock-count, .sources a, .src-local, .conduct-index a) { min-height: 44px; min-width: 44px; }
@media (any-pointer: coarse) {
  :is(.dot, .rule-n, .q-dot) { min-width: 44px; min-height: 44px; }
  :is(.seg-btn, .step-btn, .play-btn, .motion-btn, .toc-btn, .btn-link, .icon-btn, .dock-count, .sources a, .src-local, .conduct-index a) { min-height: 44px; min-width: 44px; }
}

/* ════════════════════ iteration 4 · centred welcome hero, start dialog, ΕΛ | EN ════════════════════ */
.welcome.hero-centred { display: block; max-width: 58rem; margin: 0 auto; text-align: center; }
.hero-centred .welcome-copy { display: flex; flex-direction: column; align-items: center; }
.hero-centred .hero-logo { width: min(440px, 82%); margin: 8px auto 26px; }
.hero-centred .eyebrow { justify-content: center; text-align: center; }
.hero-centred .display { text-align: center; margin-left: auto; margin-right: auto; }
.hero-centred .lead { text-align: center; margin-left: auto; margin-right: auto; max-width: 32ch; }
.start-cta { min-height: 60px; width: min(22rem, 100%); padding: 0 32px; margin-top: 28px; font-size: 1.125rem; border-radius: 999px; }
.start-cta svg { width: 22px; height: 22px; }
.hero-centred .resume { text-align: center; margin-top: 14px; }
.hero-centred .hero-art { width: 100%; max-width: 46rem; margin: 30px auto 0; }
.hero-centred .module-strip { width: 100%; text-align: left; }
body[data-view="welcome"] .brand { display: none; }
body[data-view="welcome"] .topbar-actions { margin-left: auto; }

.lang-switch { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 999px; background: rgba(255, 255, 255, 0.82); border: 1px solid rgba(15, 42, 47, 0.12); }
.lang-switch button { min-width: 48px; min-height: 48px; padding: 0 12px; border: 0; border-radius: 999px; background: transparent; font: 750 1rem/1 var(--font-d); letter-spacing: 0.04em; color: var(--ink-2); }
.lang-switch button[aria-pressed="true"] { background: var(--teal-dd); color: #fff; }
.lang-switch button:not([aria-pressed="true"]):hover { background: #fff; }

.start-dialog { border: 0; padding: 0; background: transparent; color: var(--ink); width: min(34rem, calc(100vw - 24px - env(safe-area-inset-left) - env(safe-area-inset-right))); max-width: none; max-height: calc(var(--vvh, 100dvh) - 48px); overflow: visible; }
.start-dialog[open] { display: flex; flex-direction: column; }
.start-dialog::backdrop { background: rgba(15, 42, 47, 0.34); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.sd-form { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; width: 100%; background: rgba(255, 255, 255, 0.97); border: 1px solid rgba(255, 255, 255, 0.9); border-radius: 26px; box-shadow: var(--shadow); overflow: hidden; }
.sd-head { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 14px 6px 22px; }
.sd-head h2 { font-size: 1.375rem; }
.sd-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 22px 10px; text-align: left; }
.sd-body .field:first-of-type { margin-top: 12px; }
.sd-body .req { color: var(--red); font-weight: 800; }
.sd-foot { flex: 0 0 auto; padding: 12px 22px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--hair); background: rgba(255, 255, 255, 0.98); }
.sd-foot .btn { min-height: 52px; }
/* touch / vertical: anchor to the top of the visual viewport and keep clear of external bottom overlays */
html[data-layout="vertical"] .start-dialog, html[data-input="touch"] .start-dialog {
  --sd-reserve: 76px;
  margin: 0 auto; inset: auto 0 auto 0;
  top: calc(var(--vvt, 0px) + max(12px, env(safe-area-inset-top)));
  max-height: calc(var(--vvh, 100dvh) - max(12px, env(safe-area-inset-top)) - var(--sd-reserve));
}
html[data-layout="vertical"] .start-dialog[data-kb="true"], html[data-input="touch"] .start-dialog[data-kb="true"] { --sd-reserve: 8px; }
@media (max-width: 640px) {
  .start-cta { width: 100%; }
  .sd-head { padding: 12px 10px 4px 18px; }
  .sd-body { padding: 0 18px 8px; }
  .sd-foot { padding: 10px 18px calc(12px + env(safe-area-inset-bottom)); }
  .hero-centred .hero-logo { margin: 0 auto 18px; }
}
@media (max-width: 360px) {
  .hero-centred .hero-logo { width: 78%; margin-bottom: 14px; }
  .hero-centred .display { font-size: 2.4rem; }
  .start-cta { margin-top: 20px; }
}
.sd-head { flex-wrap: wrap; }
.sd-head h2 { flex: 1 1 auto; min-width: 0; }
.sd-lang { flex: 0 0 auto; }

/* ════════════════════ G3 · compact mobile sketch footprint (owner, physical Android 2026-10-28) ════════════════════
   Every vertical lesson keeps M0-0's compact landscape card: the full composition at card width, no stacked poster.
   Labels that would render below 14px become one compact, wrapping caption line under the card. */
.stage-caps { padding: 8px 4px 0; }
html[data-layout="vertical"] .stage-caps .cap-list { display: flex; flex-wrap: wrap; gap: 4px 14px; }
html[data-layout="vertical"] .stage-caps .cap-list li { display: inline-flex; gap: 6px; align-items: baseline; min-width: 0; }
html[data-layout="vertical"] .stage-caps .cap-t { line-height: 1.3; overflow-wrap: anywhere; }
html[data-layout="vertical"] .stage-caps .cap-n { min-width: 22px; height: 22px; padding: 0 5px; }
html[data-layout="vertical"] #stage-art [data-off] { display: none !important; }
html[data-layout="vertical"] .stage-extra { margin-top: 8px; }
html[data-layout="vertical"] .stage-extra .swatches { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
html[data-layout="vertical"] .stage-pager { display: inline-flex; align-items: center; gap: 6px; }
html[data-layout="vertical"] .stage-pager button { width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(15, 42, 47, 0.14); background: rgba(255, 255, 255, 0.9); color: var(--teal-dd); font: 800 1.375rem/1 var(--font-d); display: grid; place-items: center; }
html[data-layout="vertical"] .stage-pager .pg-pos { min-width: 3.2em; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink-2); }
/* compact card grids (several cards per page, each page ≤ the M0-0 card) */
html[data-layout="vertical"] .equip-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
html[data-layout="vertical"] .equip-card { display: block; padding: 6px; }
html[data-layout="vertical"] .equip-card figcaption { text-align: center; }
html[data-layout="vertical"] .equip-card figcaption :is(strong, span) { display: block; overflow-wrap: anywhere; hyphens: auto; }
html[data-layout="vertical"] :is(.sign-grid, .hand-grid, .legacy-grid) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
html[data-layout="vertical"] .family-grid { gap: 6px; }
html[data-layout="vertical"] .sign-card { grid-template-columns: 48px minmax(0, 1fr); gap: 8px; padding: 6px 8px; }
html[data-layout="vertical"] .sign-card .sign-wrap { width: 48px; height: 48px; }
html[data-layout="vertical"] .sign-card :is(figcaption, strong, span, small) { overflow-wrap: anywhere; hyphens: auto; }
html[data-layout="vertical"] .hand-card { grid-template-columns: 52px minmax(0, 1fr); gap: 6px; padding: 6px; }
html[data-layout="vertical"] .hand-card .sig { width: 52px; }
html[data-layout="vertical"] .legacy-grid figure { grid-template-columns: 40px minmax(0, 1fr); gap: 6px; }
html[data-layout="vertical"] .legacy-grid .sign { width: 38px; }
html[data-layout="vertical"] .sig-panel { padding: 8px 10px; }
html[data-layout="vertical"] .sig-panel > svg.dg { max-height: 104px; }
html[data-layout="vertical"] .combo .dg.mini { max-width: 220px; }
/* steppers: one row of numbered step buttons + play + motion; the step name is spoken by the live line and the art caption */
html[data-layout="vertical"] .stage-controls:has(.stepper) { gap: 8px; }
html[data-layout="vertical"] .stage-controls:has(.stepper) .stepper { order: 0; flex-wrap: nowrap; gap: 6px; }
html[data-layout="vertical"] .stage-controls:has(.stepper) .motion-btn { order: 1; margin-left: 0; padding: 0; width: 44px; justify-content: center; }
html[data-layout="vertical"] .stage-controls:has(.stepper) .step-live { order: 2; margin-top: 0; font-size: max(0.875rem, 14px); line-height: 1.35; }
html[data-layout="vertical"] .stepper .step-btn { padding: 0; min-width: 44px; justify-content: center; }
/* landscape phones: the compact card never exceeds ~⅔ of the screen height (letterboxed, labels re-captioned by fitArt) */
html[data-layout="vertical"] #stage-art > svg.dg { max-height: 62vh; }
@media (max-width: 359px) {
  html[data-layout="vertical"] :is(.sign-grid, .hand-grid) { grid-template-columns: minmax(0, 1fr); }
}
