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

:root {
  --text: #1a1a1a;
  --subtle: #666;
  --border: #e0e0e0;
  --bg: #f7f7f5;
  --white: #ffffff;
  --green-bg: #e8f5e9;
  --green-text: #2e7d32;
  --red-bg: #fdecea;
  --red-text: #c62828;
  --amber-bg: #fff8e1;
}

body {
  font-family: Georgia, "Times New Roman", serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 16px;
  line-height: 1.6;
}

/* ── Screens ── */
.screen { display: none; }
.screen.active { display: block; }

/* ── Container ── */
.container {
  max-width: 740px;
  margin: 0 auto;
  padding: 48px 24px;
}

.container.center {
  text-align: center;
  padding-top: 120px;
}

/* ── Typography ── */
h1 {
  font-size: 2rem;
  font-weight: normal;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

h2 {
  font-size: 1.5rem;
  font-weight: normal;
  letter-spacing: -0.01em;
  margin-bottom: 24px;
}

.subtitle {
  color: var(--subtle);
  font-style: italic;
  margin-bottom: 36px;
}

/* ── Domain selection ── */
.domain-hero-title {
  text-align: center;
  margin-bottom: 4px;
}

#screen-domain .subtitle {
  text-align: center;
  margin-bottom: 40px;
  line-height: 1.7;
}

.domain-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.domain-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 26px 24px 22px;
  text-align: left;
  cursor: pointer;
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 128px;
}

.domain-card:hover {
  border-color: #8a8a8a;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.04);
}

.domain-numeral {
  font-family: Georgia, serif;
  font-size: 0.72rem;
  font-style: italic;
  color: var(--subtle);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.domain-name {
  font-size: 1.18rem;
  font-weight: normal;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.domain-tagline {
  font-size: 0.82rem;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--subtle);
  font-style: italic;
  margin-top: 2px;
}

/* Veritrace level cards (report list) */
.domain-card-title {
  font-size: 1.18rem;
  font-weight: normal;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.domain-card-sub {
  font-size: 0.82rem;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--subtle);
  font-style: italic;
  margin-top: auto;
}

@media (max-width: 620px) {
  .domain-grid { grid-template-columns: 1fr; }
}

.domain-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--subtle);
  margin-bottom: 28px;
  text-transform: uppercase;
}

.domain-indicator b {
  font-weight: 600;
  color: #333;
  text-transform: none;
  letter-spacing: normal;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.92rem;
}

.text-link {
  background: transparent;
  color: var(--subtle);
  padding: 0;
  border: none;
  font-size: 0.78rem;
  text-decoration: underline;
  text-underline-offset: 2px;
  letter-spacing: 0.04em;
}

.text-link:hover {
  color: var(--text);
  background: transparent;
}

/* ── Setup form ── */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--subtle);
  margin-bottom: 6px;
}

.form-group input {
  width: 100%;
  padding: 10px 14px;
  font-size: 1rem;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--white);
  color: var(--text);
  transition: border-color 0.15s;
}

.form-group input:focus {
  outline: none;
  border-color: #999;
}

button {
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.95rem;
  padding: 9px 22px;
  background: var(--text);
  color: var(--white);
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.15s;
}

button:hover { background: #333; }
button:disabled { background: #aaa; cursor: not-allowed; }

#preset-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

button.preset {
  background: var(--white);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 6px 14px;
  font-size: 0.88rem;
  border-radius: 20px;
}

button.preset:hover {
  background: #f0f0f0;
  border-color: #bbb;
}

button.preset.selected {
  background: var(--text);
  color: var(--white);
  border-color: var(--text);
}

.error-msg {
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.88rem;
  color: var(--red-text);
  margin-top: 10px;
  min-height: 20px;
}

/* ── Loading ── */
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #ddd;
  border-top-color: #555;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  margin: 0 auto 18px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-text {
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 6px;
}

.loading-sub {
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.85rem;
  color: var(--subtle);
}

/* ── Game header ── */
#game-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
}

#game-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.92rem;
  color: #444;
}

#timer-display {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  min-width: 38px;
}

.divider { color: #ccc; }

#game-actions {
  display: flex;
  gap: 8px;
}

#btn-giveup, #btn-decompose {
  background: var(--white);
  color: #888;
  border: 1px solid var(--border);
  padding: 6px 14px;
  font-size: 0.85rem;
}

#btn-giveup:hover, #btn-decompose:hover:not(:disabled) {
  background: #f4f4f4;
  color: var(--text);
}

#btn-decompose {
  color: #555;
}

#btn-decompose:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* ── Decompose / AssistV panel ── */
#decompose-panel,
#assistv-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(440px, 92vw);
  height: 100vh;
  background: var(--white);
  border-left: 1px solid var(--border);
  box-shadow: -4px 0 16px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  z-index: 30;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  transition: right 0.18s ease;
}

