/*
 * Sales Trainer - trainee product UI.
 *
 * Plain CSS, no build step, no inline styles anywhere (CSP: style-src 'self').
 * Anything that needs a continuously variable size is drawn with SVG geometry
 * attributes or segmented elements toggled by class - never a style attribute.
 */

:root {
  color-scheme: light;

  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #f1f4f7;
  --surface-3: #e8edf2;
  --border: #dbe1e8;
  --border-strong: #b9c2cc;

  --text: #15191e;
  --text-2: #3b444e;
  --muted: #54606c;

  --accent: #1f5fd0;
  --accent-hover: #184ead;
  --accent-soft: #e9f0fd;
  --accent-border: #b9cef2;

  --good: #0e6b45;
  --good-soft: #e5f3ec;
  --good-border: #b3dcc7;

  --warn: #855100;
  --warn-soft: #fdf2e2;
  --warn-border: #e7c896;

  --bad: #a52020;
  --bad-soft: #fbeaea;
  --bad-border: #e6b5b5;

  --focus: #0a58ca;
  --shadow: 0 1px 2px rgba(20, 28, 38, .06), 0 2px 8px rgba(20, 28, 38, .05);
  --radius: 12px;
  --radius-sm: 8px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  overflow-wrap: break-word;
}

/* Long unbroken strings (a pasted URL, a 60-character name) must wrap, not scroll the page. */
p, li, h1, h2, h3, td, th, q, blockquote, dd, dt { overflow-wrap: anywhere; }

button, input, select, textarea { font: inherit; color: inherit; }

