@font-face {
  font-family: "KH Interference";
  src: url("../../design-system/public/fonts/kh-interference/KHInterference-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Suisse Intl";
  src: url("../../design-system/public/fonts/suisse-international/Suisse BP Intl Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Suisse Intl";
  src: url("../../design-system/public/fonts/suisse-international/Suisse BP Intl Medium.otf") format("opentype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Suisse Intl";
  src: url("../../design-system/public/fonts/suisse-international/Suisse BP Intl Bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url("../../cnr-surface-coal/app/fonts/GeistMonoVF.woff") format("woff");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #09090a;
  --surface-1: rgba(16, 16, 19, 0.97);
  --surface-2: rgba(20, 20, 24, 0.98);
  --surface-3: rgba(26, 26, 32, 0.99);
  --surface-4: rgba(33, 33, 41, 0.98);
  --border-subtle: rgba(77, 78, 92, 0.48);
  --border-default: rgba(101, 103, 122, 0.7);
  --text-primary: #f4f5f7;
  --text-secondary: #b7bac6;
  --text-tertiary: #8a8ea0;
  --accent: #ff6a21;
  --accent-soft: rgba(255, 106, 33, 0.18);
  --good: #45c08a;
  --good-soft: rgba(69, 192, 138, 0.18);
  --warn: #ffbf47;
  --warn-soft: rgba(255, 191, 71, 0.2);
  --critical: #ff6b6b;
  --critical-soft: rgba(255, 107, 107, 0.18);
  --steel: #5da8ff;
  --steel-soft: rgba(93, 168, 255, 0.16);
  --sky: #64d6ff;
  --sky-soft: rgba(100, 214, 255, 0.15);
  --shadow: 0 16px 36px rgba(0, 0, 0, 0.22);
  --radius-lg: 26px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  background:
    radial-gradient(circle at top left, rgba(255, 106, 33, 0.18), transparent 22%),
    radial-gradient(circle at top right, rgba(93, 168, 255, 0.12), transparent 24%),
    linear-gradient(180deg, #070708 0%, #0d0d10 48%, #0d1015 100%);
  color: var(--text-primary);
  font-family: "Suisse Intl", "Inter", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

.ambient-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(77, 78, 92, 0.22) 1px, transparent 1px),
    linear-gradient(90deg, rgba(77, 78, 92, 0.22) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.52), transparent 85%);
  pointer-events: none;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(9, 9, 10, 0.94);
  backdrop-filter: blur(10px);
}

.app-header-inner {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  width: 100%;
  margin: 0;
  padding: 18px 32px;
}

.page-shell {
  width: min(1520px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 48px;
}

.panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.018), rgba(255, 255, 255, 0)),
    var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: none;
}

[data-tour-key] {
  scroll-margin-top: 110px;
  transition:
    opacity 180ms ease,
    filter 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

body.tour-active [data-tour-key].is-tour-dimmed {
  opacity: 0.26;
  filter: blur(2px) saturate(0.76);
}

body.tour-active [data-tour-key].is-tour-focus {
  opacity: 1;
  filter: none;
  border-color: rgba(255, 106, 33, 0.44);
  box-shadow:
    0 0 0 1px rgba(255, 106, 33, 0.14),
    0 0 0 6px rgba(255, 106, 33, 0.08);
}

.eyebrow,
.mini-label,
.control-label,
.status-badge,
.chip,
.card-tag,
.strip-card-label,
.lane-note,
.feed-meta,
.source-kind,
.status-label {
  font-family: "KH Interference", "Suisse Intl", sans-serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 12px;
}

.mini-label {
  margin: 0 0 10px;
  color: var(--text-tertiary);
  font-size: 10px;
}

.header-brand {
  display: grid;
  gap: 0;
  min-width: 0;
  max-width: none;
}

.header-brand h1 {
  margin: 0;
  font-family: "KH Interference", "Suisse Intl", sans-serif;
  font-size: clamp(13px, 1.2vw, 18px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.header-controls {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-width: 0;
  overflow-x: auto;
  padding: 2px 0;
  scrollbar-width: thin;
}

.transport-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-end;
  gap: 10px;
  width: max-content;
}

.header-field {
  display: grid;
  gap: 6px;
  flex: 0 0 auto;
  min-width: 0;
}

.control-label {
  color: var(--text-tertiary);
  font-size: 10px;
}

.header-field-clock {
  min-width: 102px;
}

.clock-pill {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--border-default);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text-secondary);
  font-family: "Geist Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.control-field {
  position: relative;
}

.control-field::after {
  content: "";
  position: absolute;
  right: 14px;
  bottom: 15px;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--text-secondary);
  border-bottom: 1.5px solid var(--text-secondary);
  transform: rotate(45deg);
  pointer-events: none;
}

