/* styles.css — AI Model Trust design system: tokens, components, print, mobile */

/* ─── 1. Custom properties ─────────────────────────────────────────────────── */
:root {
  --paper: #f6f1e8;
  --paper-2: #efe9dd;
  --paper-3: #e6dfd0;
  --rule: #d8cfbb;
  --rule-strong: #b8ad96;
  --ink: #1a1714;
  --ink-2: #2e2823;
  --ink-3: #5a5048;
  --ink-4: #857a6e;
  --red: #b3261e;
  --red-deep: #7a1a14;
  --red-soft: #e8c9c5;
  --ok: #2c6e3f;
  --warn: #a06a14;
  --crit: #9b2418;

  --font-serif: "Source Serif 4", Georgia, serif;
  --font-sans: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Mono", monospace;

  --max-width: 1320px;
  --page-padding: 32px;
  --reading-col: 720px;
  --radius: 4px;
  --radius-lg: 8px;

  --transition: 150ms ease;
}

/* ─── 2. Reset + base ─────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 15px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  min-height: 100vh;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--ink-2);
  text-underline-offset: 3px;
}
a:hover {
  color: var(--ink);
}

ul,
ol {
  padding-left: 1.4em;
}
p {
  margin: 0 0 0.9em;
}
p:last-child {
  margin-bottom: 0;
}

table {
  border-collapse: collapse;
  width: 100%;
}

/* ─── 3. Skip link ────────────────────────────────────────────────────────── */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: 9999;
  background: var(--ink);
  color: var(--paper);
  padding: 8px 16px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0 0 var(--radius) var(--radius);
}
.skip-link:focus {
  left: 16px;
  top: 0;
  width: auto;
  height: auto;
  overflow: visible;
  outline: 3px solid var(--red);
  outline-offset: 2px;
}

/* ─── 4. Focus styles ─────────────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--red-soft);
}
:focus:not(:focus-visible) {
  outline: none;
}

/* ─── 5. Typography utilities ─────────────────────────────────────────────── */
.serif {
  font-family: var(--font-serif);
}
.mono {
  font-family: var(--font-mono);
  font-size: 12px;
}
.kicker {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--red);
}
.eyebrow {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.helper {
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink-3);
  margin: 4px 0 0;
}
.error-text {
  font-size: 12px;
  color: var(--crit);
  margin: 4px 0 0;
}
.warning-banner--local {
  background: #fffbe6;
  border: 1px solid #f0c040;
  border-radius: 4px;
  color: #7a5c00;
  font-size: 12px;
  margin-top: 6px;
  padding: 6px 10px;
}
.local-run-banner {
  background: #fffbe6;
  border: 1px solid #f0c040;
  border-radius: 4px;
  color: #7a5c00;
  font-size: 13px;
  margin-bottom: 12px;
  padding: 8px 14px;
  text-align: center;
}

/* Pre-flight banner: same warning-red palette as report-incomplete-banner so
   the user immediately recognizes the severity and the offending model list
   reads cleanly. Distinct from generic run-error-banner so a bad-model fail
   doesn't look identical to a transient upstream outage. */
.run-error-banner--preflight {
  background: #fde8e6;
  border: 1px solid var(--crit);
  border-radius: var(--radius);
  color: var(--crit);
  padding: 16px 20px;
  margin: 16px 0;
}
.run-error-banner__title {
  font-weight: 600;
  font-size: 15px;
  margin: 0 0 8px;
}
.run-error-banner__list {
  list-style: disc;
  padding-left: 24px;
  margin: 8px 0 12px;
  font-size: 14px;
}
.run-error-banner__list code {
  color: var(--ink);
}

h1,
h2,
h3,
h4 {
  margin: 0 0 0.5em;
  font-family: var(--font-serif);
  color: var(--ink);
}
h1 {
  font-size: 44px;
  line-height: 1.05;
  font-weight: 600;
}
h2 {
  font-size: 28px;
  line-height: 1.15;
  font-weight: 600;
}
h3 {
  font-size: 20px;
  line-height: 1.2;
  font-weight: 600;
}
h4 {
  font-size: 16px;
  line-height: 1.25;
  font-weight: 600;
}

/* Visually hidden (accessible) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ─── 6. Layout ───────────────────────────────────────────────────────────── */
.app-root {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
#main {
  flex: 1;
}

.page-wrapper {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--page-padding);
}

/* ─── 7. Masthead ─────────────────────────────────────────────────────────── */
.app-masthead {
  background: var(--paper-2);
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  z-index: 100;
}
.masthead__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--page-padding);
  display: flex;
  align-items: center;
  gap: 24px;
  height: 56px;
}
.masthead__brand {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: -0.01em;
}
.masthead__brand:hover {
  color: var(--red);
}
.masthead__brand span {
  color: var(--red);
}
.masthead__nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.masthead__nav-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-3);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: var(--radius);
  transition:
    color var(--transition),
    background var(--transition);
}
.masthead__nav-link:hover {
  color: var(--ink);
  background: var(--paper-3);
}
.masthead__nav-link[aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
  background: var(--paper-3);
}

/* ─── 8. Stepper ──────────────────────────────────────────────────────────── */
.stepper-bar {
  background: var(--paper-2);
  border-bottom: 1px solid var(--rule);
}
.stepper {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--page-padding);
  display: flex;
  list-style: none;
  margin-top: 0;
  margin-bottom: 0;
  gap: 0;
}
.stepper__step {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-3);
  gap: 6px;
  white-space: nowrap;
}
.stepper__step::after {
  content: "›";
  margin-left: 12px;
  color: var(--rule-strong);
}
.stepper__step:last-child::after {
  display: none;
}
.stepper__step--active {
  color: var(--red);
  font-weight: 700;
}
.stepper__step--done {
  color: var(--ok);
}
.stepper__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  background: var(--rule);
  color: var(--ink-3);
  flex-shrink: 0;
}
.stepper__step--active .stepper__num {
  background: var(--red);
  color: var(--paper);
}
.stepper__step--done .stepper__num {
  background: var(--ok);
  color: var(--paper);
}

/* ─── 9. Privacy pill + modal ─────────────────────────────────────────────── */
.privacy-pill {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 200;
  background: var(--paper-2);
  border: 1px solid var(--rule-strong);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-3);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  transition:
    background var(--transition),
    color var(--transition);
}
.privacy-pill:hover {
  background: var(--paper-3);
  color: var(--ink);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(26, 23, 20, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-content {
  background: var(--paper);
  border-radius: var(--radius-lg);
  max-width: 520px;
  width: 100%;
  padding: 36px 40px 32px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.2);
  position: relative;
}
.modal-content__close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 20px;
  line-height: 1;
  color: var(--ink-3);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius);
  transition:
    color var(--transition),
    background var(--transition);
}
.modal-content__close:hover {
  color: var(--ink);
  background: var(--paper-3);
}
.modal-content h2 {
  font-size: 22px;
  margin-bottom: 16px;
}
.modal-content ul {
  margin: 12px 0;
}
.modal-content li {
  margin-bottom: 8px;
  font-size: 14px;
  line-height: 1.5;
}

/* ─── 10. Buttons ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  min-height: 44px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background var(--transition),
    color var(--transition),
    box-shadow var(--transition);
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn--primary {
  background: var(--ink);
  color: var(--paper);
}
.btn--primary:hover:not(:disabled) {
  background: var(--ink-2);
}

.btn--secondary {
  background: var(--paper-3);
  color: var(--ink);
  border: 1px solid var(--rule-strong);
}
.btn--secondary:hover:not(:disabled) {
  background: var(--rule);
}

.btn--ghost {
  background: transparent;
  color: var(--ink-3);
  border: 1px solid var(--rule);
}
.btn--ghost:hover:not(:disabled) {
  background: var(--paper-3);
  color: var(--ink);
}

.btn--danger {
  background: var(--red-deep);
  color: var(--paper);
}
.btn--danger:hover:not(:disabled) {
  background: var(--red);
}

.btn--sm {
  padding: 6px 12px;
  min-height: 32px;
  font-size: 12px;
}

.btn--full {
  width: 100%;
}

/* ─── 11. Form elements ──────────────────────────────────────────────────── */
.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 4px;
}
.input,
.select,
textarea {
  width: 100%;
  padding: 8px 12px;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
  appearance: none;
}
.input:focus,
.select:focus,
textarea:focus {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--red-soft);
}
.input::placeholder {
  color: var(--ink-4);
}
.input--key {
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}
.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235a5048' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}

textarea {
  min-height: 100px;
  resize: vertical;
  line-height: 1.5;
}

.input[aria-invalid="true"] {
  border-color: var(--crit);
}

.key-input-group {
  display: flex;
  gap: 6px;
  align-items: flex-start;
}
.key-input-group .input {
  flex: 1;
  min-width: 0;
}

.model-select-group {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.model-select-group .select {
  flex: 1;
  min-width: 180px;
}

/* ─── 12. Connection status indicators ────────────────────────────────────── */
.connection-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.status--ok {
  background: #d4eddc;
  color: var(--ok);
}
.status--fail {
  background: #fde8e6;
  color: var(--crit);
}
.status--checking {
  background: var(--paper-3);
  color: var(--ink-3);
}
.status--unverified {
  background: #fff8e1;
  color: #b45309;
}
.status--unchecked {
  background: var(--paper-3);
  color: var(--ink-4);
}

/* ─── 13. Badges ─────────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 3px;
  vertical-align: middle;
  margin-left: 6px;
}
.badge--beta {
  background: #fef3c7;
  color: #92400e;
}
.badge--incomplete {
  background: #fde8e6;
  color: var(--crit);
}
.badge--version {
  background: var(--paper-3);
  color: var(--ink-3);
  border: 1px solid var(--rule);
  text-transform: lowercase;
  letter-spacing: 0.02em;
}

/* ─── 14. Overview / landing page ───────────────────────────────────────── */
.overview-page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 80px var(--page-padding) 120px;
}
.overview-page__hero {
  max-width: var(--reading-col);
  margin-bottom: 64px;
}
.overview-page__eyebrow {
  margin-bottom: 12px;
  display: block;
}
.overview-page__title {
  font-size: 52px;
  line-height: 1;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
  color: var(--ink);
}
.overview-page__title span {
  color: var(--red);
}
.overview-page__lead {
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 560px;
  margin-bottom: 36px;
}
.overview-page__ctas {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 48px;
}
.overview-page__ctas .btn {
  font-size: 15px;
  padding: 12px 28px;
}
.overview-page__features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 64px;
}
.feature-card {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
}
.feature-card__number {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 600;
  color: var(--red);
  margin-bottom: 8px;
}
.feature-card__title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
}
.feature-card__text {
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-3);
}