.srOnly {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skipLink {
  position: absolute; left: 8px; top: -60px; z-index: 30;
  background: var(--surface); color: var(--accent);
  padding: 10px 14px; border-radius: var(--radius-sm); border: 1px solid var(--accent-border);
  text-decoration: none; font-weight: 600;
}
.skipLink:focus { top: 8px; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}
#main:focus { outline: none; }

/* ───────────────────────── app shell ───────────────────────── */

.appbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 9px; margin: 0; font-weight: 650; letter-spacing: -0.01em; }
.brandMark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--accent); color: #fff; flex: none;
}
.brandName { font-size: 16px; }
.identity { margin-left: auto; display: flex; align-items: center; gap: 10px; min-width: 0; }
.identityName {
  color: var(--muted); font-size: 14px;
  max-width: 24ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.appfoot {
  max-width: 1140px; margin: 0 auto; padding: 8px 16px 40px;
  color: var(--muted); font-size: 13px;
}
.appfoot p { margin: 0; }

main {
  display: block;
  max-width: 1140px;
  margin: 0 auto;
  padding-block: 24px 28px;
  padding-inline: 16px;
}
.view { display: block; }
.viewNarrow { max-width: 560px; margin: 0 auto; }

/* ───────────────────────── typography ───────────────────────── */

.h1 { font-size: 26px; line-height: 1.25; letter-spacing: -0.015em; margin: 0 0 8px; font-weight: 650; }
.h2 { font-size: 17px; line-height: 1.3; margin: 0 0 10px; font-weight: 650; }
.h3 { font-size: 15px; margin: 0; font-weight: 650; }
.lead { font-size: 15.5px; color: var(--text-2); margin: 0 0 20px; }
.bodyText { margin: 0 0 4px; color: var(--text-2); }
.help { font-size: 13.5px; color: var(--muted); margin: 0 0 12px; }
.fineprint { font-size: 12.5px; color: var(--muted); margin: 14px 0 0; }
.emptyNote { color: var(--muted); font-size: 14px; margin: 0; }
.stack > * + * { margin-top: 16px; }

/* ───────────────────────── cards, chips, buttons ───────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.cardPad { padding: 20px; }

.chip {
  display: inline-block; margin: 0;
  padding: 3px 9px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
  background: var(--surface-3); color: var(--text-2);
  border: 1px solid transparent;
}
.chipQuiet { background: var(--surface-2); color: var(--muted); border-color: var(--border); font-weight: 500; }
.chipWarn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-border); }
.chipGood { background: var(--good-soft); color: var(--good); border-color: var(--good-border); }
.chipBad { background: var(--bad-soft); color: var(--bad); border-color: var(--bad-border); }
.chipAccent { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-border); }
.segmentCard { border-color: var(--accent-border); }
.segmentCard .chip { margin: 0 0 8px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 600; cursor: pointer;
  text-align: center;
}
.btn:hover:enabled { background: var(--surface-2); }
.btn:disabled { opacity: .55; cursor: default; }
.btnPrimary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btnPrimary:hover:enabled { background: var(--accent-hover); border-color: var(--accent-hover); }
.btnQuiet { background: transparent; border-color: transparent; color: var(--accent); font-weight: 600; }
.btnQuiet:hover:enabled { background: var(--accent-soft); }
.btnSmall { min-height: 36px; padding: 6px 12px; font-size: 14px; }
.btnLarge { min-height: 52px; font-size: 16.5px; }
.btnBlock { width: 100%; }
.btnEnd { background: var(--surface); color: var(--bad); border-color: var(--bad-border); min-width: 180px; }
.btnEnd:hover:enabled { background: var(--bad-soft); }
.callActions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btnPause { min-width: 140px; }
.btnPause[aria-pressed="true"] { background: var(--warn-soft); border-color: var(--warn-border); }
.stageIndicator[data-phase="paused"] .stageRing { border-color: var(--warn-border); background: var(--warn-soft); }
.stageIndicator[data-phase="paused"] .stageDots i { width: 6px; height: 18px; border-radius: 2px; opacity: .7; }
.stageIndicator[data-phase="paused"] .stageDots i:nth-child(2) { display: none; }

.backLink {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; margin: 0 0 6px; padding: 6px 10px 6px 0;
  background: none; border: 0; color: var(--accent);
  font-size: 14.5px; font-weight: 600; cursor: pointer;
}
.backLink:hover { text-decoration: underline; }

.actionBar { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.actionBar .btn { flex: 1 1 200px; }

/* ───────────────────────── forms ───────────────────────── */

.field { margin-bottom: 16px; }
.label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 5px; }
.input {
  width: 100%; min-height: 44px; padding: 10px 12px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
}
.input:focus-visible { border-color: var(--accent); }
.field .help { margin: 6px 0 0; }
.formError { color: var(--bad); font-size: 14px; font-weight: 600; margin: 0 0 12px; min-height: 0; }
.formError:empty { display: none; }

/* ───────────────────────── notices ───────────────────────── */

