/* The showcase restyled to the reView UI design guidelines
   (Confluence: "Design Guidelines – reView UI"). Loaded after the app's own
   style.css / z-extra.css: it retargets their tokens to the brand palette,
   strips the phosphor-terminal styling, and adds the reView shell (64 px
   icon rail, project strip, rounded main panel). Section numbers (§) refer
   to the guide. */

/* ------------------------------------------------------------- tokens §3 */
:root,
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #F5F5F8;                 /* canvas (§3.1 light surface)            */
  --panel-bg: #FFFFFF;           /* main panel / cards (white: open Q §5)  */
  --panel-bg2: #FFFFFF;
  --border: #DFDEE2;             /* tint of #16141F (open Q §5)             */
  --border-dim: #E9E8ED;
  --border-bright: #CDCCD1;
  --text: #16141F;
  --muted: #5E5A73;              /* 6.6:1 on white                          */
  --accent: #534B7F;             /* primary action / active / links         */
  --accent-dim: #726B9D;         /* hover / secondary emphasis              */
  --accent-contrast: #FFFFFF;
  --accent2: #534B7F;
  --accent2-dim: #726B9D;
  --accent2-ink: #FFFFFF;
  --amber: #B45309;              /* functional status (exception §5.6)      */
  --ok: #15803D;
  --err: #DC2626;
  --wash: #EEEDF4;               /* selected / hover background (tint)      */
  --glow: none; --glow-soft: none; --glow2: none; --glow2-soft: none;
  --scanline-opacity: 0;
  --shadow: 0 1px 2px rgba(22, 20, 31, .06), 0 10px 30px rgba(22, 20, 31, .10);

  --rv-primary: #534B7F;
  --rv-primary-hover: #726B9D;
  --rv-on-primary: #FFFFFF;
  --rv-focus: rgba(83, 75, 127, .35);
  --rv-mask: rgba(22, 20, 31, .45);
  --rv-tip-bg: #16141F;
  --rv-tip-text: #F5F5F8;
  --rv-skeleton: #EEEDF4;
}

:root.dark,
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #16141F;
  --panel-bg: #1D1B29;           /* tints of #16141F → #726B9D (open Q §5) */
  --panel-bg2: #1D1B29;
  --border: #2A273B;
  --border-dim: #232031;
  --border-bright: #3A3650;
  --text: #F5F5F8;
  --muted: #A09CB5;              /* 6.9:1 on #16141F                        */
  --accent: #ADA9C6;             /* #726B9D tint — 8:1 for text on dark     */
  --accent-dim: #726B9D;
  --accent-contrast: #16141F;
  --accent2: #ADA9C6;
  --accent2-dim: #726B9D;
  --accent2-ink: #16141F;
  --amber: #FBBF24;              /* dark-mode status accents (§4.3)         */
  --ok: #34D399;
  --err: #FCA5A5;
  --wash: #232031;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .45);

  --rv-primary: #726B9D;         /* 3.7:1 vs canvas; white text 4.9:1       */
  --rv-primary-hover: #847DAF;
  --rv-on-primary: #FFFFFF;
  --rv-focus: rgba(173, 169, 198, .45);
  --rv-mask: rgba(0, 0, 0, .55);
  --rv-tip-bg: #2A273B;
  --rv-tip-text: #F5F5F8;
  --rv-skeleton: #232031;
}

/* ------------------------------------------------- typography §6, reset */
html { font-size: 13.333px; }    /* the app sizes in rem: 0.9rem = 12 px */
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 12px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  transition: background-color .3s ease, color .3s ease;
}
/* The phosphor terminal look: no caps, tracking, glows or ascii marks. */
.rv-app *,
.rv-dialog * {
  text-transform: none !important;
  letter-spacing: normal !important;
  text-shadow: none !important;
}
.module-h4::before,
.control-label::before,
.panel h4::before { content: none !important; }

