/* Jedah Zoom side panel — black & white, IBM Plex
   All accents render as tints of white. Severity uses opacity, not hue. */
:root {
  --bg: #0a0a0a;
  --panel: #0f0f0f;
  --panel-2: #141414;
  --text: #fafafa;
  --text-2: #c8c8c8;
  --muted: #888;
  --muted-2: #5a5a5a;
  --accent: #fafafa;          /* primary accent is now white */
  --accent-warm: #c8c8c8;     /* "warm" warning tone = medium gray */
  --good: #fafafa;            /* good = full brightness */
  --bad: #e07b7b;             /* keep red for true error/danger only */
  --border: #1a1a1a;
  --border-strong: #2a2a2a;
  --font: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
}

.page {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

h1 { font-size: 22px; margin: 0 0 8px; font-weight: 600; }
h2 { font-size: 16px; margin: 24px 0 8px; font-weight: 600; color: var(--accent); }
p, li { font-size: 14px; }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 22px;
  margin: 16px 0;
}

.consent-toggle {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.consent-toggle:last-child { border-bottom: none; }
.consent-toggle input { margin-top: 4px; }
.consent-toggle label { flex: 1; font-size: 14px; }
.consent-toggle .label-title { font-weight: 600; display: block; }
.consent-toggle .label-help { color: var(--muted); font-size: 12px; display: block; margin-top: 2px; }

.btn {
  background: var(--accent);
  color: var(--bg);
  border: 0;
  border-radius: 4px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.2px;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.12s;
}
.btn:hover:not([disabled]) { opacity: 0.88; }
.btn[disabled] { opacity: 0.4; cursor: not-allowed; }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.banner {
  background: var(--panel-2);
  border-left: 3px solid var(--accent-warm);
  padding: 12px 14px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--muted);
}

/* --- Interviewer side panel --- */
.panel { display: grid; grid-template-rows: auto 1fr auto; height: 100vh; }
.panel-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.panel-header h1 { font-size: 14px; margin: 0; }
.panel-header .status {
  font-size: 11px; color: var(--muted);
}
.panel-header .status.live { color: var(--good); }

.panel-body {
  overflow: auto;
  padding: 12px 16px;
}

.suggestion {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  padding: 10px 12px;
  border-radius: 6px;
  margin-bottom: 10px;
  font-size: 13px;
}
.suggestion .dim {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 4px;
  font-weight: 600;
}

.transcript-tail {
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
  background: var(--bg);
  border-radius: 6px;
  padding: 8px 10px;
  max-height: 140px;
  overflow: auto;
  border: 1px solid var(--border);
}
.transcript-tail .line { margin-bottom: 4px; }
.transcript-tail .speaker { color: var(--accent-warm); }

.panel-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--muted);
  display: flex; gap: 12px; align-items: center; justify-content: space-between;
}

.framework-pill {
  display: inline-block;
  background: var(--panel-2);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  color: var(--accent);
}

.muted { color: var(--muted); }
.small { font-size: 12px; }
.row { display: flex; gap: 10px; align-items: center; }

/* AI-thinking spinner — small circle next to the rubric header */
.ai-spinner {
  display: inline-block;
  width: 12px; height: 12px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Override button cluster — bigger click targets than v0.3 */
.rubric-overrides {
  display: inline-flex;
  gap: 3px;
}
.rubric-overrides button {
  width: 24px;
  height: 24px;
  font-size: 11px;
  padding: 0;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  border-radius: 4px;
  font-family: inherit;
  transition: background 0.1s ease;
}
.rubric-overrides button:hover { background: var(--panel-2); }
.rubric-overrides button.active { background: var(--accent); color: var(--bg); font-weight: 600; }
.rubric-overrides button.clear { color: var(--muted); }
.rubric-overrides button.clear.active { background: var(--panel-2); color: var(--text); }

.rubric-row { border-bottom: 1px solid var(--border); vertical-align: top; }
.rubric-row.scored { background: rgba(250, 250, 250, 0.03); }
.rubric-row td { padding: 8px 6px; }
.rubric-row .name { font-weight: 600; }
.rubric-row .evidence {
  color: var(--muted);
  font-size: 11px;
  font-style: italic;
  margin-top: 3px;
  line-height: 1.45;
}
.rubric-row .ai-cell {
  text-align: center;
  font-weight: 700;
  font-size: 14px;
}
.rubric-row .conf-cell {
  text-align: center;
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* --- New v0.4 layout: candidate input, control bar, sections --- */
.cand-input {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 12px;
  font-family: inherit;
  width: 220px;
}
.cand-input:focus { outline: 1px solid var(--accent); }

.control-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  padding: 10px 0 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}
.btn.small { padding: 6px 10px; font-size: 12px; }
.btn.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn.btn-ghost:hover { background: var(--panel-2); }
.btn.btn-recording {
  background: var(--bad);
  color: white;
  animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(224, 123, 123, 0.6); }
  50%      { box-shadow: 0 0 0 6px rgba(224, 123, 123, 0); }
}

