:root {
  color-scheme: light;
  --paper: #faf9f7;
  --paper-strong: #ffffff;
  --ink: #191816;
  --muted: #6f6a61;
  --line: #d9d1c4;
  --line-dark: #aaa092;
  --accent: #cc3b14;
  --orange: #ff5d31;
  --orange-soft: #ffd9cb;
  --cobalt: #2f54eb;
  --lilac: #cfc5ff;
  --lime: #d9ff65;
  --red: #a53a2b;
  --radius-card: 16px;
  --radius-control: 10px;
  --font-sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: Georgia, "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
textarea,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
textarea:focus-visible,
input:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
  outline-color: var(--ink);
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  transform: translateY(-160%);
  border-radius: var(--radius-control);
  background: var(--ink);
  color: white;
  text-decoration: none;
}

.skip-link:focus {
  transform: translateY(0);
}

.app-frame {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: 12px clamp(18px, 3vw, 44px);
  border-bottom: 1px solid rgba(170, 160, 146, 0.55);
  background: var(--paper);
  backdrop-filter: none;
  border-bottom-color: var(--line);
}

.brand {
  display: inline-flex;
  gap: 11px;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 20px;
  letter-spacing: -0.03em;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--ink);
  border-radius: var(--radius-control);
  background: var(--ink);
}

.brand-mark i {
  position: absolute;
  width: 22px;
  height: 8px;
  border: 2px solid var(--ink);
  border-radius: var(--radius-control);
  background: var(--paper-strong);
  transform: rotate(-24deg) translateY(-3px);
}

.brand-mark i:last-child {
  transform: rotate(-24deg) translateY(5px);
}

.topbar-actions,
.connection-pill {
  display: flex;
  align-items: center;
}

.topbar-actions {
  gap: 10px;
}

.connection-pill {
  gap: 8px;
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--paper-strong);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.connection-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-control);
  background: var(--line-dark);
  box-shadow: none;
}

.connection-pill.is-connected .connection-dot {
  background: var(--ink);
  box-shadow: none;
}

.connection-pill.is-human .connection-dot {
  background: var(--line-dark);
  box-shadow: none;
}

#main-content {
  padding: clamp(24px, 4vw, 58px) clamp(18px, 3vw, 44px) 72px;
}

.review-shell {
  max-width: min(1920px, 92vw);
  margin: 0 auto;
  overflow-wrap: anywhere;
}

.review-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 30px;
  align-items: start;
  margin-bottom: 24px;
}

.review-header > div {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.review-title {
  max-width: 30ch;
  margin: 0;
  font-family: var(--font-sans);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.review-deck {
  max-width: 720px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 16px;
}

.round-switcher {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 5px;
  max-width: 100%;
  padding: 5px;
  border: 1px solid var(--line-dark);
  border-radius: 999px;
  background: var(--paper-strong);
}

.round-button {
  min-width: 118px;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-height: 44px;
  padding: 8px 15px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}

.round-button.is-active {
  background: var(--ink);
  color: white;
}

.round-button .round-state {
  display: block;
  color: inherit;
  font-size: 12px;
  font-weight: 400;
  opacity: 0.7;
}

.context-band {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.75fr);
  gap: 1px;
  overflow: hidden;
  margin-bottom: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--line);
}

.brief-panel,
.evidence-panel {
  padding: 20px 22px;
  background: var(--paper-strong);
}

.brief-panel--compact {
  max-width: 820px;
  margin-top: 16px;
  padding: 14px 16px;
  border: 0;
  border-radius: 0;
  background: var(--paper-strong);
}

.brief-panel--compact .panel-label {
  margin-bottom: 5px;
}

.brief-panel--compact > p {
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
  white-space: normal;
}

.evidence-disclosure {
  margin-top: 12px;
  border-top: 1px solid var(--line);
}

.evidence-summary {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  cursor: pointer;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  list-style: none;
}

.evidence-summary::-webkit-details-marker,
.disclosure-summary::-webkit-details-marker {
  display: none;
}

.evidence-content {
  padding: 12px 0 2px;
}

.evidence-group {
  margin-bottom: 12px;
}

.evidence-group .field-label {
  margin-bottom: 6px;
}

.evidence-group .constraint-list {
  margin-top: 0;
}

.panel-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.brief-panel p,
.evidence-panel p {
  margin: 0;
}

.brief-panel p {
  max-width: 760px;
  font-size: 16px;
  font-weight: 600;
}

.evidence-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 14px;
}

.evidence-list li::marker {
  color: var(--ink);
  font-weight: 700;
}

.constraint-list,
.reason-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 11px 0 0;
  padding: 0;
  list-style: none;
}

