:root {
  color-scheme: light;
  --canvas: #f3f6f4;
  --surface: #ffffff;
  --surface-muted: #eef2f0;
  --ink: #111615;
  --muted: #5d6865;
  --line: #d5ddda;
  --line-strong: #aebbb6;
  --attack: #b4233d;
  --attack-dark: #7d172a;
  --attack-soft: #fff0f3;
  --benign: #08705c;
  --benign-dark: #075346;
  --benign-soft: #e9f7f2;
  --cobalt: #244a84;
  --cobalt-soft: #edf2fb;
  --review: #9a6308;
  --review-soft: #fff5dd;
  --focus: #1d62c5;
  --mono: "SFMono-Regular", "Cascadia Code", "Roboto Mono", Consolas, monospace;
  --sans: "Avenir Next", Avenir, "Segoe UI", Helvetica, Arial, sans-serif;
  --shadow: 0 12px 30px rgba(17, 22, 21, 0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--canvas);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
}

button,
input,
select {
  color: inherit;
  font: inherit;
}

button,
select {
  cursor: pointer;
}

a {
  color: var(--cobalt);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--attack-dark);
}

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus) 40%, transparent);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 9px 12px;
  color: #fff;
  background: var(--ink);
  border-radius: 4px;
  transform: translateY(-150%);
}

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

.app-shell {
  width: min(100%, 1480px);
  margin: 0 auto;
  padding: 24px 30px 18px;
}

.app-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  padding: 15px 0 24px;
  border-bottom: 1px solid var(--line-strong);
}

.identity-block {
  display: flex;
  align-items: flex-start;
  gap: 17px;
  min-width: 0;
}

.identity-block > div,
.source-state > div,
.pair-toolbar > *,
.scenario-toolbar > * {
  min-width: 0;
}

.brand-mark {
  width: 50px;
  height: 50px;
  flex: 0 0 50px;
  object-fit: contain;
}

.utility-line,
.section-kicker {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.4;
}

.utility-line span {
  padding: 0 6px;
  color: var(--attack);
}

