:root {
  color-scheme: dark;
  --bg: #0b0f14;
  --bg-raised: #111720;
  --panel: #141b24;
  --panel-strong: #19222d;
  --panel-soft: #10161e;
  --text: #f2f4ed;
  --muted: #8996a4;
  --muted-strong: #b4bec8;
  --line: #26313d;
  --line-soft: #1b2530;
  --accent: #d8ff5f;
  --accent-strong: #bde63e;
  --accent-ink: #151c0b;
  --blue: #7eb7ff;
  --blue-soft: #18283c;
  --danger: #ff756f;
  --warning: #ffbf69;
  --success: #65db9b;
  --jump-outline: rgb(255 255 255 / 12%);
  --jump-stop-filter: none;
  --shadow: 0 24px 80px rgb(0 0 0 / 35%);
  --radius: 14px;
  --radius-small: 9px;
  --control-height: 40px;
  --field-control-height: 43px;
  --compact-control-height: 28px;
  --control-radius: 8px;
  --max-width: 1480px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f1f2ed;
  --bg-raised: #fafbf7;
  --panel: #fff;
  --panel-strong: #eef0e9;
  --panel-soft: #f7f8f3;
  --text: #151a20;
  --muted: #67717b;
  --muted-strong: #3c4650;
  --line: #d6dad3;
  --line-soft: #e7e9e3;
  --accent: #9bc71f;
  --accent-strong: #83ad0f;
  --accent-ink: #131a07;
  --blue: #236fbf;
  --blue-soft: #e4eef9;
  --danger: #c3403b;
  --warning: #a6640b;
  --success: #167c48;
  --jump-outline: rgb(21 26 32 / 30%);
  --jump-stop-filter: drop-shadow(0 0 .65px #000);
  --shadow: 0 24px 60px rgb(25 35 40 / 13%);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #f1f2ed;
    --bg-raised: #fafbf7;
    --panel: #fff;
    --panel-strong: #eef0e9;
    --panel-soft: #f7f8f3;
    --text: #151a20;
    --muted: #67717b;
    --muted-strong: #3c4650;
    --line: #d6dad3;
    --line-soft: #e7e9e3;
    --accent: #9bc71f;
    --accent-strong: #83ad0f;
    --accent-ink: #131a07;
    --blue: #236fbf;
    --blue-soft: #e4eef9;
    --danger: #c3403b;
    --warning: #a6640b;
    --success: #167c48;
    --jump-outline: rgb(21 26 32 / 30%);
    --jump-stop-filter: drop-shadow(0 0 .65px #000);
    --shadow: 0 24px 60px rgb(25 35 40 / 13%);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { min-width: 320px; background: var(--bg); }

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 12% 0%, color-mix(in srgb, var(--blue) 9%, transparent), transparent 31rem),
    var(--bg);
  color: var(--text);
  line-height: 1.5;
}

button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: wait; opacity: .58; }
a { color: inherit; }
h1, h2, h3, p { margin-top: 0; }

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

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 10px max(24px, calc((100vw - var(--max-width)) / 2));
  border-bottom: 1px solid var(--line-soft);
  background: color-mix(in srgb, var(--bg) 87%, transparent);
  backdrop-filter: blur(18px);
}

.brand { display: inline-flex; align-items: center; gap: 11px; width: fit-content; text-decoration: none; }
.brand-mark { display: block; flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.brand-type { display: grid; line-height: .95; letter-spacing: .02em; }
.brand-type strong { font-size: 10px; letter-spacing: .18em; color: var(--muted-strong); }
.brand-type span { color: var(--accent); font-size: 22px; font-weight: 850; letter-spacing: -.04em; }
.main-nav { display: flex; align-items: center; padding: 4px; background: var(--panel-soft); border: 1px solid var(--line-soft); border-radius: 11px; }
.nav-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 14px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
}
.nav-item:hover { color: var(--text); }
.nav-item.is-active { color: var(--text); background: var(--panel-strong); box-shadow: 0 1px 0 rgb(255 255 255 / 4%); }
.nav-icon { display: grid; place-items: center; flex: 0 0 18px; width: 18px; height: 18px; color: var(--accent); }
.nav-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nav-character-icon { overflow: hidden; border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); border-radius: 50%; background: var(--panel-strong); }
.nav-character-icon img { width: 100%; height: 100%; object-fit: cover; }
.nav-count { min-width: 19px; padding: 0 5px; border-radius: 10px; color: var(--muted-strong); background: var(--line); font-size: 10px; text-align: center; }
.topbar-actions { display: flex; align-items: center; gap: 16px; margin-left: auto; }

