:root {
  --canvas: #f5eee2;
  --canvas-soft: #ebe2d0;
  --surface: #ffffff;
  --ink: #15120e;
  --ink-soft: #38332c;
  --ink-muted: #6f6a62;
  --ink-faint: #a39d92;
  --divider: #ddd5c4;
  --accent-50: #fff1ec;
  --accent-100: #ffddd0;
  --accent-300: #f7967a;
  --accent-500: #d94f30;
  --accent-600: #b93b1f;
  --accent-700: #962f18;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  max-width: 100%;
  overflow-x: clip;
  background: var(--canvas);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Segoe UI Variable", "Segoe UI", Inter, system-ui, "Helvetica Neue", Arial, sans-serif;
  font-feature-settings: "ss01", "cv11", "cv01";
  letter-spacing: 0;
}

body {
  min-height: 100%;
  max-width: 100%;
  margin: 0;
  overflow-x: clip;
  overscroll-behavior-x: none;
  touch-action: pan-y;
  background: var(--canvas);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
}

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

code {
  border: 1px solid rgba(21, 18, 14, 0.08);
  border-radius: 0.4rem;
  background: rgba(255, 255, 255, 0.7);
  padding: 0.12rem 0.3rem;
  color: var(--accent-700);
  font-size: 0.92em;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(21, 18, 14, 0.1);
  background: rgba(251, 243, 234, 0.9);
  backdrop-filter: blur(16px);
}

.topbar {
  display: flex;
  width: min(1160px, calc(100% - 2rem));
  max-width: 100%;
  height: 3.5rem;
  margin: 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 0.55rem;
  color: var(--accent-600);
  font-size: 0.95rem;
  font-weight: 650;
  text-decoration: none;
}

.brand-mark {
  display: inline-flex;
  width: 1.5rem;
  height: 1.5rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--accent-100);
  border-radius: 0.35rem;
  background: var(--accent-50);
  color: var(--accent-600);
  font-size: 1.05rem;
  line-height: 1;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 1px 2px rgba(150, 47, 24, 0.08);
}

.brand-mark .material-symbols-rounded {
  display: inline-flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  line-height: 1;
}

.material-symbols-rounded {
  display: inline-block;
  direction: ltr;
  font-family: "Material Symbols Rounded";
  font-feature-settings: "liga";
  font-style: normal;
  font-variation-settings:
    "FILL" 0,
    "wght" 500,
    "GRAD" 0,
    "opsz" 24;
  font-weight: normal;
  letter-spacing: normal;
  overflow-wrap: normal;
  text-rendering: optimizeLegibility;
  text-transform: none;
  white-space: nowrap;
  -webkit-font-smoothing: antialiased;
}

.nav-actions {
  display: flex;
  min-width: 0;
  flex-shrink: 0;
  align-items: center;
  gap: 0.75rem;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.75rem;
  color: var(--ink-soft);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 160ms ease;
}

.nav-link:hover,
.nav-link.is-current {
  color: var(--ink);
}

.divider {
  width: 1px;
  height: 1rem;
  background: rgba(21, 18, 14, 0.12);
}

.github-pill {
  display: inline-flex;
  height: 2.25rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 650;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(21, 18, 14, 0.12);
}

.github-pill {
  min-width: 5.35rem;
  padding: 0 1rem;
  background: var(--ink);
  color: var(--canvas);
}

.github-pill svg {
  width: 1rem;
  height: 1rem;
  margin-right: 0.45rem;
  fill: currentColor;
}

.github-pill img {
  width: 1rem;
  height: 1rem;
  margin-right: 0.45rem;
}

.linkup-pill {
  border: 1px solid rgba(221, 213, 196, 0.74);
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink-soft);
}

.linkup-pill img {
  width: 4.2rem;
  height: auto;
  margin-right: 0;
}