.constraint-list li {
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(360px, 1fr);
  gap: clamp(20px, 2.6vw, 38px);
  align-items: start;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.section-heading h2,
.decision-desk h2,
.history-card h2,
.trail-section h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

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

.candidate-grid[data-candidate-count="2"],
.candidate-grid[data-candidate-count="4"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.candidate-card {
  position: relative;
  display: flex;
  align-self: start;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-card);
  background: var(--paper-strong);
  box-shadow: none;
  cursor: default;
  text-align: left;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.candidate-card:hover {
  transform: none;
}

.candidate-card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent);
}

.selection-check {
  position: absolute;
  z-index: 4;
  top: 12px;
  right: 12px;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(25, 24, 22, 0.55);
  border-radius: 50%;
  background: var(--paper-strong);
  color: transparent;
  font-size: 14px;
  border-color: var(--line-dark);
}

.candidate-card.is-selected .selection-check {
  background: var(--ink);
  color: white;
}

.candidate-inner {
  display: flex;
  width: 100%;
  flex-direction: column;
}

.artifact-frame {
  margin: 0;
  border-bottom: 1px solid rgba(25, 24, 22, 0.28);
}

.artifact-frame--text {
  min-height: clamp(250px, 20vw, 430px);
  padding: clamp(26px, 3vw, 44px);
  background:
    linear-gradient(135deg, rgba(217, 208, 255, 0.58), transparent 46%),
    var(--paper);
}

