:root {
  --canvas: #eef2f4;
  --paper: #ffffff;
  --paper-warm: #f8f5ed;
  --ink: #14213d;
  --ink-soft: #253451;
  --blue: #275dff;
  --blue-dark: #1843ca;
  --amber: #f4b942;
  --coral: #e85d5d;
  --mint: #38b89c;
  --line: #c7d0d6;
  --line-dark: #93a0aa;
  --muted: #65727f;
  --quiet: #e1e7ea;
  --shadow: 6px 6px 0 rgba(20, 33, 61, 0.1);
  --display-font: "Avenir Next Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  --body-font: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono-font: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--body-font);
  scroll-behavior: smooth;
}

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

body.modal-open {
  overflow: hidden;
}

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

button,
select {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

a {
  color: inherit;
}

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

:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  background: var(--amber);
  color: var(--ink);
  font-weight: 800;
  transform: translateY(-160%);
}

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

.app-shell {
  display: grid;
  grid-template-columns: 218px minmax(0, 1fr);
  grid-template-rows: 76px minmax(calc(100vh - 110px), auto) 34px;
  min-height: 100vh;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  grid-column: 1 / -1;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  min-width: 0;
  color: #fff;
  background: var(--ink);
  border-bottom: 4px solid var(--blue);
}

.wordmark {
  display: flex;
  align-items: center;
  min-width: 218px;
  text-decoration: none;
  border-right: 1px solid rgba(255, 255, 255, 0.22);
}

.wordmark-mark {
  display: grid;
  place-items: center;
  align-self: stretch;
  width: 70px;
  color: var(--ink);
  background: var(--amber);
  font-family: var(--display-font);
  font-size: 31px;
  font-stretch: condensed;
  font-weight: 900;
  letter-spacing: -0.07em;
}

.wordmark > span:last-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 16px;
}

.wordmark strong {
  font-family: var(--display-font);
  font-size: 15px;
  letter-spacing: 0.12em;
}

.wordmark small {
  color: #aebbd0;
  font-family: var(--mono-font);
  font-size: 8px;
  letter-spacing: 0.04em;
}

.system-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 22px;
}

.system-strip > span:not(.status-beacon) {
  display: flex;
  flex-direction: column;
  min-width: 118px;
}

.system-strip small {
  margin-bottom: 3px;
  color: #91a0bb;
  font-family: var(--mono-font);
  font-size: 9px;
  letter-spacing: 0.11em;
}

.system-strip strong {
  font-family: var(--mono-font);
  font-size: 12px;
  font-weight: 600;
}

.status-beacon {
  display: block;
  width: 11px;
  height: 11px;
  background: var(--line-dark);
  border: 2px solid var(--ink);
  box-shadow: 0 0 0 1px #fff;
}

.status-beacon[data-state="online"] {
  background: var(--mint);
}

.status-beacon[data-state="busy"] {
  background: var(--amber);
}

.status-beacon[data-state="error"] {
  background: var(--coral);
}

.navigation {
  position: sticky;
  top: 76px;
  display: flex;
  flex-direction: column;
  align-self: start;
  height: calc(100vh - 76px);
  padding: 28px 18px 48px;
  background: #e5eaed;
  border-right: 1px solid var(--line);
}

.navigation-label {
  margin: 0 12px 16px;
  color: var(--muted);
  font-family: var(--mono-font);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.nav-item {
  position: relative;
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  text-align: left;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--line);
  font-weight: 700;
}

.nav-item:last-of-type {
  border-bottom: 1px solid var(--line);
}

.nav-item::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: -18px;
  width: 4px;
  background: transparent;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.58);
}

.nav-item.is-active {
  color: var(--blue-dark);
  background: var(--paper);
}

.nav-item.is-active::before {
  background: var(--blue);
}

.nav-index {
  color: var(--line-dark);
  font-family: var(--mono-font);
  font-size: 10px;
}

.nav-item.is-active .nav-index {
  color: var(--blue);
}

.nav-count {
  min-width: 23px;
  padding: 2px 5px;
  text-align: center;
  color: var(--muted);
  background: var(--quiet);
  border: 1px solid var(--line);
  font-family: var(--mono-font);
  font-size: 9px;
}

.navigation-note {
  margin-top: auto;
  padding: 16px 13px;
  background: var(--paper-warm);
  border: 1px solid var(--line);
  border-left: 3px solid var(--amber);
}

.navigation-note p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.workspace {
  min-width: 0;
  padding: clamp(24px, 3.4vw, 52px);
}

