:root, :host {
  color-scheme: dark;
  --ink: #FF4700;
  --celestial-star: #FF4700;
  --void: #0B0B0B;
  --bone: #FAFAE5;
  --font-mono: 'JetBrains Mono', ui-monospace, 'Courier New', monospace;
  --font-display: 'Rajdhani', system-ui, sans-serif;
  --font-heading: 'Orbitron', system-ui, sans-serif;
  --map-surface: #111110;
  --map-line: #292927;
  --map-muted: #a5a59b;
  --map-edge: #68685b;
  --map-historical: #555D69;
  --intel-hostile: #FF3030;
  --intel-allied: #32E875;
  --intel-resources: #FFD23F;
  --intel-structures: #4A90FF;
  --intel-agency-structures: #FF4700;
  --intel-agency-markets: #00E5E5;
  --intel-routes: #B49AFF;
  --intel-rifts: #FF4DC4;
  --map-hover: rgba(250, 250, 229, .06);
  --public-infrastructure: var(--intel-resources);
  --gate-available: var(--intel-allied);
  --gate-unavailable: var(--intel-hostile);
  --gate-unknown: var(--map-muted);
  --route-gate: var(--bone);
  --knowledge-detected: var(--intel-agency-markets);
  --knowledge-agency-known: var(--intel-routes);
}
:host { display: block; container: topology / inline-size; }
.gate-inspection { position: absolute; top: 74px; right: 18px; width: 320px; max-width: calc(100% - 36px); max-height: calc(100% - 140px); z-index: 4; overflow-y: auto; }
.gate-inspection[data-pinned="false"] { pointer-events: none; }
.gate-inspection-content { padding: 4px 14px 14px; }
.gate-endpoint { border-left: 3px solid var(--map-edge); padding: 10px; margin-bottom: 8px; overflow-wrap: anywhere; }
.gate-endpoint small { display: block; color: var(--map-muted); font: 10px/1.7 var(--font-mono); }
.gate-state-available { color: var(--gate-available); border-color: var(--gate-available); }
.gate-state-unavailable { color: var(--gate-unavailable); border-color: var(--gate-unavailable); }
.gate-state-legend { padding: 8px 0; }
#public-map-markers { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.map-page > .cycle-control, .map-page > .selected-system, .map-page > .fit-control { z-index: 3; }
.public-map-marker { position: absolute; width: 44px; height: 44px; min-height: 44px !important; padding: 10px !important; border: 0 !important; color: var(--public-infrastructure) !important; background: transparent; pointer-events: auto; }
.public-map-marker svg { width: 24px; height: 24px; padding: 2px; background: var(--void); border: 1px solid currentColor; border-radius: 2px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; }
.public-map-marker[data-anchor="true"]::before { content: ''; position: absolute; left: calc(var(--public-system-x) - 7px); top: calc(var(--public-system-y) - 7px); width: 14px; height: 14px; border: 2px solid var(--public-infrastructure); border-radius: 50%; pointer-events: none; }
.public-marker-count { position: absolute; right: 1px; top: 1px; background: var(--public-infrastructure); color: var(--void); min-width: 13px; border-radius: 2px; text-align: center; font: 9px/13px var(--font-mono); }
.public-marker-tooltip { display: none; position: absolute; top: 37px; left: 0; width: 260px; max-width: 65vw; max-height: 240px; overflow-y: auto; padding: 10px; background: var(--map-surface); border: 1px solid var(--public-infrastructure); color: var(--bone); font: 12px/1.5 var(--font-display); box-shadow: 0 5px 24px var(--void); text-align: left; pointer-events: none; overflow-wrap: anywhere; }
.public-marker-tooltip strong, .public-marker-tooltip > span { display: block; white-space: pre-line; padding-bottom: 6px; }
.public-marker-tooltip > span { color: var(--map-muted); }
.public-marker-tooltip strong { color: var(--public-infrastructure); border-bottom: 1px solid currentColor; margin-bottom: 6px; font: 11px/1.5 var(--font-mono); }
.public-map-marker:hover, .public-map-marker:focus { z-index: 1; }
.public-map-marker:hover .public-marker-tooltip, .public-map-marker:focus .public-marker-tooltip { display: block; }
.public-marker-toggle { color: var(--public-infrastructure); }
.tool-window[data-tool="activity"] { top: 74px; left: 100px; right: auto; width: min(560px, calc(100% - 124px)); margin: 0; max-width: none; max-height: min(600px, calc(100% - 112px)); }
.tool-window[data-tool="routing"] { width: 480px; max-height: calc(100% - 110px); }
.tool-window.tool-minimized { width: 310px; right: auto; margin: 0; }
.tool-minimized .tool-content { display: none; }
#minimize-tool { margin-left: auto; font: 10px var(--font-mono); }
#tool-activity { min-width: 0; }
#tool-activity .tool-note { overflow-wrap: anywhere; }
.activity-breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-bottom: 12px; }
.activity-breadcrumbs button { color: var(--ink); padding: 5px; }
.activity-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.activity-heading h3 { font-size: 30px; font-weight: 500; }
.activity-heading a { color: var(--ink); font: 10px var(--font-mono); flex-shrink: 0; }
.activity-filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-bottom: 12px; }
.activity-filters .tool-field { margin: 0; flex: 0 1 120px; }
.activity-filters .activity-search { flex: 1 1 220px; }
.activity-filters button { border: 1px solid var(--ink); color: var(--ink); }
.activity-search-results { display: grid; max-height: 220px; overflow-y: auto; border: 1px solid var(--map-line); padding: 6px; }
.activity-metrics { padding: 14px 0; font: 12px/1.8 var(--font-mono); }
.activity-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 12px 0 20px; }
.activity-cards .activity-card { border: 1px solid var(--map-line); padding: 14px; background: var(--void); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.activity-card span { color: var(--map-muted); font-size: 13px; }
.activity-card strong { font: 24px var(--font-display); }
.activity-cards .activity-card[aria-pressed="true"] { border-color: var(--ink); color: var(--ink); }
.activity-charts { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 14px; }
.activity-section { min-width: 0; border-top: 1px solid var(--map-line); padding: 16px 0; }
.activity-section h3 { margin-bottom: 8px; font-size: 16px; font-weight: 500; }
.activity-section summary, #activity-list summary { cursor: pointer; padding: 8px 0; }
#activity-histogram { height: 160px; margin-top: 16px; border-bottom: 1px solid var(--map-edge); }
#activity-histogram svg { width: 100%; height: 100%; display: block; fill: var(--ink); }
#activity-chart-axis { margin: 8px 0; font-size: 10px; }
.activity-hours { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; margin-top: 16px; }
#activity-histogram.activity-unavailable, .activity-hours.activity-unavailable { display: block; height: auto; border: 0; color: var(--map-muted); font-size: 12px; }
.activity-hour { display: flex; flex-direction: column; padding: 6px; gap: 3px; border: 1px solid var(--map-line); font: 10px var(--font-mono); }
.activity-hour strong { font-size: 13px; }
.activity-hour[data-level="1"] { background: var(--map-hover); }
.activity-hour[data-level="2"] { border-color: var(--map-edge); }
.activity-hour[data-level="3"] { border-color: var(--ink); }
.activity-hour[data-level="4"] { background: var(--ink); color: var(--void); }
.activity-leaderboard { list-style: none; padding: 0; margin: 10px 0 0; max-height: 300px; overflow-y: auto; }
.activity-leaderboard li { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--map-line); }
.activity-leaderboard button { min-width: 0; overflow-wrap: anywhere; }
.activity-leaderboard span { color: var(--map-muted); font: 11px var(--font-mono); text-align: right; }
.activity-advanced { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.activity-table { width: 100%; font-size: 12px; text-align: left; border-collapse: collapse; }
.activity-table td, .activity-table th { padding: 5px; border-bottom: 1px solid var(--map-line); }
.route-selector { position: relative; }
.route-selector .tool-field { margin-bottom: 6px; }
.route-selector small, .route-results small { display: block; font: 10px var(--font-mono); color: var(--map-muted); margin-top: 3px; }
.route-results strong { display: block; font-weight: 500; }
.route-options { max-height: 230px; overflow-y: auto; border: 1px solid var(--map-line); padding: 4px; margin-bottom: 8px; }
.route-options button { width: 100%; display: flex; flex-direction: column; min-height: 44px; background: transparent; }
.route-options strong { font-weight: 500; }
.route-options p { padding: 8px; color: var(--map-muted); }
@container topology (max-width: 700px) {
  .tool-window[data-tool="activity"], .tool-window[data-tool="routing"] { top: 70px; left: 10px; right: 10px; width: auto; max-width: none; max-height: calc(100% - 94px); margin: 0; }
  .tool-window[data-tool="activity"] { max-height: min(600px, calc(100% - 94px)); }
  .tool-window.tool-minimized { width: auto; }
  .activity-heading { flex-direction: column; align-items: start; }
  .activity-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .activity-charts, .activity-advanced { grid-template-columns: minmax(0, 1fr); }
  .activity-card span { font-size: 12px; }
  .activity-heading h3 { font-size: 26px; }
  .activity-leaderboard li { flex-wrap: wrap; gap: 0; padding-bottom: 8px; }
  .activity-leaderboard span { padding-left: 12px; }
}
.solar-active .search-control, .solar-active .tactical-toolbar, .solar-active #system-actions { display: none; }
.solar-controls { position: absolute; z-index: 3; top: 18px; left: 18px; width: 230px; max-width: calc(100% - 200px); padding: 8px 12px; max-height: calc(100% - 90px); overflow-y: auto; }
.solar-controls p { margin: 8px 0; overflow-wrap: anywhere; }
.solar-controls #solar-system-name { color: var(--ink); }
.solar-controls button { width: 100%; font: 10px var(--font-mono); }
.solar-controls .tool-field { margin: 12px 0 4px; }
.celestial-inspection { padding: 8px 16px 16px; overflow-y: auto; overscroll-behavior: contain; }
.celestial-inspection h3 { overflow-wrap: anywhere; }
@container topology (max-width: 600px) { .solar-controls { top: 74px; max-width: calc(100% - 36px); width: 220px; max-height: calc(100% - 145px); } }
agency-topology { display: block; }
.local-record.record-selected { border-color: var(--ink); }
.explorer-card .tool-actions { max-height: 130px; overflow-y: auto; }
#route-waypoints li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
#route-waypoints li span { flex: 1 1 100%; overflow-wrap: anywhere; }
#route-waypoints button { flex: 1; }
.map-page { position: relative; height: 100dvh; min-height: 300px; overflow: hidden; isolation: isolate; background: var(--void); color: var(--bone); font: 14px/1.4 var(--font-display); }
:host([embedded]) .map-page { height: max(600px, calc(100dvh - 170px)); }
.map-page *, .map-page *::before, .map-page *::after { box-sizing: border-box; }
.map-page [hidden] { display: none !important; }
.map-page button, .map-page input, .map-page select { color: var(--bone); font: inherit; border-radius: 4px; }
.map-page button { min-height: 38px; padding: 8px 12px; text-align: left; border: 0; cursor: pointer; }
.map-page button:hover:not(:disabled) { background: var(--map-hover); }
.map-page button:disabled, .map-page select:disabled, .map-page input:disabled { opacity: .4; cursor: default; }
.map-page h2, .map-page h3, .map-page p { margin: 0; }
#map-stage, #universe, #labels { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#universe { touch-action: none; outline-offset: -2px; }
#labels { pointer-events: none; }
.floating-surface, .search-field, .cycle-control select { background: var(--map-surface); border: 1px solid var(--map-line); border-radius: 5px; box-shadow: 0 5px 24px rgba(0,0,0,.25); }
.search-control { position: absolute; top: 18px; left: 18px; width: min(300px, calc(100% - 200px)); z-index: 3; pointer-events: none; }
.search-field { display: flex; align-items: center; padding-left: 12px; pointer-events: auto; }
.search-field > span { color: var(--ink); font: 24px var(--font-display); }
#search { min-width: 0; width: 100%; height: 40px; padding: 8px 10px; background: transparent; border: 0; font-size: 15px; }
#search::placeholder { color: var(--map-muted); }
#search-results { margin-top: 6px; max-height: min(360px, calc(100dvh - 140px)); overflow-y: auto; overscroll-behavior: contain; pointer-events: auto; }
#search-results.unpositioned-results { margin-left: 76px; width: min(300px, calc(100cqw - 100px)); }
#system-list { list-style: none; padding: 4px; margin: 0; }
#system-list button { width: 100%; display: grid; grid-template-columns: 6px 1fr auto; align-items: center; gap: 10px; min-height: 42px; }
.row-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#system-list small { font: 10px var(--font-mono); color: var(--map-muted); }
#system-list button.infrastructure-result { grid-template-columns: 6px minmax(0, 1fr); row-gap: 4px; }
#system-list .infrastructure-result .position-dot { grid-row: span 2; }
#system-list .infrastructure-result small { grid-column: 2; white-space: normal; overflow-wrap: anywhere; }
.position-dot { width: 5px; height: 5px; background: var(--bone); border-radius: 50%; }
.position-dot.unpositioned { background: transparent; border: 1px solid var(--map-muted); }
#search-empty, #search-summary { padding: 14px; color: var(--map-muted); }
.cycle-control { position: absolute; top: 18px; right: 18px; }
.cycle-control select { height: 42px; width: 160px; padding: 0 8px; font: 10px var(--font-mono); }
.selected-system { position: absolute; left: 18px; bottom: 62px; max-width: calc(100% - 36px); display: flex; gap: 20px; align-items: center; }
#selected-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.action-label { font-size: 12px; white-space: nowrap; color: var(--map-muted); }
.context-menu { position: absolute; z-index: 5; width: 224px; max-width: calc(100% - 16px); max-height: calc(100% - 16px); overflow-y: auto; padding: 5px; }
.context-heading { padding: 9px 8px 10px; display: flex; flex-direction: column; gap: 3px; overflow-wrap: anywhere; }
.context-heading strong { font-size: 16px; font-weight: 600; }
.context-heading small { font: 10px var(--font-mono); color: var(--map-muted); }
.context-menu button { display: block; width: 100%; }
.information-overlay { position: absolute; z-index: 4; top: 74px; right: 18px; width: 300px; max-width: calc(100% - 36px); max-height: calc(100% - 140px); display: flex; flex-direction: column; }
.information-heading { display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; padding: 5px 8px 5px 16px; }
.information-heading h2 { font: 10px var(--font-mono); color: var(--map-muted); }
#close-information { font-size: 22px; padding: 2px 10px; }
#inspection { padding: 4px 16px 16px; overflow-y: auto; overscroll-behavior: contain; }
.system-title { font-size: 24px; font-weight: 500; overflow-wrap: anywhere; }
.system-stamp { display: flex; gap: 12px; color: var(--map-muted); font-size: 12px; padding-top: 2px; }
.system-details { display: grid; grid-template-columns: 76px 1fr; gap: 6px 10px; margin: 16px 0; font-size: 13px; }
.system-details dt { color: var(--map-muted); }
.system-details dd { margin: 0; overflow-wrap: anywhere; }
.coordinate-value { font: 11px/1.6 var(--font-mono); }
#inspection h3 { margin: 16px 0 7px; font-size: 13px; font-weight: 600; }
.coordinate-source { color: var(--map-muted); font-size: 12px; overflow-wrap: anywhere; }
.known-links { list-style: none; padding: 0; margin: 0; }
.known-links button { width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 5px 0; gap: 10px; }
.known-links small { color: var(--map-muted); font: 9px var(--font-mono); text-align: right; }
.panel-note { color: var(--map-muted); font-size: 12px; }
.map-signature { position: absolute; left: 18px; bottom: 20px; display: flex; align-items: baseline; gap: 12px; max-width: calc(100% - 116px); pointer-events: none; }
.map-signature > span { font: 10px var(--font-heading); letter-spacing: .12em; }
.map-signature small { font: 9px var(--font-mono); color: var(--map-muted); }
.fit-control { position: absolute; right: 18px; bottom: 14px; font-size: 12px !important; }
.notification { position: absolute; z-index: 6; bottom: 62px; left: 50%; transform: translateX(-50%); padding: 8px 14px; width: max-content; max-width: calc(100% - 36px); font-size: 13px; }
#render-error { position: absolute; top: 40%; left: 10%; right: 10%; padding: 16px; background: var(--map-surface); text-align: center; }
.tactical-toolbar { position: absolute; z-index: 2; left: 12px; top: 80px; width: 70px; padding: 4px; max-height: calc(100% - 150px); overflow-y: auto; }
.tactical-toolbar button { width: 100%; min-height: 61px; padding: 8px 2px; display: flex; align-items: center; flex-direction: column; justify-content: center; gap: 5px; color: var(--map-muted); font: 9px/1.4 var(--font-mono); text-align: center; border-left: 2px solid transparent; }
.tactical-toolbar button[aria-expanded="true"] { color: var(--ink); border-left-color: var(--ink); background: var(--map-hover); }
.tactical-toolbar svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.4; }
.tool-window { position: absolute; z-index: 3; top: 80px; left: 92px; width: 310px; max-width: calc(100% - 104px); max-height: calc(100% - 190px); display: flex; flex-direction: column; }
#close-tool { font-size: 22px; padding: 2px 10px; }
.tool-content { padding: 8px 14px 16px; overflow-y: auto; overscroll-behavior: contain; }
.tool-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; color: var(--map-muted); font-size: 13px; }
.tool-field input, .tool-field select { width: 100%; min-width: 0; height: 36px; padding: 6px 8px; background: var(--void); border: 1px solid var(--map-line); }
.tool-field input[aria-invalid="true"] { border-color: var(--ink); }
.tool-field textarea { width: 100%; resize: vertical; min-height: 60px; max-height: 180px; padding: 8px; background: var(--void); border: 1px solid var(--map-line); color: var(--bone); font: inherit; border-radius: 4px; }
.tool-content fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.tool-actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.tool-actions button:first-child { border: 1px solid var(--ink); color: var(--ink); font: 11px var(--font-mono); }
.route-results { padding-left: 22px; margin-bottom: 0; color: var(--intel-routes); }
.route-results button { width: 100%; padding: 5px 0; font-size: 12px; overflow-wrap: anywhere; }
.range-reference { margin: 10px 0; font-size: 12px; color: var(--map-muted); }
.range-reference summary { cursor: pointer; }
.range-reference p { margin-top: 8px; }
.local-record { border-top: 1px solid var(--map-line); padding: 12px 0; overflow-wrap: anywhere; }
.local-record strong { font-size: 14px; font-weight: 500; }
.local-record p, .local-record small { font-size: 12px; color: var(--map-muted); white-space: pre-line; }
.local-record pre { font-size: 11px; color: var(--map-muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.local-record small { display: block; padding: 5px 0; font-size: 10px; }
.local-record button { min-height: 32px; padding: 5px 10px; border: 1px solid var(--map-line); }
#record-storage { margin-bottom: 10px; }
#record-feedback, #route-summary { overflow-wrap: anywhere; margin: 10px 0; }
#route-export-status { overflow-wrap: anywhere; }
#route-export-preview { font: 11px/1.5 var(--font-mono); min-height: 130px; }
.route-notes { border-top: 1px solid var(--map-line); margin-top: 20px; padding-top: 16px; }
.route-notes h3 { font: 600 17px var(--font-display); }
.route-notes h3 small { color: var(--map-muted); font: 13px var(--font-display); }
.route-notes .overlay-toggle { min-height: 28px; }
@media (pointer: coarse) { .route-notes .overlay-toggle { min-height: 44px; } }
.route-copy-primary { width: 100%; min-height: 38px !important; background: var(--ink); color: var(--void) !important; border: 1px solid var(--void) !important; outline: 1px solid var(--ink); font: 600 12px var(--font-mono); margin: 8px 0; }
.route-copy-primary:disabled { opacity: .4; }
.map-page .route-copy-primary:hover { background: var(--ink); }
.route-note-actions { display: grid; gap: 6px; margin-top: 24px; }
.route-note-actions button { width: 100%; border: 1px solid var(--map-line); min-height: 34px; font: 600 13px var(--font-display); }
#route-card-preview { width: 100%; height: auto; border: 1px solid var(--map-line); margin: 8px 0; }
.map-page .selection-shortcut { font-size: 11px; color: var(--map-muted); padding: 0 0 8px; min-height: 25px; margin-top: -8px; }
#discovery-preview { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 220px; overflow-y: auto; }
#discovery-systems { max-height: 260px; overflow-y: auto; overflow-wrap: anywhere; }
.knowledge-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font: 10px/1.6 var(--font-mono); margin: 8px 0; }
.knowledge-visited { color: var(--bone); }
.knowledge-detected { color: var(--knowledge-detected); }
.knowledge-agency-known { color: var(--knowledge-agency-known); }
.knowledge-historical { color: var(--map-historical); }
#discovery-systems .overlay-toggle { align-items: flex-start; padding: 6px 0; }
.tool-note { color: var(--map-muted); font-size: 12px; line-height: 1.5; }
.tool-empty { padding: 10px 0; font-size: 14px; }
.tool-group-heading { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin: 12px 0 5px !important; font: 10px var(--font-mono); }
.tool-group-heading:first-child { margin-top: 0 !important; }
.tool-group-heading h3 { font: inherit; }
.tool-group-heading button { font: 12px var(--font-display); min-height: 30px; padding: 4px 8px; }
.overlay-toggle { min-height: 40px; display: flex; gap: 9px; align-items: center; cursor: pointer; font-size: 14px; }
.overlay-toggle input { width: 14px; height: 14px; accent-color: var(--ink); flex-shrink: 0; }
.overlay-toggle small { display: block; font-size: 10px; color: var(--map-muted); }
.overlay-swatch { width: 5px; height: 16px; border-radius: 1px; background: var(--overlay-color); }
.historical-reference { --overlay-color: var(--map-historical); }
.intel-hostile { --overlay-color: var(--intel-hostile); }
.intel-allied { --overlay-color: var(--intel-allied); }
.intel-resources { --overlay-color: var(--intel-resources); }
.intel-structures { --overlay-color: var(--intel-structures); }
.intel-agency-structures { --overlay-color: var(--intel-agency-structures); }
.intel-agency-markets { --overlay-color: var(--intel-agency-markets); }
.intel-routes { --overlay-color: var(--intel-routes); }
.intel-rifts { --overlay-color: var(--intel-rifts); }
.intel-context { white-space: pre-line; overflow-wrap: anywhere; color: var(--ink); font-size: 13px; margin-bottom: 8px !important; }
.technical-details { margin-top: 18px; }
.technical-details summary { cursor: pointer; font: 10px var(--font-mono); color: var(--map-muted); padding: 8px 0; }
.technical-details .system-details { grid-template-columns: 70px minmax(0, 1fr); font-size: 12px; }
@container topology (max-width: 600px) {
  .tactical-toolbar { left: 8px; top: 70px; width: 62px; }
  .tactical-toolbar button { min-height: 58px; font-size: 8px; }
  .tool-window { left: 78px; top: 70px; max-width: calc(100% - 90px); max-height: min(360px, calc(100% - 190px), 55%); }
  .tool-content { padding: 6px 10px 12px; }
  .tool-field input, .tool-field select { font-size: 16px; height: 40px; }
  .search-control { left: 12px; top: 12px; width: calc(100% - 144px); }
  .cycle-control { top: 12px; right: 12px; }
  .cycle-control select { width: 112px; font-size: 9px; }
  #search { font-size: 16px; padding-left: 6px; }
  .search-field { padding-left: 8px; }
  #search-results { width: min(300px, calc(100cqw - 24px)); }
  .selected-system { left: 12px; bottom: 62px; }
  .information-overlay { top: auto; bottom: 112px; right: 12px; max-width: calc(100% - 24px); max-height: calc(100% - 180px); }
  .context-menu button { min-height: 44px; }
  .map-signature { left: 12px; gap: 8px; }
  .map-signature > span { font-size: 9px; }
  .fit-control { right: 12px; }
}

.routing-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; margin-bottom: 12px; }
.routing-tabs button { min-height: 38px; font: 10px var(--font-mono); border: 1px solid var(--map-line); padding: 7px; }
.routing-tabs [aria-selected="true"] { color: var(--ink); border-color: var(--ink); background: var(--map-surface); }
.routing-grid, .routing-endpoints { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.routing-endpoints > div { min-width: 0; }
.routing-endpoints .selection-shortcut { width: 100%; font-size: 10px; margin-bottom: 8px; white-space: normal; }
#tool-routing [hidden] { display: none !important; }
#tool-routing .tool-field { margin-bottom: 10px; }
#tool-routing .tool-field input, #tool-routing .tool-field select { min-width: 0; width: 100%; }
#tool-routing .route-options { max-height: 180px; }
#tool-routing .tool-note { font-size: 11px; }
#tool-routing .route-notes { margin-top: 12px; padding-top: 10px; }
#tool-routing .route-note-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 10px; }
.scout-targets { max-height: 180px; overflow: auto; }
.scout-targets span, #route-structures { overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .tool-window[data-tool="routing"] { left: 10px; right: 10px; width: auto; max-width: none; max-height: calc(100% - 94px); }
  .routing-grid, .routing-endpoints { grid-template-columns: minmax(0, 1fr); gap: 0; }
  #tool-routing .routing-tabs button { min-height: 44px; }
}
.public-gate-links { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; stroke: var(--public-infrastructure); stroke-width: 1.5; stroke-dasharray: 5 5; fill: none; }

.route-legend { display:flex; flex-wrap:wrap; gap:7px 14px; margin:10px 0; font:10px var(--font-mono); color:var(--bone); }
.route-legend[hidden] { display:none; }
.route-legend span { display:flex; align-items:center; gap:5px; }
.route-legend svg { width:36px; height:16px; color:var(--public-infrastructure); fill:none; stroke:currentColor; stroke-width:1.5; }
.route-legend .route-legend-unknown svg { color:var(--map-muted); }
.route-legend small { flex-basis:100%; color:var(--map-muted); font-size:10px; line-height:1.5; }
