/* AdviceIT by Radit, styles.css
   Calm, light, professional. Light blue accent. System fonts only. */

:root {
  --bg: #f6f9fc;
  --surface: #ffffff;
  --surface-2: #eef4fa;
  --text: #1c2733;
  --text-muted: #4f5f70;
  --line: #d6e0ea;
  --accent: #2f7fd0;
  --accent-dark: #1f5f9f;
  --accent-soft: #dcebf9;
  --focus: #ff9f1c;
  --positive: #1f7a4d;
  --positive-soft: #dff3e8;
  --negative: #b3261e;
  --negative-soft: #fbe3e1;
  --warning-soft: #fff4d6;
  --warning-text: #7a5300;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(28, 39, 51, 0.06), 0 4px 16px rgba(28, 39, 51, 0.06);
  --font: "Avenir Next", Avenir, "Segoe UI Variable Text", "Trebuchet MS", "Gill Sans", "Helvetica Neue", Arial, sans-serif;
  --font-display: Roboto, "Roboto Flex", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { font-size: 16px; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
}

/* Accessibility helpers */
.skip-link {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--accent-dark);
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  z-index: 100;
}
.skip-link:focus { left: 8px; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

[hidden] { display: none !important; }

code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--surface-2);
  padding: 1px 5px;
  border-radius: 4px;
}

/* Top bar */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: 0;
}
.brand-subtitle { margin: 0; color: var(--text-muted); font-size: 0.9rem; }
.topnav { display: flex; gap: 6px; flex-wrap: wrap; }
.linklike {
  font: inherit;
  font-size: 0.95rem;
  color: var(--accent-dark);
  background: none;
  border: 1px solid transparent;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
}
.linklike:hover { background: var(--surface-2); text-decoration: underline; }

/* Layout */
.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 24px 48px;
}
.columns {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 24px;
  margin-bottom: 24px;
}
@media (max-width: 860px) {
  .columns { grid-template-columns: 1fr; }
  .page { padding: 16px 14px 40px; }
  .topbar-inner { padding: 10px 14px; }
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px;
  margin-bottom: 24px;
}
.columns .panel { margin-bottom: 0; }
.panel-title { margin: 0; font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; }
.panel-intro { color: var(--text-muted); margin: 6px 0 16px; }
.panel-head-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.step-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.step-number {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.notice {
  background: var(--warning-soft);
  color: var(--warning-text);
  border: 1px solid #f0d9a0;
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 20px;
}
.notice p { margin: 0; }

/* Researcher controls */
.researcher-controls { background: var(--surface-2); }
.controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin-top: 12px;
}
.control { margin: 0; padding: 0; border: 0; min-width: 0; }
.control legend, .control-label {
  font-weight: 600;
  font-size: 0.9rem;
  margin: 0 0 6px;
  padding: 0;
}
.control-value { margin: 0; font-size: 0.95rem; }
.control-hint { margin: 6px 0 0; font-size: 0.82rem; color: var(--text-muted); }

/* Forms */
.field { margin: 0 0 18px; padding: 0; border: 0; min-width: 0; }
.field label, .field legend {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 6px;
  padding: 0;
}
.hint { margin: 6px 0 0; font-size: 0.85rem; color: var(--text-muted); }

input[type="number"] {
  font: inherit;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  width: 120px;
  background: #fff;
  color: var(--text);
}
input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  margin: 6px 0;
}
output { font-variant-numeric: tabular-nums; color: var(--accent-dark); }
.scale-ends {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Segmented control built from radios */
.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.segmented label {
  position: relative;
  margin: 0;
  font-weight: 500;
}
.segmented input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}
.segmented span {
  display: inline-block;
  padding: 8px 14px;
  border-right: 1px solid var(--line);
  color: var(--text);
  cursor: pointer;
  font-size: 0.92rem;
  white-space: nowrap;
}
.segmented label:last-child span { border-right: 0; }
.segmented input:checked + span {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}
.segmented input:focus-visible + span {
  outline: 3px solid var(--focus);
  outline-offset: -3px;
}
.segmented span:hover { background: var(--accent-soft); }
.segmented input:checked + span:hover { background: var(--accent-dark); }