.view {
  max-width: 1500px;
  margin: 0 auto;
}

.view-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 30px;
}

.view-heading h1 {
  margin: 3px 0 6px;
  font-family: var(--display-font);
  font-size: clamp(38px, 5vw, 68px);
  font-stretch: condensed;
  line-height: 0.94;
  letter-spacing: -0.045em;
}

.lede {
  max-width: 690px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.eyebrow {
  margin: 0;
  color: var(--blue-dark);
  font-family: var(--mono-font);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.15em;
}

.heading-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 0 0 auto;
}

.last-update {
  color: var(--muted);
  font-family: var(--mono-font);
  font-size: 10px;
}

.button {
  min-height: 40px;
  padding: 9px 15px;
  background: var(--paper);
  border: 1px solid var(--line-dark);
  border-radius: 0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.button:hover:not(:disabled) {
  border-color: var(--ink);
  box-shadow: 3px 3px 0 rgba(20, 33, 61, 0.14);
  transform: translate(-1px, -1px);
}

.button:active:not(:disabled) {
  box-shadow: none;
  transform: none;
}

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

.button-primary:hover:not(:disabled) {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
}

.button-warning {
  color: var(--ink);
  background: var(--amber);
  border-color: #c58a0c;
}

.button-quiet {
  background: transparent;
}

.topbar .button-quiet {
  color: #fff;
  border-color: #5d6b86;
}

.button-small {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 10px;
}

.button-wide {
  width: 100%;
}

.alert,
.inline-message {
  margin: 0 0 20px;
  padding: 12px 14px;
  color: var(--ink);
  background: #fff3cc;
  border: 1px solid #d9a526;
  border-left: 4px solid var(--amber);
  font-size: 12px;
  line-height: 1.45;
}

.alert[data-kind="error"],
.inline-message[data-kind="error"] {
  background: #fff0f0;
  border-color: var(--coral);
}

.alert[data-kind="success"],
.inline-message[data-kind="success"] {
  background: #eaf8f4;
  border-color: var(--mint);
}

.metric-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 24px;
  background: var(--paper);
  border: 1px solid var(--line-dark);
  box-shadow: var(--shadow);
}

.metric-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 150px;
  padding: 20px 22px;
  border-right: 1px solid var(--line);
}

.metric-cell:last-child {
  border-right: 0;
}

.metric-cell-signal::after {
  content: "";
  position: absolute;
  top: -1px;
  right: -1px;
  width: 18px;
  height: 18px;
  background: var(--blue);
}

.metric-label {
  color: var(--muted);
  font-family: var(--mono-font);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.metric-value {
  margin: 13px 0 5px;
  font-family: var(--display-font);
  font-size: 48px;
  font-stretch: condensed;
  line-height: 1;
  letter-spacing: -0.04em;
}

.metric-note {
  margin-top: auto;
  color: var(--muted);
  font-size: 11px;
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.85fr);
  gap: 24px;
  align-items: start;
}

.panel {
  min-width: 0;
  background: var(--paper);
  border: 1px solid var(--line-dark);
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  min-height: 75px;
  padding: 17px 20px;
  border-bottom: 1px solid var(--line);
}

.panel-heading h2,
.proof-panel h2 {
  margin: 3px 0 0;
  font-family: var(--display-font);
  font-size: 23px;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.panel-counter,
.selection-label,
.device-badge {
  padding: 5px 7px;
  color: var(--muted);
  background: var(--canvas);
  border: 1px solid var(--line);
  font-family: var(--mono-font);
  font-size: 9px;
}

.table-scroll {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.data-table th {
  padding: 10px 14px;
  color: var(--muted);
  text-align: left;
  background: var(--canvas);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono-font);
  font-size: 9px;
  letter-spacing: 0.09em;
  white-space: nowrap;
}

.data-table td {
  height: 54px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--quiet);
  vertical-align: middle;
}

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

.data-table tbody tr:not(.empty-row):hover {
  background: #f7f9fa;
}

