@import url('https://fonts.googleapis.com/css2?family=Crimson+Pro:wght@400;600;700&family=IBM+Plex+Sans:wght@400;500;600;700&display=swap');

:root {
  --bg: #f7f8fb;
  --panel: #ffffff;
  --ink: #1b2330;
  --muted: #667085;
  --line: #d8dde7;
  --teal: #0f766e;
  --teal-dark: #115e59;
  --coral: #c2410c;
  --amber: #b7791f;
  --soft-teal: #e7f5f2;
  --soft-coral: #fff0e8;
  --shadow: 0 18px 45px rgba(25, 35, 52, 0.10);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Do Better Norge v1 workbench */
:root {
  --dbn-paper: #f6f2ea;
  --dbn-ink: #16130f;
  --dbn-blue: #00205b;
  --dbn-red: #ba0c2f;
  --dbn-teal: #0f766e;
  --dbn-line: rgba(22, 19, 15, 0.16);
}

body {
  background:
    linear-gradient(90deg, rgba(0, 32, 91, 0.055) 1px, transparent 1px),
    linear-gradient(180deg, rgba(186, 12, 47, 0.04), transparent 38rem),
    var(--dbn-paper);
  background-size: 44px 44px, auto, auto;
}

.app-shell {
  padding: 18px clamp(14px, 2vw, 28px) 34px;
}

.topbar {
  align-items: flex-start;
  border-bottom: 2px solid rgba(22, 19, 15, 0.14);
  padding-bottom: 16px;
}

.topbar h1 {
  color: var(--dbn-ink);
  font-size: clamp(1.8rem, 2.8vw, 3.2rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.title-mark {
  color: var(--dbn-red);
}

.case-no {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 9px;
  color: #5d574e;
  font-size: 0.86rem;
  font-weight: 700;
}

.case-sep {
  opacity: 0.45;
}

.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dbn-teal);
  box-shadow: 0 0 0 5px rgba(15, 118, 110, 0.12);
}

.shell-lang-switcher {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--dbn-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.64);
}

.shell-lang-switcher a {
  display: inline-flex;
  min-width: 36px;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: var(--dbn-blue);
  font-size: 0.78rem;
  font-weight: 900;
  text-decoration: none;
}

.shell-lang-switcher a.is-active,
.shell-lang-switcher a:hover {
  background: var(--dbn-blue);
  color: #fff;
}

.manifesto {
  max-width: 1500px;
  margin: 0 auto 12px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  gap: 14px;
  border: 1px solid rgba(22, 19, 15, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(186, 12, 47, 0.14), transparent 44%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.42));
  overflow: hidden;
}

.manifesto-copy {
  padding: clamp(20px, 3vw, 36px);
}

.manifesto-eyebrow {
  margin: 0 0 8px;
  color: var(--dbn-red);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.manifesto-title {
  max-width: 780px;
  margin: 0;
  color: var(--dbn-ink);
  font-size: clamp(2rem, 5vw, 5.4rem);
  line-height: 0.92;
  letter-spacing: 0;
}

.manifesto-sub {
  max-width: 760px;
  margin: 14px 0 0;
  color: #3f3932;
  font-size: clamp(1rem, 1.3vw, 1.18rem);
  line-height: 1.45;
}

.manifesto-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-left: 1px solid rgba(22, 19, 15, 0.16);
}

.manifesto-stat {
  min-height: 120px;
  padding: 20px;
  border: 0 solid rgba(22, 19, 15, 0.13);
  border-bottom-width: 1px;
  border-right-width: 1px;
  background: rgba(255, 255, 255, 0.38);
}

.manifesto-stat strong {
  display: block;
  color: var(--dbn-blue);
  font-size: clamp(1.8rem, 3vw, 3.2rem);
  line-height: 1;
}

.manifesto-stat span {
  display: block;
  margin-top: 8px;
  color: #4b453d;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.workspace {
  grid-template-columns: 204px minmax(0, 1fr) 370px;
}

.tool-rail,
.tool-panel,
.reasoning-panel,
.gate-panel,
.cap-card,
.dashboard-tool-card {
  border-color: rgba(22, 19, 15, 0.15);
  box-shadow: 0 18px 45px rgba(22, 19, 15, 0.08);
}

.tool-tab {
  position: relative;
  min-height: 74px;
  overflow: hidden;
}

.tool-tab em {
  position: absolute;
  right: 10px;
  bottom: 8px;
  color: rgba(0, 32, 91, 0.22);
  font-size: 1.25rem;
  font-style: normal;
  font-weight: 900;
}

.tool-tab.is-active {
  background: #fdf8ef;
  border-color: rgba(186, 12, 47, 0.28);
  color: var(--dbn-ink);
}

.tool-tab.is-active::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--dbn-red);
}

.dashboard-shell .disclaimer {
  margin-bottom: 18px;
}

.tool-dashboard-grid {
  max-width: 1500px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.dashboard-tool-card {
  position: relative;
  min-height: 250px;
  padding: 22px;
  border: 1px solid var(--dbn-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--dbn-ink);
  text-decoration: none;
  overflow: hidden;
}

.dashboard-tool-card:hover {
  transform: translateY(-2px);
  border-color: rgba(186, 12, 47, 0.36);
}

.dashboard-tool-card__icon {
  color: rgba(0, 32, 91, 0.14);
  font-size: 4.8rem;
  font-weight: 900;
  line-height: 1;
}

.dashboard-tool-card__badge {
  position: absolute;
  top: 20px;
  right: 18px;
  color: var(--dbn-red);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.dashboard-tool-card h2 {
  margin: 12px 0 8px;
  font-size: 1.45rem;
}

.dashboard-tool-card p {
  color: #514b43;
  line-height: 1.48;
}

.dashboard-tool-card strong {
  position: absolute;
  bottom: 20px;
  color: var(--dbn-blue);
}

.dbn-public-tools {
  min-height: 100vh;
}

.showcase-header {
  background: rgba(255, 255, 255, 0.72);
  border-bottom: 1px solid var(--dbn-line);
}

.showcase-header-inner {
  align-items: flex-start;
  padding-top: 22px;
  padding-bottom: 22px;
}

.showcase-header-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.showcase-title {
  max-width: 980px;
  color: var(--dbn-ink);
  font-size: clamp(2.4rem, 6vw, 6.4rem);
  line-height: 0.9;
  letter-spacing: 0;
}

.showcase-tagline {
  max-width: 780px;
  color: #403a33;
  font-size: clamp(1.05rem, 1.6vw, 1.32rem);
}

.landing-hero {
  max-width: 1500px;
  margin: 18px auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 14px;
  padding: clamp(22px, 4vw, 54px);
  border: 1px solid var(--dbn-line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(0, 32, 91, 0.12), transparent 34%),
    linear-gradient(315deg, rgba(186, 12, 47, 0.16), transparent 40%),
    #fffaf2;
}

.landing-hero h2 {
  max-width: 840px;
  margin: 0;
  font-size: clamp(2rem, 5vw, 5.3rem);
  line-height: 0.92;
  letter-spacing: 0;
}

.landing-hero p {
  max-width: 740px;
  color: #403a33;
  font-size: 1.08rem;
  line-height: 1.5;
}

.landing-hero__stats {
  display: grid;
  gap: 10px;
  align-content: center;
}

.landing-hero__stats div {
  padding: 18px;
  border: 1px solid rgba(0, 32, 91, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
}

.landing-hero__stats strong {
  display: block;
  color: var(--dbn-blue);
  font-size: 2.5rem;
}

.landing-hero__stats span {
  color: #514b43;
  font-weight: 800;
}

.cap-grid--six {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.evidence-inner {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.evidence-inner article {
  padding: 20px;
  border-left: 4px solid rgba(186, 12, 47, 0.45);
  background: rgba(255, 255, 255, 0.58);
}

.google-access-button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin: 18px 0;
  border-radius: 8px;
  background: var(--dbn-blue);
  color: #fff;
  font-weight: 900;
  text-decoration: none;
}

.fallback-login {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--dbn-line);
}

.fallback-login summary {
  cursor: pointer;
  color: #655d53;
  font-weight: 800;
}

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

  .tool-rail {
    flex-direction: row;
    overflow-x: auto;
  }

  .tool-tab {
    min-width: 170px;
  }

  .manifesto,
  .landing-hero {
    grid-template-columns: 1fr;
  }

  .manifesto-stats {
    border-left: 0;
  }

  .tool-dashboard-grid,
  .cap-grid--six,
  .evidence-inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .topbar,
  .showcase-header-inner {
    flex-direction: column;
  }

  .topbar-actions,
  .showcase-header-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .manifesto-stats,
  .tool-dashboard-grid,
  .cap-grid--six,
  .evidence-inner {
    grid-template-columns: 1fr;
  }

  .dashboard-tool-card {
    min-height: 220px;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: progress;
  opacity: 0.7;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.35);
  outline-offset: 2px;
}

.is-hidden {
  display: none !important;
}

.gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.10), transparent 36%),
    linear-gradient(315deg, rgba(194, 65, 12, 0.10), transparent 34%),
    var(--bg);
}

.gate-panel {
  width: min(460px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 32px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

.gate-panel h1,
.topbar h1,
.tool-heading h2,
.reasoning-head h2 {
  margin-bottom: 0;
}

.gate-copy {
  color: var(--muted);
  line-height: 1.5;
}

.passcode-form label,
.input-label,
.control-label {
  display: block;
  font-weight: 700;
  color: var(--ink);
}

.passcode-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 8px;
}

.passcode-row input,
.tool-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.passcode-row input {
  min-height: 44px;
  padding: 0 12px;
}

.passcode-row button,
#runButton,
.secondary-button {
  min-height: 44px;
  border-radius: 8px;
  padding: 0 18px;
  background: var(--teal);
  color: #fff;
  font-weight: 700;
}

.secondary-button {
  background: #263344;
}

.app-shell {
  min-height: 100vh;
  padding: 18px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  max-width: 1500px;
  margin: 0 auto 12px;
  padding: 10px 2px;
}

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

.status-pill,
.tool-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--soft-teal);
  color: var(--teal-dark);
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
}

.status-pill.is-warning {
  background: var(--soft-coral);
  color: var(--coral);
}

.disclaimer {
  max-width: 1500px;
  margin: 0 auto 12px;
  padding: 10px 12px;
  border: 1px solid #f0d6bc;
  border-radius: 8px;
  background: #fff9f2;
  color: #68420d;
  font-size: 0.92rem;
}

.workspace {
  max-width: 1500px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr) 370px;
  gap: 14px;
  align-items: stretch;
}

.tool-rail,
.tool-panel,
.reasoning-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.tool-rail {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tool-tab {
  width: 100%;
  min-height: 68px;
  border-radius: 8px;
  padding: 11px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  border: 1px solid transparent;
}

.tool-tab span {
  display: block;
  font-weight: 800;
}

.tool-tab small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.tool-tab.is-active {
  background: var(--soft-teal);
  border-color: rgba(15, 118, 110, 0.30);
}

.tool-panel {
  min-height: 720px;
  padding: 18px;
}

.tool-heading,
.reasoning-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.tool-form {
  display: grid;
  gap: 12px;
}

.control-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  min-height: 34px;
}

.control-row label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-weight: 700;
}

.tool-form textarea {
  resize: vertical;
  min-height: 220px;
  padding: 14px;
  line-height: 1.55;
}

.form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.form-status {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
}

.results {
  margin-top: 18px;
  display: grid;
  gap: 12px;
}

.empty-state,
.result-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fbfcfe;
}

.empty-state p,
.result-section p,
.result-section li {
  color: var(--muted);
  line-height: 1.55;
}

.answer {
  color: var(--ink) !important;
  font-size: 1.03rem;
}

.result-section h3 {
  margin-bottom: 8px;
  font-size: 0.98rem;
}

.source-list {
  display: grid;
  gap: 10px;
}

.source-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.source-card h4,
.detail-block h4 {
  margin-bottom: 5px;
}

.source-meta {
  color: var(--teal-dark) !important;
  font-size: 0.84rem;
  font-weight: 700;
}

.detail-block {
  margin-top: 12px;
}

.timeline-list {
  display: grid;
  gap: 10px;
  padding-left: 0;
  list-style: none;
}

.timeline-item {
  padding: 10px 12px 10px 14px;
  border-left: 4px solid var(--line);
  border-radius: 0 6px 6px 0;
  background: var(--bg-card, #fff);
}

.timeline-item.confidence-high { border-left-color: #16a34a; }
.timeline-item.confidence-medium { border-left-color: #d97706; }
.timeline-item.confidence-low { border-left-color: #9ca3af; opacity: 0.75; font-style: italic; }

.timeline-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.timeline-date {
  font-size: 0.95rem;
}

.timeline-time {
  margin-left: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 400;
}

.timeline-actor {
  display: block;
  color: var(--teal-dark);
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 3px;
}

.timeline-event {
  margin: 4px 0;
}

.timeline-excerpt {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.82rem;
}

.confidence-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-style: normal;
}
.confidence-badge--high { background: #dcfce7; color: #15803d; }
.confidence-badge--medium { background: #fef3c7; color: #b45309; }
.confidence-badge--low { background: #f3f4f6; color: #6b7280; }

.redacted-output {
  max-height: 420px;
  overflow: auto;
  white-space: pre-wrap;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  color: var(--ink);
  line-height: 1.55;
}

/* ── Redact: tag highlighting ── */
.redact-tag {
  display: inline;
  border-radius: 4px;
  padding: 1px 4px;
  font-weight: 600;
  font-size: 0.88em;
}
.redact-tag--person { background: #fce7f3; color: #9d174d; }
.redact-tag--org    { background: #dbeafe; color: #1e40af; }
.redact-tag--place  { background: #dcfce7; color: #166534; }
.redact-tag--date   { background: #fef3c7; color: #92400e; }
.redact-tag--id     { background: #ede9fe; color: #5b21b6; }

/* ── Redact: view toggle ── */
.redact-view-toggle {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}
.view-btn {
  padding: 4px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 0.82em;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.view-btn.is-active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

/* ── Redact: inventory panel ── */
.redact-inventory {
  margin: 10px 0 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.redact-inventory summary {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.85em;
  font-weight: 600;
  color: var(--muted);
  background: #fafafa;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.redact-inventory summary::-webkit-details-marker { display: none; }
.inv-badge {
  background: var(--line);
  color: var(--muted);
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 0.8em;
  font-weight: 700;
}
.inv-list {
  list-style: none;
  padding: 8px 12px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #fff;
}
.inv-list li {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 0.84em;
  flex-wrap: wrap;
}
.inv-originals { color: var(--muted); }
.inv-originals em { font-style: normal; color: var(--ink); font-weight: 500; }
.inv-count {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.82em;
  white-space: nowrap;
}

/* ── Redact: upgrade engine button ── */
.upgrade-engine-btn {
  display: block;
  margin: 10px 0 4px;
  background: none;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.83em;
  color: var(--muted);
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: border-color 0.15s, color 0.15s;
}
.upgrade-engine-btn:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-left: 0;
  list-style: none;
}

.pill-list li {
  border-radius: 999px;
  background: var(--soft-teal);
  color: var(--teal-dark);
  padding: 6px 10px;
}

.result-disclaimer {
  margin: 0;
  color: #68420d;
}

.muted {
  color: var(--muted);
}

.reasoning-panel {
  min-height: 720px;
  padding: 16px;
}

.trace-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}

.trace-list li {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 10px;
}

.trace-list strong {
  display: block;
  margin-bottom: 3px;
}

.trace-list p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.trace-status {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 999px;
  background: var(--teal);
}

.trace-status.running {
  background: var(--amber);
  animation: trace-pulse 1.4s ease-in-out infinite;
}

@keyframes trace-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.7); }
}

.trace-status.warning {
  background: var(--coral);
}

.trace-status.waiting {
  background: #98a2b3;
}

@media (max-width: 1120px) {
  .workspace {
    grid-template-columns: 170px minmax(0, 1fr);
  }

  .reasoning-panel {
    grid-column: 1 / -1;
    min-height: auto;
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 12px;
  }

  .topbar,
  .form-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .tool-rail {
    flex-direction: row;
    overflow-x: auto;
  }

  .tool-tab {
    min-width: 150px;
  }

  .tool-panel,
  .reasoning-panel {
    min-height: auto;
  }

  .passcode-row {
    grid-template-columns: 1fr;
  }
}

/* ─── Public showcase landing ──────────────────────────────────────────────── */

.showcase-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg);
}

.showcase-header {
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.92), rgba(17, 94, 89, 0.97) 70%),
    linear-gradient(315deg, rgba(194, 65, 12, 0.18), transparent 40%);
  color: #fff;
  padding: 64px 24px 72px;
}

.showcase-header-inner {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}

.showcase-brand .eyebrow {
  color: rgba(255,255,255,0.72);
}

.showcase-title {
  margin: 0 0 10px;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  line-height: 1.1;
  color: #fff;
}

.showcase-tagline {
  margin: 0 0 18px;
  font-size: 1.1rem;
  color: rgba(255,255,255,0.82);
}

.powered-badge {
  display: inline-block;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
  text-decoration: none;
  transition: background 0.15s;
}

.powered-badge:hover {
  background: rgba(255,255,255,0.22);
}

.cta-button {
  display: inline-block;
  background: var(--coral);
  color: #fff;
  text-decoration: none;
  padding: 14px 28px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1rem;
  white-space: nowrap;
  transition: background 0.15s, transform 0.1s;
  flex-shrink: 0;
}

.cta-button:hover {
  background: #b83a0b;
  transform: translateY(-1px);
}

.section-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 24px;
}

.section-heading {
  margin: 0 0 8px;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--ink);
}

.section-sub {
  margin: 0 0 36px;
  color: var(--muted);
  font-size: 0.98rem;
}

/* How it works */
.hiw-section {
  padding: 64px 0;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.hiw-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 28px;
}

.hiw-step {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
}

.hiw-num {
  font-size: 2rem;
  font-weight: 800;
  color: var(--teal);
  opacity: 0.4;
  margin-bottom: 12px;
  line-height: 1;
}

.hiw-step h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 700;
}

.hiw-step p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* Capabilities */
.cap-section {
  padding: 64px 0;
  border-bottom: 1px solid var(--line);
}

.cap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 16px;
}

.cap-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  transition: box-shadow 0.15s;
}

