:root {
  color-scheme: dark;
  --navy-950: #06111b;
  --navy-900: #091827;
  --navy-850: #0c2030;
  --navy-800: #10293a;
  --navy-700: #18384b;
  --ink: #e7f0ee;
  --muted: #c7d5d4;
  --quiet: #b8c9c8;
  --teal: #55e4c2;
  --teal-soft: rgba(85, 228, 194, 0.13);
  --teal-line: rgba(85, 228, 194, 0.28);
  --amber: #efc875;
  --danger: #ffb7b2;
  --control-line: #749a96;
  --white-line: rgba(231, 240, 238, 0.12);
  --soft-line: rgba(231, 240, 238, 0.07);
  --shadow: 0 1.5rem 4rem rgba(0, 0, 0, 0.22);
  --mono: "SFMono-Regular", "Cascadia Code", "Roboto Mono", Consolas, "Liberation Mono", monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  scroll-behavior: auto;
  background: var(--navy-950);
}

body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 76% -12%, rgba(41, 118, 133, 0.18), transparent 33rem),
    var(--navy-950);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

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

button,
select,
input[type="range"] {
  min-height: 44px;
}

button,
a,
select,
input,
textarea {
  -webkit-tap-highlight-color: transparent;
}

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

[hidden] {
  display: none !important;
}

.sr-only {
  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: 20;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.65rem 0.85rem;
  color: var(--navy-950);
  background: var(--teal);
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-180%);
  transition: transform 160ms ease;
}

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

.app-shell {
  display: grid;
  grid-template-columns: 15.5rem minmax(0, 1fr);
  min-height: 100svh;
}

.sidebar {
  display: flex;
  position: sticky;
  top: 0;
  flex-direction: column;
  justify-content: space-between;
  width: 15.5rem;
  height: 100svh;
  padding: 1.65rem 1.2rem 1.35rem;
  background: rgba(6, 17, 27, 0.94);
  border-right: 1px solid var(--white-line);
}