.linkup-pill span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.readme-shell,
.examples-shell {
  width: min(1280px, calc(100% - 2rem));
  margin: 0 auto;
}

.readme-shell {
  max-width: 1180px;
  padding: 3rem 0 5rem;
}

.readme-hero {
  padding: 1.2rem 0 2rem;
}

.eyebrow,
.section-icon {
  color: var(--accent-600);
  font-size: 0.74rem;
  font-weight: 750;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 1rem;
  color: var(--ink);
  font-size: clamp(3.1rem, 9vw, 6rem);
  font-weight: 720;
  letter-spacing: -0.045em;
  line-height: 0.96;
}

h2 {
  margin-bottom: 0;
  font-size: 1.35rem;
  line-height: 1.15;
}

h3 {
  margin-bottom: 0.45rem;
  font-size: 1rem;
  line-height: 1.25;
}

p {
  color: var(--ink-muted);
  font-size: 1rem;
  line-height: 1.75;
}

.lede {
  max-width: 49rem;
  color: var(--ink-soft);
  font-size: clamp(1.25rem, 2vw, 1.7rem);
  line-height: 1.35;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem;
  margin-top: 1.25rem;
}

.hero-primary-link {
  display: inline-flex;
  min-height: 2.5rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--ink);
  padding: 0.65rem 1rem;
  color: var(--canvas);
  font-size: 0.9rem;
  font-weight: 760;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(21, 18, 14, 0.12);
}

.hero-actions span {
  max-width: 29rem;
  color: var(--ink-muted);
  font-size: 0.94rem;
  line-height: 1.5;
}

.readme-section {
  padding: 2.2rem 0;
  border-top: 1px solid rgba(221, 213, 196, 0.9);
}

.section-heading {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.screenshot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.4rem;
}

figure {
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(221, 213, 196, 0.88);
  border-radius: 0.8rem;
  background: rgba(255, 255, 255, 0.72);
  box-shadow:
    0 1px 2px rgba(21, 18, 14, 0.05),
    0 18px 48px -36px rgba(21, 18, 14, 0.36);
}

figure img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top left;
  background: var(--canvas);
}

figcaption {
  border-top: 1px solid rgba(221, 213, 196, 0.76);
  padding: 0.75rem 0.9rem 0.85rem;
  color: var(--ink-muted);
  font-size: 0.88rem;
  font-weight: 650;
}

.feature-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.feature-list article,
.code-card {
  border: 1px solid rgba(221, 213, 196, 0.88);
  border-radius: 0.65rem;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 1px 2px rgba(21, 18, 14, 0.04);
}

.feature-list article {
  padding: 1rem;
}

.feature-list p {
  margin-bottom: 0;
  font-size: 0.94rem;
  line-height: 1.55;
}

.code-card {
  margin: 0.85rem 0 1rem;
  overflow: hidden;
}

pre {
  margin: 0;
  overflow-x: auto;
  padding: 1rem;
}

pre code {
  display: block;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.7;
}

.examples-shell {
  padding: 3rem 0 5rem;
}

.back-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
  border: 1px solid rgba(221, 213, 196, 0.8);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  padding: 0.6rem 0.85rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  transition:
    border-color 160ms ease,
    color 160ms ease;
}

.back-pill:hover {
  border-color: var(--accent-300);
  color: var(--accent-700);
}

.examples-intro {
  max-width: 48rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid rgba(221, 213, 196, 0.75);
  padding-bottom: 2rem;
}

.examples-intro h1 {
  font-size: clamp(2.5rem, 8vw, 4.5rem);
}

.examples-intro p {
  font-size: clamp(1rem, 2vw, 1.15rem);
  line-height: 1.6;
}

.examples-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.example-card {
  display: flex;
  min-height: 15.75rem;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid rgba(221, 213, 196, 0.75);
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.82);
  padding: 1.25rem;
  color: inherit;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(21, 18, 14, 0.04);
  transition:
    background 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.audit-example-card {
  min-height: 19.5rem;
  overflow: hidden;
  padding: 0;
}