/* Buttons */
.button-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn {
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  cursor: pointer;
}
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-danger { color: var(--negative); }
.btn-danger:hover { background: var(--negative-soft); }
.btn-close { padding: 6px 12px; }
.examples { margin-bottom: 18px; }
.examples .btn { font-weight: 500; }

/* Recommendation card */
.card {
  background: linear-gradient(180deg, #ffffff, var(--surface-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 8px 0 18px;
}
.card-eyebrow {
  margin: 0;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
}
.portfolio-name { margin: 2px 0 12px; font-family: var(--font-display); font-size: 1.9rem; letter-spacing: 0; }
.portfolio-summary { margin: 10px 0 0; color: var(--text-muted); }

.allocation {
  display: flex;
  height: 34px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.allocation-seg {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}
.seg-equities { background: #2f7fd0; }
.seg-bonds { background: #5f8fb8; color: #fff; }
.seg-cash { background: #b9cfe4; color: #1c2733; }
.seg-realAssets { background: #3f6f8f; }
.allocation-legend {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 0.88rem;
}
.allocation-legend li { display: flex; align-items: center; gap: 6px; }
.swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; border: 1px solid rgba(0,0,0,0.1); }

.flawed-marker {
  margin: 12px 0 0;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--warning-soft);
  color: var(--warning-text);
  font-size: 0.88rem;
}

/* Explanations */
.explanation { margin-bottom: 20px; }
.explanation-box {
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 14px 18px;
  background: #fff;
}
.explanation-box h3 { margin: 0 0 8px; font-family: var(--font-display); font-size: 1.1rem; }
.explanation-box p { margin: 6px 0; }
.explanation-note { font-size: 0.85rem; color: var(--text-muted); margin-top: 10px; }
.explanation-none {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-style: italic;
  margin: 0;
}

.contrib-list { list-style: none; padding: 0; margin: 10px 0 0; }
.contrib-item {
  display: grid;
  grid-template-columns: minmax(120px, 1.2fr) minmax(120px, 2fr) 70px;
  gap: 10px;
  align-items: center;
  padding: 6px 0;
  border-top: 1px solid var(--line);
  font-size: 0.92rem;
}
.contrib-item:first-child { border-top: 0; }
.contrib-label { font-weight: 600; }
.contrib-label small { display: block; font-weight: 400; color: var(--text-muted); }
.contrib-bar-wrap {
  position: relative;
  height: 14px;
  background: var(--surface-2);
  border-radius: 7px;
  overflow: hidden;
}
.contrib-bar-wrap::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--line);
}
.contrib-bar {
  position: absolute;
  top: 2px;
  bottom: 2px;
  border-radius: 5px;
}
.contrib-bar.pos { background: var(--positive); left: 50%; }
.contrib-bar.neg { background: var(--negative); right: 50%; }
.contrib-value {
  font-variant-numeric: tabular-nums;
  text-align: right;
  font-weight: 700;
}
.contrib-value.pos { color: var(--positive); }
.contrib-value.neg { color: var(--negative); }
.contrib-value.zero { color: var(--text-muted); }
.contrib-total {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 2px solid var(--line);
  font-size: 0.92rem;
}
@media (max-width: 480px) {
  .contrib-item { grid-template-columns: 1fr 60px; }
  .contrib-bar-wrap { display: none; }
}

.cf-list { margin: 8px 0 0; padding-left: 20px; }
.cf-list li { margin: 4px 0; }

.confidence-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 8px 0;
}
.confidence-pill {
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
}
.confidence-pill.high { background: var(--positive-soft); color: var(--positive); }
.confidence-pill.moderate { background: var(--warning-soft); color: var(--warning-text); }
.confidence-pill.low { background: var(--negative-soft); color: var(--negative); }
.confidence-meter {
  flex: 1 1 160px;
  height: 12px;
  background: var(--surface-2);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.confidence-meter-fill { height: 100%; background: var(--accent); }
.confidence-detail { font-size: 0.85rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* Response */
.response {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
.status { font-size: 0.9rem; color: var(--positive); font-weight: 600; }
.status.error { color: var(--negative); }
.placeholder {
  color: var(--text-muted);
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  text-align: center;
}

/* Session table */
.table-wrap { overflow-x: auto; }
.log-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  min-width: 720px;
}
.log-table th, .log-table td {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  vertical-align: top;
}
.log-table th { background: var(--surface-2); font-weight: 600; }
.log-table td.num { font-variant-numeric: tabular-nums; text-align: right; }
.log-table tr.flawed td { background: #fffaf0; }
.tag-flawed {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--warning-soft);
  color: var(--warning-text);
}

/* Dialogs */
.dialog {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0;
  max-width: 720px;
  width: calc(100% - 32px);
  max-height: calc(100vh - 48px);
  box-shadow: 0 12px 40px rgba(28, 39, 51, 0.2);
  color: var(--text);
}
.dialog::backdrop { background: rgba(28, 39, 51, 0.45); }
.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: #fff;
}
.dialog-head h2 { margin: 0; font-family: var(--font-display); font-size: 1.3rem; }
.dialog-body { padding: 8px 22px 22px; }
.prose h3 { font-size: 0.98rem; margin: 18px 0 4px; }
.prose p { margin: 6px 0; }
.prose ul { margin: 6px 0; padding-left: 20px; }

/* Print: keep it readable */
@media print {
  .topbar, .researcher-controls, .btn { display: none !important; }
}

/* Advisor tag on the recommendation card */
.advisor-tag {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.75rem;
}

/* Probability list (neural network confidence) */
.prob-list { list-style: none; padding: 0; margin: 10px 0 0; }
.prob-item {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(100px, 2fr) 48px;
  gap: 10px;
  align-items: center;
  font-size: 0.88rem;
  padding: 3px 0;
}
.prob-item.top .prob-label, .prob-item.top .prob-value { font-weight: 700; }
.prob-bar {
  display: block;
  height: 10px;
  background: var(--surface-2);
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.prob-fill { display: block; height: 100%; background: var(--accent); }
.prob-item.top .prob-fill { background: var(--accent-dark); }
.prob-value { text-align: right; font-variant-numeric: tabular-nums; }

/* Conversational (LLM) condition */
.llm-controls select {
  font: inherit;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  max-width: 100%;
}
.llm-status { margin: 8px 0 4px; font-size: 0.88rem; color: var(--text-muted); }
.llm-progress {
  height: 6px;
  background: var(--surface-2);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 10px;
}
.llm-progress-fill { height: 100%; width: 0; background: var(--accent); transition: width 0.2s; }
.llm-transcript {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
  padding: 2px 0;
}
.llm-transcript:empty { display: none; }
.llm-bubble {
  padding: 10px 14px;
  border-radius: 12px;
  max-width: 92%;
  white-space: pre-wrap;
  line-height: 1.5;
}
.llm-bubble.assistant { background: var(--surface-2); align-self: flex-start; }
.llm-bubble.user { background: var(--accent); color: #fff; align-self: flex-end; }
.llm-bubble:empty::after { content: "Thinking"; color: var(--text-muted); font-style: italic; }
.llm-chat-row { display: flex; gap: 8px; margin-top: 10px; }
.llm-chat-row input {
  flex: 1;
  font: inherit;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 0;
}

/* Narrative input and ILS-Bench case box */
textarea#narrative {
  width: 100%;
  font: inherit;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  resize: vertical;
  min-height: 84px;
}
.narrative-block .button-row { margin-top: 8px; }
.ils-box {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 0.88rem;
}
.ils-box strong { color: var(--accent-dark); }
.ils-box .ils-labels { margin: 4px 0 0; padding-left: 18px; }
.chip-row { margin: 8px 0 0; font-size: 0.85rem; }
.chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--warning-soft);
  color: var(--warning-text);
  font-weight: 600;
}
.human-review-note {
  margin: 4px 0 8px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--warning-soft);
  color: var(--warning-text);
  font-size: 0.92rem;
}
.labels-line { margin: 8px 0 0; font-size: 0.82rem; color: var(--text-muted); }

