:root {
  color-scheme: dark;
  --bg: #0b0c0f;
  --surface: #15161a;
  --surface-2: #1c1d22;
  --line: #2a2b31;
  --line-soft: #202127;
  --text: #ecebe6;
  --text-2: #b9b8b0;
  --muted: #85847d;
  --accent: #ff8c1a;        /* cockpit orange */
  --accent-soft: rgba(255, 140, 26, 0.14);
  --accent-ink: #ffb35c;
  --good: #0ca30c;
  --warn: #fab219;
  --serious: #ec835a;
  --crit: #d03b3b;
  /* chart series (validated dark palette, fixed order) */
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #9085e9;
  --radius: 6px;
  --mono: "Cascadia Mono", Consolas, "SFMono-Regular", Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  min-height: 100vh;
}
h2 { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; margin: 0; color: var(--accent-ink); font-weight: 600; }
a { color: var(--accent-ink); }
.hidden { display: none !important; }
.mt { margin-top: 18px; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- top bar ---------- */
.topbar {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 12px 20px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #121318, var(--bg));
}
.brand { display: flex; gap: 12px; align-items: center; color: var(--accent); }
.brand-title { font-weight: 700; letter-spacing: .06em; color: var(--text); font-size: 16px; }
.brand-sub { color: var(--muted); font-size: 12px; }
.top-stats { display: flex; gap: 28px; flex-wrap: wrap; }
.top-stats > div { display: flex; flex-direction: column; }
.lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.val { font-weight: 600; font-variant-numeric: tabular-nums; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); margin-right: 6px; vertical-align: middle; }
.dot.on { background: var(--good); box-shadow: 0 0 8px var(--good); }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 2px; padding: 0 20px; border-bottom: 1px solid var(--line); overflow-x: auto; background: var(--bg); position: sticky; top: 0; z-index: 5; }
.tab {
  background: none; border: 0; color: var(--text-2); padding: 12px 16px; font: inherit; cursor: pointer;
  border-bottom: 2px solid transparent; white-space: nowrap; letter-spacing: .03em;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
main { padding: 18px 20px 40px; max-width: 1500px; margin: 0 auto; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---------- panels & layout ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px; min-width: 0; }
.panel-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.panel-head .hint { margin-right: auto; }
.panel-head h2 + .hint { margin-left: 0; }
.hint { color: var(--muted); font-size: 12px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-map { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; }
.grid-2 > .panel, .grid-3 > .panel, .grid-map > .panel { margin-bottom: 0; }
.grid-2, .grid-3, .grid-map { margin-bottom: 16px; }
@media (max-width: 1100px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-map { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  main { padding: 14px 16px 32px; }
  .topbar { padding: 12px 16px; }
  .tabs { padding: 0 8px; }
}
.scroll { max-height: 330px; overflow-y: auto; }
.scroll.tall { max-height: 520px; }

/* ---------- tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--radius); padding: 12px 14px; }
.tile .lbl { display: block; }
.tile .big { font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; margin-top: 2px; }
.tile .sub { color: var(--muted); font-size: 12px; }
.mini-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.mini { background: var(--surface-2); border-radius: 4px; padding: 8px 10px; }
.mini .big { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- key/value ---------- */
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.big-name { font-size: 20px; font-weight: 650; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sub-name { color: var(--text-2); margin-bottom: 10px; }

/* ---------- bars ---------- */
.bar-row { display: grid; grid-template-columns: 120px 1fr auto; align-items: center; gap: 10px; margin: 6px 0; }
.bar-row .name { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; }
.bar-row .v { font-variant-numeric: tabular-nums; color: var(--text-2); font-size: 12px; min-width: 60px; text-align: right; }
.rank-row { display: grid; grid-template-columns: 110px 1fr 140px; gap: 10px; align-items: center; margin: 7px 0; }
.rank-row .rk { text-align: right; font-weight: 600; }
.rank-row .rk small { color: var(--muted); font-weight: 400; margin-left: 4px; }
@media (max-width: 500px) { .rank-row { grid-template-columns: 90px 1fr 110px; } .bar-row { grid-template-columns: 90px 1fr auto; } }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: 7px 8px; text-align: left; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; position: sticky; top: 0; background: var(--surface); }
td.r, th.r { text-align: right; }
tbody tr:hover { background: var(--surface-2); }
tr.clickable { cursor: pointer; }
tr.selected { background: var(--accent-soft) !important; }
.wrap { white-space: normal; }

/* ---------- controls ---------- */
.controls { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end; }
.controls label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); min-width: 120px; flex: 0 1 150px; }
.controls label.grow { flex: 1 1 220px; }
.controls label.check { flex-direction: row; align-items: center; gap: 6px; color: var(--text-2); min-width: 0; flex: 0 0 auto; padding-bottom: 8px; }
input, select {
  background: var(--surface-2); color: var(--text); border: 1px solid var(--line); border-radius: 4px;
  padding: 7px 9px; font: inherit; width: 100%; min-width: 0;
}
input[type=checkbox] { width: auto; accent-color: var(--accent); }
input:focus, select:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.btn {
  background: var(--surface-2); color: var(--text); border: 1px solid var(--line); border-radius: 4px;
  padding: 7px 14px; font: inherit; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--accent); color: var(--accent-ink); }
