/* Plant Classification — layout and look (the Virtual Microscope design language, docs/Design_Guideline.md).
   Principles (Apple HIG / WWDC fluid-interface talks, translated for the web):
   one floating glass command bar; one lab "stage" where the microscope and the eyepiece share a backdrop;
   neutral segmented controls with a sliding thumb (accent colour is kept for actions and state);
   feedback on press; size-specific type tracking; everything fits its column (no bleeding rims);
   reduced-motion, reduced-transparency and more-contrast variants. */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #0b0e14;
  --surface: #121722; --surface2: #191f2d; --surface3: #222a3c;
  --border: rgba(255,255,255,.08); --border2: rgba(255,255,255,.14);
  --accent: #4ade80; --accent-hi: #86efac; --accent-lo: rgba(74,222,128,.18); --on-accent: #052e16;
  --teal: #2dd4bf;
  --green: #3ddc84; --red: #ff5f57; --gold: #f5c842;
  --text: #e8ecf4; --text-2: #a9b2c6; --text-dim: #707b93;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --r-card: 20px; --r-ctl: 11px;
  --ease: cubic-bezier(.32, .72, 0, 1);          /* iOS sheet curve: fast start, long soft settle */
  --lift: inset 0 1px 0 rgba(255,255,255,.05), 0 1px 2px rgba(0,0,0,.3);
}
html { -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--text); font-family: var(--font); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
#app { max-width: 1320px; margin: 0 auto; padding: 64px 24px 40px; overflow-x: clip; }
button, select, input, textarea { font-family: inherit; }
:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 2px; }

/* ── Header ─────────────────────────────────────────── */
/* Title left, subtitle right, centred on each other: the header spans the full width
   instead of a tall block of title over a short paragraph. A short title gives the
   subtitle the room it leaves (fit-content). The title wraps 'pretty', not 'balance':
   balance shortens the lines but not the column, leaving a dead gap. Stacks below 1100 px. */
.vm-header {
  display: grid; grid-template-columns: fit-content(56%) minmax(0, 1fr); align-items: center;
  gap: 18px 56px; margin: 10px 0 22px;
}
.vm-header h1 {
  font-size: clamp(1.9rem, 2.9vw, 2.55rem); font-weight: 800; line-height: 1.06; letter-spacing: -0.03em; text-wrap: pretty;
  background: linear-gradient(92deg, #eaf6ff 0%, var(--accent-hi) 48%, var(--teal) 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.vm-header .subtitle {
  color: var(--text-2); margin: 0; padding-left: 20px; border-left: 2px solid var(--accent-lo);
  font-size: 1rem; line-height: 1.5; letter-spacing: -0.005em; text-wrap: pretty;   /* no lone last word */
}
@media (max-width: 1099px) {
  .vm-header { grid-template-columns: 1fr; gap: 10px; }
  .vm-header .subtitle { max-width: 78ch; }
}

/* ── Buttons ────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--border2); background: var(--surface3); color: var(--text);
  font: 600 .86rem/1.2 var(--font); letter-spacing: -0.005em; padding: 8px 14px; border-radius: var(--r-ctl);
  cursor: pointer; min-height: 38px; box-shadow: var(--lift);
  transition: background .2s, border-color .2s, transform .12s var(--ease), box-shadow .2s;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.btn:hover { background: #2a3348; border-color: rgba(255,255,255,.2); }
.btn:active { transform: scale(.96); transition-duration: .06s; }
.btn-primary { background: var(--accent); color: var(--on-accent); border-color: transparent; box-shadow: 0 1px 0 rgba(255,255,255,.25) inset, 0 6px 18px rgba(74,222,128,.28); }
.btn-primary:hover { background: var(--accent-hi); border-color: transparent; }
.btn-ghost { background: transparent; box-shadow: none; border-color: var(--border2); }
.btn-ghost:hover { background: rgba(255,255,255,.06); }
.btn-accent { background: linear-gradient(135deg, rgba(74,222,128,.28), rgba(45,212,191,.2)); border-color: rgba(74,222,128,.5); }
.btn-danger { border-color: rgba(255,95,87,.6); color: #ffb4ae; }
.btn-oil { border-color: rgba(231,184,74,.6); color: #ffe2a0; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

/* ── Segmented controls (pill-tabs) ─────────────────── */
.pill-tabs {
  position: relative; display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px;
  background: rgba(118,118,128,.20); border-radius: 12px; isolation: isolate;
}
.pill {
  position: relative; z-index: 1; border: 0; background: transparent; color: var(--text-2);
  font: 600 .85rem/1 var(--font); letter-spacing: -0.005em; padding: 0 14px; min-height: 32px; border-radius: 9px;
  cursor: pointer; white-space: nowrap; transition: color .25s var(--ease), transform .12s var(--ease);
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.pill:hover { color: var(--text); }
.pill:active { transform: scale(.95); }
.pill.active { color: #fff; background: #3c4458; box-shadow: 0 1px 3px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.08); }
.pill:disabled { opacity: .35; cursor: not-allowed; }
/* with the shared sliding thumb (ui.js) the active segment is drawn by the thumb */
.pill-tabs.has-thumb .pill.active { background: transparent; box-shadow: none; }
.seg-thumb {
  position: absolute; left: 0; top: 0; z-index: 0; border-radius: 9px; pointer-events: none;
  background: #3c4458; box-shadow: 0 1px 3px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.09);
  transition: transform .42s var(--ease), width .42s var(--ease), height .42s var(--ease), background .3s, opacity .2s;
}
/* the mode switch is the page's primary choice: its thumb carries the accent */
#mode-tabs .seg-thumb { background: var(--accent); box-shadow: 0 2px 10px rgba(74,222,128,.35), inset 0 1px 0 rgba(255,255,255,.3); }
#mode-tabs .pill.active { color: var(--on-accent); }
#mode-tabs .pill { padding: 0 16px; min-height: 34px; font-size: .88rem; }

/* ── Command bar: floating glass ─────────────────────── */
.vm-command-probe { height: 1px; margin-top: -1px; }
.vm-command {
  position: sticky; top: 10px; z-index: 50; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
  padding: 8px; margin: 0 0 16px; border-radius: 18px;
  background: rgba(22,27,39,.74); -webkit-backdrop-filter: blur(18px) saturate(160%); backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid rgba(255,255,255,.09); box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
  transition: box-shadow .3s var(--ease), background .3s;
}
.vm-command.stuck { background: rgba(18,23,34,.8); box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 14px 40px rgba(0,0,0,.45); }
/* while the bar floats, it is the page's chrome: the site logo steps aside instead of sitting on top of it */
body:has(.vm-command.stuck) .logo-fixed { opacity: 0; pointer-events: none; transition: opacity .25s; }
.vm-command-lab { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; flex: 1 1 auto; justify-content: flex-end; min-width: 0; }
body:not(.vm-lab-on) .vm-slide-field, body:not(.vm-lab-on) .vm-view-strip, body:not(.vm-lab-on) .btn-look { display: none; }
.vm-field { position: relative; display: flex; align-items: center; min-width: 0; }
.vm-field-label { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font: 700 .66rem var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--text-dim); pointer-events: none; }
.vm-slide-field select {
  -webkit-appearance: none; appearance: none; background: rgba(118,118,128,.2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23a9b2c6' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center;
  color: var(--text); border: 0; border-radius: 12px; padding: 0 34px 0 56px; min-height: 38px; min-width: 250px;
  font: 600 .88rem var(--font); letter-spacing: -0.005em; cursor: pointer;
}
.vm-slide-field select:hover { background-color: rgba(118,118,128,.28); }
.btn-look { border-radius: 12px; }

/* legacy hooks still referenced by markup elsewhere */
.ctrl-group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ctrl-label { font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-dim); }

/* ── The lab stage: microscope | eyepiece on one backdrop ─────────── */
.vm-lab {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0; align-items: stretch;
  border-radius: 26px; overflow: hidden; border: 1px solid var(--border);
  background: radial-gradient(90% 120% at 30% 0%, #1a2032 0%, #0e121b 60%, #0a0d14 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 30px 80px -30px rgba(0,0,0,.7);
}
.vm-scope { position: relative; min-height: 600px; border-right: 1px solid var(--border); }
#cell2d { display: block; width: 100%; height: 100%; min-height: 600px; touch-action: none; }
.vm3d-stage { position: absolute; inset: 0; }
.vm3d-stage canvas { display: block; width: 100%; height: 100%; touch-action: none; outline: none; }
.vm3d-msg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 10px; flex-direction: column; color: var(--text-2); text-align: center; padding: 20px; }
.vm3d-note { position: absolute; left: 12px; right: 12px; top: 12px; display: flex; gap: 10px; align-items: flex-start; background: rgba(18,23,34,.82); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border: 1px solid var(--border2); border-radius: 14px; padding: 10px 12px; font-size: .84rem; line-height: 1.45; z-index: 5; }
.vm3d-note-acts { display: flex; align-items: center; gap: 6px; margin-left: auto; flex-shrink: 0; }
.vm3d-note-x { background: none; border: 0; color: var(--text); font-size: 1.2rem; cursor: pointer; }
.vm3d-note-2d { min-height: 32px; padding: 0 12px; font-size: .8rem; }
/* glass chips floating on the stage */
.vm-scope-opts { position: absolute; left: 14px; bottom: 14px; display: flex; gap: 4px 14px; flex-wrap: wrap; z-index: 4; padding: 7px 12px; border-radius: 14px;
  background: rgba(18,23,34,.6); -webkit-backdrop-filter: blur(16px) saturate(160%); backdrop-filter: blur(16px) saturate(160%); border: 1px solid rgba(255,255,255,.08); }
.vm-3d-label { position: absolute; left: 0; top: 0; will-change: transform; transform: translate(-50%, -100%); pointer-events: none; background: rgba(18,23,34,.92); border: 1px solid rgba(74,222,128,.45); color: var(--text); font: 600 11px var(--font); padding: 3px 8px; border-radius: 7px; white-space: nowrap; }
.vm-3d-tip { position: absolute; pointer-events: none; max-width: 260px; background: rgba(18,23,34,.9); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border: 1px solid var(--border2); border-radius: 12px; padding: 9px 11px; font-size: .8rem; line-height: 1.45; z-index: 6; box-shadow: 0 12px 30px rgba(0,0,0,.45); }
.vm-3d-tip strong { display: block; color: var(--accent-hi); margin-bottom: 2px; }
.vm-3d-cam { position: absolute; right: 12px; top: 12px; display: flex; gap: 2px; z-index: 4; padding: 3px; border-radius: 12px; background: rgba(18,23,34,.6); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border: 1px solid rgba(255,255,255,.08); }
.vm-3d-cam button { background: transparent; border: 0; color: var(--text-2); border-radius: 9px; padding: 6px 10px; font: 600 .76rem var(--font); cursor: pointer; transition: background .2s, color .2s; }
.vm-3d-cam button:hover { background: rgba(255,255,255,.08); color: var(--text); }

/* slide preparation (Stage panel): a reagent is part of the slide, so it lives next to the stage controls */
.vm-prep { display: flex; flex-direction: column; gap: 8px; padding-top: 10px; border-top: 1px solid var(--border); }
.vm-prep-row { align-items: flex-start; padding: 8px 10px; border-radius: 12px; background: rgba(255,255,255,.03); border: 1px solid var(--border); transition: background .2s, border-color .2s; }
.vm-prep-row input { margin-top: 1px; flex-shrink: 0; }
.vm-prep-row span { display: flex; flex-direction: column; gap: 2px; color: var(--text); font-weight: 600; }
.vm-prep-row small, .vm-prep-note { font-weight: 400; font-size: .74rem; line-height: 1.4; color: var(--text-dim); }
.vm-prep-row.on { background: rgba(74,222,128,.08); border-color: rgba(74,222,128,.35); }
.vm-prep-note { display: block; margin-top: 6px; }
#medium-pills { width: 100%; }
#medium-pills .pill { flex: 1; }
/* switches (every .vm-check is an on/off setting) */
.vm-check { display: inline-flex; align-items: center; gap: 9px; font-size: .84rem; color: var(--text-2); cursor: pointer; user-select: none; min-height: 30px; }
.vm-check input {
  -webkit-appearance: none; appearance: none; flex-shrink: 0; position: relative; width: 34px; height: 20px; border-radius: 999px; cursor: pointer;
  background: rgba(118,118,128,.32); transition: background .25s var(--ease); margin: 0;
}
.vm-check input::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.35); transition: transform .3s var(--ease); }
.vm-check input:checked { background: var(--green); }
.vm-check input:checked::after { transform: translateX(14px); }
.vm-check:hover { color: var(--text); }

/* eyepiece column */
.vm-eye { display: flex; flex-direction: column; align-items: center; gap: 14px; min-width: 0; padding: 26px 22px 20px; }
.vm-eye > * { width: 100%; }
.vm-eye-wrap {
  position: relative; width: min(100%, 540px) !important; aspect-ratio: 1 / 1; margin: 6px auto 0; border-radius: 50%; background: #000;
  /* the rim sits INSIDE the column padding, never past it */
  box-shadow: 0 0 0 1px rgba(255,255,255,.06), 0 0 0 9px #06080c, 0 0 0 10px rgba(255,255,255,.09), 0 28px 70px rgba(0,0,0,.65);
}
#obs-canvas { display: block; width: 100%; height: 100%; border-radius: 50%; touch-action: none; cursor: grab; }
#obs-canvas:active { cursor: grabbing; }
.vm-eye-hud { position: absolute; left: 50%; top: 5%; transform: translateX(-50%); display: flex; gap: 6px; pointer-events: none; }
.vm-eye-hud span { background: rgba(10,12,18,.62); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); color: #eaf6ff; font: 700 .74rem var(--mono); letter-spacing: .01em; padding: 4px 10px; border-radius: 999px; border: 1px solid rgba(255,255,255,.12); }
.vm-eye-hud span:empty { display: none; }
.vm-eye-tip { position: absolute; z-index: 6; background: rgba(18,23,34,.9); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border: 1px solid var(--border2); border-radius: 13px; padding: 9px 12px; font-size: .8rem; line-height: 1.45; box-shadow: 0 14px 34px rgba(0,0,0,.5); pointer-events: none; }
.vm-eye-tip strong { display: block; color: var(--accent-hi); margin-bottom: 3px; font-size: .86rem; }
.vm-eye-tip em { display: block; color: var(--gold); margin-top: 4px; font-style: normal; font-size: .76rem; }