/* === b&w refinement layer === */
body { font-family: var(--font); -webkit-font-smoothing: antialiased; }
.panel-header { background: var(--bg); }
.panel-header strong { font-weight: 600; letter-spacing: 0.2px; }
h1, h2 { color: var(--text); font-weight: 600; }
h2.section-h { color: var(--text); }
.status { font-family: 'IBM Plex Mono', monospace; font-size: 10px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--muted); }
.status.live { color: var(--text); }
.card-section { border-top: 1px solid var(--border); padding-top: 16px; margin-top: 18px; }
.card-section:first-of-type { border-top: none; }
.export-link { color: var(--text); border-bottom: 1px dotted var(--muted-2); }
.export-link:hover { text-decoration: none; border-bottom-color: var(--text); }
.banner { background: var(--panel); border-left-color: var(--text); color: var(--text-2); }
.btn-ghost:hover { background: var(--panel-2); }
.tt-title, .chart-tooltip { border-color: var(--border-strong); background: rgba(10,10,10,0.96); }
.career-chart .role-label { fill: var(--bg); }
.framework-pill { background: var(--panel-2); color: var(--text); border: 1px solid var(--border-strong); }

.card-section {
  margin-top: 18px;
  padding-top: 4px;
}
.section-h {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.export-link {
  margin-left: auto;
  color: var(--accent);
  font-size: 11px;
  text-decoration: none;
  font-weight: normal;
}
.export-link:hover { text-decoration: underline; }

/* Q&A thread layout */
.qa-thread {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 6px 0;
}
.qa-turn {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 88%;
}
.qa-turn.interviewer { align-self: flex-start; }
.qa-turn.candidate   { align-self: flex-end; align-items: flex-end; }
.qa-turn .meta {
  font-size: 10px;
  color: var(--muted);
  display: flex;
  gap: 6px;
  align-items: center;
}
.qa-turn .bubble {
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
}
.qa-turn.interviewer .bubble {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-top-left-radius: 4px;
}
.qa-turn.candidate .bubble {
  background: rgba(250, 250, 250, 0.08);
  border: 1px solid rgba(250, 250, 250, 0.18);
  border-top-right-radius: 4px;
}

/* AI-reading flag chip */
.ai-flag {
  display: inline-block;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 999px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: help;
}
.ai-flag.level-1 { background: rgba(250, 250, 250, 0.06); color: var(--muted); border: 1px solid var(--border-strong); }
.ai-flag.level-2 { background: rgba(250, 250, 250, 0.12); color: var(--text-2); border: 1px solid var(--text-2); }
.ai-flag.level-3 { background: var(--text); color: var(--bg); border: 1px solid var(--text); }

.dev-simulator {
  margin-top: 24px;
  padding: 8px 12px;
  border: 1px dashed var(--border);
  border-radius: 6px;
  opacity: 0.6;
}
.dev-simulator:hover { opacity: 1; }

/* ---- Background panel ---- */

/* The headline "best fit" card — most prominent single read. */
.bg-size-pref {
  margin: 8px 0 12px;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-left-width: 3px;
}
.bg-size-headline {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
}
.bg-size-emoji { font-size: 18px; }
.bg-size-headline.early-stage   { border-left-color: var(--text-2); }
.bg-size-headline.growth-stage  { border-left-color: var(--text); }
.bg-size-headline.enterprise    { border-left-color: var(--muted); }
.bg-size-headline.adaptable     { border-left-color: var(--muted-2); }
.bg-size-pref:has(.bg-size-headline.early-stage)  { border-left-color: var(--text-2); }
.bg-size-pref:has(.bg-size-headline.growth-stage) { border-left-color: var(--text); }
.bg-size-pref:has(.bg-size-headline.enterprise)   { border-left-color: var(--muted); }
.bg-size-pref:has(.bg-size-headline.adaptable)    { border-left-color: var(--muted-2); }
.bg-conf {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
  margin-left: auto;
}
.bg-size-reason {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text);
  line-height: 1.5;
}