.overview-page__privacy-bar {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 16px 20px;
  font-size: 13px;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 48px;
  max-width: var(--reading-col);
}

/* ─── 15. Setup screens (shared) ─────────────────────────────────────────── */
.setup-screen {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 48px var(--page-padding);
}
.setup-screen__title {
  margin-bottom: 6px;
}
.setup-screen__subtitle {
  font-size: 15px;
  color: var(--ink-3);
  margin-bottom: 40px;
}

/* ─── 16. Connect & Select screen ───────────────────────────────────────── */
.connect-screen {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 48px;
  align-items: start;
}
.provider-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.provider-card {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.provider-card--beta {
  border-color: #fbbf24;
}
.provider-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.provider-card__name {
  font-size: 16px;
  margin: 0;
}
.provider-card__key-row {
  margin-bottom: 14px;
}
.provider-card__model-row {
  margin-top: 12px;
}

.connect-sidebar {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  position: sticky;
  top: 80px;
}
.sidebar__title {
  font-size: 16px;
  margin-bottom: 16px;
}
.sidebar__empty {
  font-size: 13px;
  color: var(--ink-4);
}

.panel-list {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
}
.panel-list__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 13px;
}
.panel-list__item:last-child {
  border-bottom: none;
}
.panel-list__role {
  flex-shrink: 0;
}
.panel-list__model {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.target-display {
  background: var(--paper-3);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 16px;
  font-size: 13px;
}
.target-display .kicker {
  display: block;
  margin-bottom: 4px;
}
.target-display p {
  margin: 0;
  font-weight: 600;
}

.sidebar__privacy {
  border-top: 1px solid var(--rule);
  padding-top: 16px;
  margin-top: 16px;
  margin-bottom: 20px;
}

/* ─── 17. Configure screen ─────────────────────────────────────────────── */
.configure-screen {
  max-width: 760px;
}
.settings-section {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 20px;
}
.settings-section summary,
.settings-section__header {
  padding: 18px 20px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  user-select: none;
  background: var(--paper-2);
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.settings-section details[open] summary {
  border-bottom: 1px solid var(--rule);
}
.settings-section__body {
  padding: 20px;
}
.setting-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
}
.setting-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.setting-row__label {
  flex: 1;
  font-size: 14px;
}
.setting-row__label small {
  display: block;
  font-size: 11px;
  color: var(--ink-3);
  font-weight: 400;
}
.setting-row__control {
  flex-shrink: 0;
  min-width: 120px;
}
.setting-row__control .input,
.setting-row__control .select {
  width: auto;
}

.cost-estimate {
  background: var(--paper-3);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 20px 0;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.cost-estimate__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}
.cost-estimate__value {
  font-size: 15px;
  font-family: var(--font-serif);
  font-weight: 600;
}
.cost-estimate__note {
  font-size: 11px;
  color: var(--ink-3);
}

/* ─── 17a. Budget slider + summary (Configure → Run settings) ─────────── */
.budget-slider {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  min-width: 220px;
}
.budget-slider__row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.budget-slider__range {
  flex: 1;
  min-width: 140px;
  accent-color: var(--ink-2);
}
.budget-slider__readout {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  min-width: 90px;
  text-align: right;
}
.budget-slider__bounds {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--ink-4);
  font-family: var(--font-mono);
}

/* Reasoning-effort 4-stop slider (Configure → Advanced options). Reuses the
   same tokens as the budget slider — no new color literals. */
.thinking-slider {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  min-width: 220px;
}
.thinking-slider__range {
  width: 100%;
  min-width: 140px;
  accent-color: var(--ink-2);
}
.thinking-slider__ticks {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--ink-4);
  font-family: var(--font-mono);
}
.thinking-slider__tick--active {
  color: var(--ink);
  font-weight: 600;
}

.budget-summary {
  background: var(--paper-3);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-top: 10px;
  font-size: 12px;
}
.budget-summary__row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.budget-summary__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 3px;
}
.budget-summary__badge--ok {
  background: #d8e8d8;
  color: var(--ok);
}
.budget-summary__badge--tight {
  background: #f5e7c8;
  color: var(--warn);
}
.budget-summary__badge--fail {
  background: var(--red-soft);
  color: var(--crit);
}
.budget-summary__rationale {
  color: var(--ink-3);
  font-size: 12px;
}
.budget-summary__details {
  margin-top: 8px;
}
.budget-summary__details summary {
  cursor: pointer;
  font-size: 11px;
  color: var(--ink-3);
  user-select: none;
}
.budget-summary__details-body {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--rule);
  font-size: 11px;
  color: var(--ink-3);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.budget-summary__details-body dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: 12px;
  row-gap: 2px;
  margin: 0;
}
.budget-summary__details-body dt {
  font-weight: 600;
  color: var(--ink-2);
}
.budget-summary__details-body dd {
  margin: 0;
  font-family: var(--font-mono);
}

.budget-banner {
  margin-top: 10px;
  background: #fde8e6;
  border: 1px solid var(--crit);
  border-radius: var(--radius);
  padding: 12px;
  font-size: 12px;
  color: var(--ink-2);
}
.budget-banner__title {
  font-weight: 700;
  color: var(--crit);
  margin-bottom: 4px;
  font-size: 13px;
}
.budget-banner__numbers {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  margin-bottom: 8px;
}
.budget-banner__suggestions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.budget-banner__suggestion {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  font-size: 12px;
  color: var(--ink);
  font-family: var(--font-sans);
  cursor: pointer;
  text-align: left;
  transition: background var(--transition);
}
.budget-banner__suggestion:hover,
.budget-banner__suggestion:focus-visible {
  background: var(--paper-2);
}
.budget-banner__suggestion-preview {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
}

.dimension-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.dimension-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.dimension-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

/* ─── 18. Live Run screen ─────────────────────────────────────────────── */
.live-run-screen {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--page-padding) 60px;
}

.run-status-bar {
  background: var(--paper-2);
  border-bottom: 1px solid var(--rule);
  padding: 14px var(--page-padding);
  position: sticky;
  top: 56px;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.run-status-bar__state {
  font-size: 13px;
  font-weight: 700;
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.run-status-bar__elapsed {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--ink-2);
}
.run-status-bar__counter {
  font-size: 13px;
  color: var(--ink-3);
}
.run-status-bar__refusal {
  font-size: 13px;
  color: var(--ink-3);
}
.run-status-bar__progress {
  flex: 1;
  min-width: 120px;
  height: 6px;
  background: var(--rule);
  border-radius: 3px;
  overflow: hidden;
}
.run-status-bar__progress-fill {
  height: 100%;
  background: var(--red);
  border-radius: 3px;
  transition: width 0.4s ease;
}
.btn--stop {
  background: var(--red-deep);
  color: var(--paper);
  font-size: 13px;
  padding: 8px 16px;
  min-height: 40px;
  margin-left: auto;
  flex-shrink: 0;
}
.btn--stop:hover:not(:disabled) {
  background: var(--red);
}

.run-content {
  padding-top: 32px;
}

.agent-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

/* ─── 19. Agent tiles ─────────────────────────────────────────────────── */
.agent-tile {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 18px 16px 14px;
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
}
.agent-tile--running {
  border-color: var(--red);
  box-shadow: 0 0 0 1px var(--red-soft);
}
.agent-tile--complete {
  border-color: var(--ok);
}
.agent-tile__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.agent-tile__name {
  font-size: 15px;
  font-weight: 600;
}
.agent-tile__pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  animation: pulse-ring 1.4s ease-in-out infinite;
}
@keyframes pulse-ring {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.4;
    transform: scale(1.5);
  }
}
.agent-tile__status {
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink-3);
  min-height: 2.9em;
}

/* ─── 20. Transcript ─────────────────────────────────────────────────── */
.transcript-section {
  position: relative;
  margin-top: 32px;
}
.transcript-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.transcript-section__title {
  font-size: 16px;
  margin: 0;
}
/* Not a .btn — intentionally smaller pill affordance scoped to the transcript
   surface (6px 12px vs .btn's 10px 20px / 44px min-height). */
.transcript-jump-latest {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--paper);
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  transition:
    background var(--transition),
    transform var(--transition);
}
.transcript-jump-latest:hover {
  background: var(--ink-2);
}
/* Focus ring uses --paper so it's visible against the dark --ink button body
   (an --ink outline on an --ink background only showed at the 2px gap). */
.transcript-jump-latest:focus-visible {
  outline: 2px solid var(--paper);
  outline-offset: 2px;
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.18),
    0 0 0 4px var(--ink);
}
@media (prefers-reduced-motion: reduce) {
  .transcript-jump-latest {
    transition: none;
  }
}
.transcript-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.filter-chip {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  background: var(--paper-3);
  color: var(--ink-3);
  border: 1px solid var(--rule);
  transition:
    background var(--transition),
    color var(--transition);
}
.filter-chip--active,
.filter-chip:hover {
  background: var(--ink-2);
  color: var(--paper);
}

.transcript {
  background: var(--paper-3);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  max-height: 400px;
  overflow-y: auto;
  padding: 16px;
  font-size: 13px;
}

.print-only {
  display: none;
}
.transcript__entry {
  display: grid;
  grid-template-columns: 40px 110px 1fr;
  gap: 6px;
  padding: 6px 0;
  border-bottom: 1px solid var(--rule);
  line-height: 1.45;
}
.transcript__entry:last-child {
  border-bottom: none;
}
.transcript__ts {
  color: var(--ink-4);
  font-family: var(--font-mono);
  font-size: 11px;
}
.transcript__agent {
  font-weight: 600;
  color: var(--ink-2);
}
.transcript__text {
  color: var(--ink);
}
.transcript__entry--target .transcript__agent {
  color: var(--ink-3);
  font-style: italic;
}
.transcript__entry--probe .transcript__agent {
  color: var(--red);
}