.app-header h1 {
  max-width: 900px;
  margin: 5px 0 4px;
  font-size: clamp(28px, 3.4vw, 48px);
  font-weight: 760;
  letter-spacing: 0;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.app-header p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

.header-side {
  display: grid;
  justify-items: end;
  gap: 12px;
  min-width: 270px;
}

.source-state {
  display: grid;
  grid-template-columns: 9px auto;
  align-items: start;
  gap: 10px;
}

.source-dot {
  width: 9px;
  height: 9px;
  margin-top: 5px;
  background: var(--benign);
  border-radius: 50%;
  box-shadow: 0 0 0 4px var(--benign-soft);
}

.source-state strong,
.source-state span {
  display: block;
}

.source-state strong {
  font-size: 13px;
}

.source-state span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.header-links,
.app-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.header-links a,
.app-footer a {
  font-size: 12px;
  font-weight: 650;
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}

.stats-strip > div {
  min-height: 87px;
  padding: 18px 16px 16px 0;
}

.stats-strip > div + div {
  padding-left: 18px;
  border-left: 1px solid var(--line);
}

.stats-strip strong,
.stats-strip span {
  display: block;
}

.stats-strip strong {
  font-family: var(--mono);
  font-size: 23px;
  line-height: 1.1;
}

.stats-strip span {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.workspace-nav {
  display: flex;
  gap: 6px;
  margin: 19px 0 22px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  scrollbar-width: thin;
}

.workspace-nav button {
  min-width: max-content;
  min-height: 44px;
  padding: 0 16px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  font-size: 13px;
  font-weight: 700;
}

.workspace-nav button.active {
  color: var(--ink);
  border-bottom-color: var(--attack);
}

.tab-panel {
  min-width: 0;
}

.tab-panel[hidden] {
  display: none;
}

.pair-toolbar,
.scenario-toolbar {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
  padding: 15px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.pair-toolbar {
  grid-template-columns: minmax(260px, 1.2fr) minmax(230px, 1fr) auto;
  align-items: end;
}

label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

label > span,
.filter-rail label > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

select,
input[type="search"] {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 0 11px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
}

select:hover,
input[type="search"]:hover {
  border-color: var(--cobalt);
}

.tool-actions,
.filter-actions {
  display: flex;
  gap: 8px;
}

.button,
.text-button,
.citation-copy,
.scenario-family-button {
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  font-size: 12px;
  font-weight: 750;
}

.button.primary {
  color: #fff;
  background: var(--cobalt);
  border-color: var(--cobalt);
}

.button.primary:hover {
  background: #183a70;
}

.button.secondary {
  background: #fff;
}

.button.secondary:hover {
  color: var(--cobalt);
  border-color: var(--cobalt);
}

.scenario-brief {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(520px, 1.45fr);
  gap: 22px;
  padding: 20px 22px;
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 7px 7px 0 0;
  color: #fff;
}

.scenario-brief .section-kicker {
  color: #aebbb6;
}

.scenario-title h2 {
  margin: 4px 0 7px;
  font-size: clamp(20px, 2.2vw, 30px);
  line-height: 1.15;
}

.scenario-title p {
  max-width: 720px;
  margin: 0;
  color: #cbd3d0;
  font-size: 13px;
}

.scenario-facts,
.pair-metadata {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 0;
}

.scenario-facts > div {
  min-width: 0;
  padding: 3px 14px;
  border-left: 1px solid #3b4542;
}

dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  text-transform: uppercase;
}

.scenario-facts dt {
  color: #9fa9a6;
}

dd {
  margin: 5px 0 0;
  font-size: 12px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.pair-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px minmax(0, 1fr);
  align-items: stretch;
  border: 1px solid var(--line-strong);
  border-top: 0;
  background: var(--surface);
}

.request-panel {
  display: grid;
  grid-template-rows: auto minmax(235px, 1fr) auto;
  min-width: 0;
  margin: 0;
  background: #fff;
}

.request-panel > header,
.request-panel > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
}

.request-panel > header {
  border-bottom: 1px solid var(--line);
}

.request-panel > header > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.request-panel > header strong {
  font-size: 12px;
}

.decision-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.benign-panel .decision-dot {
  background: var(--benign);
}

.attack-panel .decision-dot {
  background: var(--attack);
}

.decision-chip {
  padding: 4px 8px;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.decision-chip.allow,
.rail-cap.allow {
  color: var(--benign-dark);
  background: var(--benign-soft);
}

.decision-chip.review,
.rail-cap.review {
  color: var(--attack-dark);
  background: var(--attack-soft);
}

.request-text {
  padding: clamp(20px, 3vw, 38px);
  font-size: clamp(17px, 1.6vw, 22px);
  font-weight: 560;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

mark.shared-token {
  padding: 0 2px;
  color: inherit;
  background: #ffeb9f;
  border-bottom: 1px solid #d8ac18;
}

.request-panel > footer {
  min-height: 48px;
  color: var(--muted);
  background: var(--surface-muted);
  border-top: 1px solid var(--line);
  font-size: 10px;
}

.request-panel > footer code {
  color: var(--ink);
  font-family: var(--mono);
}

.decision-rail {
  display: grid;
  grid-template-rows: auto 1fr auto 1fr auto;
  place-items: center;
  gap: 7px;
  min-width: 0;
  padding: 16px 12px;
  background: var(--surface-muted);
  border-right: 1px solid var(--line);
  border-left: 1px solid var(--line);
  text-align: center;
}

.rail-cap {
  width: 100%;
  padding: 5px 6px;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 800;
}

.rail-line {
  width: 1px;
  height: 100%;
  min-height: 18px;
  background: var(--line-strong);
}

.decision-rail > div span,
.decision-rail > div strong {
  display: block;
}

.decision-rail > div span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 750;
}

.decision-rail > div strong {
  margin-top: 5px;
  font-size: 11px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.pair-reading {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(520px, 1.4fr);
  gap: 24px;
  padding: 20px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 7px 7px;
}

.pair-reading p {
  margin: 5px 0 0;
  font-size: 14px;
}

.pair-metadata > div {
  min-width: 0;
  padding: 3px 12px;
  border-left: 1px solid var(--line);
}

.pair-navigation {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 13px 0 4px;
}

.text-button {
  min-height: 36px;
  color: var(--cobalt);
  background: transparent;
  border-color: transparent;
}

.text-button:first-child {
  justify-self: start;
}

.text-button:last-child {
  justify-self: end;
}

.pair-navigation span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
}

.section-heading,
.method-lead {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 18px;
  padding-bottom: 17px;
  border-bottom: 1px solid var(--line);
}

.section-heading h2,
.method-lead h2 {
  max-width: 760px;
  margin: 5px 0 0;
  font-size: clamp(23px, 2.7vw, 36px);
  line-height: 1.15;
}

.section-heading > p,
.method-lead > p {
  max-width: 500px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.scenario-toolbar {
  grid-template-columns: 1.4fr 1fr 0.7fr;
}

.scenario-workspace {
  display: grid;
  grid-template-columns: minmax(330px, 0.72fr) minmax(500px, 1.28fr);
  gap: 16px;
  align-items: start;
}

.result-summary {
  min-height: 30px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
}

.scenario-list {
  display: grid;
  gap: 7px;
  max-height: 690px;
  overflow-y: auto;
  padding-right: 4px;
}

.scenario-list button {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 64px;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 5px;
  text-align: left;
}

.scenario-list button:hover,
.scenario-list button.active {
  border-color: var(--cobalt);
}

.scenario-list button.active {
  box-shadow: inset 3px 0 0 var(--cobalt);
}

.scenario-list code {
  color: var(--cobalt);
  font-family: var(--mono);
  font-size: 10px;
}

.scenario-list strong,
.scenario-list span {
  display: block;
}

.scenario-list strong {
  font-size: 13px;
}

.scenario-list span {
  color: var(--muted);
  font-size: 11px;
}

.split-chip {
  padding: 4px 6px;
  background: var(--surface-muted);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 9px !important;
  font-weight: 750;
}

.scenario-detail {
  min-height: 480px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: var(--shadow);
}

.scenario-detail h3 {
  margin: 6px 0;
  font-size: clamp(22px, 2.6vw, 34px);
  line-height: 1.16;
}

.scenario-detail > p {
  margin: 0 0 20px;
  color: var(--muted);
}

.scenario-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 5px;
}

.scenario-detail-grid > div {
  min-height: 88px;
  padding: 13px;
  background: #fff;
}

.scenario-detail-grid dt {
  margin-bottom: 5px;
}

.scenario-family-heading {
  margin: 22px 0 9px;
  font-size: 12px;
}

.scenario-family-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.scenario-family-button {
  min-height: 48px;
  padding: 7px 9px;
  background: var(--attack-soft);
  border-color: #ebc2ca;
  color: var(--attack-dark);
  line-height: 1.25;
}

.scenario-family-button:hover {
  border-color: var(--attack);
}

.records-workspace {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.filter-rail {
  position: sticky;
  top: 12px;
  display: grid;
  gap: 10px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.filter-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 3px;
}

.records-results {
  min-width: 0;
}

.table-shell {
  max-width: 100%;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.results-table {
  width: 100%;
  min-width: 960px;
  border-collapse: collapse;
  table-layout: fixed;
}

.results-table th,
.results-table td {
  padding: 10px 11px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.results-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--muted);
  background: var(--surface-muted);
  font-size: 10px;
  text-transform: uppercase;
}

.results-table th:nth-child(1) { width: 110px; }
.results-table th:nth-child(2) { width: 110px; }
.results-table th:nth-child(3) { width: 190px; }
.results-table th:nth-child(4) { width: 150px; }
.results-table th:nth-child(5) { width: 160px; }

.results-table tbody tr {
  cursor: pointer;
}

.results-table tbody tr:hover,
.results-table tbody tr.selected {
  background: var(--cobalt-soft);
}

.results-table td {
  font-size: 11px;
  overflow-wrap: anywhere;
}

.results-table td:last-child {
  font-size: 12px;
  line-height: 1.45;
}

.label-pill {
  display: inline-block;
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 800;
}

.label-pill.allow {
  color: var(--benign-dark);
  background: var(--benign-soft);
}

.label-pill.review {
  color: var(--attack-dark);
  background: var(--attack-soft);
}

.mobile-records {
  display: none;
}

.record-detail-panel {
  margin-top: 12px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.record-detail-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.record-detail-panel h3 {
  margin: 0;
  font-family: var(--mono);
  font-size: 15px;
}

.record-detail-text {
  margin: 0 0 16px;
  padding: 15px;
  background: var(--surface-muted);
  border-left: 3px solid var(--cobalt);
  font-size: 14px;
  line-height: 1.55;
}

.record-field-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 5px;
}

.record-field-grid > div {
  min-height: 70px;
  padding: 10px;
  background: #fff;
}

.method-lead {
  align-items: end;
}

.method-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
}

.method-grid section {
  min-height: 190px;
  padding: 20px;
  background: var(--surface);
}

.method-grid section + section {
  border-left: 1px solid var(--line);
}

.method-grid h3,
.method-evidence h3 {
  margin: 0 0 9px;
  font-size: 17px;
}

.method-grid p,
.method-evidence li {
  color: var(--muted);
  font-size: 13px;
}

.method-grid code {
  font-family: var(--mono);
  font-size: 11px;
}

.method-evidence {
  display: grid;
  grid-template-columns: minmax(240px, 0.7fr) minmax(400px, 1.3fr);
  gap: 24px;
  margin-top: 16px;
  padding: 22px;
  color: #fff;
  background: var(--ink);
  border-radius: 7px;
}

.method-evidence .section-kicker,
.method-evidence li {
  color: #bac4c0;
}

.method-evidence ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px 24px;
  margin: 0;
  padding-left: 18px;
}

.citation-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin-top: 16px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.citation-block span,
.citation-block strong,
.citation-block p {
  display: block;
}

.citation-block span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 800;
}

