* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-family);
  font-variant-numeric: tabular-nums;
}

button, input { font: inherit; }

button {
  border: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  padding: 0.75rem 1rem;
  cursor: pointer;
}

button:hover:not(:disabled), button:focus-visible {
  border-color: var(--signal);
  color: var(--signal);
  outline: none;
}

button:disabled { cursor: not-allowed; color: var(--muted); }

.shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  min-height: 100vh;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
}

.topbar {
  min-height: 180px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
  padding: 2rem;
  border-bottom: 1px solid var(--line);
}

.product, .route-label, .panel-index {
  margin: 0 0 0.75rem;
  color: var(--signal);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
}

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(2rem, 5vw, 4.5rem); line-height: 0.95; font-weight: 500; letter-spacing: -0.06em; }
h2 { font-size: 1rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.08em; }

.control-status {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 240px;
  color: var(--muted);
  font-size: 0.75rem;
}

.signal { width: 9px; height: 9px; border: 1px solid var(--muted); display: inline-block; }
.signal.online { border-color: var(--signal); background: var(--signal); box-shadow: 0 0 12px var(--signal); }
.signal.error { border-color: var(--muted); background: transparent; }

.route-stage {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(120px, 2fr) minmax(180px, 1fr);
  align-items: center;
  min-height: 120px;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--line);
}

.route-endpoint strong { display: block; font-weight: 500; }
.route-selected { text-align: right; }
.route-line { position: relative; height: 1px; margin: 0 1.5rem; background: var(--line); overflow: visible; }
.route-line::before, .route-line::after { content: ""; position: absolute; top: -4px; width: 9px; height: 9px; border: 1px solid var(--line); background: var(--surface); }
.route-line::before { left: 0; }
.route-line::after { right: 0; }
.route-line span { display: block; height: 1px; width: 0; background: var(--signal); transition: width 300ms ease; box-shadow: 0 0 10px var(--signal); }
.route-line span.selected { width: 100%; }

.workspace { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(280px, 0.8fr); min-height: 480px; }
.exit-panel { padding: 2rem; border-right: 1px solid var(--line); }
.session-panel { padding: 2rem; background: var(--surface-raised); }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.section-heading p { color: var(--muted); font-size: 0.8rem; margin-bottom: 0; }
.exit-list { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }

.exit-card {
  display: grid;
  grid-template-columns: 1.5fr 1fr 0.7fr;
  gap: 1rem;
  width: 100%;
  padding: 1.25rem;
  text-align: left;
  background: var(--surface);
  border: 0;
}

.exit-card:hover, .exit-card.selected { background: #07130c; color: var(--ink); }
.exit-card.selected { box-shadow: inset 3px 0 0 var(--signal); }
.exit-card strong { display: block; margin-bottom: 0.35rem; font-weight: 500; }
.exit-card span { color: var(--muted); font-size: 0.75rem; }
.exit-card .health { text-align: right; color: var(--signal); }
.exit-card.offline .health, .exit-card.paused .health { color: var(--muted); }

.empty-state { background: var(--surface); padding: 3rem 1.25rem; color: var(--muted); }
.empty-state strong { color: var(--ink); display: block; margin-bottom: 0.75rem; font-weight: 500; }

.session-panel dl { margin: 2rem 0; }
.session-panel dl div { display: grid; grid-template-columns: 1fr 1.25fr; padding: 0.85rem 0; border-top: 1px solid var(--line); }
.session-panel dl div:last-child { border-bottom: 1px solid var(--line); }
dt { color: var(--muted); }
dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.implementation-note { color: var(--muted); font-size: 0.75rem; line-height: 1.6; }
.primary-action { width: 100%; margin-top: 1rem; border-color: var(--signal); color: var(--signal); }
.primary-action.active { background: var(--signal); color: var(--surface); }

footer { display: flex; flex-wrap: wrap; gap: 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.7rem; }
footer span { padding: 1rem 2rem; border-right: 1px solid var(--line); }

@media (max-width: 760px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  .route-stage { grid-template-columns: 1fr; gap: 1rem; }
  .route-selected { text-align: left; }
  .route-line { margin: 0; }
  .workspace { grid-template-columns: 1fr; }
  .exit-panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .exit-card { grid-template-columns: 1fr; }
  .exit-card .health { text-align: left; }
}