.control-field select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  min-height: 40px;
  width: 100%;
  padding: 0 34px 0 14px;
  border: 1px solid var(--border-default);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text-primary);
  font-family: "Geist Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
  cursor: pointer;
}

.control-field select:hover {
  border-color: rgba(160, 162, 180, 0.48);
}

.control-field select:focus {
  outline: none;
  border-color: rgba(255, 106, 33, 0.62);
  box-shadow: 0 0 0 1px rgba(255, 106, 33, 0.12);
}

.control-field-scenario {
  width: 228px;
}

.control-field-role {
  width: 132px;
}

.control-field-focus {
  width: 148px;
}

.movement-glance,
.story,
.strip-card,
.mine-card,
.timeline-lane,
.event-item,
.source-item,
.role-blurb {
  background: var(--surface-2);
  border: 1px solid rgba(92, 94, 110, 0.45);
}

.movement-glance {
  border-radius: var(--radius-md);
  padding: 18px 20px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 11px;
}

.tone-good {
  color: var(--good);
  background: var(--good-soft);
  border-color: rgba(69, 192, 138, 0.35);
}

.tone-warn {
  color: var(--warn);
  background: var(--warn-soft);
  border-color: rgba(255, 191, 71, 0.38);
}

.tone-critical {
  color: var(--critical);
  background: var(--critical-soft);
  border-color: rgba(255, 107, 107, 0.35);
}

.tone-info,
.tone-steel {
  color: var(--steel);
  background: var(--steel-soft);
  border-color: rgba(93, 168, 255, 0.35);
}

.tone-accent {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: rgba(255, 106, 33, 0.34);
}

.tone-sky {
  color: var(--sky);
  background: var(--sky-soft);
  border-color: rgba(100, 214, 255, 0.34);
}

.tone-muted {
  color: var(--text-tertiary);
  background: rgba(138, 142, 160, 0.12);
  border-color: rgba(138, 142, 160, 0.22);
}

.movement-glance h2 {
  margin: 0 0 14px;
  font-family: "KH Interference", "Suisse Intl", sans-serif;
  font-size: 24px;
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.glance-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
  margin: 0;
}

.glance-grid div {
  display: grid;
  gap: 5px;
}

.glance-grid dt {
  color: var(--text-tertiary);
  font-size: 11px;
}

.glance-grid dd {
  margin: 0;
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
}

.story {
  padding: 20px 22px;
  border-radius: var(--radius-md);
}

.story-bar {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.9fr);
  gap: 18px;
  align-items: start;
}