.bg-summary {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 4px 0 8px;
  flex-wrap: wrap;
}
.bg-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  font-weight: 600;
}
.bg-pill.stability-stable     { background: var(--text); color: var(--bg); border-color: var(--text); }
.bg-pill.stability-watchpoint { background: transparent; color: var(--text); border-color: var(--text); }
.bg-pill.stability-jumpy      { background: transparent; color: var(--muted); border-color: var(--border-strong); }
.bg-pill.stability-unknown    { color: var(--muted); }

.bg-prose {
  font-size: 12px;
  color: var(--text);
  line-height: 1.5;
  margin: 4px 0 12px;
  padding: 8px 12px;
  background: var(--panel-2);
  border-left: 2px solid var(--accent);
  border-radius: 4px;
}
.bg-prose .label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 3px;
}

.bg-roles-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  margin-top: 8px;
}
.bg-roles-table th {
  text-align: left;
  padding: 4px 6px;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
}
.bg-roles-table td {
  padding: 6px 6px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.bg-role-title { font-weight: 600; }
.bg-role-co { color: var(--muted); font-size: 10px; }
.bg-stage-chip {
  display: inline-block;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 999px;
  font-weight: 600;
  background: var(--bg);
  border: 1px solid var(--border);
}
.bg-stage-chip.stage-seed,
.bg-stage-chip.stage-series-a { background: transparent; color: var(--muted); border-color: var(--border-strong); }
.bg-stage-chip.stage-series-b,
.bg-stage-chip.stage-series-c,
.bg-stage-chip.stage-growth   { background: var(--text); color: var(--bg); border-color: var(--text); }
.bg-stage-chip.stage-late,
.bg-stage-chip.stage-public-mid,
.bg-stage-chip.stage-public-large { background: var(--panel-2); color: var(--text-2); border-color: var(--border-strong); }
.bg-stage-chip.stage-unknown  { color: var(--muted); }

.bg-growth { font-size: 10px; color: var(--muted); }
.bg-growth.hyper, .bg-growth.fast { color: var(--text); font-weight: 600; }
.bg-growth.declining { color: var(--muted); text-decoration: line-through; }

/* ---- Zoom-style call view (candidate page) ---- */
.call-view {
  position: fixed;
  inset: 0;
  background: #000;
  display: flex;
  flex-direction: column;
}
.call-stage {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0f1419;
  overflow: hidden;
}
.call-stage video#remote-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}
.remote-waiting {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text);
  text-align: center;
  font-size: 14px;
  gap: 10px;
  pointer-events: none;
}
.remote-waiting.hidden { display: none; }
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255,255,255,0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
.self-pip {
  position: absolute;
  bottom: 100px;
  right: 24px;
  width: 200px;
  height: 150px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid rgba(255,255,255,0.2);
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  background: #1a2128;
  z-index: 10;
}
.call-controls {
  background: #1a2128;
  border-top: 1px solid var(--border);
  padding: 16px;
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* ---- View tab bar (Video / AI / Split) ---- */
.view-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 12px 0;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}
.view-tab {
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
  border-bottom: none;
  padding: 6px 12px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  border-radius: 6px 6px 0 0;
  font-weight: 600;
  transition: background 0.1s ease, color 0.1s ease;
}
.view-tab:hover { color: var(--text); background: var(--panel-2); }
.view-tab.active {
  color: var(--text);
  background: var(--bg);
  border-color: var(--border);
  border-bottom-color: var(--bg);
  margin-bottom: -1px;
}

/* === View modes — body class drives the layout === */

/* AI panel mode (default — current behavior). Candidate PIP small at the top.    */
body.view-ai .ai-pane { display: block; }
body.view-ai .candidate-pip { max-width: 360px; aspect-ratio: 4/3; }

