:root {
  --bg: #050711;
  --bg2: #090e1d;
  --panel: rgba(11, 18, 38, 0.88);
  --panel2: rgba(17, 28, 58, 0.82);
  --panel3: rgba(22, 36, 74, 0.64);
  --line: rgba(139, 211, 255, 0.26);
  --line2: rgba(255, 255, 255, 0.11);
  --text: #edf7ff;
  --muted: #a8b8ca;
  --hot: #78efff;
  --warm: #ffd36d;
  --ok: #91f7bd;
  --bad: #ff7794;
  --violet: #c0a6ff;
  --shadow: rgba(0, 0, 0, 0.42);
  --radius: 18px;
  --tap: 42px;
  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); }
body.hsv-app {
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% -5%, rgba(120, 239, 255, 0.16), transparent 28%),
    radial-gradient(circle at 88% 12%, rgba(255, 211, 109, 0.10), transparent 26%),
    radial-gradient(circle at 50% 105%, rgba(192, 166, 255, 0.14), transparent 32%),
    linear-gradient(135deg, #040610, #091023 50%, #03040a);
  overflow-x: hidden;
}

button, input, select, textarea { font: inherit; color: var(--text); }
button, select, input[type="number"], input[type="file"]::file-selector-button {
  min-height: var(--tap);
  border: 1px solid rgba(120, 239, 255, 0.28);
  border-radius: 999px;
  background: rgba(6, 13, 29, 0.86);
  color: var(--text);
  outline: none;
  box-shadow: 0 8px 24px var(--shadow), inset 0 0 18px rgba(120, 239, 255, 0.035);
}
button { padding: 0 13px; cursor: pointer; transition: transform 120ms ease, border-color 120ms ease, background 120ms ease, opacity 120ms ease; }
button:hover, button:focus-visible, select:hover, select:focus-visible { border-color: rgba(120, 239, 255, 0.74); background: rgba(13, 27, 58, 0.96); }
button:active { transform: translateY(1px) scale(0.99); }
button.secondary { border-color: rgba(255,255,255,0.16); color: var(--muted); }
button.hot { border-color: rgba(120, 239, 255, 0.62); color: var(--hot); }
button.warn { border-color: rgba(255, 211, 109, 0.48); color: var(--warm); }
button.small { min-height: 34px; padding: 0 10px; font-size: 0.88rem; }
button[disabled] { opacity: 0.45; cursor: not-allowed; }

select { padding: 0 13px; min-width: 160px; }
input[type="range"] { width: 100%; min-width: 120px; accent-color: var(--hot); cursor: pointer; }
input[type="number"] { width: 86px; padding: 0 12px; border-radius: 12px; }
input[type="file"] { max-width: 220px; color: var(--muted); }
textarea {
  width: 100%; min-height: 220px; resize: vertical; border: 1px solid var(--line); border-radius: 16px;
  background: rgba(3, 8, 18, 0.74); padding: 12px; color: #dff7ff; font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.app-shell { width: min(1760px, 100%); margin: 0 auto; padding: 14px; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px; margin: 0 0 12px; border: 1px solid var(--line); border-radius: var(--radius);
  background: rgba(5, 10, 23, 0.88); backdrop-filter: blur(14px); box-shadow: 0 10px 38px rgba(0,0,0,0.35);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.logo-orb { width: 38px; height: 38px; border-radius: 50%; background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red); box-shadow: 0 0 18px rgba(120,239,255,0.32); flex: 0 0 auto; position: relative; }
.logo-orb::after { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: radial-gradient(circle, #fff, rgba(255,255,255,0.5), rgba(0,0,0,0.2)); }
h1 { margin: 0; font-size: clamp(1.1rem, 1.7vw, 1.7rem); letter-spacing: 0.01em; }
.subtitle { margin: 2px 0 0; color: var(--muted); font-size: 0.92rem; }
.top-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.mode-pill { border: 1px solid rgba(255,255,255,0.14); background: rgba(255,255,255,0.06); border-radius: 999px; padding: 8px 11px; color: var(--muted); font-size: 0.88rem; }

.main-grid { display: grid; grid-template-columns: minmax(310px, 0.94fr) minmax(340px, 1.06fr); gap: 12px; align-items: stretch; }
.card {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: 0 18px 52px var(--shadow);
  overflow: hidden;
}
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line2); background: rgba(255,255,255,0.035); }
.card-header h2, .panel h2 { margin: 0; font-size: 1rem; letter-spacing: 0.01em; }
.card-header p { margin: 2px 0 0; color: var(--muted); font-size: 0.84rem; }
.canvas-wrap { position: relative; min-height: 430px; height: min(58vh, 620px); background: radial-gradient(circle at 50% 30%, rgba(120,239,255,0.08), transparent 38%), rgba(0,0,0,0.24); }
canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.canvas-badge { position: absolute; left: 10px; bottom: 10px; display: flex; gap: 8px; flex-wrap: wrap; pointer-events: none; }
.badge { border: 1px solid rgba(255,255,255,0.13); border-radius: 999px; background: rgba(0,0,0,0.55); padding: 7px 9px; color: var(--muted); font-size: 0.78rem; }
.badge strong { color: var(--text); }