.story-copy {
  display: grid;
  align-content: start;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.app-header .chip-row {
  flex-wrap: nowrap;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(103, 105, 124, 0.35);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  font-size: 11px;
  cursor: pointer;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    color 140ms ease,
    background 140ms ease;
}

.chip:hover {
  transform: translateY(-1px);
  border-color: rgba(160, 162, 180, 0.42);
}

.chip.is-active {
  color: var(--text-primary);
  border-color: rgba(255, 106, 33, 0.45);
  background: linear-gradient(180deg, rgba(255, 106, 33, 0.18), rgba(255, 106, 33, 0.1));
}

.app-header .chip {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 6px;
  background: var(--surface-2);
  border-color: var(--border-default);
  color: var(--text-secondary);
  font-family: "KH Interference", "Suisse Intl", sans-serif;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.app-header .chip:hover {
  border-color: rgba(160, 162, 180, 0.48);
}

.app-header .chip.is-active {
  background: rgba(255, 106, 33, 0.14);
  border-color: rgba(255, 106, 33, 0.62);
}

.story-copy h2,
.section-heading h2,
.action-panel h2,
.visibility-panel h2 {
  margin: 0;
  font-family: "KH Interference", "Suisse Intl", sans-serif;
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.story-copy p:last-child,
.section-copy,
.action-panel p,
.visibility-panel p,
.source-item p,
.event-item p,
.mine-card p,
.corridor-note {
  color: var(--text-secondary);
  line-height: 1.6;
}

.story-copy p:last-child {
  max-width: 980px;
  margin: 14px 0 0;
  font-size: 15px;
}

.corridor-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.network-panel {
  margin-top: 18px;
}

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

.network-node,
.network-route {
  position: relative;
  overflow: hidden;
}

.network-node {
  display: grid;
  gap: 10px;
  min-height: 154px;
  padding: 18px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 1px solid rgba(92, 94, 110, 0.45);
}

.network-route {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 1px solid rgba(92, 94, 110, 0.45);
}

.network-node::before,
.network-route::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
}

.network-node.network-tone-good::before,
.network-route.network-tone-good::before {
  background: var(--good);
}

.network-node.network-tone-warn::before,
.network-route.network-tone-warn::before {
  background: var(--warn);
}

.network-node.network-tone-critical::before,
.network-route.network-tone-critical::before {
  background: var(--critical);
}

.network-node.network-tone-info::before,
.network-node.network-tone-steel::before,
.network-route.network-tone-info::before,
.network-route.network-tone-steel::before {
  background: var(--steel);
}

.network-node.network-tone-accent::before,
.network-route.network-tone-accent::before {
  background: var(--accent);
}

.network-node.network-tone-sky::before,
.network-route.network-tone-sky::before {
  background: var(--sky);
}

.network-node.network-tone-muted::before,
.network-route.network-tone-muted::before {
  background: rgba(138, 142, 160, 0.42);
}

.network-node-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.network-node-kind,
.network-route-label {
  color: var(--text-tertiary);
  font-family: "KH Interference", "Suisse Intl", sans-serif;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.network-node h3 {
  margin: 6px 0 0;
  font-family: "KH Interference", "Suisse Intl", sans-serif;
  font-size: 20px;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.network-node-meta {
  margin: 0;
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.45;
}

.network-node-detail {
  margin: 0;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.6;
}

.network-node.is-dimmed,
.network-route.is-dimmed {
  opacity: 0.56;
}

.network-node.is-masked .network-node-detail {
  opacity: 0.32;
}

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

.network-route-head {
  display: grid;
  gap: 8px;
}

.network-route-copy {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.55;
}

.network-route-track {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.route-stop {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(103, 105, 124, 0.35);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
}

.route-stop.is-masked {
  color: var(--text-secondary);
}

.route-arrow {
  position: relative;
  flex: 1 1 34px;
  min-width: 28px;
  height: 2px;
  background: currentColor;
  opacity: 0.8;
}

.route-arrow::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  width: 8px;
  height: 8px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: translateY(-50%) rotate(45deg);
}

.network-route-track.network-tone-good {
  color: var(--good);
}

.network-route-track.network-tone-warn {
  color: var(--warn);
}

.network-route-track.network-tone-critical {
  color: var(--critical);
}

.network-route-track.network-tone-info,
.network-route-track.network-tone-steel {
  color: var(--steel);
}

.network-route-track.network-tone-accent {
  color: var(--accent);
}

.network-route-track.network-tone-sky {
  color: var(--sky);
}

.network-route-track.network-tone-muted {
  color: var(--text-tertiary);
}

.strip-card {
  min-height: 126px;
  padding: 18px;
  border-radius: var(--radius-md);
}

.strip-card-label {
  display: block;
  color: var(--text-tertiary);
  font-size: 10px;
}

.strip-card-value {
  display: block;
  margin-top: 14px;
  font-family: "KH Interference", "Suisse Intl", sans-serif;
  font-size: 24px;
  line-height: 1.08;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.strip-card-detail {
  display: block;
  margin-top: 12px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
}

.dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(320px, 0.92fr);
  gap: 18px;
  margin-top: 18px;
}

.main-stack,
.side-stack {
  display: grid;
  gap: 18px;
}

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

.section-copy {
  max-width: 360px;
  margin: 0;
  font-size: 13px;
}

.panel {
  padding: 22px;
}

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

.mine-card {
  position: relative;
  display: grid;
  gap: 16px;
  min-height: 420px;
  padding: 18px;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.mine-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
}

.mine-card.tone-good::before {
  background: var(--good);
}

.mine-card.tone-warn::before {
  background: var(--warn);
}

.mine-card.tone-critical::before {
  background: var(--critical);
}

.mine-card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.mine-name {
  margin: 0;
  font-family: "KH Interference", "Suisse Intl", sans-serif;
  font-size: 24px;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.card-tag {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 10px;
}

.mine-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 12px;
}

.mine-ready-value {
  margin: 0;
  font-family: "KH Interference", "Suisse Intl", sans-serif;
  font-size: 46px;
  font-weight: 400;
  line-height: 0.9;
  letter-spacing: -0.02em;
}

.mine-ready-label {
  margin: 8px 0 0;
  color: var(--text-tertiary);
  font-size: 12px;
}

.mine-confidence {
  justify-self: end;
  max-width: 160px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.4;
}

.mix-block,
.mine-facts,
.mine-note {
  display: grid;
  gap: 12px;
}

.mix-row {
  display: grid;
  gap: 7px;
}

.mix-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.mix-bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.mix-bar-fill {
  height: 100%;
  border-radius: inherit;
}

.tone-fill-accent {
  background: linear-gradient(90deg, rgba(255, 106, 33, 0.65), rgba(255, 106, 33, 1));
}

.tone-fill-steel {
  background: linear-gradient(90deg, rgba(93, 168, 255, 0.55), rgba(93, 168, 255, 0.95));
}

.tone-fill-sky {
  background: linear-gradient(90deg, rgba(100, 214, 255, 0.55), rgba(100, 214, 255, 0.95));
}

.tone-fill-good {
  background: linear-gradient(90deg, rgba(69, 192, 138, 0.58), rgba(69, 192, 138, 0.95));
}

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

.fact {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(92, 94, 110, 0.32);
}

.fact-label {
  display: block;
  color: var(--text-tertiary);
  font-size: 11px;
}

.fact-value {
  display: block;
  margin-top: 6px;
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.45;
}

.mine-note {
  gap: 10px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(92, 94, 110, 0.3);
}

.mine-note h3,
.action-title {
  margin: 0;
  font-family: "KH Interference", "Suisse Intl", sans-serif;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mine-note p {
  margin: 0;
  font-size: 13px;
}

.mine-card.is-dimmed {
  opacity: 0.78;
}

.mine-card.is-masked .mix-block,
.mine-card.is-masked .mine-facts,
.mine-card.is-masked .mine-note {
  opacity: 0.3;
}

.mine-card-mask {
  display: none;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 191, 71, 0.08);
  border: 1px dashed rgba(255, 191, 71, 0.3);
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.55;
}

.mine-card.is-masked .mine-card-mask {
  display: block;
}

.timeline-panel {
  overflow: hidden;
}

.timeline-axis {
  position: relative;
  display: grid;
  grid-template-columns: 170px minmax(760px, 1fr);
  gap: 16px;
  margin-bottom: 8px;
}

.timeline-axis-spacer {
  height: 100%;
}

.axis-track {
  position: relative;
  min-height: 28px;
}

.axis-label {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  color: var(--text-tertiary);
  font-size: 11px;
}

.axis-label.is-first {
  transform: translateX(0);
}

.axis-label.is-last {
  transform: translateX(-100%);
}

.timeline-lanes {
  display: grid;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.timeline-lane {
  display: grid;
  grid-template-columns: 170px minmax(760px, 1fr);
  gap: 16px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 16px;
}

.timeline-lane.is-dimmed {
  opacity: 0.52;
}

.lane-name {
  display: block;
  font-size: 14px;
  color: var(--text-primary);
}

.lane-note {
  display: block;
  margin-top: 6px;
  color: var(--text-tertiary);
  font-size: 10px;
}

.lane-track {
  position: relative;
  min-height: 54px;
  border-radius: 14px;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.06) 0,
      rgba(255, 255, 255, 0.06) 1px,
      transparent 1px,
      transparent calc(16.666% - 1px)
    ),
    rgba(255, 255, 255, 0.025);
  overflow: hidden;
}

.lane-segment {
  position: absolute;
  top: 10px;
  bottom: 10px;
  display: flex;
  align-items: center;
  min-width: 22px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  overflow: hidden;
}

.lane-segment span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
}

.lane-segment.tone-good {
  background: linear-gradient(90deg, rgba(69, 192, 138, 0.22), rgba(69, 192, 138, 0.36));
}

.lane-segment.tone-warn {
  background: linear-gradient(90deg, rgba(255, 191, 71, 0.18), rgba(255, 191, 71, 0.3));
}

.lane-segment.tone-critical {
  background: linear-gradient(90deg, rgba(255, 107, 107, 0.2), rgba(255, 107, 107, 0.32));
}

.lane-segment.tone-accent {
  background: linear-gradient(90deg, rgba(255, 106, 33, 0.24), rgba(255, 106, 33, 0.38));
}

.lane-segment.tone-steel,
.lane-segment.tone-info {
  background: linear-gradient(90deg, rgba(93, 168, 255, 0.18), rgba(93, 168, 255, 0.31));
}

.lane-segment.tone-sky {
  background: linear-gradient(90deg, rgba(100, 214, 255, 0.18), rgba(100, 214, 255, 0.3));
}

.lane-segment.tone-muted {
  background: linear-gradient(90deg, rgba(138, 142, 160, 0.12), rgba(138, 142, 160, 0.22));
}

.event-feed,
.source-list {
  display: grid;
  gap: 12px;
}

.event-item,
.source-item {
  position: relative;
  padding: 16px 16px 16px 18px;
  border-radius: 16px;
  overflow: hidden;
}

.event-item::before,
.source-item::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: rgba(255, 255, 255, 0.1);
}

.event-item.tone-good::before {
  background: var(--good);
}

.event-item.tone-warn::before {
  background: var(--warn);
}

.event-item.tone-critical::before {
  background: var(--critical);
}

.event-item.tone-info::before,
.event-item.tone-steel::before {
  background: var(--steel);
}

.event-item.tone-accent::before {
  background: var(--accent);
}

.source-item.tone-accent::before {
  background: var(--accent);
}

.source-item.tone-steel::before {
  background: var(--steel);
}

.source-item.tone-sky::before {
  background: var(--sky);
}

.source-item.tone-good::before {
  background: var(--good);
}

.feed-head,
.source-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.feed-head h3,
.source-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.feed-meta,
.source-kind {
  color: var(--text-tertiary);
  font-size: 10px;
}

.event-item p,
.source-item p {
  margin: 10px 0 0;
  font-size: 13px;
}

.action-panel,
.visibility-panel {
  display: grid;
  gap: 16px;
}

.action-chip-row,
.role-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(92, 94, 110, 0.3);
  color: var(--text-secondary);
  font-size: 12px;
}