/* Video-only mode. Candidate video expands to fill, AI pane hidden.              */
body.view-video .ai-pane { display: none; }
body.view-video .panel-body { overflow: hidden; padding: 0; }
body.view-video .candidate-pip {
  max-width: none;
  width: 100%;
  height: calc(100vh - 140px);
  aspect-ratio: unset;
  margin: 0;
  border-radius: 0;
  border: none;
}
body.view-video .control-bar { display: none; }

/* Split mode. 50/50: video on left, AI panel scrolls on right.                   */
body.view-split .panel-body {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(360px, 1.4fr);
  gap: 16px;
  padding-right: 14px;
  align-items: start;
}
body.view-split .candidate-pip {
  max-width: none;
  width: 100%;
  aspect-ratio: 4/3;
  position: sticky;
  top: 14px;
  margin: 0;
}
body.view-split .ai-pane {
  min-width: 0;
  overflow-y: auto;
}
body.view-split .control-bar {
  grid-column: 1 / -1;
}
@media (max-width: 900px) {
  /* On narrow viewports collapse split to vertical stacking */
  body.view-split .panel-body {
    grid-template-columns: 1fr;
  }
  body.view-split .candidate-pip { aspect-ratio: 16/9; position: static; }
}

/* Interviewer-side candidate PIP — small picture-in-picture in the panel */
.candidate-pip {
  position: relative;
  width: 100%;
  max-width: 360px;
  aspect-ratio: 4/3;
  background: #0f1419;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  margin: 0 0 12px;
}
.candidate-pip video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.candidate-pip .pip-label {
  position: absolute;
  top: 6px;
  left: 8px;
  background: rgba(0,0,0,0.6);
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.candidate-pip .pip-waiting {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  padding: 12px;
}
/* High-specificity selector so this beats `.candidate-pip video` */
.candidate-pip video.interviewer-self-pip {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 120px;
  height: 90px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.5);
  z-index: 5;
}

/* ---- Career-history visualization (PSH-style) ---- */
.career-chart-wrap {
  position: relative;
  margin: 16px 0;
  padding: 12px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.career-chart-wrap.scrollable {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) var(--panel);
}
.career-chart-wrap.scrollable::-webkit-scrollbar { height: 8px; }
.career-chart-wrap.scrollable::-webkit-scrollbar-track { background: var(--panel); border-radius: 4px; }
.career-chart-wrap.scrollable::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 4px; opacity: 0.5; }
.career-chart-wrap.scrollable .career-chart {
  width: auto;
  max-width: none;
  flex-shrink: 0;
}
.career-chart-wrap.scrollable::after {
  content: "← scroll horizontally to see all roles →";
  display: block;
  text-align: center;
  font-size: 10px;
  color: var(--muted);
  margin-top: 6px;
  letter-spacing: 0.05em;
  position: sticky;
  left: 0;
}
.career-chart-wrap .chart-title {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.career-chart {
  width: 100%;
  height: auto;
  display: block;
}
.career-chart .axis-label {
  font-size: 9px;
  fill: var(--muted);
}
.career-chart .axis-grid {
  stroke: var(--border);
  stroke-width: 0.5;
  stroke-dasharray: 2 2;
}
.career-chart .role-bar {
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.15s ease;
  transform-origin: center bottom;
}
.career-chart .role-bar:hover {
  opacity: 0.85;
  filter: brightness(1.1);
}
.career-chart .role-bar.unknown {
  fill: var(--panel);
  stroke: var(--muted);
  stroke-dasharray: 3 2;
}
.career-chart .role-label {
  font-size: 9px;
  fill: white;
  font-weight: 600;
  pointer-events: none;
}
.career-chart .role-callout {
  font-size: 9px;
  fill: var(--text);
  pointer-events: none;
}
.chart-tooltip {
  position: absolute;
  background: rgba(15, 20, 25, 0.96);
  color: var(--text);
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 11px;
  line-height: 1.5;
  max-width: 260px;
  pointer-events: none;
  z-index: 50;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.chart-tooltip[hidden] { display: none; }
.chart-tooltip .tt-title { font-weight: 700; font-size: 12px; margin-bottom: 2px; }
.chart-tooltip .tt-co { color: var(--muted); font-size: 10px; margin-bottom: 6px; }
.chart-tooltip .tt-row { display: flex; justify-content: space-between; gap: 8px; }
.chart-tooltip .tt-row span:first-child { color: var(--muted); }
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: 8px;
  font-size: 10px;
  color: var(--muted);
}
.chart-legend .swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 4px;
  vertical-align: middle;
}

