:root {
  --bg: #f7f4ee;
  --bg-warm: rgba(210, 192, 165, 0.12);
  --surface: rgba(255, 255, 255, 0.9);
  --surface-strong: #ffffff;
  --border: #ddd5c8;
  --border-strong: #cec4b5;
  --text: #121212;
  --muted: #736d63;
  --muted-soft: #9b9488;
  --brand: #0f4a98;
  --brand-deep: #113e7b;
  --brand-soft: #e6eefb;
  --validated: #14653d;
  --validated-bg: #def4e6;
  --flagged: #9a6800;
  --flagged-bg: #fff0c8;
  --missing: #ab3e33;
  --missing-bg: #ffe3dd;
  --shadow: 0 30px 90px rgba(23, 18, 10, 0.08);
  --terminal: "SFMono-Regular", "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --sans: "SF Pro Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--sans);
  background:
    radial-gradient(circle at top center, rgba(255, 255, 255, 0.8), transparent 34%),
    radial-gradient(circle at 12% 10%, rgba(15, 74, 152, 0.08), transparent 24%),
    radial-gradient(circle at 88% 24%, rgba(15, 74, 152, 0.05), transparent 18%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.18)),
    var(--bg);
}

button,
textarea,
input {
  font: inherit;
}

.page-shell {
  max-width: 1380px;
  margin: 0 auto;
  padding: 16px 24px 56px;
}

.topbar,
.brand-lockup,
.topbar-meta,
.panel-header,
.summary-stats,
.input-footer,
.citation-topline,
.match-meta {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  padding: 6px 0 18px;
  border-bottom: 1px solid rgba(206, 196, 181, 0.6);
}

.brand-lockup {
  gap: 14px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: linear-gradient(180deg, #1657ae, #0f468e);
  color: white;
  display: grid;
  place-items: center;
  box-shadow: 0 14px 30px rgba(15, 74, 152, 0.18);
}

.brand-mark-glyph {
  font-size: 18px;
  line-height: 1;
  transform: translateY(-1px);
}

.brand-title {
  font-weight: 700;
  font-size: 18px;
  line-height: 1;
  letter-spacing: -0.02em;
}

.brand-subtitle {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar-meta {
  gap: 14px;
}

.topbar-context {
  color: #8b877f;
  font-size: 15px;
  letter-spacing: -0.02em;
}

.topbar-pill,
.eyebrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(206, 196, 181, 0.75);
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
}

.topbar-pill {
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
}

.beta-pill {
  background: var(--brand-soft);
  color: var(--brand);
  border-color: rgba(15, 74, 152, 0.08);
}

.hero {
  display: grid;
  gap: 24px;
  padding-top: 34px;
}

.hero-copy {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.eyebrow {
  padding: 8px 18px;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero-copy h1 {
  margin: 20px auto 12px;
  max-width: 760px;
  font-size: clamp(34px, 4.4vw, 56px);
  line-height: 1.02;
  letter-spacing: -0.06em;
  font-weight: 700;
}

.hero-copy p {
  margin: 0 auto;
  max-width: 760px;
  color: #57534b;
  font-size: clamp(16px, 1.2vw, 19px);
  line-height: 1.68;
  letter-spacing: -0.025em;
}

.workspace {
  display: grid;
  gap: 18px;
}

.draft-workspace {
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 860px);
  gap: 18px;
  align-items: stretch;
  justify-content: center;
}

.panel {
  background: var(--surface);
  border: 1px solid rgba(221, 213, 200, 0.88);
  border-radius: 26px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.input-panel,
.summary-panel,
.list-panel,
.login-panel {
  padding: 0;
}

.input-panel {
  width: min(100%, 860px);
  margin: 0 auto;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.72);
}

.saved-briefs-panel {
  min-height: 100%;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.78);
}

.compact-panel-header {
  align-items: flex-start;
  padding: 14px;
}

.saved-briefs-title {
  font-size: 17px;
  letter-spacing: -0.02em;
}

.saved-briefs-count-pill {
  border: 1px solid rgba(20, 101, 61, 0.18);
  border-radius: 999px;
  background: rgba(222, 244, 230, 0.72);
  color: var(--validated);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 6px 9px;
  text-transform: uppercase;
}

.input-panel-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 330px;
}