.cap-card:hover {
  box-shadow: 0 4px 16px rgba(15,118,110,0.1);
}

.cap-label {
  display: inline-block;
  background: var(--soft-teal);
  color: var(--teal-dark);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-radius: 999px;
  padding: 3px 10px;
  margin-bottom: 10px;
}

.cap-card h3 {
  margin: 0 0 6px;
  font-size: 0.95rem;
  font-weight: 700;
}

.cap-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.55;
}

/* Evidence trail explainer */
.evidence-section {
  padding: 64px 0;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.evidence-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

.evidence-copy h2 {
  margin: 0 0 14px;
  font-size: 1.5rem;
  font-weight: 800;
}

.evidence-copy p {
  color: var(--muted);
  line-height: 1.7;
  margin: 0 0 18px;
}

.evidence-list {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.8;
}

.evidence-mock {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
}

.mock-label {
  margin: 0 0 16px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--teal);
}

.mock-step {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  font-size: 0.85rem;
}

.mock-step:last-child {
  border-bottom: 0;
  margin-bottom: 0;
  padding-bottom: 0;
}

.mock-step p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.mock-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--teal);
  flex-shrink: 0;
  margin-top: 4px;
}

.mock-dot--amber {
  background: var(--amber);
}

.mock-done .mock-dot {
  background: var(--teal);
}

/* Access / login gate */
.access-section {
  padding: 64px 24px;
  display: flex;
  justify-content: center;
  background: var(--bg);
}

/* Showcase footer */
.showcase-footer {
  padding: 32px 24px;
  text-align: center;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
}

.showcase-footer a {
  color: var(--teal);
  text-decoration: none;
}

.showcase-footer a:hover {
  text-decoration: underline;
}

.footer-disclaimer {
  margin: 6px 0 0;
  font-size: 0.78rem;
  opacity: 0.7;
}

@media (max-width: 640px) {
  .showcase-header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .evidence-inner {
    grid-template-columns: 1fr;
  }

  .cap-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Source card chunk toggle */
.chunk-details {
  margin-top: 0.625rem;
}

.chunk-toggle {
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--teal);
  user-select: none;
  list-style: none;
}

.chunk-toggle::-webkit-details-marker {
  display: none;
}

.chunk-details[open] .chunk-toggle {
  color: var(--teal-dark);
}

.chunk-text {
  margin-top: 0.5rem;
  font-size: 0.7rem;
  line-height: 1.55;
  background: #f0fdf9;
  border: 1px solid #ccfbf1;
  border-radius: 6px;
  padding: 0.625rem 0.75rem;
  white-space: pre-wrap;
  overflow-x: auto;
  color: #374151;
}

/* ─── Upload zone (Redact tool) ──────────────────────────────────────────── */

.upload-zone {
  border: 2px dashed var(--line);
  border-radius: 8px;
  padding: 18px 14px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  position: relative;
}

.upload-zone:hover {
  border-color: var(--teal);
  background: #f7fdfb;
}

.upload-zone.is-drag-over {
  border-color: var(--teal);
  background: var(--soft-teal);
}

#uploadInput {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.upload-icon {
  display: block;
  font-size: 1.8rem;
  line-height: 1;
  color: var(--teal);
  opacity: 0.55;
  margin-bottom: 6px;
}

.upload-prompt p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.upload-browse {
  color: var(--teal);
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.upload-hint {
  font-size: 0.76rem !important;
  opacity: 0.7;
}

.upload-file {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-height: 48px;
  width: 100%;
  padding: 0.4rem 0;
}

.upload-filename {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  word-break: break-all;
}

.upload-clear {
  flex-shrink: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.25rem;
  line-height: 1;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid transparent;
}

.upload-clear:hover {
  background: var(--soft-coral);
  color: var(--coral);
  border-color: #f5c6aa;
}

/* ─── Multi-file list ─────────────────────────────────────────────────────── */

.upload-file-list {
  list-style: none;
  padding: 0;
  margin: 0;
  text-align: left;
  width: 100%;
}

.upload-file-list li {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 2px 0;
  font-size: 0.85rem;
}

.upload-chars {
  color: var(--muted);
  font-size: 0.78rem;
  flex-shrink: 0;
}

/* ─── Name aliases (Redact tool) ──────────────────────────────────────────── */

.alias-section {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}

.alias-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.alias-add-btn {
  background: var(--soft-teal);
  color: var(--teal-dark);
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s;
}

.alias-add-btn:hover {
  background: #c4ece5;
}

.alias-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.alias-original,
.alias-label {
  flex: 1;
  padding: 0.3rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.875rem;
  background: var(--panel);
  color: var(--ink);
  min-width: 0;
}

.alias-original:focus,
.alias-label:focus {
  outline: 3px solid rgba(15, 118, 110, 0.28);
  outline-offset: 1px;
  border-color: var(--teal);
}

.alias-arrow {
  color: var(--muted);
  font-size: 1rem;
  flex-shrink: 0;
}

.alias-remove {
  flex-shrink: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid transparent;
}

.alias-remove:hover {
  background: var(--soft-coral);
  color: var(--coral);
  border-color: #f5c6aa;
}

.alias-hint {
  font-size: 0.76rem;
  color: var(--muted);
  margin: 0.35rem 0 0;
}

.timeline-sort-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}
.sort-label {
  font-size: 0.8rem;
  color: var(--muted);
}
.sort-btn {
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.22rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--muted);
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.sort-btn:hover { background: var(--soft-teal); color: var(--teal-dark); border-color: var(--teal); }
.sort-btn.is-active { background: var(--teal); color: #fff; border-color: var(--teal); }

.timeline-export { margin-top: 1rem; }

.export-csv-btn {
  font-size: 0.8rem;
  padding: 0.35rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.export-csv-btn:hover {
  background: var(--bg);
  color: var(--ink);
}

/* Timeline count badge */
.timeline-count-badge {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0 0 0.6rem;
  font-variant-numeric: tabular-nums;
}

/* Actor filter chips */
.timeline-actor-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}
.timeline-actor-chip {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--muted);
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  white-space: nowrap;
}
.timeline-actor-chip:hover { background: var(--soft-teal); color: var(--teal-dark); border-color: var(--teal); }
.timeline-actor-chip.is-active { background: var(--teal); color: #fff; border-color: var(--teal); }

/* Search + source toggle toolbar */
.timeline-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.timeline-search {
  flex: 1;
  min-width: 0;
  font-size: 0.83rem;
  padding: 0.28rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--ink);
  outline-offset: 2px;
}
.timeline-search:focus { border-color: var(--teal); outline: 2px solid color-mix(in srgb, var(--teal) 25%, transparent); }
.source-toggle-btn {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.28rem 0.7rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s;
}
.source-toggle-btn:hover { background: var(--bg); color: var(--ink); }