.control-dock { margin-top: 12px; display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 12px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
.panel-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid var(--line2); background: rgba(255,255,255,0.035); gap: 8px; }
.panel-body { padding: 12px; }
.controls-grid { display: grid; grid-template-columns: repeat(2, minmax(220px, 1fr)); gap: 10px; }
.control { border: 1px solid rgba(255,255,255,0.10); background: rgba(255,255,255,0.035); border-radius: 15px; padding: 10px; }
.control label { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 0.88rem; margin-bottom: 7px; }
.value-pill { color: var(--hot); font-variant-numeric: tabular-nums; }
.toggle-row, .button-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toggle { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; border: 1px solid rgba(255,255,255,0.12); border-radius: 999px; padding: 0 10px; color: var(--muted); background: rgba(255,255,255,0.035); font-size: 0.86rem; }
.toggle input { accent-color: var(--hot); }

.stats-grid { display: grid; grid-template-columns: repeat(2, minmax(110px, 1fr)); gap: 8px; }
.stat { border: 1px solid rgba(255,255,255,0.10); background: rgba(255,255,255,0.035); border-radius: 14px; padding: 9px; min-height: 60px; }
.stat .k { display: block; color: var(--muted); font-size: 0.76rem; margin-bottom: 4px; }
.stat .v { display: block; color: var(--text); font-size: 0.96rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat .v.hot { color: var(--hot); }
.stat .v.ok { color: var(--ok); }
.stat .v.warn { color: var(--warm); }

.lab-grid { margin-top: 12px; display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 12px; }
.step-list { display: grid; gap: 8px; }
.step { padding: 11px; border: 1px solid rgba(255,255,255,0.11); border-radius: 15px; background: rgba(255,255,255,0.035); }
.step h3 { margin: 0 0 5px; font-size: 0.98rem; }
.step p, .explain p, .explain li { color: var(--muted); line-height: 1.45; }
.step p { margin: 0; font-size: 0.88rem; }
.explain { padding: 2px 0; }
.explain h3 { margin: 0.6rem 0 0.35rem; }
.explain ul { padding-left: 1.2rem; }
.codeish { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; color: #d7f5ff; }

.toast { position: fixed; right: 16px; bottom: 16px; z-index: 50; max-width: min(420px, calc(100vw - 32px)); padding: 12px 14px; border: 1px solid rgba(120,239,255,0.35); border-radius: 16px; background: rgba(3,8,18,0.94); color: var(--text); box-shadow: 0 16px 40px rgba(0,0,0,0.46); opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity 160ms ease, transform 160ms ease; }
.toast.show { opacity: 1; transform: translateY(0); }

.dialog-backdrop { position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,0.62); display: none; align-items: center; justify-content: center; padding: 16px; }
.dialog-backdrop.show { display: flex; }
.dialog { width: min(760px, 100%); max-height: min(720px, 92vh); overflow: auto; border: 1px solid var(--line); border-radius: 22px; background: #071022; box-shadow: 0 24px 80px rgba(0,0,0,0.62); }
.dialog header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px; border-bottom: 1px solid var(--line2); }
.dialog header h2 { margin: 0; font-size: 1.1rem; }
.dialog .content { padding: 14px; color: var(--muted); line-height: 1.5; }

.landing-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.hero-card { width: min(900px, 100%); border: 1px solid var(--line); border-radius: 28px; background: rgba(7, 14, 31, 0.88); padding: clamp(22px, 5vw, 46px); box-shadow: 0 22px 80px var(--shadow); }
.eyebrow { margin: 0 0 10px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--hot); font-size: 0.8rem; }
.lede { color: var(--muted); line-height: 1.55; max-width: 760px; }
.landing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 22px; }
.big-link { min-height: 86px; display: flex; align-items: center; justify-content: center; text-align: center; padding: 15px; border: 1px solid rgba(120,239,255,0.28); border-radius: 20px; background: rgba(255,255,255,0.04); color: var(--text); text-decoration: none; }
.big-link:hover { border-color: rgba(120,239,255,0.75); background: rgba(120,239,255,0.08); }