/* coach: a glass banner that rises from the bottom of the field */
.vm-coach {
  position: absolute; left: 50%; bottom: 4%; width: min(80%, 420px); z-index: 7; display: flex; align-items: flex-start; gap: 9px;
  padding: 9px 10px 9px 13px; border-radius: 15px; font-size: .8rem; line-height: 1.42; color: var(--text);
  background: rgba(18,23,34,.84); -webkit-backdrop-filter: blur(20px) saturate(170%); backdrop-filter: blur(20px) saturate(170%);
  border: 1px solid rgba(255,255,255,.12); box-shadow: 0 16px 40px rgba(0,0,0,.55);
  opacity: 0; transform: translate(-50%, 14px) scale(.97); pointer-events: none;
  transition: opacity .3s var(--ease), transform .45s var(--ease);
}
.vm-coach.show { opacity: 1; transform: translate(-50%, 0) scale(1); pointer-events: auto; }
.vm-coach::before { content: ''; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.vm-coach.warn::before { background: var(--gold); } .vm-coach.bad::before { background: var(--red); } .vm-coach.ok::before { background: var(--green); }
.vm-coach-ico { font-size: 1rem; line-height: 1.35; }
.vm-coach-msg { flex: 1; }
.vm-coach-act { background: var(--accent); color: var(--on-accent); border: 0; border-radius: 9px; padding: 6px 11px; font: 700 .78rem var(--font); cursor: pointer; white-space: nowrap; align-self: center; transition: transform .12s var(--ease); }
.vm-coach-act:active { transform: scale(.95); }
.vm-coach-x { background: rgba(255,255,255,.08); border: 0; color: var(--text-2); width: 22px; height: 22px; border-radius: 50%; font-size: .95rem; line-height: 1; cursor: pointer; flex-shrink: 0; }

/* eyepiece tools: one floating toolbar */
.vm-tools {
  display: flex; flex-wrap: nowrap; gap: 2px; padding: 4px; width: auto !important; max-width: 100%;
  border-radius: 16px; background: rgba(118,118,128,.16); border: 1px solid rgba(255,255,255,.06);
  overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain;   /* one row, swipe if it does not fit */
}
.vm-tools::-webkit-scrollbar { display: none; }
.vm-tool { flex-shrink: 0; }
.vm-tool {
  display: inline-flex; align-items: center; gap: 5px; background: transparent; border: 0; color: var(--text-2);
  border-radius: 12px; padding: 0 11px; min-height: 36px; font: 600 .8rem var(--font); letter-spacing: -0.005em; cursor: pointer; white-space: nowrap;
  transition: background .2s, color .2s, transform .12s var(--ease); -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.vm-tool:hover { background: rgba(255,255,255,.07); color: var(--text); }
.vm-tool:active { transform: scale(.94); }
.vm-tool.active { background: var(--accent); color: var(--on-accent); box-shadow: 0 2px 10px rgba(74,222,128,.3); }
.vm-tool-auto { color: #8ee8dc; }
.vm-chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.vm-chip { background: rgba(118,118,128,.2); border: 1px solid transparent; color: var(--text); border-radius: 999px; padding: 6px 12px; font: 600 .8rem var(--font); cursor: pointer; transition: background .2s, border-color .2s; }
.vm-chip b { color: var(--gold); margin-left: 4px; font-family: var(--mono); }
.vm-chip.active { border-color: var(--accent); background: var(--accent-lo); }
.vm-chip-clear { color: #ffa29b; }

/* immersive "look through the eyepiece" */
.vm-lab.immersive { position: fixed; inset: 0; z-index: 900; border-radius: 0; border: 0; background: radial-gradient(circle at 50% 50%, #0b0d12 0%, #000 70%); grid-template-columns: 1fr; padding: 14px; overflow: auto; animation: vm-iris-in .5s var(--ease); }
.vm-lab.immersive .vm-scope { display: none; }
.vm-lab.immersive .vm-eye-wrap { width: min(90vmin, 900px) !important; }
.vm-lab.immersive .vm-eye { justify-content: center; min-height: 100%; }
body:has(.vm-lab.immersive) .btn-look { position: fixed; top: 14px; right: 14px; z-index: 901; }
body:has(.vm-lab.immersive) .vm-command { z-index: 950; }
@keyframes vm-iris-in { from { opacity: 0; transform: scale(1.04); } to { opacity: 1; transform: none; } }

/* ── Under the stage: reagents, readings, controls ──── */
.vm-reagents { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; align-items: center; justify-content: center; }
.vm-oil-done { font: 600 .82rem var(--font); color: #ffe2a0; padding: 7px 12px; border: 1px dashed rgba(231,184,74,.7); border-radius: 11px; }

/* live readings: tucked behind the Status button in the eyepiece's top-right corner (outside the circular view) */
.vm-status-btn {
  position: absolute; top: 0; right: 0; z-index: 7; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px;
  border-radius: 999px; border: 1px solid rgba(255,255,255,.12); background: rgba(18,23,34,.62); color: var(--text);
  -webkit-backdrop-filter: blur(16px) saturate(160%); backdrop-filter: blur(16px) saturate(160%);
  font: 600 .78rem var(--font); cursor: pointer; transition: background .2s, border-color .2s, transform .12s var(--ease);
}
.vm-status-btn svg { width: 15px; height: 15px; }
.vm-status-btn:hover { background: rgba(30,36,52,.78); }
.vm-status-btn:active { transform: scale(.96); }
.vm-status-btn[aria-expanded="true"] { background: rgba(74,222,128,.22); border-color: rgba(74,222,128,.5); }
.vm-status-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.vm-status-alert { display: none; position: absolute; top: -2px; right: -2px; width: 10px; height: 10px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px #0b0e15; }
.vm-status-btn.alert .vm-status-alert { display: block; animation: vm-pulse 1.4s ease-in-out infinite; }
.vm-status-btn.alert { border-color: rgba(255,95,87,.6); }
@keyframes vm-pulse { 50% { transform: scale(1.35); opacity: .7; } }
.vm-status {
  position: absolute; top: 42px; right: 0; z-index: 7; width: min(360px, 100%); padding: 12px; border-radius: 20px;
  background: rgba(14,18,27,.78); border: 1px solid rgba(255,255,255,.1); box-shadow: 0 20px 50px rgba(0,0,0,.55);
  -webkit-backdrop-filter: blur(22px) saturate(170%); backdrop-filter: blur(22px) saturate(170%);
  transform-origin: top right; transition: opacity .18s ease, transform .28s cubic-bezier(.2,.9,.3,1);
}
.vm-status[hidden] { display: block; visibility: hidden; opacity: 0; transform: scale(.92) translateY(-6px); pointer-events: none; transition: opacity .15s ease, transform .2s ease, visibility 0s .2s; }
.vm-status-head { display: flex; align-items: center; justify-content: space-between; margin: 0 2px 10px 4px; }
.vm-status-x { width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(255,255,255,.08); color: var(--text-2); font-size: 1.05rem; line-height: 1; cursor: pointer; }
.vm-status-x:hover { background: rgba(255,255,255,.14); color: var(--text); }
.readout-badges { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.vm-status .readout-badge { background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.08); padding: 10px 12px; }
.readout-badge {
  display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03); transition: border-color .3s, background .3s; min-width: 0;
}
.rb-label { display: flex; align-items: center; gap: 7px; font: 600 .72rem var(--font); color: var(--text-dim); letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.readout-badge strong { font: 700 1.05rem/1.1 var(--mono); color: var(--text); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.readout-badge.danger { border-color: rgba(255,95,87,.6); background: rgba(255,95,87,.07); }
.readout-badge.danger strong { color: var(--red); }
.rb-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }

.vm-dock { display: grid; grid-template-columns: 1.15fr 1.25fr 1.4fr 1.3fr; gap: 10px; }
.vm-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; box-shadow: inset 0 1px 0 rgba(255,255,255,.03); }
.vm-panel-title { font: 700 .68rem var(--font); letter-spacing: .09em; text-transform: uppercase; color: var(--text-dim); }
.vm-panel .pill-tabs { align-self: flex-start; }
.vm-obj .pill { padding: 0 11px; }
.vm-obj .pill::after { content: ''; position: absolute; left: 30%; right: 30%; bottom: 3px; height: 2px; border-radius: 2px; opacity: .9; }
.vm-obj .obj-4::after { background: #ff5f57; } .vm-obj .obj-10::after { background: #ffd23f; } .vm-obj .obj-40::after { background: #4a9dff; } .vm-obj .obj-100::after { background: #f2f2f2; }

.vm-focus-row { display: flex; gap: 10px; align-items: stretch; }
.vm-focus-btns { display: flex; flex-direction: column; gap: 5px; align-items: center; }
.vm-mini { font: 700 .64rem var(--font); letter-spacing: .06em; text-transform: uppercase; color: var(--text-dim); }
.vm-fbtn { width: 46px; height: 38px; border-radius: 11px; border: 1px solid var(--border2); background: var(--surface3); color: var(--text); font-size: .9rem; cursor: pointer; box-shadow: var(--lift);
  transition: background .15s, transform .1s var(--ease); -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.vm-fbtn:hover { background: #2a3348; }
.vm-fbtn:active { background: var(--accent); color: var(--on-accent); transform: scale(.94); }
.vm-fbtn.fine { width: 40px; font-size: .72rem; }
.vm-gauge-wrap { flex: 1; min-width: 60px; }
#focus-gauge { width: 100%; height: 100px; display: block; border-radius: 12px; border: 1px solid var(--border); }
.vm-focus-z { font: 600 .74rem var(--mono); color: var(--text-dim); font-variant-numeric: tabular-nums; }
.vm-focus-z.sharp { color: var(--green); }

.slider-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 10px; width: 100%; }
.sim-slider-label { font-size: .82rem; color: var(--text-2); }
.slider-row > .sim-slider, .slider-row > .vm-iris-track { grid-column: 1 / -1; grid-row: 2; }
.sim-slider-val { grid-column: 2; grid-row: 1; font: 700 .8rem var(--mono); color: var(--accent-hi); text-align: right; font-variant-numeric: tabular-nums; }
.sim-slider { width: 100%; -webkit-appearance: none; appearance: none; height: 28px; background: transparent; outline: none; cursor: pointer; }
.sim-slider::-webkit-slider-runnable-track { height: 6px; border-radius: 999px; background: linear-gradient(to right, var(--accent) 0%, rgba(74,222,128,.45) 50%, rgba(118,118,128,.35) 100%); }
.sim-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; margin-top: -9px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.4), 0 0 0 .5px rgba(0,0,0,.1); transition: transform .15s var(--ease); }
.sim-slider:active::-webkit-slider-thumb { transform: scale(1.12); }
.sim-slider::-moz-range-track { height: 6px; border-radius: 999px; background: rgba(118,118,128,.35); }
.sim-slider::-moz-range-progress { height: 6px; border-radius: 999px; background: var(--accent); }
.sim-slider::-moz-range-thumb { width: 22px; height: 22px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.4); }
.vm-iris-track { position: relative; display: flex; }
.vm-iris-marker { position: absolute; top: 4px; width: 2px; height: 20px; margin-left: -1px; background: var(--gold); border-radius: 2px; box-shadow: 0 0 6px rgba(245,200,66,.6); pointer-events: none; }

.vm-stage-row { display: flex; gap: 16px; align-items: center; }
.vm-pad { display: grid; grid-template-columns: repeat(3, 36px); grid-template-rows: repeat(3, 34px); gap: 4px; flex-shrink: 0; }
.vm-pad button { border: 1px solid var(--border2); background: var(--surface3); color: var(--text); border-radius: 10px; cursor: pointer; font-size: .74rem; box-shadow: var(--lift);
  transition: background .15s, transform .1s var(--ease); -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.vm-pad button:hover { background: #2a3348; }
.vm-pad button:active { background: var(--accent); color: var(--on-accent); transform: scale(.92); }
.vm-pad [data-dir="u"] { grid-column: 2; grid-row: 1; } .vm-pad [data-dir="l"] { grid-column: 1; grid-row: 2; } .vm-pad [data-dir="r"] { grid-column: 3; grid-row: 2; } .vm-pad [data-dir="d"] { grid-column: 2; grid-row: 3; }
.vm-switches { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

/* auto-focus */
.vm-af-btn { margin-top: 2px; width: 100%; background: linear-gradient(135deg, rgba(74,222,128,.26), rgba(45,212,191,.18)); border-color: rgba(74,222,128,.45); }
.vm-af-btn.running { background: rgba(245,200,66,.14); border-color: var(--gold); color: #ffe7a6; animation: vm-af-pulse 1.4s ease-in-out infinite; }
@keyframes vm-af-pulse { 50% { box-shadow: 0 0 0 5px rgba(245,200,66,.14); } }

/* ── Cards: live optics, notebook, library ──────────── */
.vm-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: 12px; margin-top: 12px; }
.vm-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); padding: 18px 20px; min-width: 0; box-shadow: inset 0 1px 0 rgba(255,255,255,.03); }
.vm-card-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.vm-card-title { font-size: 1.08rem; font-weight: 700; letter-spacing: -0.015em; }
.vm-card > .vm-card-title { margin-bottom: 10px; }
.vm-card-head .vm-card-title { margin: 0; }
.vm-card-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.vm-card-actions .btn { padding: 6px 11px; min-height: 32px; font-size: .78rem; }
.lp-eq-body .lp-eq { padding: 8px 0; border-bottom: 1px solid var(--border); overflow-x: auto; overflow-y: hidden; font-size: .95rem; scrollbar-width: none; }
.lp-eq-body .lp-eq:last-child { border-bottom: 0; }
.vm-nb-empty { color: var(--text-dim); font-size: .86rem; line-height: 1.5; }
.vm-nb-scroll { overflow-x: auto; }
.vm-nb { width: 100%; border-collapse: collapse; font-size: .8rem; margin-top: 6px; }
.vm-nb th, .vm-nb td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--border); }
.vm-nb th { color: var(--text-dim); font-weight: 700; font-size: .68rem; text-transform: uppercase; letter-spacing: .07em; }
.vm-nb .mono { font-family: var(--mono); color: var(--gold); }

.vm-library { margin-top: 12px; }
/* share bar (shared/share-bar.js) placed inside the lab flow: same rhythm and shape as the cards around it */
.share-bar.vm-share { margin: 12px 0 0; border-radius: var(--r-card); }
/* the chooser's copy only while choosing; once an experiment runs, the lab's own copy takes over */
#exp-chooser[hidden] ~ .vm-share-chooser { display: none; }
/* the library is a shelf you swipe through, not a wall */
.vm-shelf { position: relative; }
.vm-shelf-track.explore-cards {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(270px, calc((100% - 36px) / 4)); grid-template-columns: none;
  gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 2px; padding: 2px 2px 8px; scrollbar-width: none; overscroll-behavior-x: contain;
}
.vm-shelf-track::-webkit-scrollbar { display: none; }
.vm-shelf-track .ex-card { scroll-snap-align: start; background: var(--surface2); }
.vm-shelf-btn {
  position: absolute; top: 50%; z-index: 2; width: 38px; height: 38px; margin-top: -24px; border-radius: 50%; border: 1px solid var(--border2);
  background: rgba(34,42,60,.85); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); color: var(--text); font-size: 1.4rem; line-height: 1; cursor: pointer;
  box-shadow: 0 8px 20px rgba(0,0,0,.45); transition: opacity .25s, transform .15s var(--ease);
}
.vm-shelf-btn:active { transform: scale(.92); }
.vm-shelf-btn.prev { left: -12px; } .vm-shelf-btn.next { right: -12px; }
.vm-shelf-btn:disabled { opacity: 0; pointer-events: none; }
.vm-shelf-static .vm-shelf-btn { display: none; }

/* ── Modals: dimmed backdrop, sheet materialises ─────── */
.vm-modal { position: fixed; inset: 0; z-index: 1100; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(4,6,10,.6); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); animation: vm-fade .25s ease; }
.vm-modal-box { width: min(520px, 100%); background: rgba(26,32,46,.94); -webkit-backdrop-filter: blur(30px); backdrop-filter: blur(30px); border: 1px solid rgba(255,255,255,.12); border-radius: 24px; padding: 24px 24px 20px; box-shadow: 0 40px 100px rgba(0,0,0,.65); animation: vm-sheet .45s var(--ease); }
@keyframes vm-fade { from { opacity: 0; } }
@keyframes vm-sheet { from { opacity: 0; transform: translateY(16px) scale(.97); } }
.vm-modal-icon { font-size: 1.7rem; margin-bottom: 8px; }
.vm-modal-box h2 { font-size: 1.3rem; letter-spacing: -0.02em; margin-bottom: 10px; color: #eaf6ff; }
.vm-modal-box p { font-size: .9rem; line-height: 1.55; color: #c3cadb; margin-bottom: 10px; }
.vm-modal-note { border-left: 3px solid var(--gold); padding: 9px 12px; background: rgba(245,200,66,.07); border-radius: 0 10px 10px 0; color: #ead9a8 !important; }
.vm-modal-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 16px; }

/* ── Experiment mode ────────────────────────────────── */
.exp-banner { display: flex; gap: 16px; align-items: flex-start; padding: 20px 22px; margin-bottom: 16px; border-radius: var(--r-card);
  background: linear-gradient(135deg, rgba(245,200,66,.10), rgba(74,222,128,.10) 60%, rgba(45,212,191,.06)); border: 1px solid rgba(245,200,66,.32); }
.exp-banner-icon { font-size: 2rem; line-height: 1; }
.exp-banner h2 { font-size: 1.2rem; letter-spacing: -0.015em; color: #fff1c9; margin-bottom: 6px; }
.exp-banner p { font-size: .9rem; line-height: 1.55; color: #c9cfdc; max-width: 80ch; }
.exp-banner p + p { margin-top: 6px; }
.exp-banner-note { color: var(--text-2) !important; font-size: .84rem !important; }
.exp-link { background: none; border: 0; padding: 0; color: var(--accent-hi); font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.exp-run { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 10px 12px 10px 16px; margin-bottom: 14px; border-radius: 16px; background: var(--surface); border: 1px solid rgba(245,200,66,.38); }
.exp-run-title { display: flex; align-items: center; gap: 8px; font-size: 1rem; letter-spacing: -0.01em; }
.exp-run-badge { font: 800 .62rem var(--font); letter-spacing: .09em; text-transform: uppercase; background: var(--gold); color: #2a2000; padding: 3px 8px; border-radius: 6px; }
.exp-run-meta { display: flex; gap: 14px; font-size: .84rem; color: var(--text-2); }
.exp-run-meta .mono { font-family: var(--mono); font-weight: 700; color: var(--gold); font-variant-numeric: tabular-nums; }
.exp-run-actions { margin-left: auto; display: flex; gap: 6px; }
.exp-run-actions .btn { min-height: 32px; padding: 5px 12px; font-size: .8rem; }
.ex-safety { font-size: .8rem !important; color: #ead9a8 !important; background: rgba(245,200,66,.07); border-radius: 10px; padding: 7px 10px; }
.mh-safety { font-size: .8rem; color: #ead9a8; margin: -2px 0 8px; }
.mh-done { margin-top: 10px; padding: 12px 14px; border-radius: 14px; background: rgba(61,220,132,.08); border: 1px solid rgba(61,220,132,.36); font-size: .86rem; line-height: 1.5; }
.mh-done-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.mh-opt:disabled, #mh-check:disabled, #mh-in:disabled { opacity: .7; cursor: default; }
/* aids locked in experiment mode: greyed, still pressable (they explain why) */
.vm-locked { opacity: .4; filter: grayscale(1); }
.vm-locked:hover { opacity: .58; }
.vm-locked.running { animation: none; }

/* mission HUD: a full-width stepper above the lab, so the method and the eyepiece are seen together */
.mission-hud { background: linear-gradient(140deg, rgba(74,222,128,.14), rgba(45,212,191,.06)); border: 1px solid rgba(74,222,128,.38); border-radius: 20px; padding: 16px 18px; margin-bottom: 14px; }
.mission-hud .mh-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.mission-hud .mh-steps li { background: rgba(0,0,0,.18); border: 1px solid var(--border); border-radius: 14px; padding: 10px 12px 10px 42px; }
.mission-hud .mh-steps li::before { left: 12px; top: 10px; }
.mission-hud .mh-steps li.now { border-color: rgba(74,222,128,.6); background: rgba(74,222,128,.1); }
.mission-hud .mh-steps li.done { border-color: rgba(61,220,132,.3); }
.mission-hud .mh-q, .mission-hud .mh-done { max-width: 860px; }
/* once an experiment is running, the slim run bar replaces the explainer banner */
#sec-experiment:has(#exp-run:not([hidden])) .exp-banner { display: none; }
.mission-hud .mh-head strong { display: none; }   /* the run bar already names the experiment */
.mh-head { display: flex; align-items: center; gap: 8px; }
.mh-badge { font: 800 .62rem var(--font); letter-spacing: .09em; text-transform: uppercase; background: var(--accent); color: var(--on-accent); padding: 3px 8px; border-radius: 6px; }
.mh-goal { font-size: .85rem; color: var(--text-2); margin: 8px 0 10px; line-height: 1.5; }
.mh-steps { padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 7px; counter-reset: s; }
.mh-steps li { counter-increment: s; font-size: .85rem; color: var(--text-dim); padding-left: 30px; position: relative; line-height: 1.45; transition: color .3s; }
.mh-steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 21px; height: 21px; border-radius: 50%; border: 1.5px solid #3a4260; font: 700 .7rem var(--font); display: flex; align-items: center; justify-content: center; transition: all .35s var(--ease); }
.mh-steps li.now { color: var(--text); font-weight: 600; }
.mh-steps li.now::before { border-color: var(--accent); color: var(--accent-hi); box-shadow: 0 0 0 4px var(--accent-lo); }
.mh-steps li.done { color: #82d4a4; }
.mh-steps li.done::before { content: '✓'; background: var(--green); border-color: var(--green); color: #082414; }
.mh-q { margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(74,222,128,.25); font-size: .87rem; line-height: 1.5; }
.mh-opts { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.mh-opt { justify-content: flex-start; text-align: left; }
.mh-opt.right, .opt.right { border-color: var(--green); background: rgba(61,220,132,.13); }
.mh-opt.wrong, .opt.wrong { border-color: var(--red); background: rgba(255,95,87,.1); }
.mh-num { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.mh-num input, .pq-input-row input { background: var(--bg); border: 1px solid var(--border2); color: var(--text); border-radius: 11px; padding: 8px 11px; font: 700 .95rem var(--mono); min-height: 40px; }
.mh-num input { width: 130px; }
.mh-num input:focus, .pq-input-row input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 4px var(--accent-lo); }
.mh-fb { margin-top: 10px; font-size: .85rem; line-height: 1.5; padding: 10px 12px; border-radius: 12px; }
.mh-fb.ok { background: rgba(61,220,132,.1); border: 1px solid rgba(61,220,132,.36); }
.mh-fb.no { background: rgba(255,95,87,.08); border: 1px solid rgba(255,95,87,.32); }

/* ── Quiz ───────────────────────────────────────────── */
#sec-quiz { max-width: 980px; margin: 0 auto; }
.quiz-kind { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 6px 0 18px; text-align: center; }
.quiz-kind .pill { font-size: .92rem; padding: 0 18px; min-height: 36px; }
.quiz-kind-note { font-size: .88rem; color: var(--text-2); line-height: 1.5; max-width: 62ch; }
.practice-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.practice-bar .vm-field { gap: 10px; }
.practice-bar .ctrl-label { margin-right: 2px; }
.practice-bar select { -webkit-appearance: none; appearance: none; background: rgba(118,118,128,.2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23a9b2c6' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 11px center; color: var(--text); border: 0; border-radius: 11px; padding: 0 32px 0 12px; font: 600 .86rem var(--font); min-height: 38px; cursor: pointer; }
.pbar-score { margin-left: auto; font: 700 .9rem var(--mono); color: var(--gold); background: rgba(245,200,66,.08); padding: 7px 12px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.practice-question { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); padding: 22px; box-shadow: inset 0 1px 0 rgba(255,255,255,.03); }
.vm-q { display: flex; gap: 22px; align-items: flex-start; }
.vm-q-visual { flex: 0 0 min(320px, 40%); }
.vm-q-visual canvas { width: 100%; aspect-ratio: 1; display: block; border-radius: 50%; background: #000; box-shadow: 0 0 0 6px #06080c, 0 0 0 7px rgba(255,255,255,.08); }
.vm-q-visual #pq-scope, .vm-q-visual #qq-scope { border-radius: 16px; aspect-ratio: 520 / 640; box-shadow: none; background: radial-gradient(120% 90% at 50% 10%, #1b2133 0%, #0f131c 70%); }
.vm-q-body { flex: 1; min-width: 0; }
.pq-text { font-size: 1.06rem; line-height: 1.55; margin-bottom: 14px; letter-spacing: -0.005em; }
.pq-input-row { display: flex; gap: 10px; align-items: center; }
.pq-input-row input { width: 170px; }
.pq-unit { color: var(--text-2); font-weight: 600; }
.pq-mcq, .qq-options { display: flex; flex-direction: column; gap: 8px; }
.opt { justify-content: flex-start; text-align: left; min-height: 44px; padding: 10px 14px; line-height: 1.4; }
.opt.sel { border-color: var(--accent); background: var(--accent-lo); }
.feedback { margin-top: 14px; font-weight: 600; font-size: .92rem; line-height: 1.5; }
.feedback.ok { color: var(--green); } .feedback.no { color: #ff9f98; }
.solution { margin-top: 12px; padding: 12px 14px; background: var(--bg); border: 1px solid var(--border); border-left: 3px solid var(--gold); border-radius: 12px; font-size: .9rem; line-height: 1.55; }
.quiz-result { margin-top: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); padding: 22px; text-align: center; animation: vm-sheet .5s var(--ease); }
.qr-stars { font-size: 2.4rem; color: var(--gold); letter-spacing: 8px; }
.qr-stars span { color: #343b52; }

/* ── Concept & experiment cards ─────────────────────── */
.explore-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.ex-card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 9px; min-width: 0; transition: border-color .25s, transform .3s var(--ease); }
.ex-card:hover { border-color: var(--border2); }
.ex-card h3, .ex-card .ex-title { font-size: 1.02rem; font-weight: 700; letter-spacing: -0.015em; color: #eaf6ff; }
.ex-card p { font-size: .87rem; line-height: 1.55; color: #c3cadb; }
.ex-card .btn { align-self: flex-start; margin-top: auto; }
.ex-formula { font-family: var(--mono); background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 9px 11px; color: var(--gold); font-size: .84rem; line-height: 1.45; overflow-x: auto; }
.ex-note { font-size: .8rem !important; color: #a3b2c9 !important; border-left: 2px solid var(--accent); padding-left: 10px; }
.ex-mission { background: linear-gradient(165deg, rgba(74,222,128,.12), var(--surface) 50%); }
.ex-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.ex-meta span { font: 700 .64rem var(--font); text-transform: uppercase; letter-spacing: .07em; background: rgba(118,118,128,.2); color: var(--text-2); padding: 3px 8px; border-radius: 6px; }
.ex-slide { font-size: .79rem !important; color: var(--text-dim) !important; }
#exp-chooser { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }

/* ── Auto-count panel ───────────────────────────────── */
.vm-ac { background: var(--surface); border: 1px solid rgba(45,212,191,.35); border-radius: 18px; padding: 12px 14px; font-size: .84rem; }
.ac-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; margin-bottom: 6px; }
.ac-head span { font: 600 .74rem var(--mono); color: var(--text-dim); }
.ac-table { width: 100%; border-collapse: collapse; }
.ac-table td { padding: 5px 6px; border-bottom: 1px solid var(--border); }
.ac-table td:nth-child(2), .ac-table td:nth-child(3) { text-align: right; width: 70px; }
.ac-table .mono { font-family: var(--mono); font-weight: 700; color: var(--gold); font-variant-numeric: tabular-nums; }
.ac-table .dim { color: var(--text-dim); }
.ac-total td { font-weight: 700; border-bottom: 0; }
.ac-sw { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: -1px; box-shadow: 0 0 0 2px rgba(255,255,255,.1); }
.ac-derived { margin-top: 8px; padding: 8px 10px; background: rgba(45,212,191,.08); border-radius: 10px; font-family: var(--mono); font-size: .8rem; }
.ac-derived span { font-family: var(--font); font-weight: 700; color: #9de9df; }
.ac-derived strong { color: var(--gold); }
.ac-compare { margin-top: 8px; line-height: 1.45; }
.ac-compare.dim, .vm-ac .dim { color: var(--text-dim); }
.ac-moved { color: var(--gold); margin-bottom: 6px; line-height: 1.4; }
.ac-actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.ac-actions .btn { min-height: 32px; padding: 5px 11px; font-size: .78rem; }

/* ── Report builder ─────────────────────────────────── */
.vm-report-box { width: min(660px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; }
.vm-rp-lede { font-size: .87rem !important; }
.vm-rp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 8px 0 14px; }
.vm-rp-grid label { display: flex; flex-direction: column; gap: 5px; font-size: .76rem; font-weight: 700; color: var(--text-2); }
.vm-rp-grid label.wide { grid-column: 1 / -1; }
.vm-rp-grid input, .vm-rp-grid textarea { background: rgba(0,0,0,.25); border: 1px solid var(--border2); color: var(--text); border-radius: 11px; padding: 9px 11px; font: 400 .9rem var(--font); resize: vertical; transition: border-color .2s, box-shadow .2s; }
.vm-rp-grid input:focus, .vm-rp-grid textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 4px var(--accent-lo); }
.vm-rp-opt { font-weight: 400; color: var(--text-dim); }
.vm-rp-figs { border: 1px solid var(--border2); border-radius: 14px; padding: 10px 12px; margin-bottom: 12px; }
.vm-rp-figs legend { font-size: .76rem; font-weight: 700; color: var(--text-2); padding: 0 4px; }
#rp-figs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; max-height: 190px; overflow-y: auto; }
#rp-figs .dim { color: var(--text-dim); font-size: .82rem; grid-column: 1 / -1; }
.vm-rp-fig { display: flex; align-items: center; gap: 8px; font-size: .76rem; color: #c4cbe0; cursor: pointer; }
.vm-rp-fig img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.vm-rp-fig input { accent-color: var(--accent); }
.vm-rp-checks { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.vm-rp-status { min-height: 1.2em; font-size: .84rem; color: var(--gold); margin-top: 8px; }

/* context menu */
.ctx-menu { position: fixed; z-index: 1000; min-width: 200px; background: rgba(30,36,52,.9); -webkit-backdrop-filter: blur(24px) saturate(170%); backdrop-filter: blur(24px) saturate(170%); border: 1px solid rgba(255,255,255,.12); border-radius: 14px; padding: 5px; box-shadow: 0 18px 50px rgba(0,0,0,.55); animation: vm-sheet .25s var(--ease); transform-origin: top left; }
.ctx-item { display: block; width: 100%; padding: 8px 12px; border: none; border-radius: 9px; background: transparent; color: var(--text); font-size: .85rem; text-align: left; cursor: pointer; }
.ctx-item:hover { background: var(--accent); color: var(--on-accent); }

.vm-sources { font-size: .8rem !important; color: var(--text-dim) !important; }

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 1180px) {
  .vm-dock { grid-template-columns: 1fr 1fr; }
  .vm-shelf-track.explore-cards { grid-auto-columns: minmax(260px, calc((100% - 24px) / 3)); }
}
@media (max-width: 1000px) {
  .vm-command-lab { justify-content: flex-start; }
  .vm-slide-field { flex: 1 1 240px; }
  .vm-slide-field select { width: 100%; min-width: 0; }
}
@media (max-width: 900px) {
  /* Small screens: eyepiece first, then what changes it, then the microscope itself. */
  #sec-simulate { display: flex; flex-direction: column; }
  .vm-lab:not(.immersive) { display: contents; }
  .mission-hud { order: 0; }
  .vm-eye { order: 1; padding: 6px 0 0; }
  .vm-reagents { order: 2; } .vm-dock { order: 4; }
  .vm-scope { order: 5; margin-top: 12px; border: 1px solid var(--border); border-radius: 22px; overflow: hidden; background: radial-gradient(90% 120% at 30% 0%, #1a2032 0%, #0e121b 70%); }
  .vm-two { order: 6; grid-template-columns: 1fr; } .vm-share { order: 7; } .vm-library { order: 8; }
  .vm-scope, #cell2d { min-height: 440px; }
  /* the command bar scrolls away on small screens: room for the specimen matters more */
  .vm-command { position: relative; top: auto; }
  .vm-shelf-track.explore-cards { grid-auto-columns: minmax(250px, 78%); }
  .vm-shelf-btn { display: none; }
}
@media (max-width: 768px) {
  #app { padding: 60px 16px 28px; }
  .vm-header { margin-bottom: 14px; }
  .vm-command { padding: 6px; border-radius: 16px; }
  #mode-tabs { display: flex; width: 100%; }
  #mode-tabs .pill { flex: 1; }
  .vm-command-lab { width: 100%; }
  .btn-look { flex: 1 1 auto; }
  .vm-eye-wrap { width: min(calc(100% - 22px), 540px) !important; }
  /* tools: one row you can swipe, never a ragged second line */
  .vm-tools { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; width: 100% !important; scrollbar-width: none; scroll-snap-type: x proximity; }
  .vm-tools::-webkit-scrollbar { display: none; }
  .vm-tool { flex-shrink: 0; scroll-snap-align: start; }
  /* coach: an iOS-style banner at the bottom of the screen, not a lid over the specimen */
  .vm-coach { position: fixed; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); width: auto; z-index: 800; transform: translateY(24px) scale(.98); }
  .vm-coach.show { transform: none; }
  .vm-q { flex-direction: column; }
  .vm-q-visual { flex-basis: auto; width: min(100%, 320px); margin: 0 auto; }
  .exp-run-actions { margin-left: 0; }
}
@media (max-width: 560px) {
  .vm-dock { grid-template-columns: 1fr; }
  .vm-modal-actions .btn { flex: 1 1 100%; }
  .vm-rp-grid { grid-template-columns: 1fr; }
  .vm-scope, #cell2d { min-height: 400px; }
  .pill { padding: 0 11px; font-size: .82rem; }
  .vm-card { padding: 16px; }
  .exp-banner { flex-direction: column; gap: 8px; padding: 16px; }
  .pbar-score { margin-left: 0; }
}

/* "Hold ⌘ and scroll to focus": shown when a plain scroll passes over a canvas (which then lets the page scroll) */
.vm-wheel-hint {
  position: absolute; left: 50%; bottom: 14%; z-index: 9; max-width: 92%; padding: 7px 13px; border-radius: 999px;
  background: rgba(10,12,18,.8); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border: 1px solid rgba(255,255,255,.14);
  color: #eaf6ff; font: 600 .76rem var(--font); white-space: nowrap; text-align: center; pointer-events: none;
  opacity: 0; transform: translate(-50%, 6px); transition: opacity .2s ease, transform .3s var(--ease);
}
.vm-wheel-hint.show { opacity: 1; transform: translate(-50%, 0); }
.m-fold { display: none; }
.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; }


/* ══════════════════════════════════════════════════════════════════════════════
   LAB-STAGE additions (desktop and tablet; the phone versions are inside the PHONE block below)
   ══════════════════════════════════════════════════════════════════════════════ */
.vm-scope { min-height: 620px; }
#cell-select { padding-left: 52px; min-width: 250px; }
#co2-pills, #lamp-pills { display: flex; width: 100%; }
#co2-pills .pill, #lamp-pills .pill { flex: 1; padding: 0 6px; }
.vm-prep-row.on { background: rgba(74,222,128,.08); border-color: rgba(74,222,128,.38); }
.ol-obs { gap: 12px; padding-top: 18px; }
.ol-obs-tabs { width: auto !important; align-self: center; }
.ol-obs-tabs .pill { min-height: 34px; padding: 0 16px; }
.vm-eye-wrap.ol-obs-wrap { width: min(100%, 560px) !important; border-radius: 26px; margin-top: 0; background: #05070b;
  box-shadow: 0 0 0 1px rgba(255,255,255,.07), 0 28px 70px rgba(0,0,0,.6); }
#obs-canvas { display: block; width: 100%; height: 100%; border-radius: inherit; touch-action: pan-y; cursor: default; }
.ol-obs-hud { top: auto; bottom: 14px; left: 14px; transform: none; }
.ol-obs-hud span { font-family: var(--font); font-weight: 600; font-size: .74rem; }
.vm-status-btn { top: 10px; right: 10px; }
.vm-status { top: 52px; right: 10px; width: min(360px, calc(100% - 20px)); }
/* bench HUD: lab clock + what happens next, glass chips in the corner */
.ol-bench-hud { position: absolute; left: 14px; top: 14px; z-index: 4; display: flex; gap: 6px; align-items: center; pointer-events: none; max-width: calc(100% - 28px); }
.ol-bench-hud span { background: rgba(18,23,34,.6); -webkit-backdrop-filter: blur(16px) saturate(160%); backdrop-filter: blur(16px) saturate(160%); border: 1px solid rgba(255,255,255,.1);
  color: var(--text); font: 600 .76rem var(--font); padding: 5px 11px; border-radius: 999px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ol-bench-hud .ol-hud-clock { font: 700 .8rem var(--mono); color: var(--accent-hi); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.ol-bench-hud span:empty { display: none; }
body.ol-running .ol-hud-clock::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--green); margin-right: 7px; vertical-align: 1px; animation: vm-pulse 1.4s ease-in-out infinite; }
/* clock button in the command bar */
.ol-clock-btn { gap: 8px; min-width: 196px; justify-content: flex-start; }
.ol-clock-btn .ol-clock-time { margin-left: auto; font: 700 .82rem var(--mono); color: var(--accent-hi); font-variant-numeric: tabular-nums; }
.ol-clock-btn.running { background: rgba(74,222,128,.16); border-color: rgba(74,222,128,.5); }
.ol-clock-ico { width: 1em; text-align: center; }
/* sample chips under the observe view */
.ol-samples { min-height: 34px; }
.ol-samples .vm-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; }
.ol-samples .vm-chip i { width: 9px; height: 9px; border-radius: 50%; background: var(--c, #9ab); box-shadow: 0 0 0 2px rgba(255,255,255,.08); }
.ol-samples .vm-chip small { color: var(--text-dim); font: 600 .72rem var(--mono); }
/* contextual workflow actions: a glass toolbar floating at the bottom of the bench */
.vm-scope .ol-actions {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 5; display: flex; flex-wrap: nowrap; gap: 6px;
  padding: 6px; border-radius: 16px; max-width: calc(100% - 28px);
  background: rgba(18,23,34,.62); -webkit-backdrop-filter: blur(16px) saturate(160%); backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid rgba(255,255,255,.1); box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 12px 30px rgba(0,0,0,.4);
}
.vm-scope .ol-actions:empty { display: none; }
.vm-scope .ol-actions .btn { min-height: 38px; padding: 0 14px; font-size: .84rem; white-space: nowrap; border-radius: 11px; }
.vm-scope .ol-actions .btn:not(.btn-primary) { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.12); box-shadow: none; }
.vm-scope .ol-actions .btn:not(.btn-primary):hover { background: rgba(255,255,255,.13); }
/* the view switches move to the top-right corner, clear of the action bar */
.vm-scope .vm-scope-opts { left: auto; right: 14px; top: 14px; bottom: auto; }
/* setup panel */
.ol-sub { display: none; flex-direction: column; gap: 10px; }

/* ── what shows in which mode ── */
body:not(.vm-exp-mode) .am-exp-only { display: none !important; }
body.vm-exp-mode .am-sim-only { display: none !important; }
#cell2d, #lab-bench { display: block; width: 100%; height: 100%; position: absolute; inset: 0; touch-action: pan-y; }
#lab-field { display: block; width: 100%; height: 100%; border-radius: inherit; touch-action: pan-y; cursor: crosshair; }
#lab-field.am-dragging { cursor: grabbing; }
/* the phase chip on the cell card */
.ol-bench-hud .am-phase-chip { font: 700 .82rem var(--font); color: var(--on-accent); background: var(--ph, var(--accent)); border-color: transparent; letter-spacing: -0.01em; }
/* look switch next to Labels */
.vm-scope-opts { display: flex; align-items: center; gap: 8px; }
.am-look .pill { min-height: 30px; padding: 0 12px; font-size: .76rem; }
/* transport: a glass toolbar at the bottom of the cell card */
.am-transport {
  position: absolute; left: 14px; right: 14px; bottom: 14px; z-index: 5; display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 18px;
  background: rgba(18,23,34,.62); -webkit-backdrop-filter: blur(16px) saturate(160%); backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid rgba(255,255,255,.1); box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 12px 30px rgba(0,0,0,.4);
}
body.vm-exp-mode .am-transport { display: none; }
.am-play { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--accent); color: var(--on-accent); font-size: 1rem; cursor: pointer; flex-shrink: 0;
  box-shadow: 0 6px 18px rgba(74,222,128,.3), inset 0 1px 0 rgba(255,255,255,.3); transition: transform .12s var(--ease), background .2s; }
.am-play:active { transform: scale(.93); }
.am-play.running { background: var(--gold); color: #2a2000; box-shadow: 0 6px 18px rgba(245,200,66,.25); }
.am-next { min-height: 38px; padding: 0 12px; flex-shrink: 0; border-radius: 11px; }
.am-strip { flex: 1; min-width: 0; height: 38px; display: flex; gap: 2px; position: relative; border-radius: 10px; overflow: hidden; cursor: pointer; }
.am-strip button { flex: var(--w, 1) 1 0; min-width: 0; border: 0; background: var(--c); opacity: .38; color: #07090e; font: 800 .68rem var(--font); cursor: pointer; padding: 0; transition: opacity .2s; overflow: hidden; white-space: nowrap; }
.am-strip button.on { opacity: 1; }
.am-strip button:hover { opacity: .75; }
.am-strip .am-cursor { position: absolute; top: 0; bottom: 0; width: 3px; margin-left: -1.5px; background: #fff; border-radius: 2px; box-shadow: 0 0 8px rgba(255,255,255,.8); pointer-events: none; }
.am-speed { flex-shrink: 0; }
.am-speed .pill { min-height: 34px; padding: 0 10px; font-size: .74rem; }
/* the slide: tally chip and the stage picker */
.am-tally { position: absolute; left: 12px; top: 12px; z-index: 4; display: grid; grid-template-columns: repeat(5, auto); gap: 2px 10px; padding: 8px 12px; border-radius: 14px;
  background: rgba(18,23,34,.72); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border: 1px solid rgba(255,255,255,.1); font: 600 .72rem var(--font); color: var(--text-2); pointer-events: none; }
.am-tally b { font: 800 .9rem var(--mono); color: var(--text); font-variant-numeric: tabular-nums; }
.am-tally .am-tally-mi { grid-column: 1 / -1; color: var(--gold); font-weight: 700; padding-top: 3px; border-top: 1px solid rgba(255,255,255,.08); margin-top: 3px; }
.am-picker { position: absolute; z-index: 8; display: flex; gap: 4px; padding: 6px; border-radius: 14px; background: rgba(14,18,27,.9); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,.14); box-shadow: 0 16px 40px rgba(0,0,0,.5); animation: am-pop .18s var(--ease); }
@keyframes am-pop { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }
.am-picker button { min-width: 44px; min-height: 40px; border-radius: 10px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.06); color: var(--text); font: 700 .78rem var(--font); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.05; padding: 3px 7px; }
.am-picker button small { font: 600 .6rem var(--font); color: var(--text-dim); }
.am-picker button:hover { background: var(--accent-lo); border-color: rgba(74,222,128,.5); }
.am-picker button kbd { font: 800 .9rem var(--mono); color: var(--c, var(--accent-hi)); }
/* count table in the dock */
.am-count-table { display: grid; grid-template-columns: 1fr auto auto; gap: 4px 12px; font-size: .8rem; color: var(--text-2); }
.am-count-table b { font: 700 .86rem var(--mono); color: var(--text); text-align: right; font-variant-numeric: tabular-nums; }
.am-count-table span.pct { font: 600 .74rem var(--mono); color: var(--text-dim); text-align: right; }
.am-count-table .tot { border-top: 1px solid var(--border2); padding-top: 4px; color: var(--text); font-weight: 700; }
.am-count-table .mi { color: var(--gold); font-weight: 700; }
.am-count-table i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; background: var(--c); }
#type-pills, #n2-pills, #mag-pills, #sample-pills { display: flex; width: 100%; }
#type-pills .pill, #n2-pills .pill, #mag-pills .pill, #sample-pills .pill { flex: 1; padding: 0 6px; }
#sample-pills:empty { display: none; }
.am-checks { flex-direction: column; align-items: stretch; }
.vm-panel .ol-measure-btns { margin-top: 2px; }
#bench-card.am-prep .vm-scope-opts { display: none; }
/* the caption: what is happening now */
.am-caption { position: absolute; left: 14px; bottom: 92px; z-index: 4; max-width: min(70%, 460px); padding: 8px 14px; border-radius: 14px; pointer-events: none;
  background: rgba(18,23,34,.68); -webkit-backdrop-filter: blur(16px) saturate(160%); backdrop-filter: blur(16px) saturate(160%); border: 1px solid rgba(255,255,255,.1);
  border-left: 3px solid var(--ph, var(--accent)); color: var(--text); font: 600 .86rem/1.35 var(--font); letter-spacing: -0.005em; transition: opacity .25s ease; }
.am-caption:empty { display: none; }
.am-caption.pop { animation: am-cap .45s var(--ease); }
@keyframes am-cap { from { opacity: .2; transform: translateY(6px); } to { opacity: 1; transform: none; } }
body.vm-exp-mode .am-caption, #bench-card.am-prep .am-caption { display: none; }
/* 3D labels: projected from the cell's parts each frame */
.am3-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 2; }
.am3-label { position: absolute; left: 0; top: 0; margin: -11px 0 0 10px; padding: 3px 9px; border-radius: 999px; white-space: nowrap;
  background: rgba(8,11,18,.72); border: 1px solid rgba(74,222,128,.35); color: #f1f5fb; font: 600 .72rem var(--font); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.am3-label::before { content: ''; position: absolute; left: -10px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: #f1f5fb; box-shadow: 0 0 6px rgba(255,255,255,.8); }
/* the equation line in the article */
.seo-article .vm-eq-line { font: 600 1rem var(--mono); text-align: center; color: var(--accent-hi); background: rgba(74,222,128,.06); border: 1px solid rgba(74,222,128,.2); border-radius: 14px; padding: 12px 16px; }
.ol-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }

/* time panel */
.ol-clock-row { display: flex; align-items: center; gap: 12px; }
.ol-play { width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--accent); color: var(--on-accent); font-size: 1.15rem; cursor: pointer; flex-shrink: 0;
  box-shadow: 0 6px 18px rgba(74,222,128,.3), inset 0 1px 0 rgba(255,255,255,.3); transition: transform .12s var(--ease), background .2s; }
.ol-play:active { transform: scale(.93); }
.ol-play.running { background: var(--gold); color: #2a2000; box-shadow: 0 6px 18px rgba(245,200,66,.25); }
.ol-clock-read { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ol-clock-read strong { font: 700 1.5rem/1 var(--mono); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.ol-clock-read span { font-size: .76rem; color: var(--text-dim); }
.ol-time .pill-tabs, .ol-setup .pill-tabs { display: flex; width: 100%; align-self: stretch; }
.ol-time .pill-tabs .pill, .ol-setup .pill-tabs .pill { flex: 1; padding: 0 8px; }
.ol-row .pill-tabs { width: auto; }
/* measure panel */
.ol-measure-btns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.ol-measure-btns .btn { min-height: 36px; padding: 6px 10px; font-size: .8rem; justify-content: flex-start; }
.ol-measure-btns .btn:only-child { grid-column: 1 / -1; }
.vm-dock { grid-template-columns: 1.35fr 1.1fr 1.15fr 1.1fr; }
/* concept card picture */
.ex-card .ol-card-viz { width: 100%; height: 120px; border-radius: 12px; background: #06080d; border: 1px solid var(--border); display: block; }
/* quiz pictures are rectangles here */
.ol-q-visual canvas { border-radius: 16px !important; aspect-ratio: 1 !important; box-shadow: 0 0 0 1px rgba(255,255,255,.08) !important; background: #06080d !important; }
.seo-article .vm-fig-narrow { max-width: 560px; margin-left: auto; margin-right: auto; }
.vm-3d-label { border-color: rgba(74,222,128,.45); }
@media (max-width: 1180px) { .vm-dock { grid-template-columns: 1fr 1fr; } }
/* tablets (768–900 px): the lab stacks; the bench comes first (it is where the work happens), then what you observe */
@media (max-width: 900px) {
  .vm-scope { order: 1; margin-top: 0; }
  .vm-scope, #cell2d { min-height: 480px; }
  .vm-eye.ol-obs { order: 3; }
  .vm-dock { order: 4; margin-top: 12px; }
}
/* ══════════════════════════════════════════════════════════════════════════════
   PHONE EXPERIENCE (≤ 767 px). A layout of its own, not the desktop squeezed:
   • one lab screen: the view and its controls are on screen together, so a knob and its result are never a scroll apart
   • the view card swaps Eyepiece ⇄ Microscope; the other view rides along as a tap-to-swap picture-in-picture
   • the control dock becomes a deck pinned to the bottom of the screen, one thumb-sized panel at a time
   • coach messages drop in from the top like a notification
   Everything here is inside this query (plus hooks hidden on wider screens), so desktop and tablet never change.
   ══════════════════════════════════════════════════════════════════════════════ */
.lbl-m { display: none; }
.mh-prog { display: none; }
/* desktop: icon + label render as one text run, exactly as before the phone split */
.vm-tool .t-ico, .vm-tool .t-lbl, .vm-tool .lbl-d { display: contents; }
.vm-lab > .m-viewbar, .vm-dock > .m-deck-tabs, .vm-dock > .m-deck-grab, .vm-dock > .m-deck-actions { display: none; }

@media (max-width: 767px) {
  .lbl-d, .vm-tool .lbl-d { display: none; } .lbl-m { display: inline; }
  /* mitosis: the transport rides in the deck on phones (see app.js), so the cell keeps the whole card */
  .vm-scope .am-transport { display: none; }
  .m-deck-actions .am-transport { width: 100%; display: flex; position: static; padding: 0; background: none; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; gap: 6px; }
  .m-deck-actions .am-speed { display: none; }
  .m-deck-actions .am-play { width: 40px; height: 40px; }
  .am-tally { top: auto; bottom: 10px; grid-template-columns: repeat(5, auto); gap: 0 7px; padding: 6px 9px; font-size: .66rem; }
  .am-picker button { min-width: 48px; min-height: 46px; }
  .vm-scope-opts .am-look { display: none; }
  .am-caption { left: 10px; right: 10px; top: auto; bottom: 58px; max-width: none; font-size: .78rem; padding: 6px 11px; }
  #app { padding: 54px 14px 28px; }
  .vm-header { margin: 4px 0 14px; gap: 8px; }
  .vm-header h1 { font-size: clamp(1.45rem, 6.6vw, 1.8rem); line-height: 1.1; letter-spacing: -0.024em; }
  .vm-header .subtitle { font-size: .875rem; line-height: 1.45; padding-left: 0; border-left: 0; }   /* every pixel of width for text */

  /* command bar: mode | slide | units + 2D/3D, three clean rows */
  .vm-command { padding: 6px; gap: 6px; border-radius: 18px; margin-bottom: 12px; }
  .vm-command-lab { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px; width: 100%; }
  .vm-slide-field { grid-column: 1 / -1; }
  .vm-slide-field select { min-height: 42px; font-size: .92rem; }
  .vm-command-lab .unit-toggle, .vm-command-lab .vm-view-strip { display: flex; width: 100%; }
  .vm-command-lab .unit-toggle .pill, .vm-command-lab .vm-view-strip .pill { flex: 1; min-height: 34px; }
  body:not(.vm-lab-on) .vm-command-lab .unit-toggle { grid-column: 1 / -1; }
  .btn-look { display: none !important; }        /* the view switch below replaces it */
  #mode-tabs .pill { min-height: 38px; font-size: .9rem; }

  /* ── the view card ── */
  #sec-simulate { display: flex; flex-direction: column; }
  .vm-lab:not(.immersive) {
    display: block; position: relative; padding: 8px 8px 10px; border-radius: 26px; order: 1;
  }
  .vm-lab > .m-viewbar { display: flex; padding: 0 0 8px; }
  #m-view-pills { width: 100%; }
  #m-view-pills .pill { flex: 1; min-height: 36px; font-size: .86rem; }
  .vm-eye { padding: 2px 0 0; gap: 10px; }
  .vm-eye-wrap { width: calc(100% - 22px) !important; margin-top: 4px; }
  .vm-eye-hud { top: auto; bottom: 7%; }
  .vm-scope { border: 0; border-radius: 18px; min-height: 0; overflow: hidden; background: radial-gradient(90% 120% at 30% 0%, #1a2032 0%, #0e121b 70%); }
  #cell2d { min-height: 0; }
  .vm-lab.m-bench-main .vm-scope { height: min(118vw, 58vh); }
  .vm-scope-opts { left: 10px; right: 10px; bottom: 10px; justify-content: center; }

  /* picture-in-picture: the view that is not on the main screen */
  .vm-lab .m-pip {
    position: absolute !important; top: 54px; left: 10px; z-index: 8; width: 27% !important; max-width: 140px;
    padding: 0 !important; border-radius: 16px; overflow: hidden; cursor: pointer; background: #07090e;
    border: 1px solid rgba(255,255,255,.2); box-shadow: 0 14px 34px rgba(0,0,0,.6);
    transition: filter .15s ease;
  }
  /* press feedback without a transform: a transformed ancestor would capture the fixed coach banner inside it */
  .vm-lab .m-pip:active:not(:has(.vm-coach:active)) { filter: brightness(.8); }
  .vm-lab .m-pip *:not(.vm-coach):not(.vm-coach *) { pointer-events: none !important; }
  .vm-lab .m-pip .vm-coach.show, .vm-lab .m-pip .vm-coach.show * { pointer-events: auto !important; }
  .vm-lab .m-pip::after {
    content: '⇄'; position: absolute; right: 5px; bottom: 5px; width: 22px; height: 22px; border-radius: 50%; z-index: 9;
    display: flex; align-items: center; justify-content: center; font-size: .72rem; color: #fff;
    background: rgba(18,23,34,.72); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,.18);
  }
  .vm-scope.m-pip { aspect-ratio: 4 / 5; height: auto; }
  .vm-scope.m-pip .vm-scope-opts, .vm-scope.m-pip .vm-3d-cam, .vm-scope.m-pip .vm3d-note, .vm-scope.m-pip .vm-3d-label, .vm-scope.m-pip .vm-3d-tip { display: none !important; }
  .vm-eye.m-pip { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; }
  .vm-eye.m-pip > :not(.vm-eye-wrap) { display: none !important; }
  .vm-eye.m-pip .vm-eye-wrap { width: 88% !important; margin: 0; box-shadow: 0 0 0 3px #06080c, 0 0 0 4px rgba(255,255,255,.1); }
  .vm-eye.m-pip .vm-eye-hud, .vm-eye.m-pip .vm-status-btn, .vm-eye.m-pip .vm-status, .vm-eye.m-pip .vm-eye-tip { display: none !important; }

  /* eyepiece tools: an icon toolbar that fits the width, no sideways scrolling */
  .vm-tools { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); width: 100% !important; overflow: visible; padding: 4px; gap: 2px; border-radius: 18px; }
  .vm-tool { flex-direction: column; justify-content: center; gap: 3px; min-height: 50px; padding: 6px 0 5px; border-radius: 13px; font-size: .62rem; letter-spacing: 0; min-width: 0; }
  .vm-tool .t-ico { display: block; font-size: 1.12rem; line-height: 1; }
  .vm-tool .t-lbl { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }

  /* coach: a notification that drops in from the top, clear of the deck */
  .vm-coach {
    position: fixed; left: 10px; right: 10px; top: max(10px, env(safe-area-inset-top)); bottom: auto; width: auto; z-index: 960;
    transform: translateY(-18px) scale(.98); border-radius: 18px; font-size: .84rem; padding: 11px 11px 11px 14px;
  }
  .vm-coach.show { transform: none; }

  /* experiment method: the current step only, with progress, so the specimen stays the hero */
  .mission-hud { order: 0; padding: 12px 14px; border-radius: 20px; margin-bottom: 10px; }
  .mission-hud .mh-head { display: flex; align-items: center; justify-content: space-between; }
  .mh-prog { display: inline; font: 700 .72rem var(--font); color: var(--accent-hi); letter-spacing: .02em; }
  .mission-hud .mh-goal { font-size: .82rem; margin: 6px 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .mission-hud .mh-safety { display: none; }
  .mission-hud .mh-steps { display: block; margin: 0; }
  .mission-hud .mh-steps li:not(.now) { position: absolute; width: 1px; height: 1px; overflow: hidden; visibility: hidden; padding: 0; border: 0; }   /* hidden but still counted, so the badge shows the real step number */
  .mission-hud .mh-steps li.now { font-size: .88rem; }

  /* ── the control deck ── */
  .vm-reagents { order: 2; margin-top: 10px; }
  .vm-dock {
    order: 3; position: sticky; bottom: 0; z-index: 40; display: flex; flex-direction: column;
    margin: 12px -14px 0; padding: 10px 14px calc(12px + env(safe-area-inset-bottom));
    border-radius: 24px 24px 0 0; border-top: 1px solid rgba(255,255,255,.1);
    background: rgba(14,18,27,.84); -webkit-backdrop-filter: blur(24px) saturate(170%); backdrop-filter: blur(24px) saturate(170%);
    box-shadow: 0 -18px 40px rgba(0,0,0,.45);
  }
  .vm-dock > .m-deck-grab { display: block; align-self: center; width: 64px; height: 18px; margin: -6px 0 4px; border: 0; background: transparent; cursor: pointer; position: relative; }
  .vm-dock > .m-deck-grab::before { content: ''; position: absolute; left: 50%; top: 6px; width: 38px; height: 5px; margin-left: -19px; border-radius: 3px; background: rgba(255,255,255,.28); }
  .vm-dock > .m-deck-tabs { display: flex; width: 100%; margin-bottom: 12px; }
  .vm-dock.m-collapsed > .m-deck-tabs { margin-bottom: 0; }
  .vm-dock.m-collapsed > .vm-panel { display: none !important; }
  .m-deck-tabs .pill { flex: 1; min-height: 34px; font-size: .84rem; }
  #observe-card { view-transition-name: vm-eye; } #bench-card { view-transition-name: vm-scope; }
  .vm3d-note { flex-direction: column; align-items: stretch; font-size: .8rem; }
  .vm3d-note-acts { justify-content: flex-end; }
  .vm-dock > .vm-panel { display: none; background: transparent; border: 0; box-shadow: none; padding: 0 2px; gap: 10px; }
  .vm-dock > .vm-panel.m-on { display: flex; animation: m-panel-in .22s var(--ease); }
  .vm-dock > .vm-panel > .vm-panel-title:first-child { display: none; }
  @keyframes m-panel-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

  /* Lens: four big lens buttons, then the eyepiece */
  .vm-dock .vm-obj, .vm-dock #eye-pills { display: flex; width: 100%; }
  .vm-dock .vm-obj .pill, .vm-dock #eye-pills .pill { flex: 1; min-height: 44px; font-size: .9rem; }
  /* Focus: thumb-sized knobs beside the depth gauge */
  .vm-dock > .vm-panel.vm-focus.m-on { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px 12px; }
  .vm-focus-row { grid-column: 1 / -1; gap: 10px; }
  .vm-focus-btns { gap: 4px; }
  .vm-fbtn, .vm-fbtn.fine { width: 52px; height: 40px; font-size: 1rem; border-radius: 13px; }
  .vm-gauge-wrap { min-height: 96px; }
  .vm-focus-z { font-size: .72rem; }
  .vm-af-btn { width: auto; min-height: 38px; margin: 0; padding: 0 14px; }
  /* Light */
  .vm-dock [data-deck="light"] .slider-row { padding: 4px 0; }
  /* Stage: bigger pad, switches in two columns, "On the slide" below */
  .vm-stage-row { justify-content: space-between; gap: 14px; }
  .vm-pad { grid-template-columns: repeat(3, 46px); grid-template-rows: repeat(3, 42px); }
  .vm-pad button { font-size: .9rem; }
  .vm-switches { display: grid; grid-template-columns: 1fr; gap: 0; }
  .vm-dock > .vm-panel.m-on[data-deck="stage"] { max-height: 42vh; overflow-y: auto; overscroll-behavior: contain; }

  .vm-two { order: 5; grid-template-columns: 1fr; } .vm-share { order: 6; } .vm-library { order: 7; }
  /* Live optics folds on phones: a title row with a chevron; tap to open */
  .vm-live { position: relative; }
  .vm-live .m-fold { display: block; position: absolute; inset: 0 0 auto 0; height: 56px; border: 0; background: transparent; cursor: pointer; border-radius: inherit; }
  .vm-live .m-fold::after { content: ''; position: absolute; right: 20px; top: 22px; width: 9px; height: 9px; border-right: 2px solid var(--text-2); border-bottom: 2px solid var(--text-2); transform: rotate(45deg); transition: transform .25s var(--ease); }
  .vm-live:not(.m-closed) .m-fold::after { transform: translateY(4px) rotate(-135deg); }
  .vm-live.m-closed { padding-bottom: 16px; }
  .vm-live.m-closed > .vm-card-title { margin-bottom: 0; }
  .vm-live.m-closed #lp-eq-body { display: none; }
  /* gestures: one finger scrolls the page over the canvases; the eyepiece Move tool uses two fingers (app.js) */
  #obs-canvas.coop { touch-action: pan-x pan-y; }
  #cell2d { touch-action: pan-y; }
  .vm-wheel-hint { white-space: normal; width: max-content; max-width: 86%; bottom: 18%; }
  /* concept library tabs: one swipeable row, never a ragged second line */
  #explore-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
  #explore-tabs::-webkit-scrollbar { display: none; }
  #explore-tabs .pill { flex-shrink: 0; }

  /* quiz: full-width rows a thumb can hit, score as a badge beside the topic */
  #quiz-kind { display: flex; width: 100%; } #quiz-kind .pill { flex: 1; min-height: 38px; }
  .practice-bar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; align-items: center; }
  .practice-bar .vm-field { grid-column: 1 / 3; }
  .practice-bar .vm-field select { flex: 1; min-width: 0; width: 100%; }
  .practice-bar .pbar-score { grid-column: 3; grid-row: 1; justify-self: end; white-space: nowrap; font-size: .76rem; }
  .vm-q .vm-q-visual { width: min(100%, 250px); }
  .practice-bar .btn { min-height: 42px; padding: 0 8px; font-size: .84rem; }
  .pq-input-row input { flex: 1; min-width: 0; min-height: 44px; font-size: 1rem; }

  /* ── Osmosis Lab on phones ── */
  .vm-lab.m-observe-main .ol-obs-tabs { display: flex; width: 100% !important; }
  .ol-obs-tabs { display: flex; width: 100% !important; }
  .ol-obs-tabs .pill { flex: 1; min-height: 36px; padding: 0 6px; font-size: .84rem; }
  .vm-eye-wrap.ol-obs-wrap { width: 100% !important; border-radius: 20px; }
  .vm-lab.m-bench-main .vm-scope { height: min(118vw, 58vh); }
  .vm-lab .vm-scope.m-pip { aspect-ratio: 4 / 5; height: auto !important; }
  .vm-eye.ol-obs.m-pip > :not(.vm-eye-wrap) { display: none !important; }
  .vm-eye.ol-obs.m-pip .vm-eye-wrap { width: 92% !important; border-radius: 14px; box-shadow: none; }
  .vm-scope.m-pip .ol-bench-hud { display: none; }
  .ol-bench-hud { left: auto; right: 10px; top: 10px; }
  .vm-lab.m-observe-main .m-pip { top: 104px; }
  .ol-clock-btn { display: none !important; }
  .ol-samples { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; scrollbar-width: none; padding-bottom: 2px; }
  .ol-samples::-webkit-scrollbar { display: none; }
  .ol-samples .vm-chip { flex-shrink: 0; min-height: 38px; }
  #action-row { display: none !important; }
  .vm-scope .vm-scope-opts { left: 10px; right: 10px; top: auto; bottom: 10px; }
  .vm-dock > .m-deck-actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
  .vm-dock > .m-deck-actions:empty { display: none; }
  .m-deck-actions .btn { flex: 1 1 auto; min-height: 44px; padding: 0 10px; font-size: .88rem; white-space: nowrap; }
  .m-deck-actions .btn:not(.btn-primary) { flex: 0 1 auto; }
  .ol-measure-btns .btn { min-height: 44px; }
  .vm-dock > .vm-panel.m-on[data-deck="setup"], .vm-dock > .vm-panel.m-on[data-deck="measure"], .vm-dock > .vm-panel.m-on[data-deck="time"], .vm-dock > .vm-panel.m-on[data-deck="cond"] { max-height: 32vh; overflow-y: auto; overscroll-behavior: contain; }
  .m-deck-tabs .pill { padding: 0 4px; font-size: .8rem; }
  #obs-canvas { touch-action: pan-y; }
  #cell2d { touch-action: pan-y; }
}
@media (max-width: 767px) and (prefers-reduced-transparency: reduce) {
  .vm-dock { background: #121722; -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (max-width: 767px) and (prefers-reduced-motion: reduce) {
  .vm-dock > .vm-panel.m-on { animation: none; }
}

/* ── Accessibility preferences ──────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
  .vm-coach { transition: opacity .2s ease !important; }
}
@media (prefers-reduced-transparency: reduce) {
  .vm-command, .vm-coach, .vm-modal-box, .ctx-menu, .vm-scope-opts, .vm-3d-cam, .vm-eye-tip, .vm-3d-tip, .vm3d-note, .vm-shelf-btn { background: #1a2030; -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  :root { --border: rgba(255,255,255,.3); --border2: rgba(255,255,255,.45); --text-2: #d0d6e2; --text-dim: #aab3c5; }
  .pill-tabs { outline: 1px solid var(--border2); }
}

/* ── SEO article: facts, tables, figures, FAQ ─────────────── */
.seo-article .vm-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; margin: 16px 0 20px; }
.seo-article .vm-facts > div { background: var(--surface2); border: 1px solid var(--border); border-radius: 14px; padding: 11px 14px; }
.seo-article .vm-facts dt { font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
.seo-article .vm-facts dd { margin: 0; font-size: .88rem; line-height: 1.45; color: var(--text); }
.seo-article .vm-table { width: 100%; border-collapse: collapse; margin: 10px 0 18px; font-size: .86rem; display: block; overflow-x: auto; border-radius: 12px; }
.seo-article .vm-table th, .seo-article .vm-table td { text-align: left; padding: 9px 11px; border-bottom: 1px solid var(--border); vertical-align: top; line-height: 1.45; }
.seo-article .vm-table thead th { background: var(--surface2); color: var(--accent-hi); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.seo-article .vm-table tbody tr:nth-child(even) td { background: rgba(255,255,255,.02); }
.seo-article .vm-table td:first-child { font-weight: 600; color: #eaf6ff; }
.seo-article .vm-fig { margin: 16px 0; }
.seo-article .vm-fig img { display: block; width: 100%; height: auto; border-radius: 16px; border: 1px solid var(--border); background: #000; }
.seo-article .vm-fig figcaption { font-size: .8rem; color: var(--text-2); line-height: 1.45; margin-top: 8px; }
.seo-article .vm-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 260px); gap: 18px; align-items: start; }
.seo-article .vm-split .vm-fig-side { grid-column: 2; grid-row: 1; margin: 10px 0 0; }
.seo-article .vm-split .vm-table { grid-column: 1; grid-row: 1; }
.seo-article .vm-gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 10px 0 20px; }
.seo-article .vm-gallery .vm-fig { margin: 0; }
.seo-article .vm-gallery-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.seo-article .vm-gallery-2 .vm-fig:first-child img { max-height: 520px; width: auto; max-width: 100%; margin: 0 auto; }
.seo-article .vm-faq h4 { font-size: .98rem; color: #eaf6ff; margin: 16px 0 4px; }
.seo-article .vm-faq p { margin: 0; }
.seo-article ol li, .seo-article ul li { margin-bottom: 5px; line-height: 1.55; }
.user-guide .ug-thumb { float: right; width: 130px; height: auto; margin: 2px 0 8px 14px; border-radius: 10px; border: 1px solid var(--border); background: #000; }
.user-guide .guide-content::after { content: ''; display: block; clear: both; }
@media (max-width: 900px) {
  .seo-article .vm-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .seo-article .vm-split { grid-template-columns: 1fr; }
  .seo-article .vm-split .vm-fig-side { grid-column: 1; grid-row: auto; max-width: 300px; margin: 0 auto 6px; }
  .seo-article .vm-split .vm-table { grid-row: auto; }
}
@media (max-width: 500px) {
  .seo-article .vm-gallery, .seo-article .vm-gallery-2 { grid-template-columns: 1fr; }
  .user-guide .ug-thumb { width: 96px; }
}
#user-guide { margin-top: 28px; }
/* Long content below the lab is laid out and painted only when it nears the viewport (still in the DOM for
   crawlers, find-in-page and anchors). The intrinsic sizes keep the scrollbar steady. */
.seo-article { content-visibility: auto; contain-intrinsic-size: auto 7000px; }
#user-guide { content-visibility: auto; contain-intrinsic-size: auto 700px; }
.readout-badge, .vm-panel, .ex-card { contain: layout style; }
.vm-noscript { margin: 10px 0; padding: 12px 14px; border: 1px solid var(--gold); border-radius: 12px; color: #ead9a8; }

@media (prefers-reduced-motion: reduce) { .vm-status, .vm-status[hidden] { transition: opacity .15s ease, visibility 0s; transform: none; } .vm-status-btn.alert .vm-status-alert { animation: none; } }
@media (prefers-reduced-transparency: reduce) { .vm-status, .vm-status-btn { -webkit-backdrop-filter: none; backdrop-filter: none; background: #121722; } }

/* ══════════════════════════════════════════════════════════════════════════════
   SHARED TOOL RAIL, PICKER AND LAB PANEL (same as the amoeba)
   ══════════════════════════════════════════════════════════════════════════════ */
.ol-bench-hud .am-state-chip { font: 700 .82rem var(--font); color: var(--on-accent); background: var(--ph, var(--accent)); border-color: transparent; letter-spacing: -0.01em; }
/* the tool rail: a vertical glass toolbar under the state chip */
.am-tools {
  position: absolute; left: 14px; top: 54px; z-index: 5; display: flex; flex-direction: column; gap: 2px; padding: 4px; border-radius: 14px;
  background: rgba(18,23,34,.6); -webkit-backdrop-filter: blur(16px) saturate(160%); backdrop-filter: blur(16px) saturate(160%); border: 1px solid rgba(255,255,255,.08);
}
.am-tool {
  display: flex; align-items: center; gap: 7px; min-height: 34px; padding: 0 10px 0 8px; border: 0; border-radius: 10px; background: transparent; color: var(--text-2);
  font: 600 .76rem var(--font); cursor: pointer; white-space: nowrap; transition: background .2s, color .2s, transform .12s var(--ease); -webkit-tap-highlight-color: transparent;
}
.am-tool span[aria-hidden] { font-size: .95rem; width: 1.2em; text-align: center; }
.am-tool:hover { background: rgba(255,255,255,.08); color: var(--text); }
.am-tool:active { transform: scale(.95); }
.am-tool.active { background: var(--accent); color: var(--on-accent); }
.am-tool[hidden] { display: none !important; }
#bench-card.is-lab .am-tools, #bench-card.is-lab .vm-scope-opts, #bench-card.is-lab .am-caption { display: none; }
#cell2d.tool-on, #am3d-stage.tool-on canvas { cursor: crosshair; }
#cell2d.am-dragging { cursor: grabbing; }
/* the life strip: growth (with a fill that shows how far the cell has grown), then the six stages of fission */
.am-strip button { position: relative; }
.am-strip .am-grow-fill { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(255,255,255,.35); pointer-events: none; }
.am-strip button.grow { color: #04121c; }
/* the parts picker for the labeling lab */
.am-picker.am-names { flex-wrap: wrap; max-width: 330px; }
.am-picker.am-names button { flex-direction: row; min-width: 0; padding: 6px 10px; font: 600 .78rem var(--font); }
/* lab panel (Experiment) */
.am-lab-panel { display: flex; flex-direction: column; gap: 10px; }
.am-lab-panel .pill-tabs { display: flex; width: 100%; }
.am-lab-panel .pill-tabs .pill { flex: 1; padding: 0 6px; }
.am-lab-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; font-size: .82rem; color: var(--text-2); }
.am-lab-row input { width: 92px; background: var(--bg); border: 1px solid var(--border2); color: var(--text); border-radius: 10px; padding: 6px 9px; font: 700 .88rem var(--mono); min-height: 36px; }
.am-lab-row input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 4px var(--accent-lo); }
.am-lab-big { font: 800 1.6rem/1 var(--mono); color: var(--gold); font-variant-numeric: tabular-nums; }
.am-lab-note { font-size: .76rem; line-height: 1.45; color: var(--text-dim); }
.am-swatches { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.am-swatches .btn { justify-content: flex-start; gap: 8px; min-height: 36px; font-size: .78rem; }
.am-swatches i { width: 14px; height: 14px; border-radius: 50%; background: var(--c); flex-shrink: 0; box-shadow: 0 0 0 2px rgba(255,255,255,.12); }
.am-count-btn { font-size: 1rem !important; min-height: 48px !important; }
#medium-pills, #sample-pills { display: flex; width: 100%; }
#medium-pills .pill { flex: 1; padding: 0 6px; }
#bench-card.is-lab #lab-bench { cursor: pointer; }
#lab-field { display: block; width: 100%; height: 100%; border-radius: inherit; touch-action: pan-y; cursor: crosshair; }
#lab-bench { display: block; width: 100%; height: 100%; position: absolute; inset: 0; touch-action: pan-y; }

/* phones: the tools live in the Record panel of the deck (a row of icons), not on the card */
.am-tool-row { display: none; }
@media (max-width: 767px) {
  .am-tools { display: none; }
  .am-tool-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
  .am-tool-row .am-tool { flex-direction: column; gap: 2px; padding: 4px 0; min-height: 48px; justify-content: center; background: rgba(118,118,128,.16); font-size: .66rem; }
  .am-tool-row .am-tool.active { background: var(--accent); }
  .am-picker.am-names { max-width: calc(100% - 20px); }
}

.ol-obs-tabs .pill { padding: 0 12px; }

/* Play/pause lives on the stage, beside the clock it runs (not in the command bar). Phones use the deck's ▶. */
.ol-bench-hud .ol-hud-play {
  pointer-events: auto; flex-shrink: 0; display: grid; place-items: center; width: 30px; height: 30px; padding: 0;

  border-radius: 50%; border: 0; background: var(--accent); color: var(--on-accent); font-size: .72rem; cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,.35); transition: transform .12s ease, background .2s ease;
}
.ol-bench-hud .ol-hud-play span { all: unset; }
.ol-bench-hud .ol-hud-play.running { background: rgba(18,23,34,.6); color: var(--text); border: 1px solid rgba(255,255,255,.14); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.ol-bench-hud .ol-hud-play:hover { transform: scale(1.06); }
.ol-bench-hud .ol-hud-play:active { transform: scale(.94); }
@media (max-width: 767px) { .ol-bench-hud .ol-hud-play { display: none; } }

/* ═══════════════ phones, canvas first (2026-10-27) ═══════════════
   The board fills the screen above a one-row deck (Run + panel tabs); messages and the web's state live in a strip of
   their own above the board, never over it; the Board | Pyramid switch picks the view (no floating thumbnail); the
   Levels / Energy / Live check switches move into the Tools panel. Organisms still come from the Add panel: tap one to
   add it, or pull it up onto the board. Desktop and tablet never see any of this. */
.vm-lab > .m-msg-slot, .m-opts-slot, .m-lab-acts { display: none; }
@media (max-width: 767px) {
  .vm-lab:not(.immersive) { display: flex; flex-direction: column; height: calc(100svh - var(--m-deck, 92px)); min-height: 440px; padding: 6px; border-radius: 22px; }
  .vm-lab > .m-viewbar { flex: none; padding: 0 0 6px; }
  #m-view-pills .pill { min-height: 34px; }
  .vm-lab .vm-scope.m-pip, .vm-lab .vm-eye.m-pip { display: none !important; }
  .vm-lab.m-bench-main .pk-board { flex: 1 1 auto; height: auto !important; min-height: 0; }
  .vm-lab.m-observe-main #observe-card { flex: 1 1 auto; min-height: 0; justify-content: center; padding: 0; gap: 8px; }
  .vm-lab.m-observe-main #obs-tabs { flex-wrap: nowrap; }
  .vm-lab.m-observe-main #obs-tabs .pill { flex: 1 1 0; min-width: 0; padding: 0 3px; font-size: .78rem; white-space: nowrap; }
  .pk-board .ol-bench-hud { display: none; }   /* the strip says the same */

  /* the message strip: two lines at most; a tap opens the rest over the board */
  #coach { display: none !important; }
  .vm-lab > .m-msg-slot { display: block; flex: none; position: relative; z-index: 12; height: 46px; margin: 0 0 6px; }
  .m-msg {
    position: absolute; left: 0; right: 0; top: 0; min-height: 46px; display: flex; align-items: center; gap: 8px;
    padding: 4px 4px 4px 12px; border-radius: 14px; overflow: hidden;
    background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08);
    font-size: .8rem; line-height: 1.3; color: var(--text-2);
  }
  .m-msg-ico { flex: none; font-size: .95rem; line-height: 1; }
  .m-msg-txt { flex: 1; min-width: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .m-msg-txt b { color: var(--text); font-weight: 700; }
  .m-msg.on { color: var(--text); background: rgba(20,30,30,.96); border-color: rgba(74,222,128,.45); cursor: pointer; animation: m-msg-in .32s var(--ease); }
  .m-msg.on.warn { border-color: rgba(245,200,66,.5); } .m-msg.on.bad { border-color: rgba(255,95,87,.55); } .m-msg.on.ok { border-color: rgba(52,211,153,.5); }
  .m-msg.on::before { content: ''; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
  .m-msg.on.warn::before { background: var(--gold); } .m-msg.on.bad::before { background: var(--red); } .m-msg.on.ok::before { background: var(--green); }
  .m-msg.open { align-items: flex-start; padding-top: 10px; padding-bottom: 10px; box-shadow: 0 18px 40px rgba(0,0,0,.6); }
  .m-msg.open .m-msg-txt { display: block; -webkit-line-clamp: unset; overflow: visible; }
  .m-msg.open .m-msg-act, .m-msg.open .m-msg-x { margin-top: -6px; }
  .m-msg-act { flex: none; min-height: 36px; padding: 0 11px; border: 0; border-radius: 11px; background: var(--accent); color: var(--on-accent); font: 700 .78rem var(--font); white-space: nowrap; cursor: pointer; }
  .m-msg-x { flex: none; width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; color: var(--text-2); font-size: 1.15rem; line-height: 1; cursor: pointer; }
  @keyframes m-msg-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

  /* the deck: Run (and the lab's next step) and the panel tabs in one row; a panel opens above the home bar */
  .vm-dock {
    display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 8px; align-items: center;
    margin: 8px -14px 0; padding: 2px 10px calc(8px + env(safe-area-inset-bottom));
  }
  .vm-dock > .m-deck-grab { grid-column: 1 / -1; grid-row: 1; justify-self: center; margin: 0; height: 16px; }
  .vm-dock > .m-deck-grab::before { top: 5px; }
  .vm-dock > .m-deck-actions { grid-column: 1; grid-row: 2; display: flex; flex-wrap: nowrap; gap: 6px; margin: 0 !important; }
  .vm-dock > .m-deck-tabs, .vm-dock.m-collapsed > .m-deck-tabs { grid-column: 2; grid-row: 2; margin: 0; }
  .vm-dock > .vm-panel { grid-column: 1 / -1; grid-row: 3; margin-top: 10px; }
  .pk-dock .m-deck-actions .btn { flex: 0 0 auto; min-height: 50px; padding: 0 11px; font-size: .84rem; }
  .pk-dock .m-deck-actions .btn:not([data-act="run"]) { max-width: 96px; white-space: normal; line-height: 1.15; font-size: .74rem; text-align: left; padding: 0 8px; }
  .m-deck-tabs .pill { flex-direction: column; justify-content: center; gap: 3px; min-height: 50px; padding: 4px 0; font-size: .62rem; letter-spacing: 0; min-width: 0; }
  .m-deck-tabs .t-ico { display: block; font-size: 1.08rem; line-height: 1; }
  .m-deck-tabs .t-lbl { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .vm-dock > .vm-panel.m-on[data-deck] { max-height: 36vh; overflow-y: auto; overscroll-behavior: contain; }
  .pk-tray-grid { max-height: none; overflow: visible; }   /* the panel scrolls instead */

  /* panels that took over things from the board */
  .m-lab-acts { display: flex; flex-wrap: wrap; gap: 6px; } .m-lab-acts:empty { display: none; }
  .m-lab-acts .btn { min-height: 42px; }
  .m-opts-slot { display: block; }
  .m-opts-slot .vm-scope-opts { position: static; display: flex; justify-content: flex-start; gap: 6px 18px; padding: 0; background: none; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .m-opts-slot .vm-check { font-size: .86rem; }
  { font-size: .8rem; line-height: 1.4; }
  { min-height: 40px; white-space: nowrap; padding: 0 8px; }
}

/* ══════════════════════════════════════════════════════════════════════════════
   PLANT CLASSIFICATION: activity strip, tree board, tray, the card (group, animal, key, compare, guide),
   rank ladder, experiments, interactive quiz (desktop and tablet first; phones in the block at the end)
   ══════════════════════════════════════════════════════════════════════════════ */
.pk-ic { display: inline-grid; place-items: center; width: 1.6em; height: 1.6em; flex: none; line-height: 1; }
.pk-emo { font-family: "Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif; font-size: 1.25em; }
.pk-svg svg { width: 100%; height: 100%; display: block; }
.pk-ic.big { width: 2.6em; height: 2.6em; } .pk-emo.big { font-size: 2em; }
.pk-ic.huge { width: 4.4em; height: 4.4em; } .pk-emo.huge { font-size: 3.4em; }

/* activity strip */
.pk-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 0 0 12px; }
.pk-act { display: flex; align-items: center; gap: 10px; min-height: 62px; padding: 9px 12px; border-radius: 16px; text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); color: var(--text); transition: background .15s, border-color .15s, transform .12s var(--ease); }
.pk-act:hover { background: var(--surface2); border-color: rgba(74,222,128,.4); }
.pk-act:active { transform: scale(.97); }
.pk-act-emo { font-size: 1.6rem; line-height: 1; flex-shrink: 0; font-family: "Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif; }
.pk-act-txt { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.pk-act-txt b { font: 700 .86rem/1.15 var(--font); letter-spacing: -0.01em; }
.pk-act-txt small { font: 500 .7rem/1.25 var(--font); color: var(--text-dim); }
@media (max-width: 900px) { .pk-strip { display: flex; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; } .pk-act { flex: 0 0 196px; } .pk-strip::-webkit-scrollbar { display: none; } }

/* the tree board */
.pk-lab { grid-template-columns: minmax(0, 1.42fr) minmax(0, 1fr); }
.pk-board { min-height: 760px; overflow: hidden; background: #0b0f18; }
#tree { position: absolute; inset: 0; display: block; width: 100%; height: 100%; touch-action: pan-y; }
.pk-hud { position: absolute; left: 12px; top: 10px; right: 12px; z-index: 4; display: flex; justify-content: space-between; gap: 8px; pointer-events: none; }
.pk-hud > span { display: inline-flex; align-items: center; gap: 8px; padding: 5px 11px; border-radius: 999px; background: rgba(18,23,34,.62); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,.1); font: 600 .74rem var(--font); color: var(--text-2); white-space: nowrap; }
.pk-hud b { color: var(--text); font-weight: 700; }
.pk-hud-sel { color: var(--text) !important; } .pk-hud-sel[hidden] { display: none !important; }
.pk-xpbar { width: 64px; height: 6px; border-radius: 4px; background: rgba(255,255,255,.1); overflow: hidden; }
.pk-xpbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--gold)); border-radius: 4px; transition: width .5s var(--ease); }
/* the tray */
.pk-tray {
  position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 5; display: flex; flex-direction: column; gap: 6px; padding: 8px 8px 9px; border-radius: 18px;
  background: rgba(14,18,27,.78); -webkit-backdrop-filter: blur(18px) saturate(160%); backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid rgba(255,255,255,.1); box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 14px 34px rgba(0,0,0,.45);
}
.pk-tray-h { display: flex; align-items: center; gap: 10px; padding: 0 4px; font: 700 .66rem var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--text-dim); }
.pk-tray-tip { text-transform: none; letter-spacing: 0; font-weight: 500; font-size: .72rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pk-tray-new { flex: none; min-height: 30px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--border2); background: rgba(255,255,255,.05); color: var(--text); font: 600 .74rem var(--font); cursor: pointer; text-transform: none; letter-spacing: 0; }
.pk-tray-new:hover { background: rgba(255,255,255,.1); }
.pk-tray-list { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: thin; overscroll-behavior-x: contain; touch-action: pan-x; padding-bottom: 2px; }
.pk-tray-done { font-size: .8rem; color: var(--text-2); padding: 10px 6px; }
.pk-tok {
  position: relative; flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; width: 86px; min-height: 70px; padding: 6px 4px;
  border-radius: 14px; border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.05); color: var(--text); cursor: grab; touch-action: pan-x;
  transition: background .15s, border-color .15s, transform .12s var(--ease), opacity .15s; user-select: none; -webkit-user-select: none;
}
.pk-tok .pk-ic { width: 34px; height: 34px; pointer-events: none; } .pk-tok .pk-emo { font-size: 28px; }
.pk-tok-n { font: 600 .66rem/1.15 var(--font); text-align: center; pointer-events: none; max-width: 100%; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pk-tok:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.2); }
.pk-tok:active { transform: scale(.95); }
.pk-tok.picked { border-color: var(--accent); background: rgba(74,222,128,.18); box-shadow: 0 0 0 2px rgba(74,222,128,.35); }
.pk-tok.found::after { content: '✓'; position: absolute; right: 5px; top: 3px; font: 700 .62rem var(--font); color: var(--green); }
.pk-tok.dragging { opacity: .35; }
.pk-tok.shake, .pk-ab.shake, .iq-ab.shake { animation: pk-shake .42s; }
@keyframes pk-shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.pk-ghost { position: fixed; left: 0; top: 0; width: 56px; height: 56px; z-index: 2000; pointer-events: none; display: grid; place-items: center;
  border-radius: 50%; background: rgba(14,18,27,.85); border: 2px solid rgba(74,222,128,.8); box-shadow: 0 14px 30px rgba(0,0,0,.5); }
.pk-ghost .pk-ic { width: 38px; height: 38px; } .pk-ghost .pk-emo { font-size: 30px; }

/* the card */
.pk-obs { padding: 16px 16px 16px; gap: 10px; align-items: stretch; position: relative; }
.pk-obs-tabs { display: flex; width: 100%; }
.pk-obs-tabs .pill { flex: 1; padding: 0 4px; font-size: .78rem; min-width: 0; white-space: nowrap; }
.pk-panel { flex: 1; min-height: 0; overflow-y: auto; max-height: 690px; padding: 2px 4px 60px 2px; display: flex; flex-direction: column; gap: 10px; scrollbar-width: thin; outline: none; }
.pk-panel h3 { font-size: 1.12rem; letter-spacing: -0.015em; }
.pk-empty { font-size: .86rem; color: var(--text-2); line-height: 1.5; }
.pk-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: .74rem; color: var(--text-dim); }
.pk-crumb { border: 0; background: rgba(255,255,255,.05); color: var(--text-2); border-radius: 8px; padding: 3px 7px; font: 600 .72rem var(--font); cursor: pointer; }
.pk-crumb:hover { color: var(--text); background: rgba(255,255,255,.1); }
.pk-crumbs b { color: var(--text); }
.pk-ghead { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px; background: linear-gradient(150deg, color-mix(in srgb, var(--g) 22%, transparent), rgba(255,255,255,.02)); border: 1px solid color-mix(in srgb, var(--g) 40%, transparent); }
.pk-ghead p { font-size: .78rem; color: var(--text-2); margin-top: 2px; }
.pk-gdot { width: 16px; height: 16px; border-radius: 50%; flex: none; background: var(--g); box-shadow: 0 0 0 4px color-mix(in srgb, var(--g) 25%, transparent); }
.pk-gdot.sm { width: 12px; height: 12px; box-shadow: none; }
.pk-what { font-size: .9rem; line-height: 1.5; color: var(--text); }
.pk-gain { font-size: .82rem; color: #fde68a; }
.pk-feats { display: grid; gap: 5px; padding-left: 0; list-style: none; }
.pk-feats li { position: relative; padding-left: 18px; font-size: .84rem; line-height: 1.45; color: var(--text-2); }
.pk-feats li::before { content: ''; position: absolute; left: 4px; top: .55em; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.pk-note { font-size: .78rem; line-height: 1.5; color: var(--text-2); padding: 8px 10px; border-radius: 12px; background: rgba(255,255,255,.03); border: 1px solid var(--border); }
.pk-fact { font-size: .84rem; line-height: 1.5; color: #e9dfc0; padding: 8px 10px; border-radius: 12px; background: rgba(245,200,66,.06); border: 1px solid rgba(245,200,66,.2); }
.pk-trick { font-size: .84rem; line-height: 1.5; color: #fbcfe8; padding: 8px 10px; border-radius: 12px; background: rgba(74,222,128,.08); border: 1px solid rgba(74,222,128,.3); }
.pk-sub { display: flex; flex-direction: column; gap: 7px; }
.pk-gchips { display: flex; flex-wrap: wrap; gap: 5px; }
.pk-gchip { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 10px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--g) 45%, transparent); background: color-mix(in srgb, var(--g) 12%, transparent); color: var(--text); font: 600 .74rem var(--font); cursor: pointer; }
.pk-gchip i { width: 8px; height: 8px; border-radius: 50%; background: var(--g); }
.pk-gchip:hover { background: color-mix(in srgb, var(--g) 22%, transparent); }
.pk-agrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 6px; }
.pk-abtn { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 3px 6px; border-radius: 12px; border: 1px solid var(--border); background: rgba(255,255,255,.03); color: var(--text-2); font: 600 .66rem/1.15 var(--font); cursor: pointer; text-align: center; transition: background .15s, border-color .15s; }
.pk-abtn .pk-ic { width: 34px; height: 34px; } .pk-abtn .pk-emo { font-size: 27px; }
.pk-abtn:hover { background: rgba(255,255,255,.07); color: var(--text); }
.pk-abtn.found { color: var(--text); border-color: rgba(61,220,132,.3); }
.pk-abtn.sil { cursor: default; } .pk-abtn.sil .pk-ic { filter: brightness(0) invert(.32); opacity: .55; }
.pk-tick { position: absolute; right: 5px; top: 3px; font-style: normal; font-size: .62rem; color: var(--green); }
.pk-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.pk-acts .btn { min-height: 38px; }
/* plant card */
.pk-ahead, .pk-khead { display: flex; gap: 14px; align-items: flex-start; }
.pk-abig { flex: none; width: 92px; height: 92px; border-radius: 22px; display: grid; place-items: center; background: radial-gradient(circle at 40% 35%, rgba(255,255,255,.1), rgba(255,255,255,.02)); border: 1px solid var(--border2); }
.pk-abig .pk-ic { width: 70px; height: 70px; } .pk-abig .pk-emo { font-size: 58px; }
.pk-sci { font-size: .9rem; color: var(--text-2); margin: 2px 0 6px; }
.pk-subcl { display: inline-block; margin-left: 6px; font: 600 .7rem var(--font); color: var(--text-dim); }
.pk-rank { width: 100%; border-collapse: collapse; font-size: .82rem; }
.pk-rank th { width: 98px; text-align: left; padding: 5px 8px; font: 700 .68rem var(--font); letter-spacing: .06em; text-transform: uppercase; color: var(--text-dim); border-bottom: 1px solid var(--border); }
.pk-rank td { padding: 5px 8px; border-bottom: 1px solid var(--border); color: var(--text); }
.pk-rank tr.r-subphylum th, .pk-rank tr.r-subphylum td { color: var(--text-dim); font-size: .76rem; }
.pk-rank tr.r-species td { color: var(--accent-hi); font-weight: 700; }
.pk-dl { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pk-dl div { padding: 7px 9px; border-radius: 12px; background: rgba(255,255,255,.03); border: 1px solid var(--border); }
.pk-dl dt { font: 700 .66rem var(--font); letter-spacing: .05em; text-transform: uppercase; color: var(--text-dim); }
.pk-dl dd { font-size: .82rem; color: var(--text); margin-top: 2px; line-height: 1.35; }
.pk-fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pk-fgrid div { display: grid; grid-template-columns: 22px 1fr; gap: 0 6px; padding: 6px 8px; border-radius: 10px; background: rgba(255,255,255,.025); }
.pk-fgrid span { grid-row: span 2; font-size: 1rem; font-family: "Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif; }
.pk-fgrid b { font: 700 .66rem var(--font); letter-spacing: .04em; text-transform: uppercase; color: var(--text-dim); }
.pk-fgrid em { font-style: normal; font-size: .78rem; color: var(--text); line-height: 1.35; }
/* key */
.pk-notes { list-style: none; display: grid; gap: 3px; font-size: .78rem; color: var(--text-2); margin-top: 4px; }
.pk-ktrail { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.pk-ktrail li { font-size: .8rem; padding: 5px 9px; border-radius: 10px; background: rgba(61,220,132,.07); border: 1px solid rgba(61,220,132,.25); color: var(--text); }
.pk-ktrail li.bad { background: rgba(255,95,87,.08); border-color: rgba(255,95,87,.35); }
.pk-ktrail b, .pk-ab b, .pk-fullkey b { font-family: var(--mono); color: var(--accent-hi); margin-right: 4px; }
.pk-couplet { display: flex; flex-direction: column; gap: 7px; padding: 12px; border-radius: 16px; background: rgba(74,222,128,.06); border: 1px solid rgba(74,222,128,.3); }
.pk-cq { font: 700 .95rem/1.4 var(--font); display: flex; gap: 8px; align-items: flex-start; }
.pk-cn { flex: none; display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 9px; background: var(--accent); color: var(--on-accent); font: 800 .8rem var(--mono); }
.pk-ab { justify-content: flex-start; text-align: left; white-space: normal; min-height: 46px; line-height: 1.35; flex-wrap: wrap; }
.pk-go { margin-left: auto; font-size: .72rem; color: var(--text-dim); font-weight: 500; }
.pk-left { font-size: .74rem; color: var(--text-dim); }
.pk-kend { padding: 12px; border-radius: 14px; font-size: .9rem; line-height: 1.45; }
.pk-kend.ok { background: rgba(61,220,132,.1); border: 1px solid rgba(61,220,132,.4); } .pk-kend.bad { background: rgba(255,95,87,.1); border: 1px solid rgba(255,95,87,.4); }
.pk-fullkey { border-top: 1px solid var(--border); padding-top: 8px; }
.pk-fullkey summary { cursor: pointer; font: 700 .8rem var(--font); color: var(--text-2); }
.pk-fullkey ol { list-style: none; display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.pk-fullkey li { font-size: .74rem; line-height: 1.45; padding: 5px 8px; border-radius: 9px; color: var(--text-2); }
.pk-fullkey li i { color: var(--text-dim); }
.pk-fullkey li.on { background: rgba(74,222,128,.12); color: var(--text); } .pk-fullkey li.past { background: rgba(255,255,255,.03); }
/* compare */
.pk-cmp-pick { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; align-items: center; }
.pk-cmp-slot { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 6px; border-radius: 14px; border: 1px solid var(--border2); background: rgba(255,255,255,.03); }
.pk-cmp-slot.a { border-color: rgba(74,222,128,.55); } .pk-cmp-slot.b { border-color: rgba(124,196,255,.55); }
.pk-cmp-slot .pk-ic { width: 34px; height: 34px; } .pk-cmp-slot .pk-emo { font-size: 27px; }
.pk-sel { width: 100%; min-width: 0; min-height: 36px; border-radius: 10px; border: 1px solid var(--border2); background: var(--bg); color: var(--text); font: 600 .8rem var(--font); padding: 0 8px; }
.pk-swap { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border2); background: var(--surface2); color: var(--text); cursor: pointer; font-size: 1rem; }
.pk-presets { display: flex; flex-wrap: wrap; gap: 5px; }
.pk-preset { min-height: 28px; padding: 0 9px; border-radius: 999px; border: 1px solid var(--border2); background: rgba(255,255,255,.03); color: var(--text-2); font: 600 .7rem var(--font); cursor: pointer; }
.pk-preset:hover { color: var(--text); background: rgba(255,255,255,.08); }
.pk-meter { display: flex; align-items: center; gap: 4px; }
.pk-meter i { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font: 800 .74rem var(--mono); font-style: normal; background: rgba(255,255,255,.04); border: 1px solid var(--border2); color: var(--text-dim); }
.pk-meter i.on { background: rgba(245,200,66,.18); border-color: rgba(245,200,66,.65); color: #fde68a; }
.pk-meter span { margin-left: 8px; font: 700 .84rem var(--font); color: var(--text); }
.pk-cmp { width: 100%; border-collapse: collapse; font-size: .8rem; }
.pk-cmp th, .pk-cmp td { padding: 5px 7px; border-bottom: 1px solid var(--border); text-align: left; }
.pk-cmp thead th { font: 700 .74rem var(--font); } .pk-cmp thead th.a { color: #86efac; } .pk-cmp thead th.b { color: #a9d6ff; }
.pk-cmp tbody th { font: 700 .66rem var(--font); letter-spacing: .05em; text-transform: uppercase; color: var(--text-dim); width: 78px; }
.pk-cmp tr.same td { background: rgba(245,200,66,.09); color: #fde68a; }
.pk-cmp-say { font-size: .86rem; line-height: 1.5; color: var(--text); }
/* field guide */
.pk-guide-top { display: flex; gap: 14px; align-items: center; padding: 12px; border-radius: 16px; background: linear-gradient(150deg, rgba(74,222,128,.16), rgba(245,200,66,.06)); border: 1px solid rgba(74,222,128,.3); }
.pk-guide-top p { font-size: .78rem; color: var(--text-2); }
.pk-rankemo { font-size: 2.6rem; font-family: "Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif; }
.pk-guide-top > div { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.pk-bar { height: 8px; border-radius: 6px; background: rgba(255,255,255,.08); overflow: hidden; }
.pk-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--gold)); }
.pk-badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 6px; }
.pk-badge { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 3px; border-radius: 12px; border: 1px solid var(--border); background: rgba(255,255,255,.02); color: var(--text-2); cursor: pointer; font: 600 .62rem/1.15 var(--font); text-align: center; }
.pk-ring { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(closest-side, var(--surface) 78%, transparent 80%), conic-gradient(var(--g) var(--p), rgba(255,255,255,.08) 0); }
.pk-ring .pk-ic { width: 26px; height: 26px; } .pk-ring .pk-emo { font-size: 20px; }
.pk-badge em { font-style: normal; font-family: var(--mono); color: var(--text-dim); }
.pk-badge.done { border-color: color-mix(in srgb, var(--g) 60%, transparent); background: color-mix(in srgb, var(--g) 10%, transparent); color: var(--text); }
.pk-badge:not(.done) .pk-ring .pk-ic { filter: grayscale(1); opacity: .6; }
.pk-collection { grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); }
/* rank ladder card */
.pk-ladder { display: flex; flex-direction: column; gap: 6px; }
.pk-ladder-lede, .pk-ladder-note { font-size: .78rem; color: var(--text-2); line-height: 1.5; }
.pk-ladder-note { color: var(--text-dim); font-size: .72rem; }
.pk-lrow { display: grid; grid-template-columns: 70px minmax(0, 1.1fr) minmax(0, 1fr) 96px; align-items: center; gap: 8px; }
.pk-lk { font: 700 .66rem var(--font); letter-spacing: .06em; text-transform: uppercase; color: var(--text-dim); }
.pk-lv { font-size: .84rem; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pk-lbar { height: 10px; border-radius: 6px; background: rgba(255,255,255,.05); overflow: hidden; }
.pk-lbar i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, rgba(74,222,128,.55), rgba(245,200,66,.75)); }
.pk-lc { font: 600 .72rem var(--mono); color: var(--text-2); text-align: right; }
/* find */
.pk-find input { width: 100%; min-height: 40px; padding: 0 12px; border-radius: 11px; border: 1px solid var(--border2); background: var(--bg); color: var(--text); font: 500 .9rem var(--font); }
.pk-find-res { display: flex; flex-direction: column; gap: 4px; max-height: 260px; overflow-y: auto; }
.pk-fr { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: 11px; border: 1px solid transparent; background: rgba(255,255,255,.03); color: var(--text); text-align: left; cursor: pointer; }
.pk-fr:hover, .pk-fr:focus-visible { border-color: rgba(74,222,128,.45); background: rgba(74,222,128,.08); }
.pk-fr .pk-ic { width: 30px; height: 30px; } .pk-fr .pk-emo { font-size: 24px; }
.pk-fr span { display: flex; flex-direction: column; } .pk-fr b { font-size: .84rem; } .pk-fr small { font-size: .72rem; color: var(--text-dim); }
.pk-tree-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.pk-tree-acts .btn { min-height: 36px; }
/* the dock */
.pk-dock { grid-template-columns: 1.3fr 1fr 1fr; margin-top: 12px; }
.pk-dock > .pk-animals-panel, .pk-dock > .pk-lab-panel { display: none; }
body.vm-exp-mode .pk-dock > .pk-lab-panel { display: flex; }
.pk-deal { display: flex; gap: 6px; flex-wrap: wrap; } .pk-deal:empty { display: none; }
.pk-tray-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
.pk-tray-grid .pk-tok { width: auto; touch-action: pan-y; cursor: pointer; }
/* experiments */
.pk-exp .ex-card-head { display: flex; align-items: center; gap: 8px; }
.pk-exp-ico { font-size: 1.5rem; font-family: "Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif; }
.pk-need { font-size: .8rem; color: var(--text-2); }
.pk-safety { font-size: .76rem; color: #fcd34d; }
.pk-exp .btn { align-self: flex-start; margin-top: auto; }
.mission-hud { display: flex; flex-direction: column; gap: 10px; }
.pk-mi-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.pk-mi-head strong { font-size: 1.02rem; letter-spacing: -0.01em; }
.pk-mi-prog { margin-left: auto; font: 700 .76rem var(--mono); color: var(--accent-hi); }
.pk-mi-aim { font-size: .84rem; color: var(--text-2); line-height: 1.45; }
.pk-steps { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.pk-steps li { padding: 7px 11px; border-radius: 12px; border: 1px solid var(--border2); background: rgba(255,255,255,.03); font-size: .8rem; color: var(--text-2); }
.pk-steps li.now { border-color: rgba(74,222,128,.65); background: rgba(74,222,128,.12); color: var(--text); }
.pk-steps li.done { border-color: rgba(61,220,132,.45); color: #b9f5d3; background: rgba(61,220,132,.08); }
.pk-mi-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pk-mi-acts .btn[disabled] { opacity: .4; cursor: default; }
.pk-mi-res { font: 700 .86rem var(--mono); color: var(--gold); }
.pk-q { border-top: 1px solid rgba(74,222,128,.25); padding-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.pk-q-t { font-size: .9rem; line-height: 1.5; }
.pk-q-opts { display: flex; flex-direction: column; gap: 6px; }
.pk-q-opts .opt { text-align: left; justify-content: flex-start; white-space: normal; min-height: 40px; }
.pk-q-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.ex-note { font-size: .78rem; color: var(--text-dim); }
.ex-formula { font: 600 .82rem var(--mono); color: var(--accent-hi); }
/* build-a-key */
.pk-bk-h { font-size: 1.05rem; }
.pk-bk-box, .pk-bk-q { border: 1px dashed var(--border2); border-radius: 14px; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.pk-bk-q { border-style: solid; border-color: rgba(74,222,128,.35); background: rgba(74,222,128,.04); }
.pk-bk-q > p { display: flex; align-items: center; gap: 7px; font: 700 .84rem/1.35 var(--font); }
.pk-bk-animals { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.pk-bk-animals span { font-size: .72rem; color: var(--text-dim); margin-left: 6px; }
.pk-bk-pick { display: flex; flex-direction: column; gap: 4px; font-size: .74rem; color: var(--text-dim); }
.pk-bk-pick select { min-height: 36px; border-radius: 10px; border: 1px solid var(--border2); background: var(--bg); color: var(--text); font: 600 .8rem var(--font); padding: 0 8px; width: 100%; }
.pk-bk-kids { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pk-bk-kids > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pk-bk-yn { font: 800 .64rem var(--font); letter-spacing: .08em; text-transform: uppercase; }
.pk-bk-yn.yes { color: var(--green); } .pk-bk-yn.no { color: #fca5a5; }
.pk-bk-leaf { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 11px; background: rgba(61,220,132,.08); border: 1px solid rgba(61,220,132,.35); font-size: .8rem; }
.pk-bk-undo { margin-left: auto; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(255,255,255,.06); color: var(--text-2); cursor: pointer; }
.pk-pool { font-size: .8rem; } .pk-pool tr.tot td { font-weight: 700; border-top: 2px solid var(--border2); }
.pk-eq { font: 700 .86rem var(--mono); color: var(--accent-hi); }
/* quiz */
.pk-quiz-kind .pill { min-height: 40px; padding: 0 18px; }
#text-kind { margin: 0 auto 12px; display: flex; width: max-content; max-width: 100%; }
.iq-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 10px; }
.iq-map { display: flex; flex-wrap: wrap; gap: 6px; }
.iq-lvl { position: relative; display: flex; flex-direction: column; align-items: center; gap: 1px; width: 62px; padding: 6px 2px 5px; border-radius: 14px; border: 1px solid var(--border2); background: var(--surface); color: var(--text-2); cursor: pointer; transition: border-color .15s, background .15s, transform .12s var(--ease); }
.iq-lvl:active { transform: scale(.95); }
.iq-lvl-n { position: absolute; left: 6px; top: 3px; font: 700 .6rem var(--mono); color: var(--text-dim); }
.iq-lvl-e { font-size: 1.3rem; font-family: "Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif; }
.iq-lvl-s { font-size: .66rem; color: var(--gold); letter-spacing: 1px; } .iq-lvl-s i { font-style: normal; color: rgba(255,255,255,.15); }
.iq-lvl.on { border-color: var(--accent); background: rgba(74,222,128,.14); color: var(--text); }
.iq-lvl.done { border-color: rgba(245,200,66,.4); }
.iq-total { margin-left: auto; font: 700 .9rem var(--mono); color: var(--gold); }
.iq-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.iq-head { display: flex; flex-direction: column; gap: 4px; }
.iq-kind { font: 700 .68rem var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--accent-hi); }
.iq-head h3 { font-size: 1.2rem; letter-spacing: -0.015em; }
.iq-head p { font-size: .92rem; color: var(--text-2); line-height: 1.5; }
.iq-stage { display: flex; flex-direction: column; gap: 10px; }
.iq-tray { display: flex; flex-wrap: wrap; gap: 6px; min-height: 58px; padding: 8px; border-radius: 14px; background: rgba(255,255,255,.03); border: 1px dashed var(--border2); }
.iq-tray-empty { font-size: .82rem; color: var(--text-dim); align-self: center; padding: 0 6px; }
.iq-chip { display: inline-flex; align-items: center; gap: 7px; min-height: 46px; padding: 4px 11px 4px 6px; border-radius: 13px; border: 1px solid var(--border2); background: var(--surface2); color: var(--text); font: 600 .82rem var(--font); cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; text-align: left; transition: border-color .15s, background .15s, transform .12s var(--ease); }
.iq-chip .pk-ic { width: 32px; height: 32px; pointer-events: none; } .iq-chip .pk-emo { font-size: 26px; }
.iq-chip-t { display: flex; flex-direction: column; pointer-events: none; line-height: 1.2; }
.iq-chip-t small { font-weight: 500; font-size: .68rem; color: var(--text-dim); }
.iq-chip-txt { padding-left: 11px; }
.iq-chip.picked { border-color: var(--accent); background: rgba(74,222,128,.18); box-shadow: 0 0 0 2px rgba(74,222,128,.35); }
.iq-chip.in { min-height: 40px; cursor: pointer; }
.iq-chip.ok { border-color: var(--green); background: rgba(61,220,132,.14); }
.iq-chip.bad { border-color: var(--red); background: rgba(255,95,87,.14); }
.iq-chip.dragging { opacity: .35; }
.iq-ghost { position: fixed; left: 0; top: 0; z-index: 2000; pointer-events: none; box-shadow: 0 14px 30px rgba(0,0,0,.5); }
.iq-bins { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; }
.iq-bins.n2 { grid-template-columns: 1fr 1fr; }
.iq-bin { min-height: 140px; border-radius: 16px; padding: 8px; border: 1px solid var(--border2); background: rgba(255,255,255,.02); cursor: pointer; transition: border-color .15s, background .15s; }
.iq-bin.over { background: rgba(74,222,128,.08); border-color: var(--accent); }
.iq-bin-h { display: flex; align-items: center; gap: 6px; font: 700 .86rem var(--font); margin-bottom: 8px; }
.iq-bin-h span { font-size: 1.1rem; font-family: "Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif; }
.iq-bin-h i { margin-left: auto; font: 700 .7rem var(--mono); font-style: normal; color: var(--text-dim); }
.iq-bin-b { display: flex; flex-wrap: wrap; gap: 5px; }
.iq-row { position: relative; display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; padding: 10px 10px 10px 42px; border-radius: 16px; border: 1px solid var(--border); background: rgba(255,255,255,.02); }
.iq-row.ok { border-color: rgba(61,220,132,.5); } .iq-row.bad { border-color: rgba(255,95,87,.5); }
.iq-row-n { position: absolute; left: 12px; top: 12px; font: 800 .9rem var(--mono); color: var(--accent-hi); }
.iq-card-a { flex: 1 1 110px; display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 6px; border-radius: 14px; border: 1px solid var(--border2); background: var(--surface2); color: var(--text); font: 600 .8rem/1.2 var(--font); cursor: pointer; text-align: center; transition: border-color .15s, background .15s, transform .12s var(--ease); }
.iq-card-a:active { transform: scale(.96); }
.iq-card-a.sel { border-color: var(--accent); background: rgba(74,222,128,.16); box-shadow: 0 0 0 2px rgba(74,222,128,.3); }
.iq-card-a.answer { border-color: var(--green); background: rgba(61,220,132,.14); }
.iq-why { flex: 1 1 100%; font-size: .8rem; line-height: 1.45; color: #fecaca; } .iq-why.ok { color: #b9f5d3; }
.iq-pick { padding-left: 10px; }
.iq-target { flex: 1 1 180px; display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 14px; background: rgba(74,222,128,.08); border: 1px solid rgba(74,222,128,.35); }
.iq-target span { display: flex; flex-direction: column; } .iq-target small { font-style: italic; color: var(--text-dim); font-size: .72rem; }
.iq-vs { align-self: center; font: 700 .7rem var(--font); letter-spacing: .06em; text-transform: uppercase; color: var(--text-dim); }
.iq-key { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 14px; }
.iq-mystery { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 10px; border-radius: 18px; background: radial-gradient(circle at 50% 30%, rgba(255,255,255,.08), rgba(255,255,255,.02)); border: 1px solid var(--border2); text-align: center; }
.iq-mystery b { font-size: .95rem; } .iq-mystery small { font-size: .74rem; color: var(--text-dim); }
.iq-key-r { display: flex; flex-direction: column; gap: 8px; }
.iq-trail { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.iq-trail li { font-size: .8rem; padding: 5px 9px; border-radius: 10px; background: rgba(61,220,132,.07); border: 1px solid rgba(61,220,132,.25); }
.iq-trail li.bad { background: rgba(255,95,87,.08); border-color: rgba(255,95,87,.35); }
.iq-trail b, .iq-ab b { font-family: var(--mono); color: var(--accent-hi); margin-right: 4px; }
.iq-couplet { display: flex; flex-direction: column; gap: 7px; padding: 12px; border-radius: 16px; background: rgba(74,222,128,.06); border: 1px solid rgba(74,222,128,.3); }
.iq-cq { font: 700 1rem/1.4 var(--font); display: flex; gap: 8px; }
.iq-cn { flex: none; display: inline-grid; place-items: center; min-width: 26px; height: 26px; border-radius: 9px; background: var(--accent); color: var(--on-accent); font: 800 .8rem var(--mono); }
.iq-ab { justify-content: flex-start; text-align: left; white-space: normal; min-height: 46px; }
.iq-key-end { padding: 12px; border-radius: 14px; background: rgba(61,220,132,.1); border: 1px solid rgba(61,220,132,.4); font-size: .92rem; }
.iq-order { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.iq-ord { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 14px; border: 1px solid var(--border2); background: var(--surface2); }
.iq-ord.sel { border-color: var(--accent); background: rgba(74,222,128,.14); }
.iq-ord.ok { border-color: var(--green); background: rgba(61,220,132,.1); } .iq-ord.bad { border-color: var(--red); background: rgba(255,95,87,.1); }
.iq-ord-n { font: 800 .86rem var(--mono); color: var(--accent-hi); width: 22px; text-align: center; }
.iq-ord-b { flex: 1; display: flex; align-items: center; gap: 8px; min-height: 38px; border: 0; background: transparent; color: var(--text); font: 600 .86rem var(--font); text-align: left; cursor: pointer; }
.iq-ord-b small { color: var(--text-dim); font-style: italic; font-weight: 500; }
.iq-ord-mv { display: flex; gap: 4px; }
.iq-mv { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border2); background: rgba(255,255,255,.04); color: var(--text); cursor: pointer; }
.iq-mv[disabled] { opacity: .3; cursor: default; }
.iq-note { font-size: .8rem; color: var(--text-2); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.iq-table-wrap { overflow-x: auto; }
.iq-table { width: 100%; border-collapse: collapse; font-size: .8rem; }
.iq-table th, .iq-table td { padding: 5px 7px; border-bottom: 1px solid var(--border); text-align: center; }
.iq-table th:first-child, .iq-table td:first-child { text-align: left; white-space: nowrap; }
.iq-table td:first-child { display: flex; align-items: center; gap: 6px; }
.iq-table thead th { font: 700 .68rem var(--font); color: var(--text-dim); text-transform: uppercase; letter-spacing: .04em; }
.iq-clado svg { width: 100%; max-width: 560px; height: auto; display: block; margin: 0 auto; }
.iq-acts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.iq-acts #iq-hint, .iq-acts #iq-show, .iq-acts #iq-new { margin-right: auto; }
.iq-acts #iq-show, .iq-acts #iq-new { margin-right: 0; }
.feedback.tip { color: var(--text-2); }
@media (max-width: 1180px) { .pk-dock { grid-template-columns: 1fr 1fr; } }
@media (max-width: 1100px) { .pk-lab { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); } }
@media (max-width: 900px) { .pk-board, .pk-board #tree { min-height: 680px; } .pk-panel { max-height: none; } .iq-key { grid-template-columns: 1fr; } }
@media (max-width: 500px) { .iq-bins.n2 { grid-template-columns: 1fr 1fr; } .pk-lrow { grid-template-columns: 62px minmax(0, 1fr) 70px; } .pk-lbar { display: none; } }
@media (prefers-reduced-transparency: reduce) { .pk-tray, .pk-hud > span { background: #121722; -webkit-backdrop-filter: none; backdrop-filter: none; } }
@media (prefers-reduced-motion: reduce) { .pk-tok.shake, .pk-ab.shake, .iq-ab.shake { animation: none; } }

/* ── phones ── */
@media (max-width: 767px) {
  .pk-strip { margin: 0 -14px 10px; padding: 0 14px 2px; }
  .pk-act { flex: 0 0 170px; min-height: 56px; }
  .pk-board, .pk-board #tree { min-height: 0; }
  .vm-lab.m-bench-main .pk-board { flex: 1 1 auto; height: auto !important; min-height: 0; }
  .pk-board .pk-tray { display: none !important; }
  .pk-board .pk-hud { display: none; }
  .vm-lab.m-observe-main #observe-card { flex: 1 1 auto; min-height: 0; justify-content: flex-start; padding: 6px 2px 0; gap: 8px; overflow: hidden; }
  .vm-lab.m-observe-main .pk-panel { max-height: none; flex: 1 1 auto; padding-bottom: 12px; }
  .pk-obs-tabs .pill { font-size: .7rem; padding: 0 2px; }
  .pk-obs-tabs .pill span[aria-hidden] { display: none; }
  .pk-dock > .pk-animals-panel { display: none; }
  .pk-dock > .pk-animals-panel.m-on { display: flex; }
  .pk-dock > .pk-lab-panel { display: none; }
  body.vm-exp-mode .pk-dock > .pk-lab-panel { display: none; }
  body.vm-exp-mode .pk-dock > .pk-lab-panel.m-on { display: flex; }
  .pk-dock .m-deck-actions .btn { flex: 0 0 auto; min-height: 50px; padding: 0 12px; font-size: .82rem; }
  .pk-abig { width: 74px; height: 74px; } .pk-abig .pk-ic { width: 56px; height: 56px; } .pk-abig .pk-emo { font-size: 46px; }
  .pk-fgrid { grid-template-columns: 1fr; }
  .pk-cmp-pick { grid-template-columns: 1fr; } .pk-swap { justify-self: center; }
  .iq-card { padding: 12px; }
  .iq-lvl { width: calc(20% - 5px); }
  .iq-row { padding-left: 34px; } .iq-card-a { flex: 1 1 calc(50% - 8px); }
  .mission-hud .pk-steps { display: none; }
}

/* ══════════════════════════════════════════════════════════════════════════════
   GAME MODE: Kingdom Quest (arcade.js). A game screen inside the page: HUD, world map, stage boards, overlays.
   Touch first (iPad): every target ≥ 44 px, chips carry touch-action: none so a finger drags them while the page
   still scrolls everywhere else. World colours arrive as --wc / --wc2 on the element that needs them.
   ══════════════════════════════════════════════════════════════════════════════ */
body.pk-game-mode #layout-pills { display: none; }
.gm-banner { display: flex; align-items: center; gap: 14px; margin: 0 0 12px; padding: 12px 16px; border-radius: 18px;
  background: linear-gradient(120deg, rgba(74,222,128,.14), rgba(56,189,248,.10) 60%, rgba(251,191,36,.10)); border: 1px solid var(--border); }
.gm-banner-art { font-size: 34px; line-height: 1; filter: drop-shadow(0 4px 10px rgba(0,0,0,.4)); }
.gm-banner h2 { font-size: 1.15rem; font-weight: 800; letter-spacing: -.01em; margin-bottom: 3px; }
.gm-banner p { color: var(--text-2); font-size: .9rem; line-height: 1.45; }
.gm { position: relative; border-radius: 24px; padding: 14px; min-height: 620px; margin-bottom: 14px; overflow: hidden;
  background: radial-gradient(120% 70% at 0% 0%, rgba(74,222,128,.10), transparent 55%), radial-gradient(90% 70% at 100% 100%, rgba(56,189,248,.10), transparent 60%), #0e1320;
  border: 1px solid var(--border2); box-shadow: 0 20px 60px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.05); }
.gm button { font: inherit; color: inherit; }
.gm .pk-ic { pointer-events: none; }

/* HUD */
.gm-hud { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 8px 10px; margin-bottom: 12px;
  border-radius: 18px; background: rgba(255,255,255,.04); border: 1px solid var(--border); }
.gm-avatar { width: 52px; height: 52px; border-radius: 50%; font-size: 30px; line-height: 1; display: grid; place-items: center; cursor: pointer;
  background: radial-gradient(circle at 35% 30%, #2b3550, #161c2b); border: 2px solid rgba(74,222,128,.55); box-shadow: 0 4px 14px rgba(74,222,128,.25); transition: transform .15s var(--ease); }
.gm-avatar:hover { transform: scale(1.06) rotate(-4deg); }
.gm-who { min-width: 0; display: grid; gap: 2px; }
.gm-who > b { font-size: 1rem; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gm-who > span { font-size: .78rem; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gm-xp { position: relative; height: 16px; border-radius: 99px; background: rgba(255,255,255,.07); overflow: hidden; margin-top: 2px; max-width: 360px; }
.gm-xp i { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: linear-gradient(90deg, #4ade80, #fbbf24); box-shadow: 0 0 12px rgba(251,191,36,.5); transition: width .8s var(--ease); }
.gm-xp em { position: relative; display: block; font-style: normal; font-size: .66rem; font-weight: 700; line-height: 16px; padding-left: 8px; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.7); white-space: nowrap; }
.gm-nav { display: flex; gap: 6px; }
.gm-nb { display: grid; justify-items: center; gap: 1px; min-width: 64px; min-height: 52px; padding: 5px 8px; border-radius: 14px; cursor: pointer; background: rgba(255,255,255,.04); border: 1px solid var(--border); transition: background .15s, border-color .15s, transform .12s var(--ease); }
.gm-nb span { font-size: 19px; line-height: 1; } .gm-nb em { font-style: normal; font-size: .7rem; font-weight: 700; color: var(--text-2); } .gm-nb b { font-size: .64rem; color: var(--gold); font-weight: 800; }
.gm-nb:hover { background: rgba(255,255,255,.08); } .gm-nb.on { background: rgba(74,222,128,.16); border-color: rgba(74,222,128,.5); } .gm-nb.on em { color: var(--text); }
.gm-tally { display: flex; align-items: center; gap: 6px; }
.gm-tally > span { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; padding: 0 10px; border-radius: 12px; background: rgba(255,255,255,.04); border: 1px solid var(--border); font-size: .8rem; color: var(--text-2); }
.gm-tally > span i { font-style: normal; } .gm-tally > span b { color: var(--text); font-size: .95rem; }
.gm-snd { width: 44px; height: 44px; border-radius: 12px; cursor: pointer; background: rgba(255,255,255,.04); border: 1px solid var(--border); font-size: 18px; }

/* MAP */
.gm-worlds { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.gm-wtab { display: flex; align-items: center; gap: 10px; min-height: 66px; padding: 8px 12px; border-radius: 16px; text-align: left; cursor: pointer;
  background: linear-gradient(135deg, color-mix(in srgb, var(--wc) 16%, transparent), rgba(255,255,255,.02)); border: 1px solid color-mix(in srgb, var(--wc) 30%, transparent); transition: transform .15s var(--ease), background .15s, box-shadow .2s; }
.gm-wtab:hover { transform: translateY(-1px); }
.gm-wtab.on { background: linear-gradient(135deg, color-mix(in srgb, var(--wc) 38%, transparent), color-mix(in srgb, var(--wc2) 18%, transparent)); border-color: var(--wc); box-shadow: 0 6px 22px color-mix(in srgb, var(--wc) 30%, transparent); }
.gm-wtab.locked { filter: saturate(.3); opacity: .7; }
.gm-wemo { font-size: 28px; line-height: 1; }
.gm-wt { display: grid; min-width: 0; } .gm-wt small { font-size: .66rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-2); }
.gm-wt b { font-size: .95rem; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .gm-wt em { font-style: normal; font-size: .74rem; color: var(--gold); font-weight: 700; }
.gm-world { position: relative; border-radius: 22px; padding: 16px 18px 20px; overflow: hidden;
  background: radial-gradient(90% 120% at 10% 0%, color-mix(in srgb, var(--wc) 26%, transparent), transparent 60%), radial-gradient(80% 90% at 100% 100%, color-mix(in srgb, var(--wc2) 22%, transparent), transparent 60%), rgba(255,255,255,.025);
  border: 1px solid color-mix(in srgb, var(--wc) 35%, transparent); }
.gm-whead { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.gm-tier { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: .7rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #0b0e14; background: var(--wc); }
.gm-whead h3 { font-size: 1.3rem; font-weight: 800; letter-spacing: -.02em; margin: 6px 0 3px; }
.gm-whead p { color: var(--text-2); font-size: .9rem; max-width: 62ch; line-height: 1.45; }
.gm-wlock { padding: 8px 12px; border-radius: 12px; background: rgba(0,0,0,.3); font-size: .85rem; color: var(--text-2); }
.gm-path { list-style: none; position: relative; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin-top: 18px; padding: 10px 0 4px; }
.gm-path::before { content: ''; position: absolute; left: 10%; right: 10%; top: 58px; height: 4px; border-radius: 4px; background: repeating-linear-gradient(90deg, color-mix(in srgb, var(--wc) 60%, transparent) 0 14px, transparent 14px 24px); }
.gm-node { position: relative; display: flex; justify-content: center; transform: translateY(calc(sin(var(--i) * 1.6rad) * 14px)); }
.gm-node > button { display: grid; justify-items: center; gap: 6px; background: none; border: 0; cursor: pointer; padding: 4px; border-radius: 18px; min-width: 0; width: 100%; }
.gm-ndot { position: relative; width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; font-size: 40px; line-height: 1;
  background: radial-gradient(circle at 35% 28%, color-mix(in srgb, var(--wc) 85%, #fff), var(--wc2)); border: 4px solid rgba(255,255,255,.18);
  box-shadow: 0 10px 24px rgba(0,0,0,.45), inset 0 -6px 0 rgba(0,0,0,.18), inset 0 4px 0 rgba(255,255,255,.25); transition: transform .18s var(--ease), box-shadow .2s; }
.gm-node > button:hover .gm-ndot, .gm-node > button:focus-visible .gm-ndot { transform: translateY(-3px) scale(1.05); }
.gm-node.boss .gm-ndot { width: 108px; height: 108px; font-size: 46px; border-color: rgba(251,191,36,.7); }
.gm-crown { position: absolute; top: -16px; right: -6px; font-size: 26px; font-style: normal; filter: drop-shadow(0 2px 4px rgba(0,0,0,.6)); }
.gm-node.done .gm-ndot { border-color: #f5c842; }
.gm-node.next .gm-ndot { animation: gm-pulse 1.6s ease-in-out infinite; }
@keyframes gm-pulse { 0%, 100% { box-shadow: 0 10px 24px rgba(0,0,0,.45), 0 0 0 0 color-mix(in srgb, var(--wc) 60%, transparent); } 50% { box-shadow: 0 10px 24px rgba(0,0,0,.45), 0 0 0 12px transparent; } }
.gm-node.locked .gm-ndot { background: radial-gradient(circle at 35% 28%, #3a4258, #1d2333); border-color: rgba(255,255,255,.08); font-size: 30px; filter: saturate(.2); }
.gm-node.locked > button { cursor: not-allowed; }
.gm-nlab { display: grid; justify-items: center; text-align: center; gap: 1px; } .gm-nlab small { font-size: .66rem; font-weight: 800; letter-spacing: .05em; color: var(--text-2); text-transform: uppercase; }
.gm-nlab b { font-size: .86rem; font-weight: 800; line-height: 1.2; }
.gm-stars { display: inline-flex; gap: 1px; font-size: 1rem; letter-spacing: 0; } .gm-stars i { font-style: normal; color: rgba(255,255,255,.18); } .gm-stars i.on { color: var(--gold); text-shadow: 0 0 8px rgba(245,200,66,.6); }
.gm-row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin-top: 12px; align-items: start; }
.gm-daily { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; background: linear-gradient(120deg, rgba(45,212,191,.16), rgba(45,212,191,.04)); border: 1px solid rgba(45,212,191,.35); }
.gm-daily.done { filter: saturate(.6); }
.gm-demo { font-size: 32px; line-height: 1; } .gm-daily > div { flex: 1; min-width: 0; } .gm-daily b { font-size: 1rem; } .gm-daily p { color: var(--text-2); font-size: .82rem; line-height: 1.4; }
.gm-teach { border-radius: 18px; background: rgba(255,255,255,.03); border: 1px solid var(--border); padding: 0 14px; }
.gm-teach summary { cursor: pointer; min-height: 48px; display: flex; align-items: center; font-weight: 700; font-size: .9rem; }
.gm-teach > div { display: grid; gap: 10px; padding: 0 0 14px; font-size: .85rem; color: var(--text-2); line-height: 1.5; }
.gm-teach code { font-family: var(--mono); font-size: .8rem; color: var(--text); }
.gm-teach .btn { justify-self: start; }

/* STAGE */
.gm-top { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.gm-back { min-height: 44px; padding: 0 14px; border-radius: 12px; cursor: pointer; background: rgba(255,255,255,.05); border: 1px solid var(--border); font-weight: 700; }
.gm-ttl { display: grid; min-width: 0; } .gm-ttl small { font-size: .7rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--wc); }
.gm-ttl b { font-size: 1.15rem; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gm-meters { display: flex; align-items: center; gap: 6px; }
.gm-meters > span { display: inline-flex; align-items: center; gap: 2px; min-height: 40px; padding: 0 10px; border-radius: 12px; background: rgba(255,255,255,.05); border: 1px solid var(--border); font-weight: 800; font-size: .9rem; font-variant-numeric: tabular-nums; }
.gm-hearts i { font-style: normal; font-size: 18px; transition: transform .3s var(--ease); } .gm-hearts i:not(.on) { opacity: .5; transform: scale(.85); }
.gm-combo.hot { color: #fff; background: linear-gradient(135deg, #f97316, #ef4444); border-color: transparent; animation: gm-bump .4s var(--ease); }
@keyframes gm-bump { 0% { transform: scale(1); } 40% { transform: scale(1.18); } 100% { transform: scale(1); } }
.gm-prog { height: 8px; border-radius: 99px; background: rgba(255,255,255,.07); margin: 10px 0 8px; overflow: hidden; }
.gm-prog i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--wc), color-mix(in srgb, var(--wc) 50%, #fff)); transition: width .5s var(--ease); }
.gm-goal { color: var(--text-2); font-size: .92rem; line-height: 1.45; margin-bottom: 10px; }
.gm-board { min-height: 380px; }
.gm-foot { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-top: 12px; }
.gm-feed { flex: 1; min-height: 48px; padding: 10px 14px; border-radius: 14px; font-size: .9rem; line-height: 1.45; background: rgba(255,255,255,.035); border: 1px solid var(--border); color: var(--text-2); }
.gm-feed:empty::before { content: 'Feedback appears here.'; color: var(--text-dim); }
.gm-feed.ok { color: #d6ffe6; background: rgba(61,220,132,.12); border-color: rgba(61,220,132,.4); }
.gm-feed.bad { color: #ffe1df; background: rgba(255,95,87,.12); border-color: rgba(255,95,87,.4); }
.gm-feed.tip { color: #fff3c4; background: rgba(245,200,66,.1); border-color: rgba(245,200,66,.35); }
.gm-facts { display: flex; gap: 6px; flex: none; }

/* chips (also styled outside .gm: the drag ghost lives on <body>) */
.gm-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 54px; padding: 6px 12px 6px 8px; border-radius: 14px; cursor: grab; text-align: left; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  background: linear-gradient(180deg, #232c41, #1a2132); border: 1px solid rgba(255,255,255,.14); color: var(--text); box-shadow: 0 4px 12px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.06); transition: transform .12s var(--ease), box-shadow .15s, opacity .15s; font: inherit; }
.gm-chip .pk-ic { width: 38px; height: 38px; } .gm-chip .pk-emo { font-size: 30px; }
.gm-chip > span { display: grid; min-width: 0; } .gm-chip b { font-size: .88rem; font-weight: 700; line-height: 1.2; } .gm-chip small { font-size: .72rem; color: var(--text-2); line-height: 1.25; }
.gm-chip:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(0,0,0,.4); }
.gm-chip[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(74,222,128,.35), 0 8px 18px rgba(0,0,0,.4); transform: translateY(-2px); }
.gm-chip.txt { padding: 8px 14px; max-width: 320px; } .gm-chip.txt b { font-weight: 600; }
.gm-chip.sci b, .gm-pc.sci, .sci { font-style: italic; }
.gm-chip.lifted { opacity: .3; }
.gm-chip.shake, .gm-ab.shake { animation: gm-shake .42s; }
@keyframes gm-shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
.gm-ghost { position: fixed !important; z-index: 10000; pointer-events: none; transform: rotate(-3deg) scale(1.07); box-shadow: 0 18px 40px rgba(0,0,0,.55) !important; opacity: .96; margin: 0; }
.gm-chip.grp .gm-gemo { font-size: 26px; line-height: 1; font-family: "Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif; }
.gm-tray { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px; min-height: 80px; border-radius: 18px; background: rgba(0,0,0,.22); border: 1px solid var(--border); margin-bottom: 12px; align-items: center; }
.gm-empty { color: var(--text-2); font-weight: 700; padding: 0 6px; }

/* bins */
.gm-bins { display: grid; gap: 10px; grid-template-columns: repeat(var(--cols, 5), minmax(0, 1fr)); }
.gm-bins.n2 { --cols: 2; } .gm-bins.n3 { --cols: 3; } .gm-bins.n4 { --cols: 4; } .gm-bins.n5 { --cols: 5; } .gm-bins.n6 { --cols: 3; }
.gm-bin { display: flex; flex-direction: column; gap: 8px; min-height: 160px; padding: 10px; border-radius: 18px; cursor: pointer;
  background: rgba(255,255,255,.03); border: 2px dashed rgba(255,255,255,.16); transition: background .15s, border-color .15s, box-shadow .2s, transform .15s var(--ease); }
.gm-bin:hover { background: rgba(255,255,255,.05); }
.gm-bin.over, [data-drop].over { border-style: solid; border-color: var(--accent); background: rgba(74,222,128,.12); box-shadow: 0 0 0 4px rgba(74,222,128,.2); transform: scale(1.02); }
.hinted { animation: gm-hint 0.9s ease-in-out 2; border-color: var(--gold) !important; }
@keyframes gm-hint { 50% { box-shadow: 0 0 0 6px rgba(245,200,66,.45); } }
.gm-bh { display: flex; align-items: center; gap: 8px; } .gm-bh > span:not(.pk-ic):not(.gm-bemoji) { display: grid; min-width: 0; flex: 1; }
.gm-bh b { font-size: .95rem; font-weight: 800; line-height: 1.15; } .gm-bh small { font-size: .72rem; color: var(--text-2); }
.gm-bh em { font-style: normal; min-width: 28px; height: 28px; border-radius: 99px; display: grid; place-items: center; font-size: .78rem; font-weight: 800; background: rgba(255,255,255,.08); }
.gm-bemoji { font-size: 28px; line-height: 1; font-family: "Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif; }
.gm-bin-in { display: flex; flex-wrap: wrap; gap: 5px; align-content: flex-start; }
.gm-pc { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px 3px 4px; border-radius: 99px; background: rgba(61,220,132,.14); border: 1px solid rgba(61,220,132,.35); font-size: .76rem; font-weight: 600; animation: gm-pop .35s var(--ease); }
.gm-pc .pk-ic { width: 24px; height: 24px; } .gm-pc .pk-emo { font-size: 19px; } .gm-pc.txt { padding: 4px 10px; border-radius: 10px; }
.gm-pc.focal { background: rgba(245,200,66,.16); border-color: rgba(245,200,66,.5); animation: none; }
@keyframes gm-pop { 0% { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.12); } 100% { transform: scale(1); opacity: 1; } }
.gm-m-myth .gm-bin, .gm-m-name .gm-bin { min-height: 130px; }
.gm-m-name .gm-bins { --cols: 5; }

/* nested boxes */
.gm-nest { position: relative; padding: 34px 12px 12px; border-radius: 20px; cursor: pointer; border: 2px solid; transition: box-shadow .2s, background .15s; }
.gm-nest.d0 { border-color: #64748b; background: rgba(100,116,139,.08); } .gm-nest.d1 { border-color: #38bdf8; background: rgba(56,189,248,.07); }
.gm-nest.d2 { border-color: #a78bfa; background: rgba(167,139,250,.08); } .gm-nest.d3 { border-color: #f472b6; background: rgba(244,114,182,.08); } .gm-nest.d4 { border-color: #fbbf24; background: rgba(251,191,36,.1); }
.gm-nest + .gm-nest, .gm-nin + .gm-nest { margin-top: 10px; }
.gm-nl { position: absolute; left: 12px; top: 7px; display: flex; gap: 6px; align-items: baseline; pointer-events: none; }
.gm-nl small { font-size: .66rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); } .gm-nl b { font-size: .9rem; font-weight: 800; }
.gm-nin { display: flex; flex-wrap: wrap; gap: 5px; min-height: 34px; align-items: center; }
.gm-nest.over { box-shadow: 0 0 0 5px rgba(74,222,128,.3); transform: none; }

/* clue detective */
.gm-clue { display: grid; grid-template-columns: minmax(200px, 280px) minmax(0, 1fr); gap: 14px; }
.gm-myst { display: grid; justify-items: center; align-content: center; gap: 6px; padding: 18px; border-radius: 22px; text-align: center;
  background: radial-gradient(circle at 50% 35%, rgba(255,255,255,.08), transparent 65%), #141a29; border: 2px solid rgba(255,255,255,.1); }
.gm-mpic { position: relative; display: grid; place-items: center; width: 150px; height: 150px; }
.gm-mpic .pk-ic { width: 130px; height: 130px; } .gm-mpic .pk-emo { font-size: 104px; }
.gm-myst:not(.open) .gm-mpic .pk-ic { filter: brightness(0) invert(.2); }
.gm-q { position: absolute; font-size: 64px; font-weight: 900; color: var(--gold); text-shadow: 0 4px 18px rgba(0,0,0,.6); }
.gm-myst.open { border-color: rgba(61,220,132,.5); animation: gm-pop .45s var(--ease); } .gm-myst b { font-size: 1.05rem; } .gm-myst i { color: var(--text-2); }
.gm-cside { display: grid; gap: 10px; align-content: start; }
.gm-clues { list-style: none; display: grid; gap: 6px; }
.gm-clues li { display: flex; gap: 10px; align-items: flex-start; padding: 9px 12px; border-radius: 12px; font-size: .9rem; line-height: 1.4; background: rgba(255,255,255,.04); border: 1px solid var(--border); }
.gm-clues li span { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; font-weight: 800; background: var(--gold); color: #1a1300; }
.gm-clues li.off { color: var(--text-dim); } .gm-clues li.off span { background: rgba(255,255,255,.1); color: var(--text-dim); }
.gm-clues li.new { animation: gm-slide .4s var(--ease); }
@keyframes gm-slide { from { transform: translateX(-12px); opacity: 0; } to { transform: none; opacity: 1; } }
.gm-cbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; } .gm-worth { color: var(--text-2); font-size: .88rem; } .gm-worth b { color: var(--gold); font-size: 1.1rem; }
.gm-opts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.gm-opt { display: grid; justify-items: center; gap: 4px; min-height: 76px; padding: 8px; border-radius: 16px; cursor: pointer; font-weight: 700; font-size: .88rem;
  background: linear-gradient(180deg, #232c41, #1a2132); border: 1px solid rgba(255,255,255,.14); transition: transform .12s var(--ease), border-color .15s, background .15s; }
.gm-opt span { font-size: 28px; line-height: 1; font-family: "Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif; }
.gm-opt:hover:not(:disabled) { transform: translateY(-2px); border-color: rgba(74,222,128,.5); }
.gm-opt.right, .gm-cop.right, .gm-ropt.right { background: rgba(61,220,132,.2); border-color: var(--green); }
.gm-opt.wrong, .gm-cop.wrong, .gm-ropt.wrong { background: rgba(255,95,87,.2); border-color: var(--red); }
.gm-cnext { display: flex; justify-content: flex-end; }

/* key runner */
.gm-key { display: grid; grid-template-columns: minmax(200px, 260px) minmax(0, 1fr); gap: 14px; }
.gm-kcard { display: grid; justify-items: center; align-content: center; gap: 6px; padding: 18px; border-radius: 22px; text-align: center; background: #141a29; border: 2px solid rgba(255,255,255,.1); }
.gm-kcard .pk-ic { width: 120px; height: 120px; } .gm-kcard .pk-emo { font-size: 96px; } .gm-kcard b { font-size: 1.1rem; } .gm-kcard small { color: var(--text-2); font-size: .8rem; }
.gm-kn { font-size: .7rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--wc, var(--accent)); }
.gm-kside { display: grid; gap: 10px; align-content: start; }
.gm-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: .9rem; color: var(--text-2); } .gm-left > b { font-size: 1.6rem; color: var(--text); font-weight: 900; }
.gm-dots { display: flex; gap: 4px; flex-wrap: wrap; } .gm-dots i { width: 13px; height: 13px; border-radius: 50%; background: var(--g); opacity: .14; transition: opacity .35s, transform .35s var(--ease); } .gm-dots i.on { opacity: 1; transform: scale(1.1); }
.gm-trail { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; } .gm-trail li { padding: 4px 10px; border-radius: 99px; font-size: .78rem; background: rgba(61,220,132,.12); border: 1px solid rgba(61,220,132,.35); } .gm-trail li.bad { background: rgba(245,200,66,.1); border-color: rgba(245,200,66,.35); }
.gm-couplet { display: grid; gap: 8px; padding: 14px; border-radius: 18px; background: rgba(255,255,255,.035); border: 1px solid var(--border); }
.gm-couplet p { display: flex; gap: 10px; align-items: center; font-weight: 800; font-size: 1.02rem; } .gm-couplet p span { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); font-size: .9rem; }
.gm-ab { display: flex; gap: 10px; align-items: center; min-height: 58px; padding: 10px 14px; border-radius: 14px; cursor: pointer; text-align: left; font-size: .95rem;
  background: linear-gradient(180deg, #232c41, #1a2132); border: 1px solid rgba(255,255,255,.14); transition: transform .12s var(--ease), border-color .15s; }
.gm-ab b { flex: none; min-width: 34px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: rgba(255,255,255,.1); font-size: .85rem; }
.gm-ab:hover { transform: translateX(3px); border-color: rgba(74,222,128,.5); }
.gm-kend { display: grid; gap: 10px; justify-items: start; padding: 14px; border-radius: 18px; background: rgba(61,220,132,.12); border: 1px solid rgba(61,220,132,.4); font-size: 1rem; animation: gm-pop .4s var(--ease); }

/* rank tower */
.gm-tower { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.gm-twho { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; } .gm-twho > span { display: grid; } .gm-twho b { font-size: 1.05rem; } .gm-twho small { color: var(--text-2); font-size: .78rem; }
.gm-slots { list-style: none; display: grid; gap: 6px; justify-items: center; }
.gm-slot { width: var(--w); display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: center; min-height: 52px; border-radius: 12px; cursor: pointer; overflow: hidden;
  background: rgba(255,255,255,.03); border: 2px dashed rgba(255,255,255,.18); transition: background .15s, border-color .15s, box-shadow .2s; }
.gm-rk { align-self: stretch; display: grid; place-items: center; font-size: .74rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: #0b0e14; background: linear-gradient(180deg, #c4b5fd, #8b5cf6); }
.gm-rv { padding: 0 12px; font-weight: 700; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gm-slot.full { border-style: solid; border-color: rgba(61,220,132,.5); background: rgba(61,220,132,.1); } .gm-slot.full .gm-rv { animation: gm-pop .35s var(--ease); }
.gm-pile-h { font-weight: 700; font-size: .9rem; margin-bottom: 8px; } .gm-pile-h small { font-weight: 400; color: var(--text-2); }
.gm-tiles { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; min-height: 60px; }
.gm-decoy { min-height: 64px; flex-direction: row; align-items: center; justify-content: center; gap: 8px; font-weight: 700; } .gm-decoy small { font-weight: 400; color: var(--text-2); }
.gm-twdone { display: grid; gap: 10px; justify-items: start; margin-top: 10px; padding: 14px; border-radius: 16px; background: rgba(61,220,132,.12); border: 1px solid rgba(61,220,132,.4); font-size: 1.05rem; animation: gm-pop .4s var(--ease); }

/* cousin finder */
.gm-cousin { display: grid; gap: 12px; }
.gm-ctarget { display: grid; justify-items: center; gap: 4px; padding: 12px; border-radius: 22px; background: #141a29; border: 2px solid rgba(255,255,255,.1); text-align: center; }
.gm-ctarget .pk-ic { width: 96px; height: 96px; } .gm-ctarget .pk-emo { font-size: 78px; } .gm-ctarget b { font-size: 1.15rem; } .gm-ctarget i { color: var(--text-2); } .gm-ctarget small { color: var(--text-dim); font-size: .75rem; }
.gm-copts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.gm-cop { display: grid; justify-items: center; gap: 4px; padding: 14px 10px; min-height: 150px; border-radius: 18px; cursor: pointer; text-align: center;
  background: linear-gradient(180deg, #232c41, #1a2132); border: 2px solid rgba(255,255,255,.12); transition: transform .12s var(--ease), border-color .15s, opacity .2s; }
.gm-cop:hover:not(:disabled) { transform: translateY(-3px); border-color: rgba(74,222,128,.5); } .gm-cop i { color: var(--text-2); font-size: .82rem; } .gm-cop.dim { opacity: .6; }
.gm-meter { display: flex; gap: 3px; margin-top: 4px; } .gm-meter em { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; font-style: normal; font-size: .64rem; font-weight: 800; background: rgba(255,255,255,.07); color: var(--text-dim); }
.gm-meter em.on { background: var(--gold); color: #1a1300; } .gm-cop small { font-size: .75rem; color: var(--text-2); }

/* character matrix */
.gm-matrix { display: grid; gap: 12px; }
.gm-mscroll { overflow-x: auto; }
.gm-mtab { border-collapse: separate; border-spacing: 5px; margin: 0 auto; }
.gm-mtab thead th { font-size: .74rem; font-weight: 800; color: var(--text-2); vertical-align: bottom; padding: 0 2px 4px; max-width: 92px; line-height: 1.2; }
.gm-mtab tbody th { text-align: left; white-space: nowrap; padding-right: 8px; font-size: .9rem; } .gm-mtab tbody th > * { vertical-align: middle; } .gm-mtab tbody th span:last-child { margin-left: 6px; }
.gm-cell { width: 64px; height: 52px; border-radius: 12px; cursor: pointer; font-size: 1.35rem; font-weight: 900; background: rgba(255,255,255,.04); border: 2px solid rgba(255,255,255,.14); transition: background .12s, border-color .12s, transform .1s; }
.gm-cell.yes { background: rgba(61,220,132,.18); border-color: rgba(61,220,132,.55); color: #b9ffd5; } .gm-cell.no { background: rgba(148,163,184,.1); color: var(--text-2); }
.gm-cell.bad { border-color: var(--red); box-shadow: 0 0 0 3px rgba(255,95,87,.35); } .gm-cell.good { border-color: var(--green); }
.gm-cell:active { transform: scale(.94); }
.gm-mbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--text-2); font-size: .88rem; }
.gm-clado { display: grid; gap: 10px; justify-items: center; animation: gm-pop .5s var(--ease); }
.gm-csvg { width: 100%; max-width: 680px; height: auto; } .gm-csvg .sp, .gm-csvg .br { stroke: var(--gold); stroke-width: 3; stroke-linecap: round; } .gm-csvg .nd { fill: #fff; }
.gm-csvg .tx { fill: var(--text); font: 700 15px var(--font); } .gm-csvg .ch { fill: var(--gold); font: 600 12px var(--font); }

/* key architect */
.gm-kb { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.gm-kbtree { overflow-x: auto; padding-bottom: 4px; }
.gm-kbn { display: grid; gap: 6px; justify-items: center; }
.gm-kbbox { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; padding: 8px; border-radius: 14px; background: rgba(255,255,255,.04); border: 2px solid rgba(255,255,255,.12); max-width: 100%; }
.gm-kbbox > span { display: grid; justify-items: center; font-size: .66rem; color: var(--text-2); max-width: 64px; text-align: center; line-height: 1.15; } .gm-kbbox .pk-ic { width: 34px; height: 34px; } .gm-kbbox .pk-emo { font-size: 27px; } .gm-kbbox em { font-style: normal; }
.gm-kbn.on > .gm-kbbox { border-color: var(--gold); background: rgba(245,200,66,.1); box-shadow: 0 0 0 4px rgba(245,200,66,.18); animation: gm-hint 1.4s ease-in-out infinite; }
.gm-kbn.end > .gm-kbbox { border-color: rgba(61,220,132,.55); background: rgba(61,220,132,.1); }
.gm-kbq { font-size: .8rem; font-weight: 700; padding: 5px 10px; border-radius: 99px; background: rgba(74,222,128,.18); border: 1px solid rgba(74,222,128,.4); text-align: center; }
.gm-kbkids { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; } .gm-kbkids > div { display: grid; gap: 4px; justify-items: center; align-content: start; }
.gm-kbkids b { font-size: .68rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; } .gm-kbkids b.y { color: var(--green); } .gm-kbkids b.n { color: var(--red); }
.gm-kbq-list p { font-size: .9rem; margin-bottom: 8px; color: var(--text-2); } .gm-kbq-list p b { color: var(--gold); }
.gm-qs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.gm-qb { min-height: 48px; padding: 6px 10px; border-radius: 12px; cursor: pointer; text-align: left; font-size: .82rem; line-height: 1.25; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.14); transition: border-color .15s, background .15s; }
.gm-qb:hover { border-color: rgba(74,222,128,.5); background: rgba(74,222,128,.08); }

/* tree builder */
.gm-tree { display: grid; gap: 12px; }
.gm-tstage { position: relative; min-height: 300px; border-radius: 18px; background: rgba(0,0,0,.2); border: 1px solid var(--border); }
.gm-tsvg { position: absolute; inset: 0; width: 100%; height: 100%; } .gm-tsvg line { stroke: var(--gold); stroke-width: 3; vector-effect: non-scaling-stroke; stroke-linecap: round; } .gm-tsvg circle { fill: #fff; }
.gm-tlab { position: absolute; transform: translateY(calc(-100% - 3px)); padding: 0 6px; font-size: .68rem; font-weight: 700; line-height: 1.2; color: #ffe9a8; text-align: center; pointer-events: none; text-shadow: 0 1px 3px rgba(0,0,0,.8); }
.gm-tlab.root { text-align: left; color: var(--text-2); }
.gm-tslot { position: absolute; transform: translate(4px, -50%); width: calc(30% - 12px); min-height: 46px; display: flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 12px; cursor: pointer; font-size: .85rem; font-weight: 700; color: var(--text-dim);
  background: rgba(255,255,255,.03); border: 2px dashed rgba(255,255,255,.2); transition: background .15s, border-color .15s, box-shadow .2s; }
.gm-tslot span { font-size: 22px; font-family: "Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif; }
.gm-tslot.full { color: var(--text); border-style: solid; border-color: rgba(61,220,132,.55); background: rgba(61,220,132,.12); animation: gm-pop .35s var(--ease); }
.gm-ttiles { margin-bottom: 0; }

/* boss rush */
.gm-rush { display: grid; gap: 14px; justify-items: center; }
.gm-rhead { display: flex; align-items: center; justify-content: space-between; width: 100%; max-width: 760px; }
.gm-rn { font-weight: 800; color: var(--text-2); font-size: .9rem; }
.gm-timer { position: relative; width: 58px; height: 58px; display: grid; place-items: center; }
.gm-timer svg { position: absolute; inset: 0; transform: rotate(-90deg); } .gm-timer circle { fill: none; stroke-width: 4; } .gm-timer .bg { stroke: rgba(255,255,255,.1); }
.gm-timer .fg { stroke: var(--teal); stroke-linecap: round; stroke-dasharray: 106.8; } .gm-timer b { font-size: 1.2rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.gm-timer.low .fg { stroke: var(--red); } .gm-timer.low b { color: var(--red); animation: gm-bump .5s infinite; }
.gm-rcard { display: grid; justify-items: center; gap: 6px; width: min(100%, 420px); padding: 18px 20px; border-radius: 26px; text-align: center; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none;
  background: radial-gradient(circle at 50% 30%, rgba(255,255,255,.1), transparent 60%), linear-gradient(180deg, #26304a, #182033); border: 2px solid rgba(255,255,255,.18); box-shadow: 0 18px 40px rgba(0,0,0,.45); animation: gm-deal .4s var(--ease); }
@keyframes gm-deal { from { transform: translateY(24px) rotate(4deg) scale(.92); opacity: 0; } to { transform: none; opacity: 1; } }
.gm-rcard small { font-size: .75rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--gold); }
.gm-rcard .pk-ic { width: 110px; height: 110px; } .gm-rcard .pk-emo { font-size: 88px; } .gm-rcard > b { font-size: 1.25rem; font-weight: 800; } .gm-rcard > i { color: var(--text-2); font-size: .85rem; }
.gm-rcard.lock { cursor: default; }
.gm-rt { font-size: 1.15rem; font-weight: 700; line-height: 1.35; max-width: 34ch; }
.gm-ropts { display: grid; gap: 10px; width: 100%; max-width: 900px; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); }
.gm-ropts.n2 { --cols: 2; } .gm-ropts.n3 { --cols: 3; } .gm-ropts.n4 { --cols: 4; } .gm-ropts.n5 { --cols: 5; }
.gm-ropt { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 78px; padding: 10px; border-radius: 18px; cursor: pointer; font-weight: 800; font-size: .95rem; text-align: center;
  background: linear-gradient(180deg, #232c41, #1a2132); border: 2px solid rgba(255,255,255,.14); transition: transform .12s var(--ease), border-color .15s, background .15s, opacity .2s; }
.gm-ropt > span:first-child:not(:last-child) { font-size: 28px; line-height: 1; font-family: "Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif; }
.gm-ropt span small { display: block; font-size: .7rem; font-weight: 600; color: var(--text-2); }
.gm-ropt .pk-ic { width: 36px; height: 36px; } .gm-ropt .pk-emo { font-size: 28px; }
.gm-ropt:hover:not(:disabled) { transform: translateY(-2px); border-color: rgba(74,222,128,.5); } .gm-ropt.dim { opacity: .45; }
.gm-ropt.sci span { font-style: italic; font-weight: 700; }

/* overlay: brief, result, profile */
.gm-ov { position: fixed; inset: 0; z-index: 900; display: grid; place-items: center; padding: 16px; background: rgba(5,8,14,.72); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); animation: gm-fade .2s ease; overflow-y: auto; }
@keyframes gm-fade { from { opacity: 0; } }
.gm-ovbox { width: min(640px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; border-radius: 26px; background: #121827; border: 1px solid var(--border2); box-shadow: 0 30px 80px rgba(0,0,0,.6); animation: gm-rise .35s var(--ease); }
@keyframes gm-rise { from { transform: translateY(24px) scale(.97); opacity: 0; } }
.gm-brief, .gm-result, .gm-prof { padding: 20px 22px 18px; }
.gm-bhead { display: flex; gap: 14px; align-items: center; margin: -20px -22px 14px; padding: 20px 22px 16px; background: linear-gradient(120deg, color-mix(in srgb, var(--wc) 34%, transparent), color-mix(in srgb, var(--wc2) 16%, transparent)); border-bottom: 1px solid var(--border); }
.gm-bemo { width: 76px; height: 76px; flex: none; display: grid; place-items: center; font-size: 44px; border-radius: 22px; background: rgba(0,0,0,.25); }
.gm-bhead small { font-size: .7rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--text-2); }
.gm-bhead h2 { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; margin: 2px 0 6px; }
.gm-bloom, .gm-bbest { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 99px; font-size: .75rem; font-weight: 700; background: rgba(0,0,0,.3); }
.gm-bdl { display: grid; gap: 10px; } .gm-bdl div { display: grid; gap: 2px; } .gm-bdl dt { font-size: .76rem; font-weight: 800; letter-spacing: .03em; color: var(--wc); } .gm-bdl dd { font-size: .95rem; line-height: 1.5; color: var(--text); }
.gm-bacts { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.gm-bacts .btn { min-height: 46px; }
.gm-result { text-align: center; } .gm-result > small { font-size: .72rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--wc); }
.gm-result h2 { font-size: 1.7rem; font-weight: 900; letter-spacing: -.02em; margin: 4px 0 6px; }
.gm-rstars { display: flex; justify-content: center; gap: 10px; margin: 4px 0 12px; }
.gm-rstars span { font-size: 54px; line-height: 1; color: rgba(255,255,255,.12); }
.gm-rstars span.on { color: var(--gold); text-shadow: 0 0 22px rgba(245,200,66,.7); animation: gm-star .6s var(--ease) both; animation-delay: var(--d); }
@keyframes gm-star { 0% { transform: scale(0) rotate(-40deg); opacity: 0; } 70% { transform: scale(1.3) rotate(8deg); opacity: 1; } 100% { transform: scale(1) rotate(0); } }
.gm-rstats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.gm-rstats div { display: grid; padding: 10px 6px; border-radius: 14px; background: rgba(255,255,255,.04); border: 1px solid var(--border); } .gm-rstats b { font-size: 1.3rem; font-weight: 900; } .gm-rstats span { font-size: .7rem; color: var(--text-2); }
.gm-rank-up { margin: 0 0 10px; padding: 10px; border-radius: 14px; background: linear-gradient(120deg, rgba(251,191,36,.22), rgba(74,222,128,.16)); border: 1px solid rgba(251,191,36,.45); font-size: 1rem; animation: gm-pop .5s var(--ease); }
.gm-newcard { display: grid; justify-items: center; gap: 6px; margin: 4px 0 12px; } .gm-newcard p { font-weight: 800; }
.gm-newb { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 12px; }
.gm-recap { text-align: left; padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,.035); border: 1px solid var(--border); margin-bottom: 8px; }
.gm-recap b { font-size: .85rem; } .gm-recap ul { margin: 6px 0 0 18px; display: grid; gap: 3px; font-size: .88rem; line-height: 1.45; color: var(--text-2); }
.gm-mist { text-align: left; padding: 0 14px; border-radius: 14px; background: rgba(255,95,87,.06); border: 1px solid rgba(255,95,87,.25); }
.gm-mist summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 700; font-size: .88rem; }
.gm-mist ul { margin: 0 0 12px 18px; display: grid; gap: 5px; font-size: .84rem; line-height: 1.45; color: var(--text-2); }
.gm-rtip { color: var(--text-2); font-size: .88rem; margin-top: 10px; }
.gm-prof h2 { font-size: 1.4rem; margin-bottom: 12px; } .gm-prof label { display: grid; gap: 4px; font-weight: 700; font-size: .9rem; } .gm-prof small { font-weight: 400; color: var(--text-2); }
.gm-prof input { min-height: 46px; padding: 0 12px; border-radius: 12px; background: rgba(255,255,255,.05); border: 1px solid var(--border2); color: var(--text); font-size: 1rem; }
.gm-plab { font-weight: 700; font-size: .9rem; margin: 14px 0 8px; }
.gm-avs { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
.gm-av { aspect-ratio: 1; border-radius: 14px; font-size: 28px; cursor: pointer; background: rgba(255,255,255,.04); border: 2px solid transparent; }
.gm-av.on { border-color: var(--accent); background: rgba(74,222,128,.15); }

/* album: specimen cards */
.gm-shead { margin: 4px 2px 12px; } .gm-shead h3 { font-size: 1.25rem; font-weight: 800; } .gm-shead p { color: var(--text-2); font-size: .88rem; }
.gm-album { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; }
.gm-scard { position: relative; aspect-ratio: 3 / 4; border-radius: 18px; padding: 0; cursor: pointer; perspective: 900px; background: none; border: 0; text-align: center; color: var(--text); }
.gm-sc-f, .gm-sc-b { position: absolute; inset: 0; display: grid; align-content: center; justify-items: center; gap: 4px; padding: 12px 10px; border-radius: 18px; backface-visibility: hidden; -webkit-backface-visibility: hidden; transition: transform .6s var(--ease); overflow: hidden;
  background: linear-gradient(160deg, #26304a, #151b2b); border: 3px solid #a16207; box-shadow: 0 10px 26px rgba(0,0,0,.45); }
.gm-sc-b { transform: rotateY(180deg); align-content: start; text-align: left; font-size: .76rem; line-height: 1.4; } .gm-sc-b p { color: var(--text-2); } .gm-sc-b .gm-sc-t { color: #ffe9a8; } .gm-sc-b small { color: var(--text-dim); font-size: .64rem; }
.gm-scard.flipped .gm-sc-f, .gm-scard.flip:hover .gm-sc-f { transform: rotateY(180deg); } .gm-scard.flipped .gm-sc-b, .gm-scard.flip:hover .gm-sc-b { transform: rotateY(360deg); }
.gm-sc-pic { width: 100px; height: 100px; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.12), transparent 70%); }
.gm-sc-pic .pk-ic { width: 84px; height: 84px; } .gm-sc-pic .pk-emo { font-size: 66px; }
.gm-sc-f b { font-size: .92rem; line-height: 1.15; } .gm-sc-f i { font-size: .74rem; color: var(--text-2); } .gm-sc-g { font-size: .72rem; padding: 2px 8px; border-radius: 99px; background: rgba(255,255,255,.08); } .gm-sc-f small { font-size: .64rem; color: var(--text-dim); }
.gm-sc-r { position: absolute; top: 8px; left: 10px; font-size: .66rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.gm-scard.bronze .gm-sc-f, .gm-scard.bronze .gm-sc-b { border-color: #b4743c; }
.gm-scard.silver .gm-sc-f, .gm-scard.silver .gm-sc-b { border-color: #cbd5e1; background: linear-gradient(160deg, #2c3550, #171d2e); }
.gm-scard.gold .gm-sc-f, .gm-scard.gold .gm-sc-b { border-color: #f5c842; background: linear-gradient(160deg, #3a3220, #1b1a20 60%); }
.gm-scard.gold .gm-sc-f::after { content: ''; position: absolute; inset: -40%; background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,.22) 50%, transparent 60%); animation: gm-shine 3.2s ease-in-out infinite; pointer-events: none; }
@keyframes gm-shine { from { transform: translateX(-40%); } to { transform: translateX(40%); } }
.gm-scard.locked { cursor: default; } .gm-scard.locked .gm-sc-f { border-color: rgba(255,255,255,.1); border-style: dashed; } .gm-scard.locked .pk-ic { filter: brightness(0) invert(.25); opacity: .6; }
.gm-newcard .gm-scard { width: 170px; }

/* badges and ranks */
.gm-badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin-bottom: 18px; }
.gm-badge { display: grid; grid-template-columns: 48px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 10px 12px; border-radius: 16px; background: rgba(255,255,255,.03); border: 1px solid var(--border); text-align: left; filter: saturate(.2); opacity: .6; }
.gm-badge i { grid-row: span 2; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 26px; background: rgba(255,255,255,.06); }
.gm-badge b { font-size: .9rem; } .gm-badge small { font-size: .74rem; color: var(--text-2); line-height: 1.3; }
.gm-badge.on { filter: none; opacity: 1; border-color: rgba(245,200,66,.4); background: linear-gradient(135deg, rgba(245,200,66,.12), rgba(255,255,255,.02)); } .gm-badge.on i { background: radial-gradient(circle at 35% 30%, #fde68a, #d97706); box-shadow: 0 4px 14px rgba(217,119,6,.4); }
.gm-newb .gm-badge { animation: gm-pop .5s var(--ease); }
.gm-ranks { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.gm-ranks li { display: grid; justify-items: center; gap: 2px; padding: 10px; border-radius: 14px; background: rgba(255,255,255,.03); border: 1px solid var(--border); opacity: .5; }
.gm-ranks li.on { opacity: 1; border-color: rgba(74,222,128,.4); } .gm-ranks span { font-size: 26px; } .gm-ranks b { font-size: .85rem; text-align: center; } .gm-ranks small { font-size: .7rem; color: var(--text-2); }

/* toast, floating points, confetti */
.gm-toast { position: fixed; left: 50%; top: 84px; z-index: 950; transform: translate(-50%, -30px); opacity: 0; pointer-events: none; padding: 10px 18px; border-radius: 99px; font-weight: 800; background: linear-gradient(135deg, #f97316, #ef4444); color: #fff; box-shadow: 0 10px 30px rgba(0,0,0,.45); transition: transform .3s var(--ease), opacity .3s; }
.gm-toast.on { transform: translate(-50%, 0); opacity: 1; }
.gm-float { position: fixed; z-index: 10001; pointer-events: none; font-weight: 900; font-size: 1.2rem; color: var(--gold); text-shadow: 0 2px 8px rgba(0,0,0,.7); transform: translate(-50%, -50%); animation: gm-floatup .9s ease-out forwards; }
@keyframes gm-floatup { to { transform: translate(-50%, -150%); opacity: 0; } }
.gm-fx { position: fixed; inset: 0; z-index: 9999; pointer-events: none; display: none; } .gm-fx.on { display: block; }

/* tablets (iPad portrait 768–1024) */
@media (max-width: 1100px) {
  .gm-worlds { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gm-bins.n5, .gm-m-name .gm-bins { --cols: 3; } .gm-bins.n4 { --cols: 2; }
  .gm-opts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .gm-row2 { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .gm-hud { grid-template-columns: auto minmax(0, 1fr) auto; } .gm-tally { grid-column: 1 / -1; justify-content: flex-end; }
  .gm-clue, .gm-key { grid-template-columns: 1fr; } .gm-myst, .gm-kcard { grid-template-columns: auto minmax(0, 1fr); justify-items: start; text-align: left; align-items: center; }
  .gm-mpic { width: 96px; height: 96px; } .gm-mpic .pk-ic, .gm-kcard .pk-ic { width: 84px; height: 84px; } .gm-mpic .pk-emo, .gm-kcard .pk-emo { font-size: 66px; } .gm-myst > b, .gm-myst > i, .gm-kcard > b, .gm-kcard > small, .gm-kcard > .gm-kn { grid-column: 2; }
  .gm-myst .gm-mpic, .gm-kcard > .pk-ic { grid-row: span 3; }
  .gm-tower, .gm-kb { grid-template-columns: 1fr; }
  .gm-ndot { width: 76px; height: 76px; font-size: 34px; } .gm-node.boss .gm-ndot { width: 90px; height: 90px; font-size: 40px; } .gm-path::before { top: 50px; }
}
/* phones */
@media (max-width: 640px) {
  .gm { padding: 10px; border-radius: 18px; min-height: 0; }
  .gm-banner { padding: 10px 12px; } .gm-banner p { font-size: .82rem; } .gm-banner-art { font-size: 26px; }
  .gm-hud { grid-template-columns: auto minmax(0, 1fr); gap: 8px; } .gm-nav { grid-column: 1 / -1; } .gm-nb { flex: 1; } .gm-tally { grid-column: 1 / -1; justify-content: space-between; }
  .gm-worlds { gap: 6px; } .gm-wtab { min-height: 58px; padding: 6px 8px; gap: 6px; } .gm-wemo { font-size: 22px; } .gm-wt b { font-size: .8rem; }
  .gm-world { padding: 12px; } .gm-whead { flex-direction: column; }
  .gm-path { grid-template-columns: 1fr; gap: 4px; } .gm-path::before { left: 45px; right: auto; top: 20px; bottom: 20px; width: 4px; height: auto; background: repeating-linear-gradient(180deg, color-mix(in srgb, var(--wc) 60%, transparent) 0 12px, transparent 12px 20px); }
  .gm-node { transform: none; justify-content: flex-start; } .gm-node > button { grid-template-columns: auto minmax(0, 1fr); justify-items: start; text-align: left; align-items: center; gap: 12px; }
  .gm-nlab { justify-items: start; text-align: left; } .gm-ndot, .gm-node.boss .gm-ndot { width: 72px; height: 72px; font-size: 32px; }
  .gm-top { grid-template-columns: auto minmax(0, 1fr); } .gm-meters { grid-column: 1 / -1; justify-content: flex-end; } .gm-back span { display: none; }
  .gm-bins.n3, .gm-bins.n4, .gm-bins.n5, .gm-bins.n6, .gm-m-name .gm-bins { --cols: 2; } .gm-bin { min-height: 120px; }
  .gm-opts { grid-template-columns: repeat(2, minmax(0, 1fr)); } .gm-copts { grid-template-columns: 1fr; } .gm-cop { grid-template-columns: auto minmax(0, 1fr); justify-items: start; text-align: left; min-height: 0; }
  .gm-ropts.n4, .gm-ropts.n5, .gm-ropts.n3 { --cols: 2; } .gm-ropt { min-height: 62px; font-size: .85rem; }
  .gm-rcard .pk-ic { width: 80px; height: 80px; } .gm-rcard .pk-emo { font-size: 64px; }
  .gm-foot { flex-direction: column; align-items: stretch; } .gm-facts { justify-content: flex-end; }
  .gm-slot { width: 100%; grid-template-columns: 80px minmax(0, 1fr); }
  .gm-qs { grid-template-columns: 1fr; } .gm-tslot { width: calc(42% - 6px); font-size: .74rem; } .gm-tlab { font-size: .6rem; }
  .gm-rstats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .gm-avs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .gm-album { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .gm *, .gm-ov *, .gm-toast { animation: none !important; transition: none !important; }
  .gm-node { transform: none; }
}
@media (prefers-reduced-transparency: reduce) { .gm-ov { -webkit-backdrop-filter: none; backdrop-filter: none; background: #05080e; } }
@media (prefers-contrast: more) { .gm-chip, .gm-bin, .gm-opt, .gm-ropt, .gm-cop, .gm-ab { border-color: rgba(255,255,255,.5); } .gm-feed { color: var(--text); } }