/* Year/month group headers */
.timeline-group-header {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.9rem 0 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.timeline-group-header:first-child { margin-top: 0; }
.timeline-group-header::before,
.timeline-group-header::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* Per-event copy button */
.timeline-copy-btn {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 0.8rem;
  line-height: 1;
  padding: 0.15rem 0.35rem;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.1s, background 0.1s;
}
.timeline-item:hover .timeline-copy-btn { opacity: 1; }
.timeline-copy-btn:hover { background: var(--soft-teal); color: var(--teal-dark); }
.timeline-copy-btn:focus-visible { opacity: 1; outline: 2px solid var(--teal); outline-offset: 1px; }

/* Empty state when filters yield nothing */
.timeline-empty {
  color: var(--muted);
  font-style: italic;
  padding: 0.5rem 0;
}

.date-type-badge {
  display: inline-block;
  font-size: 0.68rem;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  background: var(--bg);
  color: var(--muted);
  margin-left: 0.4rem;
  vertical-align: middle;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* ── Transcribe tool ─────────────────────────────────────────────── */

.num-speakers-input {
  width: 4.5rem;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 0.85rem;
}

.transcript-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.speaker-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
}

.speaker-tag small {
  font-weight: 400;
  opacity: 0.75;
}

.speaker-tag--0 { background: #dbeafe; color: #1d4ed8; }
.speaker-tag--1 { background: #ede9fe; color: #6d28d9; }
.speaker-tag--2 { background: #dcfce7; color: #166534; }
.speaker-tag--3 { background: #fef9c3; color: #854d0e; }
.speaker-tag--4 { background: #fee2e2; color: #991b1b; }
.speaker-tag--5 { background: #e7f5f2; color: #0f766e; }

.transcript-box {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
  max-height: 400px;
  overflow-y: auto;
  margin-bottom: 0.75rem;
}

.transcript-text {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.875rem;
  line-height: 1.65;
  font-family: inherit;
  margin: 0;
  color: var(--ink);
}

.segment-details {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 0.75rem;
}

.segment-summary {
  font-size: 0.8rem;
  color: var(--muted);
  padding: 0.6rem 1rem;
  cursor: pointer;
  user-select: none;
}

.segment-list {
  padding: 0.25rem 0.75rem 0.75rem;
  max-height: 280px;
  overflow-y: auto;
}

.segment-row {
  display: flex;
  gap: 0.6rem;
  align-items: baseline;
  padding: 0.2rem 0;
  font-size: 0.78rem;
  border-bottom: 1px solid var(--bg);
}

.segment-time {
  color: var(--muted);
  font-family: ui-monospace, monospace;
  min-width: 7rem;
  flex-shrink: 0;
}

.segment-text {
  color: var(--ink);
  line-height: 1.4;
}

.transcript-downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

/* ── Transcribe extended controls ─────────────────────────────────────── */

.byok-input {
  font-size: 0.82rem;
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--ink);
  width: 22rem;
  max-width: 100%;
}
.byok-input--short { width: 9rem; }
.byok-input:focus  { outline: 2px solid var(--teal); outline-offset: 1px; }

.inline-hint {
  font-size: 0.75rem;
  color: var(--muted);
  margin-left: 0.4rem;
}

.expert-settings {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  margin-top: 0.75rem;
}
.expert-summary {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  padding: 0.55rem 0.9rem;
  list-style: none;
  user-select: none;
}
.expert-summary::-webkit-details-marker { display: none; }
.expert-summary::before {
  content: '▶ ';
  font-size: 0.65rem;
  transition: transform 0.15s;
}
.expert-settings[open] .expert-summary::before { content: '▼ '; }
.expert-body {
  padding: 0.6rem 0.9rem 0.9rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.expert-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.4rem;
}
.prompt-textarea {
  font-size: 0.82rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--ink);
  resize: vertical;
  width: 100%;
  box-sizing: border-box;
}
.prompt-textarea:focus { outline: 2px solid var(--teal); outline-offset: 1px; }

/* ─── Vocabulary presets ──────────────────────────────────────────────────── */

.vocab-presets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
}

/* ─── UI Language switcher ────────────────────────────────────────────────── */

.lang-switcher {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding-bottom: 0.625rem;
  margin-bottom: 0.25rem;
  border-bottom: 1px solid var(--line);
}

.lang-btn {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 9999px;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 0.2rem 0.55rem;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.lang-btn:hover {
  background: var(--soft-teal);
  border-color: var(--teal);
  color: var(--teal);
}

.lang-btn.is-active {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

.vocab-btn {
  font-size: 0.78rem;
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--bg);
  color: var(--ink);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.vocab-btn:hover {
  background: var(--soft-teal, #e8f7f6);
  border-color: var(--teal);
  color: var(--teal);
}

.vocab-btn.is-active {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
  font-weight: 600;
}

/* ─── Audio queue list ────────────────────────────────────────────────────── */

.audio-queue-list {
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
  text-align: left;
}

.queue-item {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 3px 0;
  font-size: 0.84rem;
}

.queue-num {
  flex-shrink: 0;
  min-width: 1.4rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 0.78rem;
}

.queue-item--processing .queue-num { color: var(--teal); }
.queue-item--done .queue-num        { color: #22a06b; }
.queue-item--error .queue-num       { color: var(--coral, #e05); }

.queue-name {
  flex: 1;
  font-weight: 500;
  word-break: break-all;
  color: var(--ink);
}

.queue-item--done .queue-name   { color: var(--muted); }
.queue-item--error .queue-name  { color: var(--coral, #e05); }

.queue-size {
  flex-shrink: 0;
  font-size: 0.76rem;
  color: var(--muted);
}

.audio-queue-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.5rem;
  font-size: 0.82rem;
}

.control-hint { font-size: 0.74rem; color: var(--muted); font-weight: 400; }

/* ─── Exempt names section (Redact tool) ──────────────────────────────────── */

.exempt-section {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}

.exempt-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.exempt-name-input {
  flex: 1;
  padding: 0.3rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.875rem;
  background: var(--panel);
  color: var(--ink);
  min-width: 0;
}

.exempt-name-input:focus {
  outline: 3px solid rgba(15, 118, 110, 0.28);
  outline-offset: 1px;
  border-color: var(--teal);
}

/* ─── Entity type toggles (Redact tool) ───────────────────────────────────── */

.entity-toggles {
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
}

.entity-toggles label {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.875rem;
  cursor: pointer;
  user-select: none;
}

.entity-toggles input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--teal);
  cursor: pointer;
}

/* ─── Advanced settings panel (Redact tool) ───────────────────────────────── */

.advanced-panel {
  border-top: 1px solid var(--line);
  margin-top: 0.6rem;
}

.advanced-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--teal);
  cursor: pointer;
  user-select: none;
  list-style: none;
}

.advanced-toggle::-webkit-details-marker { display: none; }

.advanced-toggle::before {
  content: '▸';
  font-size: 0.7rem;
  transition: transform 0.18s ease;
  display: inline-block;
}

.advanced-panel[open] .advanced-toggle::before {
  transform: rotate(90deg);
}

.advanced-panel[open] .advanced-toggle {
  margin-bottom: 0.5rem;
}

/* ─── Redact download buttons ─────────────────────────────────────────────── */

.redact-downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.redact-dl-btn {
  padding: 0.38rem 0.9rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  background: var(--soft-teal);
  color: var(--teal-dark);
  border: 1px solid rgba(15, 118, 110, 0.2);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.redact-dl-btn:hover {
  background: #d0ede9;
  border-color: var(--teal);
}

.redact-dl-btn:disabled {
  opacity: 0.55;
  cursor: progress;
}

/* ── Feedback widget ──────────────────────────────────────────── */
.feedback-widget {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--line);
}

.feedback-label {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 0.6rem;
}

.feedback-btns {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.feedback-thumb {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.35rem 0.75rem;
  font-size: 1.2rem;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
  line-height: 1;
}

.feedback-thumb:hover { background: var(--soft-teal); border-color: var(--teal); }
.feedback-thumb.is-active { background: var(--soft-teal); border-color: var(--teal); }

.feedback-detail {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.feedback-detail-label {
  font-size: 0.83rem;
  color: var(--ink);
  font-weight: 500;
}

.feedback-optional {
  color: var(--muted);
  font-weight: 400;
}

.feedback-textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  resize: vertical;
  font-family: inherit;
  color: var(--ink);
  background: var(--panel);
}

.feedback-textarea:focus { outline: 3px solid var(--teal); outline-offset: 1px; }

.feedback-detail-footer {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.feedback-submit-btn {
  background: var(--teal);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.4rem 1rem;
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s;
}

.feedback-submit-btn:hover { background: var(--teal-dark); }
.feedback-submit-btn:disabled { opacity: 0.55; cursor: progress; }

.feedback-status {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0;
}

.feedback-thanks {
  font-size: 0.85rem;
  color: var(--teal-dark);
  font-weight: 500;
  margin: 0;
}

/* =========================================================================
   Deep Research — agent + rank/rerank RAG surface
   ========================================================================= */

.deep-research .lang-switcher {
  display: inline-flex;
  gap: 6px;
}

.deep-research .lang-btn {
  padding: 6px 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 700;
}

.deep-research .lang-btn.is-active {
  background: var(--soft-teal);
  color: var(--teal-dark);
  border-color: rgba(15, 118, 110, 0.30);
}

.dr-slice-section {
  display: grid;
  gap: 8px;
}

.dr-slice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.dr-slice {
  text-align: left;
  background: #fbfcfe;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 13px;
  cursor: pointer;
  min-height: 96px;
  display: grid;
  gap: 6px;
  align-content: start;
  transition: border-color 120ms ease, background 120ms ease;
}

.dr-slice:hover {
  border-color: rgba(15, 118, 110, 0.30);
}

.dr-slice.is-on {
  background: var(--soft-teal);
  border-color: rgba(15, 118, 110, 0.45);
}

.dr-slice__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.dr-slice__title {
  font-weight: 800;
  color: var(--ink);
}

.dr-slice__badge {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  text-transform: uppercase;
}

.dr-slice.is-on .dr-slice__badge {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

.dr-slice__tagline {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
}

.advanced-panel .dr-control-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.dr-control-card {
  background: #fbfcfe;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.dr-control-card label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  font-weight: 800;
  color: var(--ink);
  font-size: 0.85rem;
}

.dr-control-card small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.4;
}

.dr-control-card input[type="range"] {
  width: 100%;
  margin-top: 8px;
  accent-color: var(--teal);
}

.dr-control-value {
  color: var(--coral);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 980px) {
  .advanced-panel .dr-control-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dr-slice-grid {
    grid-template-columns: 1fr;
  }
}

.deep-research-results {
  display: grid;
  gap: 14px;
}

.dr-result-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
}

.dr-brief {
  line-height: 1.65;
  color: var(--ink);
  font-size: 1.0rem;
}

.dr-brief p {
  margin: 0 0 12px;
}

.dr-brief code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--soft-teal);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.86em;
}

.dr-brief strong { color: var(--ink); }
.dr-brief em { color: var(--muted); }

.dr-cite {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  margin: 0 1px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--soft-coral);
  color: var(--coral);
  font-size: 0.72rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  border: 1px solid rgba(194, 65, 12, 0.25);
  vertical-align: 1px;
}

.dr-cite:hover { background: var(--coral); color: #fff; }

.dr-sources-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}

.dr-sources-head h3 {
  margin: 0;
  font-size: 1rem;
}

.dr-sources-head small {
  color: var(--muted);
  font-size: 0.82rem;
}

.dr-source-list {
  display: grid;
  gap: 10px;
}

.dr-source-card {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 12px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfe;
  cursor: pointer;
  text-align: left;
  width: 100%;
}

.dr-source-card:hover { border-color: rgba(15, 118, 110, 0.40); }

.dr-source-card.is-highlight {
  border-color: var(--coral);
  background: var(--soft-coral);
}

.dr-source-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--soft-coral);
  color: var(--coral);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.dr-source-body {
  min-width: 0;
}

.dr-source-title {
  font-weight: 800;
  color: var(--ink);
  line-height: 1.35;
}

.dr-source-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.dr-source-tag {
  background: var(--soft-teal);
  color: var(--teal-dark);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 8px;
  text-transform: uppercase;
}

.dr-source-tag--upload { background: #fff0e8; color: #8a4524; }
.dr-source-tag--score  { background: #eef3fb; color: #314158; }
.dr-source-tag--graph  { background: #f0fdf4; color: #166534; }

.dr-source-excerpt {
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.5;
  font-size: 0.92rem;
}

.dr-source-aside {
  align-self: stretch;
  display: grid;
  grid-template-rows: auto auto;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--muted);
  text-align: right;
  min-width: 90px;
}

.dr-source-aside b {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  font-size: 0.92rem;
}

/* ============================================================
   CORPUS PAGE
   ============================================================ */

/* Stats bar */
.corpus-stats-bar {
  display: flex;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 36px;
  background: var(--panel);
}

.corpus-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 16px;
  border-right: 1px solid var(--line);
  text-align: center;
}
.corpus-stat:last-child { border-right: 0; }

.corpus-stat__value {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  color: var(--teal);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.corpus-stat__value.is-loading {
  color: var(--line);
  background: linear-gradient(90deg, var(--line) 25%, #e8ecf2 50%, var(--line) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 4px;
  min-width: 60px;
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.corpus-stat__label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 6px;
  letter-spacing: 0.04em;
}

/* Section headings */
.corpus-section {
  margin-bottom: 40px;
}

.corpus-section__title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  margin: 4px 0 18px;
}

/* Category cards */
.corpus-categories {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.category-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.category-card:hover {
  border-color: var(--teal);
  box-shadow: 0 4px 16px rgba(15, 118, 110, 0.1);
}

.category-card__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.category-card__icon {
  font-size: 1.5rem;
  line-height: 1;
}

.category-card__count {
  font-size: 0.72rem;
  font-weight: 800;
  background: var(--soft-teal);
  color: var(--teal-dark);
  border-radius: 999px;
  padding: 2px 10px;
  font-variant-numeric: tabular-nums;
  min-width: 28px;
  text-align: center;
}

.category-card__count.is-loading {
  color: transparent;
  background: linear-gradient(90deg, var(--line) 25%, #e8ecf2 50%, var(--line) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}

.category-card h4 {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 6px;
}

.category-card p {
  font-size: 0.80rem;
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

/* Sources table */
.corpus-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.sources-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  background: var(--panel);
}

.sources-table th {
  background: var(--bg);
  font-size: 0.70rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.sources-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.sources-table tbody tr:last-child td { border-bottom: 0; }

.sources-table tbody tr:hover td {
  background: var(--soft-teal);
}

.sources-table a {
  color: var(--teal);
  text-decoration: none;
  font-weight: 600;
}

.sources-table a:hover { text-decoration: underline; }

.source-name { max-width: 260px; }

.source-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.badge--teal   { background: var(--soft-teal); color: var(--teal-dark); }
.badge--amber  { background: #fef3cd; color: var(--amber); }
.badge--coral  { background: var(--soft-coral); color: var(--coral); }
.badge--muted  { background: #eef0f5; color: var(--muted); }

.source-cat {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}

.status-active   { color: #15803d; font-size: 0.78rem; font-weight: 700; white-space: nowrap; }
.status-inactive { color: var(--muted); font-size: 0.78rem; white-space: nowrap; }

.sources-skeleton td {
  color: var(--muted);
  font-style: italic;
  padding: 16px 14px;
}

/* AI Stack */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.stack-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--teal);
  border-radius: 0 8px 8px 0;
  padding: 18px 20px;
}

.stack-card h3 {
  font-size: 0.70rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 12px;
}

.stack-list {
  list-style: none;
  padding: 0;
  margin: 0 0 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 0.84rem;
  color: var(--ink);
  line-height: 1.4;
}

.stack-badge {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  vertical-align: middle;
  margin-right: 4px;
}

.stack-badge--azure { background: #dbeafe; color: #1d4ed8; }
.stack-badge--gpu   { background: #f3e8ff; color: #7c3aed; }
.stack-badge--api   { background: #fef3cd; color: var(--amber); }

.stack-star {
  font-size: 0.70rem;
  font-weight: 700;
  color: var(--amber);
}

.stack-note {
  font-size: 0.75rem;
  color: var(--muted);
  margin: 8px 0 0;
  line-height: 1.4;
}

.stack-note code {
  background: var(--bg);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.72rem;
}

/* Pipeline flow */
.pipeline-flow {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.pipeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px 14px;
  text-align: center;
  min-width: 90px;
  flex: 1;
  background: var(--panel);
}

.pipeline-step--end {
  background: var(--soft-teal);
}

.pipeline-step__icon {
  font-size: 1.4rem;
  margin-bottom: 6px;
  display: block;
}

.pipeline-step span:not(.pipeline-step__icon) {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink);
  display: block;
}

.pipeline-step small {
  font-size: 0.67rem;
  color: var(--muted);
  display: block;
  margin-top: 3px;
}

.pipeline-arrow {
  display: flex;
  align-items: center;
  padding: 0 2px;
  color: var(--muted);
  font-size: 1.1rem;
  background: var(--bg);
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
}

.pipeline-arrow::after {
  content: '›';
  font-weight: 700;
}

/* Corpus health sidebar */
.corpus-health-dl {
  margin: 0;
  padding: 16px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 12px;
  font-size: 0.80rem;
}

.corpus-health-dl dt {
  font-weight: 700;
  color: var(--muted);
  font-size: 0.70rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding-top: 2px;
  white-space: nowrap;
}

.corpus-health-dl dd {
  color: var(--ink);
  margin: 0;
  line-height: 1.5;
}

.corpus-health-dl code {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 3px;
  font-size: 0.70rem;
  padding: 1px 5px;
}

/* Responsive */
@media (max-width: 760px) {
  .corpus-stats-bar {
    flex-wrap: wrap;
  }
  .corpus-stat {
    flex: 1 1 50%;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .corpus-categories {
    grid-template-columns: 1fr;
  }
  .pipeline-flow {
    flex-direction: column;
  }
  .pipeline-arrow {
    display: none;
  }
}

/* Method trace — overrides for #traceList rendered in rich mode */
.trace-list.is-rich {
  display: grid;
  gap: 8px;
}

.trace-list.is-rich .trace-step {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  list-style: none;
}

.trace-list.is-rich .trace-step__marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.trace-list.is-rich .trace-step__label {
  display: block;
  font-weight: 800;
  color: var(--ink);
  font-size: 0.94rem;
}

.trace-list.is-rich .trace-step__detail {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.83rem;
  line-height: 1.45;
}

.trace-list.is-rich .trace-step.is-running {
  background: var(--soft-coral);
}
.trace-list.is-rich .trace-step.is-running .trace-step__marker {
  background: rgba(194, 65, 12, 0.18);
  border-color: rgba(194, 65, 12, 0.35);
  color: var(--coral);
  animation: drTracePulse 950ms ease-in-out infinite;
}

.trace-list.is-rich .trace-step.is-done .trace-step__marker {
  background: var(--soft-teal);
  border-color: rgba(15, 118, 110, 0.30);
  color: var(--teal-dark);
}

.trace-list.is-rich .trace-step.is-warning .trace-step__marker {
  background: #fff4dc;
  border-color: rgba(183, 121, 31, 0.35);
  color: var(--amber);
}

.trace-list.is-rich .trace-step.is-error {
  background: #fff0e8;
}
.trace-list.is-rich .trace-step.is-error .trace-step__marker {
  background: rgba(180, 30, 30, 0.10);
  border-color: rgba(180, 30, 30, 0.30);
  color: #b41e1e;
}

@keyframes drTracePulse {
  0%, 100% { opacity: 0.55; transform: scale(0.92); }
  50%      { opacity: 1;    transform: scale(1.04); }
}

/* Source modal */
.dr-source-modal {
  position: fixed;
  inset: 0;
  background: rgba(23, 32, 51, 0.62);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 9999;
}

.dr-source-modal__dialog {
  width: min(960px, 100%);
  max-height: 90vh;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 28px 92px rgba(0, 0, 0, 0.34);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
}

.dr-source-modal__head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.dr-source-modal__head h3 {
  margin: 0;
  color: var(--ink);
  line-height: 1.25;
  font-size: 1.2rem;
}

.dr-source-modal__body {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  overflow: hidden;
}

.dr-source-modal__meta,
.dr-source-modal__text {
  padding: 16px 18px;
  overflow: auto;
}

.dr-source-modal__meta {
  border-right: 1px solid var(--line);
  background: #fbfcfe;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.dr-source-modal__meta dt {
  color: var(--ink);
  font-weight: 800;
  margin-top: 8px;
}

.dr-source-modal__meta dt:first-of-type { margin-top: 0; }

.dr-source-modal__text {
  white-space: normal;
  line-height: 1.7;
  color: var(--ink);
}

@media (max-width: 720px) {
  .dr-source-modal__body { grid-template-columns: 1fr; }
  .dr-source-modal__meta { border-right: 0; border-bottom: 1px solid var(--line); }
  .dr-source-card { grid-template-columns: 32px 1fr; }
  .dr-source-aside { display: none; }
}

/* Per-sub-question agent report cards (v2) */
.dr-subq-list {
  display: grid;
  gap: 10px;
}

.dr-subq-report {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 13px;
  background: #fbfcfe;
}

.dr-subq-report__head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: start;
  margin-bottom: 10px;
}

.dr-subq-report__index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--soft-teal);
  color: var(--teal-dark);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.dr-subq-report__question {
  font-weight: 700;
  color: var(--ink);
  line-height: 1.4;
}

.dr-subq-report__rationale {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.dr-mini-source-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
}

.dr-mini-source {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 8px;
  align-items: start;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.dr-mini-source--empty {
  display: block;
  color: var(--muted);
  padding: 8px 10px;
}

.dr-mini-source__n {
  font-variant-numeric: tabular-nums;
  color: var(--coral);
  font-weight: 800;
  font-size: 0.85rem;
}

.dr-mini-source__title {
  display: inline-block;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  line-height: 1.35;
}

a.dr-mini-source__title:hover { color: var(--teal-dark); text-decoration: underline; }

.dr-mini-source__meta {
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 3px;
}

.dr-mini-source__excerpt {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
  margin-top: 5px;
}

.dr-external-link {
  display: inline-block;
  color: var(--teal);
  font-size: 0.8em;
  margin-left: 3px;
  vertical-align: 1px;
}

a.dr-source-title-link {
  color: var(--ink);
  text-decoration: none;
}

a.dr-source-title-link:hover {
  color: var(--teal-dark);
  text-decoration: underline;
}

/* ── Corpus Explorer: Search bar ─────────────────────────────────────── */
.corpus-search-box {
  padding: 0 0 24px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 32px;
}

.corpus-search-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.corpus-search-input {
  flex: 1;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.9rem;
  background: var(--panel);
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s;
}
.corpus-search-input:focus { border-color: var(--teal); }

.corpus-search-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  gap: 12px;
  flex-wrap: wrap;
}

.search-modes,
.lang-pills {
  display: flex;
  gap: 4px;
}

.mode-pill {
  padding: 3px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.mode-pill:hover { border-color: var(--teal); color: var(--teal); }
.mode-pill.is-active {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

.search-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

/* ── Search results ───────────────────────────────────────────────────── */
.corpus-search-results {
  margin: 0 0 32px;
}

.search-results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.search-results-count {
  font-size: 0.8rem;
  color: var(--muted);
}

.search-loading,
.search-empty,
.search-error,
.search-hint {
  font-size: 0.85rem;
  color: var(--muted);
  padding: 12px 0;
}
.search-error { color: var(--coral); }

.passage-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--teal);
  border-radius: 6px;
  padding: 14px 16px;
  margin-bottom: 10px;
}

.passage-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.passage-section {
  font-size: 0.78rem;
  color: var(--muted);
  font-style: italic;
}

.passage-score {
  font-size: 0.75rem;
  background: var(--soft-teal);
  color: var(--teal-dark);
  padding: 1px 7px;
  border-radius: 999px;
  margin-left: auto;
}

.passage-card__title {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  margin-bottom: 6px;
}
.passage-card__title:hover { color: var(--teal); text-decoration: underline; }
a.passage-card__title { color: var(--teal); text-decoration: underline; text-underline-offset: 2px; }
a.passage-card__title:hover { color: var(--ink); }

.passage-source-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.76rem;
  color: var(--muted);
  text-decoration: none;
  margin-top: 8px;
}
.passage-source-link:hover { color: var(--teal); text-decoration: underline; }

.passage-card__excerpt {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.passage-card mark {
  background: var(--soft-teal);
  color: var(--teal-dark);
  border-radius: 2px;
  padding: 0 1px;
}

.passage-expand-btn {
  display: inline-block;
  margin-top: 8px;
  padding: 2px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.75rem;
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s;
}
.passage-expand-btn:hover { border-color: var(--teal); color: var(--teal); }

.passage-full-text {
  margin-top: 10px;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.8rem;
  color: var(--ink);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── Category card browse button ──────────────────────────────────────── */
.cat-browse-btn {
  display: inline-block;
  margin-top: 10px;
  padding: 4px 12px;
  background: var(--soft-teal);
  border: 1px solid var(--teal);
  border-radius: 5px;
  color: var(--teal);
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.cat-browse-btn:hover {
  background: var(--teal);
  color: #fff;
}

/* ── Drill-down panel ─────────────────────────────────────────────────── */
.corpus-drill-panel {
  margin-top: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 3px solid var(--teal);
  border-radius: 0 0 8px 8px;
  padding: 24px;
}

.drill-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}
.drill-header h3 {
  margin: 4px 0 0;
  font-size: 1.05rem;
}

.drill-close-btn {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  cursor: pointer;
  color: var(--muted);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.drill-close-btn:hover { border-color: var(--teal); color: var(--teal); }

.drill-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.drill-count {
  font-size: 0.78rem;
  color: var(--muted);
}

.drill-controls-right {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.drill-search-input {
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.8rem;
  background: var(--panel);
  color: var(--ink);
  outline: none;
  width: 160px;
  transition: border-color 0.15s;
}
.drill-search-input:focus { border-color: var(--teal); }

.drill-sort-select {
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.8rem;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  outline: none;
}
.drill-sort-select:focus { border-color: var(--teal); }

.drill-loading,
.drill-empty,
.drill-error {
  font-size: 0.85rem;
  color: var(--muted);
  padding: 8px 0;
}
.drill-error { color: var(--coral); }

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

.doc-list__item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 5px;
}
.doc-list__item:hover { border-color: var(--teal); }

.doc-list__info { flex: 1; min-width: 0; }

.doc-list__title {
  display: block;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.doc-list__title:hover { color: var(--teal); text-decoration: underline; }

.doc-list__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.doc-list__date {
  font-size: 0.78rem;
  color: var(--muted);
}

.doc-list__chunks {
  flex-shrink: 0;
  font-size: 0.75rem;
  background: var(--soft-teal);
  color: var(--teal-dark);
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.doc-list__more-wrap {
  text-align: center;
  margin-top: 16px;
}
.doc-list__more {
  padding: 7px 20px;
  border: 1px solid var(--teal);
  border-radius: 5px;
  background: transparent;
  color: var(--teal);
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.doc-list__more:hover { background: var(--teal); color: #fff; }

/* ── Sources table expand column ──────────────────────────────────────── */
.source-expand-cell { width: 32px; padding: 0 4px !important; text-align: center; }

.source-expand-btn {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 4px;
  width: 22px;
  height: 22px;
  font-size: 0.65rem;
  cursor: pointer;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.12s, color 0.12s;
}
.source-expand-btn:hover { border-color: var(--teal); color: var(--teal); }

.source-expand-row > td {
  padding: 0 !important;
  background: var(--soft-teal);
  border-top: none;
}

.source-expand-inner {
  padding: 16px 20px;
}

.source-expand-loading,
.source-expand-error {
  font-size: 0.82rem;
  color: var(--muted);
}

.source-expand-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.source-expand-dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 12px;
  font-size: 0.82rem;
  margin: 0;
}
.source-expand-dl dt { color: var(--muted); white-space: nowrap; }
.source-expand-dl dd { margin: 0; }

.source-expand-url {
  font-size: 0.78rem;
  word-break: break-all;
  margin: 0 0 12px;
}
.source-expand-url a { color: var(--teal); }

.source-browse-btn {
  font-size: 0.82rem !important;
  padding: 5px 14px !important;
}

@media (max-width: 760px) {
  .source-expand-grid { grid-template-columns: 1fr; }
  .corpus-search-controls { flex-direction: column; align-items: flex-start; }
  .drill-controls { flex-direction: column; align-items: flex-start; }
  .drill-search-input { width: 100%; }
}

/* =====================================================================
   Advocate tool  (.adv-*)
   ===================================================================== */

/* Role selector row */
.adv-role-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 20px;
  background: var(--soft-teal);
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--teal) 20%, transparent);
  margin-bottom: 18px;
}
.adv-role-row .control-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--teal-dark, var(--teal));
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0;
}
.adv-role-select {
  appearance: none;
  background: var(--panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M0 0l6 8 6-8z' fill='%23666'/%3E%3C/svg%3E") no-repeat right 14px center;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 38px 10px 14px;
  font-size: 0.95rem;
  color: var(--ink);
  cursor: pointer;
  width: 100%;
  max-width: 480px;
}
.adv-role-select:focus { outline: 2px solid var(--teal); outline-offset: 2px; }
.adv-role-custom {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 14px;
  font-size: 0.93rem;
  color: var(--ink);
  width: 100%;
  max-width: 480px;
  background: var(--panel);
}
.adv-role-custom:focus { outline: 2px solid var(--teal); outline-offset: 2px; }

/* Advocate result banner */
.adv-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  padding: 14px 20px;
  background: var(--soft-teal);
  border-radius: 8px;
  border-left: 4px solid var(--teal);
  margin-bottom: 16px;
}
.adv-banner__label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--teal-dark, var(--teal));
  flex-shrink: 0;
}
.adv-banner__role {
  font-size: 1.05rem;
  color: var(--ink);
}
.adv-banner__note {
  font-size: 0.8rem;
  color: var(--muted);
  flex-basis: 100%;
}

/* Client strengths card */
.adv-strengths {
  background: var(--soft-teal);
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--teal) 20%, transparent);
  padding: 16px 20px;
  margin-bottom: 14px;
}
.adv-strengths__head {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--teal-dark, var(--teal));
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.adv-strengths__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.adv-strengths__item {
  padding-left: 24px;
  position: relative;
  font-size: 0.88rem;
  color: var(--ink);
  line-height: 1.5;
}
.adv-strengths__item::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--teal);
  font-weight: 700;
}

/* Opposing weaknesses card */
.adv-weaknesses {
  background: color-mix(in srgb, var(--amber, #c87f00) 10%, transparent);
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--amber, #c87f00) 25%, transparent);
  padding: 16px 20px;
  margin-bottom: 14px;
}
.adv-weaknesses__head {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--amber-dark, #8a5700);
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.adv-weaknesses__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.adv-weaknesses__item {
  padding-left: 24px;
  position: relative;
  font-size: 0.88rem;
  color: var(--ink);
  line-height: 1.5;
}
.adv-weaknesses__item::before {
  content: '⚠';
  position: absolute;
  left: 0;
  font-size: 0.85em;
  color: var(--amber, #c87f00);
}

@media (max-width: 760px) {
  .adv-role-select, .adv-role-custom { max-width: 100%; }
  .adv-banner { flex-direction: column; align-items: flex-start; }
}

/* ── Branch-from-sub-question panel ──────────────────────────────────────── */
.branch-panel {
  background: #f0faf8;
  border: 1px solid var(--teal);
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 16px;
}

.branch-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.branch-panel__label {
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--teal-dark);
}

.branch-panel__origin {
  margin: 0 0 8px;
  font-size: 0.88rem;
  color: var(--ink);
  line-height: 1.45;
}

.branch-panel__prior {
  margin-bottom: 10px;
  font-size: 0.87rem;
}

.branch-panel__prior summary {
  cursor: pointer;
  color: var(--teal-dark);
  font-weight: 600;
  user-select: none;
}

.branch-panel__brief {
  margin-top: 6px;
  padding: 8px 10px;
  background: rgba(255,255,255,0.7);
  border-radius: 5px;
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.5;
  white-space: pre-wrap;
}

/* "Branch ↓" button on sub-Q cards */
.dr-branch-btn {
  align-self: start;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  background: transparent;
  border: 1px solid var(--teal);
  border-radius: 5px;
  color: var(--teal-dark);
  white-space: nowrap;
  transition: background 0.12s, color 0.12s;
}

.dr-branch-btn:hover {
  background: var(--teal);
  color: #fff;
}

/* ── Source modal: summary + chunk toggle + all-chunks ───────────────────── */
.dr-modal-summary {
  font-size: 0.93rem;
  line-height: 1.65;
  color: var(--ink);
  margin-bottom: 14px;
}

.dr-modal-summary--empty em {
  color: var(--muted);
  font-size: 0.87rem;
}

.dr-modal-chunk-toggle,
.dr-modal-all-chunks {
  display: inline-block;
  margin-bottom: 8px;
  padding: 4px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--teal-dark);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}

.dr-modal-chunk-toggle:hover,
.dr-modal-all-chunks:hover {
  background: var(--soft-teal);
  border-color: var(--teal);
}

.dr-modal-chunk-text {
  white-space: pre-wrap;
  font-size: 0.87rem;
  line-height: 1.65;
  color: var(--muted);
  background: #f8f9fb;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 12px;
}

.dr-modal-all-chunks {
  display: block;
  width: 100%;
  text-align: left;
  margin-top: 4px;
}

.dr-modal-chunks-list {
  margin-top: 4px;
}

.dr-modal-chunks-head {
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--teal-dark);
  padding: 6px 0 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}

.dr-modal-chunk-item {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.dr-modal-chunk-item:last-child { border-bottom: 0; }

.dr-modal-chunk-idx {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--coral);
  margin-bottom: 4px;
}

.dr-modal-chunk-preview {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--muted);
  white-space: pre-wrap;
}

/* ============================================================
   BVJ Analyzer — document meta, parties, timeline, red flags
   ============================================================ */

.bvj-doc-meta {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 20px;
}

.bvj-doc-meta__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.bvj-doc-meta__authority {
  font-weight: 700;
  color: var(--ink);
  font-size: 1rem;
}

.bvj-doc-type-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--soft-teal);
  color: var(--teal-dark);
  border: 1px solid #b2dbd6;
  border-radius: 20px;
  padding: 2px 10px;
}

.bvj-doc-meta__fields {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.bvj-doc-meta__field {
  font-size: 0.84rem;
  color: var(--muted);
}

.bvj-doc-meta__field strong {
  color: var(--ink);
  font-weight: 600;
}

/* --- Parties grid --- */

.bvj-parties-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.bvj-party-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
}

.bvj-party-card__name {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--ink);
  margin: 0 0 4px;
}

.bvj-party-card__org {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0 0 6px;
}

.bvj-party-card__rel {
  font-size: 0.8rem;
  font-style: italic;
  color: var(--muted);
  margin: 0 0 8px;
}

.bvj-party-role {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  border-radius: 20px;
  padding: 2px 9px;
}

.bvj-party-role--bvv {
  background: #e8f0fe;
  color: #2d5fa6;
  border: 1px solid #c3d4f8;
}

.bvj-party-role--parent {
  background: var(--soft-teal);
  color: var(--teal-dark);
  border: 1px solid #b2dbd6;
}

.bvj-party-role--child {
  background: #ecfdf5;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.bvj-party-role--third {
  background: #f3f4f6;
  color: #4b5563;
  border: 1px solid var(--line);
}

.bvj-party-role--other {
  background: #fafafa;
  color: var(--muted);
  border: 1px solid var(--line);
}

/* --- Timeline --- */

.bvj-timeline-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 20px;
}

.bvj-timeline-event {
  display: grid;
  grid-template-columns: 130px 1fr;
  border-left: 3px solid var(--line);
  border-radius: 0 6px 6px 0;
  overflow: hidden;
}

.bvj-timeline-event--high  { border-left-color: var(--coral); }
.bvj-timeline-event--medium { border-left-color: var(--amber); }
.bvj-timeline-event--low   { border-left-color: var(--line); }

.bvj-timeline-date {
  font-family: ui-monospace, "Cascadia Code", "Fira Code", monospace;
  font-size: 0.78rem;
  color: var(--muted);
  background: #f3f4f6;
  border-right: 1px solid var(--line);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 2px;
}

.bvj-timeline-time {
  font-size: 0.72rem;
  color: var(--muted);
  opacity: 0.8;
}

.bvj-timeline-body {
  background: var(--panel);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.bvj-timeline-actor {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--teal-dark);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.bvj-timeline-action {
  font-size: 0.88rem;
  color: var(--ink);
  line-height: 1.5;
}

/* --- Red flags --- */

.bvj-red-flags {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.bvj-red-flag {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
}

.bvj-red-flag--high   { border-left: 3px solid var(--coral); }
.bvj-red-flag--medium { border-left: 3px solid var(--amber); }
.bvj-red-flag--low    { border-left: 3px solid var(--line); }

.bvj-red-flag__head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}

.bvj-red-flag__desc {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ink);
  flex: 1;
  margin: 0;
}

.bvj-red-flag__legal {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--soft-teal);
  color: var(--teal-dark);
  border: 1px solid #b2dbd6;
  border-radius: 20px;
  padding: 2px 9px;
  white-space: nowrap;
  margin-top: 2px;
}

.bvj-red-flag__details {
  margin-top: 6px;
}

.bvj-red-flag__details summary {
  font-size: 0.8rem;
  color: var(--teal);
  cursor: pointer;
  user-select: none;
}

.bvj-red-flag__check {
  font-size: 0.84rem;
  font-style: italic;
  color: var(--muted);
  margin: 6px 0 0;
  line-height: 1.5;
}

/* --- Severity badges --- */

.bvj-severity {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 20px;
  padding: 2px 9px;
  white-space: nowrap;
}

.bvj-severity-high {
  background: var(--soft-coral);
  color: var(--coral);
  border: 1px solid #f9c6ae;
}

.bvj-severity-medium {
  background: #fffbeb;
  color: var(--amber);
  border: 1px solid #fde68a;
}

.bvj-severity-low {
  background: #f3f4f6;
  color: var(--muted);
  border: 1px solid var(--line);
}

/* --- BVJ result banner (role + doc type header) --- */

.bvj-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--soft-teal);
  border: 1px solid #b2dbd6;
  border-radius: 8px;
  margin-bottom: 16px;
}