/* Training data panel */
.data-panel { border-left: 4px solid var(--accent); }
.data-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.btn-small { font-size: 0.85rem; padding: 6px 12px; text-decoration: none; display: inline-block; }
.data-summary { margin: 8px 0 6px; font-size: 0.95rem; }
.data-details summary { cursor: pointer; color: var(--accent-dark); font-weight: 600; font-size: 0.92rem; }
.data-details ul { margin: 8px 0 0; padding-left: 20px; font-size: 0.92rem; }
.data-details li { margin: 4px 0; }

/* Page navigation */
.nav-page[aria-current="page"] { background: var(--accent-soft); font-weight: 700; }
.compare-line { margin: 4px 0 0; font-size: 0.82rem; color: var(--text-muted); }

/* Training data page */
.data-columns { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 860px) { .data-columns { grid-template-columns: 1fr; } }
.sub-heading { font-size: 1rem; margin: 16px 0 6px; font-family: var(--font-display); }
.plain-list { margin: 6px 0; padding-left: 20px; font-size: 0.93rem; }
.plain-list li { margin: 4px 0; }
.data-table { min-width: 0; }
.data-table td, .data-table th { white-space: normal; }
.data-table th[scope="row"] { background: var(--surface-2); font-weight: 600; width: 38%; }
.narrative-cell { min-width: 320px; font-size: 0.85rem; line-height: 1.45; }
.confusion td.diag { background: var(--positive-soft); font-weight: 700; }
.confusion th { font-size: 0.78rem; }
.stat-headline { margin: 0 0 8px; font-size: 0.95rem; }
.stat-block { margin-bottom: 8px; }
.stat-list { list-style: none; margin: 4px 0 0; padding: 0; }
.stat-item {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) minmax(80px, 2fr) 90px;
  gap: 10px;
  align-items: center;
  font-size: 0.88rem;
  padding: 2px 0;
}
.stat-bar { display: block; height: 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; overflow: hidden; }
.stat-fill { display: block; height: 100%; background: var(--accent); }
.stat-value { text-align: right; font-variant-numeric: tabular-nums; }
.inline-label { font-size: 0.88rem; font-weight: 600; }
#case-search, #case-outcome {
  font: inherit;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}