.save-brief-primary {
  appearance: none;
  border: 1px solid rgba(20, 101, 61, 0.24);
  border-radius: 14px;
  background: linear-gradient(180deg, #1f8d5b, #14653d);
  box-shadow: 0 14px 26px rgba(20, 101, 61, 0.18);
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  padding: 9px 12px;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.save-brief-primary:hover {
  box-shadow: 0 18px 34px rgba(20, 101, 61, 0.22);
  transform: translateY(-1px);
}

.save-brief-helper {
  flex-basis: 100%;
  color: #5f735f;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
  text-align: right;
}

.local-privacy-note {
  margin: 12px 12px 0;
  padding: 10px 12px;
  border: 1px solid rgba(20, 101, 61, 0.22);
  border-radius: 14px;
  background: rgba(222, 244, 230, 0.72);
  color: #24553c;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.saved-briefs-list {
  display: grid;
  gap: 10px;
  max-height: 280px;
  overflow: auto;
  padding: 12px;
}

.saved-brief-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(221, 213, 200, 0.88);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.86);
  cursor: grab;
}

.saved-brief-card.dragging {
  opacity: 0.62;
}

.saved-brief-title {
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  color: #1d252f;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
  text-align: left;
}

.saved-brief-title:hover {
  color: var(--brand);
}

.saved-brief-meta {
  color: var(--muted);
  font-size: 11px;
}

.saved-brief-actions {
  display: flex;
  gap: 8px;
}

.saved-brief-action {
  border: 1px solid rgba(206, 196, 181, 0.86);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--brand);
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  padding: 5px 9px;
}

.saved-brief-action.danger {
  color: var(--missing);
}

.compact-empty {
  padding: 14px;
  font-size: 13px;
}

.saved-section-divider {
  height: 1px;
  margin: 4px 12px 0;
  background: rgba(221, 213, 200, 0.86);
}

.saved-validations-header {
  padding-top: 14px;
}

.validation-privacy-note {
  background: rgba(230, 238, 251, 0.72);
  border-color: rgba(15, 74, 152, 0.2);
  color: #173a6d;
}

.saved-validations-list {
  max-height: 340px;
}

.saved-validation-card {
  border-color: rgba(15, 74, 152, 0.16);
}

.panel-header {
  justify-content: space-between;
  gap: 18px;
  padding: 14px 18px 12px;
  border-bottom: 1px solid rgba(221, 213, 200, 0.72);
}

.panel-header.compact {
  margin: 0;
}

.panel-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.terminal-label {
  font-family: var(--terminal);
  font-size: 15px;
  font-weight: 500;
  color: #9a9489;
  letter-spacing: 0.01em;
}