/* ─── 21. Report screen ──────────────────────────────────────────────── */
.report-screen {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--page-padding) 80px;
}
.report-screen--incomplete .report-header {
  border-top: 4px solid var(--crit);
}

.report-incomplete-banner {
  background: #fde8e6;
  border: 1px solid var(--crit);
  border-radius: var(--radius);
  padding: 12px 20px;
  color: var(--crit);
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 24px;
}

/* Reroute disclosure (panel-independence / honesty layer). Always-visible note
 * — appears on BOTH a published-grade and a withheld report — so the amber
 * (warn) palette signals "read this" without the critical-red of an aborted run.
 * A substitution onto an independent capable model still publishes the grade;
 * the collapse case (grade withheld) is named in the recovery surface above. */
.report-panel-substitutions {
  background: var(--paper-2);
  border: 1px solid var(--warn);
  border-left-width: 4px;
  border-radius: var(--radius);
  padding: 12px 20px;
  color: var(--ink-2);
  font-size: 14px;
  margin-bottom: 24px;
}
.report-panel-substitutions > strong {
  color: var(--warn);
}
.report-panel-substitutions ul {
  margin: 6px 0 0;
  padding-left: 20px;
}
.report-panel-substitutions li {
  margin-bottom: 4px;
}

.report-header {
  padding: 48px 0 32px;
  border-bottom: 2px solid var(--rule);
  margin-bottom: 32px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px;
  align-items: start;
}
.report-header__main {
}
.report-header__kicker {
  display: block;
  margin-bottom: 10px;
}
.report-header__headline {
  font-family: var(--font-serif);
  font-size: 34px;
  line-height: 1.12;
  font-weight: 600;
  max-width: var(--reading-col);
  color: var(--ink);
  margin-bottom: 16px;
}
.report-header__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
  color: var(--ink-3);
}
.report-header__meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.report-action-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}
/* Pre-share disclosure under the export/print controls. flex-basis:100%
   drops it onto its own line below the buttons; the whole action bar is
   hidden in print, so this never appears in the exported PDF. */
.report-action-bar__note {
  flex-basis: 100%;
  margin: 2px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-3);
  max-width: 64ch;
}

/* ─── 22. Grade card ─────────────────────────────────────────────────── */
.grade-card {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  text-align: center;
  min-width: 220px;
  flex-shrink: 0;
}
.grade-card__grade {
  font-family: var(--font-serif);
  font-size: 72px;
  line-height: 1;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.04em;
}
.grade-card__sub {
  font-size: 44px;
  vertical-align: super;
  color: var(--ink-3);
}
.grade-card__score {
  font-size: 15px;
  color: var(--ink-3);
  margin: 4px 0 16px;
}
.grade-card__table {
  width: 100%;
  font-size: 12px;
  text-align: left;
  border-top: 1px solid var(--rule);
  padding-top: 12px;
  margin-top: 12px;
}
.grade-card__table td {
  padding: 2px 4px;
}
.grade-card__table td:first-child {
  color: var(--ink-3);
}
.grade-card__confidence {
  font-size: 11px;
  color: var(--ink-4);
  margin-top: 10px;
  font-style: italic;
}

/* ─── 23. Tabs ───────────────────────────────────────────────────────── */
.tabs {
  margin-bottom: 40px;
}
.tablist {
  display: flex;
  border-bottom: 2px solid var(--rule);
  margin-bottom: 32px;
  gap: 0;
  overflow-x: auto;
}
.tab-button {
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-3);
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  white-space: nowrap;
  transition:
    color var(--transition),
    border-color var(--transition);
}
.tab-button:hover {
  color: var(--ink-2);
}
.tab-button[aria-selected="true"] {
  color: var(--ink);
  border-bottom-color: var(--red);
}
.tabpanel {
  display: none;
}
.tabpanel--active {
  display: block;
}

/* ─── 24. Radar chart ────────────────────────────────────────────────── */
.radar-wrapper {
  display: flex;
  gap: 40px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 40px;
}
.radar-svg {
  max-width: 100%;
  height: auto;
}
.radar-legend {
  flex: 1;
  min-width: 200px;
}
.radar-legend__title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 10px;
}
.radar-score-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 12px;
}
.radar-score-row__bar-bg {
  flex: 1;
  height: 6px;
  background: var(--paper-3);
  border-radius: 3px;
  overflow: hidden;
}
.radar-score-row__bar {
  height: 100%;
  border-radius: 3px;
  background: var(--ink-3);
  transition: width 0.3s ease;
}
.radar-score-row--low .radar-score-row__bar {
  background: var(--crit);
}
.radar-score-row--mid .radar-score-row__bar {
  background: var(--warn);
}
.radar-score-row--high .radar-score-row__bar {
  background: var(--ok);
}
.radar-score-row__label {
  min-width: 140px;
}
.radar-score-row__val {
  min-width: 32px;
  text-align: right;
  font-family: var(--font-mono);
  color: var(--ink-2);
  font-weight: 600;
}

/* "Show data" table — keyboard/AT-reachable equivalent of the radar's
 * SVG <title> hover values (WCAG 1.1.1; docs/ui-ux-design.md §5/§5a).
 * The native <details>/<summary> gives keyboard toggling for free; the
 * print stylesheet force-opens it and hides the toggle so the table prints
 * inline. */
.radar-data {
  margin-top: 16px;
  border-top: 1px solid var(--rule);
  padding-top: 12px;
}
.radar-data__summary {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.radar-data__table {
  width: 100%;
  margin-top: 8px;
  font-size: 12px;
  border-collapse: collapse;
}
.radar-data__table th,
.radar-data__table td {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid var(--rule);
}
.radar-data__table thead th {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
}
.radar-data__table tbody th {
  font-weight: 500;
  color: var(--ink-2);
}
.radar-data__table .radar-data__val {
  text-align: right;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--ink-2);
}

/* ─── 25. Overview tab (executive summary) ───────────────────────────── */
.exec-summary {
  max-width: var(--reading-col);
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink-2);
  margin-bottom: 40px;
}
.exec-summary::first-letter {
  font-size: 60px;
  line-height: 0.85;
  float: left;
  margin: 6px 10px 0 0;
  font-weight: 600;
  color: var(--red);
}

.panel-table {
  width: 100%;
  font-size: 13px;
  border-top: 2px solid var(--rule);
  margin-top: 32px;
}
.panel-table th {
  text-align: left;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  padding: 8px 12px 8px 0;
  border-bottom: 1px solid var(--rule);
}
.panel-table td {
  padding: 8px 12px 8px 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: middle;
}
.panel-table tr:last-child td {
  border-bottom: none;
}

/* ─── 26. Findings ──────────────────────────────────────────────────── */
.findings-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.finding-card {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.finding-card__header {
  padding: 20px 20px 14px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.finding-card__badges {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}
.severity-chip {
  display: inline-block;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: 12px;
}
.severity-chip--high {
  background: #fde8e6;
  color: var(--crit);
}
.severity-chip--medium {
  background: #fef3c7;
  color: #92400e;
}
.severity-chip--low {
  background: #d4eddc;
  color: #1a5c2a;
}
.area-chip {
  display: inline-block;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 600;
  border-radius: 12px;
  background: var(--paper-3);
  color: var(--ink-3);
  text-align: center;
  line-height: 1.3;
}
.finding-card__content {
  flex: 1;
}
.finding-card__title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
}
.finding-card__detail {
  font-size: 13px;
  color: var(--ink-3);
  line-height: 1.5;
  margin: 0;
}

.finding-card details {
  border-top: 1px solid var(--rule);
}
.finding-card details summary {
  padding: 10px 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: var(--ink-3);
  list-style: none;
}
.finding-card details summary::before {
  content: "+ ";
}
.finding-card details[open] summary::before {
  content: "− ";
}
.evidence-box {
  background: var(--paper-3);
  padding: 16px 20px;
  font-size: 12px;
}
.evidence-turn {
  margin-bottom: 10px;
}
.evidence-turn:last-child {
  margin-bottom: 0;
}
.evidence-turn__speaker {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 3px;
}
.evidence-turn--target .evidence-turn__speaker {
  color: var(--red);
}
.evidence-turn__text {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  background: var(--paper);
  border-left: 3px solid var(--rule-strong);
  padding: 8px 12px;
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--ink-2);
}
.evidence-turn__annotation {
  font-size: 11px;
  color: var(--ink-3);
  font-style: italic;
  margin-top: 3px;
}

/* ─── 27. Methodology tab ────────────────────────────────────────────── */
.methodology-tab {
  font-size: 14px;
  line-height: 1.6;
  max-width: var(--reading-col);
}
.methodology-tab h3 {
  margin-top: 28px;
  margin-bottom: 8px;
}

/* ─── 28. Limitations tab ────────────────────────────────────────────── */
.limitations-tab {
  max-width: var(--reading-col);
}
.limitations-tab h3 {
  margin-top: 0;
  margin-bottom: 12px;
}
.limitations-list,
.mitigations-list {
  list-style: none;
  padding: 0;
  margin: 0 0 32px;
}
.limitations-list li,
.mitigations-list li {
  padding: 10px 0 10px 20px;
  border-bottom: 1px solid var(--rule);
  font-size: 14px;
  line-height: 1.5;
  position: relative;
}
.limitations-list li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--ink-3);
}
.mitigations-list li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--ok);
}

/* ─── 29. DOM print header/footer (Firefox fallback) ─────────────────── */
.print-header,
.print-footer {
  display: none;
  font-size: 11px;
  color: var(--ink-3);
  padding: 6px 0;
  border-top: 1px solid var(--rule);
  margin-top: 8px;
  font-family: var(--font-sans);
}