.diagnostic-shell { width: min(1100px, 100%); margin: 0 auto; padding: 14px; }
.result-list { display: grid; gap: 8px; }
.result { display: grid; grid-template-columns: 120px 1fr; gap: 8px; align-items: start; padding: 9px 10px; border-radius: 14px; border: 1px solid rgba(255,255,255,0.10); background: rgba(255,255,255,0.035); }
.status-pass { color: var(--ok); }
.status-warn { color: var(--warm); }
.status-fail { color: var(--bad); }

@media (max-width: 1100px) {
  .main-grid, .control-dock, .lab-grid { grid-template-columns: 1fr; }
  .canvas-wrap { height: 48vh; min-height: 360px; }
}
@media (max-width: 720px) {
  .app-shell { padding: 8px; }
  .topbar { position: relative; align-items: flex-start; flex-direction: column; }
  .top-actions { width: 100%; justify-content: flex-start; }
  .mode-pill { width: 100%; }
  .controls-grid, .stats-grid, .landing-grid { grid-template-columns: 1fr; }
  .canvas-wrap { height: 58vh; min-height: 320px; }
  button, select { width: auto; max-width: 100%; }
  .button-row button, .top-actions button, .top-actions select { flex: 1 1 150px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}


/* 20260528_25_hsvlab polish pass */
#animationMode { min-width: 190px; }
.enhanced-lab { grid-template-columns: 1fr 1fr; }
.preset-group { margin-bottom: 14px; }
.preset-group h3 { margin: 0 0 8px; color: var(--hot); font-size: 0.88rem; letter-spacing: 0.05em; text-transform: uppercase; }
.preset-card-grid { display: grid; grid-template-columns: repeat(2, minmax(160px, 1fr)); gap: 9px; }
.preset-card { display: grid; align-content: start; gap: 5px; min-height: 118px; width: 100%; text-align: left; border-radius: 16px; padding: 11px; background: rgba(255,255,255,0.04); white-space: normal; }
.preset-card.active { border-color: rgba(120,239,255,0.95); box-shadow: 0 0 0 1px rgba(120,239,255,0.22), inset 0 0 22px rgba(120,239,255,0.08); }
.preset-title { color: var(--text); font-weight: 700; }
.preset-shape { color: var(--warm); font-size: 0.78rem; }
.preset-notice { color: var(--muted); font-size: 0.80rem; line-height: 1.35; }
.prompt-head { display: flex; align-items: start; justify-content: space-between; gap: 10px; }
.prompt-card details { margin-top: 8px; color: var(--muted); }
.prompt-card summary { cursor: pointer; color: var(--hot); }
.notes-grid { display: grid; grid-template-columns: repeat(2, minmax(220px, 1fr)); gap: 10px; }
.notes-grid label { color: var(--muted); font-size: 0.86rem; }
.notes-grid textarea { margin-top: 6px; min-height: 120px; font-size: 0.86rem; }
.exhibit-notes h3 { color: var(--hot); }
@media (max-width: 900px) {
  .enhanced-lab, .preset-card-grid, .notes-grid { grid-template-columns: 1fr; }
  #animationMode { flex: 1 1 170px; }
}
@media (max-width: 720px) {
  .preset-card { min-height: 96px; }
  .mode-pill#presetExplainer { width: auto; }
  input[type="file"] { max-width: 100%; }
}

/* 20260528_26_hsvmodule guided module pass */
.module-layout { align-items: start; }
.module-wide { grid-column: 1 / -1; }
.module-stage-card { border-color: rgba(120,239,255,0.22); background: linear-gradient(135deg, rgba(120,239,255,0.055), rgba(255,255,255,0.028)); }
.challenge-result { display: inline-flex; align-items: center; min-height: 30px; padding: 4px 9px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.12); color: var(--muted); background: rgba(255,255,255,0.035); font-size: 0.8rem; }
.challenge-result.ok { color: var(--ok); border-color: rgba(145,247,189,0.35); }
.challenge-result.warn { color: var(--warm); border-color: rgba(255,211,109,0.35); }
.vocab-grid { display: grid; grid-template-columns: repeat(2, minmax(180px, 1fr)); gap: 9px; }
.vocab-card, .evidence-card { border: 1px solid rgba(255,255,255,0.10); border-radius: 15px; background: rgba(255,255,255,0.035); padding: 10px; }
.vocab-card h3, .evidence-card h3 { margin: 0 0 5px; color: var(--hot); font-size: 0.94rem; }
.vocab-card p, .evidence-card p, .muted { color: var(--muted); }
.evidence-list { margin-top: 12px; display: grid; gap: 9px; }
.full-label { display: grid; gap: 6px; color: var(--muted); font-size: 0.88rem; }
.full-label textarea { min-height: 92px; }
@media (max-width: 900px) {
  .module-wide { grid-column: auto; }
  .vocab-grid { grid-template-columns: 1fr; }
}

