:root {
  color-scheme: light;
  /* Base palette */
  --bg: #f0ede8;
  --bg-2: #f7f5f1;
  --surface: #fff;
  --surface-soft: #fbfaf7;
  --ink: #211f1b;
  --muted: #625d52;
  --faint: #8a857c;
  --line: #e3dfd6;
  --line-strong: #d2cdc2;
  /* Teal accent */
  --accent: #176b60;
  --accent-strong: #0c4d46;
  --accent-soft: #edf5f2;
  --accent-line: #c9ded6;
  /* Warn / danger */
  --warn: #7a5c1e;
  --warn-soft: #fdf6ec;
  --danger: #a13333;
  --danger-soft: #fff0f0;
  /* Navy header */
  --navy: #1d2a44;
  --navy-mid: #243256;
  --navy-light: #2e3f6a;
  --navy-text: #e8ecf5;
  --navy-muted: #9aa6c4;
  /* Step accent colors */
  --step-1: #176b60;
  --step-2: #3d5a99;
  --step-3: #7a5c1e;
  --step-4: #5a4888;
  --step-5: #176b60;
  /* Support label colors */
  --contradicted-bg: #fff0f0;
  --contradicted-ink: #a13333;
  --contradicted-border: #f0d0d0;
  --supported-bg: #edf5f2;
  --supported-ink: #0c4d46;
  --supported-border: #c9ded6;
  --partial-bg: #fdf6ec;
  --partial-ink: #7a5c1e;
  --partial-border: #ecd9b8;
  --unsupported-bg: #f5f5f4;
  --unsupported-ink: #4a5568;
  --unsupported-border: #d8d6d0;
  --unverifiable-bg: #f4f1f9;
  --unverifiable-ink: #5b4a8a;
  --unverifiable-border: #d6cfe8;
  /* Design system tokens */
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --pad-card: 16px;
  --border-subtle: 1px solid var(--line);
  /* Layout */
  --hdr-h: 68px;
  --shadow-sm: 0 1px 3px rgba(35, 31, 25, .05);
  --shadow: 0 4px 16px rgba(35, 31, 25, .08);
  --shadow-lg: 0 8px 28px rgba(35, 31, 25, .10);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "IBM Plex Sans Arabic", "Noto Sans Arabic", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible,
summary:focus-visible, a:focus-visible {
  outline: 3px solid rgba(23, 107, 96, .3);
  outline-offset: 2px;
}
a { color: inherit; }

/* ───── SHELL ───── */
.shell { min-height: 100vh; display: flex; flex-direction: column; }

/* ───── TOP BAR ───── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--navy);
  color: var(--navy-text);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  height: var(--hdr-h);
  border-bottom: 1px solid rgba(255,255,255,.06);
  box-shadow: 0 2px 12px rgba(0,0,0,.18);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 15px;
  white-space: nowrap;
  color: white;
  text-decoration: none;
}
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 30px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font: 800 10px ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .02em;
  flex-shrink: 0;
}
.topbar-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--navy-muted);
  min-width: 160px;
}
.topbar-progress strong { color: var(--navy-text); font-variant-numeric: tabular-nums; }
.prog-track {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,.12);
  border-radius: 99px;
  overflow: hidden;
  min-width: 80px;
}
.prog-track span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
  transition: width .3s ease;
}
.topbar .grow { flex: 1; }
.tabs {
  display: flex;
  gap: 2px;
}
.tab {
  border: 1px solid transparent;
  background: transparent;
  border-radius: 7px;
  padding: 6px 12px;
  color: var(--navy-muted);
  font-weight: 700;
  font-size: 13px;
  transition: background .15s, color .15s;
}
.tab:hover { background: rgba(255,255,255,.08); color: var(--navy-text); }
.tab.active { background: rgba(255,255,255,.13); color: white; border-color: rgba(255,255,255,.15); }
.topbar-annotator {
  display: flex;
  align-items: center;
  gap: 8px;
}
.topbar-annotator label { font-size: 11px; color: var(--navy-muted); white-space: nowrap; }
.topbar-annotator .input-sm {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.15);
  color: white;
  border-radius: 6px;
  padding: 5px 9px;
  font-size: 13px;
  min-width: 0;
  width: 130px;
}
.topbar-annotator .input-sm::placeholder { color: var(--navy-muted); }
.topbar-annotator .input-sm:focus { outline: none; border-color: var(--accent); background: rgba(255,255,255,.15); }
.topbar select.input-sm option { background: var(--navy); color: white; }
.topbar-run select {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.15);
  color: white;
  border-radius: 6px;
  padding: 5px 28px 5px 9px;
  font-size: 12px;
  min-width: 0;
  max-width: 180px;
  cursor: pointer;
}
.topbar-run select option { background: var(--navy); }
.topbar-run label { font-size: 11px; color: var(--navy-muted); white-space: nowrap; }
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 7px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.1);
  color: var(--navy-muted);
  font-size: 15px;
  transition: background .15s, color .15s;
}
.btn-icon:hover { background: rgba(255,255,255,.15); color: white; }
.token-input {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.15);
  color: white;
  border-radius: 6px;
  padding: 5px 9px;
  font-size: 12px;
  width: 180px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.token-input::placeholder { color: var(--navy-muted); }

/* ───── NOTICE ───── */
.notice {
  margin: 12px auto 0;
  max-width: 1640px;
  width: calc(100% - 36px);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  font-size: 13px;
  border: var(--border-subtle);
}
.notice.ok { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }
.notice.info { background: #eef4fb; color: #24577c; border-color: #d5e5f2; }
.notice.danger { background: var(--danger-soft); color: var(--danger); border-color: #f0d0d0; }
.notice.hidden { display: none; }

/* ───── PAGE / GRID ───── */
.page { padding: 18px; max-width: 1680px; margin: 0 auto; width: 100%; flex: 1; min-width: 0; }
.grid { display: grid; gap: 14px; }
.two { grid-template-columns: minmax(0, 1fr) 390px; align-items: start; }
.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grow { flex: 1; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; direction: ltr; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.ltr { direction: ltr; text-align: left; }
.hidden { display: none !important; }

/* ───── PANELS ───── */
.panel {
  background: var(--surface);
  border: var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--pad-card);
  box-shadow: var(--shadow-sm);
}
.panel.soft { background: var(--surface-soft); }
.section-title { font-size: 15px; font-weight: 800; margin-bottom: 12px; }
.eyebrow {
  font: 700 11px ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: .04em;
}
/* ───── FORMS ───── */
.field { display: grid; gap: 6px; margin-bottom: 12px; }
.field label, .label { font-weight: 800; font-size: 12px; color: var(--muted); }
.label { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.label .mono { color: var(--faint); font-weight: 600; font-size: 10px; }
.input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  padding: 9px 10px;
  color: var(--ink);
}
.input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); }
.input-help { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
textarea { min-height: 88px; resize: vertical; line-height: 1.8; }
.primary {
  border: 0;
  background: var(--accent);
  color: white;
  border-radius: 8px;
  padding: 10px 18px;
  font-weight: 900;
  transition: background .15s;
}
.primary:hover:not(:disabled) { background: var(--accent-strong); }
.secondary {
  border: 1px solid var(--line);
  background: white;
  color: var(--muted);
  border-radius: 7px;
  padding: 9px 13px;
  font-weight: 800;
  transition: border-color .15s, color .15s;
}
.secondary:hover { border-color: var(--line-strong); color: var(--ink); }
.warning {
  background: var(--warn-soft);
  color: var(--warn);
  border: 1px solid #ecd9b8;
  border-radius: var(--radius-sm);
  padding: 9px 11px;
}
.compact-warning { font-size: 12px; line-height: 1.7; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 6px;
  padding: 3px 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
  font-size: 12px;
}
.soft-pill { background: white; border: 1px solid var(--accent-line); }

/* ───── CARDS / UTILS ───── */
.cards { display: grid; gap: 10px; }
.card { border: var(--border-subtle); border-radius: var(--radius-sm); background: white; padding: 12px; }
.empty-state {
  min-height: 400px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  text-align: center;
  padding: 30px;
}
.empty-state h2 { font-size: 22px; margin-bottom: 8px; }
.empty-state p { color: var(--muted); max-width: 560px; line-height: 1.8; }
.ok-state { border-style: solid; background: var(--accent-soft); }

/* ───── ANNOTATION PAGE ───── */
.annotation-page { display: flex; flex-direction: column; gap: 14px; }
.annotation-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  background: var(--surface);
  border: var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px var(--pad-card);
  box-shadow: var(--shadow-sm);
}
.toolbar-load { white-space: nowrap; min-height: 38px; padding: 8px 16px; }

/* ───── 3-COLUMN WORKBENCH ───── */
.annotation-workbench {
  display: grid;
  grid-template-columns: minmax(270px, 310px) minmax(0, 1fr) minmax(250px, 278px);
  gap: 14px;
  align-items: start;
  min-width: 0;
}
.passage-col, .decision-col, .guide-col { min-width: 0; overflow-wrap: anywhere; }

/* ───── PASSAGES COLUMN (LEFT) ───── */
.passage-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.passage-col-header h2 { font-size: 14px; font-weight: 800; }
.passage-col-header p { font-size: 11px; color: var(--muted); line-height: 1.5; }
.passage-col-head-counts { display: flex; gap: 5px; }
.passage-col-head-counts span {
  direction: ltr;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 2px 6px;
  color: var(--muted);
  font: 700 10px ui-monospace, SFMono-Regular, Menlo, monospace;
}
.sticky-col {
  position: sticky;
  top: calc(var(--hdr-h) + 14px);
  max-height: calc(100vh - var(--hdr-h) - 28px);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.sticky-col::-webkit-scrollbar { width: 4px; }
.sticky-col::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 4px; }
.passage-list { display: flex; flex-direction: column; gap: 10px; }
.passage-card {
  background: var(--surface);
  border: var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color .15s;
}
.passage-card.cited { border-color: var(--accent-line); }
.passage-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: #f4f7f5;
  border-bottom: 1px solid var(--line);
  direction: ltr;
}
.passage-card.cited .passage-card-head { background: #ebf4f1; border-bottom-color: #d4e8e0; }
.passage-rank {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--accent);
  color: white;
  font: 800 10px ui-monospace, SFMono-Regular, Menlo, monospace;
  flex-shrink: 0;
}
.passage-id {
  font: 700 10px ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--muted);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.passage-card-body {
  padding: 11px 12px;
  line-height: 2;
  color: #33302a;
  font-size: 13.5px;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.passage-body-inner {
  max-height: 220px;
  overflow: hidden;
  transition: max-height .25s ease;
}
.passage-body-inner.expanded { max-height: 2000px; }
.passage-toggle {
  display: block;
  width: 100%;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 800;
  color: var(--accent);
  background: var(--accent-soft);
  border: none;
  border-top: 1px solid var(--accent-line);
  text-align: center;
  cursor: pointer;
  transition: background .15s;
}
.passage-toggle:hover { background: #ddeee8; }
.passage-toggle.hidden { display: none; }
.citation-mark {
  background: #d8f0e6;
  color: #0f4a40;
  border-radius: 3px;
  padding: 0 3px;
  box-shadow: 0 0 0 1px #b2dece;
  font-weight: 800;
}

/* ───── CITATION NAV (legacy, kept for passage section) ───── */
.citation-nav-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.citation-nav-chips a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--accent);
  text-decoration: none;
  border: 1px solid var(--accent-line);
  border-radius: 6px;
  padding: 3px 8px;
  background: var(--accent-soft);
  font-size: 11px;
  font-weight: 800;
}
.citation-nav-chips a span {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  color: var(--accent);
  direction: ltr;
  font: 800 9px ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ───── DECISION COLUMN (CENTER) ───── */
.decision-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Sticky claim context card — stays visible while scrolling through steps */
.claim-card {
  position: sticky;
  top: calc(var(--hdr-h) + 4px);
  z-index: 9;
  background: var(--surface);
  border: var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--pad-card);
  box-shadow: var(--shadow);
  /* Ensure no ancestor overflow breaks sticky */
  will-change: transform;
}
.claim-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: var(--border-subtle);
}
.claim-card-meta { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.task-meta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.claim-meta-id { font: 700 11px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--faint); }
.claim-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.nav-arrow {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  transition: background .15s, color .15s, border-color .15s;
}
.nav-arrow:hover:not(:disabled) { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.nav-arrow:disabled { opacity: .4; cursor: not-allowed; }
.nav-pos {
  font: 700 12px ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--muted);
  direction: ltr;
  min-width: 40px;
  text-align: center;
}
.claim-question {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.8;
  overflow-wrap: anywhere;
}
.claim-text-box {
  background: var(--surface-soft);
  border: var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 16px;
  line-height: 2;
  color: #181611;
  border-right: 3px solid var(--accent);
  overflow-wrap: anywhere;
}