/* ─── 30. Print styles ───────────────────────────────────────────────── */
@media print {
  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 11pt;
  }

  .app-masthead,
  .stepper-bar,
  .privacy-pill,
  .report-action-bar,
  .run-status-bar,
  .btn--stop,
  .tablist,
  .filter-chip,
  .transcript-filters,
  .overview-page__ctas,
  .connect-sidebar,
  .radar-data__summary {
    display: none !important;
  }

  .tabpanel {
    display: block !important;
  }
  details {
    display: block;
  }
  details > * {
    display: block !important;
  }
  summary::marker,
  summary::-webkit-details-marker {
    display: none;
  }

  h2,
  h3 {
    break-after: avoid;
  }
  figure,
  table {
    break-inside: avoid;
  }
  .report-section {
    break-before: page;
  }
  .finding-card {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .report-header {
    grid-template-columns: 1fr auto;
  }
  .radar-svg text {
    fill: #000;
  }
  .radar-svg .radar-fill {
    fill: rgba(0, 0, 0, 0.08);
  }
  .radar-svg .radar-stroke {
    stroke: #000;
  }
  .severity-chip--high {
    background: #eee;
    color: #000;
  }
  .severity-chip--medium {
    background: #eee;
    color: #000;
  }
  .severity-chip--low {
    background: #eee;
    color: #000;
  }

  .print-header,
  .print-footer {
    display: block;
  }

  .print-only {
    display: block;
  }

  /* Suppress the on-screen Transcript tab in print so the full-transcript
     section below the tabs is the only transcript in the PDF and lands as
     the last section (every other .report-section precedes it in DOM order
     and break-before: page above forces each onto its own page). */
  #panel-transcript {
    display: none !important;
  }

  .report-full-transcript .transcript,
  .report-full-transcript .transcript--print {
    max-height: none;
    overflow: visible;
    background: transparent;
    border: none;
    padding: 0;
  }
  .report-full-transcript .transcript__entry {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .report-full-transcript .transcript__text {
    white-space: pre-wrap;
    word-break: break-word;
  }

  @page {
    margin: 18mm 16mm;
  }
}

/* ─── 31. Mobile (≤ 720px) ─────────────────────────────────────────── */
@media (max-width: 720px) {
  :root {
    --page-padding: 18px;
  }
  h1 {
    font-size: 32px;
  }
  .overview-page__title {
    font-size: 36px;
  }
  .overview-page__features {
    grid-template-columns: 1fr;
  }
  .connect-screen {
    grid-template-columns: 1fr;
  }
  .connect-sidebar {
    position: static;
  }
  .agent-grid {
    grid-template-columns: 1fr;
  }
  .report-header {
    grid-template-columns: 1fr;
  }
  .grade-card {
    min-width: 0;
  }
  .radar-wrapper {
    flex-direction: column;
  }
  .masthead__nav-link span {
    display: none;
  }
}

/* ─── 32. Reduced motion ─────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ─── 33. Masthead aliases + additions ───────────────────────────────── */
.masthead {
  background: var(--paper-2);
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  z-index: 100;
}
.masthead__logo {
  margin-right: 4px;
}
.masthead__name {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.masthead__link {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-3);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: var(--radius);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
  transition:
    color var(--transition),
    background var(--transition);
}
.masthead__link:hover {
  color: var(--ink);
  background: var(--paper-3);
}
.masthead__privacy-btn {
  /* inherits .masthead__link */
}

/* Stepper wrapper */
.stepper {
  background: var(--paper-2);
  border-bottom: 1px solid var(--rule);
}
.stepper__list {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--page-padding);
  display: flex;
  list-style: none;
  gap: 0;
}

/* ─── 34. Main content area ──────────────────────────────────────────── */
.main-content {
  flex: 1;
  outline: none;
}

/* ─── 35. Overview screen ────────────────────────────────────────────── */
.overview-screen {
  max-width: var(--max-width);
}

.overview-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 40px 0;
}
.overview-card {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
}
.overview-card__icon {
  font-size: 28px;
  margin-bottom: 10px;
}
.overview-card__title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
  font-family: var(--font-sans);
}
.overview-card__body {
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-3);
  margin: 0;
}

.overview-dimensions {
  margin: 40px 0;
}
.overview-dimensions__title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 14px;
  font-family: var(--font-sans);
}
.overview-mechanism {
  margin: 32px auto 0;
  max-width: 680px;
  text-align: center;
}
.dimension-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.dimension-tag {
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  background: var(--paper-3);
  border: 1px solid var(--rule);
  border-radius: 12px;
  color: var(--ink-2);
}

.btn--lg {
  font-size: 16px;
  padding: 14px 32px;
  min-height: 52px;
}

/* ─── 36. Site footer ────────────────────────────────────────────────── */
.site-footer {
  background: var(--paper-2);
  border-top: 1px solid var(--rule);
  padding: 24px var(--page-padding);
  margin-top: auto;
}
.site-footer__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  font-size: 13px;
  color: var(--ink-3);
  text-align: center;
}
.site-footer__inner a {
  color: var(--ink-3);
}
.site-footer__inner a:hover {
  color: var(--ink);
}
.footer-link-btn {
  background: none;
  border: none;
  color: var(--ink-3);
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  font-family: var(--font-sans);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.footer-link-btn:hover {
  color: var(--ink);
}

/* ─── 37. Modal (used by PrivacyModal + StopModal) ────────────────────── */
.modal {
  background: var(--paper);
  border-radius: var(--radius-lg);
  max-width: 480px;
  width: 100%;
  padding: 36px 40px 32px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.22);
}
.modal__title {
  font-size: 22px;
  margin-bottom: 16px;
}
.modal__body {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-2);
  margin-bottom: 24px;
}
.modal__body p {
  margin-bottom: 12px;
}
.modal__body p:last-child {
  margin-bottom: 0;
}
.modal__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ─── 38. Live Run screen aliases ────────────────────────────────────── */
.run-screen {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-bottom: 60px;
}

/* progress bar inside status bar */
.run-progress-bar {
  flex: 1;
  min-width: 100px;
  height: 6px;
  background: var(--rule);
  border-radius: 3px;
  overflow: hidden;
}
.run-progress-bar__fill {
  height: 100%;
  background: var(--red);
  border-radius: 3px;
  transition: width 0.4s ease;
}
.run-status-bar__phase {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  margin-left: 4px;
}
.run-status-bar__timer {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.run-status-bar__progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 140px;
}
.run-status-bar__calls {
  margin: 0;
}

/* ─── 39. Mobile additions ────────────────────────────────────────────── */
@media (max-width: 720px) {
  .overview-cards {
    grid-template-columns: 1fr 1fr;
  }
  .stepper__list {
    overflow-x: auto;
  }
  .run-status-bar {
    flex-wrap: wrap;
    gap: 10px;
  }
  .modal {
    padding: 24px 20px 20px;
  }
}
@media (max-width: 480px) {
  .overview-cards {
    grid-template-columns: 1fr;
  }
}

/* ── PanelBuilder: 6-slot drag-drop role assignment ─────────────────────── */

.panel-builder {
  margin-bottom: 24px;
}