.notices { max-width: 1140px; margin: 0 auto; padding-inline: 16px; }
.notice {
  display: flex; align-items: flex-start; gap: 10px;
  margin-top: 12px; padding: 11px 13px;
  border-radius: var(--radius-sm); font-size: 14.5px;
  background: var(--warn-soft); border: 1px solid var(--warn-border); color: #4a3000;
}
.noticeBad { background: var(--bad-soft); border-color: var(--bad-border); color: #5f1414; }
.noticeInfo { background: var(--accent-soft); border-color: var(--accent-border); color: #143a7d; }
.notice p { margin: 0; flex: 1; }
.noticeClose {
  flex: none; min-height: 28px; padding: 0 8px; cursor: pointer;
  background: transparent; border: 0; border-radius: 4px;
  color: inherit; font-size: 18px; line-height: 1;
}

/* ───────────────────────── home ───────────────────────── */

#view-home > .card, #view-home > section { margin-top: 26px; }
.howCard { background: var(--accent-soft); border-color: var(--accent-border); box-shadow: none; }
.howHead { display: flex; align-items: flex-start; gap: 12px; }
.howHead .h2 { flex: 1; }
.howSteps { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 12px; }
.howSteps li { display: flex; gap: 12px; align-items: flex-start; }
.howNum {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
}
.howBody { color: var(--text-2); }
.howBody strong { color: var(--text); }

.recentList { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.recentItem {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
  padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius);
}
.recentMain { flex: 1 1 220px; min-width: 0; }
.recentTitle { margin: 0; font-weight: 600; }
.recentSub { margin: 2px 0 0; font-size: 13.5px; color: var(--muted); }
.recentActions { display: flex; gap: 8px; flex-wrap: wrap; }
/* A row whose debrief has aged out is history, not an offer: quieter, and no score slot. */
.recentItem.recentGone { padding: 10px 16px; background: var(--surface-2); }
.recentItem.recentGone .recentTitle { font-weight: 600; color: var(--text-2); font-size: 14.5px; }
.recentMore { margin: 0; }
.recentMore .btn { width: 100%; justify-content: center; }

.scoreBadge {
  flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 62px; padding: 6px 10px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.scoreBadgeValue { font-size: 18px; font-weight: 700; line-height: 1.1; }
.scoreBadgeLabel { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }

.scenarioGrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.scenarioCard { display: flex; flex-direction: column; padding: 18px; }
.scenarioCardHead { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.scenarioTitle { font-size: 17px; font-weight: 650; margin: 0; flex: 1; line-height: 1.3; }
.prospectLine { margin: 0 0 10px; font-size: 15px; color: var(--text-2); font-weight: 600; }
.tagRow { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.scenarioSummary { margin: 0 0 14px; font-size: 14.5px; color: var(--text-2); }
.practiceHead { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 6px; font-weight: 650; }
.practiceList { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 4px; }
.practiceList li { position: relative; padding-left: 16px; font-size: 14px; color: var(--text-2); }
.practiceList li::before { content: "•"; position: absolute; left: 4px; color: var(--accent); }
.scenarioCard .btn { margin-top: auto; }

/* ───────────────────────── prepare ───────────────────────── */

.prepareGrid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.goalList { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.goalList li { display: flex; gap: 10px; align-items: flex-start; }
.goalTick { flex: none; color: var(--accent); font-weight: 700; }
.goalName { font-weight: 600; }
.goalWhat { color: var(--text-2); }
.plainList { margin: 0 0 16px; padding-left: 20px; color: var(--text-2); display: grid; gap: 6px; }
.startCard { border-color: var(--accent-border); }
.micResult { margin: 12px 0 0; font-size: 14px; }
.micResult:empty { display: none; }
.micOk { color: var(--good); font-weight: 600; }
.micBad { color: var(--bad); font-weight: 600; }
.micDevice { display: block; color: var(--muted); font-weight: 400; margin-top: 2px; }
/* TU-1: the way out of an iframe that is not allowed the microphone. */
.newTabLink { color: inherit; font-weight: 600; text-decoration: underline; white-space: nowrap; }

/* ───────────────────────── live call ───────────────────────── */

.viewCall { max-width: 720px; margin: 0 auto; }
.callTop { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.callWho { flex: 1 1 200px; min-width: 0; }
.callName { font-size: 20px; font-weight: 650; margin: 0; }
.callSub { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.callMeta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.clock { margin: 0; font-variant-numeric: tabular-nums; font-size: 16px; font-weight: 600; color: var(--text-2); }

.stage {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 28px 20px 24px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}

.stageIndicator { position: relative; width: 114px; height: 114px; display: grid; place-items: center; }
.stageRing {
  /* inset by the 3px the 105% breathe/pulse scale needs, so the ring is never clipped (A-28). */
  position: absolute; inset: 3px; border-radius: 50%;
  border: 3px solid var(--accent-border); background: var(--accent-soft);
}
.stageDots { display: flex; gap: 7px; }
.stageDots i { width: 11px; height: 11px; border-radius: 50%; background: var(--accent); display: block; }

.stageIndicator[data-phase="listening"] .stageRing { animation: breathe 3.2s ease-in-out infinite; }
.stageIndicator[data-phase="listening"] .stageDots i { width: 6px; height: 16px; border-radius: 3px; opacity: .6; }
.stageIndicator[data-phase="listening"] .stageDots i:nth-child(2) { height: 26px; opacity: .8; }
.stageIndicator[data-phase="thinking"] .stageRing { border-color: var(--warn-border); background: var(--warn-soft); }
.stageIndicator[data-phase="thinking"] .stageDots i { background: var(--warn); animation: bounce 1.1s ease-in-out infinite; }
.stageIndicator[data-phase="thinking"] .stageDots i:nth-child(2) { animation-delay: .15s; }
.stageIndicator[data-phase="thinking"] .stageDots i:nth-child(3) { animation-delay: .3s; }
.stageIndicator[data-phase="speaking"] .stageRing { border-color: var(--good-border); background: var(--good-soft); animation: pulse 1.6s ease-out infinite; }
.stageIndicator[data-phase="speaking"] .stageDots i { width: 6px; height: 16px; border-radius: 3px; background: var(--good); animation: wave 1s ease-in-out infinite; }
.stageIndicator[data-phase="speaking"] .stageDots i:nth-child(2) { height: 26px; }
.stageIndicator[data-phase="speaking"] .stageDots i:nth-child(2) { animation-delay: .12s; }
.stageIndicator[data-phase="speaking"] .stageDots i:nth-child(3) { animation-delay: .24s; }
.stageIndicator[data-phase="ended"] .stageRing { border-color: var(--border-strong); background: var(--surface-2); }
.stageIndicator[data-phase="ended"] .stageDots i { background: var(--border-strong); }

@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes wave { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(2); } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(14, 107, 69, .25); } 100% { box-shadow: 0 0 0 16px rgba(14, 107, 69, 0); } }
@keyframes spin { to { transform: rotate(360deg); } }

.phaseLabel { margin: 16px 0 0; font-size: 19px; font-weight: 650; }
.phaseHint { margin: 4px 0 0; color: var(--muted); font-size: 14px; min-height: 21px; }

.micRow.micRowOff .micMeter { display: none; }
.micRow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; margin: 20px 0 22px; }
.micLabel { margin: 0; font-size: 13px; color: var(--muted); }
.micMeter { display: flex; gap: 3px; align-items: flex-end; height: 22px; }
.micMeter span {
  display: block; width: 5px; height: 100%;
  background: var(--surface-3); border-radius: 2px;
}
.micMeter span.on { background: var(--accent); }
.micMeter span.hot { background: var(--warn); }
.micState { margin: 0; font-size: 13px; color: var(--muted); }
.micState.micBad { color: var(--bad); }

.captions { margin-top: 16px; }
.captionsHead {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.captionsHead .h3 { flex: 1; color: var(--text-2); }
.captionsBody { padding: 12px 16px; max-height: 240px; overflow-y: auto; }
.captionsBody .emptyNote { padding: 4px 0; }

.turn { margin: 0 0 10px; font-size: 14.5px; }
.turn:last-child { margin-bottom: 0; }
.turnWho {
  display: block; font-size: 11.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
}
.turn.agent .turnWho { color: var(--accent); }
.turnText { display: block; color: var(--text-2); }
.turn.agent .turnText { color: var(--text); }
.turn.interim .turnText { color: var(--muted); font-style: italic; }
.turn.cut .turnText { color: var(--muted); }

.typeCard { margin-top: 16px; }
.typeBody { padding: 12px 16px 16px; }
.textForm { display: flex; gap: 8px; flex-wrap: wrap; }
.textForm .input { flex: 1 1 200px; }
.typeCard.typeCardActive { border-color: var(--accent-border); }

/* ───────────────────────── wrapping up ───────────────────────── */

.wrapCard { text-align: center; }
.spinnerSmall { width: 16px; height: 16px; margin: 3px 0 0; border-width: 2px; flex: none; }
.spinner {
  display: inline-block; width: 30px; height: 30px; margin-bottom: 14px;
  border: 3px solid var(--accent-border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 1s linear infinite;
}

/* ───────────────────────── debrief ───────────────────────── */

.scoreHead { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; padding: 20px; }
.gauge { flex: none; width: 116px; height: 116px; }
.gaugeTrack { fill: none; stroke: var(--surface-3); stroke-width: 10; }
.gaugeValue { fill: none; stroke: var(--accent); stroke-width: 10; stroke-linecap: round; }
.gaugeValue.gaugeLow { stroke: var(--bad); }
.gaugeValue.gaugeMid { stroke: var(--warn); }
.gaugeValue.gaugeHigh { stroke: var(--good); }
.gaugeNumber { fill: var(--text); font-size: 26px; font-weight: 700; font-family: var(--font); }
.gaugeUnit { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.scoreHeadMain { flex: 1 1 260px; min-width: 0; }
.scoreHeadMain .h2 { margin-bottom: 4px; }
.scoreMeta { margin: 0; color: var(--muted); font-size: 14px; }
.scoreBand { display: inline-block; margin: 0 0 4px; font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.scoreBand.bandDeveloping { color: var(--bad); }
.scoreBand.bandProgressing { color: var(--warn); }
.scoreBand.bandSolid { color: var(--accent); }
.scoreBand.bandStrong { color: var(--good); }
.scoreCoverage { margin: 6px 0 0; font-size: 14px; color: var(--text-2); }

.summaryCard { padding: 20px; border-left: 4px solid var(--accent); }
.summaryText { margin: 0; font-size: 16px; color: var(--text); }

.tryList { list-style: none; counter-reset: t; margin: 0; padding: 0; display: grid; gap: 12px; }
.tryList li { counter-increment: t; display: flex; gap: 12px; align-items: flex-start; }
.tryList li::before {
  content: counter(t); flex: none;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
}
.tryText { color: var(--text); font-size: 15.5px; }

.momentList { display: grid; gap: 12px; }
.moment { padding: 14px 16px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2); }
.momentBad { background: var(--bad-soft); border-color: var(--bad-border); }
.momentWarn { background: var(--warn-soft); border-color: var(--warn-border); }
.momentGood { background: var(--good-soft); border-color: var(--good-border); }
.momentHead { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.momentLabel { font-weight: 650; font-size: 14.5px; margin: 0; }
.momentNote { margin: 0; font-size: 14.5px; color: var(--text-2); }
.momentNote + .momentNote { margin-top: 6px; }

.moment .quoteWrap + *, .moment .momentNote + .quoteWrap { margin-top: 12px; }
.quote {
  display: block; margin: 0 0 3px; padding: 8px 12px;
  background: var(--surface); border-left: 3px solid var(--border-strong);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 14.5px; color: var(--text);
}
.quoteText::before { content: "\201C"; }
.quoteText::after { content: "\201D"; }
.quoteWho { display: block; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 2px; }
.quoteWho::before, .quoteWho::after { content: none; }
.jumpLink {
  background: none; border: 0; padding: 5px 4px 5px 0; margin: 0 0 2px;
  color: var(--muted); font-size: 12.5px; font-weight: 600; cursor: pointer;
  text-decoration: underline dotted; text-underline-offset: 3px;
}
.jumpLink:hover { color: var(--accent); text-decoration: underline; }
/* Takes the jump link's place when the cited turn is not in this record (C2-20). */
.quoteUnresolved { margin: 0 0 2px; padding: 5px 4px 5px 0; font-size: 12.5px; color: var(--muted); font-style: italic; }

.dimList { display: grid; gap: 4px; }
.dim { padding: 14px 0; border-top: 1px solid var(--border); }
.dim:first-child { border-top: 0; padding-top: 4px; }
.dimHead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.dimName { margin: 0; font-size: 15.5px; font-weight: 650; flex: 1 1 auto; }
.pips { display: flex; gap: 4px; flex: none; }
.pips span { display: block; width: 26px; height: 9px; border-radius: 3px; background: var(--surface-3); }
.pips.pipsZero span { background: var(--bad-soft); box-shadow: inset 0 0 0 1px var(--bad-border); }
.pips span.pipOn { background: var(--accent); }
.pips.pipsLow span.pipOn { background: #cc4b37; }
.pips.pipsMid span.pipOn { background: #d99114; }
.pips.pipsHigh span.pipOn { background: #17875c; }
.dimScore { flex: none; font-size: 13.5px; font-weight: 700; color: var(--text-2); font-variant-numeric: tabular-nums; }
.dimAnchor { margin: 0 0 6px; font-size: 14.5px; color: var(--text); }
.dimRationale { margin: 0 0 8px; font-size: 14.5px; color: var(--text-2); }
.dimEvidence { display: grid; gap: 14px; }

.metricGrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.metric { padding: 14px 16px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.metricValue { margin: 0; font-size: 22px; font-weight: 700; line-height: 1.15; }
.metricLabel { margin: 2px 0 0; font-size: 13.5px; color: var(--muted); }
.metricSay { margin: 6px 0 0; font-size: 13.5px; color: var(--text-2); }
.metricNote { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); }
.barChart { display: block; width: 100%; height: 14px; margin-top: 10px; }
.barTrack { fill: var(--surface-3); }
.barFill { fill: var(--accent); }

.transcriptBlock summary {
  cursor: pointer; padding: 16px 20px; font-weight: 650; font-size: 15.5px;
  border-radius: var(--radius);
}
.transcriptBlock summary::marker { color: var(--muted); }
.transcriptBlock[open] summary { border-bottom: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0; }
.transcriptBody { padding: 8px 20px 20px; }
.tTurn { display: grid; grid-template-columns: 34px 1fr; gap: 10px; padding: 8px 6px; border-radius: var(--radius-sm); }
.tTurn + .tTurn { margin-top: 2px; }
.tNum { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 3px; }
.tWho { display: block; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.tTurn.agent .tWho { color: var(--accent); }
.tFlag { margin-left: 8px; color: var(--muted); font-weight: 600; letter-spacing: .04em; }
.tText { display: block; color: var(--text-2); }
.tTurn.agent .tText { color: var(--text); }
.tTurn.cited { background: var(--accent-soft); }
.tTurn.flash { animation: flash 1.6s ease-out; }
@keyframes flash { 0% { background: #fde9a9; } 100% { background: var(--accent-soft); } }

.calloutInfo, .calloutBad {
  padding: 16px 18px; border-radius: var(--radius);
  border: 1px solid var(--accent-border); background: var(--accent-soft); color: #143a7d;
}
.calloutBad { border-color: var(--warn-border); background: var(--warn-soft); color: #4a3000; }
.calloutInfo p, .calloutBad p { margin: 0 0 10px; }
.calloutInfo p:last-child, .calloutBad p:last-child { margin-bottom: 0; }

/* ───────────────────────── responsive ───────────────────────── */

@media (min-width: 720px) {
  /* Two even columns: the scenario set is small and even, and 3 columns orphaned the 4th card (A-31). */
  .scenarioGrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 860px) {
  .prepareGrid { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: start; }
  .h1 { font-size: 30px; }
}

@media (max-width: 560px) {
  main { padding-block: 18px 22px; }
  .h1 { font-size: 23px; }
  .cardPad, .scoreHead, .summaryCard { padding: 16px; }
  .scenarioGrid { grid-template-columns: 1fr; }
  .stage { padding: 22px 14px 18px; }
  .gauge { width: 96px; height: 96px; }
  .scoreHead { gap: 16px; }
  .actionBar .btn { flex-basis: 100%; }
  .recentActions { width: 100%; }
  .recentActions .btn { flex: 1; }
  .pips span { width: 20px; }
  .transcriptBlock summary, .transcriptBody { padding-inline: 16px; }
  .tTurn { grid-template-columns: 26px 1fr; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .stageIndicator[data-phase="thinking"] .stageDots i:nth-child(2),
  .stageIndicator[data-phase="thinking"] .stageDots i:nth-child(3) { opacity: .5; }
}