/* Claim text expand/collapse for long claims */
.claim-text-wrap { position: relative; }
.claim-text-clamp .claim-text-box {
  max-height: 110px;
  overflow: hidden;
  transition: max-height .3s ease;
}
.claim-text-clamp.expanded .claim-text-box { max-height: 600px; }
.claim-text-clamp::after {
  content: '';
  position: absolute;
  bottom: 28px;
  left: 0; right: 0;
  height: 44px;
  background: linear-gradient(to bottom, transparent, var(--surface-soft));
  pointer-events: none;
}
.claim-text-clamp.expanded::after { display: none; }
.claim-expand-btn {
  display: block;
  width: 100%;
  padding: 5px 0 0;
  font-size: 11px;
  font-weight: 800;
  color: var(--accent);
  background: none;
  border: none;
  text-align: center;
  cursor: pointer;
  letter-spacing: .02em;
  transition: color .15s;
  direction: rtl;
}
.claim-expand-btn:hover { color: var(--accent-strong); }

.claim-expand-section { margin-top: 8px; }
.claim-expand-section summary { cursor: pointer; font-size: 12px; font-weight: 700; color: var(--muted); list-style: none; display: flex; align-items: center; gap: 6px; }
.claim-expand-section summary::before { content: "▶"; font-size: 9px; transition: transform .2s; }
.claim-expand-section[open] summary::before { transform: rotate(90deg); }
.claim-expand-section summary::-webkit-details-marker { display: none; }
.answer-full-text { margin-top: 8px; font-size: 13px; line-height: 2; color: #33302a; white-space: pre-wrap; padding: 10px; background: #f9f8f5; border-radius: var(--radius-sm); border: var(--border-subtle); overflow-wrap: anywhere; }
.prev-claims-list { margin-top: 8px; display: grid; gap: 5px; }
.prev-claim-item {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 12px;
  padding: 6px 10px;
  background: #f9f8f5;
  border: var(--border-subtle);
  border-radius: var(--radius-sm);
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.prev-claim-id { font: 700 10px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--faint); flex-shrink: 0; margin-top: 2px; }
.protocol-note {
  margin-top: 8px;
  color: var(--warn);
  background: var(--warn-soft);
  border: 1px solid #ecd9b8;
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  font-size: 11px;
  line-height: 1.7;
}
.blind-warning {
  padding: 8px 12px;
  background: var(--warn-soft);
  border: 1px solid #ecd9b8;
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--warn);
  line-height: 1.7;
}