.panel-slots {
  list-style: none;
  margin: 0 0 16px 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.panel-slot {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: stretch;
  background: var(--paper-2, #efe9d9);
  border: 1px solid var(--rule-strong);
  border-radius: 4px;
  padding: 0;
  position: relative;
  transition:
    border-color 120ms ease,
    box-shadow 120ms ease,
    background 120ms ease;
}

.panel-slot--empty {
  background: transparent;
  border-style: dashed;
  opacity: 0.85;
}

.panel-slot--lifted {
  outline: 3px solid var(--ok);
  outline-offset: 2px;
  box-shadow: 0 4px 0 0 var(--rule-strong);
}

.panel-slot--drag-over {
  background: var(--paper-3);
  border-color: var(--ok);
}

.panel-slot__handle {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  text-align: left;
  background: transparent;
  border: 0;
  font: inherit;
  color: inherit;
  cursor: grab;
  width: 100%;
  min-width: 0;
  min-height: 44px;
}

.panel-slot--filled .panel-slot__handle:active {
  cursor: grabbing;
}

.panel-slot__handle:focus-visible {
  outline: 2px solid var(--ok);
  outline-offset: -2px;
}

.panel-slot__role {
  font-weight: 600;
  letter-spacing: 0.04em;
  font-size: 11px;
  text-transform: uppercase;
}

.panel-slot__model {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.panel-slot__provider {
  font-weight: 500;
  font-size: 14px;
}

.panel-slot__model-id {
  font-size: 11px;
  color: #5a5040;
  /* Ellipsis prevents long model ids (claude-3-5-sonnet-20241022) from
     wrapping onto multiple lines and inflating slot height past the viewport.
     Full id is exposed via title= for hover; the handle button's aria-label
     already announces "{provider} {model}" so screen readers get it too. */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  max-width: 100%;
}

.panel-slot__empty {
  font-style: italic;
  color: #7a7060;
  font-size: 13px;
}

.panel-slot__badges {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}

.panel-slot__toolbar {
  /* 2×2 grid: column 1 = move up/down (always visible), column 2 = settings/
     remove (only when slot is filled). grid-auto-flow: column means the
     DOM order ↑, ↓, ⚙, ✕ fills column 1 first (rows top-bottom) then
     column 2, which keeps tab order linear while presenting the requested
     visual layout. Halves the toolbar's horizontal footprint vs. the prior
     4-button row, freeing space for the model name. */
  display: grid;
  grid-template-columns: repeat(2, 28px);
  grid-template-rows: repeat(2, 28px);
  grid-auto-flow: column;
  gap: 4px;
  padding: 4px 6px;
  border-left: 1px solid var(--rule-strong);
  align-content: center;
}

.panel-slot__toolbar .btn {
  min-width: 28px;
  min-height: 28px;
  padding: 0 4px;
}

/* ── Panel alignment advisory indicators ─────────────────────────────────── */

/* Small inline dot shown inside the slot handle for validity slots. */
.slot-status {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  vertical-align: middle;
  margin-left: 4px;
  flex-shrink: 0;
}

/* Green dot: flagship-tier, off the target's provider family. */
.slot-status--ok {
  background: var(--ok);
}

/* Red dot: weak tier or same provider family as the target. */
.slot-status--fail {
  background: var(--crit);
}

/* Visible fail message rendered below the slot handle (not tooltip-only). */
.panel-slot__align--fail {
  font-size: 12px;
  color: var(--crit);
  margin: 2px 0 0;
  padding: 0 10px 4px;
  grid-column: 1 / -1;
  line-height: 1.4;
}

/* Amber advisory banner when the whole panel shares one provider family. */
.panel-advisory {
  background: #fffbe6;
  border: 1px solid #f0c040;
  border-radius: var(--radius);
  color: #7a5c00;
  font-size: 12px;
  margin-top: 8px;
  padding: 6px 10px;
}

.slot-override {
  grid-column: 1 / -1;
  background: var(--paper-3);
  border-top: 1px solid var(--rule-strong);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.slot-override fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

.slot-override legend {
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.input--sm {
  font-size: 13px;
  padding: 4px 6px;
  max-width: 120px;
}

/* Badge variants — text-only with background fill, AAA contrast on paper-3 */
.badge--flagship {
  background: var(--paper-3);
  color: var(--ok);
  border: 1px solid var(--ok);
  font-weight: 600;
}

.badge--reasoning {
  background: var(--paper-3);
  color: #5a3e8a;
  border: 1px solid #5a3e8a;
}

.badge--vision,
.badge--search {
  background: var(--paper-3);
  color: #5a5040;
  border: 1px solid var(--rule-strong);
}

.badge--legacy {
  background: transparent;
  color: #7a7060;
  border: 1px dashed var(--rule-strong);
  font-style: italic;
}

/* ── Status pill: "Tested 3 min ago" ─────────────────────────────────── */
.provider-card__status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.status-pill {
  font-size: 11px;
  color: #5a5040;
  font-style: italic;
}

/* ── Remediation: typed error block ─────────────────────────────────── */

.remediation {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 4px;
  border-left: 3px solid var(--rule-strong);
  background: var(--paper-3);
}

.remediation--fail {
  border-left-color: #b3261e;
  background: #f7e8e6;
}

.remediation--warn {
  border-left-color: #a8771a;
  background: #f6efd9;
}

.remediation--notice {
  border-left-color: #2c6e3f;
  background: #e8f0e8;
}

.remediation__title {
  margin: 0 0 4px 0;
  font-weight: 600;
  font-size: 13px;
}

.remediation__hint {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
}

.remediation__raw {
  margin-top: 6px;
  font-size: 12px;
}

.remediation__raw summary {
  cursor: pointer;
  color: #5a5040;
}

.remediation__raw .mono {
  display: block;
  margin-top: 4px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 11px;
  background: rgba(0, 0, 0, 0.05);
  padding: 6px 8px;
  border-radius: 2px;
}

.remediation__link {
  margin: 6px 0 0 0;
  font-size: 12px;
}

/* ── Visually hidden helper for SR-only text ───────────────────────── */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Reduced motion: snap drags rather than animate ─────────────── */
@media (prefers-reduced-motion: reduce) {
  .panel-slot,
  .panel-slot--drag-over,
  .panel-slot--lifted {
    transition: none;
  }
}

/* ── Forced-colors (Windows High Contrast) ────────────────────────── */
@media (forced-colors: active) {
  .panel-slot--lifted {
    outline: 3px solid CanvasText;
  }
  .panel-slot--drag-over {
    border-color: Highlight;
  }
  .badge--flagship,
  .badge--reasoning,
  .badge--vision,
  .badge--search,
  .badge--legacy {
    border-color: CanvasText;
    color: CanvasText;
    background: Canvas;
    forced-color-adjust: none;
  }
}

/* ── Self-healing pipeline UI (PR: feature/self-healing-pipeline) ── */

/* Recovery re-run banner — appears at the top of the LiveRun screen
 * when state.priorReport is set, telling the user this run is targeting
 * only previously-unmeasured dims and will merge into the existing
 * report on completion. Visually distinct from the local-endpoint
 * banner so the two don't blend together when both apply.
 */
.rerun-banner {
  margin: 0 0 12px;
  padding: 10px 14px;
  background: var(--surface-info, #eef4fb);
  border: 1px solid var(--rule-info, #b8cde0);
  border-radius: 6px;
  font-size: 0.92rem;
  color: var(--ink-1, #1f1d18);
}

/* Live-run "Currently working" pane — surfaces the in-flight call's
 * wall-clock elapsed time so a slow Analyst / Scorer / Chair call never
 * leaves the user staring at a frozen UI for >5s.
 */
.run-inflight-pane {
  margin: 12px 0 0;
  padding: 10px 14px;
  background: var(--surface-2, #f6f4f0);
  border: 1px solid var(--rule-1, #e7e3da);
  border-radius: 6px;
  font-size: 0.9rem;
}
.run-inflight-pane__line {
  margin: 0;
}
.run-inflight-pane__step {
  margin: 4px 0 0;
  font-size: 0.85rem;
}

/* Recovery surface — replaces the grade card on runs that hit the
 * unmeasured-area floor. Lists which areas couldn't be measured, the
 * recovery events that were tried, and offers a one-click re-run of
 * just the missing set.
 */
.report-recovery-surface {
  margin: 16px 0 24px;
  padding: 18px 20px;
  background: var(--surface-warn, #fff8e7);
  border: 1px solid var(--rule-warn, #d8c890);
  border-radius: 8px;
}
.report-recovery-surface__head {
  font-size: 1.05rem;
  margin-bottom: 8px;
}
.report-recovery-surface__intro {
  margin: 0 0 12px;
  color: var(--ink-2, #4a463c);
}
/* Honest one-line "why this run is incomplete" callout keyed off
   report.incompleteLimiter (time / budget / route_fault / content). */
.report-recovery-surface__limiter {
  margin: 0 0 12px;
  padding: 8px 12px;
  border-left: 3px solid var(--accent-1, #b8860b);
  background: var(--surface-2, #f6f3ec);
  color: var(--ink-1, #2c2a24);
  font-size: 0.92rem;
}
.report-recovery-surface__reasons {
  margin: 0 0 12px;
}
.report-recovery-surface__reasons summary {
  cursor: pointer;
  font-weight: 500;
}
.report-recovery-surface__reasons ul {
  margin: 6px 0 0 18px;
  padding: 0;
}
.report-recovery-surface__dims {
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}
.report-recovery-surface__dim {
  padding: 6px 0;
  border-top: 1px dashed var(--rule-1, #e7e3da);
}
.report-recovery-surface__dim:first-child {
  border-top: none;
}
.report-recovery-surface__events {
  margin: 4px 0 0;
}
.report-recovery-surface__events summary {
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--ink-3, #6b6557);
}
.report-recovery-surface__events ol {
  margin: 6px 0 0 22px;
  padding: 0;
  font-size: 0.85rem;
}
.report-recovery-surface__actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  flex-wrap: wrap;
}

/* "Resume with more budget" inline dialog. Sits below the actions
 * row, expanded only when the user clicks the Resume button. Uses
 * the same warm-warning surface tone as its container so it reads
 * as part of the recovery affordance rather than a separate card.
 */
.report-recovery-surface__resume {
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--surface-1, #fffefb);
  border: 1px solid var(--rule-1, #e7e3da);
  border-radius: 6px;
}
.report-recovery-surface__resume-summary {
  cursor: pointer;
  font-weight: 600;
  margin: 0 0 6px;
}
.report-recovery-surface__resume-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 8px 0 4px;
  flex-wrap: wrap;
}
.report-recovery-surface__resume-row label {
  font-weight: 500;
  font-size: 0.9rem;
}
.report-recovery-surface__resume-row input[type="number"] {
  width: 110px;
  padding: 4px 8px;
  font: inherit;
  border: 1px solid var(--rule-1, #d8d4ca);
  border-radius: 4px;
  background: var(--surface-0, #fff);
}
.report-recovery-surface__resume-preview {
  margin: 4px 0 8px;
}
.report-recovery-surface__resume-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

/* Visual treatment for the grade card on a recovery-state report. The
 * grade reads "—" rather than a number, but we also de-emphasize it so
 * the recovery surface above is clearly the primary affordance.
 */
.grade-card--incomplete {
  opacity: 0.55;
  filter: grayscale(0.4);
}

/* Print rules: the recovery surface stays visible in the printed PDF
 * (it's the primary content of an incomplete run), and forces all its
 * <details> blocks open so the printout shows the full diagnosis. The
 * recovery action buttons (Resume run, per-area Resume, etc.) are hidden
 * in print since they're not actionable on paper.
 */
@media print {
  .report-recovery-surface {
    background: white;
    border: 2px solid #999;
  }
  .report-recovery-surface details > * {
    display: block !important;
  }
  .report-recovery-surface__actions {
    display: none;
  }
  .run-inflight-pane {
    display: none;
  }
}

/* ─── 33. Trustworthiness reframe — trust summary, response validity,
 *        user-impact risk, model-origin lens, and finding tag chips
 *        (schema 1.0.0) ─────────────────────────────────────────────── */

/* Shared band palette for the trust layers. Reuses the existing token
 * set so the new panels read as part of the same design system. The
 * accent/border uses the semantic token; band TEXT uses an AA-contrast
 * variant where the token itself falls below 4.5:1 on the chip surface:
 *   strong / high / low-risk → --ok (green)
 *   moderate / mild          → --warn border; #8a5a10 text (AA on --paper)
 *   weak / elevated / flag   → --crit (red)
 *   na / not assessed        → --ink-3 text (AA; --ink-4 was too light)
 */

/* ── Trustworthiness summary (top of the report) ── */
.trust-summary {
  max-width: var(--reading-col);
  margin: 0 0 36px;
  padding: 22px 24px;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--red);
  border-radius: var(--radius-lg);
}
.trust-summary__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.trust-summary__title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.trust-summary__confidence {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: 12px;
  white-space: nowrap;
}
.trust-summary__confidence--strong {
  background: #d4eddc;
  color: #1a5c2a;
}
.trust-summary__confidence--moderate {
  background: #fef3c7;
  color: #92400e;
}
.trust-summary__confidence--weak {
  background: #fde8e6;
  color: var(--crit);
}
.trust-summary__confidence--na {
  background: var(--paper-3);
  /* WCAG 1.4.3: --ink-4 (#857a6e) on --paper-3 is 3.16:1 — fails normal text.
     --ink-3 (#5a5048) on --paper-3 is 5.92:1 — passes AA. */
  color: var(--ink-3);
}
.trust-summary__verdict {
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  margin: 0 0 12px;
}
.trust-summary__generaluse {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-2);
  margin: 0 0 16px;
}
.trust-summary__block {
  margin-top: 16px;
}
.trust-summary__subhead {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  margin: 0 0 8px;
}
.trust-summary__list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.trust-summary__list li {
  position: relative;
  padding: 6px 0 6px 18px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-2);
  border-bottom: 1px solid var(--rule);
}
.trust-summary__list li:last-child {
  border-bottom: none;
}
.trust-summary__list li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--red);
}
.trust-summary__list--caution li::before {
  content: "!";
  font-weight: 700;
  /* --warn is ~3.7:1 on --paper-2 — below the 4.5:1 AA floor for this small
     marker glyph. Use the darkened amber (#8a5a10, 5.26:1 on --paper) already
     used for the moderate/mild band words elsewhere in the trust layer. */
  color: #8a5a10;
}

/* ── Trust-signal chips (six banded re-expressions of area sub-scores) ── */
.trust-signals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin: 4px 0 4px;
}
.trust-signal {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--rule);
  background: var(--paper);
}
.trust-signal__label {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-3);
}
.trust-signal__band {
  font-size: 13px;
  font-weight: 700;
  text-transform: capitalize;
}
.trust-signal--strong {
  border-left: 3px solid var(--ok);
}
.trust-signal--strong .trust-signal__band {
  color: var(--ok);
}
.trust-signal--moderate {
  border-left: 3px solid var(--warn);
}
.trust-signal--moderate .trust-signal__band {
  /* WCAG 1.4.3: --warn (#a06a14) on --paper is 4.09:1 — below the 4.5:1
     normal-text floor. Darken the band word to #8a5a10 (5.26:1 on --paper).
     The accent border above keeps --warn since borders are non-text. */
  color: #8a5a10;
}
.trust-signal--weak {
  border-left: 3px solid var(--crit);
}
.trust-signal--weak .trust-signal__band {
  color: var(--crit);
}
.trust-signal--na {
  border-left: 3px solid var(--rule-strong);
}
.trust-signal--na .trust-signal__band {
  /* WCAG 1.4.3: --ink-4 on --paper is 3.73:1 — fails normal text.
     --ink-3 on --paper is 6.98:1 — passes AA. */
  color: var(--ink-3);
}

/* ── Response validity panel ("can I trust this report?") ── */
.response-validity {
  max-width: var(--reading-col);
  margin: 0 0 36px;
  padding: 20px 22px;
  background: var(--paper-2);
  border: 1px dashed var(--rule-strong);
  border-radius: var(--radius-lg);
}
.response-validity__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.response-validity__title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.response-validity__subtitle {
  font-size: 12px;
  font-weight: 500;
  font-style: italic;
  color: var(--ink-3);
}
.response-validity__verdict {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 12px;
  border-radius: 12px;
  white-space: nowrap;
}
.response-validity__verdict--high {
  background: #d4eddc;
  color: #1a5c2a;
}
.response-validity__verdict--moderate {
  background: #fef3c7;
  color: #92400e;
}
.response-validity__verdict--low {
  background: #fde8e6;
  color: var(--crit);
}
.response-validity__verdict--na {
  background: var(--paper-3);
  /* WCAG 1.4.3: --ink-4 on --paper-3 is 3.16:1; --ink-3 is 5.92:1 (AA). */
  color: var(--ink-3);
}
/* Round-12 (P2): a withheld-grade run leaves responseValidity.verdict as a
 * positive band ("high"/"moderate") by design (a pure independence collapse
 * bypasses responseValidity so the merge can still read the verdict). The pill
 * is neutralized for DISPLAY to a "WITHHELD" badge in this neutral color so it
 * does not read as a green positive trust signal beside a withheld grade. Same
 * neutral palette as --na (WCAG: --ink-3 on --paper-3 is 5.92:1, AA). */
.response-validity__verdict--withheld {
  background: var(--paper-3);
  color: var(--ink-3);
}
.response-validity__headline {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-2);
  margin: 0 0 14px;
}
.response-validity__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
  margin: 0;
}
.rv-signal {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--radius);
  background: var(--paper);
  border: 1px solid var(--rule);
  font-size: 12px;
}
.rv-signal dt {
  color: var(--ink-3);
  font-weight: 500;
}
.rv-signal dd {
  margin: 0;
  font-weight: 700;
  text-transform: capitalize;
  font-family: var(--font-mono);
  font-size: 11px;
}
.rv-signal--none dd,
.rv-signal--ok dd {
  color: var(--ok);
}
.rv-signal--mild dd {
  /* WCAG 1.4.3: --warn (#a06a14) on --paper is 4.09:1 — below 4.5:1.
     Darken to #8a5a10 (5.26:1 on --paper). */
  color: #8a5a10;
}
.rv-signal--elevated dd,
.rv-signal--flag dd {
  color: var(--crit);
}
.rv-signal--flag {
  border-color: var(--red-soft);
  background: #fef6f5;
}
.rv-signal--meta dd {
  color: var(--ink-2);
}
.rv-signal--na dd {
  /* WCAG 1.4.3: --ink-4 on --paper is 3.73:1; --ink-3 is 6.98:1 (AA). */
  color: var(--ink-3);
}
.response-validity__notes {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
}
.response-validity__notes li {
  position: relative;
  padding: 5px 0 5px 18px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-3);
}
.response-validity__notes li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--ink-4);
}

/* ── User-impact risk ── */
.impact-risk {
  max-width: var(--reading-col);
  margin: 0 0 36px;
}
.impact-risk__head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.impact-risk__title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}
.impact-risk__level {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 12px;
  border-radius: 12px;
}
.impact-risk__level--low {
  background: #d4eddc;
  color: #1a5c2a;
}
.impact-risk__level--moderate {
  background: #fef3c7;
  color: #92400e;
}
.impact-risk__level--high {
  background: #fde8e6;
  color: var(--crit);
}
.impact-risk__level--na {
  background: var(--paper-3);
  /* WCAG 1.4.3: --ink-4 on --paper-3 is 3.16:1; --ink-3 is 5.92:1 (AA). */
  color: var(--ink-3);
}
.impact-risk__summary {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-2);
  margin: 0 0 14px;
}
.impact-risk__block {
  margin-bottom: 14px;
}
.impact-risk__subhead {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  margin: 0 0 8px;
}
.impact-risk__list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.impact-risk__list li {
  position: relative;
  padding: 6px 0 6px 18px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-2);
  border-bottom: 1px solid var(--rule);
}
.impact-risk__list li:last-child {
  border-bottom: none;
}
.impact-risk__list li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--ink-3);
}
.impact-risk__byarea {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 6px;
  margin-top: 4px;
}
.impact-risk__byarea-cell {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--radius);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-left-width: 3px;
  font-size: 12px;
}
.impact-risk__byarea-label {
  color: var(--ink-3);
}
.impact-risk__byarea-level {
  font-weight: 700;
  text-transform: capitalize;
}
.impact-risk__byarea-cell--low {
  border-left-color: var(--ok);
}
.impact-risk__byarea-cell--low .impact-risk__byarea-level {
  color: var(--ok);
}
.impact-risk__byarea-cell--moderate {
  border-left-color: var(--warn);
}
.impact-risk__byarea-cell--moderate .impact-risk__byarea-level {
  /* WCAG 1.4.3: --warn (#a06a14) on --paper is 4.09:1 — below 4.5:1.
     Darken to #8a5a10 (5.26:1 on --paper). The accent border stays --warn. */
  color: #8a5a10;
}
.impact-risk__byarea-cell--high {
  border-left-color: var(--crit);
}
.impact-risk__byarea-cell--high .impact-risk__byarea-level {
  color: var(--crit);
}
.impact-risk__byarea-cell--na {
  border-left-color: var(--rule-strong);
}
.impact-risk__byarea-cell--na .impact-risk__byarea-level {
  /* WCAG 1.4.3: --ink-4 on --paper is 3.73:1; --ink-3 is 6.98:1 (AA). */
  color: var(--ink-3);
}