.panel-subtitle {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.judge-textarea,
.login-input {
  width: 100%;
  border: 0;
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
}

.judge-textarea {
  min-height: 300px;
  padding: 18px 18px;
  resize: vertical;
  font-family: var(--terminal);
  font-size: 16px;
  line-height: 1.62;
  letter-spacing: -0.01em;
  outline: none;
}

.judge-textarea::placeholder {
  color: #b2a99a;
}

.judge-textarea.drag-target {
  background: #f3f8ff;
  box-shadow: inset 0 0 0 3px rgba(15, 74, 152, 0.18);
}

.input-footer {
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  border-top: 1px solid rgba(221, 213, 200, 0.72);
  color: var(--muted);
}

.terminal-meta {
  font-size: 13px;
  color: #8f8779;
}

.status-line {
  font-size: 13px;
  text-align: right;
}

.login-input {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  font-size: 16px;
}

.primary-button,
.secondary-button {
  appearance: none;
  border: 0;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.primary-button:hover,
.secondary-button:hover {
  transform: translateY(-1px);
}

.primary-button {
  border-radius: 16px;
  padding: 12px 18px;
  background: linear-gradient(180deg, #1654a7, #0f478f);
  color: white;
  font-weight: 700;
  box-shadow: 0 20px 40px rgba(15, 74, 152, 0.22);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.7;
  transform: none;
}

.primary-button-large {
  min-width: 210px;
  padding: 15px 24px;
  border-radius: 18px;
  font-size: 16px;
  letter-spacing: -0.02em;
}

.secondary-button {
  border-radius: 14px;
  padding: 8px 10px;
  background: transparent;
  color: var(--brand);
  font-weight: 700;
  font-size: 13px;
}

.primary-button.full-width {
  width: 100%;
}

.cta-block {
  display: grid;
  gap: 12px;
  justify-items: center;
  margin-top: -2px;
}

.cta-caption {
  color: #9e978d;
  font-size: 12px;
}

.privacy-caption {
  max-width: 620px;
  color: #5f5a52;
  font-weight: 700;
  line-height: 1.45;
  text-align: center;
}

.hidden {
  display: none !important;
}

.review-shell {
  display: grid;
  gap: 18px;
  margin-top: 10px;
}

.review-topbar {
  display: grid;
  gap: 10px;
}

.review-banner {
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid rgba(221, 213, 200, 0.88);
  background: rgba(255, 255, 255, 0.78);
  font-size: 14px;
}

.review-banner strong {
  font-weight: 700;
}

.review-banner.success {
  background: #eef9f1;
  border-color: #bfe1c8;
  color: #1a633d;
}

.review-banner.warning {
  background: #fff8e9;
  border-color: #ebd18e;
  color: #8d5a00;
}

.review-banner.danger {
  background: #fff0ed;
  border-color: #efc0b8;
  color: #9e3227;
}

.review-actions,
.review-chip-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.review-stats-strip {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.mini-stat {
  min-width: 112px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(221, 213, 200, 0.88);
  background: rgba(255, 255, 255, 0.9);
}

.mini-stat-label {
  display: block;
  color: #8a8378;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.mini-stat strong {
  display: block;
  margin-top: 6px;
  font-size: 22px;
  line-height: 1;
  letter-spacing: -0.03em;
}

.review-actions {
  justify-content: space-between;
}

.review-button-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.bordered-button {
  border: 1px solid rgba(15, 74, 152, 0.2);
  background: rgba(230, 238, 251, 0.82);
}

.review-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(221, 213, 200, 0.88);
  background: #fff;
  font-size: 13px;
  font-weight: 700;
}

.review-chip span {
  font-variant-numeric: tabular-nums;
}

.review-chip.validated {
  background: var(--validated-bg);
  color: var(--validated);
  border-color: #9ed1b1;
}

.review-chip.flagged {
  background: var(--flagged-bg);
  color: var(--flagged);
  border-color: #efc96e;
}

.review-chip.missing {
  display: none;
}

.review-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(320px, 0.9fr);
  gap: 16px;
  align-items: start;
}

.review-main {
  display: grid;
  gap: 14px;
}

.review-section-label {
  color: #5f5a52;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.review-section-label span {
  color: #999286;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}

.citations-label {
  margin-top: 0;
}

.citation-carousel-header {
  align-items: flex-end;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-top: 22px;
}

.annotated-panel {
  padding: 0;
  overflow: hidden;
  position: relative;
}

.annotated-output {
  max-height: min(68vh, 820px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 20px 22px;
  scrollbar-gutter: stable;
}

.citation-mini-map {
  bottom: 14px;
  position: absolute;
  right: 8px;
  top: 14px;
  width: 8px;
  z-index: 3;
}

.citation-map-mark {
  appearance: none;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  height: 7px;
  left: 0;
  padding: 0;
  position: absolute;
  transform: translateY(-50%);
  width: 7px;
}

.citation-map-mark.validated {
  background: var(--validated);
}

.citation-map-mark.possible_match {
  background: var(--flagged);
}

.citation-map-mark.selected {
  box-shadow: 0 0 0 5px rgba(15, 74, 152, 0.16);
  outline: 2px solid #fff;
}

.annotated-pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--terminal);
  font-size: 15px;
  line-height: 1.78;
  color: #1a1916;
}

.annotated-citation {
  border: 0;
  padding: 0;
  background: transparent;
  font: inherit;
  line-height: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
  cursor: pointer;
}

.annotated-citation.validated {
  color: var(--validated);
}

.annotated-citation.possible_match {
  color: var(--flagged);
}

.annotated-citation.missing {
  color: var(--missing);
}

.annotated-citation.selected {
  background: rgba(15, 74, 152, 0.08);
  border-radius: 6px;
  box-shadow: 0 0 0 5px rgba(15, 74, 152, 0.08);
}

.annotated-citation.pulse {
  animation: citation-pulse 900ms ease;
}

@keyframes citation-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(15, 74, 152, 0.24);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(15, 74, 152, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(15, 74, 152, 0);
  }
}

.citation-filter-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.citation-filter {
  appearance: none;
  border: 1px solid rgba(221, 213, 200, 0.92);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: #5f5a52;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  padding: 7px 11px;
}

.citation-filter.active {
  background: var(--brand-soft);
  border-color: rgba(15, 74, 152, 0.3);
  color: var(--brand);
}

.citation-carousel-controls {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  padding-bottom: 2px;
}

.carousel-button {
  appearance: none;
  align-items: center;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(221, 213, 200, 0.92);
  border-radius: 999px;
  color: var(--brand);
  cursor: pointer;
  display: inline-flex;
  font-size: 18px;
  font-weight: 800;
  height: 40px;
  justify-content: center;
  line-height: 1;
  width: 40px;
}

.carousel-button:hover {
  background: var(--brand-soft);
  border-color: rgba(15, 74, 152, 0.28);
}

.citation-review-list {
  display: flex;
  gap: 14px;
  margin-inline: -4px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 4px 16px;
  scroll-behavior: smooth;
  scroll-padding-left: 4px;
  scroll-snap-type: x mandatory;
  scrollbar-color: rgba(15, 74, 152, 0.42) rgba(246, 242, 235, 0.9);
  scrollbar-width: thin;
}

.citation-review-list::-webkit-scrollbar {
  height: 10px;
}

.citation-review-list::-webkit-scrollbar-track {
  background: rgba(246, 242, 235, 0.9);
  border-radius: 999px;
}

.citation-review-list::-webkit-scrollbar-thumb {
  background: rgba(15, 74, 152, 0.38);
  border-radius: 999px;
}

.citation-review-row {
  min-height: 132px;
  min-width: min(420px, 82vw);
  width: min(420px, 82vw);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(221, 213, 200, 0.92);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 34px rgba(29, 24, 17, 0.07);
  cursor: pointer;
  flex: 0 0 auto;
  scroll-snap-align: start;
  text-align: left;
}

.citation-review-row:hover {
  border-color: rgba(15, 74, 152, 0.24);
  box-shadow: 0 18px 40px rgba(29, 24, 17, 0.1);
  transform: translateY(-1px);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.citation-review-row.selected {
  border-color: rgba(15, 74, 152, 0.38);
  box-shadow: 0 0 0 4px rgba(15, 74, 152, 0.08);
}

.citation-row-left {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.citation-number {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  flex: 0 0 auto;
  border: 1px solid currentColor;
}

.citation-number.validated {
  color: var(--validated);
  background: var(--validated-bg);
}

.citation-number.possible_match {
  color: var(--flagged);
  background: var(--flagged-bg);
}

.citation-number.missing {
  color: var(--missing);
  background: var(--missing-bg);
}

.citation-row-text {
  min-width: 0;
  font-family: var(--terminal);
  font-size: 14px;
  line-height: 1.45;
  color: #1c1b18;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.citation-row-right {
  align-items: flex-end;
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  gap: 6px;
  justify-content: center;
}

.citation-confidence {
  border-radius: 999px;
  background: rgba(246, 242, 235, 0.95);
  color: #6d6559;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 4px 8px;
  text-transform: uppercase;
  white-space: nowrap;
}

.citation-confidence.validated {
  background: rgba(222, 244, 230, 0.78);
  color: var(--validated);
}

.citation-confidence.possible_match {
  background: rgba(255, 240, 200, 0.88);
  color: var(--flagged);
}

.citation-pill,
.detail-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(221, 213, 200, 0.88);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.citation-pill.validated,
.detail-status-badge.validated {
  background: var(--validated-bg);
  color: var(--validated);
  border-color: #9ed1b1;
}

.citation-pill.possible_match,
.detail-status-badge.possible_match {
  background: var(--flagged-bg);
  color: var(--flagged);
  border-color: #efc96e;
}

.citation-pill.missing,
.detail-status-badge.missing {
  background: var(--missing-bg);
  color: var(--missing);
  border-color: #efb4aa;
}

.detail-status-badge.neutral {
  background: rgba(255, 255, 255, 0.82);
  color: #837d73;
}

.detail-panel {
  max-height: min(78vh, 900px);
  min-height: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 18px;
  position: sticky;
  scrollbar-gutter: stable;
  top: 16px;
}

.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(221, 213, 200, 0.82);
}

.detail-empty-state {
  min-height: 420px;
  display: grid;
  place-items: center;
  text-align: center;
  color: #999286;
  gap: 10px;
}

.detail-empty-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  border: 1px solid rgba(221, 213, 200, 0.82);
  background: rgba(255, 255, 255, 0.84);
  font-size: 20px;
}

.detail-content {
  display: grid;
  gap: 14px;
  padding-top: 14px;
}

.detail-citation {
  font-size: 17px;
  line-height: 1.45;
  letter-spacing: -0.03em;
  font-weight: 700;
  word-break: break-word;
  max-height: 122px;
  overflow: auto;
}

.detail-key {
  font-family: var(--terminal);
  font-size: 11px;
  color: #8d867b;
  word-break: break-all;
}

.detail-group {
  display: grid;
  gap: 8px;
}

.detail-group-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #827b70;
}