.role-blurb {
  padding: 14px;
  border-radius: 16px;
}

.role-blurb h3 {
  margin: 0 0 8px;
  font-family: "KH Interference", "Suisse Intl", sans-serif;
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.role-blurb p {
  margin: 0;
  font-size: 13px;
}

.button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--border-default);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text-secondary);
  font-family: "KH Interference", "Suisse Intl", sans-serif;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, color 140ms ease, background 140ms ease;
}

.button:hover {
  transform: translateY(-1px);
  border-color: rgba(160, 162, 180, 0.48);
}

.button.is-active {
  background: rgba(255, 106, 33, 0.14);
  border-color: rgba(255, 106, 33, 0.62);
  color: var(--text-primary);
}

.button.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-tertiary);
}

.button.ghost:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}

.empty-state {
  color: var(--text-tertiary);
  font-size: 13px;
  line-height: 1.55;
}

.tour-panel {
  position: fixed;
  left: 18px;
  bottom: 16px;
  z-index: 29;
  width: min(360px, calc(100vw - 40px));
  padding: 18px;
  display: grid;
  gap: 14px;
  border-radius: 18px;
  border-color: rgba(255, 106, 33, 0.18);
  background:
    linear-gradient(180deg, rgba(26, 26, 32, 0.985), rgba(16, 16, 19, 0.985)),
    radial-gradient(circle at top left, rgba(255, 106, 33, 0.1), transparent 56%);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.38);
}

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