.bvj-banner__label {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.bvj-banner__role {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--teal-dark);
}

/* --- [DOC] citation inline marker --- */

.dr-cite--doc {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  background: #e8f0fe;
  color: #2d5fa6;
  border: 1px solid #c3d4f8;
  border-radius: 4px;
  padding: 1px 5px;
  margin: 0 1px;
  cursor: default;
  vertical-align: baseline;
  position: relative;
  top: -1px;
}

/* v1 final cascade overrides */
body {
  background:
    linear-gradient(90deg, rgba(0, 32, 91, 0.055) 1px, transparent 1px),
    linear-gradient(180deg, rgba(186, 12, 47, 0.04), transparent 38rem),
    var(--dbn-paper);
  background-size: 44px 44px, auto, auto;
  color: var(--dbn-ink);
}

.app-shell { padding: 18px clamp(14px, 2vw, 28px) 34px; }
.topbar { align-items: flex-start; border-bottom: 2px solid rgba(22, 19, 15, 0.14); padding-bottom: 16px; }
.topbar h1 { color: var(--dbn-ink); font-size: clamp(1.8rem, 2.8vw, 3.2rem); line-height: .95; letter-spacing: 0; }
.workspace { grid-template-columns: 204px minmax(0, 1fr) 370px; }
.tool-rail, .tool-panel, .reasoning-panel, .gate-panel, .cap-card, .dashboard-tool-card {
  border-color: rgba(22, 19, 15, 0.15);
  box-shadow: 0 18px 45px rgba(22, 19, 15, 0.08);
}
.tool-tab { position: relative; min-height: 74px; overflow: hidden; }
.tool-tab em { position: absolute; right: 10px; bottom: 8px; color: rgba(0, 32, 91, .22); font-size: 1.25rem; font-style: normal; font-weight: 900; }
.tool-tab.is-active { background: #fdf8ef; border-color: rgba(186, 12, 47, .28); color: var(--dbn-ink); }
.tool-tab.is-active::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--dbn-red); }
.showcase-title { max-width: 980px; color: var(--dbn-ink); font-size: clamp(2.4rem, 6vw, 6.4rem); line-height: .9; letter-spacing: 0; }
.showcase-tagline { max-width: 780px; color: #403a33; font-size: clamp(1.05rem, 1.6vw, 1.32rem); }
.cap-grid--six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.evidence-inner { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.google-access-button { display: flex; align-items: center; justify-content: center; min-height: 48px; margin: 18px 0; border-radius: 8px; background: var(--dbn-blue); color: #fff; font-weight: 900; text-decoration: none; }
.fallback-login { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--dbn-line); }
.fallback-login summary { cursor: pointer; color: #655d53; font-weight: 800; }

@media (max-width: 1120px) {
  .workspace { grid-template-columns: 1fr; }
  .tool-rail { flex-direction: row; overflow-x: auto; }
  .tool-tab { min-width: 170px; }
  .tool-dashboard-grid, .cap-grid--six, .evidence-inner { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .topbar, .showcase-header-inner { flex-direction: column; }
  .topbar-actions, .showcase-header-actions { width: 100%; justify-content: flex-start; }
  .manifesto-stats, .tool-dashboard-grid, .cap-grid--six, .evidence-inner { grid-template-columns: 1fr; }
}

/* ── Site Footer ─────────────────────────────────────────── */
.site-footer {
  background: var(--dbn-blue);
  color: rgba(255, 255, 255, 0.82);
  margin-top: 48px;
}
.site-footer__inner {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px 48px;
  padding: 48px clamp(20px, 4vw, 80px) 32px;
  max-width: 1200px;
  margin: 0 auto;
}
.site-footer__heading {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dbn-teal);
  margin: 0 0 12px;
}
.site-footer__body {
  font-size: 0.88rem;
  line-height: 1.65;
  margin: 0 0 10px;
}
.site-footer__body a {
  color: #7dd3ca;
  text-decoration: none;
}
.site-footer__body a:hover { text-decoration: underline; }
.site-footer__sub {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.5);
  margin: 0;
}
.site-footer__links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.site-footer__links a {
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  font-size: 0.88rem;
}
.site-footer__links a:hover { color: #fff; text-decoration: underline; }
.site-footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 20px clamp(20px, 4vw, 80px) 28px;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 32px;
  align-items: flex-start;
}
.site-footer__copy {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.5);
  margin: 0;
  white-space: nowrap;
}
.site-footer__disclaimer {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.4);
  margin: 0;
  flex: 1;
  min-width: 240px;
  line-height: 1.55;
}

/* ── Workbench Attribution (slim strip on tool pages) ─────── */
.workbench-attribution {
  text-align: center;
  padding: 10px 24px 14px;
  font-size: 0.72rem;
  color: var(--muted);
  border-top: 1px solid var(--dbn-line);
  background: var(--dbn-paper);
}
.workbench-attribution a {
  color: var(--dbn-teal);
  text-decoration: none;
}
.workbench-attribution a:hover { text-decoration: underline; }

@media (max-width: 860px) {
  .site-footer__inner { grid-template-columns: 1fr; }
  .site-footer__bottom { flex-direction: column; }
}

/* ── Syttende Mai banner ──────────────────────────────────────────────────── */
.syttende-mai-banner {
  background: #ba0c2f;
  color: #fff;
  padding: 9px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  position: sticky;
  top: 0;
  z-index: 200;
}
.syttende-mai-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.75);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 4px;
  margin-left: 8px;
}
.syttende-mai-close:hover { color: #fff; }

/* ── Free-tier credit badge ──────────────────────────────────────────────── */
.credit-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--soft-teal);
  color: var(--teal-dark);
  border: 1px solid rgba(15, 118, 110, 0.25);
  white-space: nowrap;
  cursor: default;
}
.credit-badge.is-low {
  background: #fff7ed;
  color: #92400e;
  border-color: rgba(183, 121, 31, 0.3);
}
.credit-badge.is-empty {
  background: #fff0e8;
  color: #c2410c;
  border-color: rgba(194, 65, 12, 0.3);
}

/* ── Credit-empty modal ───────────────────────────────────────────────────── */
.credit-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(22, 19, 15, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
}
.credit-modal {
  background: var(--panel);
  border-radius: 12px;
  padding: 32px 28px 24px;
  max-width: 380px;
  width: calc(100% - 40px);
  box-shadow: var(--shadow);
  text-align: center;
}
.credit-modal__icon { font-size: 2.5rem; margin-bottom: 12px; }
.credit-modal h3 { margin: 0 0 8px; font-size: 1.15rem; color: var(--ink); }
.credit-modal p { color: var(--muted); font-size: 0.9rem; margin: 0 0 20px; line-height: 1.55; }
.credit-modal__actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.credit-modal__actions a {
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
}
.credit-modal__cta { background: var(--teal); color: #fff; }
.credit-modal__cta:hover { background: var(--teal-dark); }
.credit-modal__dismiss { background: var(--line); color: var(--ink); }
.credit-modal__dismiss:hover { background: #c8cdd8; }

/* ── Rate-limit toast ────────────────────────────────────────────────────── */
.credit-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #1b2330;
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.875rem;
  z-index: 500;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  animation: toastIn 0.2s ease;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Landing page rebrand — matches dobetternorge.no
   ═════════════════════════════════════════════════════════════════════════ */

:root {
  --lt-red:       #BA0C2F;
  --lt-navy:      #00205B;
  --lt-navy-dark: #001540;
  --lt-gold:      #f4c542;
}

body.lt-landing {
  background: #fff;
  font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── Sticky nav ─────────────────────────────────────────────────────────── */
.lt-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 clamp(16px, 3vw, 48px);
  background: rgba(0, 32, 91, 0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.09);
}

.lt-nav__brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.lt-nav__logo {
  height: 34px;
  width: auto;
  display: block;
}

.lt-nav__brand::after {
  content: '/';
  color: rgba(255,255,255,0.22);
  font-size: 1rem;
  font-weight: 300;
  margin: 0 4px;
  line-height: 1;
}

.lt-nav__badge {
  font-family: 'IBM Plex Sans', -apple-system, sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(244,197,66,0.55);
  padding: 0;
}

.lt-nav__right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.lt-nav .shell-lang-switcher {
  background: rgba(255,255,255,0.09);
  border-color: rgba(255,255,255,0.16);
}
.lt-nav .shell-lang-switcher a { color: rgba(255,255,255,0.72); }
.lt-nav .shell-lang-switcher a.is-active,
.lt-nav .shell-lang-switcher a:hover {
  background: rgba(255,255,255,0.17);
  color: #fff;
}

.lt-nav__cta {
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding: 0 20px;
  border-radius: 50px;
  background: var(--lt-red);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: background 140ms, transform 140ms, box-shadow 140ms;
  white-space: nowrap;
}
.lt-nav__cta:hover {
  background: #9a0a26;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(186,12,47,0.40);
}

/* ── Hero ───────────────────────────────────────────────────────────────── */
.lt-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(148deg, var(--lt-navy-dark) 0%, #00205b 58%, #180010 100%);
  padding: clamp(4rem, 9vw, 7.5rem) clamp(16px, 4vw, 60px) clamp(3.5rem, 8vw, 6.5rem);
  text-align: center;
}
.lt-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 65% at 50% 0%, rgba(186,12,47,0.22), transparent);
  pointer-events: none;
}
.lt-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(90deg, rgba(244,197,66,0.04) 1px, transparent 1px),
    linear-gradient(180deg, rgba(244,197,66,0.03) 1px, transparent 1px);
  background-size: 52px 52px;
  pointer-events: none;
}
.lt-hero__inner {
  position: relative;
  z-index: 2;
  max-width: 800px;
  margin: 0 auto;
}
.lt-hero__kicker {
  display: inline-block;
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 0.70rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--lt-gold);
  margin-bottom: 1.2rem;
  opacity: 0.88;
}
.lt-hero__title {
  font-family: 'Crimson Pro', serif;
  font-size: clamp(2.5rem, 5.5vw, 5rem);
  font-weight: 700;
  line-height: 1.04;
  color: #fff;
  margin: 0 0 1.25rem;
  text-wrap: balance;
}
.lt-hero__body {
  font-size: clamp(1rem, 1.6vw, 1.10rem);
  line-height: 1.82;
  color: rgba(255,255,255,0.74);
  margin: 0 auto 2.6rem;
  max-width: 60ch;
}
.lt-hero__stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 2.8rem;
}
.lt-hero__stat {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 22px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(4px);
  min-width: 116px;
}
.lt-hero__stat strong {
  font-family: 'Crimson Pro', serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--lt-gold);
  line-height: 1;
}
.lt-hero__stat span {
  font-size: 0.68rem;
  font-weight: 700;
  color: rgba(255,255,255,0.52);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 5px;
  text-align: center;
}
.lt-hero__cta-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 0.80rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  text-decoration: none;
  transition: color 160ms;
}
.lt-hero__cta-link:hover { color: var(--lt-gold); }