#case-search { min-width: 220px; }
pre.cmd {
  background: #1c2733;
  color: #e8eef5;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  overflow-x: auto;
  margin: 6px 0;
}
pre.cmd code { background: none; color: inherit; padding: 0; }

/* Hybrid options, literacy check, adjust panel, secondary measures */
.hybrid-options { margin-top: 8px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; font-size: 0.88rem; }
.check-inline { font-weight: 500; }
.check-inline input { margin-right: 4px; }
.literacy-block { border-top: 1px solid var(--line); padding-top: 12px; }
.literacy-q { margin: 10px 0; }
.literacy-text { margin: 0 0 6px; font-size: 0.92rem; }
.adjust-panel { margin-top: 10px; padding: 10px 12px; background: var(--surface-2); border-radius: 8px; }
.adjust-panel .control-label { margin-bottom: 6px; }
.secondary-measures { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; }
.secondary-measures summary { cursor: pointer; font-weight: 600; font-size: 0.92rem; color: var(--accent-dark); }
.secondary-measures .field { margin-top: 12px; }
.secondary-measures textarea { width: 100%; font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; resize: vertical; }

/* Interactive what-if panel */
.whatif-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.whatif-grid > * { min-width: 0; }
.whatif-controls .field { margin-bottom: 10px; }
.whatif-controls label, .whatif-controls legend { font-size: 0.88rem; }
.ignore-toggle { font-size: 0.8rem; color: var(--text-muted); font-weight: 400; margin-left: 8px; }
.whatif-preview { background: var(--surface-2); border-radius: 8px; padding: 12px 14px; }
.whatif-outcome { font-family: var(--font-display); font-size: 1.25rem; margin: 2px 0 6px; }
.whatif-preview .prob-list, .whatif-preview .contrib-list { margin-top: 6px; }
.whatif-preview .contrib-item { grid-template-columns: minmax(100px, 1fr) 60px; }
.whatif-preview .contrib-bar-wrap { display: none; }
.whynot { margin-top: 12px; }
.whynot select { font: inherit; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; max-width: 100%; }
.whynot-answer { margin: 8px 0 0; font-size: 0.92rem; }