.brand-lockup {
  padding-bottom: 2.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.brand__mark {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  color: var(--navy-950);
  background: var(--teal);
  font-size: 0.68rem;
  letter-spacing: -0.08em;
}

.brand__name {
  white-space: nowrap;
}

.sidebar__context,
.sidebar__notice,
.sidebar__signal,
.side-nav__link,
.eyebrow,
.section-kicker,
.badge,
.field-label,
.status-line,
.source-link,
.source-meta,
.metric-label,
.metric-change,
.session-state,
.replay-date,
.inline-status,
.scenario-fingerprint,
.footer-label,
.site-footer,
.chart-range,
th,
td {
  font-family: var(--mono);
}

.sidebar__context {
  margin: 0.85rem 0 0;
  color: var(--quiet);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  line-height: 1.5;
  text-transform: uppercase;
}

.side-nav {
  display: grid;
  gap: 0.3rem;
}

.side-nav__link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 44px;
  padding: 0.65rem 0.7rem;
  color: var(--muted);
  font-size: 0.7rem;
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.side-nav__link:hover,
.side-nav__link--active {
  color: var(--ink);
  background: var(--teal-soft);
  border-left-color: var(--teal);
}

.side-nav__index {
  width: 1.45rem;
  color: var(--quiet);
  font-size: 0.62rem;
  text-align: right;
}

.side-nav__link--active .side-nav__index {
  color: var(--teal);
}

.sidebar__bottom {
  display: grid;
  gap: 0.8rem;
}

.sidebar__signal {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.signal-dot {
  width: 0.45rem;
  height: 0.45rem;
  background: var(--teal);
  border-radius: 50%;
  box-shadow: 0 0 0 0.22rem rgba(85, 228, 194, 0.1);
}

.sidebar__notice {
  max-width: 18ch;
  margin: 0;
  color: var(--quiet);
  font-size: 0.62rem;
  line-height: 1.55;
}

.workspace {
  min-width: 0;
}

.topbar,
.workbench-main,
.site-footer {
  width: min(100% - 4.5rem, 89rem);
  margin-inline: auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  padding: 2.45rem 0 2.05rem;
  border-bottom: 1px solid var(--white-line);
}

.topbar__heading {
  min-width: 0;
}

.eyebrow,
.section-kicker {
  margin: 0;
  color: var(--teal);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.17em;
  line-height: 1.3;
}

.topbar h1 {
  max-width: 24ch;
  margin: 0.9rem 0 0;
  color: var(--ink);
  font-size: clamp(2.15rem, 3.1vw, 2.75rem);
  font-weight: 670;
  letter-spacing: -0.06em;
  line-height: 0.98;
  text-wrap: balance;
}

.topbar h1 span {
  color: var(--teal);
}

.topbar__lede {
  max-width: 46ch;
  margin: 1.45rem 0 0;
  color: var(--muted);
  font-size: clamp(0.94rem, 1.3vw, 1.08rem);
  line-height: 1.55;
}

.topbar__meta {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-end;
  flex-direction: column;
  gap: 0.7rem;
  padding-top: 0.25rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.4rem 0.6rem;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.badge--source {
  color: var(--teal);
  background: var(--teal-soft);
  border: 1px solid var(--teal-line);
}

.badge--simulation {
  color: var(--amber);
  background: rgba(239, 200, 117, 0.08);
  border: 1px solid rgba(239, 200, 117, 0.24);
}

.topbar__pitch,
.footer-nav__pitch {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--teal);
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  text-decoration: none;
}

.topbar__pitch {
  margin-top: 0.8rem;
}

.a11y-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem 0.7rem;
  width: min(100% - 4.5rem, 89rem);
  margin: 0.85rem auto 0;
  padding: 0.75rem 0;
}

.a11y-controls label {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.a11y-controls button,
.a11y-controls select {
  min-height: 44px;
}

.a11y-controls select {
  width: auto;
  min-width: 6.5rem;
}

.a11y-help-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-left: auto;
  color: var(--teal);
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.a11y-help {
  width: min(100% - 4.5rem, 89rem);
  margin: 0 auto 1.15rem;
  color: var(--ink);
  background: linear-gradient(135deg, rgba(16, 41, 58, 0.86), rgba(9, 24, 39, 0.92));
  border: 1px solid var(--control-line);
}

.a11y-help summary {
  min-height: 44px;
  padding: 0.75rem 1rem;
  color: var(--teal);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.a11y-help__content {
  max-width: 88ch;
  padding: 0 1rem 1.25rem;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.55;
}

.a11y-help__content p {
  margin: 0.75rem 0;
}

.a11y-help__content h2 {
  margin: 1.25rem 0 0.55rem;
  color: var(--ink);
  font-size: 1rem;
}

.a11y-help__content ol {
  margin: 0.65rem 0 0;
  padding-left: 1.35rem;
}

.a11y-help__content li + li {
  margin-top: 0.55rem;
}

.a11y-glossary {
  display: grid;
  gap: 0.6rem;
  margin: 0.7rem 0 0;
}

.a11y-glossary > div {
  display: grid;
  grid-template-columns: minmax(9rem, 0.35fr) minmax(0, 1fr);
  gap: 0.75rem;
}

.a11y-glossary dt {
  color: var(--teal);
  font-family: var(--mono);
  font-weight: 700;
}

.a11y-glossary dd {
  margin: 0;
}

.topbar__pitch:hover,
.footer-nav a:hover,
.source-link:hover {
  color: var(--ink);
}

.workbench-main {
  display: grid;
  gap: 1.15rem;
  padding: 1.2rem 0 4rem;
}

.data-section,
.panel {
  background: linear-gradient(135deg, rgba(16, 41, 58, 0.86), rgba(9, 24, 39, 0.92));
  border: 1px solid var(--white-line);
  box-shadow: var(--shadow);
}

.data-section {
  padding: 1.6rem;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
}

.section-heading h2,
.panel__header h2,
.session-panel h2 {
  margin: 0.48rem 0 0;
  color: var(--ink);
  font-size: clamp(1.2rem, 2vw, 1.65rem);
  font-weight: 620;
  letter-spacing: -0.04em;
}

.section-summary {
  margin: 0.6rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.source-controls {
  display: flex;
  align-items: flex-end;
  gap: 0.55rem;
  min-width: min(100%, 26rem);
}

.field-label {
  display: block;
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.3;
  text-transform: uppercase;
}

.source-controls .field-label {
  align-self: center;
  margin-right: 0.1rem;
}

.select-control,
.text-control,
textarea {
  width: 100%;
  min-width: 0;
  color: var(--ink);
  background-color: var(--navy-900);
  border: 1px solid var(--control-line);
  border-radius: 0;
}

.select-control {
  padding: 0.65rem 2rem 0.65rem 0.7rem;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--teal) 50%), linear-gradient(135deg, var(--teal) 50%, transparent 50%);
  background-position: calc(100% - 0.95rem) 1.18rem, calc(100% - 0.68rem) 1.18rem;
  background-repeat: no-repeat;
  background-size: 0.28rem 0.28rem, 0.28rem 0.28rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 700;
}

.select-control--instrument {
  width: 10rem;
}

.text-control {
  min-height: 44px;
  padding: 0.65rem 0.7rem;
  border-radius: 0;
  font-family: var(--mono);
  font-size: 0.84rem;
  font-variant-numeric: tabular-nums;
}

.select-control:hover,
.text-control:hover,
textarea:hover {
  border-color: var(--teal-line);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  padding: 0.7rem 0.88rem;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--control-line);
  border-radius: 0;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.2;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.button:hover:not(:disabled) {
  border-color: var(--teal-line);
  transform: translateY(-1px);
}

.button--primary {
  color: var(--navy-950);
  background: var(--teal);
  border-color: var(--teal);
}

.button--primary:hover:not(:disabled) {
  background: #8df2da;
  border-color: #8df2da;
}

.button--quiet {
  color: var(--muted);
  background: rgba(231, 240, 238, 0.025);
}

.button--quiet:hover:not(:disabled) {
  color: var(--ink);
  background: rgba(85, 228, 194, 0.08);
}

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

.source-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--soft-line);
  border-bottom: 1px solid var(--soft-line);
}