/* 20260528_32_hsv-validation three-panel shell + earned mission validation */
.button-link {
  min-height: var(--tap);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 13px;
  border: 1px solid rgba(120, 239, 255, 0.28);
  border-radius: 999px;
  background: rgba(6, 13, 29, 0.86);
  color: var(--text);
  text-decoration: none;
  box-shadow: 0 8px 24px var(--shadow), inset 0 0 18px rgba(120, 239, 255, 0.035);
}
.button-link:hover,
.button-link:focus-visible {
  border-color: rgba(120, 239, 255, 0.74);
  background: rgba(13, 27, 58, 0.96);
}
.button-link.secondary { border-color: rgba(255,255,255,0.16); color: var(--muted); }

body.hsv-workspace-app {
  overflow: hidden;
}
.workspace-app-shell {
  width: min(1920px, 100%);
  height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
}
.workspace-topbar {
  position: relative;
  margin: 0;
  padding: 8px 10px;
  border-radius: 16px;
}
.workspace-topbar .logo-orb { width: 32px; height: 32px; }
.workspace-topbar .logo-orb::after { inset: 8px; }
.workspace-topbar h1 { font-size: clamp(1rem, 1.35vw, 1.42rem); }
.workspace-topbar .subtitle { font-size: 0.82rem; }
.workspace-top-actions { gap: 6px; }
.workspace-top-actions .button-link,
.workspace-top-actions button,
.workspace-top-actions select,
.workspace-top-actions .mode-pill {
  min-height: 34px;
  font-size: 0.82rem;
  padding-top: 0;
  padding-bottom: 0;
}
.workspace-top-actions select { min-width: 145px; }

.hsv-workspace-shell {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(220px, 270px) minmax(420px, 1fr) minmax(270px, 350px);
  gap: 10px;
  overflow: hidden;
}
.hsv-workspace-panel {
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
  box-shadow: 0 18px 52px var(--shadow);
}
.hsv-left-panel,
.hsv-right-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}
.panel-scroll {
  max-height: 100%;
  min-height: 0;
  overflow: auto;
  scrollbar-width: thin;
}
.hsv-center-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  gap: 8px;
  padding: 10px;
}
.workspace-stage-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 15px;
  background: rgba(255,255,255,0.035);
}
.workspace-stage-header h2 { margin: 0; font-size: clamp(1rem, 1.5vw, 1.42rem); }
.workspace-stage-header p { margin: 4px 0 0; }
.view-mode-row { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.view-mode-row button.active,
#moveModeBtn.active {
  border-color: rgba(120,239,255,0.95);
  color: var(--hot);
  background: rgba(120,239,255,0.12);
}
.workspace-prompt-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid rgba(120,239,255,0.18);
  border-radius: 15px;
  background: rgba(120,239,255,0.045);
  color: var(--muted);
  font-size: 0.84rem;
}
.workspace-prompt-strip strong { color: var(--text); }

.hsv-sim-frame {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(260px, 1fr);
  gap: 10px;
}
.hsv-sim-card {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}
.hsv-sim-card .card-header { padding: 8px 10px; }
.hsv-sim-card .card-header p { font-size: 0.78rem; }
.workspace-canvas-wrap {
  min-height: 0;
  height: auto;
}
.sim-actions { justify-content: flex-end; }

body[data-hsv-view="3d"] .hsv-sim-frame { grid-template-columns: 1fr; }
body[data-hsv-view="3d"] .hsv-sim-card--2d { display: none; }
body[data-hsv-view="2d"] .hsv-sim-frame { grid-template-columns: 1fr; }
body[data-hsv-view="2d"] .hsv-sim-card--3d { display: none; }
body[data-hsv-view="report"] .hsv-sim-frame { display: none; }
body[data-hsv-view="report"] .workspace-report-panel { display: block; }
.workspace-report-panel {
  display: none;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.035);
}
.workspace-report-panel .panel-body {
  max-height: 100%;
  overflow: auto;
}
.workspace-phase-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.035);
  overflow: auto;
}