/* Band visual (rule-based confidence) */
.band-visual { margin: 8px 0; }
.band-track { display: flex; height: 26px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); position: relative; }
.band-seg { flex: 1; display: flex; align-items: center; justify-content: center; font-size: 0.72rem; font-weight: 600; color: var(--text); background: var(--surface-2); border-right: 1px solid var(--line); }
.band-seg:last-child { border-right: 0; }
.band-seg.active { background: var(--accent-soft); color: var(--accent-dark); }
.band-marker { position: absolute; top: -4px; bottom: -4px; width: 3px; background: var(--accent-dark); border-radius: 2px; }
.band-caption { font-size: 0.8rem; color: var(--text-muted); margin: 4px 0 0; }

/* Counterfactual chips */
.cf-chip { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-dark); font-size: 0.78rem; font-weight: 600; white-space: normal; }

/* Hybrid and adaptive */
.hybrid-stack > .explanation-box { margin-bottom: 12px; }
.adaptive-plain p { font-size: 1.02rem; line-height: 1.6; }

/* Study flow */
.study-stage { max-width: 760px; margin-left: auto; margin-right: auto; }
.study-stage h2 { font-family: var(--font-display); margin: 0 0 8px; font-size: 1.3rem; }
.study-stage p { margin: 8px 0; }
.study-stage .consent-check { margin: 14px 0; font-weight: 600; }
.study-stage .consent-check input { margin-right: 6px; }
.study-progress { font-size: 0.85rem; color: var(--text-muted); margin: 0 0 8px; }
.case-card { background: var(--warning-soft); border: 1px solid #f0d9a0; border-radius: var(--radius); padding: 12px 16px; margin: 6px 0 12px; }
.case-card .card-eyebrow { color: var(--warning-text); }
.case-text { margin: 4px 0 0; font-size: 1rem; }
.attention-line { background: var(--accent-soft); color: var(--accent-dark); padding: 8px 12px; border-radius: 8px; font-size: 0.92rem; }
.debrief-list { padding-left: 20px; }

/* Analytics page */
.an-sources { margin: 6px 0; }
.an-load { margin-top: 10px; }
.an-load input[type="file"] { font: inherit; font-size: 0.85rem; }
.an-load select { font: inherit; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.data-table caption { text-align: left; padding: 4px 0; }

/* References page */
.ref-list { margin: 6px 0; padding-left: 20px; }
.ref-list li { margin: 8px 0; font-size: 0.93rem; }
.ref-use { display: block; color: var(--text-muted); font-size: 0.86rem; margin-top: 2px; }

/* Explanation preset and customise control */
#preset-select, #example-select { font: inherit; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text); max-width: 100%; }
.customise { margin-top: 8px; }
.customise summary { cursor: pointer; font-size: 0.88rem; color: var(--accent-dark); font-weight: 600; }
.customise-row { display: flex; gap: 10px 14px; flex-wrap: wrap; align-items: center; margin: 8px 0 0; font-size: 0.88rem; }
.customise-row .control-label { margin: 0; min-width: 64px; }

/* Scorecard weight table */
.scorecard td.pos { color: var(--positive); }
.scorecard td.neg { color: var(--negative); }
.scorecard th[scope="row"] { white-space: nowrap; }
.scorecard th[scope="col"] { font-size: 0.8rem; }

/* Overflow safety inside explanation panels */
.explanation-box { min-width: 0; overflow-wrap: break-word; }
.whatif-controls input[type="number"] { max-width: 100%; }

/* Study flow trials: one wide centered column, no step numbers */
body.flow-study #columns { grid-template-columns: minmax(0, 1fr); max-width: 880px; margin-left: auto; margin-right: auto; }
body.flow-study .step-number { display: none; }