/* ── Tool cards ─────────────────────────────────────────────────────────── */
.lt-tools {
  padding: clamp(3rem, 6vw, 5.5rem) clamp(16px, 4vw, 60px);
  background: #f6f2ea;
}
.lt-tools__header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 3rem;
}
.lt-tools__eyebrow {
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 0.70rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--lt-red);
  margin-bottom: 0.7rem;
}
.lt-tools__title {
  font-family: 'Crimson Pro', serif;
  font-size: clamp(1.9rem, 3.5vw, 2.75rem);
  font-weight: 700;
  color: var(--lt-navy);
  margin: 0 0 0.75rem;
  line-height: 1.1;
}
.lt-tools__sub {
  color: #5a544d;
  font-size: 0.96rem;
  line-height: 1.75;
  margin: 0;
}

.lt-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.2rem;
  max-width: 1280px;
  margin: 0 auto;
}

.lt-card {
  background: #fff;
  border: 1px solid rgba(0,32,91,0.10);
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: transform 200ms ease-out, box-shadow 200ms ease-out, border-color 200ms;
  box-shadow: 0 4px 14px rgba(0,32,91,0.06);
}
.lt-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 18px 44px rgba(0,32,91,0.12);
  border-color: rgba(186,12,47,0.28);
}

.lt-card__art {
  width: 100%;
  height: 178px;
  display: block;
  overflow: hidden;
  flex-shrink: 0;
  line-height: 0;
}
.lt-card__art svg {
  width: 100%;
  height: 100%;
  display: block;
}

.lt-card__body {
  padding: 1.2rem 1.4rem 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.lt-card__badge {
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--lt-red);
  margin: 0 0 0.45rem;
}
.lt-card__title {
  font-family: 'Crimson Pro', serif;
  font-size: 1.48rem;
  font-weight: 700;
  color: var(--lt-navy);
  margin: 0 0 0.45rem;
  line-height: 1.1;
}
.lt-card__desc {
  font-size: 0.88rem;
  line-height: 1.70;
  color: #5a544d;
  margin: 0;
  flex: 1;
}
.lt-card__arrow {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 1rem;
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--lt-navy);
  opacity: 0.38;
  transition: opacity 150ms, gap 150ms;
}
.lt-card:hover .lt-card__arrow { opacity: 1; gap: 9px; }

@media (max-width: 900px) {
  .lt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .lt-grid { grid-template-columns: 1fr; }
  .lt-hero__stats { flex-direction: column; align-items: center; }
  .lt-nav__badge { display: none; }
}

/* ── Trust strip ────────────────────────────────────────────────────────── */
.lt-trust {
  padding: clamp(2.5rem, 5vw, 4rem) clamp(16px, 4vw, 60px);
  background: #fffaf3;
  border-top: 1px solid rgba(0,32,91,0.07);
  border-bottom: 1px solid rgba(0,32,91,0.07);
}
.lt-trust__grid {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}
.lt-trust__item {
  padding: 1.5rem 1.4rem 1.5rem 1.8rem;
  border-left: 4px solid rgba(186,12,47,0.38);
  background: rgba(255,255,255,0.65);
  border-radius: 0 10px 10px 0;
}
.lt-trust__item h3 {
  font-family: 'Crimson Pro', serif;
  font-size: 1.28rem;
  font-weight: 700;
  color: var(--lt-navy);
  margin: 0 0 0.55rem;
}
.lt-trust__item p {
  font-size: 0.88rem;
  line-height: 1.74;
  color: #5a544d;
  margin: 0;
}
@media (max-width: 760px) {
  .lt-trust__grid { grid-template-columns: 1fr; }
}

/* ── Access gate ────────────────────────────────────────────────────────── */
.lt-access {
  padding: clamp(3rem, 7vw, 5.5rem) clamp(16px, 4vw, 60px);
  background: var(--lt-navy);
  position: relative;
  overflow: hidden;
}
.lt-access::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 80% at 30% 50%, rgba(244,197,66,0.06), transparent);
  pointer-events: none;
}
.lt-access__inner {
  position: relative;
  z-index: 1;
  max-width: 520px;
  margin: 0 auto;
  text-align: center;
}
.lt-access__eyebrow {
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 0.70rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--lt-gold);
  margin-bottom: 0.8rem;
  opacity: 0.85;
}
.lt-access__title {
  font-family: 'Crimson Pro', serif;
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 700;
  color: #fff;
  margin: 0 0 0.75rem;
  line-height: 1.08;
}
.lt-access__note {
  color: rgba(255,255,255,0.60);
  font-size: 0.90rem;
  line-height: 1.72;
  margin: 0 0 1.8rem;
}
.lt-access-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 28px;
  border-radius: 10px;
  background: var(--lt-red);
  color: #fff;
  font-weight: 700;
  font-size: 0.98rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  margin: 0 0 1rem;
  transition: background 150ms, transform 150ms, box-shadow 150ms;
  box-shadow: 0 6px 24px rgba(186,12,47,0.35);
}
.lt-access-btn:hover {
  background: #9a0a26;
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(186,12,47,0.50);
}
.lt-access .gate-copy {
  color: rgba(255,255,255,0.45);
  font-size: 0.84rem;
  margin: 0.4rem 0;
}
.lt-access .gate-copy a {
  color: rgba(244,197,66,0.78);
  text-decoration: underline;
  text-decoration-color: rgba(244,197,66,0.30);
}
.lt-access .fallback-login summary {
  color: rgba(255,255,255,0.42);
  cursor: pointer;
  font-size: 0.84rem;
  margin-top: 0.6rem;
  text-align: center;
  list-style: none;
}
.lt-access .passcode-form {
  margin-top: 1.1rem;
  text-align: left;
}
.lt-access .passcode-form label {
  display: block;
  color: rgba(255,255,255,0.60);
  font-size: 0.84rem;
  margin-bottom: 4px;
}
.lt-access .passcode-form input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 8px;
  background: rgba(255,255,255,0.07);
  color: #fff;
  font-size: 0.95rem;
  margin-bottom: 10px;
  outline: none;
  transition: border-color 150ms;
}
.lt-access .passcode-form input:focus { border-color: rgba(244,197,66,0.50); }
.lt-access .passcode-row { display: flex; gap: 8px; }
.lt-access .passcode-row input { flex: 1; margin-bottom: 0; }
.lt-access .passcode-row button {
  padding: 0 18px;
  background: var(--lt-gold);
  color: var(--lt-navy);
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.90rem;
  cursor: pointer;
  transition: background 140ms;
}
.lt-access .passcode-row button:hover { background: #e2b230; }
.lt-access .form-status { color: rgba(255,255,255,0.55); font-size: 0.82rem; margin-top: 8px; }

/* ── Footer ─────────────────────────────────────────────────────────────── */
.lt-footer {
  background: var(--lt-navy);
  border-top: 1px solid rgba(255,255,255,0.07);
  padding: clamp(2rem, 4vw, 3rem) clamp(16px, 4vw, 60px) 1.5rem;
  color: rgba(255,255,255,0.55);
  font-family: 'IBM Plex Sans', -apple-system, sans-serif;
}
.lt-footer__inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4rem;
  align-items: start;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  margin-bottom: 1.25rem;
}
.lt-footer__logo {
  height: 28px;
  width: auto;
  opacity: 0.82;
  display: block;
  margin-bottom: 1rem;
}
.lt-footer__tagline {
  font-size: 0.87rem;
  line-height: 1.65;
  margin: 0 0 0.55rem;
  max-width: 42ch;
  color: rgba(255,255,255,0.58);
}
.lt-footer__tagline a { color: rgba(244,197,66,0.72); text-decoration: none; }
.lt-footer__tagline a:hover { color: var(--lt-gold); }
.lt-footer__privacy-note {
  font-size: 0.78rem;
  line-height: 1.6;
  color: rgba(255,255,255,0.3);
  max-width: 42ch;
  margin: 0;
}
.lt-footer__links {
  display: flex;
  gap: 2.5rem;
  align-items: flex-start;
  padding-top: 0.2rem;
}
.lt-footer__link-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.lt-footer__link-col a {
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  font-size: 0.84rem;
  transition: color 130ms;
  white-space: nowrap;
}
.lt-footer__link-col a:hover { color: var(--lt-gold); }
.lt-footer__bottom {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  align-items: flex-start;
}
.lt-footer__copy {
  font-size: 0.77rem;
  color: rgba(255,255,255,0.26);
  margin: 0;
}
.lt-footer__disclaimer {
  font-size: 0.74rem;
  color: rgba(255,255,255,0.2);
  line-height: 1.55;
  max-width: 56ch;
  margin: 0;
}
@media (max-width: 620px) {
  .lt-footer__inner { grid-template-columns: 1fr; gap: 2rem; }
  .lt-footer__links { flex-direction: column; gap: 1.25rem; }
  .lt-footer__bottom { flex-direction: column; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   TOOL PREVIEW PAGES  (preview.php)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.lt-preview-hero {
  background: linear-gradient(148deg, var(--lt-navy-dark) 0%, #00205b 60%, #160010 100%);
  padding: clamp(2rem, 5vw, 4rem) clamp(16px, 4vw, 60px);
  position: relative;
  overflow: hidden;
}
.lt-preview-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 55% 60% at 80% 50%, rgba(186,12,47,0.13), transparent);
  pointer-events: none;
}
.lt-preview-hero__inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: clamp(2rem, 4vw, 4rem);
  align-items: center;
}
.lt-preview-hero__art {
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0,0,0,0.36);
  flex-shrink: 0;
}
.lt-preview-hero__art svg {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 480 / 300;
}
.lt-preview-back {
  display: inline-block;
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.48);
  text-decoration: none;
  letter-spacing: 0.04em;
  margin-bottom: 1rem;
  transition: color 180ms;
}
.lt-preview-back:hover { color: rgba(255,255,255,0.82); }
.lt-preview-badge {
  display: inline-block;
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--lt-gold);
  background: rgba(244,197,66,0.11);
  border: 1px solid rgba(244,197,66,0.28);
  padding: 3px 10px;
  border-radius: 4px;
  margin-bottom: 0.75rem;
}
.lt-preview-title {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  color: #fff;
  margin: 0 0 0.5rem;
  line-height: 1.08;
}
.lt-preview-sub {
  font-size: 1.0rem;
  color: rgba(255,255,255,0.60);
  margin: 0 0 0.9rem;
  line-height: 1.55;
}
.lt-preview-pitch {
  font-size: 1.08rem;
  color: rgba(255,255,255,0.84);
  line-height: 1.68;
  margin: 0;
}

/* ── Features ─────────────────────────────────────────────────────────────── */
.lt-preview-features {
  background: #fff;
  padding: clamp(2.5rem, 5vw, 4rem) clamp(16px, 4vw, 60px);
  border-bottom: 1px solid rgba(0,32,91,0.07);
}
.lt-preview-features__inner {
  max-width: 1100px;
  margin: 0 auto;
}
.lt-preview-features__heading {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--lt-navy);
  margin: 0 0 1.5rem;
}
.lt-preview-features__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 2.5rem;
}
.lt-preview-features__item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 1.0rem;
  color: #2a2f3d;
  line-height: 1.5;
}
.lt-preview-features__dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--lt-red);
  margin-top: 0.42em;
}

/* ── Sample ───────────────────────────────────────────────────────────────── */
.lt-preview-sample {
  background: #f6f2ea;
  padding: clamp(2.5rem, 5vw, 4rem) clamp(16px, 4vw, 60px);
}
.lt-preview-sample__inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: clamp(1.5rem, 3vw, 3rem);
  align-items: start;
}
.lt-preview-sample__label {
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--lt-navy);
  opacity: 0.55;
  margin: 0 0 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.lt-preview-sample__label--out {
  color: var(--lt-red);
  opacity: 0.75;
}
.lt-preview-sample__icon {
  font-style: normal;
}
.lt-preview-sample__input {
  background: #fff;
  border: 1px solid rgba(0,32,91,0.10);
  border-radius: 10px;
  padding: 1.25rem 1.4rem;
  font-size: 0.97rem;
  color: #2a2f3d;
  line-height: 1.62;
  box-shadow: 0 2px 8px rgba(0,32,91,0.04);
}
.lt-preview-sample__input p { margin: 0; }
.lt-preview-sample__output {
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(0,0,0,0.22);
}
.lt-preview-output {
  background: #001540;
  padding: 1.4rem 1.6rem;
}
.lt-preview-output pre {
  margin: 0;
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 0.80rem;
  line-height: 1.78;
  color: rgba(255,255,255,0.85);
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── CTA ──────────────────────────────────────────────────────────────────── */
.lt-preview-cta {
  background: var(--lt-navy);
  padding: clamp(3rem, 6vw, 5rem) clamp(16px, 4vw, 60px);
  position: relative;
  overflow: hidden;
}
.lt-preview-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 50% 70% at 50% 0%, rgba(244,197,66,0.07), transparent);
  pointer-events: none;
}
.lt-preview-cta__inner {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
  position: relative;
}
.lt-preview-cta__eyebrow {
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 0.70rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--lt-gold);
  opacity: 0.72;
  margin: 0 0 0.6rem;
}
.lt-preview-cta__title {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  font-weight: 700;
  color: #fff;
  margin: 0 0 0.75rem;
  line-height: 1.1;
}
.lt-preview-cta__note {
  font-size: 0.97rem;
  color: rgba(255,255,255,0.56);
  margin: 0 0 2rem;
  line-height: 1.6;
}
.lt-preview-cta__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 700;
  font-size: 1.0rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: #fff;
  background: var(--lt-red);
  padding: 0.8rem 2rem;
  border-radius: 8px;
  transition: background 160ms, transform 160ms;
}
.lt-preview-cta__btn:hover {
  background: #9a0a26;
  transform: translateY(-2px);
}
.lt-preview-cta__register {
  margin: 1.1rem 0 0;
  font-size: 0.88rem;
  color: rgba(255,255,255,0.40);
}
.lt-preview-cta__register a {
  color: rgba(244,197,66,0.72);
  text-decoration: none;
}
.lt-preview-cta__register a:hover { color: var(--lt-gold); }
.lt-preview-cta__tools {
  max-width: 860px;
  margin: 3rem auto 0;
  text-align: center;
  position: relative;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 2rem;
}
.lt-preview-cta__tools-label {
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.28);
  margin: 0 0 1rem;
}
.lt-preview-cta__tool-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 0.75rem;
}
.lt-preview-cta__tool-link {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(255,255,255,0.48);
  text-decoration: none;
  padding: 0.3rem 0.85rem;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 20px;
  transition: color 160ms, border-color 160ms;
}
.lt-preview-cta__tool-link:hover {
  color: rgba(255,255,255,0.88);
  border-color: rgba(255,255,255,0.32);
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .lt-preview-hero__inner { grid-template-columns: 1fr; }
  .lt-preview-hero__art { max-width: 420px; }
  .lt-preview-sample__inner { grid-template-columns: 1fr; }
  .lt-preview-features__list { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .lt-preview-hero__art { max-width: 100%; }
  .lt-preview-output pre { font-size: 0.72rem; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   AUTH-AWARE LANDING PAGE
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Nav: logged-in state ───────────────────────────────────────────────── */
.lt-auth-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}
.lt-auth-nav__email {
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.55);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lt-nav__cta--enter {
  background: #00205b;
  border: 1px solid rgba(255,255,255,0.20);
}
.lt-nav__cta--enter:hover {
  background: #0a3080;
  box-shadow: 0 6px 18px rgba(0,32,91,0.50);
}

/* ── Hero: logged-in CTA ─────────────────────────────────────────────────── */
.lt-hero__auth-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 0.5rem;
}
.lt-hero__auth-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0,212,128,0.18);
  border: 1.5px solid rgba(0,212,128,0.45);
  color: #00d480;
  font-size: 1rem;
  font-weight: 700;
  flex-shrink: 0;
}
.lt-hero__auth-label {
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.04em;
}
.lt-hero__enter-btn {
  display: inline-flex;
  align-items: center;
  height: 54px;
  padding: 0 36px;
  border-radius: 10px;
  background: var(--lt-red);
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  margin-top: 0.5rem;
  transition: background 150ms, transform 150ms, box-shadow 150ms;
  box-shadow: 0 6px 24px rgba(186,12,47,0.40);
}
.lt-hero__enter-btn:hover {
  background: #9a0a26;
  transform: translateY(-2px);
  box-shadow: 0 12px 36px rgba(186,12,47,0.55);
}