.tour-panel-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.tour-panel-head h2 {
  margin: 0;
  font-family: "KH Interference", "Suisse Intl", sans-serif;
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tour-meta-row {
  display: grid;
  gap: 10px;
}

.tour-progress {
  color: var(--accent);
  font-family: "KH Interference", "Suisse Intl", sans-serif;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.tour-state-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tour-state-row .pill {
  min-height: 28px;
  padding: 6px 10px;
  font-size: 10px;
}

.tour-body {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.6;
}

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

.tour-actions .button {
  flex: 1 1 0;
}

.tour-actions .button.ghost {
  border-color: rgba(92, 94, 110, 0.3);
}

.tour-actions .button:disabled {
  opacity: 0.42;
  cursor: default;
  transform: none;
}

.assistant-launcher {
  position: fixed;
  right: 18px;
  bottom: 16px;
  z-index: 30;
  min-width: 228px;
  max-width: min(320px, calc(100vw - 40px));
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background:
    linear-gradient(180deg, rgba(26, 26, 32, 0.98), rgba(16, 16, 19, 0.98)),
    radial-gradient(circle at top left, rgba(255, 106, 33, 0.16), transparent 58%);
  border: 1px solid rgba(255, 106, 33, 0.26);
  border-radius: 16px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.assistant-launcher:hover,
.assistant-launcher:focus-visible {
  outline: none;
  transform: translateY(-2px);
  border-color: rgba(255, 106, 33, 0.4);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.38);
}

.assistant-launcher-dot {
  width: 11px;
  height: 11px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 16px rgba(255, 106, 33, 0.42);
}

.assistant-launcher-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.assistant-launcher-label,
.assistant-role,
.assistant-status {
  font-family: "KH Interference", "Suisse Intl", sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.assistant-launcher-label {
  color: rgba(255, 106, 33, 0.9);
  font-size: 10px;
}

.assistant-launcher-state {
  color: var(--text-primary);
  font-size: 12px;
  line-height: 1.35;
}

.assistant-launcher-meta {
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.35;
}

.assistant-overlay {
  position: fixed;
  inset: 0;
  z-index: 34;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 18px;
}

.assistant-overlay[hidden] {
  display: none;
}

.assistant-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 7, 8, 0.22);
}

.assistant-drawer {
  position: relative;
  width: min(460px, calc(100vw - 32px));
  min-height: 520px;
  max-height: min(78vh, 760px);
  padding: 20px;
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  gap: 14px;
  overflow: hidden;
  border-radius: 18px;
  border-color: rgba(255, 106, 33, 0.18);
  background:
    linear-gradient(180deg, rgba(26, 26, 32, 0.985), rgba(16, 16, 19, 0.985)),
    radial-gradient(circle at top left, rgba(255, 106, 33, 0.1), transparent 56%);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.42);
}