#decompose-panel.hidden,
#assistv-panel.hidden { display: none; }

/* When both panels are open, narrow them and slide assistv to the LEFT of
   decompose so they sit side-by-side instead of stacking. Each gets ~360px
   so even ~1280px screens still have room for the report. */
body.both-panels #decompose-panel,
body.both-panels #assistv-panel {
  width: min(360px, 46vw);
}
body.both-panels #assistv-panel {
  right: min(360px, 46vw);
}

#assistv-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

.assistv-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  color: var(--muted, #555);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.assistv-stats u { text-decoration: underline; color: #1565c0; font-weight: 600; }

.assistv-issues, .assistv-battles {
  margin-bottom: 16px;
}

.battle-item {
  padding: 8px 10px;
  margin-bottom: 6px;
  background: #fafafa;
  border-left: 3px solid #b0bec5;
  border-radius: 3px;
  font-size: 12px;
}
.battle-head { font-weight: 600; margin-bottom: 4px; }
.battle-reasoning { color: var(--muted, #555); line-height: 1.4; }

/* Inline hint shown atop the Critique panel pointing user to Decompose panel */
.assistv-hint {
  padding: 8px 10px;
  margin-bottom: 12px;
  background: #e8f5e9;
  border-left: 3px solid #43a047;
  font-size: 12px;
  color: #1b5e20;
  border-radius: 3px;
}

/* Vanilla/Refined toggle at top of decompose panel */
.decompose-view-toggle {
  display: flex;
  gap: 4px;
  margin: 0 0 12px;
  padding: 4px;
  background: #f5f5f3;
  border-radius: 6px;
}
.decompose-view-toggle button {
  flex: 1;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 500;
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  color: var(--muted, #555);
  font-family: inherit;
}
.decompose-view-toggle button.active {
  background: var(--white, #fff);
  color: #1565c0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.decompose-view-toggle button:hover:not(.active) { background: rgba(0, 0, 0, 0.04); }

/* Inline issue badge on each claim (after critique runs) */
.claim-issue-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 1px 7px;
  font-size: 10.5px;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  margin-left: auto;
  user-select: none;
}
.claim-issue-badge.sev-major { background: #ffebee; color: #b71c1c; border: 1px solid #ef5350; }
.claim-issue-badge.sev-minor { background: #fff8e1; color: #b26a00; border: 1px solid #ffb300; }
.claim-issue-badge:hover { filter: brightness(0.95); }

/* Don't override the priority left-border (has higher specificity).
   Use a subtle background tint to mark items with critique issues. */
.claim-item.has-issue { background: #fffdf2; }
.claim-item.has-major { background: #fff5f3; }

.claim-issues {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border, #e0e0e0);
}

/* When the decomposition panel is open, push the report content left so the
   panel doesn't overlap text. The panel is fixed-position 440px wide. */
body.panel-open #screen-game .container,
body.panel-open #instruction-bar,
body.panel-open #feedback-bar {
  padding-right: 460px;
  transition: padding-right 0.18s ease;
}

/* When BOTH panels are open (~360px each = 720px total), push content
   further left to clear them. */
body.both-panels #screen-game .container,
body.both-panels #instruction-bar,
body.both-panels #feedback-bar {
  padding-right: 740px;
}

body.panel-open #screen-game .container {
  max-width: none;
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 900px) {
  body.panel-open #screen-game .container,
  body.panel-open #instruction-bar,
  body.panel-open #feedback-bar {
    padding-right: 24px;
  }
}

/* On very narrow screens, fall back to overlap — user can close one to see other. */
@media (max-width: 900px) {
  body.both-panels #assistv-panel { right: 0; }
}

.decompose-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  background: #fafaf8;
}

.decompose-title {
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
}

.decompose-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.decompose-close {
  background: transparent;
  color: #888;
  padding: 2px 10px;
  font-size: 1.3rem;
  line-height: 1;
}

.decompose-close:hover {
  background: #eee;
  color: var(--text);
}

#decompose-body {
  overflow-y: auto;
  padding: 14px 18px 24px;
  flex: 1;
  font-size: 0.88rem;
}

.decompose-placeholder {
  color: var(--subtle);
  text-align: center;
  padding: 40px 10px;
  font-style: italic;
}

.decompose-placeholder .spinner {
  margin: 0 auto 14px;
}

.decompose-error {
  color: var(--red-text);
  background: var(--red-bg);
  padding: 10px 12px;
  border-radius: 5px;
  font-size: 0.85rem;
}

.decompose-banner {
  padding: 8px 12px;
  border-radius: 5px;
  font-size: 0.82rem;
  margin-bottom: 14px;
  background: #f0f0ed;
  color: #555;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.decompose-banner.ok {
  background: var(--green-bg);
  color: var(--green-text);
}

.decompose-banner.warn {
  background: var(--red-bg);
  color: var(--red-text);
}

.decompose-banner.pending {
  background: var(--amber-bg);
  color: #6d4c00;
}

.inline-btn {
  background: var(--white);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 3px 10px;
  font-size: 0.76rem;
  border-radius: 4px;
}

.inline-btn:hover {
  background: #f4f4f4;
}

.inline-spinner {
  width: 12px;
  height: 12px;
  border-width: 2px;
  display: inline-block;
  margin: 0 6px -2px 0;
}

.decompose-subheading {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--subtle);
  margin: 20px 0 10px;
}

.claim-list { display: flex; flex-direction: column; gap: 8px; }

.claim-item {
  background: #fafaf8;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 9px 11px;
  cursor: pointer;
  transition: background 0.1s, border-color 0.1s;
}

.claim-item:hover {
  background: #f0f0ed;
}

.claim-item.claim-active {
  background: #fff8e1;
  border-color: #fdd835;
}

.claim-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  font-size: 0.72rem;
}

.claim-id {
  font-weight: 700;
  color: #555;
  font-variant-numeric: tabular-nums;
}

.claim-type {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 0.66rem;
  color: #555;
  background: #eee;
}

.type-factual      { background: #e3f2fd; color: #1565c0; }
.type-quantitative { background: #f3e5f5; color: #6a1b9a; }
.type-citation     { background: #fff3e0; color: #e65100; }
.type-inference    { background: #fce4ec; color: #ad1457; }
.type-definition   { background: #e8f5e9; color: #2e7d32; }
.type-methodological { background: #e0f7fa; color: #00695c; }
.type-opinion      { background: #ffebee; color: #c62828; }

.claim-tag {
  font-size: 0.66rem;
  color: #888;
  font-style: italic;
}

.claim-priority {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 0.62rem;
}

.claim-priority.prio-high   { background: #ffebee; color: #c62828; }
.claim-priority.prio-medium { background: #fff8e1; color: #ef6c00; }
.claim-priority.prio-low    { background: #f5f5f5; color: #757575; }

.claim-item[data-priority="high"]   { border-left: 3px solid #ef5350; }
.claim-item[data-priority="medium"] { border-left: 3px solid #ffb300; }
.claim-item[data-priority="low"]    { border-left: 3px solid #cfd8dc; }

.claim-why {
  margin-top: 5px;
  padding: 5px 8px;
  background: #fafaf6;
  border-radius: 4px;
  font-size: 0.78rem;
  color: #4a4a4a;
  line-height: 1.45;
  font-style: italic;
}

.claim-text {
  color: var(--text);
  line-height: 1.45;
  font-size: 0.88rem;
}

.claim-meta {
  margin-top: 5px;
  font-size: 0.72rem;
  color: var(--subtle);
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.issue-item {
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 8px 11px;
  margin-bottom: 8px;
  background: var(--white);
}

.issue-item.issue-major { border-left: 3px solid #ef5350; }
.issue-item.issue-minor { border-left: 3px solid #ffb300; }

.issue-head {
  display: flex;
  gap: 6px;
  margin-bottom: 4px;
  font-size: 0.72rem;
}

.issue-type {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
  color: #555;
}

.issue-sev {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  color: #888;
}

.issue-item.issue-major .issue-sev { color: var(--red-text); }

.issue-ref {
  color: #888;
  font-family: monospace;
}

.issue-reasoning {
  color: var(--text);
  font-size: 0.82rem;
  line-height: 1.4;
}

/* ── Instruction bar ── */
#instruction-bar {
  background: var(--amber-bg);
  border-bottom: 1px solid #ffe082;
  padding: 9px 24px;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.88rem;
  color: #5d4037;
  text-align: center;
}

/* ── Feedback bar ── */
#feedback-bar {
  padding: 10px 24px;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.9rem;
  text-align: center;
  transition: opacity 0.2s;
  border-bottom: 1px solid transparent;
}

#feedback-bar.correct {
  background: var(--green-bg);
  color: var(--green-text);
  border-color: #a5d6a7;
}

#feedback-bar.incorrect {
  background: var(--red-bg);
  color: var(--red-text);
  border-color: #ef9a9a;
}

#feedback-bar.hidden { display: none; }

/* ── Report ── */
#report-container {
  font-size: 1.05rem;
  line-height: 1.85;
}

.seg-break {
  display: block;
  height: 0.9em;
}

.seg-header {
  display: block;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin-top: 1.6em;
  margin-bottom: 0.2em;
  color: var(--text);
}

.seg-sentence {
  cursor: pointer;
  border-radius: 3px;
  padding: 1px 2px;
  transition: background 0.12s;
}

.seg-sentence:hover {
  background: #ededeb;
}

.seg-sentence.found {
  background: var(--green-bg);
  cursor: default;
  border-radius: 3px;
}

.seg-sentence.wrong-flash {
  background: var(--red-bg);
}

.seg-sentence.missed-reveal {
  background: #fce4ec;
  text-decoration: underline;
  text-decoration-color: #e57373;
  text-underline-offset: 3px;
}

.seg-sentence.claim-linked {
  background: #fff59d;
  box-shadow: 0 0 0 2px #fdd835;
  border-radius: 3px;
}

/* ── Self-report suspicion marks ── */
.seg-sentence[data-suspicion] {
  text-decoration: underline wavy;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
  cursor: help;
}

.seg-sentence[data-suspicion="high"] {
  text-decoration-color: #e53935;
  background: rgba(229, 57, 53, 0.04);
}

.seg-sentence[data-suspicion="medium"] {
  text-decoration-color: #fb8c00;
  background: rgba(251, 140, 0, 0.04);
}

.seg-sentence[data-suspicion="low"] {
  text-decoration-color: #78909c;
  text-decoration-style: dashed;
  text-decoration-thickness: 1.5px;
}

.seg-sentence[data-suspicion]:hover {
  background: rgba(255, 193, 7, 0.12);
}

#btn-self-report {
  background: var(--white);
  color: #555;
  border: 1px solid var(--border);
  padding: 6px 14px;
  font-size: 0.85rem;
}

#btn-self-report:hover:not(:disabled) {
  background: #f4f4f4;
  color: var(--text);
}

#btn-self-report:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* ── Results ── */
#score-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 36px;
}

.score-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 12px;
  text-align: center;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.score-value {
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.score-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--subtle);
}

#errors-reveal h3 {
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--subtle);
  margin-bottom: 12px;
}

.error-item {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 16px;
  margin-bottom: 10px;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.9rem;
}

.error-item.was-found {
  border-left: 3px solid #66bb6a;
}

.error-item.was-missed {
  border-left: 3px solid #ef5350;
}

.error-item .error-status {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
  color: var(--subtle);
}

.error-item.was-found .error-status { color: var(--green-text); }
.error-item.was-missed .error-status { color: var(--red-text); }

.error-item .error-claim {
  color: var(--red-text);
  margin-bottom: 4px;
}

.error-item .error-fix {
  color: var(--green-text);
}

.error-item .error-level {
  display: inline-block;
  font-size: 0.72rem;
  padding: 1px 7px;
  border-radius: 10px;
  background: #f0f0f0;
  color: #555;
  margin-top: 6px;
}

#screen-results .container button {
  margin-top: 8px;
}

.results-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.results-actions button.secondary {
  background: var(--white);
  color: var(--text);
  border: 1px solid var(--border);
}

.results-actions button.secondary:hover {
  background: #f4f4f4;
}

#btn-back-to-results {
  background: var(--text);
  color: var(--white);
  border: none;
  padding: 6px 14px;
  font-size: 0.85rem;
}

#btn-back-to-results:hover { background: #333; }

.hidden { display: none !important; }

/* ── Analysis screen ── */
#analysis-body { font-family: -apple-system, BlinkMacSystemFont, sans-serif; }

.analysis-h {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--subtle);
  margin: 28px 0 12px;
}

.analysis-h:first-child { margin-top: 0; }

.metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.metric-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
}

.metric-card.muted { opacity: 0.65; }

.metric-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--subtle);
  margin-bottom: 8px;
}