/* ───── NUMBERED STEPS ───── */
.steps-form {
  background: var(--surface);
  border: var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.step-section {
  border-bottom: var(--border-subtle);
  padding: var(--pad-card);
}
.step-section:last-of-type { border-bottom: none; }
.step-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.step-num {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: white;
  font: 800 11px ui-monospace, SFMono-Regular, Menlo, monospace;
  flex-shrink: 0;
}
.step-num-1 { background: var(--step-1); }
.step-num-2 { background: var(--step-2); }
.step-num-3 { background: var(--step-3); }
.step-num-4 { background: var(--step-4); }
.step-num-5 { background: var(--step-5); }
.step-title {
  font-size: 13px;
  font-weight: 800;
  flex: 1;
}
.step-title-en { font-size: 10px; font-weight: 600; color: var(--faint); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; direction: ltr; }
.step-help {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 10px;
}

/* ─── Step 1: Support Label (5 horizontal cards) ─── */
.support-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
}
.support-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  padding: 10px 6px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
  background: white;
  min-height: 64px;
  justify-content: center;
}
.support-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.support-card input { display: none; }
.support-card .sc-ar { font-size: 12px; font-weight: 800; line-height: 1.4; }
.support-card .sc-en { font: 700 9px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--faint); direction: ltr; }

/* Selected + color states */
.sc-contradicted:has(input:checked), .sc-contradicted.checked {
  border-color: var(--contradicted-ink);
  background: var(--contradicted-bg);
  box-shadow: 0 0 0 2px rgba(161,51,51,.12);
}
.sc-contradicted:hover { border-color: var(--contradicted-border); }
.sc-contradicted .sc-ar { color: var(--contradicted-ink); }

.sc-fully_supported:has(input:checked), .sc-fully_supported.checked {
  border-color: var(--supported-ink);
  background: var(--supported-bg);
  box-shadow: 0 0 0 2px rgba(23,107,96,.12);
}
.sc-fully_supported:hover { border-color: var(--supported-border); }
.sc-fully_supported .sc-ar { color: var(--supported-ink); }

.sc-partially_supported:has(input:checked), .sc-partially_supported.checked {
  border-color: var(--partial-ink);
  background: var(--partial-bg);
  box-shadow: 0 0 0 2px rgba(122,92,30,.12);
}
.sc-partially_supported:hover { border-color: var(--partial-border); }
.sc-partially_supported .sc-ar { color: var(--partial-ink); }

.sc-unsupported:has(input:checked), .sc-unsupported.checked {
  border-color: var(--unsupported-ink);
  background: var(--unsupported-bg);
  box-shadow: 0 0 0 2px rgba(74,85,104,.12);
}
.sc-unsupported:hover { border-color: var(--unsupported-border); }
.sc-unsupported .sc-ar { color: var(--unsupported-ink); }

.sc-unverifiable:has(input:checked), .sc-unverifiable.checked {
  border-color: var(--unverifiable-ink);
  background: var(--unverifiable-bg);
  box-shadow: 0 0 0 2px rgba(91,74,138,.12);
}
.sc-unverifiable:hover { border-color: var(--unverifiable-border); }
.sc-unverifiable .sc-ar { color: var(--unverifiable-ink); }

/* ─── Step 2: Claim Type Chips ─── */
.type-chips {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
.type-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: white;
  transition: border-color .15s, background .15s;
  font-size: 12px;
  font-weight: 700;
  min-height: 52px;
}
.type-chip input { display: none; }
.type-chip:hover { border-color: #7a9bc2; background: #f0f5fb; }
.type-chip:has(input:checked) {
  border-color: #3d5a99;
  background: #eef2fa;
  box-shadow: 0 0 0 2px rgba(61,90,153,.12);
}
.type-chip:has(input:checked) .tc-ar { color: #3d5a99; }
.tc-ar { font-weight: 800; }
.tc-en { font: 600 9px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--faint); direction: ltr; }

/* ─── Steps 3 & 4: Binary cards ─── */
.binary-step-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.binary-step-pair .step-section {
  border-bottom: none;
  border-left: 1px solid var(--line);
}
.binary-step-pair .step-section:last-child { border-left: none; }
.binary-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.binary-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  padding: 10px 8px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: white;
  transition: border-color .15s, background .15s;
  min-height: 64px;
  justify-content: center;
}
.binary-card input { display: none; }
.binary-card .bc-ar { font-size: 13px; font-weight: 800; }
.binary-card .bc-hint { font-size: 10px; color: var(--muted); line-height: 1.5; }
.binary-card:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 2px rgba(23,107,96,.12);
}
.binary-card:has(input:checked) .bc-ar { color: var(--accent); }
.binary-card:hover { border-color: var(--accent-line); }

/* ─── Step 5: Citations ─── */
.citations-section { display: flex; flex-direction: column; gap: 10px; }
.citation-block {
  scroll-margin-top: calc(var(--hdr-h) + 14px);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: white;
}
.citation-block-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px var(--pad-card);
  background: #f0f7f4;
  border-bottom: 1px solid var(--accent-line);
}
.citation-block-head > div { display: flex; flex-direction: column; gap: 2px; }
.citation-label-text { font-weight: 800; color: var(--accent-strong); font-size: 13px; }
.citation-id-mono { font: 600 10px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--faint); direction: ltr; }
.citation-meta-loc { font: 700 10px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); direction: ltr; }
.citation-snippet {
  padding: 10px var(--pad-card);
  border-bottom: 1px solid var(--line);
  line-height: 1.9;
  color: #253b36;
  font-size: 13px;
  border-right: 3px solid var(--accent);
  background: #fafcfb;
  overflow-wrap: anywhere;
}
.citation-missing {
  padding: 8px var(--pad-card);
  color: var(--warn);
  background: var(--warn-soft);
  font-size: 12px;
  line-height: 1.7;
  border-bottom: 1px solid #ecd9b8;
}
.citation-dims {
  padding: var(--pad-card);
  display: grid;
  gap: 10px;
}
.citation-dim-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: center;
}
.citation-dim-label {
  font: 700 11px ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--muted);
  white-space: nowrap;
  direction: ltr;
  min-width: 120px;
}
.citation-dim-chips {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.dim-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border: var(--border-subtle);
  border-radius: 6px;
  cursor: pointer;
  background: white;
  font-size: 11px;
  font-weight: 700;
  transition: border-color .12s, background .12s;
  white-space: nowrap;
}
.dim-chip input { display: none; }
.dim-chip:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.dim-chip:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 800;
}
.citation-notes-row { padding: 0 var(--pad-card) var(--pad-card); }
.citation-notes-row textarea { min-height: 56px; font-size: 12px; }
.citation-empty, .citation-none {
  padding: var(--pad-card);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
  text-align: center;
}