.assistant-panel-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.assistant-panel-head h2 {
  margin: 0;
  font-family: "KH Interference", "Suisse Intl", sans-serif;
  font-size: 24px;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.assistant-head-copy {
  margin: 10px 0 0;
  max-width: 28rem;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.55;
}

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

.assistant-status {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 10px;
}

.assistant-context {
  padding: 12px 14px;
  border: 1px solid var(--border-default);
  border-radius: 10px;
  background: rgba(16, 16, 19, 0.74);
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
}

.assistant-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.assistant-chip {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--border-default);
  border-radius: 999px;
  background: rgba(35, 35, 41, 0.78);
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
}

.assistant-chip:hover,
.assistant-chip:focus-visible {
  outline: none;
  border-color: rgba(255, 106, 33, 0.34);
  background: rgba(255, 106, 33, 0.1);
  color: var(--text-primary);
}

.assistant-chip:disabled {
  cursor: wait;
  opacity: 0.72;
}

.assistant-thread {
  min-height: 240px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 3px;
}

.assistant-message {
  max-width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--border-default);
  border-radius: 12px;
  background: rgba(16, 16, 19, 0.78);
}

.assistant-message.user {
  align-self: flex-end;
  max-width: 88%;
  background: rgba(255, 106, 33, 0.1);
  border-color: rgba(255, 106, 33, 0.28);
}