code, .rv-mono, .panel-title, .dm-val, .chat-when, .tf-ratio {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------------------------------------------------- shell §10.1 */
.rv-skip {
  position: absolute; left: -999px; top: 8px; z-index: 3000;
  padding: 6px 10px; border-radius: 6px;
  background: var(--rv-primary); color: var(--rv-on-primary);
}
.rv-skip:focus { left: 8px; }

.rv-app { display: flex; height: 100vh; width: 100vw; background: var(--bg); }

.rv-rail {
  width: 64px;
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 0;
  background: var(--panel-bg);
  border-right: 1px solid var(--border);
  overflow-y: auto;
}
.rv-logo { display: block; margin-bottom: 24px; border-radius: 8px; }
.rv-logo img { display: block; width: 40px; height: 40px; border-radius: 8px; }
.rv-nav { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.rv-spacer { flex: 1; min-height: 16px; }
.rv-nav-sep { width: 28px; height: 1px; margin: 4px 0; background: var(--border); }

/* §10.3: ≈48 px hit area, active = primary bg + shadow + 2 px border,
   hover = accent bg + 8 px dot on the right; tooltip required. */
.rv-nav-item {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  transition: background-color .2s, color .2s, box-shadow .2s;
}
.rv-nav-item .pi { font-size: 18px; }
.rv-nav-item:hover { background: var(--wash); color: var(--text); }
.rv-nav-item:hover::after {
  content: "";
  position: absolute;
  right: -10px;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-top: -4px;
  border-radius: 50%;
  background: var(--accent-dim);
}
.rv-nav-item.module-active {
  background: var(--rv-primary);
  border-color: var(--rv-primary-hover);
  color: var(--rv-on-primary);
  box-shadow: 0 4px 10px -2px rgba(22, 20, 31, .25);
}
.rv-nav-item.module-active:hover::after { display: none; }
.rv-nav-locked { color: var(--muted); opacity: .75; }
.rv-nav-lock {
  position: absolute;
  right: 3px;
  bottom: 3px;
  font-size: 8px !important;
}

.rv-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* Project strip (§10.1) — instead of a top bar. */
.rv-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px;
  background: var(--panel-bg);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.rv-project { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.rv-project > .pi { color: var(--accent); font-size: 14px; }
.rv-project-name { font-size: 14px; font-weight: 600; }
.rv-summary { color: var(--muted); }
.rv-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
  background: var(--wash);
  border: 1px solid var(--border);
  cursor: help;
}
.rv-pill .pi { font-size: 11px; }

.rv-panel {
  flex: 1;
  min-height: 0;
  margin: 16px;
  display: flex;
  flex-direction: column;
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.rv-page-head {
  flex-shrink: 0;
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border);
}
.rv-page-head h1 { margin: 0; font-size: 24px; font-weight: 700; color: var(--text); }
.rv-blurb { margin: 0; color: var(--muted); font-size: 12px; }
.rv-sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.rv-pages { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.rv-pages > .module-page { flex: 1; min-height: 0; }
.rv-muted { color: var(--muted); }
.rv-noscript { padding: 32px; text-align: center; }

/* ------------------------------------------------------- buttons §7.5 */
.rv-btn,
.sc-cta,
.net-reset,
.scene-zoom-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 6px;
  font: 600 11px/1 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s;
}
.rv-btn { height: 30px; padding: 0 12px; font-size: 12px; }
.rv-btn .pi { font-size: 11px; }
.rv-btn-primary,
.sc-cta {
  color: var(--rv-on-primary);
  background: var(--rv-primary);
  border: 1px solid var(--rv-primary);
  box-shadow: none;
}
.sc-cta { height: 30px; padding: 0 14px; font-size: 12px; }
.rv-btn-primary:hover,
.sc-cta:hover { background: var(--rv-primary-hover); border-color: var(--rv-primary-hover); }
.rv-btn-text {
  color: var(--accent);
  background: transparent;
  border: 1px solid transparent;
}
.rv-btn-text:hover { background: var(--wash); }
/* toolbar actions: outlined (p-button-outlined) */
.net-reset,
.scene-zoom-btn {
  color: var(--accent);
  background: var(--panel-bg);
  border: 1px solid var(--border-bright);
  box-shadow: none;
}
.net-reset:hover,
.scene-zoom-btn:hover { background: var(--wash); border-color: var(--accent-dim); color: var(--accent); }

/* ------------------------------------------------ form controls §6, §7 */
.control-label {
  margin: 10px 0 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
}
.sc-select,
.cfg-input,
.sc-ms-button {
  width: 100%;
  min-height: 30px;
  padding: 4px 8px;
  font: 12px ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--panel-bg);
  border: 1px solid var(--border-bright);
  border-radius: 6px;
}
.sc-select:hover, .cfg-input:hover, .sc-ms-button:hover { border-color: var(--accent-dim); }
.sc-select:focus, .cfg-input:focus, .sc-ms-button:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--rv-focus);
}
.sc-select:disabled, .cfg-input:disabled {
  opacity: .6;
  cursor: not-allowed;
  background: var(--bg);
}
.sc-select option { background: var(--panel-bg); color: var(--text); }
.cfg-input { width: 7rem; }
.control { margin-bottom: 4px; }
.sc-ms { position: relative; margin-bottom: 6px; }
.sc-ms-button { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; text-align: left; cursor: pointer; }
.sc-ms-placeholder { color: var(--muted); }
.sc-ms-chip {
  padding: 0 6px;
  border-radius: 999px;
  font-size: 11px;
  background: var(--wash);
  border: 1px solid var(--border);
}
.sc-ms-menu {
  position: absolute;
  z-index: 60;
  left: 0;
  right: 0;
  max-height: 16rem;
  overflow: auto;
  padding: 4px 0;
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: var(--shadow);
}
.sc-ms-row { display: flex; align-items: center; gap: 6px; padding: 5px 10px; font-size: 12px; cursor: pointer; }
.sc-ms-row:hover { background: var(--wash); }
.sc-checklist { display: flex; flex-direction: column; gap: 4px; }
.chatter-sev.sc-checklist,
.chatter-cat.sc-checklist { flex-direction: row; flex-wrap: wrap; gap: 4px 12px; }
.sc-check { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; cursor: pointer; }
.sc-check input, .sc-ms-row input, .sc-slider { accent-color: var(--rv-primary); }
.sc-slider-wrap { margin: 2px 0 8px; }
.sc-slider { width: 100%; }
.sc-slider-marks { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }

/* ---------------------------------------------- tabs §10.4, side panes */
.data-tabs { gap: 2px; margin: 0 0 8px; border-bottom: 1px solid var(--border); }
.data-tab,
.rtab-bar .data-tab {
  padding: 8px 10px;
  font: 500 12px ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 6px 6px 0 0;
  box-shadow: none;
}
.data-tab:hover { color: var(--text); background: var(--wash); }
.data-tab.data-tab-active {
  color: var(--accent);
  background: var(--wash);
  border-bottom-color: var(--accent);
  box-shadow: none;
}
.sidebar {
  padding: 12px 14px 24px;
  background: var(--panel-bg);
  border-right: 1px solid var(--border);
}
.sidebar hr { border: 0; border-top: 1px solid var(--border-dim); margin: 12px 0; }
.panel-hint { font-size: 12px; color: var(--muted); }

/* ----------------------------------------------- panes, cards §7.2–7.4 */
.net-header {
  align-items: center;
  padding: 8px 12px;
  background: var(--panel-bg);
  border-bottom: 1px solid var(--border);
}
.net-title { font-size: 13px; font-weight: 600; color: var(--text); }
.net-subtitle { font-size: 11px; color: var(--muted); }
.viewport, .center, .right-col, .bench-main, .prod-main { background: var(--panel-bg); }
.dq-main { background: var(--bg); }
.bench-note { font-size: 12px; color: var(--muted); }
.bench-graph, .prod-graph, .dq-graph, .prod-targets, .dq-work, .cfg-card,
.bench-insufficient:not(:empty) {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-bg);
}
.bench-graph:hover, .prod-graph:hover, .dq-graph:hover { box-shadow: 0 1px 2px rgba(22, 20, 31, .06); }
.module-h4, .panel h4 {
  margin: 14px 0 6px;
  padding-bottom: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--border-dim);
}
.panel-title { font-size: 14px; font-weight: 600; color: var(--accent); }
.kv-row { font-size: 12px; border-bottom-color: var(--border-dim); }
.kv-key { color: var(--muted); }
.stat-tile {
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel-bg);
  box-shadow: none;
}
.stat-label { font-size: 11px; color: var(--muted); }
.tier-badge { border-radius: 4px; font-size: 11px; }
.sev { border-radius: 999px; font-size: 10px; font-weight: 600; }
.chat-card { border-radius: 8px; border-color: var(--border); }
.chat-card:hover { background: var(--wash); }
.chat-text { font-size: 12px; }

/* Plotly modebar */
.modebar-btn path { fill: var(--muted) !important; }
.modebar-btn:hover path, .modebar-btn.active path { fill: var(--accent) !important; }
.js-plotly-plot .plotly .modebar { background: transparent !important; }