.avatar-stack {
  display: flex;
  align-items: center;
  max-width: min(32vw, 440px);
  min-height: 36px;
  padding: 2px 3px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.avatar-stack img, .avatar-fallback {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  margin-left: -8px;
  border: 2px solid var(--bg);
  border-radius: 50%;
  object-fit: cover;
  background: var(--panel-strong);
}
.avatar-stack img:first-child { margin-left: 0; }
.avatar-stack img.is-offline { filter: grayscale(1); opacity: .35; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--control-height);
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: var(--control-radius);
  font-weight: 780;
  font-size: 13px;
  text-decoration: none;
  transition: border-color .16s ease, background-color .16s ease;
}
.button-primary { background: var(--accent); color: var(--accent-ink); }
.button-primary:hover:not(:disabled) { background: var(--accent-strong); }
.button-ghost { color: var(--text); background: var(--panel); border-color: var(--line); }
.button-ghost:hover:not(:disabled) { border-color: var(--muted); }
.button-danger { color: #fff; background: var(--danger); }
.button-danger-ghost { color: var(--danger); background: transparent; border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.button-small { min-height: var(--control-height); padding: 0 14px; }
.button-icon { flex: 0 0 16px; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

.app-shell { width: min(calc(100% - 48px), var(--max-width)); min-height: calc(100vh - 150px); margin: 0 auto; }
.app-view { animation: view-in .22s ease both; }
.app-view[hidden] { display: none; }
@keyframes view-in { from { opacity: 0; transform: translateY(4px); } }

.eyebrow { color: var(--muted-strong); font-size: 10px; font-weight: 820; letter-spacing: .18em; text-transform: uppercase; }

.route-board { padding: 30px 0 72px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 22px; }
.page-heading h1 { margin: 5px 0 0; font-size: 30px; line-height: 1.1; letter-spacing: -.035em; }
.board-tools { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
input, select, textarea {
  color: var(--text);
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 15%, transparent); }
select { min-height: var(--control-height); padding: 0 34px 0 12px; }
.search-field { position: relative; display: flex; align-items: center; }
.search-field span { position: absolute; left: 12px; color: var(--muted); }
.search-field input { width: 190px; min-height: var(--control-height); padding: 0 12px 0 34px; }
.icon-button { display: inline-grid; place-items: center; width: var(--control-height); height: var(--control-height); padding: 0; color: var(--text); background: var(--panel-soft); border: 1px solid var(--line); border-radius: var(--control-radius); font-size: 18px; line-height: 1; }
.icon-button:hover { border-color: var(--muted); }

.route-board-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: stretch; gap: 16px; }
.route-board-column { display: flex; flex-direction: column; min-width: 0; }
.board-column-heading { display: flex; align-items: center; justify-content: space-between; min-height: var(--control-height); margin-bottom: 8px; padding: 0 4px; }
.board-column-heading h2 { margin: 0; font-size: 24px; line-height: 1.1; letter-spacing: -.03em; }
.board-heading-actions { display: flex; align-items: center; gap: 8px; }
.clear-routes-button { flex: 0 0 var(--control-height); }
.ad-hoc-route-button { flex: 0 0 var(--control-height); color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.ad-hoc-route-button svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.ad-hoc-route-button:hover:not(:disabled) { background: var(--accent-strong); border-color: var(--accent-strong); }
.clear-routes-button svg, .new-route-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.new-route-button { flex: 0 0 var(--control-height); color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.new-route-button svg { width: 19px; height: 19px; stroke-width: 2.1; }
.new-route-button:hover:not(:disabled) { background: var(--accent-strong); border-color: var(--accent-strong); }
.route-column-tools, .pilot-column-tools { display: flex; align-items: center; gap: 8px; min-height: var(--control-height); margin-bottom: 8px; }
.route-column-tools .search-field { flex: 1 1 150px; min-width: 120px; }
.route-column-tools .search-field input { width: 100%; }
.route-column-tools #route-status-filter { flex: 0 1 130px; min-width: 0; }
.route-column-tools #route-sort { flex: 0 1 165px; min-width: 0; }
.pilot-column-tools { justify-content: space-between; }
.pilot-column-tools #pilot-progress-sort { flex: 0 0 200px; width: 200px; }
.pilot-filter-toggle { display: inline-flex; align-items: center; gap: 8px; color: var(--muted-strong); font-size: 11px; font-weight: 700; cursor: pointer; }
.pilot-filter-toggle input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
.toggle-slider { position: relative; width: 34px; height: 18px; background: var(--line); border: 1px solid var(--line); border-radius: 999px; }
.toggle-slider::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; background: var(--muted-strong); border-radius: 50%; }
.pilot-filter-toggle input:checked + .toggle-slider { background: var(--accent); border-color: var(--accent); }
.pilot-filter-toggle input:checked + .toggle-slider::after { left: 18px; background: var(--accent-ink); }
.pilot-filter-toggle input:focus-visible + .toggle-slider { outline: 2px solid var(--blue); outline-offset: 2px; }
.routes-list { display: grid; gap: 8px; }
.route-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(150px, 1.2fr) minmax(130px, 1fr) 58px 87px;
  align-items: center;
  gap: 14px;
  min-height: 96px;
  padding: 14px 15px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
}
.route-primary { min-width: 0; }
.route-primary-top { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.status-pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 7px; border-radius: 5px; font-size: 9px; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.status-pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-ready { color: var(--success); background: color-mix(in srgb, var(--success) 10%, transparent); }
.status-draft { color: var(--warning); background: color-mix(in srgb, var(--warning) 10%, transparent); }
.status-archived { color: var(--muted); background: var(--panel-soft); }
.route-updated { color: var(--muted); font-size: 10px; }
.route-primary h3 { overflow: hidden; margin: 0; font-size: 17px; text-overflow: ellipsis; white-space: nowrap; }
.route-primary p { overflow: hidden; margin: 4px 0 0; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.route-line { min-width: 0; }
.route-system { min-width: 0; }
.route-system span { display: block; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.route-system strong { display: block; overflow: hidden; margin-top: 2px; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.route-metrics { display: flex; align-items: center; gap: 14px; }
.metric { display: grid; }
.metric strong { font-size: 16px; }
.metric span { color: var(--muted); font-size: 9px; font-weight: 750; text-transform: uppercase; letter-spacing: .09em; }
.route-actions { display: flex; align-items: center; justify-self: end; gap: 7px; width: 87px; }
.route-edit, .route-assign { display: grid; place-items: center; flex: 0 0 auto; height: var(--control-height); padding: 0; border-radius: var(--control-radius); }
.route-edit { width: var(--control-height); color: var(--muted-strong); background: var(--panel-soft); border: 1px solid var(--line); }
.route-assign { width: var(--control-height); color: var(--accent-ink); background: var(--accent); border: 1px solid var(--accent); }
.route-edit svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.route-assign svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; }
.route-edit:hover { color: var(--text); border-color: var(--muted); }
.route-assign:hover { background: var(--accent-strong); border-color: var(--accent-strong); }

.pilot-progress-list { display: grid; gap: 8px; }
.pilot-progress-row {
  display: grid;
  grid-template-columns: 38px minmax(120px, .85fr) minmax(150px, 1.35fr) 66px 26px;
  align-items: center;
  gap: 12px;
  min-height: 76px;
  padding: 12px 14px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-small);
}
.pilot-progress-row > img { width: 38px; height: 38px; border-radius: 8px; object-fit: cover; background: var(--panel-strong); }
.pilot-progress-row.is-offline > img { filter: grayscale(1); opacity: .45; }
.pilot-progress-identity, .pilot-progress-location, .pilot-progress-jumps { min-width: 0; }
.pilot-progress-identity strong, .pilot-progress-location strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pilot-progress-identity strong { font-size: 13px; }
.pilot-progress-identity span { display: block; overflow: hidden; margin-top: 2px; color: var(--accent); font-size: 12px; font-weight: 650; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.pilot-progress-location span, .pilot-progress-jumps span { display: block; color: var(--muted); font-size: 8px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.pilot-progress-jumps span { color: var(--muted-strong); font-size: 9px; }
.pilot-progress-jumps.is-complete span { color: var(--success); }
.pilot-progress-jumps.is-docking span { color: var(--accent); }
.pilot-progress-location strong { margin-top: 2px; font-size: 12px; }
.pilot-progress-jumps { text-align: right; }
.pilot-progress-jumps strong { display: block; font-size: 18px; line-height: 1.1; }
.pilot-progress-actions { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.pilot-progress-edit, .pilot-progress-remove { display: grid; place-items: center; width: 26px; height: 26px; padding: 0; color: var(--muted); background: transparent; border: 1px solid transparent; border-radius: 6px; line-height: 1; }
.pilot-progress-edit svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.pilot-progress-edit:hover, .pilot-progress-edit:focus-visible { color: var(--text); background: var(--panel-strong); border-color: var(--muted); }
.pilot-progress-remove { font-size: 18px; }
.pilot-progress-remove:hover, .pilot-progress-remove:focus-visible { color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, transparent); border-color: color-mix(in srgb, var(--danger) 28%, transparent); }
.pilot-progress-edit:focus-visible, .pilot-progress-remove:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.pilot-route-timeline { position: relative; display: grid; grid-column: 3 / -1; grid-row: 2; gap: 4px; min-width: 0; margin-top: -3px; }
.pilot-route-chevron { position: absolute; top: -3px; left: -40px; display: grid; place-items: center; width: 18px; height: 18px; padding: 0; color: var(--text); background: transparent; border: 0; border-radius: 4px; }
.pilot-route-chevron:hover, .pilot-route-chevron:focus-visible { color: var(--accent); background: var(--panel-strong); }
.pilot-route-chevron:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.pilot-route-chevron svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.pilot-route-chevron.is-expanded svg { transform: rotate(90deg); }
.pilot-route-sequence { display: grid; gap: 4px; min-width: 0; }
.pilot-jump-track { display: flex; flex-wrap: wrap; gap: 1px 2px; min-width: 0; }
.jump-marker { position: relative; flex: 0 0 10px; width: 10px; height: 10px; }
.jump-marker.is-transit::before { content: ""; position: absolute; inset: 1px; background: var(--jump-color); box-shadow: inset 0 0 0 1px var(--jump-outline); }
.jump-marker.is-docking { filter: var(--jump-stop-filter); }
.jump-marker.is-docking::before { content: ""; position: absolute; inset: 0; border: 1px solid var(--jump-color); background: transparent; }
.jump-marker.is-stop { filter: var(--jump-stop-filter); }
.jump-marker.is-stop::before, .jump-marker.is-stop::after { content: ""; position: absolute; background: var(--jump-color); }
.jump-marker.is-stop::before { top: 4px; left: 0; width: 10px; height: 2px; }
.jump-marker.is-stop::after { top: 0; left: 4px; width: 2px; height: 10px; }
.pilot-wormhole-stop { display: grid; grid-template-columns: 12px minmax(0, auto) 1fr; align-items: baseline; gap: 5px 8px; min-width: 0; color: var(--text); font-size: 10px; }
.pilot-wormhole-symbol { align-self: center; width: 14px; height: 14px; margin-left: -1px; object-fit: contain; }
.pilot-wormhole-instruction { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 4px; min-width: 0; }
.pilot-wormhole-instruction strong { color: var(--text); font-size: 11px; }
.pilot-wormhole-instruction b { color: var(--text); font-size: 12px; letter-spacing: .04em; text-decoration: underline 2px var(--accent); text-underline-offset: 2px; }
.pilot-wormhole-stop small { color: var(--text); font-size: 10px; white-space: nowrap; }
.pilot-wormhole-stop.is-expired .pilot-wormhole-instruction b { color: var(--danger); }
.pilot-route-details { display: grid; gap: 1px; }
.pilot-route-detail-row { display: grid; grid-template-columns: 10px minmax(80px, 1fr) 38px minmax(90px, 1fr); align-items: center; gap: 8px; min-height: 20px; }
.pilot-route-detail-row { color: var(--text); font-size: 10px; }
.pilot-route-detail-row strong { font-size: 10px; white-space: nowrap; }
.pilot-route-detail-row > span:last-child { white-space: nowrap; }
.pilot-route-detail-security { font-variant-numeric: tabular-nums; }
.pilot-waypoint-error { grid-column: 3 / -1; color: var(--danger); font-size: 9px; }
.pilot-progress-empty { display: grid; place-items: center; min-height: 96px; padding: 20px; color: var(--muted); background: var(--panel-soft); border: 1px dashed var(--line); border-radius: var(--radius-small); font-size: 12px; text-align: center; }
.progress-note { margin: auto 0 0; padding: 12px 4px 0; color: var(--muted); border-top: 1px solid var(--line-soft); font-size: 10px; line-height: 1.45; }
.route-board-column .empty-state { padding: 38px 18px; }
.route-board-column .empty-orbit { width: 54px; height: 54px; margin-bottom: 14px; }
.route-board-column .empty-orbit::before { inset: 13px; }
.route-board-column .empty-orbit::after { top: 5px; left: 34px; }

.empty-state { display: grid; justify-items: center; padding: 70px 24px; border: 1px dashed var(--line); border-radius: var(--radius); text-align: center; }
.empty-orbit { position: relative; width: 76px; height: 76px; margin-bottom: 22px; border: 1px solid var(--line); border-radius: 50%; }
.empty-orbit::before { content: ""; position: absolute; inset: 18px; border: 1px solid var(--line); border-radius: 50%; }
.empty-orbit::after { content: ""; position: absolute; top: 8px; left: 47px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: -29px 38px 0 -2px var(--blue); }
.empty-state h3 { margin-bottom: 6px; font-size: 20px; }
.empty-state p { max-width: 430px; margin-bottom: 21px; color: var(--muted); }

.page-heading { align-items: center; padding: 30px 0 20px; border-bottom: 1px solid var(--line-soft); }
.page-heading h1 { margin-top: 9px; font-size: 34px; }
.page-heading p { max-width: 670px; margin: 12px 0 0; color: var(--muted); }
.page-heading-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.utility-heading { min-height: 68px; margin-bottom: 0; padding: 14px 0; }
.utility-heading h1 { margin: 0; font-size: 24px; }

.character-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 10px; padding: 14px 0 48px; }
.character-card { position: relative; overflow: hidden; padding: 14px; background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius-small); }
.character-card::after { content: ""; position: absolute; right: -44px; top: -44px; width: 110px; height: 110px; border: 1px solid var(--line-soft); border-radius: 50%; }
.character-head { position: relative; z-index: 1; display: flex; align-items: center; gap: 11px; }
.character-head img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: var(--panel-strong); }
.character-head h2 { margin: 0 0 1px; font-size: 15px; }
.character-head p { margin: 0; color: var(--muted); font-size: 11px; }
.character-location { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; margin: 12px 0 9px; padding: 9px 10px; border: 1px solid var(--line-soft); border-radius: 7px; background: var(--panel-soft); }
.location-pulse { width: 9px; height: 9px; margin-top: 5px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 5px color-mix(in srgb, var(--success) 10%, transparent); }
.location-pulse.is-offline { background: var(--muted); box-shadow: 0 0 0 5px color-mix(in srgb, var(--muted) 10%, transparent); }
.character-location span { display: block; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .1em; }
.character-location strong { display: block; overflow: hidden; font-size: 13px; text-overflow: ellipsis; }
.character-ship { display: flex; align-items: baseline; gap: 7px; min-width: 0; margin: 0 0 9px; padding: 0 10px; }
.character-ship strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.character-ship small { flex: 0 0 auto; color: var(--muted); font-size: 9px; }
.character-actions { display: flex; justify-content: space-between; align-items: center; }
.scope-status { color: var(--success); font-size: 10px; font-weight: 700; }
.scope-status.is-offline { color: var(--muted); }
.text-button { padding: 4px; color: var(--muted); background: transparent; border: 0; font-size: 11px; }
.text-button:hover { color: var(--danger); }
.reconnect-button { color: var(--accent); }
.reconnect-button:hover { color: var(--accent-strong); }
.add-character-card { min-height: 177px; display: grid; place-items: center; border-style: dashed; background: transparent; text-align: center; }
.add-character-card button { display: grid; place-items: center; width: var(--control-height); height: var(--control-height); margin: auto auto 7px; color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); border-radius: 50%; font-size: 19px; }
.add-character-card strong { display: block; }
.add-character-card span { color: var(--muted); font-size: 11px; }

.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px 0 48px; }
.settings-column { display: contents; }
.settings-appearance-card { grid-column: 1; grid-row: 1; }
.settings-transfer-card { grid-column: 1; grid-row: 2; }
.settings-routing-card { grid-column: 2; grid-row: 1 / span 2; }
.settings-local-card { grid-column: 1; grid-row: 3; }
.settings-universe-card { grid-column: 2; grid-row: 3; }
.settings-local-card, .settings-universe-card { align-self: start; width: 100%; }
.settings-card { padding: 17px; background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius-small); }
.settings-card-wide { grid-column: 1 / -1; }
.settings-card-heading { display: flex; align-items: flex-start; gap: 11px; margin-bottom: 14px; }
.settings-glyph { display: grid; place-items: center; flex: 0 0 34px; height: 34px; border-radius: 7px; color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent); font-size: 9px; font-weight: 900; letter-spacing: .05em; }
.settings-card-heading h2 { margin: 0 0 2px; font-size: 17px; }
.settings-card-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.settings-routing-grid { display: grid; grid-template-columns: 1fr; align-items: start; gap: 13px; }
.settings-preference-fieldset { margin: 0; }
.settings-preference-fieldset label > span { padding: 10px; }
.settings-routing-secondary { display: grid; gap: 13px; }
.settings-routing-secondary > .field { margin: 0; }
.settings-avoid-builder { display: grid; gap: 7px; min-width: 0; }
.settings-avoid-builder .builder-heading > span, .settings-avoid-builder .system-chip { color: var(--text); }
.settings-avoid-builder input::placeholder { color: var(--muted-strong); opacity: 1; }
.settings-avoid-builder .system-chip button { color: var(--text); }
.settings-avoid-builder .system-add-row input, .settings-avoid-builder .system-add-row .button { min-height: var(--field-control-height); }
.settings-avoid-empty { align-self: center; color: var(--muted); font-size: 10px; }
.settings-shortcut-options { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 10px; min-width: 0; margin: 0; padding: 0; border: 0; }
.settings-shortcut-options legend { grid-column: 1 / -1; margin-bottom: 1px; }
.settings-check-option { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 8px 10px; background: var(--panel-soft); border: 1px solid var(--line); border-radius: var(--control-radius); cursor: pointer; }
.settings-check-option input { flex: 0 0 auto; width: 15px; height: 15px; margin: 0; accent-color: var(--accent); }
.settings-check-option span { display: grid; min-width: 0; }
.settings-check-option strong { font-size: 10px; }
.settings-check-option small { color: var(--muted); font-size: 8px; }
.settings-override-option { width: 100%; }
.field { display: grid; gap: 7px; margin-top: 16px; }
.field > span, fieldset > legend { color: var(--muted-strong); font-size: 11px; font-weight: 750; }
.field > span small { color: var(--muted); font-weight: 500; }
.field input, .field select, .field textarea { width: 100%; min-height: var(--field-control-height); padding: 10px 12px; }
.field textarea { resize: vertical; }
.field small { color: var(--muted); font-size: 10px; }
.coverage-area-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; }
.coverage-area-row select, .coverage-area-row input, .coverage-area-row .button { min-height: var(--field-control-height); }
.builder-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted-strong); font-size: 11px; font-weight: 750; }
.builder-heading small { color: var(--muted); font-weight: 500; }
.builder-actions { display: flex; align-items: center; gap: 5px; }
.wormhole-fieldset { min-width: 0; margin: 16px 0 0; padding: 0; border: 0; }
.wormhole-fieldset legend { margin-bottom: 7px; }
.wormhole-fieldset legend small { color: var(--muted); font-weight: 500; }
.wormhole-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.wormhole-option { position: relative; min-width: 0; }
.wormhole-option input { position: absolute; opacity: 0; pointer-events: none; }
.wormhole-option span { display: grid; min-height: 40px; align-content: center; padding: 6px 11px; background: var(--panel-soft); border: 1px solid var(--line); border-radius: var(--control-radius); cursor: pointer; }
.wormhole-option strong { font-size: 11px; }
.wormhole-option small, .wormhole-status { color: var(--muted); font-size: 9px; }
.wormhole-option input:checked + span { border-color: var(--blue); background: var(--blue-soft); box-shadow: inset 0 0 0 1px var(--blue); }
.wormhole-option input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.wormhole-option input:disabled + span { cursor: default; }
.wormhole-status { display: block; margin-top: 6px; }
.wormhole-status.is-error { color: var(--danger); }
.current-location-button { min-height: var(--compact-control-height); padding: 0 9px; color: var(--blue); background: var(--blue-soft); border: 1px solid color-mix(in srgb, var(--blue) 25%, transparent); border-radius: 6px; font-size: 9px; font-weight: 750; }
.current-location-button:hover:not(:disabled) { color: var(--text); border-color: var(--blue); }
.current-location-button:disabled { opacity: .42; cursor: default; }
.coverage-assignment-actions { display: flex; gap: 5px; }
.coverage-assignment-actions button { min-height: var(--compact-control-height); padding: 0 8px; color: var(--blue); background: var(--blue-soft); border: 1px solid color-mix(in srgb, var(--blue) 25%, transparent); border-radius: 6px; font-size: 9px; font-weight: 750; }
.system-add-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.system-add-row .button, .connection-add-row .button { min-height: var(--field-control-height); white-space: nowrap; }
.connection-add-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.connection-add-row > span { color: var(--accent); font-size: 18px; }
.ordered-system-list, .connection-list { display: grid; gap: 6px; }
.builder-empty { margin: 0; padding: 12px; color: var(--muted); background: var(--panel-soft); border: 1px dashed var(--line); border-radius: 8px; font-size: 10px; text-align: center; }
.ordered-system-row { display: grid; grid-template-columns: 24px 27px minmax(0, 1fr) auto auto; align-items: center; gap: 8px; min-height: 42px; padding: 6px 7px; background: var(--panel-soft); border: 1px solid var(--line-soft); border-radius: 8px; transition: border-color .15s, box-shadow .15s, opacity .15s; }
.waypoint-drag-handle { display: grid; place-items: center; width: 24px; height: var(--compact-control-height); padding: 0; color: var(--muted); background: transparent; border: 0; border-radius: 6px; cursor: grab; touch-action: none; }
.waypoint-drag-handle:hover, .waypoint-drag-handle:focus-visible { color: var(--text); background: var(--panel-strong); }
.waypoint-drag-handle:active { cursor: grabbing; }
.ordered-system-row.is-dragging { z-index: 3; opacity: .78; border-color: var(--accent); box-shadow: 0 8px 24px rgb(0 0 0 / 28%); }
.ordered-system-list.is-reordering { cursor: grabbing; }
body.is-reordering-waypoint { cursor: grabbing; user-select: none; }
.ordered-system-row.is-coverage-stop { row-gap: 6px; }
.system-order { display: grid; place-items: center; width: 27px; height: 27px; color: var(--accent-ink); background: var(--accent); border-radius: 7px; font-size: 10px; font-weight: 850; }
.ordered-system-name { display: grid; min-width: 0; }
.ordered-system-name strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.ordered-system-name small { overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.ordered-system-row.is-final-stop { border-color: color-mix(in srgb, var(--accent) 28%, var(--line-soft)); }
.system-id { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; }
.system-row-actions { display: flex; gap: 3px; }
.system-row-actions button, .system-chip button, .connection-row button { display: grid; place-items: center; width: var(--compact-control-height); height: var(--compact-control-height); padding: 0; color: var(--muted); background: var(--panel-strong); border: 1px solid var(--line); border-radius: 6px; line-height: 1; }
.system-row-actions button:hover:not(:disabled), .system-chip button:hover, .connection-row button:hover { color: var(--text); border-color: var(--muted); }
.system-row-actions button:disabled { opacity: .25; cursor: default; }
.system-chip-list { display: flex; flex-wrap: wrap; gap: 6px; }
.system-chip { display: inline-flex; align-items: center; gap: 7px; padding: 4px 4px 4px 10px; color: var(--muted-strong); background: var(--panel-soft); border: 1px solid var(--line-soft); border-radius: 20px; font-size: 10px; }
.system-chip button { width: 22px; height: 22px; border-radius: 50%; }
.connection-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 40px; padding: 6px 7px 6px 12px; background: var(--panel-soft); border: 1px solid var(--line-soft); border-radius: 8px; }
.connection-row strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.connection-row > span { color: var(--accent); }
.settings-facts { display: grid; gap: 0; margin: 0; }
.settings-facts div { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.settings-facts div:last-child { border: 0; }
.settings-facts dt { color: var(--muted); font-size: 11px; }
.settings-facts dd { margin: 0; font-size: 12px; font-weight: 750; }
.danger-card .settings-glyph { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 25%, transparent); background: color-mix(in srgb, var(--danger) 7%, transparent); }
.data-actions { display: flex; flex-wrap: wrap; gap: 9px; }