/* ── Model-origin lens ── */
.origin-lens {
  max-width: var(--reading-col);
  margin: 0 0 36px;
  padding: 18px 20px;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
}
.origin-lens__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.origin-lens__title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}
.origin-lens__selfref {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: 12px;
  white-space: nowrap;
}
.origin-lens__selfref--yes {
  background: #fef3c7;
  color: #92400e;
}
.origin-lens__selfref--no {
  background: var(--paper-3);
  color: var(--ink-3);
}
.origin-lens__provider {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-2);
  margin: 0 0 8px;
}
.origin-lens__notes {
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-3);
  margin: 0;
}

/* ── Finding tag chips (evidence / distortion / technique) ── */
.finding-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.tag-chip {
  display: inline-block;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 600;
  font-family: var(--font-mono);
  border-radius: 10px;
  border: 1px solid transparent;
}
/* Evidence tags = the probe category that produced the finding. Tinted
 * red to read as the primary, area-owned evidence. */
.tag-chip--evidence {
  background: #fbe9e7;
  color: var(--red-deep);
  border-color: var(--red-soft);
}
/* Distortion tags = cross-cutting CBT lens; amber. WCAG 1.4.1
 * (docs/ui-ux-design.md §131): distortion chips must be distinguishable from
 * evidence chips by more than hue. A dashed border gives a shape cue that
 * survives grayscale, Windows High Contrast, and color-vision deficiency —
 * evidence/technique chips keep the default solid border. */