.detail-checks {
  display: grid;
  gap: 10px;
}

.detail-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  background: #faf7f0;
  border: 1px solid rgba(221, 213, 200, 0.86);
}

.detail-check.ok {
  background: #f3fbf5;
}

.detail-check.warn {
  background: #fff7ee;
}

.detail-check-dot {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  flex: 0 0 auto;
  background: rgba(18, 18, 18, 0.06);
}

.detail-check-body {
  display: grid;
  gap: 3px;
}

.detail-check-body strong {
  font-size: 13px;
}

.detail-check-body span {
  color: #6f695f;
  font-size: 12px;
  line-height: 1.5;
}

.detail-match-box {
  padding: 12px;
  border-radius: 12px;
  background: #faf7f0;
  border: 1px solid rgba(221, 213, 200, 0.86);
}

.detail-info-box {
  display: grid;
  gap: 7px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(221, 213, 200, 0.86);
  color: #635d54;
  font-size: 12px;
  line-height: 1.5;
}

.detail-info-box strong {
  color: #201f1c;
}

.detail-match-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
}

.detail-match-meta,
.detail-meta,
.detail-source-uri {
  color: #6f695f;
  font-size: 12px;
  line-height: 1.55;
}

.detail-source-uri {
  margin-top: 8px;
  font-family: var(--terminal);
  font-size: 11px;
  word-break: break-all;
}