.app-footer { width: min(calc(100% - 48px), var(--max-width)); display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: auto; padding: 24px 0 34px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 10px; }
.app-footer-links { display: flex; align-items: center; justify-content: center; gap: 8px; }
.app-footer-links a { display: inline-flex; align-items: center; border-radius: 4px; }
.app-footer-links a:hover { filter: brightness(1.15); }
.app-footer-links a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.app-footer-github { display: block; width: 24px; height: 24px; }
.app-footer-suite { display: block; height: 20px; width: auto; }
.app-footer-disclaimer { cursor: help; text-decoration: underline; text-underline-offset: 2px; }

.modal {
  width: min(820px, calc(100vw - 28px));
  max-height: min(90vh, 920px);
  padding: 0;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 17px;
  box-shadow: var(--shadow);
}
.modal::backdrop { background: rgb(2 5 8 / 75%); backdrop-filter: blur(5px); }
.modal-header { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 21px 24px; border-bottom: 1px solid var(--line-soft); background: var(--panel); }
.modal-header h2 { margin: 4px 0 0; font-size: 23px; letter-spacing: -.03em; }
.modal-close { width: var(--control-height); height: var(--control-height); padding: 0; color: var(--muted); background: var(--panel-soft); border: 1px solid var(--line); border-radius: 50%; font-size: 21px; line-height: 1; }
.modal-body { padding: 24px; overflow: auto; }
.modal-footer { position: sticky; bottom: 0; z-index: 2; display: flex; align-items: center; justify-content: flex-end; gap: 9px; padding: 15px 24px; border-top: 1px solid var(--line-soft); background: var(--panel); }
.modal-status { margin: 0 auto 0 0; color: var(--muted); font-size: 11px; }
.modal-status.is-error { color: var(--danger); }
#route-coverage-status.is-error { color: var(--danger); font-weight: 700; }
.route-assignment .modal-status { flex: 1 1 280px; line-height: 1.35; }
.route-assignment .modal-footer { flex-wrap: wrap; }
.route-editor { overflow: visible; }
.route-editor > form { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; max-height: min(90vh, 920px); overflow: hidden; border-radius: inherit; }
.system-autocomplete-menu {
  position: fixed;
  z-index: 20;
  display: grid;
  gap: 2px;
  padding: 6px;
  overflow-y: auto;
  color: var(--text);
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
}
.system-autocomplete-menu[hidden] { display: none !important; }
.system-autocomplete-menu button { display: grid; gap: 2px; width: 100%; padding: 9px 10px; color: var(--text); background: transparent; border: 1px solid transparent; border-radius: 7px; text-align: left; }
.system-autocomplete-menu button:hover, .system-autocomplete-menu button.is-active { background: var(--blue-soft); border-color: color-mix(in srgb, var(--blue) 32%, transparent); }
.system-autocomplete-menu strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.system-autocomplete-menu .market-hub-label { color: var(--accent); font-size: 9px; font-style: normal; letter-spacing: .04em; }
.system-autocomplete-menu span { color: var(--muted); font-size: 9px; }
.editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 18px; }
.editor-wide, .editor-name { grid-column: 1 / -1; }
.preference-fieldset, .character-picker { min-width: 0; margin: 18px 0 0; padding: 0; border: 0; }
.preference-fieldset > legend, .character-picker > legend { margin-bottom: 8px; }
.preference-fieldset { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.preference-fieldset legend { grid-column: 1 / -1; }
.preference-fieldset label { position: relative; }
.preference-fieldset input { position: absolute; opacity: 0; }
.preference-fieldset label > span { display: grid; gap: 1px; height: 100%; padding: 13px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-soft); }
.preference-fieldset input:checked + span { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--panel-soft)); box-shadow: inset 0 0 0 1px var(--accent); }
.preference-fieldset strong { font-size: 12px; }
.preference-fieldset small { color: var(--muted); font-size: 9px; }
.routing-override-option { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 9px 11px; background: var(--panel-soft); border: 1px solid var(--line); border-radius: var(--control-radius); cursor: pointer; }
.routing-override-option input { flex: 0 0 auto; width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.routing-override-option span { display: grid; min-width: 0; }
.routing-override-option strong { font-size: 11px; }
.routing-override-option small { color: var(--muted); font-size: 9px; }
.range-field > span { display: flex; justify-content: space-between; }
.range-field output { color: var(--accent); }
.range-field input { padding: 0; accent-color: var(--accent); box-shadow: none; border: 0; }
.range-field.is-disabled { opacity: .48; }
.range-field.is-disabled input { cursor: not-allowed; }
#route-assignment-character-options, #clear-routes-character-options, #ad-hoc-character-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.character-option { position: relative; }
.character-option input { position: absolute; opacity: 0; }
.character-option span { display: grid; grid-template-columns: 35px 1fr; align-items: center; gap: 9px; padding: 8px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-soft); }
.character-option input:checked + span { border-color: var(--blue); background: var(--blue-soft); }
.character-option.is-offline span { filter: grayscale(.65); opacity: .62; }
.character-option.is-disabled span { filter: grayscale(.85); opacity: .45; cursor: not-allowed; }
.character-option img { grid-row: 1 / 3; width: 35px; height: 35px; border-radius: 7px; object-fit: cover; }
.character-option strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.character-option small { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }

.route-assignment {
  width: min(820px, calc(100vw - 28px));
  overflow: hidden;
}
.route-assignment > form, .ad-hoc-route-dialog > form, .clear-routes-dialog > form { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; max-height: min(90vh, 920px); overflow: hidden; border-radius: inherit; }
.route-assignment .modal-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.ad-hoc-route-dialog { width: min(820px, calc(100vw - 28px)); overflow: hidden; }
.ad-hoc-route-dialog .modal-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.ad-hoc-route-dialog .modal-footer { flex-wrap: wrap; }
.ad-hoc-route-summary { display: flex; align-items: center; flex: 1 1 470px; gap: 12px; min-width: 0; }
.ad-hoc-route-dialog .modal-status { display: flex; align-items: baseline; flex: 0 0 auto; flex-wrap: wrap; gap: 4px 12px; color: var(--text); line-height: 1.35; }
.ad-hoc-route-dialog .modal-status strong { color: var(--accent); white-space: nowrap; }
.ad-hoc-route-preview { flex: 1 1 auto; min-width: 80px; }
.ad-hoc-route-preview .pilot-jump-track { align-items: center; }
.ad-hoc-route-preview .wormhole-route-marker { flex: 0 0 14px; width: 14px; height: 14px; margin: -2px 2px; object-fit: contain; }
.ad-hoc-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; min-width: 0; margin: 0; padding: 0; border: 0; }
.ad-hoc-destination-field, .ad-hoc-character-picker, .ad-hoc-preference-fieldset, #ad-hoc-security-penalty-field, .ad-hoc-override-option, .ad-hoc-wormholes, .ad-hoc-avoid-builder, .ad-hoc-connection-builder { grid-column: 1 / -1; }
.ad-hoc-destination-field { margin-top: 0; }
.ad-hoc-character-picker { margin-top: 16px; }
.ad-hoc-preference-fieldset { margin-top: 16px; }
.ad-hoc-wormholes { margin-top: 16px; }
.clear-routes-dialog { width: min(820px, calc(100vw - 28px)); overflow: hidden; }
.clear-routes-dialog .modal-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.clear-routes-dialog .modal-footer { flex-wrap: wrap; }
.assignment-intro { margin: 0 0 20px; color: var(--muted); font-size: 11px; }
.assignment-wormholes { margin: 0 0 18px; }
.assignment-preference-fieldset { margin: 0 0 12px; }
#assignment-security-penalty-field { margin: 0 0 18px; }
.assignment-override-option { margin-bottom: 18px; }
.assignment-character-picker { margin-top: 0; }
.assignment-character-heading { margin-bottom: 8px; }
.assignment-coverage { display: grid; gap: 10px; margin-top: 18px; }
.assignment-stop-list { display: grid; gap: 6px; }
.assignment-stop-row { display: grid; grid-template-columns: 27px minmax(0, 1fr); align-items: center; gap: 10px; padding: 7px; background: var(--panel-soft); border: 1px solid var(--line-soft); border-radius: 8px; }