.status-line,
.inline-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.45;
}

.status-line::before {
  display: inline-block;
  width: 0.42rem;
  height: 0.42rem;
  margin-right: 0.55rem;
  vertical-align: 0.04rem;
  background: var(--quiet);
  border-radius: 50%;
  content: "";
}

.source-link {
  color: var(--teal);
  font-size: 0.68rem;
  text-decoration: none;
  white-space: nowrap;
}

.source-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
  margin: 1rem 0 0;
}

.source-meta__item {
  min-width: 0;
  padding-right: 0.8rem;
  border-right: 1px solid var(--soft-line);
}

.source-meta__item:last-child {
  padding-right: 0;
  border-right: 0;
}

.source-meta dt,
.account-metric dt {
  color: var(--quiet);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.3;
  text-transform: uppercase;
}

.source-meta dd {
  margin: 0.42rem 0 0;
  color: var(--ink);
  font-size: 0.71rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
  overflow-wrap: anywhere;
  white-space: normal;
}

.market-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(20rem, 0.85fr);
  gap: 1.15rem;
}

.panel {
  min-width: 0;
  padding: 1.5rem;
}

.panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.rate-summary {
  min-width: 9rem;
  text-align: right;
}

.metric-label {
  margin: 0;
  color: var(--quiet);
  font-size: 0.61rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.metric-value {
  margin: 0.28rem 0 0;
  color: var(--ink);
  font-family: var(--mono);
  font-size: clamp(1.35rem, 2.4vw, 2rem);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: -0.05em;
}

.metric-value .quote-unit,
.account-metric .quote-unit,
.field-unit {
  color: var(--teal);
  font-size: 0.62em;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.metric-change {
  margin: 0.24rem 0 0;
  color: var(--quiet);
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
}

.chart-frame {
  position: relative;
  min-height: 17.5rem;
  margin-top: 1.7rem;
  padding: 0.25rem 0 0;
  border-top: 1px solid var(--soft-line);
}

.chart-frame svg {
  display: block;
  width: 100%;
  height: auto;
  min-height: 15.8rem;
  overflow: visible;
}

.chart-grid line {
  stroke: rgba(231, 240, 238, 0.08);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.chart-area {
  fill: rgba(85, 228, 194, 0.12);
  stroke: none;
}

.chart-line {
  fill: none;
  stroke: var(--teal);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.5;
  vector-effect: non-scaling-stroke;
}

.chart-label {
  fill: var(--quiet);
  font-family: var(--mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.chart-empty {
  position: absolute;
  top: 50%;
  right: 1rem;
  left: 1rem;
  margin: 0;
  color: var(--quiet);
  font-family: var(--mono);
  font-size: 0.7rem;
  text-align: center;
  transform: translateY(-50%);
}

.chart-range {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.7rem;
  color: var(--quiet);
  font-size: 0.62rem;
  font-variant-numeric: tabular-nums;
}

.chart-range__rule {
  height: 1px;
  flex: 1;
  background: var(--white-line);
}

.ticket-card {
  display: flex;
  flex-direction: column;
}

.panel__header--ticket {
  align-items: center;
}

.ticket-mark {
  display: grid;
  width: 2.4rem;
  height: 2.4rem;
  place-items: center;
  color: var(--teal);
  background: var(--teal-soft);
  border: 1px solid var(--teal-line);
  font-size: 1.4rem;
}

.ticket-disclosure {
  margin: 1.3rem 0 0;
  padding: 0.8rem 0.85rem;
  color: var(--amber);
  background: rgba(239, 200, 117, 0.055);
  border-left: 2px solid var(--amber);
  font-size: 0.72rem;
  line-height: 1.5;
}

.ticket-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 1.35rem;
}

.field-group {
  min-width: 0;
}

.field-group--wide {
  grid-column: 1 / -1;
}

.field-group .field-label {
  margin-bottom: 0.42rem;
}

.ticket-card .button--full {
  margin-top: 1.1rem;
}

.ticket-card .inline-status {
  min-height: 2.2rem;
  margin-top: 0.8rem;
}

.session-panel {
  padding-bottom: 0;
}

.session-panel__heading,
.session-panel__body {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
}

.session-state {
  margin: 0.2rem 0 0;
  padding: 0.55rem 0.7rem;
  color: var(--danger);
  background: rgba(255, 131, 123, 0.08);
  border: 1px solid rgba(255, 131, 123, 0.24);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.session-panel__body {
  align-items: center;
  padding: 1.3rem 0 1.5rem;
}

.session-actions,
.replay-controls__buttons,
.scenario-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.account-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(6.5rem, 1fr));
  gap: 1.15rem;
  min-width: min(100%, 31rem);
  margin: 0;
}

.account-metric {
  min-width: 0;
  padding-left: 1rem;
  border-left: 1px solid var(--soft-line);
}

.account-metric dd {
  margin: 0.42rem 0 0;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.replay-controls {
  display: grid;
  grid-template-columns: minmax(10rem, 0.5fr) minmax(10rem, 1fr) minmax(0, 1.65fr);
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
  border-top: 1px solid var(--soft-line);
}

.replay-controls__label {
  display: grid;
  gap: 0.3rem;
}

.replay-date {
  color: var(--ink);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}

#observation {
  width: 100%;
  accent-color: var(--teal);
  cursor: pointer;
}

.replay-controls__buttons {
  justify-content: flex-end;
}

.scenario-panel,
.ledger-panel {
  scroll-margin-top: 1.5rem;
}

.scenario-panel textarea {
  display: block;
  min-height: 13rem;
  margin-top: 1.3rem;
  padding: 1rem;
  resize: vertical;
  font-family: var(--mono);
  font-size: 0.76rem;
  line-height: 1.55;
  tab-size: 2;
}

.field-error {
  display: block;
  min-height: 1.2rem;
  margin-top: 0.35rem;
  color: var(--danger);
  font-family: var(--mono);
  font-size: 0.68rem;
  line-height: 1.4;
}

.field-error:empty {
  min-height: 0;
  margin-top: 0;
}

.scenario-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.8rem;
}

.scenario-fingerprint {
  min-width: 0;
  overflow-wrap: anywhere;
  margin: 0;
  color: var(--quiet);
  font-size: 0.67rem;
  font-variant-numeric: tabular-nums;
}

.scenario-fingerprint span {
  color: var(--ink);
}

.observations-table {
  margin-top: 1rem;
  border-top: 1px solid var(--soft-line);
}

.observations-table summary {
  min-height: 44px;
  padding: 0.75rem 0;
  color: var(--teal);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 700;
}

.observations-table table {
  min-width: 0;
  margin-bottom: 0.4rem;
}

.observations-table caption {
  padding: 0.35rem 0.7rem 0.7rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.68rem;
  text-align: left;
}

#review-dialog {
  width: min(32rem, calc(100% - 2rem));
  max-width: 32rem;
  padding: 1.35rem;
  color: var(--ink);
  background: var(--navy-900);
  border: 1px solid var(--control-line);
  box-shadow: var(--shadow);
}

#review-dialog::backdrop {
  background: rgba(3, 9, 14, 0.78);
}