.artifact-kind {
  display: block;
  margin-bottom: clamp(34px, 6vw, 84px);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.artifact-text {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(25px, 2.5vw, 39px);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.08;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.artifact-image-stage {
  display: grid;
  height: clamp(290px, 30vw, 520px);
  place-items: center;
  padding: 12px;
  background:
    linear-gradient(45deg, rgba(25, 24, 22, 0.035) 25%, transparent 25%) 0 0 / 18px 18px,
    linear-gradient(-45deg, rgba(25, 24, 22, 0.035) 25%, transparent 25%) 0 9px / 18px 18px,
    var(--paper);
}

.artifact-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.artifact-load-error {
  max-width: 28ch;
  margin: 0;
  color: var(--muted);
  text-align: center;
}

.artifact-caption {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.artifact-caption span {
  overflow-wrap: anywhere;
}

.artifact-caption a {
  flex: 0 0 auto;
  color: var(--ink);
  font-weight: 700;
  text-underline-offset: 3px;
}

.poster {
  position: relative;
  min-height: clamp(300px, 22vw, 560px);
  overflow: hidden;
  border-bottom: 1px solid rgba(25, 24, 22, 0.28);
  isolation: isolate;
}

.poster::before,
.poster::after {
  position: absolute;
  content: "";
}

.poster-copy {
  position: absolute;
  z-index: 3;
  inset: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.poster-kicker {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.poster-title {
  max-width: 90%;
  font-family: var(--font-display);
  font-size: clamp(29px, 3vw, 46px);
  font-weight: 400;
  letter-spacing: -0.06em;
  line-height: 0.9;
}

.poster-code {
  align-self: flex-end;
  font-size: 14px;
  font-weight: 700;
}

.poster--signal {
  background: #d9d0ff;
}

.poster--signal::before {
  top: 18%;
  right: -16%;
  width: 82%;
  aspect-ratio: 1;
  border: 2px solid var(--ink);
  border-radius: 50%;
  box-shadow: inset 0 0 0 32px #ff7b56, inset 0 0 0 34px var(--ink);
}

.poster--signal::after {
  right: 16%;
  bottom: 11%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 22px -17px 0 4px var(--ink), -26px 8px 0 7px white;
}

.poster--pulse {
  background: var(--ink);
  color: var(--lime);
}

.poster--pulse::before {
  inset: 19% -30% auto 28%;
  height: 29%;
  border: 2px solid var(--lime);
  border-radius: 50%;
  box-shadow: 0 25px 0 -2px var(--orange), 0 50px 0 -2px var(--lilac), 0 75px 0 -2px var(--lime);
  transform: rotate(-17deg);
}

.poster--pulse::after {
  right: 20px;
  bottom: 18px;
  width: 54px;
  height: 54px;
  border-radius: 5px 50% 50%;
  background: var(--orange);
  transform: rotate(25deg);
}

.poster--window {
  background: #bfe8ff;
  color: #1b2a6b;
}

.poster--window::before {
  top: 16%;
  left: 12%;
  width: 62%;
  height: 58%;
  border: 2px solid #1b2a6b;
  border-radius: 44% 44% 8px 8px;
  background: linear-gradient(90deg, transparent 49%, #1b2a6b 49%, #1b2a6b 51%, transparent 51%), linear-gradient(#ffddcb 49%, #1b2a6b 49%, #1b2a6b 51%, #6e7ef4 51%);
  box-shadow: 16px 16px 0 var(--orange);
}

.poster--window::after {
  right: 8%;
  bottom: 8%;
  width: 34%;
  height: 6px;
  border-radius: 999px;
  background: #1b2a6b;
  box-shadow: 0 -14px 0 #1b2a6b, 0 -28px 0 #1b2a6b;
}

.poster--orbit {
  background: #ffcf70;
  color: #30200e;
}

.poster--orbit::before {
  top: 10%;
  left: 4%;
  width: 90%;
  aspect-ratio: 1;
  border: 2px solid currentColor;
  border-radius: 50%;
  box-shadow: inset 0 0 0 29px #ff6b45, inset 0 0 0 31px currentColor, inset 0 0 0 74px #9d91ff, inset 0 0 0 76px currentColor;
}

.poster--orbit::after {
  top: 44%;
  left: 46%;
  width: 24px;
  height: 24px;
  border: 2px solid currentColor;
  border-radius: 50%;
  background: var(--lime);
}

.poster--editorial {
  background: #f5ede0;
}

.poster--editorial::before {
  top: 0;
  right: 0;
  width: 43%;
  height: 100%;
  background: repeating-linear-gradient(135deg, var(--cobalt) 0 14px, var(--paper-strong) 14px 28px);
}

.poster--editorial::after {
  right: 12%;
  bottom: 14%;
  width: 95px;
  height: 135px;
  border: 2px solid var(--ink);
  background: var(--orange-soft);
  transform: rotate(8deg);
}

.poster--field {
  background: #174c3b;
  color: #f6f1df;
}

.poster--field::before {
  right: -19%;
  bottom: -9%;
  width: 93%;
  aspect-ratio: 1;
  border: 2px solid var(--lime);
  border-radius: 49% 51% 33% 67%;
  box-shadow: inset 0 0 0 36px #317b59, inset 0 0 0 38px var(--lime);
}

.poster--field::after {
  top: 27%;
  left: 16%;
  width: 14px;
  height: 90px;
  border-radius: 999px;
  background: var(--orange);
  transform: rotate(32deg);
}

.candidate-meta {
  display: grid;
  gap: 7px;
  padding: 15px 16px 17px;
}

.candidate-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.candidate-name {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.candidate-fit {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.candidate-select {
  width: 100%;
  min-height: 44px;
  margin-top: 5px;
  padding: 9px 12px;
  border: 1px solid var(--ink);
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
}

.candidate-select:hover,
.candidate-select:focus-visible,
.candidate-card.is-selected .candidate-select {
  background: var(--ink);
  color: white;
}

.candidate-index {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.decision-column {
  position: sticky;
  top: 96px;
}

.decision-desk,
.trail-section,
.agent-desk {
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-card);
  background: var(--paper-strong);
  box-shadow: none;
}

.decision-desk {
  padding: 20px;
}

.desk-topline {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.precedent-badge,
.stage-badge {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.selected-summary {
  display: flex;
  align-items: center;
  min-height: 72px;
  margin-bottom: 17px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.selected-summary strong,
.selected-summary small {
  display: block;
}

.candidate-insights {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  margin: 0;
}

.candidate-insights p {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: var(--muted);
  font-size: 14px;
  background: transparent;
}

.selected-summary small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 14px;
}

.empty-copy {
  color: var(--muted);
  font-size: 14px;
}

.field-group {
  margin-top: 17px;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
}

.field-hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.reason-chip {
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--line-dark);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
}

.reason-chip.is-selected {
  border-color: var(--ink);
  background: var(--ink);
  color: white;
}

.decision-note {
  width: 100%;
  min-height: 88px;
  resize: vertical;
  padding: 11px 12px;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-card);
  background: white;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
}

.decision-note::placeholder {
  color: #9a9186;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px 15px;
  border: 1px solid var(--ink);
  border-radius: var(--radius-control);
  background: var(--ink);
  color: white;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  transition: transform 140ms ease, opacity 140ms ease, background 140ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:disabled {
  background: var(--paper);
  border-color: var(--line-dark);
  color: var(--muted);
  cursor: not-allowed;
  opacity: 1;
}

.button--primary {
  width: 100%;
  margin-top: 16px;
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.button--agent {
  width: 100%;
  margin-top: 8px;
  border-color: var(--ink);
  background: var(--paper-strong);
  color: var(--ink);
}

.button--quiet {
  border-color: var(--ink);
  background: var(--paper-strong);
  color: var(--ink);
}

.button--compact {
  min-height: 36px;
  padding: 7px 11px;
  border-radius: var(--radius-control);
  font-size: 14px;
}

.commit-explainer {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.approval-panel {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding: 13px;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-card);
  background: var(--paper);
}

.approval-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.approval-panel code {
  display: block;
  min-width: 0;
  overflow: hidden;
  padding: 7px 8px;
  border-radius: var(--radius-control);
  background: var(--paper-strong);
  color: var(--ink);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid var(--line);
}

.approval-id-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.text-action {
  width: 100%;
  margin-top: 12px;
  padding: 7px;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
}

.history-card,
.agent-stage {
  padding: 18px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.agent-desk,
.trail-section {
  margin-top: 24px;
}

.disclosure-summary {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 17px 19px;
  cursor: pointer;
  list-style: none;
}

.disclosure-title {
  min-width: 0;
}

.disclosure-title .panel-label {
  margin-bottom: 3px;
}

.disclosure-heading {
  display: block;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.disclosure-badge {
  display: block;
  flex: 0 0 auto;
  align-items: center;
  min-height: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
  border: 0;
}

.disclosure-card[open] > .disclosure-summary {
  border-bottom: 1px solid var(--line);
}

.agent-desk-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 0;
  background: transparent;
}

.agent-desk .history-card,
.agent-desk .agent-stage {
  min-width: 0;
  padding: 18px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.agent-desk-pane h3 {
  margin: 0;
  font-size: 14px;
  letter-spacing: -0.02em;
  font-weight: 600;
}

.history-header,
.stage-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.precedent-badge {
  background: transparent;
  color: var(--muted);
  border: 0;
  border-radius: 0;
  font-size: 14px;
}

.stage-badge {
  background: transparent;
  color: var(--muted);
  border: 0;
  border-radius: 0;
  font-size: 14px;
}

.history-card p,
.agent-stage p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.history-assessment-label {
  margin-top: 14px;
}

.history-action {
  width: 100%;
  margin-top: 9px;
}

.analysis-frozen {
  display: grid;
  gap: 3px;
  margin-top: 13px;
  padding: 12px 0 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  border-top: 1px solid var(--line);
}

.analysis-frozen span {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.analysis-frozen strong {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.overlap-line {
  color: var(--muted) !important;
  font-size: 14px !important;
  font-weight: 600;
}

.no-match {
  padding: 0;
  border-radius: 0;
  background: transparent;
}

.precedent-record,
.stage-record {
  margin-top: 12px;
  padding: 12px 0 0 12px;
  border-left: 3px solid var(--cobalt);
  border-radius: 0;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--line);
}

.stage-record {
  border-left-color: var(--ink);
  margin-top: 12px;
  padding: 12px 0 0 12px;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.stage-actions {
  display: flex;
  margin-top: 10px;
}

.stage-actions .text-action {
  width: auto;
  margin-top: 0;
}

.stage-precedent {
  color: var(--muted);
  font-size: 12px;
}

.precedent-record strong,
.stage-record strong {
  display: block;
  font-size: 14px;
}

.context-difference {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.difference-cell {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 14px;
}

.difference-cell span {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.trail-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin-top: 0;
}

.trail-content {
  padding: 0 19px 19px;
}

.trail-item {
  display: grid;
  gap: 4px;
  padding: 12px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.trail-item strong {
  font-size: 14px;
}

.trail-item span {
  color: var(--muted);
  font-size: 14px;
}

.trail-artifact {
  margin-top: 5px;
  padding-top: 7px;
  border-top: 1px solid var(--line);
}

.trail-artifact summary {
  width: fit-content;
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.trail-artifact-text {
  max-width: 72ch;
  margin: 10px 0 2px;
  padding: 12px 14px;
  border-radius: var(--radius-control);
  background: var(--paper);
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.trail-artifact-image {
  display: grid;
  gap: 4px;
  margin-top: 9px;
}

.trail-artifact-image a {
  width: fit-content;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  text-underline-offset: 3px;
}

.trail-artifact-image small {
  color: var(--muted);
}

.trail-empty {
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.saved-banner,
.error-banner {
  display: flex;
  gap: 9px;
  align-items: center;
  margin-top: 12px;
  padding: 10px 11px;
  border-radius: var(--radius-control);
  font-size: 14px;
  font-weight: 700;
  border: 1px solid var(--line-dark);
  background: var(--paper);
}

.saved-banner {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-control);
  font-size: 14px;
  font-weight: 700;
}

.error-banner {
  background: var(--paper);
  color: var(--red);
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-control);
  font-size: 14px;
  font-weight: 700;
}

.loading-state {
  display: grid;
  min-height: 55vh;
  place-items: center;
  align-content: center;
  gap: 12px;
  color: var(--muted);
}

.loading-mark {
  width: 42px;
  height: 42px;
  border: 2px solid var(--line-dark);
  border-top-color: var(--ink);
  border-radius: var(--radius-control);
  animation: spin 800ms linear infinite;
}

.toast-region {
  position: fixed;
  z-index: 50;
  top: 16px;
  right: auto;
  bottom: auto;
  left: 50%;
  display: grid;
  gap: 8px;
  transform: translateX(-50%);
  width: min(360px, calc(100vw - 40px));
}

.toast {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border: 1px solid var(--ink);
  border-radius: var(--radius-control);
  background: var(--ink);
  color: white;
  box-shadow: none;
  font-size: 14px;
}

.toast .button--quiet {
  flex: 0 0 auto;
  background: transparent;
  border-color: rgba(255, 255, 255, 0.65);
  color: white;
}

.toast .button--quiet:hover,
.toast .button--quiet:focus-visible {
  background: rgba(255, 255, 255, 0.14);
}

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

/* Bring your own review — custom round creation */

.round-button--new {
  min-width: 104px;
  color: var(--ink);
}

.round-button--new.is-active {
  background: var(--ink);
  color: white;
}

.new-round-card {
  margin-bottom: 28px;
  padding: 20px;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-card);
  background: var(--paper-strong);
  box-shadow: none;
}

.new-round-card h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.025em;
  font-weight: 600;
}

.new-round-card > p {
  max-width: 760px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.medium-picker {
  min-width: 0;
  margin: 20px 0 2px;
  padding: 0;
  border: 0;
}

.medium-picker legend {
  padding: 0;
}

.medium-picker > p {
  margin: -3px 0 10px;
  color: var(--muted);
  font-size: 13px;
}

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

.medium-option {
  display: flex;
  min-width: 0;
  gap: 11px;
  align-items: flex-start;
  padding: 13px 14px;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-control);
  background: white;
  cursor: pointer;
}

.medium-option.is-selected {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
}

.medium-option input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--ink);
}

.medium-option span,
.medium-option strong,
.medium-option small {
  display: block;
}

.medium-option span {
  min-width: 0;
}

.medium-option small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.new-round-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0 16px;
}

.field-input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-control);
  background: white;
  color: var(--ink);
  font-size: 14px;
}

.field-input::placeholder {
  color: #9a9186;
}

.candidate-fieldset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(238px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.candidate-fieldset {
  min-width: 0;
  margin: 0;
  padding: 10px 14px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--paper-strong);
}

.candidate-fieldset legend {
  padding: 0 6px;
  color: var(--ink);
  letter-spacing: 0;
  text-transform: none;
  font-size: 14px;
  font-weight: 600;
}

.candidate-fieldset .field-group {
  margin-top: 11px;
}

.candidate-remove {
  margin-top: 11px;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--red);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
}

.new-round-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 18px;
}

.new-round-actions .button--primary {
  width: auto;
  margin-top: 0;
  margin-left: auto;
}

.agent-desk .agent-stage {
  border-left: 1px solid var(--line);
}

.trail-item + .trail-item {
  border-top: 1px solid var(--line);
}

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

  .decision-column {
    position: static;
  }
}

@media (max-width: 820px) {
  .review-header {
    grid-template-columns: 1fr;
  }

  .round-switcher {
    width: 100%;
  }

  .round-button {
    flex: 1;
  }

  .context-band {
    grid-template-columns: 1fr;
  }

  .candidate-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .agent-desk-grid {
    grid-template-columns: 1fr;
  }

  .agent-desk .agent-stage {
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

@media (max-width: 640px) {
  .topbar {
    align-items: flex-start;
  }

  .brand small,
  #reset-demo {
    display: none;
  }

  .connection-pill {
    max-width: 150px;
  }

  .review-title {
    font-size: 32px;
  }

  .candidate-grid,
  .candidate-grid[data-candidate-count="2"],
  .candidate-grid[data-candidate-count="4"] {
    grid-template-columns: 1fr;
  }

  .medium-options {
    grid-template-columns: 1fr;
  }

  .artifact-frame--text {
    min-height: 240px;
    padding: 26px 22px;
  }

  .artifact-kind {
    margin-bottom: 48px;
  }

  .artifact-image-stage {
    height: min(82vw, 390px);
  }

  .artifact-caption {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .poster {
    min-height: 390px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .context-difference {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