/* Notes field within steps */
.notes-step { padding: var(--pad-card); border-top: var(--border-subtle); }
.notes-step textarea { min-height: 72px; font-size: 13px; }
.notes-step label { font-size: 12px; font-weight: 800; color: var(--muted); margin-bottom: 6px; display: block; }

/* Save bar */
.save-bar {
  padding: var(--pad-card);
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface) 100%);
  border-top: var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 12px;
}
.save-btn {
  flex: 1;
  min-height: 44px;
  font-size: 14px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.save-shortcut {
  font: 700 11px ui-monospace, SFMono-Regular, Menlo, monospace;
  background: rgba(255,255,255,.2);
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 4px;
  padding: 1px 6px;
  direction: ltr;
}
.save-status { font-size: 11px; color: var(--muted); white-space: nowrap; }
.save-status.ok { color: var(--accent); }

/* ───── QUICK GUIDE COLUMN (RIGHT) ───── */
.guide-col {
  position: sticky;
  top: calc(var(--hdr-h) + 14px);
  max-height: calc(100vh - var(--hdr-h) - 28px);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.guide-col::-webkit-scrollbar { width: 4px; }
.guide-col::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 4px; }
.guide-panel {
  background: var(--surface-soft);
  border: var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.guide-panel-header {
  padding: 12px var(--pad-card) 0;
  font-size: 11px;
  font-weight: 800;
  color: var(--faint);
  letter-spacing: .06em;
  text-transform: uppercase;
}
.guide-tabs {
  display: flex;
  gap: 0;
  border-bottom: var(--border-subtle);
  padding: 0 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.guide-tabs::-webkit-scrollbar { display: none; }
.guide-tab {
  border: none;
  background: transparent;
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  cursor: pointer;
  transition: color .15s, border-color .15s;
  margin-bottom: -1px;
}
.guide-tab:hover { color: var(--ink); }
.guide-tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 800; }
.guide-content { padding: var(--pad-card); }
.guide-section { margin-bottom: 14px; }
.guide-section:last-child { margin-bottom: 0; }
.guide-section-title { font-size: 12px; font-weight: 800; color: var(--ink); margin-bottom: 6px; }
.guide-entry {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 7px;
}
.guide-label {
  font: 700 10px ui-monospace, SFMono-Regular, Menlo, monospace;
  direction: ltr;
  white-space: nowrap;
  padding-top: 1px;
  min-width: 80px;
}
.guide-desc { font-size: 11px; color: var(--muted); line-height: 1.65; }
.guide-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
}
.guide-example {
  background: var(--surface);
  border: var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.7;
  margin-top: 6px;
}
.guide-example b { color: var(--ink); }

/* ───── FOOTER BAR ───── */
.footer-bar {
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 8px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 11px;
  color: var(--muted);
  flex-wrap: wrap;
}
.footer-item { display: flex; align-items: center; gap: 5px; }
.footer-item .mono { color: var(--faint); }
.footer-saved { color: var(--accent); }

/* ───── PROGRESS (IN PASSAGE COL) ───── */
.progress-card {
  background: var(--surface);
  border: var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.progress-copy {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
}
.progress-copy b { color: var(--ink); font-variant-numeric: tabular-nums; }
.progress { height: 5px; background: #e9e5dc; border-radius: 99px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width .3s ease; }

/* ───── LEGACY / ADMIN VIEWS ───── */
.annotation-form { display: block; }
/* Old 3-col for admin reuse */
.two { grid-template-columns: minmax(0, 1fr) 390px; align-items: start; }
.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* Old radio fields (kept for admin/adjudication views) */
.field-card {
  border: var(--border-subtle);
  border-radius: var(--radius-sm);
  background: white;
  padding: 11px;
  margin: 10px 0 0;
}
.field-card > .label { margin-bottom: 5px; }
.field-help { margin: 0 0 9px; font-size: 12px; color: var(--muted); line-height: 1.75; }
.choice-grid { display: grid; gap: 7px; }
.choice {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 8px;
  align-items: flex-start;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
}
.choice:hover { border-color: var(--line-strong); }
.choice input { margin-top: 4px; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice-number {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--faint);
  font: 800 10px ui-monospace, SFMono-Regular, Menlo, monospace;
  margin-top: 2px;
}
.choice-copy { display: grid; gap: 3px; min-width: 0; }
.choice-title { font-weight: 800; line-height: 1.5; }
.choice-title .mono { color: var(--faint); font-size: 10px; font-weight: 700; }
.choice-hint { color: var(--muted); font-size: 11px; line-height: 1.55; }
.ladder-field .choice { padding: 7px 9px; gap: 6px; }
.ladder-field .field-help { margin-bottom: 7px; line-height: 1.55; }
.ladder-field .choice-hint { font-size: 10.5px; line-height: 1.45; }
.chip-field .choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.chip-field .choice { grid-template-columns: auto minmax(0, 1fr); }
.chip-field .choice-hint { display: none; }
.binary-field .choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.binary-field .choice { grid-template-columns: auto minmax(0, 1fr); }
.compact-field .choice { grid-template-columns: auto minmax(0, 1fr); }
.compact-field .choice-hint { font-size: 10.5px; }
.option-contradicted .choice-title { color: var(--danger); }
.option-fully_supported .choice-title { color: var(--accent-strong); }
.option-partially_supported .choice-title { color: #8a6116; }
.option-unverifiable .choice-title { color: #5b4a8a; }
.decision-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-items: start; }
.notes-field { margin-top: 10px; }
.notes-field textarea { min-height: 78px; }
.save-row {
  position: sticky;
  top: 0;
  z-index: 3;
  margin: 10px 0;
  padding: 8px 0 10px;
  background: linear-gradient(180deg, white 82%, rgba(255,255,255,0));
}
.save-row .primary { width: 100%; min-height: 44px; font-size: 15px; }
.guide { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.guide-list { margin: 8px 0 0; padding-inline-start: 20px; line-height: 1.9; font-size: 12px; color: var(--muted); }
.guide-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 10px;
  margin-top: 10px;
  line-height: 1.7;
  color: var(--muted);
}
.guide-grid b { direction: ltr; color: var(--ink); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.split-list { max-height: 360px; overflow: auto; }

/* ───── RESPONSIVE ───── */
@media (max-width: 1280px) {
  .annotation-workbench {
    grid-template-columns: minmax(250px, 290px) minmax(0, 1fr);
  }
  .guide-col {
    grid-column: 1 / -1;
    position: static;
    max-height: none;
  }
  .guide-panel { display: grid; grid-template-columns: auto 1fr; align-items: start; }
  .guide-tabs { flex-direction: column; border-bottom: none; border-left: 1px solid var(--line); padding: 8px 0; }
  .guide-tab { border-bottom: none; border-left: 2px solid transparent; margin-bottom: 0; margin-right: -1px; padding: 7px 12px; }
  .guide-tab.active { border-left-color: var(--accent); }
}

@media (max-width: 1000px) {
  :root { --hdr-h: 56px; }
  .annotation-workbench { grid-template-columns: 1fr; }
  .passage-col .sticky-col, .guide-col { position: static; max-height: none; overflow: visible; }
  .claim-card { position: static; box-shadow: var(--shadow-sm); }
  .topbar { padding: 0 12px; gap: 8px; }
  .topbar-progress, .topbar-run { display: none; }
  .brand span { display: none; }
  .tabs { gap: 2px; }
  .tab { padding: 5px 9px; font-size: 12px; }
  .support-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .type-chips { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .binary-step-pair { grid-template-columns: 1fr; }
  .binary-step-pair .step-section { border-left: none; border-bottom: 1px solid var(--line); }
  .page { padding: 10px; }
  .notice { width: calc(100% - 20px); }
  .two, .three, .decision-pair { grid-template-columns: 1fr; }
  .guide-panel { display: block; }
  .guide-tabs { flex-direction: row; border-bottom: 1px solid var(--line); border-left: none; padding: 0 8px; }
  .guide-tab { border-bottom: 2px solid transparent; border-left: none; margin-bottom: -1px; }
  .guide-tab.active { border-bottom-color: var(--accent); border-left: none; }
  .topbar-annotator label { display: none; }
  .topbar-annotator .input-sm { width: 110px; }
}

@media (max-width: 600px) {
  .support-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .type-chips { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   ANNOTATION TASK — REDESIGN (full-height, context band + two-pane + drawer)
   Palette locked to "Annotation Task Redesign.dc.html"
   ═══════════════════════════════════════════════════════════════════════════ */
:root {
  --rd-bg: #efece6;
  --rd-line: #e5e1d8;
  --rd-line-soft: #eeeae2;
  --rd-accent: #17695d;
  --rd-ink: #211f1b;
  --rd-muted: #57534a;
  --rd-faint: #8f897d;
  --rd-cite-bg: #dcefe7;
  --rd-cite-ink: #14483f;
  --rd-cite-ring: #bcdfd3;
  --rd-warn-bg: #fdf6ec;
  --rd-warn-line: #ecd9b8;
  --rd-warn-ink: #7a5c1e;
  /* blue evidence family */
  --rd-blue-bg: #f4f8fb;
  --rd-blue-line: #ccd8e3;
  --rd-blue-head: #e9f0f6;
  --rd-blue-head-line: #d8e2ec;
  --rd-blue-badge: #2f5f80;
  --rd-blue-title: #274a63;
  --rd-blue-sub: #5a7488;
}
.mono { font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace; }

/* ── full-height shell for the annotator screen ── */
.shell.mode-annotate { height: 100vh; min-height: 0; overflow: hidden; }
.page-annotate {
  padding: 0; max-width: none; margin: 0; width: 100%;
  flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden;
}
.mode-annotate .notice { flex: none; margin: 8px auto 0; }

/* ── light top bar ── */
.topbar.topbar-light {
  background: #fff; color: var(--rd-ink);
  border-bottom: 1px solid var(--rd-line);
  box-shadow: none; height: 56px; gap: 14px;
}
.topbar-light .brand { color: var(--rd-ink); font-size: 14.5px; }
.topbar-light .brand-mark { width: 30px; height: 30px; border-radius: 7px; background: var(--rd-accent); }
.tb-sep { width: 1px; height: 22px; background: var(--rd-line); flex: none; }
.tabs-light .tab { color: var(--rd-muted); }
.tabs-light .tab:hover { background: #f2efe8; color: var(--rd-ink); }
.tabs-light .tab.active { background: #eef3f1; color: var(--rd-accent); border-color: #cadfd9; }
.tb-badge {
  font: 500 10.5px "IBM Plex Mono", monospace; color: var(--rd-faint);
  border: 1px solid var(--rd-line); border-radius: 6px; padding: 3px 8px; white-space: nowrap;
}
.tb-batch { font-size: 12px; color: var(--rd-muted); white-space: nowrap; }
.tb-batch b { font-weight: 600; color: var(--rd-ink); }
.tb-progress { display: flex; align-items: center; gap: 9px; font-size: 12px; color: var(--rd-muted); }
.tb-progress b { color: var(--rd-ink); font-variant-numeric: tabular-nums; }
.tb-track { width: 150px; height: 6px; background: #e8e4db; border-radius: 4px; overflow: hidden; }
.tb-track span { display: block; height: 100%; background: var(--rd-accent); border-radius: 4px; transition: width .3s ease; }
.tb-saved { display: flex; align-items: center; gap: 7px; font-size: 11.5px; min-width: 104px; color: #b3541e; }
.tb-saved.ok { color: var(--rd-accent); }
.tb-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.tb-guide-btn {
  font-size: 12px; background: #fff; border: 1px solid #d8d3c9; border-radius: 7px;
  padding: 7px 12px; color: #33302a; transition: border-color .12s, color .12s; white-space: nowrap;
}
.tb-guide-btn:hover { border-color: var(--rd-accent); color: var(--rd-accent); }
.tb-avatar {
  width: 30px; height: 30px; border-radius: 50%; background: #e8e4db;
  display: grid; place-items: center; font-size: 11px; font-weight: 600; color: var(--rd-muted); flex: none;
}
/* functional controls re-themed for the light bar */
.topbar-light .topbar-run select,
.topbar-light .topbar-annotator .input-sm,
.topbar-light .token-input {
  background: #fff; color: var(--rd-ink); border: 1px solid #d8d3c9;
}
.topbar-light .topbar-run label,
.topbar-light .topbar-annotator label { color: var(--rd-faint); }
.topbar-light .btn-icon { background: #f2efe8; border: 1px solid var(--rd-line); color: var(--rd-muted); }
.topbar-light .btn-icon:hover { background: #e8e4db; color: var(--rd-ink); }
.topbar-light .topbar-run select option { background: #fff; color: var(--rd-ink); }

/* ── task screen skeleton ── */
.task-screen { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--rd-bg); }
.task-main { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 500px; grid-template-rows: minmax(0, 1fr); }

/* ── empty / done states ── */
.task-empty { flex: 1; display: grid; place-items: center; padding: 40px; }
.task-empty-card {
  background: #fff; border: 1px solid var(--rd-line); border-radius: 12px;
  padding: 30px 34px; max-width: 460px; text-align: center; box-shadow: var(--shadow-sm);
}
.task-empty-card h2 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.task-empty-card p { font-size: 13px; color: var(--rd-muted); line-height: 1.7; margin-bottom: 16px; }
.task-empty-card .primary { background: var(--rd-accent); }

/* ═══ CONTEXT BAND ═══ */
.context-band { flex: none; background: #fff; border-bottom: 1px solid var(--rd-line); padding: 13px 20px; }
.cb-inner { display: flex; align-items: stretch; gap: 22px; max-width: 1640px; margin: 0 auto; }
.cb-question { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.cb-eyebrow { font: 500 10px "IBM Plex Mono", monospace; color: var(--rd-faint); letter-spacing: .05em; margin-bottom: 5px; }
.cb-qtext { font-size: 14.5px; font-weight: 600; line-height: 1.65; color: #33302a; }
.cb-qmeta { display: flex; align-items: center; gap: 8px; margin-top: 9px; }
.cb-answer-pill {
  font-size: 11.5px; background: #eef3f1; color: var(--rd-accent); border: 1px solid #cadfd9;
  border-radius: 6px; padding: 2px 9px; font-weight: 600;
}
.cb-unit { font: 500 10px "IBM Plex Mono", monospace; color: var(--rd-faint); }
.cb-divider { width: 1px; background: var(--rd-line-soft); flex: none; }
.cb-claim {
  flex: 1.35; min-width: 0; background: #f5faf8; border: 1px solid #cadfd9;
  border-radius: 10px; padding: 12px 15px;
}
.cb-claim-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.cb-claim-bar { width: 5px; height: 15px; background: var(--rd-accent); border-radius: 3px; flex: none; }
.cb-claim-title { font-size: 11px; font-weight: 700; color: var(--rd-accent); }
.cb-claim-id { font: 600 10px "IBM Plex Mono", monospace; background: var(--rd-accent); color: #fff; border-radius: 4px; padding: 1px 6px; }
.cb-claim-pos { font-size: 11px; color: var(--rd-faint); }
.cb-claim .grow { flex: 1; }
.cb-steps { display: flex; gap: 5px; align-items: center; }
.cb-step { width: 9px; height: 9px; border-radius: 50%; background: #d8d3c9; }
.cb-step.done { background: var(--rd-accent); }
.cb-step.current { background: #fff; border: 2.5px solid var(--rd-accent); }
.cb-claim-text { font-size: 17px; font-weight: 600; line-height: 1.8; color: var(--rd-ink); }
.cb-cite-chip {
  font: 600 10px "IBM Plex Mono", monospace; color: var(--rd-cite-ink); background: #c9e6da;
  border: none; border-radius: 4px; padding: 1px 6px; margin-inline-start: 5px; vertical-align: middle;
}
.cb-cite-chip:hover { background: #b6ddce; }

/* ═══ READING PANE ═══ */
.reading-pane { min-height: 0; overflow: auto; padding: 18px 22px 40px; }
.reading-inner { max-width: 920px; margin: 0 auto; display: flex; flex-direction: column; gap: 13px; }
.reading-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.reading-title { font-size: 13px; font-weight: 700; }
.reading-sub { font-size: 11px; color: var(--rd-faint); flex: 1; min-width: 160px; }
.focus-btn {
  font-size: 11px; border-radius: 6px; padding: 5px 10px; background: #fff;
  border: 1px solid #d8d3c9; color: var(--rd-muted); white-space: nowrap;
}
.focus-btn.on { background: var(--rd-accent); border-color: var(--rd-accent); color: #fff; font-weight: 600; }

.reading-pane .passage-card {
  background: #fff; border: 1px solid var(--rd-line); border-radius: 9px; overflow: hidden;
  transition: opacity .2s;
}
.reading-pane .passage-card.cited { border-color: #cadfd9; }
.reading-pane .passage-card-head {
  display: flex; align-items: center; gap: 8px; background: #faf9f6;
  border-bottom: 1px solid var(--rd-line-soft); padding: 7px 12px;
}
.reading-pane .passage-card.cited .passage-card-head { background: #f3f7f5; border-bottom-color: #e0eae6; }
.reading-pane .passage-id { font: 500 10px "IBM Plex Mono", monospace; color: var(--rd-muted); }
.passage-cited-tag { font-size: 10.5px; color: var(--rd-accent); font-weight: 600; }
.reading-pane .passage-card-body { padding: 13px 15px; }
.reading-pane .passage-body-inner {
  font-size: 16px; line-height: 2.05; color: #33302a;
  max-height: 190px; overflow: hidden; position: relative;
}
.reading-pane .passage-body-inner.expanded { max-height: none; }
.reading-pane .passage-body-inner .citation-mark {
  background: var(--rd-cite-bg); color: var(--rd-cite-ink);
  border-radius: 3px; box-shadow: 0 0 0 1px var(--rd-cite-ring);
  padding: 1px 3px; font: 600 11px "IBM Plex Mono", monospace;
}
.reading-pane .passage-toggle {
  width: 100%; font-size: 11px; color: var(--rd-accent); background: #fff;
  border: none; border-top: 1px solid var(--rd-line-soft); padding: 6px; margin-top: 8px;
}
/* focus mode: dim non-cited passages */
.reading-pane.focus-on .passage-card:not(.cited) { opacity: .4; }
/* pulse on "show in passage" */
.passage-card.pulse, .citation-block.pulse { animation: rdPulse 1.2s ease; }
@keyframes rdPulse {
  0% { box-shadow: 0 0 0 0 rgba(23,105,93,0); }
  25% { box-shadow: 0 0 0 4px rgba(23,105,93,.4); }
  100% { box-shadow: 0 0 0 0 rgba(23,105,93,0); }
}

/* ═══ LABELS RAIL ═══ */
.labels-rail {
  min-height: 0; display: flex; flex-direction: column;
  background: #fff; border-inline-start: 1px solid var(--rd-line);
}
.lr-complete {
  flex: none; padding: 10px 18px; border-bottom: 1px solid var(--rd-line-soft);
  background: #faf8f4; display: flex; flex-direction: column; gap: 6px;
}
.lr-complete-top { display: flex; align-items: center; gap: 10px; }
.lr-complete-title { font-size: 13px; font-weight: 700; }
.lr-complete .grow { flex: 1; }
.lr-pill {
  font-size: 11px; font-weight: 700; color: #8a6116; background: var(--rd-warn-bg);
  border: 1px solid var(--rd-warn-line); border-radius: 20px; padding: 3px 11px;
}
.lr-pill.ok { color: var(--rd-cite-ink); background: #eef3f1; border-color: #cadfd9; }
.lr-missing { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.lr-missing-lead { font-size: 10.5px; color: var(--rd-faint); }
.lr-missing-chip {
  font-size: 10px; border-radius: 5px; padding: 2px 7px; background: #faf6ee;
  border: 1px solid var(--rd-warn-line); color: #8a6116; font-weight: 600;
}

.lr-form { flex: 1; min-height: 0; overflow: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 20px; }
.lr-field-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.lr-field-title { font-size: 12.5px; font-weight: 700; }
.lr-code { font: 500 10px "IBM Plex Mono", monospace; color: var(--rd-faint); }
.lr-hint { font-size: 10.5px; color: var(--rd-faint); line-height: 1.5; }
.lr-form .grow { flex: 1; }

/* claim_type chips */
.lr-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.lr-chip input { position: absolute; opacity: 0; pointer-events: none; }
.lr-chip {
  font-size: 12px; border-radius: 6px; padding: 6px 11px; cursor: pointer;
  background: #fff; border: 1px solid var(--rd-line); color: var(--rd-muted); transition: border-color .1s;
}
.lr-chip:hover { border-color: #b9b3a6; }
.lr-chip:has(input:checked) { background: #eef3f1; border-color: var(--rd-accent); color: var(--rd-cite-ink); font-weight: 600; }

/* support ladder */
.lr-ladder { background: #fbfaf7; border: 1px solid var(--rd-line-soft); border-radius: 10px; padding: 13px 14px; }
.lr-ladder-help { font-size: 11px; color: var(--rd-faint); line-height: 1.6; margin: 4px 0 9px; }
.lr-ladder-rows { display: flex; flex-direction: column; gap: 6px; }
.lr-support-row {
  display: flex; gap: 9px; align-items: flex-start; border-radius: 8px; padding: 9px 10px;
  cursor: pointer; background: #fff; border: 1px solid var(--rd-line);
}
.lr-support-row input { position: absolute; opacity: 0; pointer-events: none; }
.lr-support-row:hover { border-color: #b9b3a6; }
.lr-support-num {
  font: 600 10px "IBM Plex Mono", monospace; color: #a49e92; background: #f2efe8;
  border: 1px solid var(--rd-line); border-radius: 4px; min-width: 18px; height: 18px;
  display: grid; place-items: center; margin-top: 2px; flex: none;
}
.lr-support-dot {
  width: 15px; height: 15px; border-radius: 50%; flex: none; margin-top: 2px;
  border: 1.5px solid #c9c4b9; background: #fff;
}
.lr-support-copy { flex: 1; min-width: 0; }
.lr-support-title { font-size: 12.5px; color: var(--sc, var(--rd-ink)); }
.lr-support-desc { display: block; font-size: 11px; color: var(--rd-faint); line-height: 1.55; margin-top: 2px; }
.lr-support-row:has(input:checked) { background: #f0f7f4; border: 1.5px solid var(--rd-accent); }
.lr-support-row:has(input:checked) .lr-support-num { color: var(--sc); background: #fff; border-color: var(--sc); }
.lr-support-row:has(input:checked) .lr-support-dot { border: 4.5px solid var(--sc); }

/* necessity + redundant */
.lr-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.lr-code-block { display: block; margin-bottom: 6px; }
.lr-blocks { display: flex; flex-direction: column; gap: 5px; }
.lr-block {
  font-size: 12px; border-radius: 6px; padding: 7px 10px; cursor: pointer; text-align: center;
  background: #fff; border: 1px solid var(--rd-line); color: var(--rd-muted);
}
.lr-block input { position: absolute; opacity: 0; pointer-events: none; }
.lr-block:hover { border-color: #b9b3a6; }
.lr-block:has(input:checked) { background: #eef3f1; border-color: var(--rd-accent); color: var(--rd-cite-ink); font-weight: 600; }

/* misleading warning */
.lr-mislead {
  display: flex; gap: 9px; background: var(--rd-warn-bg); border: 1px solid var(--rd-warn-line);
  border-radius: 9px; padding: 11px 13px;
}
.lr-mislead-icon { font-size: 14px; line-height: 1; }
.lr-mislead-title { font-size: 11.5px; font-weight: 700; color: var(--rd-warn-ink); }
.lr-mislead-body { font-size: 11px; color: var(--rd-warn-ink); line-height: 1.65; margin-top: 3px; }

/* citation family (blue) */
.lr-cite-family { border-radius: 10px; border: 1px solid var(--rd-blue-line); background: var(--rd-blue-bg); overflow: hidden; }
.lr-cite-head {
  display: flex; align-items: flex-start; gap: 9px; padding: 11px 13px;
  background: var(--rd-blue-head); border-bottom: 1px solid var(--rd-blue-head-line);
}
.lr-cite-badge {
  width: 22px; height: 22px; border-radius: 6px; background: var(--rd-blue-badge); color: #fff;
  display: grid; place-items: center; font-size: 12px; flex: none; margin-top: 1px;
}
.lr-cite-title { font-size: 12.5px; font-weight: 700; color: var(--rd-blue-title); }
.lr-cite-sub { font-size: 10.5px; color: var(--rd-blue-sub); line-height: 1.55; margin-top: 2px; }
.lr-cite-head > div:nth-child(2) { flex: 1; }
.lr-cite-count {
  font: 600 9.5px "IBM Plex Mono", monospace; color: var(--rd-blue-sub); background: #fff;
  border: 1px solid var(--rd-blue-head-line); border-radius: 5px; padding: 2px 7px; margin-top: 1px; white-space: nowrap;
}
.lr-cite-list { padding: 11px 12px; display: flex; flex-direction: column; gap: 11px; }
.lr-cite-family .citation-block {
  border: 1px solid #dbe4ee; border-radius: 8px; background: #fff; overflow: hidden;
}
.lr-cite-block-head {
  display: flex; align-items: center; gap: 8px; padding: 8px 11px;
  background: #f6f9fc; border-bottom: 1px solid #e6edf4;
}
.lr-cite-block-head .grow { flex: 1; }
.lr-cite-id { font: 700 9.5px "IBM Plex Mono", monospace; color: var(--rd-blue-title); background: #dceaf5; border-radius: 4px; padding: 2px 7px; }
.lr-cite-span { font: 500 9.5px "IBM Plex Mono", monospace; color: var(--rd-faint); }
.lr-cite-show { font-size: 10.5px; color: var(--rd-blue-badge); background: none; border: none; font-weight: 600; }
.lr-cite-show:hover { text-decoration: underline; }
.lr-cite-fields { padding: 10px 12px; display: flex; flex-direction: column; gap: 11px; }
.lr-cite-field-head { display: flex; align-items: baseline; gap: 7px; margin-bottom: 6px; }
.lr-cite-field-title { font-size: 11px; font-weight: 600; color: var(--rd-muted); }
.lr-cite-field-head .lr-code { font-size: 9px; color: #a49e92; }
.lr-cite-opts { display: flex; flex-wrap: wrap; gap: 5px; }
.lr-cite-opt {
  font-size: 11px; border-radius: 5px; padding: 4px 9px; cursor: pointer;
  background: #fff; border: 1px solid #dbe4ee; color: var(--rd-muted);
}
.lr-cite-opt input { position: absolute; opacity: 0; pointer-events: none; }
.lr-cite-opt:has(input:checked) { background: #e4eef6; border-color: var(--rd-blue-badge); color: var(--rd-blue-title); font-weight: 600; }
.lr-cite-notes { padding: 0 12px 11px; }
.lr-cite-notes textarea {
  width: 100%; min-height: 44px; resize: vertical; border: 1px solid #dbe4ee; border-radius: 7px;
  padding: 7px 9px; font-size: 12px; line-height: 1.7; color: var(--rd-ink); background: #fff; outline: none;
}

/* notes */
.lr-notes textarea {
  width: 100%; min-height: 66px; resize: vertical; border: 1px solid var(--rd-line); border-radius: 8px;
  padding: 9px 11px; font-size: 12.5px; line-height: 1.7; color: var(--rd-ink); background: #fff; outline: none;
}
.lr-notes textarea:focus { border-color: var(--rd-accent); }

/* save bar */
.lr-savebar {
  flex: none; border-top: 1px solid var(--rd-line); padding: 10px 18px;
  background: #faf8f4; display: flex; align-items: center; gap: 9px;
}
.lr-savebar .grow { flex: 1; }
.lr-nav-btn { font-size: 12px; background: #fff; border: 1px solid #d8d3c9; border-radius: 7px; padding: 9px 13px; color: var(--rd-muted); }
.lr-nav-btn:hover { border-color: #b9b3a6; }
.lr-kbd { font: 500 10px "IBM Plex Mono", monospace; color: var(--rd-faint); background: #fff; border: 1px solid var(--rd-line); border-radius: 5px; padding: 3px 7px; }
.lr-save-btn {
  font-size: 12px; font-weight: 600; background: #f0ede7; color: #8a857c;
  border: 1px solid #e0dcd3; border-radius: 7px; padding: 10px 16px;
}
.lr-save-btn.ready { font-size: 13px; font-weight: 700; background: var(--rd-accent); color: #fff; border: none; padding: 10px 20px; }

/* ═══ GUIDELINE DRAWER ═══ */
.guide-drawer { position: fixed; inset: 0; z-index: 50; display: flex; }
.gd-overlay { position: absolute; inset: 0; background: rgba(30,28,20,.3); }
.gd-panel {
  position: relative; width: 430px; max-width: 92vw; height: 100%;
  background: #fff; overflow: auto; padding: 20px 22px; box-shadow: -10px 0 34px rgba(30,28,20,.14);
}
.gd-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.gd-title { font-size: 15px; font-weight: 700; }
.gd-ver { font: 500 10px "IBM Plex Mono", monospace; color: var(--rd-faint); border: 1px solid var(--rd-line); border-radius: 5px; padding: 2px 7px; }
.gd-head .grow { flex: 1; }
.gd-close { font-size: 13px; background: #f2efe8; border: none; border-radius: 6px; width: 28px; height: 28px; color: var(--rd-muted); }
.gd-diff { background: #f5faf8; border: 1px solid #cadfd9; border-radius: 9px; padding: 13px 14px; margin-bottom: 16px; }
.gd-diff-title { font-size: 12px; font-weight: 700; color: var(--rd-accent); margin-bottom: 8px; }
.gd-diff-body { font-size: 11.5px; line-height: 1.7; color: #33302a; }
.gd-section-title { font-size: 12px; font-weight: 700; margin-bottom: 9px; }
.gd-support-list { display: flex; flex-direction: column; gap: 7px; margin-bottom: 18px; }
.gd-support { display: flex; gap: 9px; align-items: flex-start; }
.gd-support-dot { width: 16px; height: 16px; border-radius: 50%; flex: none; margin-top: 2px; }
.gd-support b { font-size: 11.5px; }
.gd-support-desc { display: block; font-size: 11.5px; color: var(--rd-muted); line-height: 1.6; }
.gd-rules { display: flex; flex-direction: column; gap: 8px; font-size: 11.5px; line-height: 1.65; color: #33302a; }
.gd-rule { background: #faf8f4; border: 1px solid var(--rd-line-soft); border-radius: 7px; padding: 9px 11px; }

/* ── redesign responsive ── */
@media (max-width: 1200px) {
  .task-main { grid-template-columns: 1fr 420px; }
}
@media (max-width: 980px) {
  .shell.mode-annotate { height: auto; min-height: 100vh; overflow: visible; }
  .page-annotate, .task-screen { overflow: visible; }
  .task-main { grid-template-columns: 1fr; grid-template-rows: auto; }
  .reading-pane, .labels-rail { min-height: 0; overflow: visible; }
  .lr-form { overflow: visible; }
  .cb-inner { flex-direction: column; gap: 12px; }
  .cb-divider { display: none; }
  .topbar-light .tb-badge, .topbar-light .tb-batch, .topbar-light .tb-progress { display: none; }
}

/* ── redesign follow-ups: sentence highlight, answer, prior claims, full guide ── */
/* cited SENTENCE (not the code) is highlighted; code becomes a compact chip */
.reading-pane .passage-body-inner .ps-cited {
  background: var(--rd-cite-bg); color: var(--rd-cite-ink);
  border-radius: 3px; box-shadow: 0 0 0 1px var(--rd-cite-ring); padding: 1px 3px;
}
.reading-pane .passage-body-inner .ps-chip {
  font: 600 9.5px "IBM Plex Mono", monospace; color: var(--rd-cite-ink);
  background: #c9e6da; border-radius: 3px; padding: 0 4px; margin: 0 3px; white-space: nowrap;
}
.reading-pane .passage-body-inner .ps-plain { transition: opacity .18s; }
/* focus mode: dim everything that is not a cited sentence */
.reading-pane.focus-on .passage-card:not(.cited) { opacity: .4; }
.reading-pane.focus-on .passage-body-inner .ps-plain { opacity: .38; }
.ps-cited.pulse { animation: rdPulse 1.2s ease; border-radius: 3px; }

/* full answer (context band) */
.cb-answer { margin-top: 9px; }
.cb-answer > summary {
  font-size: 11px; color: var(--rd-accent); cursor: pointer; list-style: none;
  display: inline-flex; align-items: center; gap: 5px; font-weight: 600;
}
.cb-answer > summary::before { content: "▾"; font-size: 9px; }
.cb-answer[open] > summary::before { content: "▴"; }
.cb-answer-text {
  margin-top: 6px; font-size: 12.5px; line-height: 1.8; color: var(--rd-muted);
  background: #faf9f6; border: 1px solid var(--rd-line-soft); border-radius: 8px; padding: 9px 11px;
}

/* prior claims (context band claim card) */
.cb-prev { margin-top: 9px; }
.cb-prev > summary {
  font-size: 11px; color: var(--rd-muted); cursor: pointer; list-style: none;
  display: inline-flex; align-items: center; gap: 6px; font-weight: 600;
}
.cb-prev > summary::before { content: "▾"; font-size: 9px; }
.cb-prev[open] > summary::before { content: "▴"; }
.cb-prev-count {
  font: 600 9.5px "IBM Plex Mono", monospace; background: #e8e4db; color: var(--rd-muted);
  border-radius: 10px; padding: 0 6px;
}
.cb-prev-list { margin-top: 7px; display: flex; flex-direction: column; gap: 5px; }
.cb-prev-item {
  display: flex; align-items: baseline; gap: 7px; font-size: 12px; line-height: 1.6; color: var(--rd-muted);
  background: #fff; border: 1px solid var(--rd-line-soft); border-radius: 7px; padding: 6px 9px;
}
.cb-prev-id { font: 600 9.5px "IBM Plex Mono", monospace; color: var(--rd-cite-ink); background: #eef3f1; border: 1px solid #cadfd9; border-radius: 4px; padding: 1px 5px; flex: none; }
.cb-prev-check { color: var(--rd-accent); flex: none; }
.cb-prev-text { flex: 1; }

/* fuller guideline drawer */
.gd-code { font: 500 10px "IBM Plex Mono", monospace; color: var(--rd-faint); font-weight: 400; }
.gd-section-title .gd-code { margin-inline-start: 4px; }
.gd-note { font-size: 11px; color: var(--rd-muted); line-height: 1.6; margin: -3px 0 9px; }
.gd-defs { display: flex; flex-direction: column; gap: 7px; margin-bottom: 18px; }
.gd-def { background: #faf8f4; border: 1px solid var(--rd-line-soft); border-radius: 7px; padding: 8px 10px; }
.gd-def-head { display: flex; align-items: baseline; gap: 7px; }
.gd-def-head b { font-size: 12px; }
.gd-def-en { font: 500 9.5px "IBM Plex Mono", monospace; color: var(--rd-faint); }
.gd-def-desc { font-size: 11px; color: var(--rd-muted); line-height: 1.6; margin-top: 3px; }
.gd-blue-band {
  background: var(--rd-blue-head); color: var(--rd-blue-title); border: 1px solid var(--rd-blue-head-line);
  border-radius: 8px; padding: 9px 12px; font-size: 12px; font-weight: 700; margin: 4px 0 14px;
}
