/* Sprint 14: Local self-hosted fonts — air-gapped deployment safe.
   Downloaded from Google Fonts on 2026-03-23. No external requests. */

@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('../fonts/DMSans-300-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'DM Sans';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/DMSans-400-italic.woff2') format('woff2');
}

@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/DMSans-400-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/DMSans-500-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/DMSans-600-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'DM Serif Display';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/DMSerifDisplay-400-italic.woff2') format('woff2');
}

@font-face {
  font-family: 'DM Serif Display';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/DMSerifDisplay-400-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('../fonts/JetBrainsMono-300-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/JetBrainsMono-400-italic.woff2') format('woff2');
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/JetBrainsMono-400-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/JetBrainsMono-500-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/JetBrainsMono-700-normal.woff2') format('woff2');
}

:root {
  --bg:       #0b0e14;
  --bg2:      #111520;
  --bg3:      #171d2b;
  --bg4:      #1e2636;
  --border:   #2a3347;
  --text:     #c8d4e8;
  --dim:      #5a6a85;
  --green:    #76b900;
  --green2:   #a3d44e;
  --red:      #e05252;
  --yellow:   #f0b429;
  --blue:     #4a9eff;
  --cyan:     #00d4d4;
  --copper:   #c87941;
  --purple:   #9b7fe8;
  --white:    #e8eef8;
  --font-mono: 'JetBrains Mono', monospace;
  --font-ui:   'DM Sans', sans-serif;
  --font-disp: 'DM Serif Display', serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 13px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── HEADER ── */
header {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  z-index: 100;
}
header h1 { font-family: var(--font-disp); font-size: 16px; color: var(--white); letter-spacing: .3px; margin: 0; }
header h1 span { color: var(--green); }
.hdr-brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.hdr-badge { font-family: var(--font-mono); font-size: 10px; background: rgba(118,185,0,.12); color: var(--green); border: 1px solid rgba(118,185,0,.25); padding: 2px 8px; border-radius: 3px; letter-spacing: .5px; }
.mode-switch { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border: 1px solid var(--border); background: rgba(10,18,32,.72); border-radius: 5px; flex-shrink: 0; }
.mode-tab { border: 0; border-radius: 3px; background: transparent; color: var(--dim); cursor: pointer; font-family: var(--font-mono); font-size: 10px; padding: 5px 9px; text-transform: uppercase; }
.mode-tab:hover { color: var(--text); background: rgba(255,255,255,.04); }
.mode-tab.active { color: #06100a; background: var(--green); font-weight: 700; }
.hdr-right { margin-left: auto; display: flex; gap: 8px; align-items: center; min-width: 0; }
.hdr-status-group,
.hdr-tool-group { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.hdr-status-group { padding-right: 10px; border-right: 1px solid var(--border); }
.hdr-tool-group { padding: 3px 6px; border: 1px solid transparent; border-radius: 5px; }
body[data-workspace-mode="training"] .hdr-tool-group[data-mode-scope="incident"],
body[data-workspace-mode="training"] .hdr-tool-group[data-mode-scope="fleet"],
body[data-workspace-mode="incident"] .hdr-tool-group[data-mode-scope="training"],
body[data-workspace-mode="incident"] .hdr-tool-group[data-mode-scope="fleet"],
body[data-workspace-mode="fleet"] .hdr-tool-group[data-mode-scope="training"],
body[data-workspace-mode="fleet"] .hdr-tool-group[data-mode-scope="incident"] { display: none; }
body[data-workspace-mode="incident"] .hdr-tool-group[data-mode-scope="incident"],
body[data-workspace-mode="fleet"] .hdr-tool-group[data-mode-scope="fleet"],
body[data-workspace-mode="training"] .hdr-tool-group[data-mode-scope="training"] { border-color: rgba(118,185,0,.22); background: rgba(118,185,0,.05); }
.hdr-stat { font-family: var(--font-mono); font-size: 10px; color: var(--dim); }
.hdr-stat span { color: var(--green); }
.hdr-settings { position: relative; flex-shrink: 0; }
.hdr-settings summary { list-style: none; border: 1px solid var(--border); border-radius: 3px; color: var(--dim); cursor: pointer; font-family: var(--font-mono); font-size: 10px; padding: 4px 9px; }
.hdr-settings summary::-webkit-details-marker { display: none; }
.hdr-settings summary:hover { border-color: var(--green); color: var(--green); }
.hdr-settings[open] summary { color: var(--green); border-color: rgba(118,185,0,.45); background: rgba(118,185,0,.08); }
.hdr-settings[open] .explain-toolbar { position: absolute; right: 0; top: calc(100% + 8px); z-index: 300; min-width: 260px; padding: 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg2); box-shadow: 0 14px 40px rgba(0,0,0,.42); }
.explain-toolbar { display: grid; grid-template-columns: 1fr; gap: 10px; align-items: stretch; }
.explain-toolbar-check { color: #c8d4e8; font-family: var(--font-mono); font-size: 10px; cursor: pointer; white-space: nowrap; }
.explain-toolbar-check input { margin-right: 4px; }
.explain-toolbar-select { color: var(--dim); font-family: var(--font-mono); font-size: 10px; letter-spacing: .04em; text-transform: uppercase; display: inline-flex; align-items: center; gap: 6px; }
.explain-toolbar-select select { background: var(--bg3); border: 1px solid var(--border); color: var(--text); border-radius: 3px; padding: 4px 6px; font-family: var(--font-mono); font-size: 10px; }
.logout-btn { border-color: rgba(244,162,97,.55); color: #f4a261; background: #1a2030; }

/* ── LAYOUT ── */
.app { display: flex; flex: 1; overflow: hidden; }

/* ── SIDEBAR ── */
.sidebar { width: 220px; background: var(--bg2); border-right: 1px solid var(--border); display: flex; flex-direction: column; overflow: hidden; flex-shrink: 0; }
.sidebar-section { padding: 8px 12px 4px; font-size: 9px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--dim); font-weight: 600; }
.nav-item { display: flex; align-items: center; gap: 8px; padding: 6px 12px; cursor: pointer; border-left: 2px solid transparent; transition: all .15s; font-size: 12px; color: var(--dim); line-height: 1.3; }
.nav-item:hover { background: rgba(255,255,255,.03); color: var(--text); border-left-color: var(--border); }
.nav-item.active { background: rgba(118,185,0,.07); color: var(--green); border-left-color: var(--green); }
.nav-item .icon { font-size: 13px; min-width: 16px; flex-shrink: 0; }
.nav-item .badge { margin-left: auto; font-family: var(--font-mono); font-size: 9px; background: var(--bg4); color: var(--dim); padding: 1px 5px; border-radius: 2px; }
.nav-item.done .badge { background: rgba(118,185,0,.15); color: var(--green); }
.sidebar-scroll { overflow-y: auto; flex: 1; }
.sidebar-scroll::-webkit-scrollbar { width: 3px; }
.sidebar-scroll::-webkit-scrollbar-track { background: transparent; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.sidebar-action-row { display: grid; grid-template-columns: 1fr; gap: 6px; padding: 4px 12px 10px; }
.sidebar-action-row .btn-sm { width: 100%; margin: 0; border-radius: 3px; font-size: 11px; padding: 6px; }

/* ── MAIN ── */
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

/* ── DIAGRAM PANE ── */
.diagram-pane { flex: 1; position: relative; overflow: hidden; min-height: 0; }
#diagram-canvas { width: 100%; height: 100%; display: block; }
.cluster-dashboard-pane { position: fixed; inset: 0; padding: 28px; overflow-y: auto; background: rgba(6,13,22,.82); backdrop-filter: blur(6px); z-index: 5000; }
.cluster-dashboard-shell { width: min(1500px, 100%); min-height: calc(100vh - 56px); margin: 0 auto; padding: 18px; border: 1px solid rgba(74,158,255,.18); border-radius: 18px; box-shadow: 0 18px 64px rgba(0,0,0,.52); background:
  radial-gradient(circle at top left, rgba(74,158,255,.10), transparent 32%),
  radial-gradient(circle at right 20%, rgba(118,185,0,.07), transparent 26%),
  linear-gradient(180deg, rgba(17,21,32,.985), rgba(11,14,20,.975)); }
.cluster-dashboard-topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.cluster-dashboard-kicker { font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: .16em; color: var(--blue); margin-bottom: 6px; }
.cluster-dashboard-subtitle { max-width: 760px; font-size: 11px; color: var(--dim); line-height: 1.6; }
.cluster-dashboard-close { position: sticky; top: 0; flex-shrink: 0; border: 1px solid rgba(255,255,255,.10); background: rgba(255,255,255,.03); }
.cluster-fleet-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr) 300px; gap: 14px; align-items: start; min-height: calc(100vh - 150px); }
.cluster-fleet-kpis,
.cluster-fleet-main,
.cluster-fleet-side { min-width: 0; }
.cluster-fleet-kpis,
.cluster-fleet-side { display: grid; gap: 10px; align-content: start; position: sticky; top: 0; }
.cluster-fleet-main { display: grid; gap: 12px; min-width: 0; }
.cluster-dashboard-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.cluster-node-card { border: 1px solid var(--border); border-radius: 10px; background: linear-gradient(180deg, rgba(23,29,43,.92), rgba(11,14,20,.92)); padding: 12px; box-shadow: inset 0 1px 0 rgba(255,255,255,.03); }
.cluster-node-card.tone-healthy { border-color: rgba(118,185,0,.18); }
.cluster-node-card.tone-warning { border-color: rgba(240,180,41,.28); }
.cluster-node-card.tone-critical { border-color: rgba(224,82,82,.34); }
.cluster-node-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.cluster-node-name { font-family: var(--font-mono); font-size: 12px; color: var(--white); letter-spacing: .04em; }
.cluster-node-sub { font-size: 10px; color: var(--dim); margin-top: 2px; text-transform: uppercase; letter-spacing: .08em; }
.cluster-node-state { font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--border); }
.cluster-node-state.tone-healthy { color: var(--green); border-color: rgba(118,185,0,.28); background: rgba(118,185,0,.08); }
.cluster-node-state.tone-warning { color: var(--yellow); border-color: rgba(240,180,41,.28); background: rgba(240,180,41,.08); }
.cluster-node-state.tone-critical { color: var(--red); border-color: rgba(224,82,82,.34); background: rgba(224,82,82,.10); }
.cluster-node-job { font-size: 11px; color: var(--text); margin-bottom: 8px; }
.cluster-node-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; margin-bottom: 10px; }
.cluster-node-metrics span { font-family: var(--font-mono); font-size: 10px; color: var(--dim); }
.cluster-gpu-strip { display: grid; grid-template-columns: repeat(9, 1fr); gap: 4px; margin-bottom: 10px; }
.cluster-gpu-cell { display: block; aspect-ratio: 1; border-radius: 3px; border: 1px solid rgba(255,255,255,.04); }
.cluster-gpu-cell.tone-healthy { background: rgba(118,185,0,.20); }
.cluster-gpu-cell.tone-active { background: rgba(74,158,255,.30); }
.cluster-gpu-cell.tone-warning { background: rgba(240,180,41,.34); }
.cluster-gpu-cell.tone-critical { background: rgba(224,82,82,.38); }
.cluster-node-notes { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.cluster-node-notes span { font-family: var(--font-mono); font-size: 9.5px; padding: 3px 6px; border-radius: 999px; background: rgba(240,180,41,.10); border: 1px solid rgba(240,180,41,.20); color: #ffd37b; }
.cluster-node-foot { display: flex; flex-wrap: wrap; gap: 10px; font-size: 10px; color: var(--dim); }
.cluster-kpi { min-width: 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: linear-gradient(180deg, rgba(17,21,32,.92), rgba(11,14,20,.92)); }
.cluster-kpi-label { font-family: var(--font-mono); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); margin-bottom: 6px; }
.cluster-kpi-value { font-family: var(--font-mono); font-size: 19px; color: var(--white); line-height: 1; margin-bottom: 5px; }
.cluster-kpi-meta { font-size: 10px; color: var(--dim); line-height: 1.5; }
.cluster-kpi-health { border-color: rgba(118,185,0,.22); }
.cluster-kpi-gpus { border-color: rgba(74,158,255,.22); }
.cluster-kpi-util { border-color: rgba(240,180,41,.22); }
.cluster-kpi-power { border-color: rgba(200,121,65,.26); }
.cluster-side-card { margin-bottom: 10px; }
.cluster-fleet-side .cluster-side-card { margin-bottom: 0; }
.cluster-mini-list { display: grid; gap: 8px; }
.cluster-mini-item { display: grid; gap: 4px; padding: 8px 10px; border-radius: 6px; background: rgba(255,255,255,.02); border: 1px solid rgba(255,255,255,.04); }
.cluster-mini-item strong { font-size: 10.5px; color: var(--white); line-height: 1.5; }
.cluster-mini-item span { font-size: 10px; color: var(--dim); line-height: 1.5; }
.cluster-mini-item.tone-warn strong { color: #ffd37b; }
.cluster-mini-item.tone-info strong { color: #9ad0ff; }
.cluster-submit-card,
.cluster-jobs-card { border: 1px solid var(--border); border-radius: 10px; background: linear-gradient(180deg, rgba(23,29,43,.94), rgba(11,14,20,.94)); padding: 12px; }
.cluster-submit-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.cluster-submit-head-secondary { margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.06); }
.cluster-submit-title { font-family: var(--font-mono); font-size: 11px; color: var(--white); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 4px; }
.cluster-submit-copy { font-size: 10.5px; color: var(--dim); line-height: 1.65; max-width: 900px; }
.cluster-submit-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.cluster-submit-btn { display: grid; gap: 4px; min-height: 70px; text-align: left; padding: 10px; background: rgba(255,255,255,.02); border: 1px solid rgba(74,158,255,.18); border-radius: 8px; color: var(--text); cursor: pointer; transition: border-color .15s, transform .15s, background .15s; }
.cluster-submit-btn:hover { border-color: rgba(118,185,0,.32); background: rgba(118,185,0,.08); transform: translateY(-1px); }
.cluster-submit-btn.tone-warning { border-color: rgba(240,180,41,.22); }
.cluster-submit-btn.tone-warning:hover { border-color: rgba(240,180,41,.36); background: rgba(240,180,41,.10); }
.cluster-submit-btn.tone-critical { border-color: rgba(224,82,82,.22); }
.cluster-submit-btn.tone-critical:hover { border-color: rgba(224,82,82,.38); background: rgba(224,82,82,.10); }
.cluster-submit-btn span { font-family: var(--font-mono); font-size: 11px; color: var(--white); }
.cluster-submit-btn small { font-size: 10px; color: var(--dim); line-height: 1.4; }
.cluster-submit-empty { display: flex; align-items: center; min-height: 54px; padding: 0 4px; font-size: 10px; color: var(--dim); }
.cluster-clear-btn { font-family: var(--font-mono); font-size: 10px; padding: 6px 10px; border-radius: 5px; border: 1px solid rgba(74,158,255,.28); background: rgba(74,158,255,.08); color: var(--blue); cursor: pointer; }
.cluster-clear-btn:hover { background: rgba(74,158,255,.14); }
.cluster-jobs-shell { overflow-x: auto; }
.cluster-jobs-table { width: 100%; border-collapse: collapse; font-size: 11px; min-width: 880px; }
.cluster-jobs-table th { text-align: left; padding: 7px 8px; color: var(--dim); border-bottom: 1px solid rgba(255,255,255,.08); font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.cluster-jobs-table td { padding: 8px; border-bottom: 1px solid rgba(255,255,255,.05); color: var(--text); vertical-align: middle; }
.cluster-job-id { font-family: var(--font-mono); color: var(--green); }
.cluster-job-assigned { color: var(--dim); font-size: 10px; }
.cluster-cancel-btn { font-family: var(--font-mono); font-size: 10px; padding: 4px 9px; border-radius: 4px; border: 1px solid rgba(224,82,82,.34); background: rgba(224,82,82,.08); color: var(--red); cursor: pointer; }
.cluster-cancel-btn:hover { background: rgba(224,82,82,.14); }

/* ── TERMINAL PANE ── */
.terminal-pane { height: 280px; border-top: 1px solid var(--border); display: flex; flex-direction: column; flex-shrink: 0; }
.terminal-tabs { display: flex; background: var(--bg2); border-bottom: 1px solid var(--border); flex-shrink: 0; }
.terminal-tab { padding: 6px 16px; font-family: var(--font-mono); font-size: 10px; color: var(--dim); cursor: pointer; border-right: 1px solid var(--border); transition: all .15s; display: flex; align-items: center; gap: 6px; }
.terminal-tab.active { background: var(--bg3); color: var(--green); }
.terminal-tab:hover:not(.active) { color: var(--text); }
.terminal-tab .tab-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--dim); }
.terminal-tab.active .tab-dot { background: var(--green); animation: pulse-dot 2s infinite; }
@keyframes pulse-dot { 0%,100%{opacity:1} 50%{opacity:.4} }
.terminal-actions { margin-left: auto; display: flex; align-items: center; gap: 4px; padding: 0 8px; }
.btn-sm { font-family: var(--font-mono); font-size: 10px; padding: 3px 10px; border-radius: 3px; border: 1px solid var(--border); background: transparent; color: var(--dim); cursor: pointer; transition: all .15s; }
.btn-sm:hover { border-color: var(--green); color: var(--green); }
.btn-sm.primary { background: var(--green); color: #000; border-color: var(--green); font-weight: 700; }
.btn-sm.primary:hover { background: var(--green2); }
.btn-sm.danger { border-color: var(--red); color: var(--red); }
.btn-sm.danger:hover { background: rgba(224,82,82,.1); }

.terminal-body { flex: 1; min-height: 0; overflow: hidden; position: relative; display: flex; }
.terminal-actions .btn-sm.active { border-color: var(--blue); color: var(--blue); background: rgba(74,158,255,.10); }
.terminal-output { flex: 1; min-height: 0; overflow-y: auto; padding: 10px 14px; font-family: var(--font-mono); font-size: 11.5px; line-height: 1.65; }
.terminal-output::-webkit-scrollbar { width: 4px; }
.terminal-output::-webkit-scrollbar-thumb { background: var(--border); }

.lab-step-coach { position: absolute; top: 14px; right: 14px; width: min(420px, calc(100% - 28px)); height: calc(100% - 28px); min-height: 0; display: flex; flex-direction: column; overflow: hidden; z-index: 15; pointer-events: auto; }
.lab-step-coach.is-hidden { display: none; }
.lab-step-coach-shell { height: 100%; display: flex; flex-direction: column; background: rgba(10,18,32,.97); border: 1px solid rgba(74,158,255,.18); box-shadow: 0 18px 40px rgba(0,0,0,.35); border-radius: 8px; overflow: hidden; backdrop-filter: blur(8px); }
.lab-step-coach-topbar { position: relative; z-index: 1; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 10px 12px 9px; border-bottom: 1px solid rgba(255,255,255,.08); background: linear-gradient(180deg, rgba(74,158,255,.08), rgba(255,255,255,0)); flex-shrink: 0; }
.lab-step-coach-actions { display: flex; align-items: center; gap: 6px; }
.lab-step-coach-content { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; scrollbar-gutter: stable; padding: 14px; }
.lab-step-coach-content::-webkit-scrollbar { width: 4px; }
.lab-step-coach-content::-webkit-scrollbar-thumb { background: var(--border); }
.lab-step-coach-close { position: relative; z-index: 2; background: none; border: none; color: var(--dim); font-size: 14px; cursor: pointer; line-height: 1; padding: 1px 3px; }
.lab-step-coach-close:hover { color: var(--text); }
.lab-step-coach-kicker { font-family: var(--font-mono); font-size: 9px; color: var(--blue); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 3px; }
.lab-step-coach-title { font-family: var(--font-disp); font-size: 15px; line-height: 1.2; color: var(--white); margin-bottom: 0; }
.lab-step-coach p { font-size: 11.5px; line-height: 1.8; color: var(--text); margin: 0 0 12px; }
.lab-step-coach p:last-child { margin-bottom: 0; }
.lab-step-coach-code { display: block; background: var(--bg4); border: 1px solid rgba(255,255,255,.08); border-radius: 6px; padding: 10px 12px; font-family: var(--font-mono); font-size: 10px; color: var(--green2); margin: 0 0 12px; white-space: pre-wrap; word-break: break-word; }
.lab-step-coach-section { margin-top: 0; margin-bottom: 14px; padding: 12px; border: 1px solid rgba(255,255,255,.06); border-radius: 6px; background: rgba(255,255,255,.02); }
.lab-step-coach-section:last-child { margin-bottom: 0; }
.lab-step-coach-section-title { font-family: var(--font-mono); font-size: 10px; color: var(--dim); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 10px; }
.lab-step-coach-list { list-style: disc; padding-left: 20px; margin: 0; display: grid; gap: 8px; }
.lab-step-coach-list li { color: var(--text); font-size: 11.5px; line-height: 1.75; margin: 0; }
.lab-step-coach-clue { background: var(--bg4); border: 1px solid rgba(74,158,255,.14); border-radius: 6px; padding: 10px 12px; margin-bottom: 10px; }
.lab-step-coach-clue:last-child { margin-bottom: 0; }
.lab-step-coach-clue-line { font-family: var(--font-mono); font-size: 10px; color: var(--white); margin-bottom: 6px; white-space: pre-wrap; word-break: break-word; }
.lab-step-coach-clue-meaning { font-size: 11.5px; color: var(--dim); line-height: 1.75; }
.lab-step-coach-callout { border-left: 3px solid var(--green); padding: 0 0 0 12px; margin-bottom: 14px; }
.lab-step-coach-callout.warn { border-color: var(--yellow); }
.lab-step-coach-callout.err { border-color: var(--red); }
.lab-step-coach-topic-label { display: inline-block; margin-right: 6px; font-family: var(--font-mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
.lab-step-coach-topic-label-purpose { color: #7cc6ff; }
.lab-step-coach-topic-label-doing { color: #8fe388; }
.lab-step-coach-topic-label-matters { color: #f7bf68; }
.ask-aegis { border-color: rgba(244,162,97,.34); background: linear-gradient(180deg, rgba(244,162,97,.14), rgba(244,162,97,.05)); box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 0 0 1px rgba(244,162,97,.06); }
.ask-aegis-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.ask-aegis-title { color: #ffd2a8; margin-bottom: 4px; }
.ask-aegis-subtitle { margin: 0; font-size: 10.5px; line-height: 1.6; color: #f0d8c0; }
.ask-aegis-badge { display: inline-flex; align-items: center; min-height: 24px; padding: 0 10px; border-radius: 999px; background: rgba(10,16,26,.72); border: 1px solid rgba(244,162,97,.34); color: #ffd2a8; font-size: 10px; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .08em; white-space: nowrap; }
.ask-aegis-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.ask-aegis-btn { display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px; border-radius: 999px; border: 1px solid rgba(244,162,97,.28); background: rgba(10,16,26,.78); color: #ffe4c8; font-size: 10.5px; cursor: pointer; }
.ask-aegis-btn.is-active, .ask-aegis-btn:hover { border-color: rgba(244,162,97,.66); background: rgba(244,162,97,.20); color: var(--white); }
.ask-aegis-answer { padding: 10px 12px; border-radius: 8px; border: 1px solid rgba(244,162,97,.20); background: rgba(10,16,26,.72); color: #fff1de; font-size: 11px; line-height: 1.7; }
.lab-step-shot-grid { display: grid; gap: 12px; }
.lab-step-shot-frame { margin: 0; }
.lab-step-shot-title { font-family: var(--font-mono); font-size: 10px; color: var(--white); letter-spacing: .04em; margin-bottom: 8px; }
.lab-step-shot-terminal { background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,0)), linear-gradient(135deg, rgba(74,158,255,.06), rgba(118,185,0,.04)), #0a0f18; border: 1px solid rgba(74,158,255,.16); border-radius: 8px; padding: 12px; box-shadow: inset 0 1px 0 rgba(255,255,255,.04); overflow-x: auto; }
.lab-step-shot-line { font-family: var(--font-mono); font-size: 10px; line-height: 1.6; color: #dbe6f7; white-space: pre; }
.lab-step-shot-caption { margin-top: 8px; font-size: 10.5px; line-height: 1.65; color: var(--dim); }
.snapshot-interest { margin-top: 10px; background: linear-gradient(180deg, rgba(74,158,255,.09), rgba(74,158,255,.05)); border: 1px solid rgba(74,158,255,.20); border-radius: 6px; padding: 10px 12px; box-shadow: inset 0 1px 0 rgba(255,255,255,.04); }
.snapshot-interest-title { font-family: var(--font-mono); font-size: 10px; color: #93c5ff; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; }
.snapshot-interest ul { list-style: none; display: grid; gap: 8px; margin: 0; padding: 0; }
.snapshot-interest li { display: grid; gap: 4px; color: #e7eefb; font-size: 11.5px; line-height: 1.65; }
.snapshot-interest code { color: #d9f99d; background: rgba(3,10,18,.42); border: 1px solid rgba(255,255,255,.09); border-radius: 4px; padding: 4px 6px; font-family: var(--font-mono); font-size: 10px; white-space: pre-wrap; word-break: break-word; }
.snapshot-interest span { color: #d7e3f4; }
.guided-step-screenshots { background: rgba(74,158,255,.04); }
.ai-static-overlay { display: none; position: absolute; top: 14px; right: 14px; width: min(520px, calc(100% - 28px)); height: calc(100% - 28px); max-width: 100%; overflow-y: auto; background: #0d1117; border: 2px solid var(--gold, #f4a261); border-radius: 6px; padding: 20px; z-index: 16; font-family: var(--font-mono); font-size: 11px; line-height: 1.7; color: #c8d4e8; white-space: pre-wrap; box-shadow: 0 4px 24px rgba(0,0,0,0.7); overscroll-behavior: contain; }
.ai-static-overlay::-webkit-scrollbar { width: 4px; }
.ai-static-overlay::-webkit-scrollbar-thumb { background: var(--border); }
.t-cmd    { color: var(--green); }
.t-comment{ color: #3d7a2c; }
.t-good   { color: var(--green2); }
.t-warn   { color: var(--yellow); }
.t-err    { color: var(--red); }
.t-info   { color: var(--blue); }
.t-cyan   { color: var(--cyan); }
.t-dim    { color: var(--dim); }
.t-white  { color: var(--white); }
.t-copper { color: var(--copper); }
.t-purple { color: var(--purple); }
.t-prompt { color: var(--dim); }
.t-val    { color: var(--yellow); }

.terminal-mode-status { padding: 7px 14px; border-bottom: 1px solid var(--border); background: rgba(10,18,32,.96); color: var(--dim); font-family: var(--font-mono); font-size: 10px; line-height: 1.45; flex-shrink: 0; }
.terminal-mode-status strong { color: var(--white); font-weight: 600; }
.terminal-mode-status .mode-guided { color: var(--green); }
.terminal-mode-status .mode-terminal { color: var(--blue); }
.terminal-input-row { display: flex; align-items: center; padding: 6px 14px; border-bottom: 1px solid var(--border); background: var(--bg2); flex-shrink: 0; }
.terminal-input-row span { color: var(--green); font-family: var(--font-mono); font-size: 11px; margin-right: 8px; }
#cmd-input { flex: 1; background: transparent; border: none; outline: none; color: var(--white); font-family: var(--font-mono); font-size: 11.5px; caret-color: var(--green); }
#cmd-input::placeholder { color: var(--dim); }

/* ── METRICS SIDEBAR ── */
.metrics-sidebar { width: 200px; background: var(--bg2); border-left: 1px solid var(--border); display: flex; flex-direction: column; flex-shrink: 0; overflow-y: auto; padding: 10px 0; }
/* Progressive disclosure: telemetry appears once a lab is active; incident mode always shows it */
body[data-workspace-mode="training"]:not(.lab-active) .metrics-sidebar { display: none; }
.metrics-sidebar::-webkit-scrollbar { width: 3px; }
.metrics-sidebar::-webkit-scrollbar-thumb { background: var(--border); }

.metric-group { padding: 8px 12px; border-bottom: 1px solid var(--border); }
.metric-group-title { font-size: 9px; text-transform: uppercase; letter-spacing: 1px; color: var(--dim); margin-bottom: 8px; font-weight: 600; }
.metric-group-title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.panel-popout-btn { border: 1px solid rgba(74,158,255,.22); background: rgba(74,158,255,.08); color: var(--blue); font-family: var(--font-mono); font-size: 9px; line-height: 1; text-transform: uppercase; letter-spacing: .08em; border-radius: 999px; padding: 5px 8px; cursor: pointer; }
.panel-popout-btn:hover { background: rgba(74,158,255,.16); color: var(--white); }
.panel-popout-btn.active { border-color: rgba(118,185,0,.35); color: var(--green); background: rgba(118,185,0,.12); }
.metric-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px; }
.metric-label { font-size: 10px; color: var(--dim); font-family: var(--font-mono); }
.metric-value { font-size: 11px; font-family: var(--font-mono); font-weight: 700; }
.metric-value.ok  { color: var(--green); }
.metric-value.warn{ color: var(--yellow); }
.metric-value.err { color: var(--red); }
.metric-value.dim { color: var(--dim); }
.metric-bar { width: 100%; height: 3px; background: var(--bg4); border-radius: 2px; margin: 2px 0 4px; overflow: hidden; }
.metric-bar-fill { height: 100%; border-radius: 2px; transition: width .8s ease, background .5s; }

.xid-log { padding: 8px 12px; flex: 1; }
.xid-title { font-size: 9px; text-transform: uppercase; letter-spacing: 1px; color: var(--dim); margin-bottom: 6px; font-weight: 600; }
.xid-entry { font-family: var(--font-mono); font-size: 9px; color: var(--dim); margin-bottom: 3px; line-height: 1.4; }
.xid-entry.warn { color: var(--yellow); }
.xid-entry.crit { color: var(--red); }
.live-explainer { border-top: 1px solid rgba(74,158,255,.15); }
.live-explainer-body { font-size: 11px; color: var(--text); line-height: 1.65; }
.live-explainer-body p { margin-bottom: 10px; }
.live-explainer-body p:last-child { margin-bottom: 0; }
.live-explainer-block { background: var(--bg4); border: 1px solid rgba(74,158,255,.12); border-radius: 4px; padding: 10px; margin-top: 10px; }
.live-explainer-title { font-family: var(--font-mono); font-size: 10px; color: var(--blue); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; }
.live-explainer-list { padding-left: 18px; margin: 0; }
.live-explainer-list li { font-size: 10.5px; color: var(--text); line-height: 1.6; margin-bottom: 6px; }
.live-explainer-list li:last-child { margin-bottom: 0; }
.diag-block { margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid rgba(255,255,255,.07); }
.diag-block:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.diag-title { font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: #f4a261; margin-bottom: 8px; }
.diag-list { padding-left: 18px; margin: 0; }
.diag-list li { margin-bottom: 6px; color: #c8d4e8; }
.diag-list li:last-child { margin-bottom: 0; }
.incident-explain { margin-top: 8px; padding: 8px 10px; background: rgba(74,158,255,.08); border: 1px solid rgba(74,158,255,.15); border-radius: 4px; color: var(--text); font-size: 10.5px; line-height: 1.6; font-family: var(--font-ui); }

/* ── OVERLAY PANELS ── */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 200; display: none; align-items: center; justify-content: center; }
.overlay.show { display: flex; }
.panel { background: var(--bg2); border: 1px solid var(--border); border-radius: 6px; width: 700px; max-height: 80vh; overflow-y: auto; padding: 28px; position: relative; }
.panel::-webkit-scrollbar { width: 4px; }
.panel::-webkit-scrollbar-thumb { background: var(--border); }
.panel-tools { position: sticky; top: 10px; z-index: 3; display: flex; justify-content: flex-end; gap: 8px; margin: -8px -8px 8px 0; }
.panel-tools .panel-popout-btn { padding: 6px 10px; font-size: 10px; }
.panel h2 { font-family: var(--font-disp); font-size: 20px; color: var(--white); margin-bottom: 6px; }
.panel p { color: var(--text); font-size: 13px; line-height: 1.7; margin-bottom: 12px; }
.quiz-panel { width: 760px; }
.study-panel { width: min(980px, calc(100vw - 36px)); }
.learn-tabs { display: flex; gap: 6px; margin-bottom: 16px; padding-right: 72px; }
.learn-tab { border: 1px solid var(--border); border-radius: 3px; background: transparent; color: var(--dim); cursor: pointer; font-family: var(--font-mono); font-size: 10px; padding: 5px 12px; text-transform: uppercase; transition: all .15s; }
.learn-tab:hover { color: var(--text); background: rgba(255,255,255,.04); }
.learn-tab.active { color: #06100a; background: var(--green); border-color: var(--green); font-weight: 700; }
.quiz-panel-header,
.study-panel-header { margin-bottom: 20px; padding-right: 36px; }
.quiz-panel-header p,
.study-panel-header p { color: var(--dim); font-size: 12px; margin-bottom: 0; }
.panel .close-btn { background: rgba(8,17,30,.92); border: 1px solid rgba(255,255,255,.08); border-radius: 999px; color: var(--dim); font-size: 18px; cursor: pointer; line-height: 1; padding: 6px 10px; backdrop-filter: blur(4px); }
.panel .close-btn:hover { color: var(--text); }

/* ── LAB INTRO PANEL ── */
.lab-intro .intro-action-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.lab-intro .intro-action-row-top { margin: 6px 0 16px; }
.lab-intro .objective { background: var(--bg3); border: 1px solid var(--border); border-left: 3px solid var(--green); padding: 12px 14px; border-radius: 3px; margin-bottom: 16px; }
.lab-intro .objective h4 { color: var(--green); font-size: 11px; text-transform: uppercase; letter-spacing: .8px; margin-bottom: 6px; }
.lab-intro .objective p { margin-bottom: 0; font-size: 12px; }
.learn-banner { background: linear-gradient(135deg, rgba(118,185,0,.14), rgba(74,158,255,.10)); border: 1px solid rgba(118,185,0,.22); border-left: 3px solid var(--green); padding: 12px 14px; border-radius: 4px; margin-bottom: 16px; }
.learn-banner.learn-banner-compact { border-left-color: var(--blue); background: linear-gradient(135deg, rgba(74,158,255,.12), rgba(200,212,232,.06)); }
.learn-banner-title { font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--white); margin-bottom: 6px; }
.learn-banner p { margin: 0; font-size: 12px; color: var(--text); line-height: 1.6; }
.learn-section { background: var(--bg3); border: 1px solid var(--border); border-radius: 4px; padding: 14px; margin-bottom: 14px; }
.learn-section.learn-callout { border-left: 3px solid var(--yellow); }
.learn-section.learn-take-home { border-left: 3px solid var(--green); background: linear-gradient(180deg, rgba(118,185,0,.06), rgba(255,255,255,.015)); }
.learn-section h4 { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--white); margin-bottom: 10px; }
.learn-section p { font-size: 12px; line-height: 1.7; margin-bottom: 10px; }
.learn-section p:last-child { margin-bottom: 0; }
.stack-handoff-intro { color: var(--white); margin-top: 12px; }
.stack-handoff-list { display: grid; gap: 10px; margin: 12px 0; }
.stack-handoff-card { background: rgba(255,255,255,.025); border: 1px solid var(--border); border-left: 3px solid var(--blue); border-radius: 4px; padding: 11px 12px; }
.stack-handoff-card p { font-size: 11.5px; margin: 0; }
.stack-handoff-top { display: flex; align-items: center; gap: 9px; margin-bottom: 6px; }
.stack-handoff-num { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; font-family: var(--font-mono); font-size: 11px; background: rgba(74,158,255,.12); color: var(--blue); border: 1px solid rgba(74,158,255,.28); }
.stack-handoff-card h5,
.stack-problem-callout h5,
.stack-version-check h5 { font-family: var(--font-mono); font-size: 10.5px; line-height: 1.35; text-transform: uppercase; letter-spacing: .08em; color: var(--white); margin: 0; }
.stack-handoff-green { border-left-color: var(--green); }
.stack-handoff-green .stack-handoff-num { background: rgba(118,185,0,.12); border-color: rgba(118,185,0,.28); color: var(--green); }
.stack-handoff-blue { border-left-color: var(--blue); }
.stack-handoff-yellow { border-left-color: var(--yellow); }
.stack-handoff-yellow .stack-handoff-num { background: rgba(240,180,41,.12); border-color: rgba(240,180,41,.28); color: var(--yellow); }
.stack-handoff-purple { border-left-color: #9b7fe8; }
.stack-handoff-purple .stack-handoff-num { background: rgba(155,127,232,.12); border-color: rgba(155,127,232,.28); color: #b7a4ff; }
.stack-handoff-cyan { border-left-color: var(--cyan); }
.stack-handoff-cyan .stack-handoff-num { background: rgba(0,212,255,.10); border-color: rgba(0,212,255,.26); color: var(--cyan); }
.stack-problem-callout { margin-top: 12px; padding: 12px; background: rgba(224,82,82,.06); border: 1px solid rgba(224,82,82,.20); border-left: 3px solid var(--red); border-radius: 4px; }
.stack-problem-callout h5 { color: #ffb0b0; margin-bottom: 6px; }
.stack-problem-callout p { font-size: 11.5px; margin: 0; }
.stack-version-check { margin-top: 12px; padding: 12px; background: rgba(74,158,255,.06); border: 1px solid rgba(74,158,255,.20); border-left: 3px solid var(--blue); border-radius: 4px; }
.stack-version-check h5 { color: var(--blue); margin-bottom: 6px; }
.stack-version-check p { font-size: 11.5px; margin-bottom: 8px; }
.stack-version-check ol { margin: 0; padding-left: 20px; }
.stack-version-check li { font-size: 11.5px; line-height: 1.65; margin-bottom: 6px; }
.stack-version-check li:last-child { margin-bottom: 0; }
.detached-panel-window { margin: 0; min-height: 100vh; background: radial-gradient(circle at top, rgba(20,34,56,.9), #08111e 62%); color: var(--text); overflow-y: auto; }
.detached-panel-frame { min-height: 100vh; padding: 18px; box-sizing: border-box; overflow-y: auto; }
.detached-panel-frame .panel { width: min(1120px, 100%); max-height: none; overflow: visible; margin: 0 auto; box-sizing: border-box; }
.detached-panel-frame .panel-tools { position: sticky; top: 0; padding-top: 2px; }
.detached-panel-frame .detached-overlay-panel { max-height: calc(100vh - 36px); overflow-y: auto; overscroll-behavior: contain; }
.detached-panel-frame .detached-overlay-panel::-webkit-scrollbar { width: 6px; }
.detached-panel-frame .detached-overlay-panel::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 999px; }
.detached-panel-frame .lab-step-coach-shell { height: calc(100vh - 36px); }
.detached-panel-frame .live-explainer { border-top: none; background: rgba(10,18,32,.97); border: 1px solid rgba(74,158,255,.18); border-radius: 8px; box-shadow: 0 18px 40px rgba(0,0,0,.35); min-height: calc(100vh - 36px); box-sizing: border-box; }
.detached-panel-frame .metric-group-title { padding-bottom: 10px; margin-bottom: 12px; border-bottom: 1px solid rgba(255,255,255,.08); }
.learn-heading-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.explain-card { background: var(--bg4); border: 1px solid rgba(255,255,255,.08); border-radius: 4px; padding: 12px; margin-bottom: 12px; }
.explain-card-title { font-family: var(--font-mono); font-size: 10px; color: var(--blue); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; }
.explain-card p { font-size: 11.5px; color: var(--text); line-height: 1.7; margin-bottom: 8px; }
.explain-card p:last-child { margin-bottom: 0; }
.explain-card-profile { border-left: 3px solid var(--cyan); }
.explain-card-role { border-color: rgba(118,185,0,.18); }
.explain-card-misread { border-color: rgba(224,82,82,.18); background: rgba(224,82,82,.05); }
.explain-card-counterfactual { border-color: rgba(74,158,255,.18); background: rgba(74,158,255,.05); }
.explain-card-uncertainty { border-color: rgba(240,180,41,.18); background: rgba(240,180,41,.05); }
.explain-card-selfcheck { border-color: rgba(118,185,0,.18); background: rgba(118,185,0,.05); }
.explain-card-tradeoff { border-color: rgba(200,121,65,.18); background: rgba(200,121,65,.05); }
.explain-card-network { border-color: rgba(155,127,232,.18); background: rgba(155,127,232,.05); }
.explain-pill-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.explain-pill { display: inline-flex; gap: 6px; align-items: center; font-family: var(--font-mono); font-size: 10px; border-radius: 999px; padding: 4px 8px; border: 1px solid var(--border); background: var(--bg4); color: var(--text); }
.explain-pill strong { color: var(--dim); font-weight: 500; }
.explain-pill-good { border-color: rgba(118,185,0,.28); color: var(--green2); }
.explain-pill-mid { border-color: rgba(74,158,255,.28); color: var(--blue); }
.explain-pill-warn { border-color: rgba(240,180,41,.28); color: var(--yellow); }
.explain-list { padding-left: 18px; margin: 0; }
.explain-list li { color: var(--text); font-size: 11px; line-height: 1.7; margin-bottom: 6px; }
.explain-list li:last-child { margin-bottom: 0; }
.explain-chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.explain-chip { font-family: var(--font-mono); font-size: 10px; color: var(--white); background: rgba(155,127,232,.16); border: 1px solid rgba(155,127,232,.24); border-radius: 999px; padding: 4px 8px; }
.explain-selfcheck-context { color: var(--dim); border-top: 1px solid rgba(255,255,255,.05); padding-top: 8px; }
.learn-mode-tag { font-family: var(--font-mono); font-size: 10px; color: var(--blue); background: rgba(74,158,255,.10); border: 1px solid rgba(74,158,255,.22); padding: 2px 7px; border-radius: 999px; }
.term-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.term-card { background: var(--bg4); border: 1px solid var(--border); border-radius: 4px; padding: 12px; }
.term-name { font-family: var(--font-mono); font-size: 11px; color: var(--yellow); margin-bottom: 8px; }
.term-card p { font-size: 11.5px; margin-bottom: 8px; }
.term-why { font-size: 10px; color: var(--dim); line-height: 1.5; border-top: 1px solid rgba(255,255,255,.05); padding-top: 8px; }
.learn-timeline { list-style: none; display: flex; flex-direction: column; gap: 10px; counter-reset: learn-step; }
.learn-timeline li { position: relative; padding-left: 42px; min-height: 28px; }
.learn-timeline li::before { counter-increment: learn-step; content: counter(learn-step); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--border); background: var(--bg4); color: var(--green); font-family: var(--font-mono); font-size: 10px; display: flex; align-items: center; justify-content: center; }
.timeline-title { font-size: 12px; color: var(--white); font-weight: 600; margin-bottom: 4px; }
.timeline-body { font-size: 11px; color: var(--text); line-height: 1.6; }
.learn-list { padding-left: 18px; margin: 0; }
.learn-list li { color: var(--text); font-size: 11.5px; line-height: 1.7; margin-bottom: 6px; }
.learn-list li:last-child { margin-bottom: 0; }
.guided-steps { display: grid; gap: 12px; }
.guided-step-card { background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.01)); border: 1px solid var(--border); border-radius: 6px; padding: 12px; }
.guided-step-card-fault { border-color: rgba(224,82,82,.45); box-shadow: inset 0 0 0 1px rgba(224,82,82,.08); }
.guided-step-top { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.guided-step-header { min-width: 0; flex: 1; }
.guided-step-label { font-size: 13px; color: var(--white); font-weight: 600; }
.guided-step-block { margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.06); }
.guided-step-context { background: rgba(74,158,255,.05); border: 1px solid rgba(74,158,255,.14); border-radius: 4px; padding: 10px; }
.guided-step-compare { background: rgba(240,180,41,.05); border: 1px solid rgba(240,180,41,.16); border-radius: 4px; padding: 10px; }
.guided-step-title { font-family: var(--font-mono); font-size: 10px; color: var(--blue); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 7px; }
.guided-step-compare .guided-step-title { color: var(--yellow); }
.guided-step-block p { font-size: 11.5px; color: var(--text); line-height: 1.75; margin: 0; }
.guided-step-list { padding-left: 18px; margin: 0; }
.guided-step-list li { color: var(--text); font-size: 11px; line-height: 1.7; margin-bottom: 6px; }
.guided-step-list li:last-child { margin-bottom: 0; }
.steps-list { list-style: none; }
.steps-list li { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 10px; font-size: 12px; color: var(--text); }
.step-num { flex-shrink: 0; width: 20px; height: 20px; border-radius: 50%; background: var(--bg4); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-size: 10px; color: var(--dim); margin-top: 1px; }
.step-hint { font-family: var(--font-mono); font-size: 10px; color: var(--dim); background: var(--bg4); border: 1px solid var(--border); padding: 3px 7px; border-radius: 3px; margin-top: 4px; display: inline-block; }

/* ── STUDY PANEL ── */
.study-hero { border: 1px solid rgba(118,185,0,.22); border-left: 3px solid var(--green); border-radius: 6px; background: linear-gradient(135deg, rgba(118,185,0,.10), rgba(74,158,255,.06)); padding: 16px; margin-bottom: 14px; }
.study-hero-kicker { font-family: var(--font-mono); font-size: 10px; letter-spacing: .10em; text-transform: uppercase; color: var(--green); margin-bottom: 6px; }
.study-hero h3 { font-family: var(--font-disp); font-size: 22px; color: var(--white); margin-bottom: 8px; line-height: 1.2; }
.study-hero p { color: var(--text); font-size: 12.5px; margin: 0; }
.study-official { border-left: 3px solid var(--blue); }
.study-official-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; margin-bottom: 12px; }
.study-official-card { border: 1px solid rgba(74,158,255,.18); background: rgba(74,158,255,.06); border-radius: 4px; color: var(--text); font-family: var(--font-mono); font-size: 10.5px; line-height: 1.5; padding: 9px 10px; }
.study-blueprint-bars { display: grid; gap: 8px; margin-top: 6px; }
.study-blueprint-row { display: grid; grid-template-columns: minmax(130px, 1fr) minmax(120px, 2fr) 42px; align-items: center; gap: 10px; }
.study-blueprint-label,
.study-blueprint-value { font-family: var(--font-mono); font-size: 10px; color: var(--dim); }
.study-blueprint-value { color: var(--white); text-align: right; }
.study-blueprint-track { height: 6px; border-radius: 999px; background: rgba(255,255,255,.06); overflow: hidden; }
.study-blueprint-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--green), var(--blue)); }
.study-source-link { display: inline-block; margin-top: 12px; color: var(--blue); font-family: var(--font-mono); font-size: 10px; text-decoration: none; }
.study-source-link:hover { color: var(--green); }
.study-model p { font-size: 12px; line-height: 1.75; }
.study-path { display: grid; gap: 12px; }
.study-phase { background: linear-gradient(180deg, rgba(255,255,255,.025), rgba(255,255,255,.01)); border: 1px solid var(--border); border-radius: 6px; padding: 14px; }
.study-phase-top { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.study-phase-num { width: 28px; height: 28px; border-radius: 50%; background: rgba(118,185,0,.12); border: 1px solid rgba(118,185,0,.28); color: var(--green); font-family: var(--font-mono); font-size: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.study-phase h5 { color: var(--white); font-size: 14px; line-height: 1.25; margin-bottom: 4px; }
.study-focus { color: var(--dim); font-size: 11.5px; line-height: 1.5; }
.study-mini-title { font-family: var(--font-mono); color: var(--blue); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; margin: 10px 0 7px; }
.study-list { padding-left: 18px; margin: 0 0 10px; }
.study-list li { color: var(--text); font-size: 11.5px; line-height: 1.7; margin-bottom: 5px; }
.study-trap { background: rgba(240,180,41,.06); border: 1px solid rgba(240,180,41,.18); border-radius: 4px; color: var(--text); font-size: 11.5px; line-height: 1.65; padding: 10px; margin: 10px 0; }
.study-trap strong { color: var(--yellow); }
.study-lab-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.study-lab-link { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px; border: 1px solid rgba(74,158,255,.20); background: rgba(74,158,255,.07); color: var(--text); border-radius: 4px; padding: 7px 10px; cursor: pointer; font-family: var(--font-ui); max-width: 100%; }
.study-lab-link:hover { border-color: var(--green); color: var(--white); background: rgba(118,185,0,.08); }
.study-lab-link span { font-size: 11.5px; line-height: 1.25; }
.study-lab-link small { color: var(--dim); font-family: var(--font-mono); font-size: 9px; }
.study-check-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; }
.study-check { background: var(--bg4); border: 1px solid var(--border); border-radius: 5px; padding: 12px; }
.study-check p { font-size: 11.5px; line-height: 1.65; }
.study-check details { border-top: 1px solid rgba(255,255,255,.06); padding-top: 8px; }
.study-check summary { color: var(--green); cursor: pointer; font-family: var(--font-mono); font-size: 10px; }
.study-check details div { color: var(--text); font-size: 11px; line-height: 1.65; margin-top: 8px; }

/* ── QUIZ PANEL ── */
.quiz-q { background: var(--bg3); border: 1px solid var(--border); border-radius: 4px; padding: 14px; margin-bottom: 10px; }
.quiz-q .q-text { font-size: 13px; color: var(--white); margin-bottom: 10px; font-weight: 500; }
.quiz-option { display: flex; align-items: flex-start; gap: 10px; padding: 7px 10px; border-radius: 4px; cursor: pointer; margin-bottom: 4px; font-size: 12px; border: 1px solid transparent; transition: all .15s; }
.quiz-option:hover { background: var(--bg4); border-color: var(--border); }
.quiz-option.answered { cursor: default; }
.quiz-option.answered:not(.correct):not(.wrong):hover { background: transparent; border-color: transparent; }
.quiz-option.selected { background: rgba(74,158,255,.1); border-color: var(--blue); }
.quiz-option.correct { background: rgba(118,185,0,.1); border-color: var(--green); color: var(--green); }
.quiz-option.wrong   { background: rgba(224,82,82,.1); border-color: var(--red); color: var(--red); }
.quiz-option .opt-key { font-family: var(--font-mono); font-size: 10px; background: var(--bg4); padding: 1px 6px; border-radius: 2px; flex-shrink: 0; margin-top: 1px; }
.quiz-explain { margin-top: 10px; padding: 12px; background: rgba(11,18,28,.7); border: 1px solid rgba(118,185,0,.14); border-radius: 6px; font-size: 11px; color: var(--dim); display: none; line-height: 1.6; }
.quiz-explain.show { display: block; }
.quiz-explain-kicker { font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--green); margin-bottom: 8px; }
.quiz-choice-feedback { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 5px; margin-bottom: 10px; }
.quiz-choice-feedback.correct { border: 1px solid rgba(118,185,0,.22); background: rgba(118,185,0,.06); }
.quiz-choice-feedback.wrong { border: 1px solid rgba(224,82,82,.24); background: rgba(224,82,82,.07); }
.quiz-choice-feedback > span { flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-size: 10px; margin-top: 1px; }
.quiz-choice-feedback.correct > span { background: rgba(118,185,0,.16); color: var(--green); }
.quiz-choice-feedback.wrong > span { background: rgba(224,82,82,.16); color: var(--red); }
.quiz-choice-feedback strong { color: var(--white); font-size: 11.5px; line-height: 1.6; font-weight: 600; }
.quiz-choice-feedback p { margin: 5px 0 0; color: var(--text); font-size: 11px; line-height: 1.6; }
.quiz-correct-answer { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid rgba(118,185,0,.22); background: rgba(118,185,0,.06); border-radius: 5px; margin-bottom: 12px; }
.quiz-correct-answer span { flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: rgba(118,185,0,.16); color: var(--green); font-family: var(--font-mono); font-size: 10px; margin-top: 1px; }
.quiz-correct-answer strong { color: var(--white); font-size: 11.5px; line-height: 1.6; font-weight: 600; }
.quiz-explain p { margin: 0; color: var(--text); font-size: 11.5px; line-height: 1.65; }
.quiz-score { text-align: center; padding: 20px; }
.quiz-score .score-num { font-family: var(--font-disp); font-size: 48px; color: var(--green); display: block; }
.quiz-score .score-label { color: var(--dim); font-size: 12px; margin-top: 4px; }

/* ── V3: REASONING SCORECARD ── */
.reasoning-scorecard { margin-bottom: 14px; padding: 12px; border: 1px solid rgba(118,185,0,.16); border-radius: 6px; background: linear-gradient(180deg, rgba(118,185,0,.06), rgba(74,158,255,.04)); }
.reasoning-scorecard-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.reasoning-scorecard-title { font-family: var(--font-mono); font-size: 10px; color: var(--green); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 4px; }
.reasoning-scorecard-subtitle { color: var(--text); font-size: 11px; line-height: 1.6; }
.reasoning-scorecard-total { text-align: right; flex-shrink: 0; }
.reasoning-scorecard-total span { display: block; font-family: var(--font-disp); font-size: 28px; line-height: 1; color: var(--white); }
.reasoning-scorecard-total small { display: block; margin-top: 4px; color: var(--dim); font-family: var(--font-mono); font-size: 9px; text-transform: uppercase; letter-spacing: .06em; }
.reasoning-scorecard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.reasoning-card { border: 1px solid rgba(255,255,255,.07); border-radius: 5px; background: rgba(11,18,28,.48); padding: 10px; }
.reasoning-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; font-family: var(--font-mono); font-size: 10px; letter-spacing: .05em; text-transform: uppercase; color: var(--white); }
.reasoning-card-head strong { font-size: 9px; }
.reasoning-card p { margin: 0; font-size: 11px; line-height: 1.65; color: var(--text); }
.reasoning-card-strong { border-color: rgba(118,185,0,.24); }
.reasoning-card-strong .reasoning-card-head strong { color: var(--green); }
.reasoning-card-good { border-color: rgba(74,158,255,.22); }
.reasoning-card-good .reasoning-card-head strong { color: var(--blue); }
.reasoning-card-watch { border-color: rgba(240,180,41,.22); }
.reasoning-card-watch .reasoning-card-head strong { color: var(--yellow); }

/* ── V3: DIFFERENTIAL DIAGNOSIS ── */
.differential-diagnosis { margin-bottom: 14px; padding: 12px; border: 1px solid rgba(74,158,255,.16); border-radius: 6px; background: linear-gradient(180deg, rgba(74,158,255,.05), rgba(11,18,28,.12)); }
.differential-diagnosis-top { margin-bottom: 12px; }
.differential-diagnosis-title { font-family: var(--font-mono); font-size: 10px; color: var(--blue); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 4px; }
.differential-diagnosis-subtitle { color: var(--text); font-size: 11px; line-height: 1.6; }
.differential-diagnosis-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.diagnosis-card { padding: 10px; border-radius: 5px; border: 1px solid rgba(255,255,255,.08); background: rgba(11,18,28,.45); }
.diagnosis-card-title { margin-bottom: 8px; font-family: var(--font-mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--white); }
.diagnosis-card p { margin: 0 0 8px; font-size: 11px; line-height: 1.65; color: var(--text); }
.diagnosis-card p:last-child { margin-bottom: 0; }

/* ── V3: INCIDENT MODE ── */
.incident-brief { margin-bottom: 14px; padding: 12px; border: 1px solid rgba(240,180,41,.2); border-radius: 6px; background: linear-gradient(180deg, rgba(240,180,41,.05), rgba(11,18,28,.12)); }
.incident-brief-title { font-family: var(--font-mono); font-size: 10px; color: var(--yellow); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 4px; }
.incident-brief-subtitle { margin-bottom: 12px; color: var(--text); font-size: 11px; line-height: 1.6; }
.incident-brief-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.incident-brief-card { padding: 10px; border-radius: 5px; border: 1px solid rgba(255,255,255,.08); background: rgba(11,18,28,.45); }
.incident-brief-card-title { margin-bottom: 8px; font-family: var(--font-mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--white); }
.incident-brief-card p { margin: 0 0 8px; font-size: 11px; line-height: 1.65; color: var(--text); }
.incident-brief-card p:last-child { margin-bottom: 0; }
.incident-brief-list { margin: 0; }

/* ── V3: REASONING PROGRESS ── */
.study-progress-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 12px; }
.study-progress-card { padding: 12px; border-radius: 6px; border: 1px solid rgba(118,185,0,.16); background: rgba(11,18,28,.42); }
.study-progress-value { margin: 8px 0; font-family: var(--font-disp); font-size: 28px; line-height: 1; color: var(--white); }
.study-progress-card p { margin: 0; font-size: 11px; line-height: 1.6; color: var(--text); }
.study-progress-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.study-action-btn { border: 1px solid rgba(118,185,0,.26); background: rgba(118,185,0,.10); color: var(--white); border-radius: 999px; padding: 8px 12px; cursor: pointer; font-family: var(--font-ui); font-size: 11px; }
.study-action-btn:hover { border-color: rgba(118,185,0,.46); background: rgba(118,185,0,.16); }
.study-progress-export-note { font-size: 10.5px; line-height: 1.5; color: var(--text-soft); }
.study-progress-breakdown { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.study-progress-chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 999px; border: 1px solid rgba(74,158,255,.18); background: rgba(74,158,255,.06); font-size: 11px; color: var(--text); }
.study-progress-chip strong { font-family: var(--font-mono); font-size: 10px; color: var(--white); }
.study-focus-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 12px; }
.study-focus-card { padding: 12px 13px; border-radius: 10px; border: 1px solid rgba(74,158,255,.18); background: rgba(74,158,255,.08); }
.study-focus-card strong { display: block; margin-top: 6px; color: var(--white); font-size: 13px; }
.study-focus-card p { margin: 8px 0 0; font-size: 11px; line-height: 1.6; color: var(--text); }
.study-focus-rationale { margin-top: 8px; padding: 8px 10px; border-radius: 8px; background: rgba(10,16,26,.42); border: 1px solid rgba(255,255,255,.06); font-size: 10.5px; line-height: 1.5; color: var(--text-soft); }
.study-focus-card-risk { border-color: rgba(244,162,97,.26); background: rgba(244,162,97,.08); }

/* ── V3: CONSEQUENCE BRANCHING ── */
.consequence-branch { margin-bottom: 14px; padding: 12px; border: 1px solid rgba(244,162,97,.18); border-radius: 6px; background: linear-gradient(180deg, rgba(244,162,97,.05), rgba(11,18,28,.1)); }
.consequence-branch-title { font-family: var(--font-mono); font-size: 10px; color: var(--copper); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 4px; }
.consequence-branch-subtitle { color: var(--text); font-size: 11px; line-height: 1.6; margin-bottom: 10px; }
.consequence-branch-prompt { margin-bottom: 10px; font-size: 11px; line-height: 1.6; color: var(--white); }
.consequence-branch-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-bottom: 10px; }
.consequence-choice { width: 100%; text-align: left; padding: 10px; border-radius: 6px; border: 1px solid rgba(255,255,255,.08); background: rgba(11,18,28,.48); color: var(--text); font-size: 11px; line-height: 1.5; cursor: pointer; transition: border-color .15s ease, transform .15s ease, background .15s ease; }
.consequence-choice:hover { border-color: rgba(244,162,97,.28); transform: translateY(-1px); }
.consequence-choice.is-selected { border-color: rgba(244,162,97,.36); background: rgba(244,162,97,.08); color: var(--white); }
.consequence-outcome { padding: 10px; border-radius: 6px; border: 1px solid rgba(255,255,255,.08); background: rgba(11,18,28,.48); }
.consequence-outcome-title { margin-bottom: 6px; font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--white); }
.consequence-outcome p { margin: 0; font-size: 11px; line-height: 1.65; color: var(--text); }
.consequence-outcome-best { border-color: rgba(118,185,0,.24); }
.consequence-outcome-best .consequence-outcome-title { color: var(--green); }
.consequence-outcome-warn { border-color: rgba(240,180,41,.24); }
.consequence-outcome-warn .consequence-outcome-title { color: var(--yellow); }
.consequence-outcome-bad { border-color: rgba(224,82,82,.24); }
.consequence-outcome-bad .consequence-outcome-title { color: var(--red); }
.consequence-outcome-idle .consequence-outcome-title { color: var(--dim); }
.branch-route-status { margin-bottom: 14px; padding: 10px 12px; border: 1px solid rgba(244,162,97,.14); border-radius: 6px; background: rgba(244,162,97,.04); }
.branch-route-status-title { margin-bottom: 6px; font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--copper); }
.branch-route-status p { margin: 0 0 6px; font-size: 11px; line-height: 1.6; color: var(--text); }
.branch-route-status p:last-child { margin-bottom: 0; }
.branch-step-context { margin-bottom: 10px; padding: 10px; border-radius: 6px; border: 1px solid rgba(74,158,255,.14); background: rgba(74,158,255,.05); }
.branch-step-context-title { margin-bottom: 6px; font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--blue); }
.branch-step-context p { margin: 0; font-size: 11px; line-height: 1.6; color: var(--text); }

/* ── SVG DIAGRAM STYLES ── */
.node-box { transition: all .2s; cursor: pointer; }
.node-box:hover rect { filter: brightness(1.2); }
.pkt { animation: none; }
@keyframes flow-h { 0%{transform:translateX(0)} 100%{transform:translateX(var(--dx,80px))} }
@keyframes flow-v { 0%{transform:translateY(0)} 100%{transform:translateY(var(--dy,60px))} }
@keyframes flash  { 0%,100%{opacity:0} 50%{opacity:1} }
@keyframes spin   { from{transform:rotate(0deg)} to{transform:rotate(360deg)} }

/* ── SCENARIO HIGHLIGHT ── */
.scenario-bar { background: var(--bg2); border-bottom: 1px solid var(--border); padding: 6px 16px; display: flex; align-items: center; gap: 10px; flex-shrink: 0; font-size: 12px; min-height: 34px; }
.scenario-bar .scen-title { color: var(--white); font-weight: 600; }
.scenario-bar .scen-desc  { color: var(--dim); font-size: 11px; }
.scenario-bar .scen-step  { font-family: var(--font-mono); font-size: 10px; color: var(--green); background: rgba(118,185,0,.08); border: 1px solid rgba(118,185,0,.2); padding: 2px 8px; border-radius: 3px; margin-left: auto; }

/* ── STEP BUTTONS ── */
.step-controls { padding: 6px 12px; display: flex; gap: 6px; background: var(--bg2); border-bottom: 1px solid var(--border); flex-wrap: wrap; flex-shrink: 0; }
.step-btn { font-family: var(--font-mono); font-size: 10px; padding: 4px 10px; border: 1px solid var(--border); background: var(--bg3); color: var(--dim); cursor: pointer; border-radius: 3px; transition: all .15s; white-space: nowrap; }
.step-btn:hover { border-color: var(--blue); color: var(--blue); }
.step-btn.active { border-color: var(--green); color: var(--green); background: rgba(118,185,0,.07); }
.step-btn.fault  { border-color: var(--red); color: var(--red); }
.step-btn.fault:hover { background: rgba(224,82,82,.08); }

/* ── WELCOME ── */
.welcome-screen { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; gap: 24px; padding: 40px; }
.welcome-screen h2 { font-family: var(--font-disp); font-size: 28px; color: var(--white); text-align: center; }
.welcome-screen h2 span { color: var(--green); }
.welcome-screen p { color: var(--dim); font-size: 13px; text-align: center; max-width: 500px; line-height: 1.8; }
.welcome-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; max-width: 640px; width: 100%; }
.welcome-card { background: var(--bg3); border: 1px solid var(--border); border-radius: 5px; padding: 14px 12px; text-align: center; cursor: pointer; transition: all .2s; }
.welcome-card:hover { border-color: var(--green); transform: translateY(-2px); }
.welcome-card .wc-icon { font-size: 22px; margin-bottom: 6px; }
.welcome-card .wc-title { font-size: 11px; color: var(--text); font-weight: 600; }
.welcome-card .wc-count { font-size: 10px; color: var(--dim); margin-top: 2px; font-family: var(--font-mono); }

/* scrollbar global */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── NEW: RECONSTITUTION MODAL (Phase 1) ── */
.modal-overlay { display:flex; position:fixed; inset:0; background:rgba(0,0,0,0.95); z-index:10000; justify-content:center; align-items:center; }
.recon-box { background:var(--bg2); border:1px solid var(--green); padding:30px; width:460px; border-radius:4px; box-shadow:0 0 30px rgba(118,185,0,0.15); }
.hub-box { background:var(--bg2); border:1px solid var(--border); padding:34px; width:min(760px, calc(100vw - 36px)); border-radius:6px; box-shadow:0 0 40px rgba(0,0,0,0.6); }
.hub-box h2 { margin:0 0 8px 0; font-family:var(--font-disp); color:var(--white); font-size:24px; }
.hub-sub { color:var(--dim); font-size:12px; margin:0 0 22px 0; line-height:1.5; }
.hub-cards { display:grid; grid-template-columns:repeat(auto-fit, minmax(200px, 1fr)); gap:12px; }
.hub-card { display:flex; flex-direction:column; gap:8px; text-align:left; background:var(--bg); border:1px solid var(--border); border-radius:5px; padding:18px 16px; cursor:pointer; transition:all .15s; color:var(--text); }
.hub-card:hover { border-color:var(--green); background:rgba(118,185,0,.05); transform:translateY(-1px); }
.hub-card-icon { font-size:22px; line-height:1; }
.hub-card-title { font-family:var(--font-mono); font-size:13px; font-weight:700; color:var(--white); text-transform:uppercase; letter-spacing:.04em; }
.hub-card-desc { color:var(--dim); font-size:11px; line-height:1.5; }
.hub-blueprint-link { display:block; margin:18px auto 0; background:none; border:none; color:var(--dim); font-family:var(--font-mono); font-size:11px; cursor:pointer; text-decoration:underline; text-underline-offset:3px; }
.hub-blueprint-link:hover { color:var(--text); }
#brand-home { cursor:pointer; }

#palette-overlay { display:flex; position:fixed; inset:0; background:rgba(3,8,14,0.72); z-index:9500; justify-content:center; align-items:flex-start; padding-top:12vh; }
.palette-box { width:min(560px, calc(100vw - 36px)); background:var(--bg2); border:1px solid var(--border); border-radius:6px; box-shadow:0 12px 48px rgba(0,0,0,0.7); overflow:hidden; }
#palette-input { width:100%; box-sizing:border-box; background:var(--bg); color:var(--text); border:none; border-bottom:1px solid var(--border); padding:14px 16px; font-family:var(--font-mono); font-size:13px; outline:none; }
.palette-list { max-height:320px; overflow-y:auto; }
.palette-item { display:flex; justify-content:space-between; align-items:center; gap:12px; width:100%; text-align:left; background:transparent; border:none; border-bottom:1px solid rgba(255,255,255,.03); color:var(--text); padding:9px 16px; font-family:var(--font-mono); font-size:12px; cursor:pointer; }
.palette-item:hover { background:rgba(255,255,255,.04); }
.palette-item.selected { background:rgba(118,185,0,.12); color:var(--white); }
.palette-item-hint { color:var(--dim); font-size:10px; text-transform:uppercase; letter-spacing:.05em; flex-shrink:0; }
.palette-empty { color:var(--dim); font-family:var(--font-mono); font-size:12px; padding:14px 16px; }
.palette-footer { color:var(--dim); font-family:var(--font-mono); font-size:10px; padding:8px 16px; border-top:1px solid var(--border); background:var(--bg); }

/* ═══════════════════════════════════════════════════════════════
   SPRINT 14: MOBILE RESPONSIVENESS
   Fixes overflow:hidden body lock and stacks layout for ≤768px
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  body {
    height: auto;
    min-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
  }

  header {
    height: auto;
    flex-wrap: wrap;
    align-items: flex-start;
    padding: 10px 12px;
    gap: 10px;
  }

  header h1 { font-size: 15px; }
  .hdr-brand {
    width: 100%;
    justify-content: space-between;
  }
  .hdr-badge { margin-top: 2px; }
  .mode-switch {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }
  .mode-tab {
    min-height: 34px;
  }
  .hdr-right {
    flex-wrap: wrap;
    margin-left: 0;
    gap: 6px;
    justify-content: flex-start;
    width: 100%;
  }
  .hdr-status-group {
    width: 100%;
    flex-wrap: wrap;
    border-right: none;
    padding-right: 0;
    padding-bottom: 2px;
  }
  .hdr-tool-group {
    width: 100%;
    flex-wrap: wrap;
  }
  .hdr-stat  { font-size: 9px; }
  .hdr-settings {
    flex: 1 1 auto;
  }
  .hdr-settings summary {
    min-height: 24px;
    box-sizing: border-box;
    text-align: center;
  }
  .hdr-settings[open] .explain-toolbar {
    left: 0;
    right: auto;
    min-width: min(280px, calc(100vw - 24px));
  }
  .hdr-right > .btn-sm {
    min-height: 34px;
    padding: 7px 10px;
    font-size: 10px;
  }

  .app { flex-direction: column; overflow: visible; }

  .sidebar {
    width: 100%;
    max-height: none;
    overflow: visible;
    flex-shrink: 0;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .sidebar-scroll {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-content: flex-start;
    padding: 8px;
    overflow-y: visible;
  }
  .sidebar-section {
    width: 100%;
    padding: 6px 2px 0;
    font-size: 8.5px;
  }
  .nav-item {
    flex: 1 1 calc(50% - 6px);
    min-width: 150px;
    border-left: none;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    background: rgba(255,255,255,.02);
    color: var(--text);
  }
  .nav-item:hover { border-left-color: transparent; }
  .nav-item.active {
    border-left-color: transparent;
    border-color: rgba(118,185,0,.32);
    background: rgba(118,185,0,.10);
  }
  .nav-item .badge {
    margin-left: 6px;
    flex-shrink: 0;
  }
  .sidebar-action-row {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 2px 0 8px;
  }
  .sidebar-action-row .btn-sm {
    min-height: 36px;
    font-size: 10px;
  }

  .main { overflow: visible; min-height: 0; }

  /* The diagram + metrics row — stack vertically on mobile */
  #canvas-row {
    flex-direction: column !important;
    overflow: visible !important;
    min-height: 0 !important;
  }

  .diagram-pane { min-height: 220px; flex: none; }

  #diagram-canvas { min-height: 220px; }

  .metrics-sidebar {
    width: 100%;
    max-height: none;
    border-left: none;
    border-top: 1px solid var(--border);
    flex-direction: row;
    flex-wrap: wrap;
    overflow: visible;
  }

  .metric-group { flex: 1 1 140px; border-bottom: none; border-right: 1px solid var(--border); }
  .xid-log      { display: none; }

  .terminal-pane { height: auto; min-height: 200px; flex-shrink: 0; }
  .terminal-body { flex-direction: column; min-height: 0; }
  .lab-step-coach { position: absolute; inset: 10px; width: auto; height: auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
  .lab-step-coach-shell { height: 100%; }
  .lab-step-coach-content { flex: 1; min-height: 0; }
  .lab-step-shot-line { font-size: 9px; }
  .ai-static-overlay { inset: 10px; width: auto; height: auto; padding: 16px; }

  .terminal-tabs  { flex-wrap: wrap; }
  .terminal-tab   { font-size: 9px; padding: 5px 10px; }
  .terminal-actions { padding: 0 4px; }

  .step-controls  { overflow-x: auto; }
  .step-btn       { white-space: nowrap; }

  .scenario-bar   { flex-wrap: wrap; gap: 4px; }

  /* Overlays / panels */
  .overlay .panel,
  .panel {
    width: 100vw !important;
    max-height: 100vh;
    height: 100vh;
    padding: 16px;
    border-radius: 0;
  }
  .panel-tools { top: 0; margin-right: 0; }

  #login-overlay > div {
    width: min(360px, calc(100vw - 28px)) !important;
    padding: 24px !important;
  }

  /* Remediation status bar — shrink font on mobile */
  #remediation-status-panel { padding: 10px 12px; font-size: 11px; }
}

@media (max-width: 480px) {
  .terminal-tab   { display: none; }
  #tab-term       { display: flex; }
  header h1       { font-size: 12px; }
  .hdr-badge      { display: none; }
  .nav-item       { flex-basis: 100%; min-width: 0; }
  .sidebar-action-row { grid-template-columns: 1fr; }
  .diagram-pane   { min-height: 180px; }
  .cluster-dashboard-pane { padding: 12px; }
  .cluster-dashboard-shell { min-height: calc(100vh - 24px); padding: 14px; border-radius: 14px; }
  .cluster-dashboard-topbar { flex-direction: column; align-items: stretch; }
  .cluster-dashboard-close { align-self: flex-end; }
  .cluster-fleet-layout { grid-template-columns: 1fr; }
  .cluster-dashboard-grid { grid-template-columns: 1fr; }
  .cluster-submit-row { grid-template-columns: 1fr; }
  .lab-step-shot-line { font-size: 8.5px; }
}

@media (max-width: 1480px) {
  .cluster-fleet-layout { grid-template-columns: 210px minmax(0, 1fr); }
  .cluster-fleet-side { grid-column: 1 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)); position: static; }
}

@media (max-width: 1120px) {
  .cluster-fleet-layout { grid-template-columns: 1fr; }
  .cluster-fleet-kpis,
  .cluster-fleet-side { position: static; }
  .cluster-fleet-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cluster-fleet-side { grid-template-columns: 1fr; }
  .cluster-dashboard-grid { grid-template-columns: 1fr; }
}

#btn-login { transition: opacity 0.2s; }
#btn-login:hover { opacity: 0.85; }

.lab-outcome-summary {
  margin: 14px 0;
  padding: 14px 15px;
  border-radius: 12px;
  border: 1px solid rgba(118, 185, 0, 0.26);
  background: rgba(118, 185, 0, 0.08);
}

.lab-outcome-summary.is-compromised {
  border-color: rgba(244, 162, 97, 0.34);
  background: rgba(244, 162, 97, 0.10);
}

.lab-outcome-summary-top,
.study-outcome-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.lab-outcome-summary-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
}

.lab-outcome-summary-tag,
.study-outcome-card-top span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(12, 18, 28, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 11px;
  color: var(--text-soft);
}

.lab-outcome-summary-route,
.study-progress-outcomes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.lab-outcome-route-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(10, 16, 26, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 11px;
  color: var(--text);
}

.lab-outcome-route-chip.effect-best {
  border-color: rgba(118, 185, 0, 0.34);
}

.lab-outcome-route-chip.effect-warn {
  border-color: rgba(244, 162, 97, 0.34);
}

.lab-outcome-route-chip.effect-bad {
  border-color: rgba(231, 111, 81, 0.42);
}

.study-progress-recent {
  margin-top: 14px;
}

.study-outcome-card {
  flex: 1 1 220px;
  min-width: 220px;
  padding: 12px 13px;
  border-radius: 12px;
  border: 1px solid rgba(118, 185, 0, 0.22);
  background: rgba(118, 185, 0, 0.07);
}

.study-outcome-card.is-compromised {
  border-color: rgba(244, 162, 97, 0.30);
  background: rgba(244, 162, 97, 0.10);
}