#review-dialog h2 {
  margin: 0;
  font-size: 1.25rem;
}

#review-dialog p {
  margin: 0.8rem 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.review-dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 1.25rem;
}

[hidden] {
  display: none !important;
}

.table-wrap {
  width: 100%;
  margin-top: 1.35rem;
  overflow-x: auto;
  border-top: 1px solid var(--soft-line);
}

table {
  width: 100%;
  min-width: 42rem;
  border-collapse: collapse;
  font-size: 0.69rem;
  font-variant-numeric: tabular-nums;
  text-align: left;
}

th,
td {
  padding: 0.85rem 0.7rem;
  border-bottom: 1px solid var(--soft-line);
}

th {
  color: var(--quiet);
  font-size: 0.61rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

td {
  color: var(--muted);
}

tbody tr:first-child:last-child td {
  padding-block: 1.35rem;
  color: var(--quiet);
  text-align: center;
}

.site-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  padding: 1.4rem 0 2rem;
  border-top: 1px solid var(--white-line);
}

.site-footer__copy {
  max-width: 72ch;
}

.site-footer p {
  margin: 0.25rem 0;
  color: var(--quiet);
  font-size: 0.62rem;
  line-height: 1.55;
}

.site-footer a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.site-footer .footer-nav__pitch {
  color: var(--teal);
  text-decoration: none;
}