.bg-warnings {
  font-size: 10px;
  color: var(--muted);
  margin-top: 8px;
  padding: 6px 10px;
  background: var(--bg);
  border-radius: 4px;
  border: 1px dashed var(--border);
}

/* ===== Zoom side-panel stage tracker ===== */
.zoom-stage-tracker {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0;
  padding: 12px 8px 8px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  position: relative;
}
.zoom-stage-tracker::before {
  content: '';
  position: absolute;
  left: calc(8.333% + 2px);
  right: calc(8.333% + 2px);
  top: 20px;
  height: 1px;
  background: var(--border);
  z-index: 0;
}
.zs-step {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  position: relative; z-index: 1;
}
.zs-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--panel-2);
  border: 1px solid var(--border-strong);
  transition: background 0.2s, border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.zs-name {
  font-size: 8px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  font-weight: 500;
}
.zs-step.done .zs-dot { background: var(--text); border-color: var(--text); }
.zs-step.done .zs-name { color: var(--muted); }
.zs-step.active .zs-dot {
  background: var(--panel);
  border: 2px solid var(--text);
  transform: scale(1.3);
}
.zs-step.active .zs-name { color: var(--text); font-weight: 600; }
.zs-step.active.ready .zs-dot { animation: zs-pulse 1.6s infinite; }
@keyframes zs-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(250,250,250,0.5); }
  50% { box-shadow: 0 0 0 5px rgba(250,250,250,0); }
}

.zoom-stage-hint {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 10px 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 2px solid var(--muted);
  border-radius: 6px;
  margin-bottom: 14px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
}
.zoom-stage-hint.ready { border-left-color: var(--text); color: var(--text-2); }
.zs-arrow { color: var(--muted); font-size: 12px; }
.zoom-stage-hint.ready .zs-arrow { color: var(--text); }
.zs-text { flex: 1; }
.zs-text b { color: var(--text); font-weight: 600; }

/* ===================================================================
   Zoom panel v0.7 — tabs, polished stage tracker, candidate chart,
   deep analysis, framework, rubric. Variables aliased to the app's
   token names so CSS can be lifted from app/styles.css verbatim.
   =================================================================== */
:root {
  --bg-2: var(--panel);
  --bg-3: var(--panel-2);
  --hairline: var(--border);
  --hairline-strong: var(--border-strong);
  --text-3: var(--muted);
  --text-4: var(--muted-2);
  --text-5: #3a3a3a;
}

/* Header: brand glyph, wordmark, subtitle, candidate line */
.zp-header { padding: 10px 14px; }
.zp-brand { display: flex; align-items: center; gap: 10px; }
.zp-logo {
  position: relative;
  display: inline-block;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--text);
  flex-shrink: 0;
}
.zp-logo-iris {
  position: absolute; left: 50%; top: 50%;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--bg);
  transform: translate(-50%, -50%);
}
.zp-logo-pupil {
  position: absolute; left: 50%; top: 50%;
  width: 2px; height: 2px; border-radius: 50%;
  background: var(--text);
  transform: translate(-50%, -50%);
}
.zp-wordmark { letter-spacing: 1.4px; font-size: 12px; }
.zp-subtitle {
  padding: 0 14px;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.6px;
  margin-top: -2px;
}
.zp-cand-line {
  padding: 6px 14px 10px;
  font-size: 11px;
  color: var(--text-2);
  border-bottom: 1px solid var(--border);
}
.zp-cand-line b { color: var(--text); font-weight: 600; }