.run-name {
  display: block;
  max-width: 280px;
  overflow: hidden;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.run-id {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-family: var(--mono-font);
  font-size: 9px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font-family: var(--mono-font);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.status-chip::before {
  content: "";
  width: 7px;
  height: 7px;
  background: var(--line-dark);
}

.status-chip[data-state="completed"]::before {
  background: var(--mint);
}

.status-chip[data-state="running"]::before,
.status-chip[data-state="queued"]::before,
.status-chip[data-state="stopping"]::before {
  background: var(--amber);
}

.status-chip[data-state="failed"]::before,
.status-chip[data-state="completed_with_errors"]::before {
  background: var(--coral);
}

.row-open {
  width: 30px;
  height: 30px;
  padding: 0;
  color: var(--blue-dark);
  background: transparent;
  border: 1px solid var(--line);
  font-family: var(--mono-font);
  font-weight: 800;
}

.row-open:hover {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
}

.empty-cell {
  height: 150px !important;
  color: var(--muted);
  text-align: center;
}

.vitals-stack {
  display: grid;
  padding: 4px 20px;
}

.vital-row {
  display: grid;
  grid-template-columns: 48px minmax(74px, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 53px;
  border-bottom: 1px solid var(--quiet);
}

.vital-row:last-child {
  border-bottom: 0;
}

.vital-name {
  font-family: var(--mono-font);
  font-size: 11px;
  font-weight: 800;
}

.vital-track {
  position: relative;
  height: 5px;
  background: var(--quiet);
}

.vital-progress {
  display: block;
  width: 100%;
  height: 100%;
  appearance: none;
  background: transparent;
  border: 0;
}

.vital-progress::-webkit-progress-bar {
  background: var(--quiet);
}

.vital-progress::-webkit-progress-value {
  background: var(--line-dark);
}

.vital-progress::-moz-progress-bar {
  background: var(--line-dark);
}

.vital-row[data-rating="good"] .vital-progress::-webkit-progress-value {
  background: var(--mint);
}

.vital-row[data-rating="good"] .vital-progress::-moz-progress-bar {
  background: var(--mint);
}

.vital-row[data-rating="needs-improvement"] .vital-progress::-webkit-progress-value {
  background: var(--amber);
}

.vital-row[data-rating="needs-improvement"] .vital-progress::-moz-progress-bar {
  background: var(--amber);
}

.vital-row[data-rating="poor"] .vital-progress::-webkit-progress-value {
  background: var(--coral);
}

.vital-row[data-rating="poor"] .vital-progress::-moz-progress-bar {
  background: var(--coral);
}

.vital-value {
  min-width: 75px;
  text-align: right;
  font-family: var(--mono-font);
  font-size: 11px;
  font-weight: 700;
}

.panel-footnote {
  margin: 0;
  padding: 13px 20px;
  color: var(--muted);
  background: var(--canvas);
  border-top: 1px solid var(--line);
  font-size: 10px;
  line-height: 1.45;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field > span {
  color: var(--muted);
  font-family: var(--mono-font);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.field input,
.field select,
.run-picker select,
.site-row input {
  height: 42px;
  padding: 8px 11px;
  background: var(--paper);
  border: 1px solid var(--line-dark);
  border-radius: 0;
}

.run-picker {
  min-width: 310px;
}

.session-tape {
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.tape-heading {
  align-items: center;
}

.tape-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 13px;
  color: var(--muted);
  font-family: var(--mono-font);
  font-size: 9px;
}

.legend-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 4px;
  background: var(--line-dark);
}

.legend-mobile {
  background: var(--blue);
}

.legend-desktop {
  background: var(--ink);
}

.legend-error {
  background: var(--coral);
}

.tape-scale {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 8px 22px 8px 154px;
  color: var(--line-dark);
  background: var(--canvas);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono-font);
  font-size: 8px;
}

.tape-scale span:not(:first-child):not(:last-child) {
  text-align: center;
}

.tape-scale span:last-child {
  text-align: right;
}

.tape-list {
  max-height: 390px;
  overflow-y: auto;
}

.tape-row {
  display: grid;
  grid-template-columns: 120px minmax(180px, 1fr) 95px;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 57px;
  padding: 9px 22px;
  text-align: left;
  background: var(--paper);
  border: 0;
  border-bottom: 1px solid var(--quiet);
}

.tape-row:last-child {
  border-bottom: 0;
}

.tape-row:hover,
.tape-row.is-selected {
  background: #f5f7ff;
}

.tape-row.is-selected {
  box-shadow: inset 4px 0 0 var(--blue);
}

.tape-identity {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.tape-device {
  flex: 0 0 auto;
  width: 9px;
  height: 28px;
  background: var(--ink);
}

.tape-row[data-device="mobile"] .tape-device {
  background: var(--blue);
}

.tape-identity strong,
.tape-identity small {
  display: block;
}

.tape-identity strong {
  font-family: var(--mono-font);
  font-size: 10px;
}

.tape-identity small {
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tape-track {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: center;
  height: 28px;
  border-right: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.tape-track::before {
  content: "";
  position: absolute;
  top: 12px;
  right: 0;
  left: 0;
  height: 3px;
  background: var(--quiet);
}

.tape-tick {
  position: relative;
  z-index: 1;
  height: 28px;
  border-right: 1px solid var(--line);
}

.tape-tick:last-child {
  border-right: 0;
}

.tape-progress {
  position: absolute;
  z-index: 2;
  top: 11px;
  left: 0;
  width: 100%;
  height: 5px;
  appearance: none;
  background: transparent;
  border: 0;
}

.tape-progress::-webkit-progress-bar {
  background: transparent;
}

.tape-progress::-webkit-progress-value {
  background: var(--blue);
}

.tape-progress::-moz-progress-bar {
  background: var(--blue);
}

.tape-markers {
  position: absolute;
  z-index: 3;
  top: 0;
  right: 7%;
  bottom: 0;
  left: 7%;
  display: flex;
  justify-content: space-between;
}

.tape-marker {
  position: relative;
  top: 8px;
  width: 3px;
  height: 11px;
  background: var(--ink);
}

.tape-marker.is-error {
  position: absolute;
  z-index: 4;
  top: 8px;
  right: 4%;
  width: 7px;
  height: 7px;
  background: var(--coral);
}

.tape-meta {
  text-align: right;
}

.tape-meta strong,
.tape-meta span {
  display: block;
}

.tape-meta strong {
  font-family: var(--mono-font);
  font-size: 10px;
}

.tape-meta span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.session-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(380px, 1.05fr);
  gap: 24px;
  align-items: start;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  padding: 30px;
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  margin-bottom: 7px;
  color: var(--ink);
  font-family: var(--display-font);
  font-size: 19px;
}

.empty-state span {
  max-width: 360px;
  font-size: 11px;
  line-height: 1.5;
}

.empty-state.compact {
  min-height: 120px;
}

.session-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--line);
}

.session-kpi {
  padding: 15px;
  border-right: 1px solid var(--line);
}

.session-kpi:last-child {
  border-right: 0;
}

.session-kpi span,
.trace-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-family: var(--mono-font);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.session-kpi strong {
  font-family: var(--mono-font);
  font-size: 15px;
}

.trace-section {
  padding: 17px 20px;
  border-bottom: 1px solid var(--line);
}

.trace-section:last-child {
  border-bottom: 0;
}

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

.trace-item {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  font-size: 11px;
}

.trace-step {
  color: var(--line-dark);
  font-family: var(--mono-font);
  font-size: 8px;
}

.trace-path {
  overflow: hidden;
  font-family: var(--mono-font);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trace-vital {
  color: var(--muted);
  font-family: var(--mono-font);
  font-size: 9px;
}

.goal-list {
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.goal-list li {
  padding: 8px 10px;
  color: #145c4c;
  background: #eaf8f4;
  border-left: 3px solid var(--mint);
  font-family: var(--mono-font);
  font-size: 9px;
}

.error-line {
  color: #992f2f;
  font-family: var(--mono-font);
  font-size: 10px;
}

.session-terminal-error {
  display: block;
  padding: 10px 12px;
  color: #8f2424;
  background: #fff0f0;
  border-left: 3px solid var(--coral);
  font-family: var(--mono-font);
  font-size: 9px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.sensitive-note {
  padding: 12px 20px;
  color: #694c08;
  background: #fff6dc;
  border-bottom: 1px solid #e8c970;
  font-size: 10px;
  line-height: 1.5;
}

.storage-content {
  display: grid;
}

.storage-truncated {
  margin: 0;
  padding: 10px 14px;
  color: #7a5100;
  background: #fff3cc;
  border-bottom: 1px solid #d9a526;
  font-size: 10px;
  line-height: 1.45;
}

.storage-truncation {
  display: block;
  margin-top: 5px;
  color: #a62e2e;
  font-size: 9px;
}

.storage-group {
  border-bottom: 1px solid var(--line);
}

.storage-group:last-child {
  border-bottom: 0;
}

.storage-group > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  background: var(--canvas);
  cursor: pointer;
  font-size: 11px;
  font-weight: 750;
  list-style: none;
}

.storage-group > summary::-webkit-details-marker {
  display: none;
}

.storage-group > summary::before {
  content: "+";
  color: var(--blue);
  font-family: var(--mono-font);
  font-size: 16px;
}

.storage-group[open] > summary::before {
  content: "−";
}

.storage-group > summary span:first-of-type {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.storage-count {
  color: var(--muted);
  font-family: var(--mono-font);
  font-size: 9px;
}

.storage-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-family: var(--mono-font);
  font-size: 9px;
}

.storage-table th,
.storage-table td {
  padding: 9px 12px;
  text-align: left;
  border-top: 1px solid var(--quiet);
  vertical-align: top;
  word-break: break-word;
}

.storage-table th {
  width: 31%;
  color: var(--muted);
  font-weight: 600;
}

.storage-value {
  display: block;
  max-height: 110px;
  overflow: auto;
  white-space: pre-wrap;
}

.storage-value.is-masked {
  color: var(--line-dark);
  letter-spacing: 0.12em;
  white-space: nowrap;
}

.cookie-meta {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.5;
}

.allowlist-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.7fr);
  gap: 24px;
  align-items: start;
}

.editor-panel {
  box-shadow: var(--shadow);
}

.editor-labels,
.site-row {
  display: grid;
  grid-template-columns: minmax(130px, 0.4fr) minmax(240px, 1fr) 36px;
  gap: 10px;
}

.editor-labels {
  padding: 10px 20px 7px;
  color: var(--muted);
  background: var(--canvas);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono-font);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-rows {
  display: grid;
}

.site-row {
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid var(--quiet);
}

.site-row input {
  min-width: 0;
  width: 100%;
  font-family: var(--mono-font);
  font-size: 11px;
}

.site-row input[aria-invalid="true"] {
  background: #fff3f3;
  border-color: var(--coral);
}

.remove-site {
  width: 36px;
  height: 36px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  font-size: 17px;
}

.remove-site:hover {
  color: #fff;
  background: var(--coral);
  border-color: var(--coral);
}

.form-hint {
  margin: 0;
  padding: 12px 20px;
  color: var(--muted);
  background: var(--canvas);
  border-top: 1px solid var(--line);
  font-size: 10px;
  line-height: 1.45;
}

.editor-panel .inline-message {
  margin: 14px 20px 20px;
}

.proof-panel {
  position: relative;
  overflow: hidden;
  padding: 24px;
  color: #fff;
  background: var(--ink);
  border: 0;
}

.proof-index {
  position: absolute;
  top: -7px;
  right: -7px;
  color: rgba(255, 255, 255, 0.06);
  font-family: var(--display-font);
  font-size: 60px;
  font-weight: 900;
  letter-spacing: -0.07em;
  pointer-events: none;
}

.proof-panel .eyebrow {
  color: var(--amber);
}

.proof-panel h2 {
  position: relative;
  max-width: 300px;
  margin: 7px 0 24px;
  font-size: 30px;
}

.proof-steps {
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
  border-top: 1px solid #4f5c76;
}

.proof-steps li {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid #4f5c76;
}

.proof-steps span {
  color: var(--amber);
  font-family: var(--mono-font);
  font-size: 10px;
}

.proof-steps p {
  margin: 0;
  color: #d5dbea;
  font-size: 11px;
  line-height: 1.5;
}

.proof-code {
  display: grid;
  gap: 13px;
  margin: 0;
}

.proof-code > div {
  min-width: 0;
}

.proof-code dt {
  margin-bottom: 5px;
  color: #91a0bb;
  font-family: var(--mono-font);
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.proof-code dd {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: start;
  margin: 0;
}

.proof-code code {
  display: block;
  min-width: 0;
  padding: 8px;
  overflow-wrap: anywhere;
  color: var(--amber);
  background: #0d172c;
  border: 1px solid #4f5c76;
  font-family: var(--mono-font);
  font-size: 9px;
  line-height: 1.5;
}

.copy-button {
  min-height: 33px;
  padding: 6px 8px;
  color: #fff;
  background: transparent;
  border: 1px solid #5d6b86;
  font-size: 8px;
}

.copy-button:hover {
  background: #263653;
}

.proof-note {
  margin: 18px 0 0;
  color: #91a0bb;
  font-size: 9px;
  line-height: 1.5;
}

.footer {
  z-index: 21;
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  color: #718094;
  background: var(--ink);
  font-family: var(--mono-font);
  font-size: 8px;
  letter-spacing: 0.11em;
}

.auth-gate {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(20, 33, 61, 0.88);
}

.auth-card {
  display: grid;
  grid-template-columns: 110px minmax(0, 460px);
  width: min(100%, 570px);
  background: var(--paper);
  border: 1px solid var(--ink);
  box-shadow: 10px 10px 0 var(--blue);
}

.auth-register {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px;
  color: #fff;
  background: var(--ink);
}

.auth-register span {
  font-family: var(--mono-font);
  font-size: 8px;
  letter-spacing: 0.13em;
  writing-mode: vertical-rl;
}

.auth-register strong {
  color: var(--amber);
  font-family: var(--display-font);
  font-size: 42px;
}

.auth-content {
  padding: 38px;
}

.auth-content h1 {
  margin: 8px 0 12px;
  font-family: var(--display-font);
  font-size: 38px;
  line-height: 1;
  letter-spacing: -0.04em;
}

.auth-content > p:not(.eyebrow) {
  margin: 0 0 25px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.auth-content form {
  display: grid;
  gap: 14px;
}

.auth-content > small {
  display: block;
  margin-top: 15px;
  color: var(--muted);
  font-size: 9px;
}

.auth-error {
  min-height: 16px;
  color: #a62e2e;
  font-size: 10px;
}

.toast-region {
  position: fixed;
  z-index: 200;
  right: 20px;
  bottom: 48px;
  display: grid;
  gap: 8px;
  width: min(360px, calc(100vw - 40px));
}

.toast {
  padding: 12px 14px;
  color: #fff;
  background: var(--ink);
  border-left: 5px solid var(--blue);
  box-shadow: 4px 4px 0 rgba(20, 33, 61, 0.18);
  font-size: 11px;
  line-height: 1.45;
  animation: toast-in 180ms ease-out;
}

.toast[data-kind="error"] {
  border-color: var(--coral);
}

.toast[data-kind="success"] {
  border-color: var(--mint);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

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

  .wordmark {
    min-width: 176px;
  }

  .wordmark-mark {
    width: 58px;
  }

  .wordmark > span:last-child {
    padding: 0 10px;
  }

  .wordmark small {
    display: none;
  }

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

  .metric-cell:nth-child(2) {
    border-right: 0;
  }

  .metric-cell:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .overview-grid,
  .session-grid,
  .allowlist-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .app-shell {
    display: block;
    padding-bottom: 35px;
  }

  .topbar {
    position: sticky;
    height: 62px;
  }

  .wordmark {
    min-width: 92px;
    border-right: 0;
  }

  .wordmark-mark {
    width: 52px;
  }

  .wordmark > span:last-child {
    display: none;
  }

  .system-strip {
    gap: 8px;
    padding: 0 10px;
  }

  .system-strip > span:not(.status-beacon) {
    min-width: 94px;
  }

  .system-clock {
    display: none !important;
  }

  .navigation {
    position: sticky;
    z-index: 19;
    top: 62px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    height: auto;
    padding: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line-dark);
  }

  .navigation-label,
  .navigation-note,
  .nav-index,
  .nav-count {
    display: none;
  }

  .nav-item,
  .nav-item:last-of-type {
    display: flex;
    justify-content: center;
    min-height: 46px;
    padding: 8px;
    border: 0;
    border-right: 1px solid var(--line);
  }

  .nav-item:last-of-type {
    border-right: 0;
  }

  .nav-item::before {
    top: auto;
    right: 10px;
    bottom: -1px;
    left: 10px;
    width: auto;
    height: 3px;
  }

  .workspace {
    padding: 28px 15px 40px;
  }

  .view-heading {
    align-items: stretch;
    flex-direction: column;
    margin-bottom: 22px;
  }

  .view-heading h1 {
    font-size: 43px;
  }

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

  .run-picker {
    min-width: 0;
    width: 100%;
  }

  .metric-board {
    grid-template-columns: 1fr;
  }

  .metric-cell,
  .metric-cell:nth-child(2) {
    min-height: 118px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .metric-cell:last-child {
    border-bottom: 0;
  }

  .metric-value {
    font-size: 38px;
  }

  .tape-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .tape-scale {
    display: none;
  }

  .tape-row {
    grid-template-columns: 104px minmax(90px, 1fr);
    padding: 10px 14px;
  }

  .tape-meta {
    display: none;
  }

  .session-kpis {
    grid-template-columns: 1fr;
  }

  .session-kpi {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .session-kpi:last-child {
    border-bottom: 0;
  }

  .editor-labels {
    display: none;
  }

  .site-row {
    grid-template-columns: 1fr 36px;
  }

  .site-row input:first-child {
    grid-column: 1 / -1;
  }

  .footer {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    height: 34px;
  }

  .footer span:first-child {
    display: none;
  }

  .auth-card {
    grid-template-columns: 1fr;
  }

  .auth-register {
    display: none;
  }

  .auth-content {
    padding: 28px 22px;
  }
}

@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;
  }
}

/* Разрезы по условиям измерения */
.breakdown-panel {
  margin-top: 24px;
}

.breakdown-stack {
  display: grid;
  gap: 20px;
  padding: 16px 20px;
}

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

.breakdown-title {
  margin: 0;
  font-family: var(--display-font);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.breakdown-table td {
  font-family: var(--mono-font);
  font-size: 11px;
}

.breakdown-table td:first-child {
  font-family: var(--body-font);
}

.breakdown-bucket {
  font-weight: 700;
  color: var(--ink);
}

.breakdown-table td[data-rating='good'] {
  color: var(--mint);
  font-weight: 700;
}

.breakdown-table td[data-rating='needs-improvement'] {
  color: var(--amber);
  font-weight: 700;
}

.breakdown-table td[data-rating='poor'] {
  color: var(--coral);
  font-weight: 700;
}

.breakdown-table td[data-rating='missing'] {
  color: var(--muted);
}

.breakdown-ci {
  color: var(--ink-soft);
}

.breakdown-thin {
  color: var(--muted);
  font-style: italic;
}

.breakdown-target {
  display: inline-block;
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
  padding: 1px 5px;
  background: var(--quiet);
  border: 1px solid var(--line);
  font-family: var(--mono-font);
  font-size: 10px;
}

.vital-sample {
  display: block;
  margin-top: 2px;
  font-family: var(--mono-font);
  font-size: 9px;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0.02em;
}

/* Traffic Fidelity — observed request/session signature */
.fidelity-signature-panel {
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.fidelity-signature-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
}

.fidelity-signature-cell {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 136px;
  padding: 18px 20px;
  background: var(--paper);
}

.fidelity-signature-primary {
  color: #fff;
  background: var(--ink);
}

.fidelity-signature-label,
.fidelity-methods-label,
.cache-ratio-label,
.warm-stage-label {
  color: var(--muted);
  font-family: var(--mono-font);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.11em;
}

.fidelity-signature-primary .fidelity-signature-label {
  color: #91a0bb;
}

.fidelity-signature-value {
  margin: 13px 0 5px;
  font-family: var(--display-font);
  font-size: 33px;
  font-stretch: condensed;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.035em;
}

.fidelity-signature-note {
  margin-top: auto;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-family: var(--mono-font);
  font-size: 8px;
  line-height: 1.45;
}

.fidelity-signature-primary .fidelity-signature-note {
  color: #aebbd0;
}

.fidelity-methods {
  display: flex;
  gap: 18px;
  align-items: center;
  min-height: 50px;
  padding: 10px 20px;
  background: var(--canvas);
  border-top: 1px solid var(--line);
}

.fidelity-methods-label {
  flex: 0 0 auto;
}

.fidelity-method-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0;
}

.fidelity-method {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  font-family: var(--mono-font);
  font-size: 9px;
}

.fidelity-method dt,
.fidelity-method dd {
  margin: 0;
  padding: 4px 7px;
}

.fidelity-method dt {
  color: var(--ink-soft);
  background: var(--paper);
}

.fidelity-method dd {
  color: #fff;
  background: var(--blue);
  font-weight: 800;
}

.fidelity-methods-empty {
  color: var(--muted);
  font-family: var(--mono-font);
  font-size: 9px;
}

.fidelity-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
  gap: 24px;
  align-items: start;
}

.warm-body {
  display: grid;
  grid-template-columns: 155px minmax(0, 1fr);
}

.cache-ratio {
  display: flex;
  flex-direction: column;
  min-height: 153px;
  padding: 19px 20px;
  color: #fff;
  background: var(--blue-dark);
}

.cache-ratio-label {
  color: #c5d1ff;
  line-height: 1.4;
}

.cache-ratio-value {
  margin: 13px 0 6px;
  font-family: var(--display-font);
  font-size: 45px;
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.cache-ratio-note {
  margin-top: auto;
  color: #c5d1ff;
  font-family: var(--mono-font);
  font-size: 8px;
}

.warm-stages {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  min-width: 0;
  margin: 0;
  padding: 0;
  background: var(--line);
  list-style: none;
}

.warm-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 153px;
  padding: 18px 13px;
  background: var(--paper-warm);
}

.warm-stage:not(:last-child)::after {
  content: "→";
  position: absolute;
  z-index: 1;
  top: 50%;
  right: -10px;
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  color: var(--blue);
  background: var(--paper);
  border: 1px solid var(--line);
  font-family: var(--mono-font);
  font-size: 10px;
  transform: translateY(-50%);
}

.warm-stage-value {
  margin: 12px 0 5px;
  font-family: var(--display-font);
  font-size: 30px;
  line-height: 1;
}

.warm-stage-note {
  margin-top: auto;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}

.warm-evidence {
  grid-column: 1 / -1;
  margin: 0;
  padding: 11px 14px;
  color: var(--muted);
  background: var(--canvas);
  border-top: 1px solid var(--line);
  font-size: 10px;
  line-height: 1.45;
}

.warm-evidence[data-kind="complete"] {
  color: #145c4c;
  background: #eaf8f4;
  box-shadow: inset 4px 0 0 var(--mint);
}

.warm-evidence[data-kind="warning"] {
  color: #694c08;
  background: #fff6dc;
  box-shadow: inset 4px 0 0 var(--amber);
}

.resource-mix {
  display: grid;
  max-height: 311px;
  margin: 0;
  padding: 5px 20px;
  overflow-y: auto;
  list-style: none;
}

.resource-row {
  display: grid;
  grid-template-columns: minmax(74px, 0.45fr) minmax(90px, 1fr) 62px;
  gap: 12px;
  align-items: center;
  min-height: 45px;
  border-bottom: 1px solid var(--quiet);
}

.resource-row:last-child {
  border-bottom: 0;
}

.resource-name {
  overflow: hidden;
  font-family: var(--mono-font);
  font-size: 9px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resource-progress {
  display: block;
  width: 100%;
  height: 7px;
  appearance: none;
  background: var(--quiet);
  border: 0;
}

.resource-progress::-webkit-progress-bar {
  background: var(--quiet);
}

.resource-progress::-webkit-progress-value {
  background: var(--blue);
}

.resource-progress::-moz-progress-bar {
  background: var(--blue);
}

.resource-value {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  font-family: var(--mono-font);
  font-size: 9px;
}

.resource-value small {
  min-width: 27px;
  color: var(--muted);
  text-align: right;
}

.fidelity-transitions-panel,
.fidelity-manifest-panel {
  margin-top: 24px;
}

.fidelity-transitions-panel .table-scroll {
  max-height: 380px;
  overflow: auto;
}

.fidelity-transitions-panel .breakdown-target {
  max-width: min(38vw, 520px);
}

.transition-count {
  color: var(--blue-dark);
  font-family: var(--mono-font);
  font-weight: 800;
  text-align: right;
}

.manifest-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  background: var(--line);
}

.manifest-item {
  min-width: 0;
  min-height: 78px;
  padding: 14px 18px;
  background: var(--paper);
}

.manifest-item:last-child:nth-child(3n + 2) {
  grid-column: span 2;
}

.manifest-item dt {
  margin-bottom: 9px;
  color: var(--muted);
  font-family: var(--mono-font);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.manifest-item dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
}

.manifest-item code {
  padding: 2px 5px;
  background: var(--canvas);
  border: 1px solid var(--line);
  font-family: var(--mono-font);
  font-size: 9px;
}

#view-fidelity .empty-state.compact {
  min-height: 153px;
}

@media (max-width: 1120px) {
  .fidelity-signature-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

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

  .manifest-item:last-child:nth-child(3n + 2) {
    grid-column: auto;
  }

  .manifest-item:last-child:nth-child(2n + 1) {
    grid-column: span 2;
  }
}

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

  .fidelity-signature-cell {
    min-height: 124px;
    padding: 16px;
  }

  .fidelity-signature-value {
    font-size: 29px;
  }

  .fidelity-methods {
    align-items: flex-start;
    flex-direction: column;
  }

  .warm-body {
    grid-template-columns: 1fr;
  }

  .cache-ratio {
    min-height: 125px;
  }

  .warm-evidence {
    grid-column: 1;
  }

  .fidelity-transitions-panel .breakdown-target {
    max-width: 230px;
  }

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

  .manifest-item:last-child:nth-child(2n + 1) {
    grid-column: auto;
  }
}

@media (max-width: 480px) {
  .fidelity-signature-grid,
  .warm-stages {
    grid-template-columns: 1fr;
  }

  .warm-stage {
    min-height: 112px;
  }

  .warm-stage:not(:last-child)::after {
    top: auto;
    right: 18px;
    bottom: -10px;
    content: "↓";
    transform: none;
  }

  .resource-row {
    grid-template-columns: 72px minmax(70px, 1fr) 54px;
    gap: 8px;
  }
}