/* ── Tools section: enter strip for logged-in users ─────────────────────── */
.lt-tools__enter-strip {
  display: flex;
  justify-content: center;
  margin-top: 2.5rem;
}
.lt-tools__enter-strip .lt-access-btn {
  max-width: 320px;
  width: 100%;
}

/* ── Access gate: two-column layout ─────────────────────────────────────── */
.lt-gate.lt-access {
  padding: 0;
  overflow: visible;
}
.lt-gate.lt-access::before { display: none; }
.lt-gate__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 420px;
}
.lt-gate__card {
  position: relative;
  padding: clamp(2.5rem, 5vw, 4rem) clamp(1.5rem, 4vw, 3.5rem);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
}
.lt-gate__card--member {
  background: var(--lt-navy);
}
.lt-gate__card--member::after {
  content: '';
  position: absolute;
  top: 10%;
  right: 0;
  bottom: 10%;
  width: 1px;
  background: rgba(255,255,255,0.10);
}
.lt-gate__card--register {
  background: linear-gradient(145deg, #00205b 0%, #001540 100%);
}
.lt-gate__card-eyebrow {
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--lt-gold);
  margin: 0 0 0.9rem;
  opacity: 0.80;
}
.lt-gate__card-title {
  font-family: 'Crimson Pro', serif;
  font-size: clamp(1.6rem, 2.8vw, 2.2rem);
  font-weight: 700;
  color: #fff;
  margin: 0 0 0.65rem;
  line-height: 1.1;
}
.lt-gate__card-note {
  color: rgba(255,255,255,0.55);
  font-size: 0.90rem;
  line-height: 1.72;
  margin: 0 0 1.8rem;
  max-width: 38ch;
}
/* inherit fallback-login styles inside cards */
.lt-gate__card .fallback-login summary {
  color: rgba(255,255,255,0.42);
  cursor: pointer;
  font-size: 0.84rem;
  margin-top: 0.6rem;
  list-style: none;
}
.lt-gate__card .passcode-form {
  margin-top: 1rem;
  text-align: left;
  width: 100%;
}
.lt-gate__card .passcode-form label {
  display: block;
  color: rgba(255,255,255,0.60);
  font-size: 0.84rem;
  margin-bottom: 4px;
}
.lt-gate__card .passcode-form input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 8px;
  background: rgba(255,255,255,0.07);
  color: #fff;
  font-size: 0.95rem;
  margin-bottom: 10px;
  outline: none;
  transition: border-color 150ms;
}
.lt-gate__card .passcode-form input:focus { border-color: rgba(244,197,66,0.50); }
.lt-gate__card .passcode-row { display: flex; gap: 8px; }
.lt-gate__card .passcode-row input { flex: 1; margin-bottom: 0; }
.lt-gate__card .passcode-row button {
  padding: 0 18px;
  background: var(--lt-gold);
  color: var(--lt-navy);
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.90rem;
  cursor: pointer;
  transition: background 140ms;
}
.lt-gate__card .passcode-row button:hover { background: #e2b230; }
.lt-gate__card .form-status { color: rgba(255,255,255,0.55); font-size: 0.82rem; margin-top: 8px; }
.lt-gate__card .lt-access-btn { width: 100%; box-sizing: border-box; }

/* ── Register buttons ────────────────────────────────────────────────────── */
.lt-register-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
  min-height: 50px;
  padding: 0 22px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.96rem;
  text-decoration: none;
  transition: background 150ms, transform 140ms, box-shadow 140ms;
  margin-bottom: 0.75rem;
}
.lt-register-btn--google {
  background: #fff;
  color: #3c3c3c;
  border: none;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}
.lt-register-btn--google:hover {
  background: #f1f1f1;
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(0,0,0,0.32);
}
.lt-register-btn--email {
  background: transparent;
  color: rgba(255,255,255,0.68);
  border: 1px solid rgba(255,255,255,0.20);
  margin-bottom: 0;
}
.lt-register-btn--email:hover {
  background: rgba(255,255,255,0.07);
  color: #fff;
  border-color: rgba(255,255,255,0.40);
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 760px) {
  .lt-gate__grid { grid-template-columns: 1fr; }
  .lt-gate__card--member::after { display: none; }
  .lt-gate__card--member {
    border-bottom: 1px solid rgba(255,255,255,0.10);
  }
  .lt-auth-nav__email { display: none; }
  .lt-hero__auth-cta { gap: 8px; }
}

/* ── Transcription UX improvements ──────────────────────────────────────── */

/* Vocab footer: hint + char counter side by side */
.vocab-footer {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.25rem;
}
.vocab-char-count { margin: 0; white-space: nowrap; }
.vocab-char-count--warn { color: #b45309; font-weight: 600; }

/* Progress bar shown while transcribing */
.transcribe-progress-wrap {
  padding: 2.5rem 1.5rem;
  text-align: center;
}
.transcribe-progress-track {
  height: 6px;
  background: var(--line);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}
.transcribe-progress-fill {
  height: 100%;
  background: var(--teal);
  border-radius: 3px;
  transition: width 0.4s ease;
}
.transcribe-progress-fill.is-indeterminate {
  width: 40%;
  animation: progress-slide 1.4s ease-in-out infinite;
}
@keyframes progress-slide {
  0%   { transform: translateX(-150%); }
  100% { transform: translateX(400%); }
}
.transcribe-progress-label {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
}

/* Transcript meta stats row */
.transcript-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}
.transcript-meta-row span {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

/* AI cleanup badge */
.cleanup-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: 0.6rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: #166534;
  background: #dcfce7;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  vertical-align: middle;
}

/* Action row above transcript (copy + download txt) */
.transcript-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

/* Segment legend (speaker role key inside the segments panel) */
.segment-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.45rem 0.75rem;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

/* === Advocate UX additions 2026-05-18 === */
.adv-input-footer { display:flex; justify-content:flex-end; margin-top:4px; }
.adv-char-count { font-size:.78rem; color:var(--muted); }
.adv-char-count.is-warn { color:var(--amber); }
.adv-char-count.is-crit { color:var(--coral); font-weight:600; }
.dr-section-head { display:flex; align-items:baseline; gap:12px; margin-bottom:10px; }
.dr-section-head h3 { margin:0; font-size:1rem; }
.dr-copy-btn { font-size:.78rem; padding:2px 10px; border:1px solid var(--line); border-radius:4px; background:var(--panel); color:var(--teal); cursor:pointer; }
.dr-copy-btn:hover { background:var(--soft-teal); }
.adv-result-actions { display:flex; justify-content:flex-end; margin-bottom:16px; }
.adv-new-query-btn { font-size:.82rem; padding:4px 14px; border:1px solid var(--teal); border-radius:4px; background:var(--soft-teal); color:var(--teal-dark); cursor:pointer; }
.adv-restore-banner { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px 14px; border-radius:6px; background:var(--soft-teal); border:1px solid var(--teal); margin-bottom:12px; font-size:.85rem; flex-wrap:wrap; }
.adv-restore-banner__text em { font-style:normal; color:var(--muted); }
.adv-restore-banner__actions { display:flex; gap:8px; }
.adv-restore-banner__actions button { font-size:.82rem; padding:3px 12px; border-radius:4px; cursor:pointer; }
.adv-restore-banner__actions button:first-child { background:var(--teal); color:#fff; border:none; }
.adv-restore-banner__actions button:last-child { background:transparent; border:1px solid var(--line); color:var(--muted); }
.dr-collapsible > summary { list-style:none; cursor:pointer; display:flex; align-items:baseline; gap:12px; padding:8px 0; }
.dr-collapsible > summary::-webkit-details-marker { display:none; }
.dr-collapsible > summary h3 { margin:0; font-size:.95rem; }
.dr-collapsible > summary::before { content:'▸'; font-size:.7rem; color:var(--muted); margin-right:4px; }
.dr-collapsible[open] > summary::before { content:'▾'; }
.adv-slice-hint { margin:8px 0 0; font-size:.83rem; color:var(--ink); background:var(--soft-teal); border:1px solid var(--teal); border-radius:6px; padding:8px 12px; display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.adv-slice-hint button { font-size:.8rem; padding:2px 10px; border-radius:4px; cursor:pointer; }
#advSliceHintEnable { background:var(--teal); color:#fff; border:none; }
#advSliceHintDismiss { background:transparent; border:1px solid var(--line); color:var(--muted); }

/* === Advocate UX additions — F1/F3/F5/F6/F7 === */
/* Brief action buttons */
.adv-brief-actions { display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.adv-result-actions { display:flex; align-items:center; gap:8px; justify-content:flex-end; margin-bottom:16px; }

/* Strength branch button */
.adv-strengths__item { display:flex; align-items:flex-start; gap:6px; }
.dr-strength-branch-btn { flex-shrink:0; font-size:.75rem; padding:1px 6px; border:1px solid var(--line); border-radius:3px; background:var(--bg); color:var(--teal); cursor:pointer; margin-top:1px; }
.dr-strength-branch-btn:hover { background:var(--soft-teal); }

/* Flip-brief bar */
.adv-flip-bar { display:flex; align-items:center; gap:10px; padding:8px 14px; margin-bottom:12px; background:var(--bg); border:1px solid var(--line); border-radius:6px; font-size:.85rem; flex-wrap:wrap; }
.adv-flip-bar__label { color:var(--muted); }
.adv-flip-bar__role { font-weight:600; color:var(--ink); }
.adv-flip-btn { margin-left:auto; font-size:.82rem; padding:3px 12px; border:1px solid var(--teal); border-radius:4px; background:var(--soft-teal); color:var(--teal-dark); cursor:pointer; }
.adv-flip-btn:hover { background:var(--teal); color:#fff; }

/* Sub-Q preview panel */
.adv-subq-preview { background:var(--bg); border:1px solid var(--line); border-radius:8px; padding:16px; margin:12px 0; }
.adv-subq-preview__head { margin:0 0 4px; font-size:.95rem; }
.adv-subq-preview-item { margin-bottom:14px; }
.adv-subq-preview-label { display:block; font-size:.8rem; font-weight:600; color:var(--muted); text-transform:uppercase; letter-spacing:.04em; margin-bottom:4px; }
.adv-subq-edit { width:100%; font-size:.88rem; padding:8px 10px; border:1px solid var(--line); border-radius:5px; background:var(--panel); color:var(--ink); resize:vertical; font-family:inherit; box-sizing:border-box; }
.adv-subq-edit:focus { outline:2px solid var(--teal); border-color:var(--teal); }
.adv-subq-rationale { font-size:.8rem; color:var(--muted); margin:3px 0 0; font-style:italic; }
.adv-subq-preview__actions { display:flex; gap:10px; margin-top:12px; flex-wrap:wrap; }
.adv-subq-preview__actions button { font-size:.85rem; padding:5px 16px; border-radius:5px; cursor:pointer; }
#advRunWithAngles { background:var(--teal); color:#fff; border:none; }
#advRunWithAngles:hover { background:var(--teal-dark); }
.adv-discard-btn { background:transparent; border:1px solid var(--line); color:var(--muted); }

/* Form footer with two buttons */
.form-footer__btns { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.adv-preview-btn { font-size:.82rem; padding:5px 14px; border:1px solid var(--line); border-radius:5px; background:var(--bg); color:var(--muted); cursor:pointer; }
.adv-preview-btn:hover { border-color:var(--teal); color:var(--teal); background:var(--soft-teal); }

/* Case Workbench - additive page */
.workbench-shell {
  max-width: 1480px;
}

.workbench-dashboard-link {
  text-decoration: none;
}

.workbench-entry-art {
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(0, 32, 91, 0.96), rgba(15, 118, 110, 0.86)),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.12) 0 1px, transparent 1px 28px);
  color: #fff;
  line-height: 1;
}

.workbench-entry-art span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 84px;
  height: 84px;
  border: 2px solid rgba(255,255,255,0.55);
  border-radius: 50%;
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  background: rgba(255,255,255,0.10);
}

.workbench-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.7fr);
  gap: 18px;
  align-items: stretch;
  margin: 22px 0 18px;
}

.workbench-hero__copy,
.workbench-hero__panel,
.workbench-panel {
  border: 1px solid var(--dbn-line);
  background: rgba(255,255,255,0.72);
  box-shadow: 0 18px 45px rgba(25, 35, 52, 0.08);
}

.workbench-hero__copy {
  padding: clamp(24px, 4vw, 44px);
}

.workbench-hero__copy h2 {
  max-width: 860px;
  margin: 0;
  color: var(--dbn-ink);
  font-family: 'Crimson Pro', serif;
  font-size: clamp(2rem, 4vw, 4.4rem);
  line-height: 0.94;
  letter-spacing: 0;
}

.workbench-hero__copy p:last-child {
  max-width: 760px;
  margin: 16px 0 0;
  color: rgba(22, 19, 15, 0.74);
  font-size: 1rem;
  line-height: 1.7;
}

.workbench-kicker {
  margin: 0 0 10px;
  color: var(--dbn-red);
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.workbench-hero__panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  border-left: 5px solid var(--dbn-teal);
}

.workbench-hero__panel strong {
  color: var(--dbn-blue);
  font-size: 1.05rem;
}

.workbench-hero__panel p {
  margin: 0;
  color: rgba(22, 19, 15, 0.70);
  line-height: 1.6;
}

.workbench-clear,
.workbench-tool-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 0;
  border-radius: 999px;
  padding: 0 16px;
  background: var(--dbn-blue);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.workbench-clear {
  align-self: flex-start;
  background: var(--dbn-red);
}

.workbench-status {
  min-height: 20px;
  color: var(--dbn-teal);
  font-size: 0.86rem;
  font-weight: 700;
}

.workbench-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 18px;
  margin-top: 18px;
}

.workbench-panel {
  padding: clamp(18px, 2.4vw, 28px);
}

.workbench-panel--flow,
.workbench-panel--outputs,
.workbench-panel--docs {
  grid-column: 1 / -1;
}

.workbench-docs__desc {
  font-size: 0.875rem;
  color: var(--dbn-text-2, #555);
  margin-bottom: 16px;
}

.workbench-docs__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  min-height: 40px;
}

.workbench-docs__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--dbn-line, #e0ddd8);
  background: rgba(255,255,255,0.9);
  font-size: 0.875rem;
}

.workbench-docs__icon { flex-shrink: 0; font-size: 1rem; }