.route-detail { width: min(900px, calc(100vw - 28px)); }
.detail-hero { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-soft); }
.detail-endpoint:last-child { text-align: right; }
.detail-endpoint span { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .11em; }
.detail-endpoint strong { display: block; margin-top: 3px; font-size: 20px; }
.detail-jumps { display: grid; min-width: 100px; text-align: center; }
.detail-jumps strong { color: var(--accent); font-size: 28px; }
.detail-jumps span { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 7px; margin: 14px 0 22px; }
.detail-meta span { padding: 5px 8px; color: var(--muted-strong); background: var(--panel-soft); border: 1px solid var(--line-soft); border-radius: 6px; font-size: 10px; }
.detail-notes { margin: 0 0 22px; padding: 14px 16px; border-left: 2px solid var(--blue); color: var(--muted-strong); background: var(--blue-soft); font-size: 12px; white-space: pre-wrap; }
.calculation-group { margin-top: 18px; }
.calculation-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 9px; }
.calculation-heading strong { font-size: 13px; }
.calculation-heading span { color: var(--muted); font-size: 10px; }
.coverage-calculation { padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: 9px; background: var(--panel-soft); }
.coverage-calculation summary { margin: 0; cursor: pointer; list-style-position: outside; }
.coverage-calculation[open] summary { margin-bottom: 10px; }
.system-path { display: flex; flex-wrap: wrap; gap: 5px; margin: 0; padding: 0; list-style: none; }
.system-path li { display: inline-flex; align-items: center; gap: 5px; color: var(--muted-strong); font-size: 10px; }
.system-path li:not(:last-child)::after { content: "›"; color: var(--line); font-size: 15px; }
.system-path li:first-child, .system-path li:last-child { color: var(--text); font-weight: 750; }
.assigned-crew { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.crew-chip { display: flex; align-items: center; gap: 7px; padding: 5px 9px 5px 5px; border: 1px solid var(--line); border-radius: 20px; font-size: 10px; }
.crew-chip img { width: 24px; height: 24px; border-radius: 50%; }
.crew-chip > span { display: grid; line-height: 1.25; }
.crew-chip small { color: var(--muted); font-size: 8px; }
.crew-chip.is-offline { filter: grayscale(1); opacity: .5; }
.footer-spacer { flex: 1; }
.confirm-dialog { width: min(470px, calc(100vw - 28px)); }
.confirm-dialog .modal-body p { margin: 0; color: var(--muted-strong); }

.toast { position: fixed; right: 24px; bottom: 24px; z-index: 50; max-width: min(390px, calc(100vw - 48px)); padding: 13px 16px; color: var(--text); background: var(--panel-strong); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 9px; box-shadow: var(--shadow); font-size: 12px; opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .2s, transform .2s; }
.modal > .toast { position: absolute; right: 16px; bottom: 70px; max-width: min(390px, calc(100% - 32px)); }
.toast.is-visible { opacity: 1; transform: none; }
.toast.is-error { border-left-color: var(--danger); }

.auth-page { display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(460px, 100%); padding: 44px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); box-shadow: var(--shadow); text-align: center; }
.brand-mark-large { width: 70px; height: 70px; margin-bottom: 25px; }
.auth-card h1 { margin: 9px 0 12px; font-size: 30px; letter-spacing: -.04em; }
.auth-card p { color: var(--muted); }
.auth-spinner { display: inline-block; width: 26px; height: 26px; margin-top: 12px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1180px) {
  .route-board-grid { grid-template-columns: 1fr; }
  .pilot-progress-column { margin-top: 10px; }
  .route-row { grid-template-columns: minmax(220px, 1fr) minmax(260px, 1.4fr) 80px 87px; }
}