.detail-meta {
  display: grid;
  gap: 6px;
}

.confidence-readout {
  color: #111;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0;
}

.muted-detail {
  color: #8d867b;
}

.empty-state {
  padding: 40px 28px;
  border: 1px dashed rgba(206, 196, 181, 0.9);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.56);
  color: var(--muted);
  text-align: center;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.login-panel {
  width: min(440px, calc(100vw - 32px));
  padding: 28px;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(247, 244, 238, 0.82);
  backdrop-filter: blur(8px);
}

.loading-card {
  width: min(100%, 620px);
  padding: 44px 42px 36px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(221, 213, 200, 0.9);
  box-shadow: 0 40px 90px rgba(23, 18, 10, 0.1);
  text-align: center;
}

.loading-spinner {
  width: 86px;
  height: 86px;
  margin: 0 auto 22px;
  border-radius: 50%;
  border: 4px solid rgba(15, 74, 152, 0.12);
  border-top-color: var(--brand);
  animation: judge-spin 1s linear infinite;
}

.loading-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.loading-subtitle {
  margin-top: 10px;
  color: #91897f;
  font-size: 16px;
}

.loading-progress-track {
  width: 100%;
  height: 8px;
  margin: 26px 0 24px;
  border-radius: 999px;
  background: #ece8e0;
  overflow: hidden;
}