/* Semantic network (SVG) */
.sc-graph { width: 100%; height: 100%; min-height: 0; }
.sc-network { width: 100%; height: 100%; }
.sc-net-svg { display: block; }
.sc-net-edge { stroke: var(--border-bright); stroke-width: 1.2; }
.sc-net-node { cursor: pointer; }
.sc-net-node circle { stroke: var(--panel-bg); stroke-width: 1.5; }
.sc-net-node text {
  fill: var(--text);
  font: 10px ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  text-anchor: middle;
  pointer-events: none;
  paint-order: stroke;
  stroke: var(--panel-bg);
  stroke-width: 3px;
}
.sc-net-root circle { stroke: var(--accent); stroke-width: 2.5; }
.sc-net-hint { padding: 16px; }
.chat-card { cursor: pointer; }
.prov-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.prov-conf { color: var(--muted); font-size: 11px; }

/* Tooltips (§11.5): 12 px, dark chip. */
.tiptip {
  padding: 6px 10px;
  font: 12px/1.45 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--rv-tip-text);
  background: var(--rv-tip-bg);
  border: 0;
  border-radius: 6px;
  box-shadow: var(--shadow);
}

/* ------------------------------------------------ locked full-demo tabs */
.sc-locked-page { align-items: center; justify-content: center; padding: 32px 16px; background: var(--bg); }
.sc-locked-card {
  max-width: 34rem;
  padding: 24px;
  text-align: center;
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.sc-locked-icon { font-size: 28px; color: var(--accent); }
.sc-locked-icon .pi { font-size: 28px; }
.sc-locked-card h2 { margin: 8px 0; font-size: 18px; font-weight: 600; color: var(--text); }
.sc-locked-card p { font-size: 12px; line-height: 1.6; }
.sc-locked-note { color: var(--muted); }

/* ------------------------------------------------- dialog §11.3 */
.rv-dialog-mask {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  /* No backdrop-filter: blurring over the live WebGL scene stalls the
     page for tens of seconds on machines without GPU compositing. */
  background: var(--rv-mask);
}
.rv-dialog-mask[hidden] { display: none; }
.rv-dialog {
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 32px);
  overflow: auto;
  background: var(--panel-bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  animation: rv-enter .3s cubic-bezier(.22, 1, .36, 1);
}
.rv-dialog-head { padding: 20px 24px 0; }
.rv-dialog-head h2 { margin: 0; font-size: 18px; font-weight: 600; }
.rv-dialog-body { padding: 8px 24px; font-size: 12px; line-height: 1.6; }
.rv-dialog-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 24px 20px; }
.rv-tour { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 8px; }
.rv-tour li { display: flex; gap: 10px; align-items: flex-start; }
.rv-tour .pi { margin-top: 2px; color: var(--accent); }
@keyframes rv-enter { from { opacity: 0; transform: translateY(8px); } }

/* ------------------------------------------------- skeleton §11.1 */
@keyframes rv-pulse { 50% { opacity: .45; } }
.rv-busy .rv-pages .module-page .sc-graph,
.rv-busy .rv-pages .module-page .bench-note,
.rv-busy .rv-pages .module-page .panel,
.rv-busy .rv-pages .module-page .dq-tiles {
  background: var(--rv-skeleton);
  border-radius: 8px;
  animation: rv-pulse 1.2s ease-in-out infinite;
}

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

/* ---------------------------------------- narrow screens (§11.10) --
   Supported: 11-inch tablets (820 px portrait) and up. Below 900 px the
   columns stack and the page scrolls; the rail stays. */
@media (max-width: 900px) {
  .rv-app { height: auto; min-height: 100vh; }
  .rv-rail { position: sticky; top: 0; height: 100vh; }
  .rv-panel { margin: 8px; overflow: visible; }
  .rv-strip { flex-wrap: wrap; }
  .rv-summary { display: none; }
  .module-page.body { flex-direction: column; overflow: visible; }
  .module-page .splitter { display: none !important; }
  .module-page .sidebar,
  .module-page .right-col,
  .module-page .center,
  .module-page .bench-main,
  .module-page .prod-main,
  .module-page .dq-main {
    width: 100% !important;
    max-width: none !important;
    flex: none !important;
    border-right: 0;
  }
  .module-page .center { height: 85vh; flex-direction: column; }
  .module-page .viewport { flex: 1; }
  .module-page .right-col { height: 80vh; }
  .module-page .bench-graph { min-height: 22rem; }
  .prod-grid { grid-template-columns: 1fr; grid-template-rows: none; grid-auto-rows: 22rem; }
}