/* Tabs */
.zp-tabs {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  gap: 4px;
  padding: 8px 10px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.zp-tab {
  flex: 1;
  font-family: inherit;
  font-size: 10px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  font-weight: 500;
  padding: 7px 6px;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.zp-tab:hover { color: var(--text-2); border-color: var(--border-strong); }
.zp-tab.is-active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
  font-weight: 600;
}

/* Panels */
.zp-panel[hidden] { display: none; }

/* ───── Polished 6-stage tracker ───── */
.zp-stage-tracker {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0;
  padding: 14px 10px 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  position: relative;
}
.zp-stage-tracker::before {
  content: '';
  position: absolute;
  left: calc(8.333% + 4px);
  right: calc(8.333% + 4px);
  top: 22px;
  height: 1px;
  background: var(--border-strong);
  z-index: 0;
}
.zp-stage-step {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  position: relative; z-index: 1;
}
.zp-stage-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--panel-2);
  border: 1px solid var(--border-strong);
  transition: background 0.2s, border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.zp-stage-name {
  font-size: 8px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--muted-2);
  white-space: nowrap;
  font-weight: 500;
  text-align: center;
}
.zp-stage-step.done .zp-stage-dot { background: var(--text); border-color: var(--text); }
.zp-stage-step.done .zp-stage-name { color: var(--muted); }
.zp-stage-step.active .zp-stage-dot {
  background: var(--panel);
  border: 2px solid var(--text);
  transform: scale(1.35);
  box-shadow: 0 0 0 3px rgba(250,250,250,0.08);
}
.zp-stage-step.active .zp-stage-name { color: var(--text); font-weight: 600; }
.zp-stage-step.active.ready .zp-stage-dot { animation: zp-pulse 1.6s infinite; }
@keyframes zp-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(250,250,250,0.5); }
  50%      { box-shadow: 0 0 0 6px rgba(250,250,250,0); }
}
.zp-stage-hint {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 9px 11px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 2px solid var(--muted-2);
  border-radius: 6px;
  margin-bottom: 14px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-2);
}
.zp-stage-hint.ready { border-left-color: var(--text); color: var(--text); }
.zp-stage-hint-icon { color: var(--muted); font-size: 12px; line-height: 1.4; }
.zp-stage-hint.ready .zp-stage-hint-icon { color: var(--text); }
.zp-stage-hint-text { flex: 1; }
.zp-stage-hint-text b { color: var(--text); font-weight: 600; }

/* ───── Candidate header (in candidate tab) ───── */
.zp-cand-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
}
.zp-cand-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--panel-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 500;
  flex-shrink: 0;
}
.zp-cand-name { font-size: 16px; font-weight: 600; letter-spacing: -0.2px; }
.zp-cand-meta { font-size: 11px; color: var(--muted); margin-top: 2px; line-height: 1.45; }
.zp-cand-meta b { color: var(--text); font-weight: 500; }

/* ───── Career-stage chart (compact, narrow-friendly) ───── */
.zp-chart-wrap {
  /* container so the inner .chart-wrap can scroll horizontally on tight widths */
  overflow-x: auto;
  overflow-y: hidden;
  margin: 0 -4px;
}
.zp-chart-wrap::-webkit-scrollbar { height: 6px; }
.zp-chart-wrap::-webkit-scrollbar-track { background: transparent; }
.zp-chart-wrap::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }

.zp-chart-wrap .chart-wrap {
  min-width: 360px;
  padding: 14px 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  margin: 0;
}
.zp-chart-wrap .chart-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
  font-size: 9px;
}
.zp-chart-wrap .chart-head .lbl { font-size: 9px; letter-spacing: 1.2px; color: var(--muted); text-transform: uppercase; }
.zp-chart-wrap .chart-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: 240px;
}
.zp-chart-wrap .stage-col {
  position: relative; padding-top: 6px; text-align: center;
}
.zp-chart-wrap .stage-col.target {
  background: linear-gradient(180deg, rgba(250,250,250,0.08), rgba(250,250,250,0.02) 80%);
  border-left: 0.5px dashed var(--border-strong);
  border-right: 0.5px dashed var(--border-strong);
}
.zp-chart-wrap .stage-col:not(.target) { border-left: 0.5px solid #161616; }
.zp-chart-wrap .stage-col:first-child { border-left: none; }
.zp-chart-wrap .stage-col .stage-label {
  font-size: 8px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--muted-2);
}
.zp-chart-wrap .stage-col.target .stage-label { color: var(--text); font-weight: 700; }
.zp-chart-wrap .stage-col .stage-range { font-size: 8px; color: #3a3a3a; margin-top: 2px; }
.zp-chart-wrap .stage-col.target .stage-range { color: var(--muted); }

.zp-chart-wrap .dots-layer { position: absolute; inset: 30px 0 28px; }
.zp-chart-wrap .dot {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 1;
}
.zp-chart-wrap .dot-pill {
  position: absolute;
  left: 50%; top: 100%;
  transform: translateX(-50%);
  margin-top: 6px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.2px;
  color: var(--text-2);
  padding: 2px 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 9px;
  white-space: nowrap;
  pointer-events: none;
  line-height: 1.1;
}
.zp-chart-wrap .dot-pill.current {
  color: var(--bg); background: var(--text); border-color: var(--text); font-weight: 600;
}
.zp-chart-wrap .target-mark {
  position: absolute; bottom: 4px; left: 50%;
  transform: translateX(-50%);
  font-size: 8px; letter-spacing: 1.4px; font-weight: 600;
  color: var(--text);
  background: var(--panel);
  padding: 2px 7px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  white-space: nowrap;
}
.zp-chart-wrap .dots-line {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 0;
}
.zp-chart-wrap .year-rail {
  position: absolute; left: 0; top: 0; bottom: 0; width: 28px;
  pointer-events: none; z-index: 2;
}
.zp-chart-wrap .year-tick {
  position: absolute; left: 0;
  transform: translateY(-50%);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 8px; color: var(--muted-2);
  letter-spacing: 0.3px;
  padding: 0 3px;
  background: var(--panel);
  border-radius: 2px;
}

/* Role list inside candidate tab (compact) */
.zp-panel[data-panel="candidate"] .roles { margin-bottom: 4px; }
.zp-panel[data-panel="candidate"] .role {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 4px;
  border-top: 1px solid var(--border);
  font-size: 12px;
}
.zp-panel[data-panel="candidate"] .role:last-child { border-bottom: 1px solid var(--border); }
.zp-panel[data-panel="candidate"] .role.faded .role-title { color: var(--muted); }
.zp-panel[data-panel="candidate"] .role-title { font-size: 12px; font-weight: 500; }
.zp-panel[data-panel="candidate"] .role-meta { font-size: 10px; color: var(--muted); margin-top: 2px; }
.zp-panel[data-panel="candidate"] .chips { display: flex; gap: 4px; flex-shrink: 0; }
.zp-panel[data-panel="candidate"] .chip {
  font-size: 9px; font-weight: 600; letter-spacing: 0.3px;
  padding: 3px 7px; border-radius: 9px;
}
.zp-panel[data-panel="candidate"] .chip.bright { background: var(--text); color: var(--bg); }
.zp-panel[data-panel="candidate"] .chip.mute { background: var(--panel-2); color: var(--muted); font-weight: 500; }
.zp-panel[data-panel="candidate"] .chip.outline { background: transparent; border: 0.5px solid var(--border-strong); color: var(--muted); font-weight: 500; }

/* ───── Deep analysis (compact for the panel) ───── */
.deep-cta {
  display: flex; flex-direction: column; gap: 10px;
  padding: 14px 14px;
  background: var(--panel);
  border: 1px dashed var(--border-strong);
  border-radius: 6px;
}
.deep-cta-text { font-size: 12px; color: var(--text-2); line-height: 1.5; }
.deep-empty {
  padding: 12px 14px; font-size: 12px; color: var(--muted);
  background: var(--panel); border: 1px solid var(--border); border-radius: 6px;
}
.deep-loading {
  padding: 14px; font-size: 12px; color: var(--text-2);
  background: var(--panel); border: 1px solid var(--border); border-radius: 6px;
  display: flex; align-items: center; gap: 8px;
}
.loading-dots { display: inline-flex; gap: 4px; }
.loading-dots span {
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--muted);
  animation: zp-loading 1.2s infinite;
}
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes zp-loading {
  0%, 80%, 100% { opacity: 0.2; }
  40% { opacity: 1; }
}
.deep-analysis {
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
}
.deep-top {
  display: grid; grid-template-columns: 70px 1fr; gap: 14px;
  padding-bottom: 12px; margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.deep-score-num { font-size: 32px; font-weight: 600; letter-spacing: -1px; line-height: 1; }
.deep-score-lbl { font-size: 9px; color: var(--muted-2); letter-spacing: 1.2px; text-transform: uppercase; margin-top: 6px; }
.deep-meta-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.deep-tag {
  font-size: 9px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase;
  padding: 3px 8px; border-radius: 9px;
  background: var(--text); color: var(--bg);
}
.deep-tag.deep-traj-plateaued,
.deep-tag.deep-traj-lateral,
.deep-tag.deep-traj-mixed {
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--border-strong);
}
.deep-tag.deep-traj-declining {
  background: transparent; color: var(--text-2);
  border: 1px solid var(--border-strong);
}
.deep-conf {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px; letter-spacing: 1px; color: var(--muted-2);
}
.deep-summary { font-size: 12px; color: var(--text); line-height: 1.5; }
.deep-block { margin-bottom: 14px; }
.deep-block:last-of-type { margin-bottom: 0; }
.deep-block-lbl {
  font-size: 9px; font-weight: 600; letter-spacing: 1.4px;
  text-transform: uppercase; color: var(--muted);
  margin-bottom: 8px;
}
.deep-item {
  display: flex; gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}