.loading-progress-bar {
  height: 100%;
  width: 18%;
  border-radius: inherit;
  background: linear-gradient(90deg, #195bb1, #0f478f);
  transition: width 220ms ease;
}

.loading-steps {
  display: grid;
  gap: 12px;
  text-align: left;
}

.loading-step {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #cbc4ba;
  font-family: var(--terminal);
  font-size: 14px;
}

.loading-step-dot {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(18, 18, 18, 0.05);
  color: #d7d1c8;
  font-size: 14px;
  flex: 0 0 auto;
}

.loading-step.done {
  color: #1d5f39;
}

.loading-step.done .loading-step-dot {
  background: #dff3e6;
  color: #1d5f39;
}

.loading-step.active {
  color: #163a6f;
}

.loading-step.active .loading-step-dot {
  background: #e6eefb;
  color: #163a6f;
}

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

@media (max-width: 1100px) {
  .hero-copy h1 {
    max-width: 760px;
  }

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

  .saved-briefs-list {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    max-height: none;
  }

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

  .detail-panel {
    max-height: none;
    position: static;
  }
}

@media (max-width: 860px) {
  .page-shell {
    padding: 16px 16px 40px;
  }

  .topbar {
    align-items: flex-start;
    gap: 16px;
    flex-direction: column;
  }

  .topbar-meta {
    align-self: stretch;
    justify-content: space-between;
  }

  .hero {
    padding-top: 30px;
  }

  .hero-copy h1 {
    font-size: clamp(38px, 10vw, 56px);
  }

  .hero-copy p {
    font-size: 18px;
  }

  .review-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .review-stats-strip {
    width: 100%;
  }

  .panel-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .input-panel-actions {
    align-items: flex-start;
    justify-content: flex-start;
    max-width: none;
    width: 100%;
  }

  .save-brief-helper {
    text-align: left;
  }

  .judge-textarea {
    min-height: 300px;
    font-size: 17px;
  }

  .input-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .annotated-output {
    max-height: 62vh;
    padding: 18px;
  }

  .citation-carousel-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .citation-carousel-controls {
    align-self: stretch;
    justify-content: flex-end;
  }

  .citation-review-row {
    min-width: min(330px, 86vw);
    width: min(330px, 86vw);
  }

  .detail-panel {
    padding: 18px;
  }

  .loading-card {
    padding: 34px 24px 28px;
  }
}