@media (max-width: 1050px) {
  .main-nav { position: fixed; left: 50%; bottom: 14px; z-index: 25; transform: translateX(-50%); box-shadow: var(--shadow); }
  .route-row { grid-template-columns: minmax(170px, 1fr) minmax(280px, 1.5fr) 87px; }
  .route-metrics { display: none; }
  .app-footer { padding-bottom: 90px; }
}

@media (max-width: 760px) {
  .topbar { min-height: 64px; padding: 8px 18px; }
  .brand-type strong { font-size: 8px; }
  .brand-type span { font-size: 18px; }
  .brand-mark { width: 34px; height: 34px; }
  .topbar .avatar-stack { max-width: 32vw; }
  .topbar-actions { gap: 8px; }
  .topbar-actions .button { width: var(--control-height); padding: 0; font-size: 0; }
  .topbar-actions .button span { font-size: 17px; }
  .app-shell, .app-footer { width: min(calc(100% - 28px), var(--max-width)); }
  .page-heading { display: block; }
  .board-tools { justify-content: flex-start; margin-top: 18px; }
  .search-field, .search-field input { width: 100%; }
  .route-column-tools { flex-wrap: wrap; }
  .route-column-tools .search-field { flex-basis: 100%; }
  .route-column-tools #route-status-filter, .route-column-tools #route-sort { flex: 1 1 140px; }
  .pilot-column-tools #pilot-progress-sort { flex-basis: 190px; width: 190px; }
  .route-row { grid-template-columns: 1fr auto; gap: 17px; min-height: 0; padding: 18px; }
  .route-line { grid-column: 1 / -1; grid-row: 2; }
  .route-actions { grid-column: 2; grid-row: 1; }
  .pilot-progress-row { grid-template-columns: 38px minmax(0, 1fr) 66px 26px; }
  .pilot-progress-location { grid-column: 2; grid-row: 2; }
  .pilot-progress-jumps { grid-column: 3; grid-row: 1 / span 2; }
  .pilot-progress-actions { grid-column: 4; grid-row: 1 / span 2; }
  .pilot-route-timeline { grid-column: 2 / -1; grid-row: 3; }
  .pilot-wormhole-stop { grid-template-columns: 12px auto minmax(0, 1fr); }
  .pilot-wormhole-stop small { grid-column: 3; }
  .pilot-route-chevron { left: -24px; }
  .pilot-route-detail-row { grid-template-columns: 10px minmax(58px, 1fr) 32px minmax(65px, 1fr); gap: 4px; }
  .pilot-route-detail-row, .pilot-route-detail-row strong { font-size: 9px; }
  .pilot-waypoint-error { grid-column: 2 / -1; }
  .route-system strong { font-size: 12px; }
  .page-heading { padding-top: 40px; }
  .page-heading h1 { font-size: 36px; }
  .page-heading-actions { margin-top: 20px; }
  .utility-heading { display: flex; flex-wrap: wrap; gap: 8px 14px; min-height: 0; padding: 10px 0; }
  .utility-heading h1 { font-size: 22px; }
  .utility-heading .page-heading-actions { margin-top: 0; }
  .settings-grid { grid-template-columns: 1fr; }
  .settings-appearance-card, .settings-transfer-card, .settings-routing-card, .settings-local-card, .settings-universe-card { grid-column: 1; grid-row: auto; }
  .settings-card-wide { grid-column: 1; }
  .settings-routing-grid, .settings-shortcut-options { grid-template-columns: 1fr; }
  .data-actions .button { width: 100%; }
  .editor-grid { grid-template-columns: 1fr; }
  .editor-wide, .editor-name { grid-column: 1; }
  .preference-fieldset { grid-template-columns: 1fr; }
  .wormhole-options { grid-template-columns: 1fr; }
  .connection-add-row { grid-template-columns: 1fr auto; }
  .connection-add-row input { grid-column: 1; }
  .connection-add-row > span { grid-column: 2; grid-row: 1; }
  .connection-add-row input:nth-of-type(2) { grid-row: 2; }
  .connection-add-row .button { grid-column: 1 / -1; }
  .coverage-area-row { grid-template-columns: 1fr; }
  .ordered-system-row { grid-template-columns: 24px 27px minmax(0, 1fr) auto; }
  .assignment-stop-row { grid-template-columns: 27px minmax(0, 1fr); }
  .system-id { display: none; }
  .system-row-actions { grid-column: 4; }
  .detail-hero { grid-template-columns: 1fr; text-align: left; }
  .detail-endpoint:last-child { text-align: left; }
  .detail-jumps { text-align: left; }
  .detail-actions { flex-wrap: wrap; }
  .detail-actions .footer-spacer { display: none; }
  .detail-actions .button { flex: 1; }
}

@media (max-width: 470px) {
  .main-nav { width: calc(100% - 28px); justify-content: stretch; }
  .nav-item { flex: 1; justify-content: center; padding: 0 8px; font-size: 11px; }
  .board-tools select { flex: 1; min-width: 0; }
  .app-footer { display: grid; justify-items: center; text-align: center; }
  .modal-header, .modal-body, .modal-footer { padding-left: 17px; padding-right: 17px; }
}