.deep-item:last-child { border-bottom: none; }
.deep-mark {
  flex-shrink: 0; width: 14px; text-align: center;
  font-size: 12px; color: var(--text); line-height: 1.5;
}
.deep-item-warn .deep-mark { color: var(--text-2); }
.deep-point { font-size: 12px; color: var(--text); line-height: 1.5; margin-bottom: 2px; }
.deep-ev { font-size: 10px; color: var(--muted); font-family: 'IBM Plex Mono', monospace; }
.deep-probes { list-style: decimal; padding-left: 18px; margin: 0; }
.deep-probes li { font-size: 12px; color: var(--text); line-height: 1.5; padding: 4px 0; }
.deep-foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 12px; padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 9px; color: var(--muted-2); letter-spacing: 0.5px;
}
.deep-regen {
  background: transparent; border: 1px solid var(--border-strong);
  color: var(--muted); font-size: 9px;
  letter-spacing: 1.1px; text-transform: uppercase;
  padding: 4px 9px; border-radius: 10px; cursor: pointer;
  font-family: inherit;
}
.deep-regen:hover { color: var(--text); border-color: var(--muted); }

/* ───── Framework tab ───── */
.zp-doc { padding: 4px 0 8px; }
.zp-thesis {
  margin: 6px 0 16px;
  padding: 14px 16px;
  background: var(--panel);
  border-left: 3px solid var(--text);
  border-radius: 4px;
  font-size: 13px;
  color: var(--text);
  font-style: italic;
  line-height: 1.5;
}
.zp-thesis b { font-style: normal; font-weight: 600; }
.zp-fw-stage {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}
.zp-fw-stage:last-of-type { border-bottom: 1px solid var(--border); }
.zp-fw-num {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--panel-2);
  border: 1px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600;
  color: var(--text);
}
.zp-fw-title {
  font-size: 13px; font-weight: 600; color: var(--text);
  margin-bottom: 4px;
}
.zp-fw-body { font-size: 12px; color: var(--text-2); line-height: 1.55; }
.zp-fw-foot { padding-top: 10px; }

/* ───── Rubric tab ───── */
.zp-rubric-card {
  padding: 12px 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 12px;
}
.zp-rubric-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 10px;
  margin-bottom: 4px;
}
.zp-rubric-name { font-size: 14px; font-weight: 600; color: var(--text); }
.zp-rubric-sub { font-size: 10px; color: var(--muted); margin-top: 3px; line-height: 1.5; }
.zp-rubric-badge {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px; letter-spacing: 1.2px;
  padding: 3px 7px;
  background: var(--text); color: var(--bg);
  border-radius: 9px;
  font-weight: 600;
  flex-shrink: 0;
}
.zp-dim-list { margin-top: 10px; }
.zp-dim-row {
  display: grid;
  grid-template-columns: 1fr 60px;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid var(--border);
  align-items: center;
}
.zp-dim-name { font-size: 12px; font-weight: 500; color: var(--text); }
.zp-dim-source { font-size: 10px; color: var(--muted); margin-top: 2px; line-height: 1.45; }
.zp-dim-weight {
  text-align: right;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--text-2);
}
.zp-dim-weight-bar {
  display: block;
  width: 50px;
  height: 3px;
  margin: 4px 0 0 auto;
  background: var(--panel-2);
  border-radius: 2px;
  overflow: hidden;
}
.zp-dim-weight-fill {
  display: block;
  height: 100%;
  background: var(--text);
}
.zp-rubric-empty {
  padding: 16px 14px;
  font-size: 12px;
  color: var(--muted);
  background: var(--panel);
  border: 1px dashed var(--border-strong);
  border-radius: 6px;
  line-height: 1.55;
}
.zp-rubric-empty a { color: var(--text); border-bottom: 1px dotted var(--muted-2); text-decoration: none; }