.workbench-docs__name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.workbench-docs__meta {
  font-size: 0.75rem;
  color: var(--dbn-text-2, #888);
  white-space: nowrap;
  flex-shrink: 0;
}

.workbench-docs__remove {
  flex-shrink: 0;
  background: none;
  border: 1px solid var(--dbn-line, #e0ddd8);
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 0.75rem;
  cursor: pointer;
  color: var(--dbn-text-2, #777);
  transition: background 0.15s, color 0.15s;
}

.workbench-docs__remove:hover {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fca5a5;
}

.workbench-docs__empty,
.workbench-docs__loading {
  font-size: 0.875rem;
  color: var(--dbn-text-2, #888);
  font-style: italic;
}

.workbench-docs__cta {
  display: inline-block;
  font-size: 0.875rem;
}

.workbench-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  border-bottom: 1px solid rgba(22, 19, 15, 0.12);
  padding-bottom: 12px;
}

.workbench-section-head h2 {
  margin: 0;
  color: var(--dbn-ink);
  font-family: 'Crimson Pro', serif;
  font-size: clamp(1.45rem, 2vw, 2.1rem);
  letter-spacing: 0;
}

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

.workbench-field {
  display: grid;
  gap: 7px;
  color: var(--dbn-ink);
  font-weight: 800;
}

.workbench-field--wide {
  margin-top: 14px;
}

.workbench-field span {
  font-size: 0.86rem;
}

.workbench-field input,
.workbench-field select,
.workbench-field textarea {
  width: 100%;
  border: 1px solid rgba(22, 19, 15, 0.18);
  border-radius: 8px;
  background: #fff;
  color: var(--dbn-ink);
  font: inherit;
  font-weight: 500;
  padding: 12px 13px;
}

.workbench-field textarea {
  min-height: 112px;
  resize: vertical;
  line-height: 1.5;
}

.workbench-field input:focus,
.workbench-field select:focus,
.workbench-field textarea:focus,
.workbench-clear:focus,
.workbench-tool-link:focus,
.workbench-check input:focus {
  outline: 3px solid rgba(15, 118, 110, 0.26);
  outline-offset: 2px;
}

.workbench-evidence-list {
  display: grid;
  gap: 14px;
}

.workbench-flow {
  display: grid;
  grid-template-columns: repeat(7, minmax(160px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.workbench-step {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 276px;
  border: 1px solid rgba(0, 32, 91, 0.14);
  background: #fff;
  padding: 16px;
}

.workbench-step__index {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--dbn-blue);
  color: #fff;
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  font-weight: 900;
}

.workbench-step__body {
  padding: 16px 0;
}

.workbench-step__body p,
.workbench-step__body span {
  margin: 0;
  color: rgba(22, 19, 15, 0.66);
  font-size: 0.86rem;
  line-height: 1.5;
}

.workbench-step__body h3 {
  margin: 6px 0 10px;
  color: var(--dbn-ink);
  font-size: 1.08rem;
  line-height: 1.2;
  letter-spacing: 0;
}

.workbench-tool-link {
  min-height: 38px;
  font-size: 0.84rem;
}

.workbench-checklist {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.workbench-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 72px;
  border: 1px solid rgba(0, 32, 91, 0.14);
  background: #fff;
  padding: 14px;
  color: var(--dbn-ink);
  font-weight: 800;
  line-height: 1.35;
}

.workbench-check input {
  width: 20px;
  height: 20px;
  margin-top: 1px;
  accent-color: var(--dbn-teal);
  flex: 0 0 auto;
}

@media (max-width: 1080px) {
  .workbench-hero,
  .workbench-grid,
  .workbench-checklist {
    grid-template-columns: 1fr;
  }

  .workbench-flow {
    grid-template-columns: repeat(7, minmax(220px, 1fr));
  }
}

@media (max-width: 640px) {
  .workbench-form-grid {
    grid-template-columns: 1fr;
  }

  .workbench-section-head {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* ─── Discrepancy Finder (dc-*) ──────────────────────────────────────────── */

/* Two upload zones side by side */
.dc-upload-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.dc-upload-slot {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dc-slot-hint {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.86em;
}

.dc-zone input[type="file"] {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

/* Progressive doc meta cards */
.dc-doc-meta-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.dc-doc-meta-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
}

.dc-doc-meta-card__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.dc-slot-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  background: #f3f4f6;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2px 7px;
}

.dc-slot-label--a { background: #e8f0fe; color: #2d5fa6; border-color: #c3d4f8; }
.dc-slot-label--b { background: var(--soft-coral); color: var(--coral); border-color: #f9c6ae; }

/* Parties preview (stream-time) */
.dc-parties-preview {
  margin-bottom: 10px;
}

.dc-parties-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.dc-party-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--soft-teal);
  color: var(--teal-dark);
  border: 1px solid #b2dbd6;
  border-radius: 999px;
  padding: 3px 10px;
}

.dc-party-chip--more {
  background: #f3f4f6;
  color: var(--muted);
  border-color: var(--line);
}

.dc-parties-count {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 4px 0 0;
}

/* Timeline preview (stream-time) */
.dc-timeline-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 6px;
  padding: 6px 10px;
  background: #f7f8fb;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.dc-timeline-preview strong {
  color: var(--ink);
}

/* ── Tabs ─────────────────────────────────────────────────────────────────── */

.dc-tabs {
  display: grid;
  gap: 0;
}

.dc-tab-bar {
  display: flex;
  gap: 2px;
  border-bottom: 2px solid var(--line);
  margin-bottom: 16px;
  overflow-x: auto;
}

.dc-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--muted);
  border: none;
  background: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: color 100ms ease, border-color 100ms ease;
}

.dc-tab:hover { color: var(--ink); }

.dc-tab.is-active {
  color: var(--teal-dark);
  border-bottom-color: var(--teal);
}

.dc-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  background: var(--line);
  color: var(--muted);
}

.dc-tab.is-active .dc-tab-count {
  background: var(--soft-teal);
  color: var(--teal-dark);
}

.dc-tab-panel { display: none; }
.dc-tab-panel.is-active { display: block; }

/* ── Headline finding ─────────────────────────────────────────────────────── */

.dc-headline {
  border-left: 4px solid var(--coral);
  background: var(--soft-coral);
  border-radius: 0 8px 8px 0;
  padding: 14px 16px;
  margin-bottom: 16px;
}

.dc-headline__label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--coral);
  margin-bottom: 6px;
}

.dc-headline__text {
  font-size: 1.0rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.5;
  margin: 0;
}

/* ── Discrepancy list (Summary tab) ──────────────────────────────────────── */

.dc-discrepancies {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dc-discrepancy {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
}

.dc-discrepancy--contradiction { border-left: 3px solid var(--coral); }
.dc-discrepancy--deletion      { border-left: 3px solid var(--amber); }
.dc-discrepancy--addition      { border-left: 3px solid var(--teal); }
.dc-discrepancy--date_shift    { border-left: 3px solid #8b5cf6; }
.dc-discrepancy--changed       { border-left: 3px solid var(--amber); }

.dc-discrepancy__head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.dc-cat-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 4px;
  padding: 2px 7px;
  white-space: nowrap;
}

.dc-cat-tag--contradiction { background: var(--soft-coral); color: var(--coral); }
.dc-cat-tag--deletion      { background: #fffbeb; color: var(--amber); }
.dc-cat-tag--addition      { background: var(--soft-teal); color: var(--teal-dark); }
.dc-cat-tag--date_shift    { background: #ede9fe; color: #6d28d9; }
.dc-cat-tag--changed       { background: #fffbeb; color: var(--amber); }

.dc-severity {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 2px 9px;
  white-space: nowrap;
}

.dc-sev--high   { background: var(--soft-coral); color: var(--coral); border: 1px solid #f9c6ae; }
.dc-sev--medium { background: #fffbeb; color: var(--amber); border: 1px solid #fde68a; }
.dc-sev--low    { background: #f3f4f6; color: var(--muted); border: 1px solid var(--line); }

.dc-discrepancy__compare {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: start;
  margin-bottom: 10px;
}

.dc-compare-col {
  background: #f7f8fb;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--ink);
}

.dc-compare-col--a {
  background: #f0f5ff;
  border-color: #c3d4f8;
}

.dc-compare-col--b {
  background: #fff5f0;
  border-color: #f9c6ae;
}

.dc-compare-col__label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 5px;
}

.dc-compare-col--a .dc-compare-col__label { color: #2d5fa6; }
.dc-compare-col--b .dc-compare-col__label { color: var(--coral); }

.dc-compare-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--muted);
  padding-top: 28px;
}

.dc-discrepancy__legal {
  font-size: 0.82rem;
  color: var(--muted);
  font-style: italic;
  line-height: 1.5;
  border-top: 1px solid var(--line);
  padding-top: 8px;
  margin-top: 4px;
}

.dc-sig-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 8px;
  margin-bottom: 6px;
}

.dc-sig--high   { background: var(--soft-coral); color: var(--coral); }
.dc-sig--medium { background: #fffbeb; color: var(--amber); }
.dc-sig--low    { background: #f3f4f6; color: var(--muted); }

/* ── Parties tab ─────────────────────────────────────────────────────────── */

.dc-party-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dc-party-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  border-left: 3px solid var(--line);
}

.dc-party-row--removed { border-left-color: var(--coral); background: #fff5f0; }
.dc-party-row--added   { border-left-color: var(--teal);  background: #f0faf8; }
.dc-party-row--changed { border-left-color: var(--amber); background: #fffdf0; }

.dc-party-row__name {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--ink);
}

.dc-party-row__role {
  font-size: 0.82rem;
  color: var(--muted);
}

.dc-party-row__sig {
  font-size: 0.78rem;
  color: var(--muted);
  font-style: italic;
  line-height: 1.4;
  grid-column: 1 / -1;
  padding-top: 4px;
  border-top: 1px solid var(--line);
  margin-top: 4px;
}

/* ── Timeline tab ────────────────────────────────────────────────────────── */

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

.dc-tl-item {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  border-left: 3px solid var(--line);
}

.dc-tl-item--conflict  { border-left-color: var(--coral); }
.dc-tl-item--deleted   { border-left-color: var(--amber); }
.dc-tl-item--added     { border-left-color: var(--teal); }
.dc-tl-item--date_shift { border-left-color: #8b5cf6; }

.dc-tl-item__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.dc-tl-date {
  font-family: ui-monospace, "Cascadia Code", "Fira Code", monospace;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  background: #f3f4f6;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2px 7px;
}

.dc-tl-actor {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--teal-dark);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dc-tl-desc {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

.dc-tl-legal {
  font-size: 0.8rem;
  color: var(--muted);
  font-style: italic;
  line-height: 1.4;
  border-top: 1px solid var(--line);
  padding-top: 7px;
}

/* ── Narrative blocks ─────────────────────────────────────────────────────── */

.dc-narrative-block {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  border-left: 3px solid var(--line);
  margin-bottom: 8px;
}

.dc-narrative-block--added   { border-left-color: var(--teal); background: #f0faf8; }
.dc-narrative-block--removed { border-left-color: var(--coral); background: #fff5f0; }

/* ── Action list ─────────────────────────────────────────────────────────── */

.dc-action-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.dc-action-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--ink);
  line-height: 1.5;
  padding: 8px 12px;
  background: var(--soft-teal);
  border: 1px solid #b2dbd6;
  border-radius: 6px;
}

.dc-action-list li::before {
  content: '→';
  color: var(--teal);
  font-weight: 800;
  flex: 0 0 auto;
}

/* ── Disclaimer ──────────────────────────────────────────────────────────── */

.dc-disclaimer {
  font-size: 0.76rem;
  color: var(--muted);
  font-style: italic;
  line-height: 1.5;
  padding: 10px 12px;
  background: #f7f8fb;
  border: 1px solid var(--line);
  border-radius: 6px;
  margin-top: 16px;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 780px) {
  .dc-upload-pair { grid-template-columns: 1fr; }
  .dc-doc-meta-pair { grid-template-columns: 1fr; }
  .dc-discrepancy__compare { grid-template-columns: 1fr; }
  .dc-compare-divider { padding-top: 0; }
  .dc-party-row { grid-template-columns: 1fr 1fr; }
  .dc-tl-desc { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .dc-tab-bar { gap: 0; }
  .dc-tab { padding: 8px 10px; font-size: 0.78rem; }
  .dc-party-row { grid-template-columns: 1fr; }
}

/* Print styles */
@media print {
  .tool-rail, .reasoning-panel, .topbar, .tool-form,
  .adv-result-actions, .adv-flip-bar, .adv-brief-actions,
  .dr-branch-btn, .dr-strength-branch-btn,
  .adv-restore-banner, .adv-subq-preview,
  .dr-source-modal { display:none !important; }
  .workspace { display:block !important; }
  .tool-panel { max-width:100%; border:none; box-shadow:none; padding:0; }
  .results { padding:0; }
  .adv-banner { border:1px solid #000; padding:8px 12px; margin-bottom:12px; }
  details { display:block !important; }
  details > * { display:block !important; }
  .dr-result-block { border:1px solid #ccc; margin-bottom:12px; padding:12px; break-inside:avoid; }
  .dr-source-card { break-inside:avoid; }
  .dr-brief { line-height:1.75; }
  summary { display:none; }
}

/* ── Korrespond ──────────────────────────────────────────────────────────── */
.korr-goal-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 14px;
}
.korr-chip {
  background: rgba(15, 118, 110, 0.08);
  border: 1px solid rgba(15, 118, 110, 0.25);
  color: var(--ink, #1b2330);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.korr-chip:hover { background: rgba(15, 118, 110, 0.16); }
.korr-chip.is-active {
  background: var(--dbn-blue, #00205b);
  color: #fff;
  border-color: var(--dbn-blue, #00205b);
}

.korr-clarify-panel {
  background: rgba(183, 121, 31, 0.08);
  border: 1px solid rgba(183, 121, 31, 0.35);
  border-radius: 10px;
  padding: 18px 20px;
  margin: 18px 0;
}
.korr-clarify-panel h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
  color: var(--ink, #1b2330);
}
.korr-clarify-list {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}
.korr-clarify-item { display: grid; gap: 4px; }
.korr-clarify-item label { font-size: 0.9rem; }
.korr-clarify-item input {
  padding: 8px 10px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 6px;
  font: inherit;
  background: #fff;
}
.korr-clarify-actions { display: flex; gap: 10px; }

.korr-result-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}
.korr-flags { display: flex; flex-wrap: wrap; gap: 6px; }
.korr-flag {
  font-size: 0.78rem;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid currentColor;
  font-weight: 500;
}
.korr-flag.is-ok    { color: #0f766e; background: rgba(15, 118, 110, 0.08); }
.korr-flag.is-warn  { color: #b7791f; background: rgba(183, 121, 31, 0.10); }
.korr-flag.is-error { color: #ba0c2f; background: rgba(186, 12, 47, 0.08); }

.korr-drafts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.korr-drafts.is-single { grid-template-columns: 1fr; }
@media (max-width: 1100px) {
  .korr-drafts { grid-template-columns: 1fr; }
}
.korr-draft-col {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.10);
  border-radius: 10px;
  padding: 14px 16px;
}
.korr-draft-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  padding-bottom: 8px;
}
.korr-draft-head h3 {
  margin: 0;
  font-size: 0.92rem;
  color: var(--dbn-blue, #00205b);
}
.korr-draft-actions { display: flex; gap: 6px; }
.korr-draft-body {
  margin: 0;
  font-family: 'IBM Plex Mono', 'Menlo', 'Consolas', monospace;
  font-size: 0.82rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--ink, #1b2330);
  max-height: 600px;
  overflow-y: auto;
}

.korr-cited {
  margin-top: 18px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.10);
  border-radius: 10px;
  padding: 12px 16px;
}
.korr-cited summary {
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--dbn-blue, #00205b);
}
.korr-cited-list { display: grid; gap: 12px; margin-top: 10px; }
.korr-cited-item {
  border-left: 3px solid var(--dbn-blue, #00205b);
  padding: 6px 12px;
  background: rgba(0, 32, 91, 0.03);
}
.korr-cited-head { font-size: 0.88rem; margin-bottom: 4px; }
.korr-cited-excerpt { font-size: 0.83rem; line-height: 1.5; margin: 0 0 4px; color: rgba(0, 0, 0, 0.75); }
.korr-cited-item a { font-size: 0.78rem; color: var(--dbn-blue, #00205b); }

/* Required hint */
.required-hint { color: var(--dbn-red, #ba0c2f); font-size: 0.78rem; font-weight: 500; }

/* Korrespond — refine panel */
.korr-refine-panel {
  margin-top: 22px;
  padding: 16px 18px;
  background: rgba(0, 32, 91, 0.04);
  border: 1px dashed rgba(0, 32, 91, 0.35);
  border-radius: 10px;
}
.korr-refine-panel h3 {
  margin: 0 0 6px;
  font-size: 1rem;
  color: var(--dbn-blue, #00205b);
}
.korr-refine-panel h3 small {
  font-size: 0.75rem;
  font-weight: 400;
  color: rgba(0, 0, 0, 0.55);
}
.korr-refine-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin: 10px 0 4px;
}
.korr-refine-controls label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  cursor: pointer;
}
.korr-refine-controls button {
  margin-left: auto;
}
.korr-refined {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(0, 32, 91, 0.18);
}

/* ── korr-doc-links (in-tool breadcrumb links) ───────────────────────── */
.korr-doc-links {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--dbn-ink, #16130f);
  opacity: 0.6;
  margin-bottom: 18px;
}
.korr-doc-links a {
  color: var(--dbn-blue, #00205b);
  text-decoration: none;
}
.korr-doc-links a:hover {
  text-decoration: underline;
}

/* ═══════════════════════════════════════════════════════════════════════
   KDOC — Public documentation pages (korrespond-about / guide / tech)
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Shared page wrapper ─────────────────────────────────────────────── */
.kdoc-page {
  background: var(--dbn-paper, #f6f2ea);
  color: var(--dbn-ink, #16130f);
  min-height: 100vh;
  font-family: 'IBM Plex Sans', sans-serif;
}

/* ── Nav breadcrumb row ──────────────────────────────────────────────── */
.kdoc-breadcrumb {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 2rem;
  font-size: 0.82rem;
  color: var(--dbn-ink);
  opacity: 0.7;
}
.kdoc-breadcrumb a {
  color: var(--dbn-blue, #00205b);
  text-decoration: none;
}
.kdoc-breadcrumb a:hover { text-decoration: underline; }

/* ── Hero ─────────────────────────────────────────────────────────────── */
.kdoc-hero {
  background: var(--dbn-blue, #00205b);
  color: #fff;
  padding: clamp(3rem, 8vw, 6rem) 2rem clamp(3rem, 6vw, 5rem);
  text-align: center;
}
.kdoc-hero__inner {
  max-width: 860px;
  margin: 0 auto;
}
.kdoc-hero__kicker {
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.75;
  margin-bottom: 1rem;
}
.kdoc-hero__title {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: clamp(2rem, 5vw, 3.6rem);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 1.2rem;
  color: #fff;
}
.kdoc-hero__sub {
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  opacity: 0.88;
  line-height: 1.65;
  margin-bottom: 2rem;
}
.kdoc-hero__stats {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2rem 3rem;
  margin: 2rem 0;
}
.kdoc-hero__stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.kdoc-hero__stat strong {
  font-size: 2rem;
  font-weight: 700;
  font-family: 'Crimson Pro', serif;
  color: #c9e0ff;
}
.kdoc-hero__stat span {
  font-size: 0.78rem;
  opacity: 0.75;
  text-align: center;
}
.kdoc-hero__ctas {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 2rem;
}
.kdoc-btn-primary {
  display: inline-block;
  background: var(--dbn-red, #ba0c2f);
  color: #fff;
  padding: 0.75rem 1.8rem;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: background 0.15s;
}
.kdoc-btn-primary:hover { background: #8f0921; }
.kdoc-btn-secondary {
  display: inline-block;
  background: rgba(255,255,255,0.12);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.4);
  padding: 0.75rem 1.6rem;
  border-radius: 4px;
  font-weight: 500;
  font-size: 0.9rem;
  text-decoration: none;
  transition: background 0.15s;
}
.kdoc-btn-secondary:hover { background: rgba(255,255,255,0.22); }

/* ── Sections ────────────────────────────────────────────────────────── */
.kdoc-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(2.5rem, 5vw, 4.5rem) 2rem;
}
.kdoc-section--alt {
  background: #edeae1;
}
.kdoc-section--alt .kdoc-section {
  /* inner padding still applies */
}
.kdoc-section__eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dbn-red, #ba0c2f);
  font-weight: 600;
  margin-bottom: 0.6rem;
}
.kdoc-section__title {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 700;
  margin: 0 0 0.8rem;
  color: var(--dbn-ink);
}
.kdoc-section__sub {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--dbn-ink);
  opacity: 0.8;
  max-width: 680px;
  margin-bottom: 2rem;
}

/* ── Feature cards grid ─────────────────────────────────────────────── */
.kdoc-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}
.kdoc-feature-card {
  background: #fff;
  border: 1px solid rgba(0,32,91,0.1);
  border-radius: 8px;
  padding: 1.6rem;
}
.kdoc-feature-card__icon {
  font-size: 1.8rem;
  margin-bottom: 0.8rem;
  display: block;
}
.kdoc-feature-card__title {
  font-family: 'Crimson Pro', serif;
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: var(--dbn-blue, #00205b);
}
.kdoc-feature-card__body {
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--dbn-ink);
  opacity: 0.85;
}

/* ── Simple 3-step pipeline (marketing page) ─────────────────────────── */
.kdoc-steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1.5rem;
  position: relative;
}
.kdoc-step-card {
  background: #fff;
  border: 1px solid rgba(0,32,91,0.1);
  border-radius: 8px;
  padding: 1.8rem 1.6rem;
  position: relative;
}
.kdoc-step-card__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  background: var(--dbn-blue, #00205b);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 1rem;
}
.kdoc-step-card__title {
  font-family: 'Crimson Pro', serif;
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: var(--dbn-ink);
}
.kdoc-step-card__body {
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--dbn-ink);
  opacity: 0.82;
}
.kdoc-step-card__example {
  margin-top: 0.8rem;
  font-size: 0.8rem;
  font-style: italic;
  color: var(--dbn-blue);
  opacity: 0.75;
}
.kdoc-step-card__screenshot {
  display: block;
  width: 100%;
  margin-top: 1rem;
  border-radius: 6px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.12);
}
@media (min-width: 700px) {
  .kdoc-steps {
    grid-template-columns: 1fr auto 1fr auto 1fr;
    align-items: stretch;
  }
  .kdoc-step-arrow {
    display: flex;
    align-items: center;
    padding: 0 0.5rem;
    font-size: 1.4rem;
    color: var(--dbn-blue);
    opacity: 0.4;
  }
}
.kdoc-step-arrow {
  display: none;
}

/* ── Screenshot gallery ──────────────────────────────────────────────── */
.kdoc-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 2rem;
  margin-top: 1.5rem;
}
.kdoc-gallery__item {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
.kdoc-screenshot {
  border-radius: 8px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.12), 0 1px 4px rgba(0,0,0,0.08);
  max-width: 100%;
  border: 1px solid rgba(0,32,91,0.08);
}
.kdoc-gallery__caption {
  font-size: 0.82rem;
  color: var(--dbn-ink);
  opacity: 0.65;
  text-align: center;
}

/* ── LLM spotlight ───────────────────────────────────────────────────── */
.kdoc-llm-spotlight {
  background: var(--dbn-blue, #00205b);
  color: #fff;
  border-radius: 10px;
  padding: 2.5rem 2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: center;
  margin-top: 1.5rem;
}
@media (max-width: 640px) {
  .kdoc-llm-spotlight { grid-template-columns: 1fr; }
}
.kdoc-llm-spotlight__badge {
  display: inline-block;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.8rem;
}
.kdoc-llm-spotlight__title {
  font-family: 'Crimson Pro', serif;
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0 0 0.6rem;
}
.kdoc-llm-spotlight__body {
  font-size: 0.9rem;
  line-height: 1.7;
  opacity: 0.88;
}
.kdoc-llm-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.kdoc-llm-stat {
  background: rgba(255,255,255,0.1);
  border-radius: 6px;
  padding: 1rem;
}
.kdoc-llm-stat strong {
  display: block;
  font-size: 1.3rem;
  font-family: 'Crimson Pro', serif;
  color: #c9e0ff;
}
.kdoc-llm-stat span {
  font-size: 0.78rem;
  opacity: 0.75;
}

/* ── Authority body grid ─────────────────────────────────────────────── */
.kdoc-bodies {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}
.kdoc-body-card {
  background: #fff;
  border: 1px solid rgba(0,32,91,0.1);
  border-radius: 6px;
  padding: 1rem 1.2rem;
}
.kdoc-body-card__name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--dbn-blue, #00205b);
  margin-bottom: 4px;
}
.kdoc-body-card__law {
  font-size: 0.75rem;
  color: var(--dbn-ink);
  opacity: 0.6;
  font-style: italic;
}

/* ── CTA strip ───────────────────────────────────────────────────────── */
.kdoc-cta-strip {
  background: var(--dbn-red, #ba0c2f);
  color: #fff;
  text-align: center;
  padding: 4rem 2rem;
}
.kdoc-cta-strip__title {
  font-family: 'Crimson Pro', serif;
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 700;
  margin: 0 0 0.8rem;
}
.kdoc-cta-strip__sub {
  font-size: 1rem;
  opacity: 0.88;
  margin-bottom: 2rem;
}
.kdoc-cta-strip .kdoc-btn-primary {
  background: #fff;
  color: var(--dbn-red, #ba0c2f);
}
.kdoc-cta-strip .kdoc-btn-primary:hover {
  background: #f5e8ea;
}
.kdoc-cta-strip .kdoc-btn-secondary {
  border-color: rgba(255,255,255,0.5);
}

/* ── Guide: TOC ──────────────────────────────────────────────────────── */
.kdoc-toc {
  background: #fff;
  border: 1px solid rgba(0,32,91,0.1);
  border-radius: 8px;
  padding: 1.4rem 1.6rem;
  margin: 0 0 2.5rem;
  display: inline-block;
}
.kdoc-toc__title {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--dbn-ink);
  opacity: 0.55;
  margin-bottom: 0.8rem;
}
.kdoc-toc ol {
  margin: 0;
  padding-left: 1.2rem;
}
.kdoc-toc li {
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
}
.kdoc-toc a {
  color: var(--dbn-blue, #00205b);
  text-decoration: none;
}
.kdoc-toc a:hover { text-decoration: underline; }

/* ── Guide: step sections ────────────────────────────────────────────── */
.kdoc-guide-step {
  margin-bottom: 3.5rem;
  scroll-margin-top: 2rem;
}
.kdoc-guide-step__header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}
.kdoc-guide-step__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--dbn-blue, #00205b);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.kdoc-guide-step__title {
  font-family: 'Crimson Pro', serif;
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0;
  color: var(--dbn-ink);
}
.kdoc-guide-step__body {
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--dbn-ink);
  opacity: 0.88;
  margin-bottom: 1.2rem;
}
.kdoc-guide-step__screenshot {
  margin: 1rem 0;
}

/* ── Preset / tone table ─────────────────────────────────────────────── */
.kdoc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  margin: 1rem 0 1.5rem;
}
.kdoc-table th {
  text-align: left;
  font-weight: 600;
  padding: 0.5rem 0.8rem;
  border-bottom: 2px solid rgba(0,32,91,0.2);
  color: var(--dbn-blue, #00205b);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.kdoc-table td {
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid rgba(0,32,91,0.08);
  vertical-align: top;
  line-height: 1.55;
}
.kdoc-table tr:last-child td { border-bottom: none; }
.kdoc-table td:first-child { font-weight: 600; color: var(--dbn-blue); white-space: nowrap; }

/* ── Guide: tips ─────────────────────────────────────────────────────── */
.kdoc-tips {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.kdoc-tip {
  background: #fff;
  border-left: 3px solid var(--dbn-blue, #00205b);
  border-radius: 0 6px 6px 0;
  padding: 0.9rem 1.1rem;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--dbn-ink);
}
.kdoc-tip strong { color: var(--dbn-blue); }

/* ── Tech: pipeline diagram ──────────────────────────────────────────── */
.kdoc-pipeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 1.5rem 0;
}
.kdoc-pipeline__pass {
  background: #fff;
  border: 1px solid rgba(0,32,91,0.12);
  border-radius: 8px;
  padding: 1.4rem 1.6rem;
  position: relative;
}
.kdoc-pipeline__pass-badge {
  display: inline-block;
  background: var(--dbn-blue, #00205b);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 3px;
  margin-bottom: 0.6rem;
}
.kdoc-pipeline__pass-badge--mini { background: #0f766e; }
.kdoc-pipeline__pass-badge--optional { background: #6b7280; }
.kdoc-pipeline__pass-title {
  font-family: 'Crimson Pro', serif;
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 0.4rem;
  color: var(--dbn-ink);
}
.kdoc-pipeline__pass-body {
  font-size: 0.86rem;
  line-height: 1.65;
  color: var(--dbn-ink);
  opacity: 0.82;
}
.kdoc-pipeline__pass ul {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
  font-size: 0.84rem;
  line-height: 1.6;
}
.kdoc-pipeline__arrow-down {
  text-align: center;
  font-size: 1.2rem;
  color: var(--dbn-blue);
  opacity: 0.4;
  padding: 4px 0;
}
@media (min-width: 760px) {
  .kdoc-pipeline {
    flex-direction: row;
    align-items: stretch;
  }
  .kdoc-pipeline__pass {
    flex: 1;
  }
  .kdoc-pipeline__arrow-down {
    display: flex;
    align-items: center;
    padding: 0 4px;
    font-size: 1.4rem;
  }
}

/* ── Tech: KB stats ──────────────────────────────────────────────────── */
.kdoc-kb-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.kdoc-kb-stat {
  background: #fff;
  border: 1px solid rgba(0,32,91,0.1);
  border-radius: 8px;
  padding: 1.1rem 1.2rem;
  text-align: center;
}
.kdoc-kb-stat strong {
  display: block;
  font-family: 'Crimson Pro', serif;
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--dbn-blue, #00205b);
  line-height: 1;
  margin-bottom: 4px;
}
.kdoc-kb-stat span {
  font-size: 0.78rem;
  color: var(--dbn-ink);
  opacity: 0.65;
}

/* ── Tech: RAG diagram ───────────────────────────────────────────────── */
.kdoc-rag-flow {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 1.5rem 0;
}
.kdoc-rag-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.kdoc-rag-box {
  background: #fff;
  border: 1px solid rgba(0,32,91,0.14);
  border-radius: 5px;
  padding: 0.6rem 1rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--dbn-ink);
}
.kdoc-rag-box--blue {
  background: var(--dbn-blue, #00205b);
  color: #fff;
  border-color: var(--dbn-blue);
}
.kdoc-rag-box--teal {
  background: #0f766e;
  color: #fff;
  border-color: #0f766e;
}
.kdoc-rag-box--red {
  background: var(--dbn-red, #ba0c2f);
  color: #fff;
  border-color: var(--dbn-red);
}
.kdoc-rag-arrow {
  font-size: 1rem;
  color: var(--dbn-blue);
  opacity: 0.45;
}
.kdoc-slice-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0.8rem 0;
}
.kdoc-slice-chip {
  background: rgba(0,32,91,0.08);
  border: 1px solid rgba(0,32,91,0.14);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--dbn-blue, #00205b);
}

/* ── Tech: finetune block ────────────────────────────────────────────── */
.kdoc-finetune {
  background: #1a2e4a;
  color: #e8f0fb;
  border-radius: 10px;
  padding: 2rem 2rem;
  margin-top: 1.5rem;
}
.kdoc-finetune__badge {
  display: inline-block;
  background: rgba(201,224,255,0.15);
  border: 1px solid rgba(201,224,255,0.3);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.73rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 0.8rem;
}
.kdoc-finetune__title {
  font-family: 'Crimson Pro', serif;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 0.6rem;
  color: #c9e0ff;
}
.kdoc-finetune__body {
  font-size: 0.9rem;
  line-height: 1.7;
  opacity: 0.88;
}
.kdoc-finetune__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 1.2rem;
}
.kdoc-finetune__chip {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 0.78rem;
  color: #c9e0ff;
  font-family: 'IBM Plex Mono', monospace;
}

/* ── Tech: privacy block ─────────────────────────────────────────────── */
.kdoc-privacy {
  background: #edeae1;
  border-radius: 8px;
  padding: 1.6rem 2rem;
  margin-top: 1.5rem;
}
.kdoc-privacy__title {
  font-weight: 700;
  color: var(--dbn-blue, #00205b);
  margin-bottom: 0.6rem;
}
.kdoc-privacy ul {
  margin: 0;
  padding-left: 1.3rem;
  font-size: 0.88rem;
  line-height: 1.8;
  color: var(--dbn-ink);
}

/* ── Doc page nav-bar links row ──────────────────────────────────────── */
.kdoc-doc-nav {
  background: rgba(0,32,91,0.04);
  border-bottom: 1px solid rgba(0,32,91,0.08);
  padding: 8px 2rem;
}
.kdoc-doc-nav__inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  gap: 1.5rem;
  font-size: 0.82rem;
  flex-wrap: wrap;
}
.kdoc-doc-nav a {
  color: var(--dbn-blue, #00205b);
  text-decoration: none;
  font-weight: 500;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}
.kdoc-doc-nav a:hover,
.kdoc-doc-nav a.is-active {
  border-bottom-color: var(--dbn-blue);
}

/* ── Korrespond legal-check card (dbn-legal-agent-v2) ────────────────────── */
.korr-legal-check {
  margin-top: 20px;
  padding: 14px 16px;
  background: rgba(186, 12, 47, 0.04);
  border: 1px solid rgba(186, 12, 47, 0.15);
  border-radius: 8px;
}
.korr-legal-check__title {
  margin: 0 0 10px;
  font-size: 0.92rem;
  color: var(--ink);
}
.korr-legal-check__title small {
  font-weight: 400;
  color: var(--muted, #6b7280);
  font-size: 0.78em;
}

/* ── why-ours.php — two-path comparison ─────────────────────────────────── */
.kdoc-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 2rem;
}
.kdoc-compare__col {
  background: var(--panel);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 2px 12px rgba(25,35,52,.06);
}
.kdoc-compare__col--generic { border-top: 4px solid #c2410c; }
.kdoc-compare__col--dbn     { border-top: 4px solid var(--dbn-blue, #00205b); }
.kdoc-compare__label {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-weight: 700;
  margin-bottom: 1.25rem;
}
.kdoc-compare__col--generic .kdoc-compare__label { color: #c2410c; }
.kdoc-compare__col--dbn     .kdoc-compare__label { color: var(--dbn-blue, #00205b); }
.kdoc-compare__flow {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.kdoc-compare__arrow {
  text-align: center;
  color: var(--muted, #667085);
  font-size: 1.1rem;
  line-height: 1;
  padding: .1rem 0;
}
.kdoc-compare__flow-step {
  background: var(--bg, #f7f8fb);
  border-radius: 8px;
  padding: .75rem 1rem;
  font-size: .88rem;
  line-height: 1.55;
  color: var(--ink, #1b2330);
}
.kdoc-compare__flow-step small {
  display: block;
  margin-top: .25rem;
  font-size: .78rem;
  color: var(--muted, #667085);
  font-style: italic;
}
.kdoc-compare__flow-step--final { font-weight: 700; }
.kdoc-compare__col--generic .kdoc-compare__flow-step--final {
  background: #fff0e8;
  color: #c2410c;
}
.kdoc-compare__col--dbn .kdoc-compare__flow-step--final {
  background: var(--soft-teal, #e7f5f2);
  color: var(--teal-dark, #115e59);
}
.kdoc-compare__caption {
  margin-top: 1.5rem;
  text-align: center;
  font-size: .92rem;
  color: var(--muted, #667085);
  font-style: italic;
}
@media (max-width: 700px) {
  .kdoc-compare { grid-template-columns: 1fr; }
}

/* ── Analogy term chip ───────────────────────────────────────────────────── */
.kdoc-feature-card__term {
  display: inline-block;
  margin-top: .75rem;
  padding: .25rem .65rem;
  background: var(--soft-teal, #e7f5f2);
  color: var(--teal-dark, #115e59);
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .03em;
}

/* ── Knowledge graph (why-ours) ──────────────────────────────────────────── */
.kdoc-graph {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  margin-top: 2rem;
}
.kdoc-graph__node {
  background: var(--panel);
  border: 1.5px solid var(--line, #d8dde7);
  border-radius: 10px;
  padding: .85rem 1.5rem;
  text-align: center;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 2px 8px rgba(25,35,52,.06);
}
.kdoc-graph__node--start {
  background: var(--dbn-blue, #00205b);
  color: #fff;
  border-color: var(--dbn-blue, #00205b);
}
.kdoc-graph__node--end {
  background: var(--soft-teal, #e7f5f2);
  border-color: var(--teal, #0f766e);
}
.kdoc-graph__node-title {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: inherit;
  margin: 0 0 .15rem;
}
.kdoc-graph__node--start .kdoc-graph__node-title { color: #fff; }
.kdoc-graph__node--end   .kdoc-graph__node-title { color: var(--teal-dark, #115e59); }
.kdoc-graph__node-note {
  font-size: .75rem;
  color: var(--muted, #667085);
  margin: 0;
}
.kdoc-graph__node--start .kdoc-graph__node-note { color: rgba(255,255,255,.7); }
.kdoc-graph__node--end   .kdoc-graph__node-note { color: var(--teal-dark, #115e59); opacity: .8; }
.kdoc-graph__connector {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: .35rem 0;
  color: var(--muted, #667085);
  font-size: .8rem;
  gap: .2rem;
}
.kdoc-graph__connector-line {
  width: 2px;
  height: 20px;
  background: var(--line, #d8dde7);
}
.kdoc-graph__connector-label {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted, #667085);
}

/* ── Image placeholder slots ─────────────────────────────────────────────── */
.kdoc-img-slot {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: var(--dbn-blue, #00205b);
  min-height: 300px;
  margin: 2.5rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.kdoc-img-slot picture,
.kdoc-img-slot img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.kdoc-img-slot__placeholder {
  text-align: center;
  color: rgba(255,255,255,.45);
  padding: 2.5rem 2rem;
  max-width: 700px;
  position: relative;
  z-index: 1;
}
.kdoc-img-slot__placeholder strong {
  display: block;
  font-size: .95rem;
  color: rgba(255,255,255,.75);
  margin-bottom: .6rem;
  font-family: 'Crimson Pro', Georgia, serif;
  font-weight: 600;
}
.kdoc-img-slot__label {
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: rgba(255,255,255,.35);
  margin-bottom: .4rem;
}
.kdoc-img-slot__prompt {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  font-size: .78rem;
  font-family: 'IBM Plex Sans', sans-serif;
  color: rgba(255,255,255,.65);
  line-height: 1.65;
  margin-top: .75rem;
  text-align: left;
}

/* ── Privacy card (why-ours) ─────────────────────────────────────────────── */
.kdoc-privacy-card {
  background: var(--dbn-blue, #00205b);
  color: rgba(255,255,255,.9);
  border-radius: 12px;
  padding: 2.5rem;
  margin-top: 1.5rem;
}
.kdoc-privacy-card h3 {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 .75rem;
}
.kdoc-privacy-card p {
  font-size: .95rem;
  line-height: 1.7;
  color: rgba(255,255,255,.8);
  margin: 0;
}
.kdoc-privacy-card__badges {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: 1.25rem;
}
.kdoc-privacy-card__badge {
  padding: .3rem .8rem;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 600;
  color: rgba(255,255,255,.85);
  letter-spacing: .03em;
}


/* Custom infographic diagram images (transparent-bg PNGs/WebPs) */
.kdoc-diagram-img { margin: 2rem auto; max-width: 100%; overflow: hidden; }
.kdoc-diagram-img picture { display: block; width: 100%; }
.kdoc-diagram-img img { display: block; width: 100%; max-width: 100%; height: auto; }