.metric-stats {
  display: flex;
  gap: 16px;
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
  margin-bottom: 4px;
}

.metric-stats b {
  color: var(--subtle);
  font-weight: 600;
  margin-right: 4px;
}

.metric-detail {
  font-size: 0.78rem;
  color: var(--subtle);
}

.analysis-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.analysis-table th, .analysis-table td {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}

.analysis-table thead th {
  background: #fafaf8;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--subtle);
  font-weight: 700;
}

.analysis-table tbody tr:last-child td { border-bottom: none; }

.analysis-table .muted-cell { color: var(--subtle); }
.analysis-table .lvl-high { color: #c62828; font-weight: 600; }
.analysis-table .lvl-medium { color: #ef6c00; font-weight: 600; }
.analysis-table .lvl-low { color: #546e7a; font-weight: 600; }
.analysis-table .type-cell { font-family: ui-monospace, SFMono-Regular, monospace; font-size: 0.8rem; }

.analysis-note {
  font-size: 0.78rem;
  color: var(--subtle);
  margin: 6px 2px 0;
  line-height: 1.5;
}

.audit-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 14px;
  margin-bottom: 10px;
  font-size: 0.88rem;
}

.audit-head {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.tag-type, .tag-caught, .tag-missed,
.tag-attacker, .tag-fabricated, .tag-modified {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tag-type { background: #eceff1; color: #37474f; font-family: ui-monospace, SFMono-Regular, monospace; }
.tag-caught { background: #e8f5e9; color: #2e7d32; }
.tag-missed { background: #fdecea; color: #c62828; }
.tag-attacker { background: #e3f2fd; color: #1565c0; font-family: ui-monospace, SFMono-Regular, monospace; }
.tag-fabricated { background: #fff3e0; color: #e65100; }
.tag-modified { background: #f5f5f5; color: #616161; }
.audit-card-fabricated { border-left: 3px solid #ff9800; }

.audit-fact { color: var(--red-text); margin-bottom: 3px; }
.audit-correction { color: var(--green-text); margin-bottom: 4px; }
.audit-why, .audit-sr-reason {
  color: var(--subtle);
  font-size: 0.8rem;
  margin-top: 4px;
  line-height: 1.5;
}
.audit-why b, .audit-sr-reason b { color: #555; }


.analysis-subh {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--subtle);
  margin: 16px 0 8px;
}

@media (max-width: 540px) {
  #score-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================================
   Veritrace — minimal refresh (Anthropic-leaning, white-first).
   Appended last so it layers over the original honeypot styles.
   Palette stays white-dominant; a single warm clay accent is used
   sparingly for selection + the primary call-to-action.
   ============================================================ */
:root {
  --bg: #faf9f6;
  --white: #ffffff;
  --text: #1a1a18;
  --subtle: #6b6862;
  --border: #e8e4dc;
  --accent: #1f3a5f;        /* deep navy (藏青) */
  --accent-press: #16293f;
  --accent-soft: #e4e9f1;
}

body {
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.container.narrow {
  max-width: 560px;
  padding-top: 84px;
  padding-bottom: 64px;
}

/* ── wordmark (landing) ── */
.wordmark { margin-bottom: 44px; }
.wordmark-name {
  display: block;
  font-size: 2.7rem;
  letter-spacing: -0.025em;
  line-height: 1;
  color: var(--text);
}
.wordmark-tag {
  display: block;
  margin-top: 13px;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.95rem;
  color: var(--subtle);
}

/* ── inputs ── */
.form-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ── option list (domains + reports) ── */
.option-list { display: flex; flex-direction: column; gap: 10px; }
.option-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  background: var(--white);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 17px 19px;
  cursor: pointer;
  text-align: left;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.06rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}
.option-row:hover {
  border-color: var(--accent);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.045);
  transform: translateY(-1px);
}
.radio-dot {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 1.5px solid #c9c3b8;
  flex: 0 0 auto;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.option-row:hover .radio-dot {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 4px var(--accent);
}
.option-label { flex: 1; }
.option-meta {
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.8rem;
  color: var(--subtle);
  flex: 0 0 auto;
}

/* ── breadcrumb ── */
.crumb {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.85rem;
  color: var(--subtle);
  margin-bottom: 30px;
}
.crumb b { color: var(--text); font-weight: 600; font-family: -apple-system, sans-serif; }
.muted-line {
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.9rem;
  color: var(--subtle);
}

/* ── survey ── */
.survey-q { margin-bottom: 30px; }
.survey-q-label {
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 14px;
}
.req { color: var(--accent); }
.scale-row { display: flex; gap: 8px; }
.scale-pill {
  flex: 1;
  background: var(--white);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 13px 0;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.13s ease;
}
.scale-pill:hover { border-color: var(--accent); }
.scale-pill.selected { background: var(--accent); color: #fff; border-color: var(--accent); }
.scale-ends {
  display: flex;
  justify-content: space-between;
  margin-top: 9px;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.78rem;
  color: var(--subtle);
}
.choice-row { display: flex; flex-wrap: wrap; gap: 8px; }
.choice-pill {
  background: var(--white);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 9px 17px;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.13s ease;
}
.choice-pill:hover { border-color: var(--accent); }
.choice-pill.selected { background: var(--accent); color: #fff; border-color: var(--accent); }
.survey-text {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 11px 13px;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.95rem;
  background: var(--white);
  color: var(--text);
  resize: vertical;
}
.survey-text:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ── buttons (clay CTA + ghost) ── */
.cta {
  background: var(--accent);
  border: none;
  color: #fff;
  border-radius: 9px;
  padding: 13px 32px;
  font-size: 1rem;
  margin-top: 6px;
}
.cta:hover { background: var(--accent-press); }
.cta:disabled { background: #d9b3a6; cursor: not-allowed; }
.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.ghost:hover { background: #f1efe9; border-color: #cfc9bd; }

@media (max-width: 540px) {
  .wordmark-name { font-size: 2.2rem; }
  .container.narrow { padding-top: 56px; }
}

/* ── domain accordion (landing) ── */
.acc-list { display: flex; flex-direction: column; gap: 8px; }
.acc {
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--white);
  overflow: hidden;
  transition: border-color 0.15s ease;
}
.acc:hover { border-color: #d7d2c7; }
.acc-head {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: transparent;
  color: var(--text);
  border: none;
  border-radius: 0;
  padding: 16px 18px;
  cursor: pointer;
  text-align: left;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.08rem;
}
.acc-head:hover { background: #faf8f3; }
.acc-arrow {
  flex: 0 0 auto;
  color: var(--subtle);
  font-size: 0.85rem;
  transition: transform 0.18s ease, color 0.15s ease;
}
.acc.open .acc-arrow { transform: rotate(90deg); color: var(--accent); }
.acc-title { flex: 1; }
.acc-count {
  flex: 0 0 auto;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.8rem;
  color: var(--subtle);
}
.acc-body { display: none; flex-direction: column; gap: 6px; padding: 2px 12px 12px; }
.acc.open .acc-body { display: flex; }

.report-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 13px 16px 13px 42px;
  cursor: pointer;
  text-align: left;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.report-row:hover { border-color: var(--accent); background: var(--white); }
.report-title { flex: 1; }
.report-variant {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.05rem 0.4rem;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  vertical-align: middle;
  border-radius: 999px;
  color: #6d28d9;
  background: rgba(124, 58, 237, 0.12);
}
.report-meta {
  flex: 0 0 auto;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.78rem;
  color: var(--subtle);
}

/* ================================================================
   v2 visual pass — lighter, editorial, white-first. Later in the
   file → overrides the heavier rules above at equal specificity.
   ================================================================ */

/* landing: hairline table-of-contents instead of filled cards */
.acc-list { display: flex; flex-direction: column; gap: 0; border: none; }
.acc {
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  overflow: visible;
}
.acc:first-child { border-top: 1px solid var(--border); }
.acc:hover { border-color: var(--border); }
.acc-head {
  display: flex; align-items: center; gap: 13px; width: 100%;
  background: transparent; color: var(--text);
  border: none; border-radius: 0;
  padding: 16px 6px;
  font-family: Georgia, "Times New Roman", serif; font-size: 1.14rem;
  text-align: left; cursor: pointer;
  transition: color 0.15s ease;
}
.acc-head:hover { background: transparent; color: var(--accent); }
.acc-arrow {
  flex: 0 0 auto; color: #b8b3a8; font-size: 0.72rem;
  transition: transform 0.18s ease, color 0.15s ease;
}
.acc.open .acc-arrow { transform: rotate(90deg); color: var(--accent); }
.acc-title { flex: 1; }
.acc-count {
  flex: 0 0 auto; font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.72rem; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--subtle);
}
.acc-body { display: none; flex-direction: column; gap: 1px; padding: 0 0 14px 28px; }
.acc.open .acc-body { display: flex; }
.report-row {
  display: flex; align-items: baseline; gap: 12px; width: 100%;
  background: transparent; color: var(--text);
  border: none; border-radius: 7px;
  padding: 10px 12px;
  font-family: Georgia, "Times New Roman", serif; font-size: 1.02rem;
  text-align: left; cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}
.report-row:hover { background: #f1efe8; color: var(--accent); border: none; }

/* ── annotation popover ── */
#annot-popover {
  position: fixed; z-index: 60;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 13px;
  box-shadow: 0 12px 34px rgba(20, 25, 40, 0.16);
  padding: 15px;
}
#annot-popover.hidden { display: none; }
.ap-quote {
  font-family: Georgia, "Times New Roman", serif; font-style: italic;
  font-size: 0.92rem; line-height: 1.45; color: #555;
  border-left: 3px solid var(--accent-soft);
  padding: 2px 0 2px 11px; margin-bottom: 13px;
  max-height: 78px; overflow: auto;
}
.ap-judgment { display: flex; gap: 8px; margin-bottom: 10px; }
.ap-choice {
  flex: 1; background: var(--white); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 9px 0; font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.88rem; cursor: pointer; transition: all 0.13s ease;
}
.ap-choice:hover { border-color: var(--accent); }
.ap-choice.selected { background: var(--accent); color: #fff; border-color: var(--accent); }
#ap-comment {
  width: 100%; border: 1px solid var(--border); border-radius: 8px;
  padding: 9px 11px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.92rem; background: var(--white); color: var(--text);
  resize: vertical; min-height: 54px;
}
#ap-comment:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ap-actions { display: flex; align-items: center; gap: 8px; margin-top: 11px; }
.ap-spacer { flex: 1; }
.ap-btn {
  background: transparent; color: var(--subtle);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 13px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.84rem; cursor: pointer; transition: all 0.13s ease;
}
.ap-btn:hover { border-color: #cfc9bd; color: var(--text); }
.ap-save {
  background: var(--accent); color: #fff; border: none; border-radius: 8px;
  padding: 9px 20px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.88rem; cursor: pointer;
}
.ap-save:hover { background: var(--accent-press); }

/* ── sentence marks: NEUTRAL during play (no right/wrong signal) ── */
.seg-sentence { border-radius: 3px; transition: background 0.12s ease, box-shadow 0.12s ease; }
.seg-sentence.flag-false {
  background: #fbeede; box-shadow: inset 0 -2px 0 #e2a86a;   /* amber: you flagged it */
}
.seg-sentence.flag-false:hover { background: #f7e4cd; }
.seg-sentence.flag-correct {
  background: #eef1f5; box-shadow: inset 0 -2px 0 #aab6c4;   /* slate: you marked it fine */
}
.seg-sentence.flag-correct:hover { background: #e6ebf1; }
.seg-sentence.active { box-shadow: 0 0 0 2px var(--accent); background: #fff; }

/* ── post-game reveal (truth shown only after Submit) ── */
.seg-sentence.reveal-tp { background: #e3f3e6; box-shadow: inset 0 -2px 0 #58a563; }
.seg-sentence.reveal-fp { background: #fbe6e4; box-shadow: inset 0 -2px 0 #d08a83; }
.seg-sentence.reveal-missed { background: #fff4d6; box-shadow: inset 0 -2px 0 #e3c360; }

.error-note {
  margin-top: 8px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.85rem; color: var(--subtle); font-style: italic;
}

/* ================================================================
   v3 — two-tag quick popover + post-submit notes review.
   ================================================================ */

/* color-code the two tags (kept neutral; not a correctness signal) */
.ap-choice.ap-false.selected  { background: #c0792e; border-color: #c0792e; color: #fff; }
.ap-choice.ap-weird.selected  { background: #6f64ad; border-color: #6f64ad; color: #fff; }
.ap-choice.ap-false:hover  { border-color: #c0792e; }
.ap-choice.ap-weird:hover  { border-color: #6f64ad; }
.ap-remove-btn {
  width: 100%; margin-top: 9px;
  background: transparent; color: var(--subtle);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 0; font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.84rem; cursor: pointer; transition: all 0.13s ease;
}
.ap-remove-btn:hover { border-color: #cfc9bd; color: var(--text); }

/* in-play flags: amber = "false", indigo = "questionable" (both NEUTRAL) */
.seg-sentence.flag-false  { background: #fbeede; box-shadow: inset 0 -2px 0 #e2a86a; }
.seg-sentence.flag-false:hover  { background: #f7e4cd; }
.seg-sentence.flag-weird  { background: #ecebf6; box-shadow: inset 0 -2px 0 #9a8fc9; }
.seg-sentence.flag-weird:hover  { background: #e4e2f1; }

/* ── review / notes screen ── */
#review-list { display: flex; flex-direction: column; gap: 14px; margin-bottom: 24px; }
.review-item {
  border: 1px solid var(--border); border-radius: 11px;
  background: var(--white); padding: 14px 16px;
}
.rv-head { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.rv-chip {
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.03em;
  text-transform: uppercase; padding: 4px 10px; border-radius: 20px;
}
.rv-chip.rv-false { background: #f6e8d6; color: #9a5a1c; }
.rv-chip.rv-weird { background: #e7e4f3; color: #574b91; }
.rv-req { font-family: -apple-system, sans-serif; font-size: 0.74rem; color: #b4533a; }
.rv-opt { font-family: -apple-system, sans-serif; font-size: 0.74rem; color: var(--subtle); }
.rv-quote {
  font-family: Georgia, "Times New Roman", serif; font-size: 0.98rem;
  line-height: 1.5; color: #333; margin-bottom: 10px;
}
.rv-comment {
  width: 100%; border: 1px solid var(--border); border-radius: 8px;
  padding: 9px 11px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.92rem; background: var(--bg); color: var(--text); resize: vertical;
}
.rv-comment:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--white); }

/* ── rules / "how it works" box (pre-start briefing) ── */
.rules-box {
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  background: var(--white);
  padding: 16px 20px 16px 22px;
  margin-bottom: 30px;
}
.rules-title {
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.74rem; font-weight: 700; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--accent);
  margin-bottom: 10px;
}
.rules-list {
  margin: 0; padding-left: 20px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.98rem; line-height: 1.55; color: var(--text);
}
.rules-list li { margin-bottom: 7px; }
.rules-list li:last-child { margin-bottom: 0; }

.rules-guard {
  margin: 14px 0 0;
  padding: 11px 15px;
  border-radius: 8px;
  background: rgba(180, 35, 24, 0.06);
  border: 1px solid rgba(180, 35, 24, 0.22);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.92rem; line-height: 1.5; color: #b42318;
}

.examples-box {
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  background: var(--white);
  padding: 16px 20px 16px 22px;
  margin-bottom: 30px;
}
.ex-row { margin-top: 12px; }
.ex-row:first-of-type { margin-top: 10px; }
.ex-quote {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.98rem; font-style: italic; line-height: 1.5;
  color: var(--text);
  padding-left: 12px; border-left: 2px solid var(--border);
  margin-bottom: 7px;
}
.ex-line {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
}
.ex-verdict {
  flex: 0 0 auto;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.02em;
  padding: 2px 9px; border-radius: 999px; white-space: nowrap;
}
.ex-false { color: #9a5416; background: #fbeede; border: 1px solid #e2a86a; }
.ex-weird { color: #574c8c; background: #ecebf6; border: 1px solid #9a8fc9; }
.ex-why {
  flex: 1 1 240px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.9rem; line-height: 1.5; color: var(--subtle);
}

/* ================================================================
   Report rendering: Markdown headers/lists + inline md + KaTeX math.
   ================================================================ */
.seg-header.level-1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.55rem; font-weight: normal; letter-spacing: -0.015em;
  margin-top: 0.1em; margin-bottom: 0.5em; color: var(--text);
}
.seg-header.level-2 { font-size: 1.05rem; margin-top: 1.7em; }
.seg-header.level-3 { font-size: 0.95rem; margin-top: 1.3em; }
.seg-header.level-4,
.seg-header.level-5,
.seg-header.level-6 { font-size: 0.9rem; margin-top: 1.1em; color: var(--subtle); }

.seg-sentence.seg-list {
  display: block;
  margin: 0.1em 0 0.1em 1.5em;
  padding: 2px 4px;
  position: relative;
}
.seg-sentence.seg-list::before {
  content: "•"; position: absolute; left: -1em; color: var(--subtle);
}

#report-container code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em; background: #efece5;
  padding: 0.05em 0.35em; border-radius: 4px;
}
#report-container strong { font-weight: 700; }
#report-container em { font-style: italic; }

/* KaTeX: tame inline math height; let display math scroll rather than overflow */
#report-container .katex { font-size: 1.02em; }
#report-container .katex-display { margin: 0.6em 0; overflow-x: auto; overflow-y: hidden; }

/* second-tier "Questionable" reveal subtitle */
.soft-sub { font-weight: 400; font-size: 0.8rem; color: var(--subtle); }
#soft-reveal { margin-top: 22px; }

/* post-reveal feedback on the judging */
.fb-row { margin-top: 8px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.fb-q { font-size: 12px; color: #667; }
.fb-btn { font-size: 12px; padding: 2px 12px; border: 1px solid #bbb; border-radius: 12px;
          background: #fff; cursor: pointer; }
.fb-btn.fb-sel { background: #2b6cb0; color: #fff; border-color: #2b6cb0; }
.fb-note { font-size: 12px; flex: 1; min-width: 180px; padding: 4px 8px; }
.error-item.was-fp { border-left: 3px solid #d69e2e; }

/* RR arm legend — sits above the report so the marking is explained in place. */
.rr-legend {
  margin: 0 0 18px;
  padding: 10px 14px;
  border-left: 3px solid #e53935;
  background: rgba(229, 57, 53, 0.04);
  font-size: 0.88rem;
  line-height: 1.6;
  color: #555;
}

.rr-demo {
  text-decoration: underline wavy #e53935;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
  background: rgba(229, 57, 53, 0.04);
}

/* Display-math sentence: block so the flag/suspicion highlight covers the formula. */
.seg-sentence.seg-display {
  display: block;
  padding: 2px 0;
  border-radius: 6px;
}
.seg-sentence.seg-display.flag-false { box-shadow: inset 0 0 0 2px #e2a86a; }
/* Keep display math from overflowing the narrow quick-tag popover. */
#ap-quote .katex-display { margin: 4px 0; font-size: 0.9em; overflow-x: auto; }

/* Results reassurance — the ground truth is AI-checked and fallible; say so kindly. */
#results-disclaimer {
  margin: 4px 0 22px;
  padding: 12px 16px;
  border-left: 3px solid #c0603a;
  background: rgba(192, 96, 58, 0.06);
  border-radius: 6px;
  color: #7a4632;
  font-size: 0.92rem;
  line-height: 1.6;
}

/* "You may look things up" — a permission, styled as encouragement not warning. */
.rules-ok {
  margin: 10px 0 2px;
  font-size: 0.9rem;
  color: #3f6b52;
}

/* Pilot scope note — sets expectations without alarming. */
.rules-pilot {
  margin: 12px 0 2px;
  font-size: 0.9rem;
  color: #555;
}

/* Mode toggle — tiny, out of the way; for debugging only. */
.mode-toggle {
  position: fixed;
  bottom: 8px;
  right: 10px;
  background: none;
  border: none;
  color: rgba(176, 169, 154, 0.35);
  font-size: 0.62rem;
  cursor: default;
  padding: 2px 4px;
}
.mode-toggle:hover { color: #7a7364; cursor: pointer; }

/* Names the paper/codebase a testbed report was written from. */
.source-ref {
  margin: 0 0 14px;
  padding: 9px 14px;
  border-left: 3px solid #7a8b99;
  background: rgba(122, 139, 153, 0.07);
  border-radius: 6px;
  font-size: 0.9rem;
  color: #4a5560;
}