.citation-block strong {
  margin-top: 4px;
  font-size: 13px;
}

.citation-block p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.method-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.method-links a,
.citation-copy {
  font-size: 11px;
  font-weight: 700;
}

.citation-copy {
  min-height: 36px;
  background: var(--cobalt-soft);
  border-color: #bac9e4;
  color: var(--cobalt);
}

.empty-state,
.error-state {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
}

.error-state {
  color: var(--attack-dark);
  background: var(--attack-soft);
  border-color: #e9b8c2;
}

.app-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 28px;
  padding: 16px 0 0;
  color: var(--muted);
  border-top: 1px solid var(--line-strong);
  font-size: 11px;
}

.app-status {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  max-width: min(420px, calc(100vw - 36px));
  padding: 10px 13px;
  color: #fff;
  background: var(--ink);
  border-radius: 5px;
  box-shadow: var(--shadow);
  font-size: 11px;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 160ms ease, transform 160ms ease;
}

.app-status.hidden {
  pointer-events: none;
  opacity: 0;
  transform: translateY(8px);
}

.app-status.error {
  background: var(--attack-dark);
}

@media (max-width: 1120px) {
  .app-header {
    align-items: flex-start;
  }

  .header-side {
    min-width: 230px;
  }

  .pair-stage {
    grid-template-columns: minmax(0, 1fr) 110px minmax(0, 1fr);
  }

  .scenario-brief,
  .pair-reading {
    grid-template-columns: 1fr;
  }

  .scenario-facts > div:first-child,
  .pair-metadata > div:first-child {
    border-left: 0;
  }

  .scenario-workspace {
    grid-template-columns: minmax(290px, 0.75fr) minmax(420px, 1.25fr);
  }

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

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

  .method-grid section:nth-child(3) {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .method-grid section:nth-child(4) {
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 860px) {
  .app-shell {
    padding: 15px 18px;
  }

  .app-header,
  .section-heading,
  .method-lead,
  .citation-block,
  .app-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-side {
    justify-items: start;
    min-width: 0;
  }

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

  .stats-strip > div:nth-child(4) {
    padding-left: 0;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .stats-strip > div:nth-child(5) {
    border-top: 1px solid var(--line);
  }

  .pair-toolbar,
  .scenario-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .tool-actions {
    grid-column: 1 / -1;
  }

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

  .scenario-list {
    max-height: 380px;
  }

  .filter-rail {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-actions {
    align-self: end;
  }

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

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

  .app-header {
    padding-top: 8px;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
  }

  .app-header h1 {
    font-size: 28px;
  }

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

  .stats-strip > div {
    min-height: 76px;
  }

  .stats-strip > div:nth-child(3) {
    padding-left: 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .stats-strip > div:nth-child(4) {
    padding-left: 18px;
    border-left: 1px solid var(--line);
  }

  .stats-strip > div:nth-child(5) {
    padding-left: 0;
    border-left: 0;
  }

  .pair-toolbar,
  .scenario-toolbar,
  .filter-rail {
    grid-template-columns: 1fr;
  }

  .tool-actions,
  .filter-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-width: 0;
  }

  .tool-actions .button,
  .filter-actions .button {
    width: 100%;
    min-width: 0;
  }

  .scenario-brief {
    padding: 18px;
  }

  .scenario-facts,
  .pair-metadata {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .scenario-facts > div:nth-child(3),
  .pair-metadata > div:nth-child(3) {
    border-left: 0;
  }

  .scenario-facts > div,
  .pair-metadata > div {
    min-height: 64px;
    padding: 7px 10px;
    border-top: 1px solid #3b4542;
  }

  .pair-metadata > div {
    border-top-color: var(--line);
  }

  .pair-stage {
    grid-template-columns: 1fr;
  }

  .decision-rail {
    grid-template-rows: auto;
    grid-template-columns: auto 1fr minmax(90px, auto) 1fr auto;
    min-height: 82px;
    border: 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  .rail-line {
    width: 100%;
    height: 1px;
    min-height: 1px;
  }

  .request-panel {
    grid-template-rows: auto minmax(200px, 1fr) auto;
  }

  .pair-reading {
    padding: 18px;
  }

  .scenario-detail {
    padding: 17px;
  }

  .scenario-detail-grid,
  .record-field-grid {
    grid-template-columns: 1fr;
  }

  .scenario-family-actions {
    grid-template-columns: 1fr;
  }

  .table-shell {
    display: none;
  }

  .mobile-records {
    display: grid;
    gap: 8px;
  }

  .mobile-record-button {
    display: grid;
    gap: 8px;
    width: 100%;
    padding: 13px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 5px;
    text-align: left;
  }

  .mobile-record-button.selected {
    border-color: var(--cobalt);
    box-shadow: inset 3px 0 0 var(--cobalt);
  }

  .mobile-record-button header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 9px;
  }

  .mobile-record-button p {
    margin: 0;
    font-size: 12px;
    line-height: 1.45;
  }

  .mobile-record-button footer {
    color: var(--muted);
    font-size: 10px;
  }

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

  .method-grid section + section {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .method-grid section {
    min-height: 0;
  }

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

@media (max-width: 430px) {
  .identity-block {
    gap: 11px;
  }

  .utility-line {
    font-size: 9px;
  }

  .app-header h1 {
    font-size: 24px;
    overflow-wrap: anywhere;
  }

  .app-header p {
    font-size: 14px;
  }

  .workspace-nav button {
    padding: 0 12px;
  }

  .request-panel > header,
  .request-panel > footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .request-text {
    padding: 20px;
    font-size: 17px;
  }

  .pair-navigation {
    grid-template-columns: 1fr 1fr;
  }

  .pair-navigation span {
    grid-column: 1 / -1;
    grid-row: 1;
    text-align: center;
  }
}

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