.assistant-message.assistant.is-streaming {
  border-color: rgba(255, 106, 33, 0.34);
  box-shadow: 0 0 0 1px rgba(255, 106, 33, 0.08);
}

.assistant-role {
  color: var(--text-tertiary);
  font-size: 10px;
}

.assistant-copy {
  margin-top: 6px;
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.62;
  white-space: pre-wrap;
}

.assistant-message.assistant.is-streaming .assistant-copy::after {
  content: "|";
  display: inline-block;
  margin-left: 2px;
  color: var(--accent);
  animation: assistant-cursor 0.9s steps(1, end) infinite;
}

@keyframes assistant-cursor {
  0%, 48% {
    opacity: 1;
  }

  49%, 100% {
    opacity: 0;
  }
}

.assistant-form {
  display: flex;
  align-items: center;
  gap: 10px;
}

.assistant-form input {
  flex: 1;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--border-default);
  border-radius: 10px;
  background: rgba(9, 9, 10, 0.94);
  color: var(--text-primary);
}

.assistant-form input:focus {
  outline: none;
  border-color: rgba(255, 106, 33, 0.42);
  box-shadow: 0 0 0 1px rgba(255, 106, 33, 0.12);
}

.assistant-form input:disabled {
  cursor: wait;
  color: var(--text-secondary);
}

.error-card {
  margin-top: 18px;
  padding: 18px 20px;
  border-radius: 18px;
  border: 1px solid rgba(255, 107, 107, 0.32);
  background: rgba(255, 107, 107, 0.08);
  color: var(--text-primary);
}

@media (max-width: 1320px) {
  .page-shell {
    width: min(1520px, calc(100% - 24px));
  }

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

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

  .network-routes {
    grid-template-columns: 1fr;
  }

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

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

@media (max-width: 980px) {
  .page-shell {
    width: min(1520px, calc(100% - 18px));
  }

  .app-header-inner {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 14px;
    padding: 16px 18px;
  }

  .page-shell {
    padding-top: 18px;
  }

  .header-controls {
    justify-content: flex-start;
    overflow-x: visible;
  }

  .transport-row {
    flex-wrap: wrap;
    width: 100%;
  }

  .story-bar,
  .network-grid,
  .mine-grid,
  .side-stack {
    grid-template-columns: 1fr;
  }

  .corridor-strip {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 18px;
  }

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

  .section-copy {
    max-width: none;
  }
}

@media (max-width: 720px) {
  .header-brand h1 {
    font-size: clamp(12px, 4.4vw, 16px);
  }

  .header-field,
  .control-field-scenario,
  .control-field-role,
  .control-field-focus {
    width: 100%;
  }

  .glance-grid,
  .mine-facts {
    grid-template-columns: 1fr;
  }

  .network-route-track {
    flex-wrap: wrap;
  }

  .route-arrow {
    flex: 1 1 100%;
    min-width: 100%;
  }

  .timeline-axis,
  .timeline-lane {
    grid-template-columns: 1fr;
  }

  .axis-track,
  .lane-track {
    min-width: 680px;
  }

  .assistant-overlay {
    padding: 12px;
  }

  .tour-panel {
    left: 12px;
    right: 12px;
    bottom: 90px;
    width: auto;
  }

  .assistant-launcher {
    right: 12px;
    bottom: 12px;
    min-width: 0;
    max-width: calc(100vw - 24px);
  }

  .assistant-drawer {
    width: calc(100vw - 24px);
    min-height: min(560px, calc(100vh - 24px));
    max-height: calc(100vh - 24px);
    padding: 16px;
  }

  .assistant-panel-head,
  .assistant-form {
    flex-direction: column;
    align-items: stretch;
  }
}