.phase-nav { display: grid; gap: 8px; }
.phase-button {
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 22px;
  gap: 8px;
  align-items: center;
  text-align: left;
  border-radius: 15px;
  padding: 8px;
  white-space: normal;
  background: rgba(255,255,255,0.035);
}
.phase-button.active {
  border-color: rgba(120,239,255,0.95);
  background: linear-gradient(135deg, rgba(120,239,255,0.14), rgba(255,255,255,0.04));
}
.phase-number {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 34px;
  border-radius: 12px;
  background: rgba(120,239,255,0.10);
  color: var(--hot);
  font-weight: 800;
  font-size: 0.86rem;
}
.phase-copy { display: grid; gap: 2px; min-width: 0; }
.phase-copy strong { font-size: 0.9rem; }
.phase-copy small {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.25;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.phase-done {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-width: 28px;
  min-height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.16);
  color: rgba(168,184,202,0.72);
  background: rgba(0,0,0,0.16);
  font-weight: 900;
  letter-spacing: -0.08em;
}
.phase-button.phase-started .phase-done {
  color: rgba(120,239,255,0.86);
  border-color: rgba(120,239,255,0.34);
}
.phase-button.phase-current .phase-done {
  color: var(--hot);
  border-color: rgba(120,239,255,0.76);
  box-shadow: 0 0 16px rgba(120,239,255,0.28);
}
.phase-button.phase-complete .phase-done {
  color: var(--ok);
  border-color: rgba(145,247,189,0.82);
  background: rgba(145,247,189,0.12);
  box-shadow: 0 0 18px rgba(145,247,189,0.22);
}
.phase-button.phase-evidence .phase-done {
  min-width: 34px;
}
.mission-validation-status {
  margin-top: 10px;
  display: grid;
  gap: 5px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.035);
}
.mission-validation-status strong { color: var(--muted); }
.mission-validation-status span,
.mission-validation-status small { color: var(--muted); line-height: 1.35; }
.mission-validation-status.complete {
  border-color: rgba(145,247,189,0.45);
  background: rgba(145,247,189,0.075);
}
.mission-validation-status.complete strong { color: var(--ok); }
.mission-validation-status.current strong { color: var(--hot); }
.left-compact-note {
  margin-top: 12px;
  padding: 10px;
  border-radius: 15px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.035);
}
.left-compact-note p { color: var(--muted); margin: 5px 0 0; font-size: 0.82rem; line-height: 1.35; }
.compact-links { margin-top: 12px; }
.compact-links .button-link { min-height: 34px; }

.inspector-stack { display: grid; gap: 9px; }
.inspector-card {
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 15px;
  background: rgba(255,255,255,0.035);
  padding: 10px;
}
.inspector-card h3 { margin: 0 0 6px; color: var(--hot); font-size: 0.94rem; }
.inspector-card > summary {
  cursor: pointer;
  color: var(--text);
  font-weight: 800;
  margin: -2px 0 8px;
}
.inspector-card[open] > summary { color: var(--hot); }
.controls-grid--single,
.stats-grid--compact,
.notes-grid--single,
.vocab-grid--single {
  grid-template-columns: 1fr;
}
.stats-grid--compact .stat { min-height: 52px; }
.stat-wide { grid-column: 1 / -1; }
.export-actions button,
.export-actions .button-link,
.export-actions input { flex: 1 1 140px; }
.report-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
canvas.is-move-mode { cursor: move; }
.hsv-sim-card--3d canvas { cursor: grab; }
.hsv-sim-card--3d canvas:active { cursor: grabbing; }

@media (max-width: 1180px) {
  body.hsv-workspace-app { overflow: auto; }
  .workspace-app-shell { height: auto; min-height: 100vh; }
  .hsv-workspace-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(58vh, auto) auto;
    overflow: visible;
  }
  .hsv-center-panel { min-height: 720px; }
  .workspace-prompt-strip { grid-template-columns: 1fr; }
  .panel-scroll { max-height: none; }
  .hsv-left-panel, .hsv-right-panel { max-height: none; }
}
@media (max-width: 820px) {
  .workspace-app-shell { padding: 8px; }
  .workspace-topbar { align-items: stretch; }
  .workspace-top-actions { justify-content: flex-start; }
  .workspace-top-actions .button-link,
  .workspace-top-actions button,
  .workspace-top-actions select,
  .workspace-top-actions .mode-pill { flex: 1 1 140px; }
  .hsv-center-panel { padding: 8px; min-height: 680px; }
  .workspace-stage-header { flex-direction: column; }
  .view-mode-row { justify-content: flex-start; width: 100%; }
  .hsv-sim-frame { grid-template-columns: 1fr; }
  .workspace-canvas-wrap { min-height: 330px; }
  .report-summary-grid { grid-template-columns: 1fr; }
  .phase-button { min-height: 52px; }
}
body[data-hsv-view="report"] .workspace-report-panel { display: block; }