.btn.primary { background: var(--accent); color: #1a1007; border-color: var(--accent); font-weight: 650; }
.btn.primary:hover { background: #ffa143; color: #1a1007; }
.btn.big { padding: 10px 22px; font-size: 15px; letter-spacing: .03em; }
.btn.small { padding: 3px 9px; font-size: 12px; }
.btn.ghost { background: none; }
.btn:disabled { opacity: .55; cursor: wait; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.link-chip { font-size: 12px; padding: 3px 8px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--text-2); }
.link-chip:hover { border-color: var(--accent); color: var(--accent-ink); }
.copy { cursor: pointer; border: 0; background: none; color: var(--muted); padding: 0 2px; font-size: 13px; }
.copy:hover { color: var(--accent); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.seg button { background: none; border: 0; color: var(--text-2); padding: 4px 10px; font: inherit; font-size: 12px; cursor: pointer; }
.seg button.active { background: var(--accent-soft); color: var(--accent-ink); }

.pill { font-size: 11px; padding: 2px 8px; border-radius: 10px; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line); }
.pill.good { color: #6fd66f; border-color: rgba(12, 163, 12, .5); }
.pill.warn { color: var(--warn); border-color: rgba(250, 178, 25, .5); }
.pill.crit { color: #ff7b7b; border-color: rgba(208, 59, 59, .6); }
.pill.accent { color: var(--accent-ink); border-color: rgba(255, 140, 26, .5); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }

/* ---------- gauges ---------- */
.gauge { margin: 8px 0 12px; }
.gauge-top { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-2); margin-bottom: 4px; }
.gauge-track { height: 10px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.gauge-fill { height: 100%; background: var(--accent); border-radius: 0 5px 5px 0; transition: width .4s; }
.gauge-fill.low { background: var(--crit); }

/* ---------- route & feed ---------- */
.route-item { display: grid; grid-template-columns: 28px 1fr auto; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.route-item .idx { color: var(--muted); font-size: 12px; text-align: right; }
.star { font-family: var(--mono); font-size: 12px; padding: 1px 6px; border-radius: 3px; background: var(--surface-2); }
.star.noscoop { color: var(--warn); }
.feed-item { display: grid; grid-template-columns: 70px 90px 1fr; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line-soft); align-items: baseline; }
.feed-item .t { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.feed-item .k { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--accent-ink); }
@media (max-width: 600px) { .feed-item { grid-template-columns: 60px 1fr; } .feed-item .k { display: none; } }
.cargo-item { display: flex; justify-content: space-between; padding: 7px 10px; border-radius: 4px; cursor: pointer; border: 1px solid transparent; }
.cargo-item:hover { border-color: var(--line); background: var(--surface-2); }
.empty { color: var(--muted); padding: 10px 0; }

/* ---------- charts ---------- */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.axis text { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.grid line { stroke: var(--line-soft); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); margin-bottom: 6px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.tooltip {
  position: fixed; pointer-events: none; z-index: 50; background: #0f1013; border: 1px solid var(--line);
  border-radius: 5px; padding: 8px 10px; font-size: 12px; color: var(--text); display: none; max-width: 300px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .5); font-variant-numeric: tabular-nums;
}
.tooltip .tt-title { font-weight: 650; margin-bottom: 4px; }
.tooltip .tt-row { display: flex; justify-content: space-between; gap: 16px; color: var(--text-2); }
.tooltip .tt-row b { color: var(--text); font-weight: 600; }
.tooltip i { width: 8px; height: 8px; display: inline-block; border-radius: 2px; margin-right: 6px; }

/* ---------- mining plan ---------- */
.plan-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
@media (max-width: 1000px) { .plan-steps { grid-template-columns: 1fr; } }
.step { background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: var(--radius); padding: 14px 16px; }
.step .step-n { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-ink); }
.step .big-name { font-size: 18px; margin: 4px 0 2px; }
.step .kv { margin-top: 10px; }
.step.summary { border-top-color: var(--s3); }
.status-line { color: var(--text-2); margin: 0 0 14px; min-height: 20px; }
.status-line.err { color: #ff8a8a; }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -2px; margin-right: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }
.map { position: relative; width: 100%; aspect-ratio: 16 / 10; background: radial-gradient(ellipse at center, #14151b 0%, #0d0e12 75%); border-radius: 4px; overflow: hidden; cursor: grab; touch-action: none; }
.map:active { cursor: grabbing; }
.map svg { width: 100%; height: 100%; display: block; }
/* sizes for map text/lines are set as attributes in app.js so they scale with zoom */
.map .gridline { stroke: #1f2027; }
.map .gridlabel { fill: #55545b; }
.map .leg-line { stroke: var(--accent); fill: none; }
.map .leg-line.sell { stroke: var(--s3); }
.map .lbl-text { fill: var(--text); paint-order: stroke; stroke: #0d0e12; font-weight: 600; }
.map .lbl-text.dim { fill: var(--text-2); }
.map-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); margin-bottom: 8px; }
.map-legend span { display: inline-flex; align-items: center; gap: 6px; }
.site-item { padding: 9px 10px; border-radius: 4px; border: 1px solid transparent; cursor: pointer; margin-bottom: 4px; }
.site-item:hover { background: var(--surface-2); border-color: var(--line); }
.site-item.selected { background: var(--accent-soft); border-color: rgba(255, 140, 26, .45); }
.site-item .top { display: flex; justify-content: space-between; gap: 8px; }
.site-item .top b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-item .meta { color: var(--muted); font-size: 12px; }

.calc-out { margin-top: 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.calc-out .mini .lbl { display: block; }
.note { color: var(--muted); font-size: 12px; margin: 12px 0 0; }
.stat-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px 24px; }
.stat-groups h3 { font-size: 12px; color: var(--text-2); margin: 0 0 6px; text-transform: uppercase; letter-spacing: .06em; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--surface-2); border: 1px solid var(--accent); color: var(--text); padding: 8px 16px; border-radius: 5px; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 60; }
.toast.show { opacity: 1; }

/* ---------- trade ---------- */
.route-controls { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
#tab-trade.carrier-mode .ship-only { display: none !important; }
.trade-arrow { color: var(--muted); margin: 0 4px; }
.leg-card { background: var(--surface-2); border-radius: 4px; padding: 10px 12px; margin-bottom: 8px; }
.leg-card .top { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.leg-n { display: inline-flex; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: #1a1007; font-size: 11px; font-weight: 700; align-items: center; justify-content: center; margin-right: 6px; }
.profit { color: #6fd66f; font-weight: 600; }

/* ---------- goals ---------- */
.goal-types { margin-bottom: 14px; flex-wrap: wrap; }
.goal-types button { padding: 6px 14px; font-size: 13px; }
.goal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-bottom: 16px; }
.goal-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; cursor: pointer; display: flex; flex-direction: column; gap: 8px; }
.goal-card:hover { border-color: #3a3b42; }
.goal-card.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.goal-card.done { opacity: .75; }
.goal-card .gtop { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.goal-card .gtitle { font-weight: 650; font-size: 15px; line-height: 1.3; }
.goal-card .gpct { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.goal-card .gsub { color: var(--muted); font-size: 12px; }
.goal-bar { height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.goal-bar > div { height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; }
.goal-card.done .goal-bar > div { background: var(--good); }
.goal-row { display: grid; grid-template-columns: 1fr 160px 90px 30px; gap: 8px; align-items: end; margin-bottom: 8px; }
.eng-row { display: grid; grid-template-columns: minmax(150px, 1.2fr) minmax(150px, 1.2fr) 70px 70px 60px minmax(140px, 1fr) auto 30px; gap: 8px; align-items: end; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line-soft); }
.eng-row label, .goal-row label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); min-width: 0; }
.rolls { display: flex; gap: 3px; }
.rolls input { width: 38px; padding: 6px 4px; text-align: center; }
.icon-btn { background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 4px; height: 34px; cursor: pointer; }
.icon-btn:hover { color: #ff7b7b; border-color: #ff7b7b; }
@media (max-width: 900px) {
  .eng-row { grid-template-columns: 1fr 1fr; }
  .goal-row { grid-template-columns: 1fr 1fr; }
}
.step-list { list-style: none; padding: 0; margin: 0; }
.step-list li { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; border-bottom: 1px solid var(--line-soft); }
.step-list .tick { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); flex: 0 0 18px; margin-top: 1px; display: flex; align-items: center; justify-content: center; font-size: 11px; }
.step-list li.done .tick { background: var(--good); border-color: var(--good); color: #fff; }
.step-list li.done .txt { color: var(--muted); text-decoration: line-through; }
.step-list li.editable { cursor: pointer; }
.short { color: #ff9a7a; font-weight: 600; }
.okv { color: #6fd66f; }

/* ---------- galaxy map ---------- */
/* the map fills the whole window: no centred column, no page padding */
body.on-map main { max-width: none; padding: 0; margin: 0; }
#tab-map { margin: 0; }
.galaxy-wrap { position: relative; width: 100%; height: calc(100vh - 118px); min-height: 460px; background: #07080b; overflow: hidden; touch-action: none; }
.galaxy-wrap canvas { display: block; cursor: grab; }
.map-hud { position: absolute; top: 14px; left: 14px; background: rgba(13,14,18,.86); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 6px; padding: 10px 14px; min-width: 240px; max-width: 320px; backdrop-filter: blur(4px); font-size: 13px; }
.hud-title { font-weight: 700; letter-spacing: .06em; color: var(--accent-ink); font-size: 12px; text-transform: uppercase; margin-bottom: 4px; }
.hud-row { color: var(--text-2); margin: 2px 0; }
.hud-row b { color: var(--text); }
.hud-goals { margin-top: 8px; border-top: 1px solid var(--line-soft); padding-top: 6px; }
.hud-goal { cursor: pointer; padding: 4px 0; font-size: 12px; position: relative; }
.hud-goal:hover { color: var(--accent-ink); }
.hud-goal .dot { margin-right: 6px; }
.hud-pct { float: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.hud-goal .goal-bar { height: 3px; margin-top: 3px; }
.map-search { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); width: min(320px, 50%); }
.map-search input { background: rgba(13,14,18,.9); border-radius: 20px; padding: 8px 14px; }
.map-tools { position: absolute; top: 14px; right: 14px; display: flex; flex-direction: column; gap: 6px; }
.map-tools button { width: 34px; height: 34px; border-radius: 6px; background: rgba(13,14,18,.88); border: 1px solid var(--line); color: var(--text); font-size: 15px; cursor: pointer; }
.map-tools button:hover { border-color: var(--accent); color: var(--accent-ink); }
.map-layers { position: absolute; bottom: 14px; left: 14px; display: flex; flex-wrap: wrap; gap: 6px; max-width: calc(100% - 140px); }
.layer { display: inline-flex; align-items: center; gap: 6px; background: rgba(13,14,18,.88); border: 1px solid var(--line); color: var(--muted); border-radius: 14px; padding: 4px 10px; font: inherit; font-size: 12px; cursor: pointer; }
.layer.on { color: var(--text); border-color: #3b3c44; }
.layer:not(.on) svg { opacity: .3; }
.map-panel-side { position: absolute; top: 60px; right: 60px; width: min(340px, calc(100% - 80px)); max-height: calc(100% - 120px); overflow-y: auto; background: rgba(13,14,18,.94); border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: 6px; padding: 14px 16px; backdrop-filter: blur(4px); }
.map-close { position: absolute; top: 8px; right: 8px; background: none; border: 0; color: var(--muted); font-size: 14px; cursor: pointer; }
.map-close:hover { color: var(--text); }
.mp-kind { display: flex; gap: 6px; margin-bottom: 6px; }
.mp-h { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--accent-ink); margin: 14px 0 6px; }
.mp-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.mp-goal { padding: 6px 8px; border-radius: 4px; background: var(--surface-2); margin-bottom: 4px; cursor: pointer; }
.mp-goal:hover { outline: 1px solid var(--accent); }
.mp-goal .dot { margin-right: 6px; }
.mp-station { padding: 5px 0; border-bottom: 1px solid var(--line-soft); }
@media (max-width: 760px) {

  .map-hud { max-width: calc(100% - 70px); min-width: 0; font-size: 12px; }
  .map-search { top: auto; bottom: 60px; width: calc(100% - 28px); }
  .map-panel-side { top: auto; bottom: 0; right: 0; left: 0; width: 100%; max-height: 55%; border-radius: 10px 10px 0 0; }
}

/* ---------- map hub: tool rail, panels, ticker ---------- */
.map-rail { position: absolute; top: 14px; left: 14px; bottom: 60px; display: flex; flex-direction: column; gap: 6px; z-index: 3; }
.rail-btn { width: 56px; padding: 8px 0 6px; display: flex; flex-direction: column; align-items: center; gap: 3px; background: rgba(13,14,18,.9); border: 1px solid var(--line); border-radius: 8px; color: var(--text-2); cursor: pointer; font: inherit; font-size: 10px; letter-spacing: .03em; }
.rail-btn:hover { color: var(--text); border-color: #3b3c44; }
.rail-btn.on { color: var(--accent-ink); border-color: var(--accent); background: rgba(255,140,26,.12); }
.map-fly { position: absolute; top: 14px; left: 80px; width: 340px; max-height: calc(100% - 80px); display: flex; flex-direction: column; background: rgba(13,14,18,.94); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 6px; backdrop-filter: blur(4px); z-index: 3; }
.fly-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px 8px 14px; border-bottom: 1px solid var(--line-soft); position: relative; }
.fly-head h2 { margin-right: auto; }
.fly-head .map-close { position: static; }
.fly-body { padding: 10px 14px 14px; overflow-y: auto; font-size: 13px; }
.fly-form { display: flex; flex-direction: column; gap: 8px; }
.fly-form label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.fly-form textarea { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); border-radius: 4px; padding: 7px 9px; font: inherit; resize: vertical; }
.fly-row { display: flex; gap: 8px; }
.fly-row > * { flex: 1; }
.fly-step { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.fly-step .leg-n { flex: 0 0 20px; margin-top: 1px; }
.fly-item { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 4px; cursor: pointer; border: 1px solid transparent; }
.fly-item:hover { background: var(--surface-2); }
.fly-item.on { background: var(--accent-soft); border-color: rgba(255,140,26,.4); }
.fly-item .star { flex: 0 0 auto; }
.fly-link { color: var(--accent-ink); text-decoration: none; border-bottom: 1px dotted rgba(255,179,92,.5); }
.fly-link:hover { color: #fff; }
.fg-goal { padding: 8px 10px; border: 1px solid var(--line-soft); border-radius: 6px; margin-top: 8px; cursor: pointer; }
.fg-goal:hover { border-color: #3b3c44; }
.fg-goal.open { border-color: var(--accent); }
.fg-goal.done { opacity: .7; }
.fg-top { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; }
.fg-top b { flex: 1; font-weight: 600; }
.fg-detail { margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--line-soft); }
.fg-detail .step-list li { padding: 5px 0; font-size: 12px; }
.fl-feed { padding: 4px 0; border-bottom: 1px solid var(--line-soft); font-size: 12px; }
.map-ticker { position: absolute; bottom: 58px; left: 50%; transform: translate(-50%, 10px); background: rgba(13,14,18,.92); border: 1px solid var(--accent); color: var(--text); padding: 7px 16px; border-radius: 18px; font-size: 13px; opacity: 0; transition: opacity .3s, transform .3s; pointer-events: none; max-width: 70%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; z-index: 4; }
.map-ticker.show { opacity: 1; transform: translate(-50%, 0); }
.map-layers { left: 80px; }
.map-search { left: calc(50% + 40px); }
@media (max-width: 760px) {
  .map-rail { top: auto; bottom: 0; left: 0; right: 0; flex-direction: row; justify-content: space-around; padding: 6px; background: rgba(7,8,11,.95); border-top: 1px solid var(--line); }
  .rail-btn { width: auto; flex: 1; }
  .map-fly { left: 0; right: 0; top: auto; bottom: 64px; width: auto; max-height: 58%; border-left: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: 10px 10px 0 0; }
  .map-layers { left: 8px; bottom: 70px; max-width: calc(100% - 16px); }
  .map-layers .layer { padding: 3px 8px; }
  .map-search { left: 50%; top: 14px; bottom: auto; width: calc(100% - 80px); transform: translateX(calc(-50% - 20px)); }
  .map-panel-side { bottom: 64px; }
  .map-ticker { bottom: 110px; max-width: 90%; }
}

@media (max-width: 760px) {
  body.on-map .top-stats, body.on-map .brand-sub { display: none; }
  body.on-map .topbar { padding: 8px 16px; }

}

.layers-toggle { display: none; }
@media (max-width: 760px) {
  .layers-toggle { display: inline-flex; }
  .map-layers:not(.open) .layer[data-k] { display: none; }
}

/* ---------- map visuals pass ---------- */
.galaxy-wrap { background: #04050a; }
.map-tools button.on { border-color: var(--accent); color: var(--accent-ink); background: rgba(255,140,26,.15); }
.map-tools button { backdrop-filter: blur(4px); box-shadow: 0 2px 10px rgba(0,0,0,.4); }
.map-help { position: absolute; top: 14px; right: 60px; width: 300px; background: rgba(10,11,16,.95); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; font-size: 12px; color: var(--text-2); z-index: 5; box-shadow: 0 8px 30px rgba(0,0,0,.5); }
.map-help b { color: var(--accent-ink); display: block; margin-bottom: 6px; }
.map-help div { margin: 5px 0; line-height: 1.7; }
kbd { background: var(--surface-2); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; font: 11px var(--mono); color: var(--text); }
.mp-waypoints { max-height: 220px; overflow-y: auto; margin-bottom: 6px; }
.map-fly, .map-panel-side, .rail-btn, .layer, .map-search input { box-shadow: 0 6px 24px rgba(0,0,0,.45); }
.map-panel-side { border-top-color: #ff8c1a; }
@media (max-width: 760px) { .map-help { right: 8px; left: 8px; width: auto; top: 60px; } }

/* layers as a pop-up on every screen size */
.map-layers { flex-direction: column-reverse; align-items: flex-start; flex-wrap: nowrap; gap: 4px; max-width: none; }
.layers-toggle { display: inline-flex !important; }
.map-layers:not(.open) .layer[data-k] { display: none; }
.map-layers.open .layer[data-k] { min-width: 150px; }

/* ---------- voyage ---------- */
.voy-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; margin-top: 12px; }
.voy-next { background: linear-gradient(180deg, rgba(120,230,255,.10), rgba(120,230,255,.03)); border: 1px solid rgba(120,230,255,.35); border-radius: 8px; padding: 10px 12px; margin: 8px 0; }
.voy-next .lbl { display: block; }
.voy-next.done { color: #8ff0b4; border-color: rgba(47,211,107,.5); background: rgba(47,211,107,.08); font-weight: 600; }
.voy-sys { font-size: 18px; font-weight: 700; margin: 2px 0 4px; color: #e6fbff; word-break: break-word; }
.voy-win { background: rgba(47,211,107,.08); border: 1px solid rgba(47,211,107,.35); border-radius: 6px; padding: 7px 10px; font-size: 12px; color: #b9f3cd; }
.voy-warn { background: rgba(250,178,25,.08); border: 1px solid rgba(250,178,25,.4); border-radius: 6px; padding: 7px 10px; font-size: 12px; color: #f6d48a; }
.voy-list { max-height: 260px; overflow-y: auto; }
.voy-row.done { opacity: .45; }
.voy-row.done span::before { content: "✓ "; color: var(--good); }
#fv-eff { padding: 0; accent-color: #7fd8ff; }

/* ---------- shipyard ---------- */
.sy-ships { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; align-items: stretch; }
.sy-chip { display: flex; flex-direction: column; gap: 2px; text-align: left; background: var(--surface-2); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius); padding: 7px 12px; cursor: pointer; font: inherit; min-width: 150px; }
.sy-chip span { font-size: 12px; color: var(--muted); }
.sy-chip .sy-chip-stats { font-size: 11px; }
.sy-chip:hover { border-color: var(--accent); }
.sy-chip.active { border-color: var(--accent); background: var(--accent-soft); }
.sy-chip i { font-style: normal; }
.accent-ink { color: var(--accent-ink); }
.sy-missing { align-self: center; }
.sy-layout { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 16px; align-items: start; }
.sy-side { position: sticky; top: 52px; max-height: calc(100vh - 68px); overflow-y: auto; }
.sy-side-tabs { margin-bottom: 12px; }
.sy-engcount { margin-left: auto; }
.sy-group { margin-bottom: 14px; }
.sy-gtitle { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-2); margin: 0 0 6px 2px; }
.sy-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; }
.sy-core .sy-grid { grid-template-columns: 1fr; }
.sy-slot { display: flex; flex-direction: column; gap: 3px; text-align: left; font: inherit; color: var(--text); cursor: pointer; min-width: 0;
  background: rgba(21, 22, 26, .92); border: 1px solid var(--line); border-left: 3px solid var(--line); border-radius: 5px; padding: 6px 8px; transition: border-color .12s, background .12s; }
.sy-slot:hover { border-color: var(--accent); }
.sy-slot.sel { border-color: var(--accent); background: rgba(255, 140, 26, .12); box-shadow: 0 0 0 1px var(--accent) inset; }
.sy-slot.is-eng { border-left-color: #2fae4f; }
.sy-slot.has-plan { border-left-color: var(--accent); }
.sy-slot.no-eng { opacity: .55; }
.sy-slot.empty-slot { opacity: .4; border-style: dashed; }
.sy-row1 { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.sy-size { font-family: var(--mono); font-size: 10px; font-weight: 700; min-width: 16px; height: 16px; line-height: 16px; text-align: center; border-radius: 3px; background: rgba(57, 135, 229, .2); color: #8fbcf2; }
.sy-rating { font-family: var(--mono); color: var(--text-2); }
.sy-mount { color: var(--text-2); }
.sy-label { text-transform: uppercase; letter-spacing: .06em; font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sy-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sy-eng, .sy-plan { font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sy-eng { color: #6fd66f; }
.sy-eng small { color: var(--muted); }
.sy-plan { color: var(--accent-ink); }
.sy-plan.done { color: #6fd66f; }
.sy-plan.changed { color: var(--warn); }
.sy-dot { margin-left: auto; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--accent); display: inline-block; flex: none; }
.sy-dot.on { background: var(--accent); }
.sy-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 4px; }
.sy-legend span { display: inline-flex; align-items: center; gap: 6px; }
.sy-legend .sy-dot { margin-left: 0; }
.sy-legend .lg { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.sy-legend .lg.eng { background: #2fae4f; }
.sy-legend .lg.plan { background: var(--accent); }
.sy-ed-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.sy-ed-head h3 { margin: 2px 0 8px; font-size: 16px; }
.sy-cur { margin-bottom: 12px; }
.sy-cur-top { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.sy-cur details { margin-top: 6px; }
.sy-cur summary { cursor: pointer; }
.sy-mods td, .sy-mats td { padding: 4px 6px; }
.sy-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.sy-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.sy-form .sy-wide { grid-column: 1 / -1; }
.sy-form .lbl { margin-bottom: 4px; }
.sy-rolls { display: flex; gap: 6px; }
.sy-rolls label { flex: 1; font-size: 11px; text-align: center; }
.sy-rolls label.off { opacity: .35; }
.sy-rolls input { text-align: center; padding: 4px 2px; }
.sy-sub-h { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--accent-ink); margin: 14px 0 6px; }
.sy-mat-sum { margin-bottom: 4px; }
.sy-engs { margin-top: 0; }
.sy-track { display: flex; gap: 8px; align-items: center; margin-top: 14px; font-size: 13px; }
.sy-sheet { display: flex; flex-direction: column; gap: 6px; }
.sy-item { display: flex; gap: 6px; align-items: center; border: 1px solid var(--line); border-left: 3px solid var(--line); border-radius: 5px; padding: 5px 6px; }
.sy-item.tracked { border-left-color: var(--accent); }
.sy-item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; text-align: left; background: none; border: 0; color: var(--text); font: inherit; cursor: pointer; padding: 0; }
.sy-item-t { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sy-item-b { font-size: 12px; color: var(--accent-ink); }
@media (max-width: 1250px) {
  .sy-layout { grid-template-columns: minmax(0, 1fr) 340px; }
  .sy-body { grid-template-columns: 1fr; }
  .sy-core .sy-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
}
@media (max-width: 900px) { .sy-layout { grid-template-columns: 1fr; } .sy-side { position: static; max-height: none; } }
@media (max-width: 500px) {
  .sy-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sy-chip { min-width: 0; flex: 1 1 140px; }
}
.sy-mats td:first-child { white-space: normal; }
.sy-mats th, .sy-mats td { padding-left: 4px; padding-right: 4px; }

/* blueprint */
.sy-bp { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 330px) minmax(0, 1fr); gap: 34px; margin: 22px 0 10px; }
.sy-col { position: relative; }
.sy-col > .sy-slot { position: absolute; left: 0; right: 0; z-index: 3; }
.sy-hull2 { position: relative; aspect-ratio: 2 / 3; align-self: start; }
.sy-hullsvg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.sy-hullsvg .hull { fill: rgba(57, 135, 229, .07); stroke: rgba(110, 170, 240, .55); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.sy-hullsvg .hull-detail { fill: none; stroke: rgba(110, 170, 240, .18); stroke-dasharray: 3 5; vector-effect: non-scaling-stroke; }
.sy-hullsvg .cockpit { fill: rgba(140, 200, 255, .35); stroke: rgba(160, 210, 255, .7); vector-effect: non-scaling-stroke; }
.sy-hullsvg .nose-lbl { fill: rgba(140, 190, 240, .45); font-size: 7px; letter-spacing: .2em; text-anchor: middle; }
.sy-lines { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; overflow: visible; }
.sy-lines path { fill: none; stroke: rgba(140, 180, 230, .32); stroke-width: 1; }
.sy-lines path.hl, .sy-lines path.sel { stroke: var(--accent); stroke-width: 1.5; }
.sy-pin { position: absolute; z-index: 4; transform: translate(-50%, -50%); width: 17px; height: 17px; border-radius: 50%; padding: 0;
  font: 700 9px/1 var(--mono); color: #0b0c0f; background: #8fbcf2; border: 2px solid #8fbcf2; cursor: pointer; display: grid; place-items: center; }
.sy-pin.util { width: 15px; height: 15px; border-radius: 3px; font-size: 8px; }
.sy-pin.util { line-height: 1; }
.sy-pin.is-eng { background: #2fae4f; border-color: #2fae4f; }
.sy-pin.has-plan { background: var(--accent); border-color: var(--accent); }
.sy-pin.no-eng { background: #4a4c55; border-color: #4a4c55; color: var(--text-2); }
.sy-pin.empty { background: var(--bg); border: 2px dashed #5d6070; color: var(--muted); }
.sy-pin.under { background: var(--bg); color: var(--text); border-style: dashed; }
.sy-pin.under.is-eng { color: #6fd66f; } .sy-pin.under.has-plan { color: var(--accent-ink); } .sy-pin.under:not(.is-eng):not(.has-plan):not(.empty) { color: #8fbcf2; }
.sy-pin.guess { opacity: .7; }
.sy-pin:hover, .sy-pin.hl, .sy-pin.sel { box-shadow: 0 0 0 3px rgba(255, 140, 26, .45); z-index: 5; }
.sy-col > .sy-slot.hl { border-color: var(--accent); }
.sy-num { font: 700 10px/16px var(--mono); min-width: 16px; text-align: center; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2); }
.sy-legend .lg.pin { width: 12px; height: 12px; border-radius: 50%; background: #8fbcf2; }
.sy-legend .lg.pin.under { background: none; border: 2px dashed #8fbcf2; }
.sy-legend .lg.pin.util { border-radius: 2px; width: 11px; height: 11px; }
.sy-bp-note { margin: 4px 0 14px; }
.sy-bp.narrow { display: flex; flex-direction: column; gap: 0; height: auto !important; }
.sy-bp.narrow .sy-hull2 { order: -1; width: min(100%, 300px); margin: 0 auto 14px; }
.sy-bp.narrow .sy-col { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; margin-bottom: 6px; }
.sy-bp.narrow .sy-col > .sy-slot { position: static; }
.sy-bp.narrow .sy-lines { display: none; }
.sy-chip.planned { border-style: dashed; }
.sy-chip.sy-add { border-style: dashed; color: var(--accent-ink); background: none; }
.sy-chip.sy-add b { color: var(--accent-ink); }
.sy-addform { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; padding: 6px 10px; border: 1px dashed var(--accent); border-radius: var(--radius); }
.sy-addform label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.sy-addform select { min-width: 220px; }
.sy-engcount .btn { margin-left: 6px; }

/* ---------- ship AI ---------- */
.voice-btn { display: inline-flex; align-items: center; gap: 6px; align-self: center; background: var(--surface-2); color: var(--muted);
  border: 1px solid var(--line); border-radius: 16px; padding: 5px 12px 5px 10px; font: inherit; font-size: 12px; cursor: pointer; }
.voice-btn .w { opacity: .25; }
.voice-btn.on { color: var(--accent-ink); border-color: rgba(255, 140, 26, .55); }
.voice-btn.on .w { opacity: 1; }
.voice-btn:hover { border-color: var(--accent); }
.vs-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .55); display: grid; place-items: start center; padding: 6vh 16px; overflow: auto; }
.vs-dialog { width: min(640px, 100%); margin: 0; box-shadow: 0 20px 60px rgba(0, 0, 0, .6); }
.vs-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.vs-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.vs-grid input[type=range] { width: 100%; accent-color: var(--accent); }
.vs-cats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; font-size: 13px; }
.vs-cats label { display: flex; gap: 6px; align-items: center; }
.vs-game { margin: 8px 0 4px; }
@media (max-width: 560px) { .vs-grid, .vs-cats { grid-template-columns: 1fr; } }
.copy.plot { color: var(--accent-ink); opacity: .75; }
.copy.plot:hover { opacity: 1; }

/* ---------- where to buy ---------- */
.buy-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 10px; }
.buy-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); min-width: 120px; }
.buy-form label.buy-chk { flex-direction: row; align-items: center; min-width: 0; font-size: 13px; color: var(--text-2); padding-bottom: 6px; }
.buy-form select { min-width: 160px; }
.buy-what { font-weight: 600; align-self: center; padding-bottom: 6px; }
tr.buy-cheap td { background: rgba(12, 163, 12, .07); }
.sy-buy { margin: 0 0 12px; border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 10px; }
.sy-buy summary { cursor: pointer; color: var(--accent-ink); font-size: 13px; }
.sy-buy-body { margin-top: 8px; }
.sy-buy .buy-form label { min-width: 0; }
.sy-buy .buy-form select { min-width: 0; max-width: 100%; }
.sy-ship-buy { width: 100%; margin-top: 10px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); }

/* ---------- inventory ---------- */
.inv-filter { margin-left: auto; min-width: 220px; }
.inv-scroll { max-height: 520px; overflow: auto; }
th.sorted a { color: var(--accent-ink); }
th a { color: inherit; text-decoration: none; }
.inv-buy-row td { background: var(--surface-2); }
.inv-mats { display: grid; grid-template-columns: 150px repeat(var(--cols), minmax(0, 1fr)); gap: 4px; margin-bottom: 8px; overflow-x: auto; }
.inv-mh { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 2px 4px; }
.inv-fam { font-size: 12px; color: var(--text-2); padding: 6px 4px; align-self: center; }
.inv-cellwrap { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.inv-cell { background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: 4px; padding: 4px 6px; min-width: 0; }
.inv-cell.full { border-color: rgba(250, 178, 25, .55); }
.inv-cell.short { border-color: rgba(255, 120, 90, .7); box-shadow: inset 3px 0 0 #ff7a5a; }
.inv-cell.needok { box-shadow: inset 3px 0 0 #2fae4f; }
.inv-mn { font-size: 11px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inv-mc { font-size: 12px; font-variant-numeric: tabular-nums; }
.inv-mc .short, .inv-mc .okv { font-size: 11px; }
.inv-bar { height: 3px; background: var(--line); border-radius: 2px; margin-top: 3px; overflow: hidden; }
.inv-bar i { display: block; height: 100%; background: var(--s1); }
.inv-cell.full .inv-bar i { background: var(--warn); }
.inv-need-key, .inv-full-key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: middle; }
.inv-need-key { box-shadow: inset 3px 0 0 #ff7a5a; border: 1px solid rgba(255, 120, 90, .7); }
.inv-full-key { border: 1px solid rgba(250, 178, 25, .7); }
.inv-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; }
.inv-item { background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: 4px; padding: 6px 8px; }
.inv-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.inv-chip { font-size: 12px; background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: 10px; padding: 2px 8px; color: var(--text-2); }
.inv-chip b { color: var(--text); margin-left: 2px; }
@media (max-width: 760px) { .inv-mats { grid-template-columns: 90px repeat(var(--cols), minmax(110px, 1fr)); } .inv-filter { min-width: 0; width: 100%; } }
.sy-buy th:nth-child(4), .sy-buy td:nth-child(4), .sy-buy th:nth-child(7), .sy-buy td:nth-child(7) { display: none; }
.sy-buy td:first-child, .sy-buy td:nth-child(2) { white-space: normal; }
.sy-buy td, .sy-buy th { padding: 5px 4px; }

/* ---------- assist ---------- */
.as-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.as-head .seg { flex-wrap: wrap; }
.as-head .seg button { padding: 7px 12px; font-size: 13px; }
.as-actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.act { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 64px; padding: 10px;
  background: var(--surface-2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; font: inherit; cursor: pointer; touch-action: manipulation; }
.act b { font-size: 15px; }
.act span { font-size: 11px; color: var(--muted); }
.act.big { min-height: 84px; border-color: rgba(255, 140, 26, .45); }
.act.big b { font-size: 17px; color: var(--accent-ink); }
.act:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); }
.act:active:not(:disabled) { transform: scale(.97); }
.act:disabled { opacity: .4; cursor: not-allowed; }
.as-setup { margin-top: 12px; }
.as-setup summary { cursor: pointer; color: var(--accent-ink); font-size: 13px; }
.as-setup-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin: 10px 0 6px; }
.as-setup-grid label, .as-inline { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.as-inline { flex-direction: row; align-items: center; gap: 6px; }
.as-inline input { width: 60px; }
.as-tiles .val { font-size: 22px; }
.as-sys { font-size: 16px !important; }
.as-bar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin-top: 6px; }
.as-bar i { display: block; height: 100%; background: var(--s1); transition: width .4s; }
.as-bar.full i { background: var(--crit); }
.as-bar.ok i { background: #2fae4f; }
.as-rocks { display: flex; flex-direction: column; gap: 4px; max-height: 420px; overflow: auto; }
.as-rock { display: grid; grid-template-columns: 70px 90px 1fr auto; gap: 8px; align-items: center; padding: 6px 8px; border: 1px solid var(--line-soft); border-radius: 5px; font-size: 13px; }
.as-rock.good { border-color: rgba(47, 174, 79, .6); background: rgba(47, 174, 79, .08); }
.as-tgt { color: var(--accent-ink); font-weight: 600; }
.as-bios { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.as-bio { border: 1px solid var(--line); border-radius: 6px; padding: 10px; display: flex; flex-direction: column; gap: 4px; }
.as-bio.ok { border-color: rgba(47, 174, 79, .7); }
.as-bio.done { opacity: .7; }
.as-bio-top { display: flex; justify-content: space-between; gap: 6px; align-items: center; }
.as-dist { font-size: 18px; font-weight: 600; }
@media (max-width: 600px) { .as-rock { grid-template-columns: 1fr auto; } .as-rock > .hint { display: none; } .as-actions { grid-template-columns: repeat(2, 1fr); } }

.as-auto { margin-top: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.as-auto.on { border-color: rgba(47, 174, 79, .6); }
.as-auto-switch { display: flex; align-items: center; gap: 10px; font-size: 16px; cursor: pointer; }
.as-auto-switch input { width: 22px; height: 22px; }
.as-auto-line { margin: 8px 0; font-size: 14px; }
.as-auto-set { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 6px; }
.as-auto-set label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.as-auto-set input { width: 110px; }

/* ---------- loadout list (outfitting style) ---------- */
.sy-viewsel { margin-left: 12px; }
.ly { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; margin: 8px 0 10px; font-size: 13px; }
.ly-head { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 6px; padding: 0 2px 4px; border-bottom: 2px solid var(--accent);
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text); }
.ly-head span:first-child { text-align: center; }
.ly-sec { margin: 10px 0 3px; padding: 3px 8px 3px 36px; background: #9d9d9d; color: #101010; font-weight: 700; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.ly-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 6px; align-items: center; margin-top: 3px; cursor: pointer; }
.ly-cl { text-align: center; color: var(--text); font-weight: 600; }
.ly-mod { background: #352010; color: var(--accent); padding: 5px 9px; text-transform: uppercase; letter-spacing: .04em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border: 1px solid transparent; }
.ly-row:hover .ly-mod { background: #4a2c12; border-color: rgba(255, 140, 26, .45); }
.ly-row.sel .ly-mod, .ly-ship .ly-mod { background: var(--accent); color: #1a1007; font-weight: 600; }
.ly-ship { cursor: default; margin-top: 8px; }
.ly-row.empty .ly-mod { color: #7d5c3c; background: #24170c; }
.ly-row.planned-fit .ly-mod { color: var(--accent-ink); background: #2a1a0c; border-style: dashed; border-color: rgba(255, 140, 26, .5); }
.ly-row.no-eng .ly-mod { color: #c48a52; }
.ly-right { display: flex; gap: 8px; justify-content: flex-end; align-items: center; min-width: 54px; font-size: 12px; white-space: nowrap; }
.ly-eng { color: #4fd07a; }
.ly-plan { color: var(--accent-ink); }
.ly-plan.done { color: #4fd07a; }
.ly-plan.changed { color: var(--warn); }
.ly-plan .sy-dot { margin-left: 2px; vertical-align: middle; }
.ly-bpn { display: inline; }
@media (max-width: 1500px) { .ly-bpn { display: none; } }
@media (max-width: 1100px) { .ly { grid-template-columns: 1fr; gap: 6px; } .ly-col + .ly-col .ly-head { display: none; } }
.ly-head, .ly-row { grid-template-columns: 28px minmax(0, 1fr); }
.ly-hm { display: flex; justify-content: space-between; padding-right: 8px; }
.ly-mod { display: flex; align-items: center; gap: 10px; }
.ly-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ly-mod .ly-right { flex: none; min-width: 0; text-transform: none; letter-spacing: 0; }
.ly-row.sel .ly-eng, .ly-row.sel .ly-plan { color: #102a12; font-weight: 600; }
@media (max-width: 600px) { .ly-mod { padding: 5px 6px; font-size: 12px; } }

/* ---------- accounts ---------- */
.auth-backdrop { background: radial-gradient(ellipse at 50% 30%, rgba(255, 140, 26, .08), rgba(5, 6, 8, .96) 60%); z-index: 100; place-items: center; }
.auth-dialog { width: min(440px, 100%); }
.auth-dialog h2 { margin-bottom: 6px; }
.auth-tabs { margin-bottom: 14px; }
.auth-form { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.auth-form label, .acct-row { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.auth-err { min-height: 1em; font-size: 13px; }
.acct-btn span:first-child { color: var(--text); }
.acct-menu { position: fixed; z-index: 60; display: flex; flex-direction: column; padding: 6px; min-width: 200px; margin: 0; }
.acct-menu button { background: none; border: 0; color: var(--text); text-align: left; padding: 8px 10px; font: inherit; cursor: pointer; border-radius: 4px; }
.acct-menu button:hover { background: var(--accent-soft); color: var(--accent-ink); }
.acct-row { margin-top: 10px; }
.acct-tok { display: flex; gap: 6px; }
.acct-tok input { flex: 1; }
.adm-acts { white-space: nowrap; }
.adm-inl { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.adm-inl input { width: 70px; }
.adm-code { margin: 10px 0; padding: 10px; border: 1px dashed var(--accent); border-radius: var(--radius); }
.mono { font-family: var(--mono); }
.muted-row td { opacity: .55; }
.acct-dialog { width: min(860px, 100%); }
.carrier-tick { flex-basis: 100%; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--accent-soft); }
.step .step-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.step .step-head .btn { text-transform: none; letter-spacing: 0; }
.resell-when { margin: 2px 0 8px; }
.resell-banner { border: 1px solid var(--line, rgba(255,255,255,.12)); border-radius: 6px; padding: 6px 9px; margin-bottom: 8px; background: var(--accent-soft); }
.resell-banner.changed { border-color: rgba(250, 178, 25, .6); background: rgba(250, 178, 25, .1); }
.resell-alts { margin-top: 8px; }
.resell-alts summary { cursor: pointer; color: var(--accent-ink); font-size: 13px; }
/* Carriers tab */
.cv-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 14px; margin-bottom: 14px; }
@media (max-width: 900px) { .cv-top { grid-template-columns: 1fr; } }
.cv-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.cv-form label { flex: 1 1 150px; }
.cv-tank { margin: 10px 0; }
.cv-pending { margin: 6px 0; display: inline-block; }
.convoy { margin-bottom: 14px; }
.convoy .panel-head h2 { margin-right: 0; }
.cv-actions { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.cv-code { font-size: 12px; color: var(--muted, #9aa); border: 1px dashed var(--line); border-radius: 4px; padding: 2px 6px; }
.cv-tiles { grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 6px 0 10px; }
@media (max-width: 700px) { .cv-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cv-next { border-color: rgba(180, 170, 255, .45); background: linear-gradient(180deg, rgba(180,170,255,.12), rgba(180,170,255,.03)); }
.cv-table td { vertical-align: top; }
.convoy details { margin-top: 10px; }
.convoy details summary { cursor: pointer; color: var(--accent-ink); font-size: 13px; }
.convoy .cv-edit { margin: 4px 0 12px; }
.linkish { background: none; border: 0; color: inherit; text-decoration: underline dotted; cursor: pointer; font: inherit; padding: 0; }
.voy-auto { margin: 10px 0 2px; display: flex; gap: 8px; align-items: center; font-weight: 600; }
.voy-auto-hint { margin-bottom: 8px; }

.cv-cmd { border: 1px solid var(--line, rgba(255,255,255,.12)); border-radius: 10px; padding: 10px 12px; margin: 10px 0; }
.cv-cmd-head { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-bottom: 6px; }
.cv-watch.handed b { color: #fab219; }
.cv-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: rgba(160,160,160,.5); margin-right: 5px; vertical-align: middle; }
.cv-dot.on { background: #4cd07d; }
.cv-orders { margin: 6px 0; }
.cv-orders .btn-row { align-items: center; flex-wrap: wrap; }
.cv-cmd-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0; }
.cv-cmd-row input, .cv-cmd-row select { max-width: 260px; }
.cv-second { display: flex; gap: 6px; align-items: center; margin: 4px 0; }
.cv-officers summary { cursor: pointer; margin-top: 6px; }
.cv-follow { color: #b4aaff; }
.cv-wing { min-width: 120px; max-width: 160px; width: auto; }