.footer-label {
  margin-right: 0.35rem;
  color: var(--teal);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.footer-nav {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.8rem 1rem;
  font-family: var(--mono);
  font-size: 0.66rem;
}

.footer-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--muted);
  text-decoration: none;
  white-space: normal;
}

.noscript-diagnostic {
  position: fixed;
  z-index: 30;
  right: 1rem;
  bottom: 1rem;
  left: 1rem;
  padding: 1rem;
  color: var(--navy-950);
  background: var(--amber);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
}

@media (max-width: 1100px) {
  .topbar,
  .workbench-main,
  .site-footer {
    width: min(100% - 3rem, 89rem);
  }

  .a11y-controls,
  .a11y-help {
    width: min(100% - 3rem, 89rem);
  }

  .market-grid {
    grid-template-columns: minmax(0, 1.25fr) minmax(18rem, 0.85fr);
  }

  .source-controls {
    min-width: 0;
  }

  .replay-controls {
    grid-template-columns: minmax(10rem, 0.65fr) minmax(10rem, 1fr);
  }

  .replay-controls__buttons {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

@media (max-width: 820px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    flex-wrap: wrap;
    position: static;
    display: flex;
    flex-direction: row;
    align-items: center;
    width: 100%;
    height: auto;
    min-height: 4.2rem;
    padding: 0.8rem 1.5rem;
    border-right: 0;
    border-bottom: 1px solid var(--white-line);
  }

  .brand-lockup {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0;
  }

  .sidebar__context,
  .sidebar__bottom {
    display: none;
  }

  .side-nav {
    display: flex;
    flex-wrap: wrap;
    margin-left: auto;
  }

  .side-nav__link {
    padding-inline: 0.55rem;
    border-bottom: 2px solid transparent;
    border-left: 0;
  }

  .side-nav__link:hover,
  .side-nav__link--active {
    border-bottom-color: var(--teal);
    border-left-color: transparent;
  }

  .side-nav__index {
    display: none;
  }

  .topbar,
  .workbench-main,
  .site-footer {
    width: min(100% - 2rem, 89rem);
  }

  .a11y-controls,
  .a11y-help {
    width: min(100% - 2rem, 89rem);
  }

  .topbar {
    padding-top: 2.75rem;
  }

  .topbar__meta {
    align-items: flex-start;
  }

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

  .session-panel__body {
    display: grid;
  }

  .account-metrics {
    width: 100%;
  }

  .site-footer {
    display: grid;
  }

  .footer-nav {
    justify-content: flex-start;
  }
}

@media (max-width: 580px) {
  .sidebar {
    align-items: flex-start;
    gap: 0.65rem;
  }

  .brand-lockup {
    flex: 0 0 auto;
  }

  .side-nav {
    flex: 1 1 100%;
    margin-left: 0;
  }

  .side-nav__link {
    flex: 1 1 auto;
    font-size: 0.62rem;
  }

  .topbar {
    display: block;
  }

  .topbar__meta {
    display: flex;
    align-items: flex-start;
    flex-direction: row;
    flex-wrap: wrap;
    margin-top: 1.5rem;
  }

  .a11y-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
  }

  .a11y-controls button,
  .a11y-controls select,
  .a11y-help-link {
    width: 100%;
  }

  .a11y-help-link {
    justify-content: center;
    margin-left: 0;
  }

  .topbar h1 {
    max-width: 13ch;
  }

  .data-section,
  .panel {
    padding: 1.15rem;
  }

  .section-heading {
    display: block;
  }

  .source-controls {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
    margin-top: 1.25rem;
  }

  .source-controls .field-label {
    align-self: auto;
    margin: 0;
  }

  .select-control--instrument {
    width: 100%;
  }

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

  .source-meta__item:nth-child(2) {
    padding-right: 0;
    border-right: 0;
  }

  .source-meta__item:nth-child(n + 3) {
    padding-top: 0.7rem;
    border-top: 1px solid var(--soft-line);
  }

  .source-status {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.6rem;
  }

  .panel__header {
    display: block;
  }

  .rate-summary {
    margin-top: 1.1rem;
    text-align: left;
  }

  .chart-frame {
    min-height: 13.5rem;
  }

  .chart-frame svg {
    min-height: 12rem;
  }

  .ticket-fields {
    grid-template-columns: 1fr;
  }

  .field-group--wide {
    grid-column: auto;
  }

  .session-panel__heading {
    display: block;
  }

  .session-state {
    display: inline-flex;
    margin-top: 1rem;
  }

  .account-metrics {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .account-metric {
    padding: 0.7rem 0 0;
    border-top: 1px solid var(--soft-line);
    border-left: 0;
  }

  .replay-controls {
    display: block;
  }

  .replay-controls input {
    margin: 1rem 0;
  }

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

  .replay-controls__buttons .button,
  .scenario-actions .button {
    width: 100%;
  }

  .scenario-footer {
    display: block;
  }

  .scenario-fingerprint {
    margin-top: 0.7rem;
  }

  .a11y-glossary > div {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