/* ---------------------------------------------------------------- Benchmark (read-only snapshot) */
.sb-page { gap: 1.6rem; padding: 0.4rem 0.6rem; min-height: 0; overflow: hidden; }
.sb-left { flex: 0 0 21rem; display: flex; flex-direction: column; gap: 0.6rem; overflow-y: auto; }
.sb-right { flex: 1; min-width: 0; overflow-y: auto; padding-right: 0.4rem; }
.sb-h { font-size: 1.05rem; font-weight: 600; color: var(--text); }
.sb-note, .sb-meta { font-size: 0.74rem; color: var(--muted); line-height: 1.5; }
.sb-meta b { color: var(--text); font-weight: 600; }
.sb-roles { display: flex; flex-direction: column; gap: 2px; }
.sb-role { position: relative; display: flex; align-items: center; gap: 0.75rem; width: 100%; text-align: left;
  cursor: pointer; padding: 0.6rem 0.7rem 0.6rem 1rem; border: 1px solid transparent; border-radius: 8px;
  background: transparent; color: var(--text); font: inherit; }
.sb-role:hover { background: var(--wash); }
.sb-on { background: var(--panel-bg); border-color: var(--border); box-shadow: 0 1px 2px rgba(22, 20, 31, .06); }
.sb-on::before { content: ""; position: absolute; left: 0; top: 0.55rem; bottom: 0.55rem; width: 3px;
  border-radius: 2px; background: var(--accent); }