.card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 1.25rem;
}

.example-card:hover {
  border-color: var(--accent-300);
  background: white;
  box-shadow: 0 20px 44px -36px rgba(217, 79, 48, 0.72);
  transform: translateY(-1px);
}

.card-heading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.2;
}

.card-heading small {
  display: block;
  margin-top: 0.28rem;
  color: var(--accent-700);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.arena-mark {
  position: relative;
  display: inline-flex;
  width: 3rem;
  height: 3rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--accent-100);
  border-radius: 0.5rem;
  background: rgba(255, 241, 236, 0.74);
  color: var(--accent-700);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 1px 2px rgba(21, 18, 14, 0.05);
}

.arena-mark svg {
  width: 1.45rem;
  height: 1.45rem;
  fill: currentColor;
}

.arena-mark .duo-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.08rem;
}

.arena-mark .duo-icon svg {
  width: 1.03rem;
  height: 1.03rem;
}

.arena-mark .stroke-mark {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card-copy {
  display: block;
  color: var(--ink-muted);
  font-size: 0.9rem;
  line-height: 1.7;
}

.strong-copy {
  color: var(--ink);
  font-weight: 720;
  line-height: 1.65;
}

.verdict-copy {
  margin-top: 0.75rem;
  display: block;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1.25rem;
  border-top: 1px solid rgba(221, 213, 196, 0.7);
  padding-top: 1rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.5;
}

.audit-example-card .card-footer {
  margin-top: 0;
  padding: 1rem 1.25rem;
}

.card-footer span:last-child {
  color: var(--accent-600);
  transition: transform 160ms ease;
}

.example-card:hover .card-footer span:last-child {
  transform: translate(2px, -2px);
}

.audit-shell {
  width: min(1280px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 3rem 0 5rem;
}

.audit-hero {
  margin-bottom: 1.25rem;
  border: 1px solid rgba(221, 213, 196, 0.85);
  border-radius: 0.7rem;
  background: rgba(255, 255, 255, 0.86);
  box-shadow:
    0 1px 2px rgba(21, 18, 14, 0.05),
    0 24px 60px -44px rgba(150, 47, 24, 0.42);
}

.audit-hero-inner {
  padding: 1.5rem;
}

.audit-label {
  margin-bottom: 0.45rem;
  color: var(--accent-600);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.audit-title {
  margin-bottom: 0.6rem;
  font-size: clamp(2.35rem, 5vw, 4.5rem);
  font-weight: 720;
  letter-spacing: -0.045em;
  line-height: 0.98;
}

.audit-subtitle {
  max-width: 62rem;
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: 1.08rem;
  line-height: 1.65;
}

.audit-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 22rem;
  gap: 1rem;
  align-items: start;
}

.audit-thread,
.audit-sources {
  border: 1px solid rgba(221, 213, 196, 0.85);
  border-radius: 0.7rem;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 1px 2px rgba(21, 18, 14, 0.04);
}

.audit-thread {
  padding: 1.4rem;
}

.audit-sources {
  position: sticky;
  top: 4.5rem;
  padding: 1rem;
}

.audit-bubble {
  margin-bottom: 1rem;
  border-radius: 0.55rem;
  padding: 1rem;
}

.audit-bubble.user {
  margin-left: auto;
  max-width: 84%;
  background: var(--ink);
  color: white;
}

.audit-bubble.counter {
  border: 1px solid rgba(217, 79, 48, 0.26);
  background: rgba(255, 241, 236, 0.68);
}

.audit-bubble.verdict {
  margin-top: 1.4rem;
  border-color: rgba(21, 18, 14, 0.14);
  background: rgba(245, 238, 226, 0.74);
}

.audit-bubble h2,
.audit-bubble h3 {
  margin-bottom: 0.45rem;
  font-size: 0.84rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.audit-bubble p {
  margin-bottom: 0;
  color: inherit;
  font-size: 1rem;
  line-height: 1.65;
}

.audit-bubble.counter p {
  color: var(--ink-soft);
}

.message-source-callout {
  display: flex;
  width: min(30rem, 100%);
  align-items: center;
  gap: 0.8rem;
  margin: 0.35rem 0 1rem;
  border: 1px solid rgba(217, 79, 48, 0.28);
  border-radius: 0.55rem;
  background: rgba(245, 238, 226, 0.72);
  padding: 0.72rem 0.85rem;
  color: var(--ink-soft);
}

.message-source-callout .material-symbols-rounded {
  display: flex;
  width: 2.1rem;
  height: 2.1rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 0.45rem;
  background: rgba(255, 255, 255, 0.8);
  color: var(--accent-700);
  font-size: 1.2rem;
}

.message-source-callout strong,
.message-source-callout small {
  display: block;
}

.message-source-callout small {
  margin-top: 0.1rem;
  color: var(--ink-muted);
  font-size: 0.82rem;
}

.message-source-callout > span:last-child {
  margin-left: auto;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  padding: 0.32rem 0.65rem;
  color: var(--ink-muted);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.audit-source-chips {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.9rem;
  color: var(--ink-faint);
  font-size: 0.84rem;
  font-weight: 700;
}

.audit-source-chips a {
  display: inline-flex;
  width: 1.55rem;
  height: 1.55rem;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(217, 79, 48, 0.34);
  border-radius: 999px;
  background: rgba(255, 241, 236, 0.72);
  color: var(--accent-700);
  text-decoration: none;
}

.source-group {
  border: 1px solid rgba(221, 213, 196, 0.88);
  border-radius: 0.62rem;
  background: rgba(245, 238, 226, 0.52);
  padding: 0.85rem;
}

.source-group + .source-group {
  margin-top: 0.9rem;
}

.source-group-heading {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.55rem;
}

.source-group-heading span {
  display: inline-flex;
  width: 1.6rem;
  height: 1.6rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: white;
  color: var(--accent-700);
  font-size: 0.85rem;
  font-weight: 800;
}

.source-group-heading strong {
  color: var(--ink-soft);
  font-size: 0.96rem;
}

.source-group p {
  margin-bottom: 0.7rem;
  color: var(--ink-muted);
  font-size: 0.86rem;
  line-height: 1.55;
}

.source-query {
  margin-bottom: 0.75rem;
  border: 1px dashed rgba(21, 18, 14, 0.13);
  border-radius: 0.45rem;
  padding: 0.55rem 0.65rem;
  color: var(--ink-muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.source-card {
  display: block;
  border: 1px solid rgba(221, 213, 196, 0.88);
  border-radius: 0.55rem;
  background: rgba(255, 255, 255, 0.72);
  padding: 0.9rem;
  color: inherit;
  text-decoration: none;
  transition:
    border-color 160ms ease,
    background 160ms ease;
}

.source-card + .source-card {
  margin-top: 0.75rem;
}

.source-card:hover {
  border-color: var(--accent-300);
  background: white;
}

.source-number {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--accent-700);
  font-size: 0.74rem;
  font-weight: 800;
}

.source-card strong {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--ink-soft);
  font-size: 0.94rem;
}

.source-card span {
  color: var(--ink-muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.source-card em {
  display: inline-flex;
  margin-top: 0.75rem;
  border: 1px solid rgba(221, 213, 196, 0.9);
  border-radius: 999px;
  background: rgba(245, 238, 226, 0.76);
  padding: 0.32rem 0.62rem;
  color: var(--ink-muted);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 700;
}

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

  .audit-layout {
    grid-template-columns: 1fr;
  }

  .audit-sources {
    position: static;
  }
}

@media (max-width: 720px) {
  .topbar {
    position: relative;
    width: 100%;
    max-width: 100vw;
    height: auto;
    min-height: 3.5rem;
    align-items: center;
    justify-content: flex-start;
    gap: 0.55rem;
    overflow: hidden;
    padding: 0.45rem 0.7rem;
  }

  .brand {
    position: absolute;
    left: 0.7rem;
    top: 50%;
    transform: translateY(-50%);
    flex: 0 0 auto;
    gap: 0.45rem;
    font-size: 0.95rem;
  }

  .brand-name {
    display: none;
  }

  .nav-actions {
    position: absolute;
    top: 50%;
    right: 0.7rem;
    transform: translateY(-50%);
    display: flex;
    width: 16.15rem;
    align-items: center;
    flex: 0 0 auto;
    margin-left: 0;
    justify-content: flex-end;
    gap: 0.45rem;
  }

  .nav-link {
    order: 1;
    flex: 0 0 5.55rem;
    height: 2.5rem;
    width: 5.55rem;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid var(--divider);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.7);
    padding: 0.52rem 0;
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    text-transform: none;
  }

  .divider {
    display: none;
  }

  .github-pill {
    order: 2;
    flex: 0 0 4.85rem;
    width: 4.85rem;
    height: 2.5rem;
    min-width: 0;
    flex-shrink: 0;
    padding: 0 0.62rem;
    font-size: 0.74rem;
    gap: 0.34rem;
  }

  .github-pill svg {
    margin-right: 0;
    width: 0.94rem;
    height: 0.94rem;
  }

  .github-pill:not(.linkup-pill) span {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    white-space: nowrap;
  }

  .linkup-pill {
    order: 3;
    flex: 0 0 4.85rem;
    width: 4.85rem;
    height: 2.5rem;
    justify-content: center;
    overflow: visible;
    padding: 0 0.66rem;
  }

  .linkup-pill img {
    width: 3.78rem;
    max-width: 100%;
    height: auto;
    flex: 0 1 auto;
    margin-right: 0;
  }

  .readme-shell,
  .examples-shell,
  .audit-shell {
    max-width: 100%;
    overflow-x: clip;
  }

  .readme-shell,
  .examples-shell,
  .audit-shell {
    width: min(100% - 1.35rem, 1280px);
    padding-top: 2rem;
  }

  .screenshot-grid,
  .feature-list,
  .examples-grid {
    grid-template-columns: 1fr;
  }

  .example-card {
    min-height: 0;
  }

  .audit-bubble.user {
    max-width: 100%;
  }
}

/* Static audit pages intentionally mirror the live app's debate/audit shell. */
.audit-shell {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

.audit-app-grid {
  display: block;
  min-height: calc(100dvh - 3.5rem);
}

.audit-layout {
  display: block;
}

.source-backdrop {
  display: none;
}

.audit-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  min-width: 0;
  min-height: calc(100dvh - 3.5rem);
  gap: 0;
  padding: 1rem;
}

.audit-workspace.has-sources {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 30vw);
}

.debate-thread-panel,
.evidence-rail-panel {
  min-height: 0;
  border: 1px solid rgba(221, 213, 196, 0.72);
  background: rgba(255, 255, 255, 0.88);
  box-shadow:
    0 1px 2px rgba(21, 18, 14, 0.05),
    0 26px 62px -38px rgba(21, 18, 14, 0.48);
}

.debate-thread-panel {
  display: flex;
  min-height: calc(100dvh - 5.5rem);
  flex-direction: column;
  overflow: visible;
  border-radius: 0.55rem;
}

.debate-thread-panel.is-connected {
  border-right: 0;
  border-radius: 0.55rem 0 0 0.55rem;
}

.debate-thread-header {
  display: flex;
  flex-shrink: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid rgba(221, 213, 196, 0.72);
  background: rgba(255, 255, 255, 0.74);
  padding: 0.85rem 1.25rem;
}

.thread-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 750;
}

.thread-title .material-symbols-rounded,
.rail-title .material-symbols-rounded,
.source-trail-title .material-symbols-rounded {
  color: var(--accent-600);
}

.thread-title-block p,
.evidence-rail-header p {
  margin: 0.28rem 0 0;
  color: var(--ink-muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.thread-action {
  display: inline-flex;
  height: 2.25rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: 1px solid rgba(221, 213, 196, 0.8);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  padding: 0 0.85rem;
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 750;
  text-decoration: none;
  transition:
    border-color 160ms ease,
    color 160ms ease;
}

.thread-action:hover {
  border-color: var(--accent-100);
  color: var(--accent-700);
}

.thread-scroll {
  min-height: 0;
  flex: 1;
  overflow: visible;
  background: radial-gradient(circle at 50% 0%, rgba(217, 79, 48, 0.08), transparent 35%);
  padding: 1rem 1.25rem 1.35rem;
}

.message-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.message-row {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 0.75rem;
}

.message-row.is-user {
  flex-direction: row-reverse;
}

.message-avatar {
  display: flex;
  width: 2.25rem;
  height: 2.25rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--accent-100);
  border-radius: 0.42rem;
  background: var(--accent-50);
  color: var(--accent-700);
}

.message-avatar.is-user {
  border-color: rgba(21, 18, 14, 0.1);
  background: var(--ink);
  color: white;
}

.message-avatar .material-symbols-rounded {
  font-size: 1.08rem;
  line-height: 1;
}

.message-card {
  width: min(88%, 62rem);
  min-width: 0;
  border: 1px solid rgba(221, 213, 196, 0.72);
  border-radius: 0.55rem;
  background: rgba(255, 255, 255, 0.78);
  padding: 0.85rem 1rem;
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(21, 18, 14, 0.04);
}

.message-card.is-user {
  border-color: rgba(21, 18, 14, 0.1);
  background: var(--ink);
  color: white;
}

.message-stance {
  margin-bottom: 0.5rem;
  color: var(--accent-700);
  font-size: 0.76rem;
  font-weight: 780;
}

.message-card.is-user .message-stance {
  color: rgba(255, 255, 255, 0.7);
}

.message-content {
  color: inherit;
  font-size: 0.92rem;
  line-height: 1.7;
}

.message-content p {
  margin: 0;
  white-space: pre-wrap;
}

.message-paragraphs {
  display: grid;
  gap: 0.75rem;
}

.message-card.is-counter .message-content {
  color: var(--ink);
}

.citation-link {
  display: inline-flex;
  min-width: 1.38rem;
  height: 1.38rem;
  transform: translateY(-1px);
  align-items: center;
  justify-content: center;
  border: 1px solid var(--accent-100);
  border-radius: 999px;
  background: var(--accent-50);
  color: var(--accent-800, var(--accent-700));
  cursor: pointer;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1;
  margin: 0 0.08rem;
  padding: 0 0.36rem;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.citation-cluster {
  display: inline;
}

.citation-material {
  border-radius: 0.28rem;
  background: rgba(255, 241, 236, 0.72);
  box-shadow: 0 0 0 1px rgba(251, 191, 170, 0.55);
  color: color-mix(in oklab, var(--accent-800, var(--accent-700)) 78%, var(--ink) 22%);
  font-weight: 720;
  padding: 0.12rem 0.25rem;
}

.citation-link:hover {
  border-color: var(--accent-300);
  background: white;
}

.message-source-button {
  display: flex;
  width: min(100%, 28rem);
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 0.85rem;
  border: 1px solid rgba(221, 213, 196, 0.72);
  border-radius: 0.55rem;
  background: rgba(245, 238, 226, 0.62);
  padding: 0.55rem 0.7rem;
  color: var(--ink-muted);
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.message-source-button:hover,
.message-source-button.is-active {
  border-color: var(--accent-300);
  background: var(--accent-50);
  color: var(--accent-900, var(--accent-700));
}

.source-button-icon {
  display: flex;
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 0.42rem;
  background: rgba(255, 255, 255, 0.8);
  color: var(--accent-700);
}

.source-button-copy {
  min-width: 0;
  flex: 1;
}

.source-button-copy span {
  display: block;
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 760;
}

.source-button-copy small {
  display: block;
  overflow: hidden;
  color: var(--ink-faint);
  font-size: 0.72rem;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-count {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  padding: 0.25rem 0.6rem;
  color: var(--ink-muted);
  font-size: 0.72rem;
  font-weight: 760;
  white-space: nowrap;
}

.source-chevron {
  flex-shrink: 0;
  color: var(--ink-muted);
  font-size: 1.05rem;
}

.source-reference-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.38rem;
  margin-top: 0.75rem;
  color: var(--ink-faint);
  font-size: 0.72rem;
  font-weight: 760;
}

.source-reference-label {
  display: inline-flex;
  height: 1.5rem;
  align-items: center;
  gap: 0.22rem;
  border: 1px solid rgba(221, 213, 196, 0.72);
  border-radius: 999px;
  background: rgba(245, 238, 226, 0.7);
  padding: 0 0.62rem;
  color: var(--ink-muted);
  font-size: 0.72rem;
  font-weight: 780;
}

.source-reference-label .material-symbols-rounded {
  color: var(--accent-600);
  font-size: 0.9rem;
}

.source-reference {
  display: inline-flex;
  min-width: 2rem;
  height: 1.5rem;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--accent-100);
  border-radius: 999px;
  background: var(--accent-50);
  color: var(--accent-800, var(--accent-700));
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  line-height: 1;
  padding: 0 0.58rem;
  transition:
    background 160ms ease,
    border-color 160ms ease;
}

.source-reference:hover,
.source-reference.is-selected {
  border-color: var(--accent-300);
}

.source-reference:hover {
  background: white;
}

.source-reference.is-selected {
  background: var(--accent-600);
  color: white;
}

.evidence-rail-panel {
  position: sticky;
  top: 4.5rem;
  display: flex;
  height: calc(100dvh - 5.5rem);
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border-radius: 0 0.55rem 0.55rem 0;
  background: rgba(255, 255, 255, 0.9);
}

.evidence-rail-header {
  display: flex;
  flex-shrink: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1rem 0.75rem;
}

.rail-title {
  display: flex;
  align-items: center;
  gap: 0.48rem;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 760;
}

.rail-close {
  display: flex;
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(221, 213, 196, 0.72);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink-muted);
  cursor: pointer;
}

.rail-close .material-symbols-rounded {
  font-size: 1rem;
}

.rail-scroll {
  min-height: 0;
  flex: 1;
  overscroll-behavior: contain;
  overflow-y: auto;
  padding: 0 1rem 1rem;
}

.source-trail-card {
  margin-bottom: 1rem;
  border: 1px solid rgba(221, 213, 196, 0.72);
  border-radius: 0.55rem;
  background: rgba(245, 238, 226, 0.58);
  padding: 0.75rem;
}

.source-trail-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.35rem;
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 760;
}

.source-trail-card p {
  margin: 0.35rem 0 0;
  color: var(--ink-muted);
  font-size: 0.76rem;
  line-height: 1.55;
}

.source-trail-context {
  color: var(--ink-faint) !important;
  font-size: 0.68rem !important;
  font-weight: 780;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.rail-source-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.rail-source-card {
  display: block;
  scroll-margin-top: 1rem;
  border: 1px solid rgba(221, 213, 196, 0.72);
  border-radius: 0.55rem;
  background: rgba(255, 255, 255, 0.68);
  padding: 0.75rem;
  color: inherit;
  text-decoration: none;
  transition:
    background 160ms ease,
    border-color 160ms ease;
}

.rail-source-card:hover {
  border-color: var(--accent-300);
  background: white;
}

.rail-source-card.is-highlighted {
  border-color: var(--accent-300);
  background: rgba(255, 241, 236, 0.86);
  box-shadow:
    0 0 0 3px rgba(217, 79, 48, 0.14),
    0 14px 32px -26px rgba(150, 47, 24, 0.78);
}

.source-card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  margin-bottom: 0.48rem;
  color: var(--accent-700);
  font-size: 0.68rem;
  font-weight: 800;
}

.source-card-pill {
  display: inline-flex;
  height: 1.45rem;
  align-items: center;
  border: 1px solid var(--accent-100);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  padding: 0 0.5rem;
}

.source-card-topline .material-symbols-rounded {
  color: var(--ink-faint);
  font-size: 1rem;
}

.rail-source-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 740;
  line-height: 1.4;
}

.source-domain {
  margin-top: 0.3rem;
  color: var(--ink-faint);
  font-size: 0.72rem;
  font-weight: 650;
}

.rail-source-card p {
  margin: 0.58rem 0 0;
  color: var(--ink-muted);
  font-size: 0.78rem;
  line-height: 1.55;
}

.source-quality {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  margin-top: 0.75rem;
  border: 1px solid rgba(221, 213, 196, 0.72);
  border-radius: 999px;
  background: rgba(245, 238, 226, 0.7);
  padding: 0.32rem 0.58rem;
  color: var(--ink-muted);
  font-size: 0.72rem;
  font-weight: 760;
}

.source-quality .material-symbols-rounded {
  color: var(--accent-600);
  font-size: 0.86rem;
}

.empty-sources {
  border: 1px dashed var(--divider);
  border-radius: 0.55rem;
  background: rgba(245, 238, 226, 0.42);
  padding: 1rem;
  color: var(--ink-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

@media (max-width: 980px) {
  body.sources-open {
    overflow: hidden;
  }

  .audit-app-grid {
    display: block;
  }

  .audit-workspace,
  .audit-workspace.has-sources {
    display: block;
    min-height: 0;
    margin-left: 0;
    padding: 0.75rem;
  }

  .debate-thread-panel,
  .debate-thread-panel.is-connected {
    height: auto;
    min-height: 0;
    border-radius: 0.55rem;
  }

  .debate-thread-panel.is-connected {
    border-right: 1px solid rgba(221, 213, 196, 0.72);
  }

  .thread-scroll {
    overflow: visible;
  }

  .source-backdrop {
    position: fixed;
    inset: 0;
    z-index: 55;
    display: block;
    background: rgba(21, 18, 14, 0.2);
    backdrop-filter: blur(5px);
  }

  .evidence-rail-panel {
    position: fixed;
    inset: 0 0 0 auto;
    z-index: 60;
    width: min(92vw, 390px);
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }

  .rail-scroll {
    overflow-y: auto;
  }
}

@media (max-width: 720px) {
  .audit-workspace,
  .audit-workspace.has-sources {
    padding: 0.75rem 0.55rem 1rem;
  }

  .debate-thread-header {
    flex-direction: column;
    gap: 0.8rem;
    padding: 0.9rem;
  }

  .thread-title {
    font-size: 1rem;
  }

  .thread-title-block p {
    font-size: 0.94rem;
    line-height: 1.6;
  }

  .thread-action {
    width: 100%;
    height: 2.3rem;
  }

  .thread-scroll {
    padding: 0.85rem;
  }

  .message-row,
  .message-row.is-user {
    gap: 0.55rem;
  }

  .message-avatar {
    width: 2rem;
    height: 2rem;
  }

  .message-card {
    width: calc(100% - 2.55rem);
    padding: 0.8rem;
  }

  .message-content {
    font-size: 0.9rem;
    line-height: 1.7;
  }

  .message-source-button {
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.58rem;
  }

  .source-count {
    display: none;
  }
}