.tag-chip--distortion {
  background: #fdf3d6;
  color: #92400e;
  border-color: #e6d28f;
  border-style: dashed;
}
/* Technique tags = probe-construction provenance; muted/neutral. */
.tag-chip--technique {
  background: var(--paper-3);
  color: var(--ink-3);
  border-color: var(--rule-strong);
}

/* ── Recovery surface: area label on each unmeasured row ── */
.report-recovery-surface__dim-label {
  font-weight: 600;
}

/* ── Radar label spacing for six axes ── */
/* With only six spokes the labels carry the full area text at a larger
 * size than the retired 17-axis chart. Keep them from breaking words
 * mid-token and let the multi-line tspans breathe. */
.radar-svg text {
  font-family: var(--font-sans);
}

/* ─── 34. Trust-layer print rules ────────────────────────────────────── */
@media print {
  .trust-summary,
  .response-validity,
  .impact-risk,
  .origin-lens {
    break-inside: avoid;
    page-break-inside: avoid;
    background: #fff;
    border-color: #999;
  }
  .trust-summary {
    border-left: 4px solid #000;
  }
  /* Flatten the band tints to grayscale-friendly neutrals so the panels
   * stay legible on a monochrome printout. */
  .trust-summary__confidence,
  .response-validity__verdict,
  .impact-risk__level,
  .origin-lens__selfref,
  .tag-chip,
  .trust-signal,
  .rv-signal,
  .impact-risk__byarea-cell {
    background: #eee !important;
    color: #000 !important;
    border-color: #999 !important;
  }
  .trust-signal__band,
  .rv-signal dd,
  .impact-risk__byarea-level {
    color: #000 !important;
  }
}

/* ─── 38. Conductor transcript styling ───────────────────────────────────── */
/* Conductor lines sit beside system/error in the transcript role hierarchy.
 * A muted background + kicker-style agent label makes them visually distinct
 * from panel-agent lines without shouting — they are advisory, not errors. */
.transcript__entry--conductor {
  background: var(--paper-3);
  border-bottom-color: var(--rule-strong);
}
.transcript__agent--conductor {
  color: var(--ink-3);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
/* Subtle left accent stripe so conductor lines are scannable at a glance */
.transcript__entry--conductor .transcript__agent--conductor::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 1em;
  background: var(--ink-4);
  border-radius: 2px;
  margin-right: 5px;
  vertical-align: -0.1em;
}

/* ─── 39. Pause/Escalate modal ───────────────────────────────────────────── */
/* Inherits .modal layout; adds pause-specific slots. Aria parity with Stop
 * modal: role=dialog, aria-modal, aria-labelledby, aria-describedby, focus
 * trap, Escape → skip, overlay backdrop. */
.modal--pause {
  max-width: 520px;
}
.modal__kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 6px;
}
.pause-modal__stats {
  display: flex;
  gap: 24px;
  margin-bottom: 14px;
}
.pause-modal__stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pause-modal__stat-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-4);
}
.pause-modal__stat-value {
  font-size: 18px;
  font-weight: 600;
  font-family: var(--font-mono);
}
.pause-modal__conductor-rec {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 12px;
}
.pause-modal__conductor-reason {
  margin: 4px 0 0;
}
.pause-modal__auto-note {
  margin: 0;
  color: var(--ink-3);
}
/* Context line explaining the engine already auto-extended this area's
   deadline, so "Keep waiting" means waiting on a slow-but-responding model. */
.pause-modal__context {
  margin: 0 0 10px;
  color: var(--ink-2, #4a463c);
  font-size: 0.9rem;
}
/* R5: Conductor-authored plain-English situation string in package mode.
   Rendered instead of the generic __context paragraph when present. */
.pause-modal__situation {
  margin: 0 0 12px;
  color: var(--ink-1, #1e1b14);
  font-size: 0.95rem;
  line-height: 1.5;
}
/* Three-button layout for the pause actions (legacy path) */
.modal--pause .modal__actions {
  flex-wrap: wrap;
}
/* R3 decision-package option list — stacked full-width buttons */
.pause-modal__option-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 0 0;
}
.pause-modal__option-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  width: 100%;
  /* Keep the 44px touch-target floor from .btn even though this is a tall,
     text-wrapping, left-aligned button (WCAG 2.5.5 / design-system §4). */
  min-height: 44px;
  height: auto;
  text-align: left;
  padding: 10px 14px;
  /* Wrap a long label/rationale instead of forcing horizontal scroll; break
     pathological unbroken tokens so nothing overflows at 320px (WCAG 1.4.10). */
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.pause-modal__option-label {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
  font-weight: 600;
}
/* Recommended badge — INVERSE (ink-on-paper) treatment.
 * The recommended option button is .btn--primary (background: var(--ink)).
 * The old badge was --red bg + --paper text: the badge background (--red
 * #b3261e) sat on the button background (--ink #1a1714) at only 2.73:1, so the
 * chip barely separated from the button (WCAG 1.4.11 non-text), and if the
 * recommended button were ever rendered red the badge would vanish entirely.
 * An ink-on-paper chip is legible AND clearly separated on any colored button:
 *   - ink text on paper chip      → 15.86:1 (WCAG 1.4.3, AAA)
 *   - paper chip vs --ink button  → 15.86:1 separation (WCAG 1.4.11)
 *   - paper chip vs --red button  →  5.81:1 separation (robustness, ≥ 3:1)
 * Recommendation is also conveyed non-visually via the option's accessible
 * name ("Recommended option…"), so the badge is reinforcement, not the sole
 * channel (WCAG 1.4.1). */
.pause-modal__rec-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--paper);
  color: var(--ink);
  border-radius: 3px;
  padding: 1px 5px;
  line-height: 1.4;
  flex-shrink: 0;
}
.pause-modal__option-eta {
  font-weight: 400;
  font-size: 0.88em;
  color: inherit;
  opacity: 0.85;
}
/* Plain-English consequence cue under each option label. Default (ghost
 * button) palette: --ink-3 on the --paper modal = 6.98:1 (AA). */
.pause-modal__option-consequence {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-3);
  line-height: 1.45;
}
.pause-modal__option-rationale {
  font-size: 12px;
  font-weight: 400;
  color: var(--ink-3);
  line-height: 1.45;
}
/* Contrast fix on the recommended (btn--primary, background: var(--ink))
 * button: --ink-3 secondary text on --ink is only 2.27:1 — a hard WCAG 1.4.3
 * failure that made the rationale + consequence effectively invisible on the
 * one button users are steered toward. Lift both to --paper-3 on --ink =
 * 13.45:1 (AAA). The label inherits --paper from .btn--primary (15.86:1) and
 * the ETA inherits that label color, so they were already fine. */
.pause-modal__option-btn--rec .pause-modal__option-consequence,
.pause-modal__option-btn--rec .pause-modal__option-rationale {
  color: var(--paper-3);
}
/* Long Conductor rationales can run ~200 chars. Clamp the VISIBLE rationale to
 * 3 lines so one option can't dominate the viewport (and push the auto-resolve
 * countdown off-screen) on a 320px-wide phone. The full rationale is preserved
 * verbatim in the option's accessible name, so nothing is lost for AT users —
 * this is a visual bound only. The fixed consequence cue is short and is not
 * clamped. */
.pause-modal__option-rationale {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}

/* Mobile (≤ 360px): the modal's 40px side padding leaves too little room for
 * the stacked option buttons on a 320px viewport. Tighten the chrome so the
 * option labels + rationales wrap cleanly with no horizontal scroll. */
@media (max-width: 360px) {
  .modal--pause {
    padding: 24px 18px 20px;
  }
  .pause-modal__stats {
    gap: 16px;
    flex-wrap: wrap;
  }
  .pause-modal__option-btn {
    padding: 10px 12px;
  }
}

/* ─── 40. Report recovery surface: narrative + per-area resume ───────────── */
.report-recovery-surface__dim-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 2px;
}
.report-recovery-surface__dim-narrative {
  margin: 0 0 4px;
  font-style: italic;
}
/* Small xs-sized ghost button for per-area Resume affordance */
.btn--xs {
  padding: 2px 8px;
  font-size: 12px;
  line-height: 1.6;
  border-radius: var(--radius);
}
.report-recovery-surface__dim-resume {
  flex-shrink: 0;
}
/* Plain-English event list — no mono, no machine ids */
.report-recovery-surface__events-list {
  margin: 6px 0 0 18px;
  padding: 0;
  font-size: 0.85rem;
  list-style: decimal;
}
.report-recovery-surface__event-item {
  margin-bottom: 4px;
}
.report-recovery-surface__event-label {
  font-weight: 500;
}
.report-recovery-surface__event-explain {
  font-style: italic;
}
.report-recovery-surface__event-coverage {
  margin: 6px 0 0;
}

/* ─── 41. Configure — adaptive proposal ─────────────────────────────────── */
/* Shown in the Configure screen when window.aimbTimeEstimator signals the
 * target looks slow. Subtle card below the budget summary. */
.adaptive-proposal {
  margin: 10px 0;
  padding: 12px 14px;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--warn);
  border-radius: var(--radius);
}
.adaptive-proposal__head {
  margin-bottom: 4px;
}
.adaptive-proposal__label {
  font-weight: 600;
  font-size: 14px;
  color: var(--warn);
}
.adaptive-proposal__rationale {
  margin: 0 0 8px;
}
.adaptive-proposal__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.adaptive-proposal__dismiss {
  font-style: italic;
}
/* Small button variant used in the proposal */
.btn--sm {
  padding: 5px 14px;
  font-size: 13px;
}

/* reasoning-notice — informational pre-run heads-up shown when the selected
 * TARGET is a reasoning model and the configured settings make a slow run
 * likely. Same warn palette as .adaptive-proposal (section 41) so the tone
 * reads informational; carries no actions — it only sets time expectations. */
.reasoning-notice {
  margin: 10px 0;
  padding: 12px 14px;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--warn);
  border-radius: var(--radius);
}
.reasoning-notice__head {
  margin-bottom: 4px;
  font-weight: 600;
  font-size: 14px;
  color: var(--warn);
}
.reasoning-notice__body {
  margin: 0;
}

/* ─── 42. Conductor agent tile ───────────────────────────────────────────── */
/* The Conductor tile sits in the agent grid only when active (failure path).
 * A distinct border/background differentiates it from panel agents. */