.sb-role-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.sb-role-name { font-weight: 600; font-size: 0.85rem; }
.sb-role-who { font-size: 0.72rem; color: var(--muted); line-height: 1.35; }
.sb-role-n { font-size: 0.72rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.sb-cta { align-self: flex-start; margin-top: 0.3rem; }
.sb-panel { display: flex; flex-direction: column; gap: 0.7rem; }
.sb-panel[hidden] { display: none; }
.sb-title { font-size: 1.2rem; font-weight: 600; color: var(--text); }
.sb-sub { font-size: 0.8rem; color: var(--muted); margin-top: 0.15rem; }
.sb-wants { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.sb-label { font-size: 0.72rem; color: var(--muted); margin-right: 0.2rem; }
.sb-want { font-size: 0.72rem; padding: 0.1rem 0.55rem; border-radius: 999px; border: 1px solid var(--border);
  color: var(--text); background: var(--panel-bg); }
.sb-scores { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 0.6rem; }
.sb-score { border: 1px solid var(--border); border-radius: 10px; padding: 0.7rem 0.85rem; background: var(--panel-bg); }
.sb-score-v { font-size: 1.35rem; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text); }
.sb-score-p { font-size: 0.78rem; color: var(--accent); font-weight: 600; }
.sb-score-k { font-size: 0.72rem; color: var(--muted); margin-top: 0.15rem; }
.sb-list { border: 1px solid var(--border); border-radius: 10px; background: var(--panel-bg); overflow: hidden; }
.sb-q { padding: 0.75rem 0.95rem; display: flex; flex-direction: column; gap: 0.35rem; }
.sb-q + .sb-q { border-top: 1px solid var(--border-dim); }
.sb-q-head { display: flex; gap: 0.7rem; align-items: baseline; }
.sb-q-n { min-width: 1.3rem; color: var(--muted); font-size: 0.75rem; font-variant-numeric: tabular-nums; }
.sb-q-text { font-weight: 500; font-size: 0.88rem; line-height: 1.45; color: var(--text); }
.sb-truth, .sb-chips, .sb-answers { margin-left: 2rem; }
.sb-truth { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem; font-size: 0.82rem; }
.sb-truth-k { font-size: 0.68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.sb-truth-v { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.sb-detail { color: var(--muted); font-size: 0.76rem; }
.sb-detail::before { content: "· "; }
.sb-chips { display: flex; gap: 0.35rem; }
.sb-chip { font-size: 0.68rem; padding: 0.05rem 0.5rem; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); }
.sb-answers { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 0.5rem; margin-top: 0.2rem; }
.sb-ans { display: flex; flex-direction: column; gap: 0.15rem; border: 1px solid var(--border-dim); border-radius: 8px;
  padding: 0.45rem 0.6rem; font-size: 0.76rem; }
.sb-ans-k { font-size: 0.68rem; color: var(--muted); }
.sb-ans-mark { font-weight: 600; }
.sb-right .sb-ans-mark { color: var(--ok); }
.sb-wrong .sb-ans-mark { color: var(--err); }
.sb-ans-t { color: var(--text); line-height: 1.4; }
.sb-ans-none { color: var(--muted); }
@media (max-width: 900px) {
  .sb-page { flex-direction: column; overflow-y: auto; }
  .sb-left { flex: none; }
}
.sb-left { overflow-x: hidden; }
.sb-cta { white-space: normal; max-width: 100%; text-align: center; line-height: 1.35; }

/* ---------------------------------------------------------------- the user app's own rail icons (line icons as masks) */
.sc-ico { display: inline-block; width: 1.3rem; height: 1.3rem; background-color: currentColor;
  -webkit-mask: center / contain no-repeat; mask: center / contain no-repeat; }
.sc-ico-bench { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M12 3 7 21'/><path d='M12 3l5 18'/><path d='M8.8 14.5h6.4'/><path d='M7.7 18.5h8.6'/><path d='M10.1 10h3.8'/><path d='M4 21h16'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M12 3 7 21'/><path d='M12 3l5 18'/><path d='M8.8 14.5h6.4'/><path d='M7.7 18.5h8.6'/><path d='M10.1 10h3.8'/><path d='M4 21h16'/></svg>"); }
.sc-ico-benchmark { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><circle cx='12' cy='12' r='6'/><circle cx='12' cy='12' r='2'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><circle cx='12' cy='12' r='6'/><circle cx='12' cy='12' r='2'/></svg>"); }
.sc-ico-prod { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M12 22a7 7 0 0 0 7-7c0-2-1-3.9-3-5.5s-3.5-4-4-6.5c-.5 2.5-2 4.9-4 6.5C6 11.1 5 13 5 15a7 7 0 0 0 7 7z'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M12 22a7 7 0 0 0 7-7c0-2-1-3.9-3-5.5s-3.5-4-4-6.5c-.5 2.5-2 4.9-4 6.5C6 11.1 5 13 5 15a7 7 0 0 0 7 7z'/></svg>"); }
.sc-ico-quality { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z'/><path d='m9 12 2 2 4-4'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z'/><path d='m9 12 2 2 4-4'/></svg>"); }
.sc-ico-review { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><circle cx='18' cy='5' r='3'/><circle cx='6' cy='12' r='3'/><circle cx='18' cy='19' r='3'/><path d='m8.59 13.51 6.83 3.98'/><path d='m15.41 6.51-6.82 3.98'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><circle cx='18' cy='5' r='3'/><circle cx='6' cy='12' r='3'/><circle cx='18' cy='19' r='3'/><path d='m8.59 13.51 6.83 3.98'/><path d='m15.41 6.51-6.82 3.98'/></svg>"); }
.sc-ico-viewer { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z'/><path d='M3.3 7 12 12l8.7-5'/><path d='M12 22V12'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z'/><path d='M3.3 7 12 12l8.7-5'/><path d='M12 22V12'/></svg>"); }
.sc-ico-voxel { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><rect width='7' height='7' x='3' y='3' rx='1'/><rect width='7' height='7' x='14' y='3' rx='1'/><rect width='7' height='7' x='14' y='14' rx='1'/><rect width='7' height='7' x='3' y='14' rx='1'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><rect width='7' height='7' x='3' y='3' rx='1'/><rect width='7' height='7' x='14' y='3' rx='1'/><rect width='7' height='7' x='14' y='14' rx='1'/><rect width='7' height='7' x='3' y='14' rx='1'/></svg>"); }

/* ---------------------------------------------------------------- Benchmark: one question, answered two ways */
.bq-page { flex-direction: column; gap: 0.7rem; padding: 0.5rem 0.8rem; overflow-y: auto; min-height: 0; }
.bq-q { font-size: 1.05rem; font-weight: 600; color: var(--text); display: flex; gap: 0.6rem; align-items: baseline; }
.bq-qid { font-size: 0.72rem; color: var(--muted); font-weight: 600; letter-spacing: .04em; }
.bq-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.6rem; }
.bq-card { border: 1px solid var(--border); border-left-width: 4px; border-radius: 10px; padding: 0.7rem 0.85rem;
  background: var(--panel-bg); display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; }
.bq-card-top { display: flex; flex-direction: column; gap: 0.1rem; }
.bq-card-t { font-size: 0.7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.bq-card-s { font-size: 0.72rem; color: var(--muted); }
.bq-card-text { font-size: 0.95rem; font-weight: 600; color: var(--text); line-height: 1.4; overflow-wrap: anywhere; }
.bq-ok { border-left-color: var(--ok); } .bq-ok .bq-card-s { color: var(--ok); }
.bq-bad { border-left-color: var(--err); } .bq-bad .bq-card-s { color: var(--err); }
.bq-gold { border-left-color: var(--accent); background: var(--wash); }
.bq-route { font-size: 0.8rem; color: var(--text); }
.bq-controls { display: flex; align-items: center; gap: 0.4rem; }
.bq-btn { border: 1px solid var(--border); background: var(--panel-bg); color: var(--accent); border-radius: 6px;
  padding: 0.3rem 0.7rem; cursor: pointer; font: inherit; font-size: 0.82rem; }
.bq-btn:hover { background: var(--wash); }
.bq-play { min-width: 6rem; }
.bq-slider { flex: 1; accent-color: var(--accent); }
.bq-count { font-size: 0.78rem; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 3rem; text-align: right; }
.bq-body { display: grid; grid-template-columns: minmax(0, 1fr) 22rem; gap: 0.8rem; min-height: 460px; }
.bq-fig { min-height: 460px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel-bg); }
.bq-side { display: flex; flex-direction: column; gap: 0.7rem; min-width: 0; }
.bq-step { border: 1px solid var(--border); border-radius: 10px; padding: 0.8rem 0.9rem; background: var(--panel-bg);
  font-size: 0.8rem; line-height: 1.5; color: var(--text); overflow-wrap: anywhere; }
.bq-step .tr-step-k { color: var(--muted); }
.bq-step .tr-step-v { font-weight: 600; }
.bq-step .pv-detail { color: var(--muted); margin: 0.3rem 0; }
.bq-step pre { white-space: pre-wrap; font-size: 0.72rem; background: var(--bg); border-radius: 6px; padding: 0.5rem; margin: 0.3rem 0; }
.bq-step summary { cursor: pointer; color: var(--muted); font-size: 0.74rem; }
.bq-side .tr-summary { border: 1px solid var(--border); border-radius: 10px; padding: 0.7rem 0.9rem; font-size: 0.78rem;
  background: var(--panel-bg); color: var(--text); }
.bq-foot { font-size: 0.72rem; color: var(--muted); }
@media (max-width: 900px) {
  .bq-cards { grid-template-columns: 1fr; }
  .bq-body { grid-template-columns: 1fr; }
}

/* Benchmark, as the app's traceability view: light panels in either theme (the app's light palette, scoped here) */
.bq-light { --text: #16141F; --muted: #5d5b6b; --border: #dcdbe2; --border-dim: #e9e8ee; --panel-bg: #ffffff;
  --bg: #F5F5F8; --wash: rgba(83, 75, 127, 0.08); --accent: #534B7F; --accent-dim: #726B9D; --ok: #15803d; --err: #dc2626;
  background: #ffffff; color: #16141F; border: 1px solid #dcdbe2; border-radius: 12px; }
.bq-page { gap: 0.8rem; }
.bq-top { display: grid; grid-template-columns: 19rem minmax(0, 1fr); gap: 1rem; padding: 0.8rem 1rem; align-items: center; }
.bq-head .hl { border: 1px solid var(--border); border-radius: 10px; padding: 0.9rem 1rem; background: var(--bg); }
.bq-head .hl-role { font-size: 0.7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.bq-head .hl-top { display: flex; align-items: baseline; gap: 0.5rem; margin: 0.2rem 0; }
.bq-head .hl-value { font-size: 2.4rem; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.bq-head .hl-label { font-size: 0.85rem; color: var(--text); }
.bq-head .hl-sub { font-size: 0.78rem; color: var(--muted); }
.bq-head .hl-more { display: none; }
.bq-roles { height: 270px; min-width: 0; }
.bq-main { display: grid; grid-template-columns: 20rem minmax(0, 1fr); gap: 0.8rem; align-items: start; }
.bq-list { padding: 0.8rem 0.6rem 0.8rem 0.9rem; max-height: 900px; overflow-y: auto; }
.bq-list-h { font-size: 1rem; font-weight: 600; color: var(--accent); }
.bq-list-sub { font-size: 0.72rem; color: var(--muted); margin: 0.2rem 0 0.6rem; }
.bq-qi { display: flex; gap: 0.6rem; align-items: baseline; padding: 0.45rem 0.5rem; border-radius: 8px; font-size: 0.8rem;
  border: 1px solid transparent; }
.bq-qi-id { font-size: 0.7rem; font-weight: 700; color: var(--muted); min-width: 2.2rem; }
.bq-qi-t { flex: 1; line-height: 1.4; }
.bq-qi-on { border-color: var(--accent-dim); background: var(--wash); font-weight: 600; color: var(--text); }
.bq-qi-locked { color: #a9a6bc; cursor: not-allowed; }
.bq-qi-locked .bq-qi-id { color: #c4c2d1; }
.bq-qi-lock { font-size: 0.7rem; color: #c4c2d1; }
.bq-detail { padding: 0.9rem 1rem; display: flex; flex-direction: column; gap: 0.7rem; min-width: 0; }
.bq-figwrap { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.bq-fig { background: #ffffff; }
.bq-hint { font-size: 0.7rem; color: var(--muted); }
@media (max-width: 1100px) {
  .bq-top, .bq-main { grid-template-columns: 1fr; }
  .bq-list { max-height: 320px; }
}
.bq-fig { height: 620px; min-height: 0; overflow: hidden; border-radius: 10px; }
.bq-body { min-height: 0; align-items: start; }

/* ---------------------------------------------------------------- recorded Reasoner answers (assets/asks.js) */
.sa-card { display: flex; flex-direction: column; gap: 0.45rem; font-size: 0.82rem; line-height: 1.55; color: var(--text); }
.sa-title { font-weight: 600; font-size: 0.85rem; color: var(--accent); }
.sa-q { font-size: 0.78rem; color: var(--muted); border-left: 3px solid var(--accent-dim); padding-left: 0.5rem; }
.sa-asking { color: var(--muted); font-style: italic; }
.sa-asking::after { content: " ▮"; animation: sa-blink 1s steps(2, start) infinite; }
@keyframes sa-blink { to { visibility: hidden; } }
.sa-body h3, .sa-body h4, .sa-body h5 { margin: 0.6rem 0 0.25rem; font-size: 0.86rem; color: var(--text); }
.sa-body p { margin: 0.3rem 0; }
.sa-body ul, .sa-body ol { margin: 0.25rem 0 0.25rem 1.1rem; padding: 0; }
.sa-body table { border-collapse: collapse; margin: 0.4rem 0; font-size: 0.76rem; width: 100%; }
.sa-body th, .sa-body td { border: 1px solid var(--border); padding: 0.25rem 0.45rem; text-align: left; vertical-align: top; }
.sa-body th { background: var(--wash); }
.sa-body code { font-size: 0.74rem; background: var(--wash); padding: 0 0.25rem; border-radius: 4px; }
.sa-body pre { white-space: pre-wrap; background: var(--wash); padding: 0.5rem; border-radius: 6px; font-size: 0.72rem; }
.sa-body hr { border: none; border-top: 1px solid var(--border-dim); margin: 0.5rem 0; }
.sa-note { font-size: 0.7rem; color: var(--muted); border-top: 1px solid var(--border-dim); padding-top: 0.4rem; margin-top: 0.3rem; }

/* rail, as the user app (z-extra.css "rail, reView style"): a white tile for the active page, dark line icons */
.rv-nav { gap: 0.75rem; }
.rv-nav-item { width: 2.9rem; height: 2.9rem; border-radius: 9px; border: 1px solid transparent; background: transparent;
  box-shadow: none; color: var(--text); }
.rv-nav-item .sc-ico { width: 1.4rem; height: 1.4rem; opacity: .85; }
.rv-nav-item .pi { opacity: .85; }
.rv-nav-item:hover { background: var(--panel-bg); border-color: var(--border-dim); color: var(--text); }
.rv-nav-item:hover .sc-ico, .rv-nav-item:hover .pi { opacity: 1; }
.rv-nav-item:hover::after { display: none; }
.rv-nav-item.module-active { background: var(--panel-bg); border-color: var(--border); color: var(--text);
  box-shadow: 0 1px 3px rgba(22, 20, 31, .10), 0 1px 2px rgba(22, 20, 31, .06); }
.rv-nav-item.module-active .sc-ico, .rv-nav-item.module-active .pi { opacity: 1; }
.rv-nav-locked { color: var(--muted); }