.agent-tile--conductor {
  border-color: var(--ink-4);
  background: var(--paper-3);
  opacity: 0.9;
}
.agent-tile--conductor .agent-tile__name {
  color: var(--ink-3);
  font-size: 13px;
  letter-spacing: 0.03em;
}

/* ─── 43. Conductor transcript in report print ───────────────────────────── */
@media print {
  .transcript__entry--conductor {
    background: #f0ede8;
    border-bottom: 1px solid #bbb;
  }
  .transcript__agent--conductor {
    color: #555;
  }
}

/* ─── 44. Provisional scoring UI ─────────────────────────────────────────── */
/* Provisional areas are MEASURED areas scored on partial evidence (W5,
 * adaptiveTuning active). They have real scores that count toward the
 * composite — the badge communicates lower confidence, not failure.
 *
 * Color choice: --warn (#a06a14) on --paper-2 passes 5.0:1 against
 * --paper-2 (#efe9dd) — AA for normal text and comfortable at 10–11px bold
 * uppercase. The badge always carries its text label so color is never the
 * sole differentiator (WCAG 1.4.1). */

/* Run-level callout at the top of the Overview tab. Rendered only when one
 * or more provisional areas exist; uses the same warn palette as the
 * adaptive-proposal block (section 41) so the tone reads informational. */
.provisional-run-notice {
  margin: 0 0 20px;
  padding: 12px 16px;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--warn);
  border-radius: var(--radius, 6px);
}
.provisional-run-notice__head {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--warn);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 4px;
}
.provisional-run-notice__body {
  margin: 0;
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.5;
}

/* Score-row modifier for a provisional area — wraps to two lines so the
 * badge + coverage subtext sit below the bar without breaking the row grid. */
.radar-score-row--provisional {
  flex-wrap: wrap;
  align-items: flex-start;
  row-gap: 2px;
}
.radar-score-row--provisional .radar-score-row__label {
  /* Label cell stays on its own visual line even when the row wraps. */
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

/* Provisional badge pill. Sits inline beside the area label in the score
 * list and as a compact indicator inside the "Show data" table cell.
 * Text carries the confidence qualifier — never color alone. */
.provisional-badge {
  display: inline-block;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: 10px;
  background: var(--paper-3);
  color: var(--warn);
  border: 1px solid var(--rule-strong);
  /* Prevent the badge breaking inside the label flex cell. */
  white-space: nowrap;
  vertical-align: middle;
}
/* Compact single-letter badge variant used inside the data table cell where
 * space is constrained. Accessibility: the sibling .sr-only carries "(provisional)". */
.provisional-badge--inline {
  padding: 1px 4px;
  font-size: 9px;
  margin-left: 4px;
}

/* Meta row below the score bar: coverage subtext + optional Firm up button.
 * Spans the full row width (flex-basis 100%) so it wraps below the bar. */
.provisional-badge__meta {
  flex-basis: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 2px;
}
/* Coverage subtext — e.g. "scored on 5 of 12 probes". Uses .helper sizing
 * (12px / --ink-3) but kept at --ink-3 for readability (ink-4 fails AA at
 * that size — see docs/ui-ux-design.md §2 required fixes). */
.provisional-badge__coverage {
  color: var(--ink-3);
}
/* "Firm up" affordance — very small ghost button, same xs sizing as the
 * per-area recovery-surface Resume. Framed as optional improvement, not
 * repair. Shares .btn--xs from section 40. */
.provisional-badge__firmup {
  /* Inherits .btn--ghost .btn--xs; margin-top keeps it off the coverage text. */
  flex-shrink: 0;
}

/* ─── Print rules for provisional UI ───────────────────────────────────── */
@media print {
  /* Run notice stays visible — same treatment as the recovery surface banner. */
  .provisional-run-notice {
    background: #fff;
    border: 1px solid #bbb;
    border-left: 3px solid #666;
  }
  .provisional-run-notice__head {
    color: #000;
  }
  /* Badge prints as black-on-light-gray; the text label is the source of
   * truth so color inversion doesn't lose information. */
  .provisional-badge {
    background: #eee !important;
    color: #000 !important;
    border-color: #999 !important;
  }
  /* Hide the Firm up button — not actionable on paper. */
  .provisional-badge__firmup {
    display: none !important;
  }
}

/* ─── S5: Run health panel (self-healing R3 live recovery visibility) ─────
 * Compact, always-visible, READ-ONLY panel that surfaces the engine's
 * self-healing activity: ETA, per-area probe counts, at-risk markers, and
 * a plain-English log of recent recovery actions. Rendered alongside the
 * in-flight pane; purely observational — no user controls.
 *
 * Color is never the sole signal: at-risk areas carry the text tag "At risk";
 * elevated malformed rate carries the text tag "elevated". Contrast is AA
 * against the existing design tokens (ink-3 on paper-2 ≈ 5.2:1; warn text
 * #8a5a10 on warn-surface ≈ 4.7:1).
 *
 * Reduced-motion: the panel has no animation, so nothing to suppress.
 * Responsive at 320 px: the summary stats flex-wrap; the area list stacks
 * naturally; the recovery log is a plain column.
 */

.run-health-panel {
  margin: 12px 0 0;
  padding: 12px 14px;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 6px;
  font-size: 0.9rem;
}

/* Collapsed: slimmer bar — trim the vertical padding to a thin strip. */
.run-health-panel--collapsed {
  padding-top: 8px;
  padding-bottom: 8px;
}

/* ── Toggle bar: always-visible header (chevron + name + ETA) ─────────────── */
.run-health-panel__bar {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 0;
  background: none;
  border: none;
  font: inherit;
  text-align: left;
  color: inherit;
  cursor: pointer;
}
.run-health-panel__bar:focus-visible {
  outline-offset: 2px;
  border-radius: 4px;
}

/* Chevron: points right when collapsed, rotates down when expanded. */
.run-health-panel__chevron {
  flex-shrink: 0;
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 6px solid var(--ink-3);
  transition: transform var(--transition);
}
.run-health-panel__bar[aria-expanded="true"] .run-health-panel__chevron {
  transform: rotate(90deg);
}

/* ETA in the bar — right-aligned, mirrors the stat-value treatment. */
.run-health-panel__bar-eta {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
}

/* Collapsed-only elevated-malformed indicator — same amber as the stat warn.
   margin-left:auto right-aligns it when there is no ETA to anchor against;
   when an ETA is present the indicator sits directly after it instead. */
.run-health-panel__bar-warn {
  margin-left: auto;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #8a5a10;
  background: #f6efd9;
  border-radius: 4px;
  padding: 2px 7px;
}
.run-health-panel__bar-eta + .run-health-panel__bar-warn {
  margin-left: 0;
}

/* Body wrapper — separates the expanded content from the bar. */
.run-health-panel__body {
  margin-top: 10px;
}

/* ── Summary row: kicker + stat chips ────────────────────────────────────── */
.run-health-panel__summary {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 10px;
}

.run-health-panel__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  align-items: baseline;
}

.run-health-panel__stat {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  font-size: 12px;
}

.run-health-panel__stat-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.run-health-panel__stat-value {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
}

/* Elevated malformed rate: warm-amber background, contrasting text. */
.run-health-panel__stat--warn {
  background: #f6efd9;
  border-radius: 4px;
  padding: 2px 7px;
}
.run-health-panel__stat--warn .run-health-panel__stat-value {
  color: #8a5a10;
}
.run-health-panel__stat--warn .run-health-panel__stat-label {
  color: #7a4e0e;
}
.run-health-panel__warn-tag {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #8a5a10;
}
/* Positive resolution tag — e.g. "budget raised" after the engine auto-corrected
   a truncating Target. Green to read as "handled", not a warning. */
.run-health-panel__ok-tag {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ok);
}

/* ── Per-area section ─────────────────────────────────────────────────────── */
.run-health-panel__areas {
  margin-top: 8px;
}
.run-health-panel__areas-label {
  margin-bottom: 5px;
}

.run-health-panel__area-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.run-health-panel__area {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 10px;
  padding: 4px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 12px;
}
.run-health-panel__area:last-child {
  border-bottom: none;
}

.run-health-panel__area-label {
  flex: 1;
  min-width: 0;
  font-weight: 500;
  color: var(--ink-2);
}

.run-health-panel__area-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  flex-shrink: 0;
}

/* Scored: green-tinted label + text tag. */
.run-health-panel__area--scored .run-health-panel__area-label {
  color: var(--ok);
}

/* At-risk: amber-tinted label. */
.run-health-panel__area--at-risk .run-health-panel__area-label {
  color: var(--warn);
}

/* State tag chips (text + background, not color-only). */
.run-health-panel__area-tag {
  flex-shrink: 0;
  display: inline-block;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 3px;
}
.run-health-panel__area-tag--scored {
  background: #d4eddc;
  color: var(--ok);
}
.run-health-panel__area-tag--risk {
  background: #f5e7c8;
  color: var(--warn);
}

/* ── Recent recovery log ──────────────────────────────────────────────────── */
.run-health-panel__recovery {
  margin-top: 10px;
  border-top: 1px solid var(--rule);
  padding-top: 8px;
}
.run-health-panel__recovery-label {
  margin-bottom: 5px;
}

.run-health-panel__recovery-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.run-health-panel__recovery-item {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 8px;
  font-size: 12px;
  padding: 2px 0;
}

.run-health-panel__recovery-action {
  color: var(--ink-2);
  font-weight: 500;
}

.run-health-panel__recovery-area {
  color: var(--ink-4);
  font-family: var(--font-mono);
  font-size: 11px;
}

/* ── Responsive: 320 px breakpoint ──────────────────────────────────────── */
@media (max-width: 480px) {
  .run-health-panel__summary {
    flex-direction: column;
    gap: 6px;
  }
  .run-health-panel__stats {
    flex-direction: column;
    gap: 4px;
  }
}

/* ── Print: hide the health panel (not useful on paper) ─────────────────── */
@media print {
  .run-health-panel {
    display: none;
  }
}
