/* App styles. Shared by the app shell and the plain pages (privacy, messages). */
:root {
  /* Base palette = the "Cockpit" theme (no data-theme): warm near-black panels with a red instrument glow.
     The default is Space (data-theme="space", shown as "Dark"), set by theme.js before paint. */
  --bg: #0c0806; --chrome: #110b08; --panel: #17100b; --panel-2: #130d09; --line: #2e1f15; --line-2: #46301f;
  --text: #f1e2d0; --text-2: #e3ccb3; --muted: #bf9f80; --faint: #ad8e71; --accent: #ff2c2c; --accent-bg: #241210;
  --hi: #3fd17a; --low: #e6a23c; --null: #ff4d3d; --strong: #fff; --hover: #21160e; --accent-line: #4a2a22; --on-accent: #1a0505;
  --bad-bg: #2a1210; --bad-bg-2: #3a150e; --bad-line: #5e2a1e; --bad-text: #ffc6b8; --hostile-text: #ff7a6b; --friendly-text: #7cc4ff;
  --danger: #ff4d3d; --danger-2: #ff6a55; --danger-dim: #a84a3a; --good-bg: #12241a; --good-text: #a6f0c4; --warn-bg: #2a1d10; --warn-text: #ffd699;
  --overlay: rgba(17, 11, 8, .96); --overlay-2: rgba(17, 11, 8, .9); --shadow: rgba(0, 0, 0, .55);
  --map-gate: #4a3020; --map-gate-2: #5c3d28; --map-pill: #1a110b; --map-pill-line: #5a3a24; --map-cons: #7a5338; --map-null: #b39478;
  --map-glow: #1a100a; --kc-text: #ffd6c2; --kc-halo: #3a0f08; --page-art: none; --you: #4fd6e0;
  /* The instrument glow: soft orange light around lit controls and inside panels. */
  --glow: 0 0 14px rgba(255, 44, 44, .32); --panel-glow: inset 0 0 26px rgba(255, 44, 44, .05); --text-glow: 0 0 8px rgba(255, 44, 44, .35); --nav-mark: inset 3px 0 0 var(--accent-fill);
  /* Filled controls (buttons, nav marker) use a deeper red than text links. Kills/hostiles use the bright reds. */
  --accent-fill: #ff2c2c;
  --topbar: 56px; --nav: 232px; --nav-collapsed: 64px; --flyout: 360px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font-family: system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 14px; line-height: 1.4; }
a { color: var(--accent); }
button { font: inherit; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.error { color: var(--null); font-size: 13px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 14px;
       border-radius: 8px; background: var(--accent-fill, var(--accent)); color: var(--on-accent); border: 0; font-weight: 700; text-decoration: none; cursor: pointer; }
.btn.secondary { background: transparent; color: var(--text-2); border: 1px solid var(--line-2); font-weight: 500; }
.btn.block { width: 100%; min-height: 44px; }
.link { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; cursor: pointer; }
.link-danger { background: none; border: 0; padding: 0; color: var(--null); text-decoration: underline; cursor: pointer; }
.icon-btn { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px;
            border: 1px solid var(--line); background: var(--panel); color: var(--text); cursor: pointer; position: relative; }
.icon-btn.plain { border-color: transparent; background: transparent; color: var(--muted); }
.icon-btn:focus-visible, .btn:focus-visible, .nav-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.count { position: absolute; top: 5px; right: 5px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
         background: var(--null); color: #fff; font-size: 11px; font-weight: 700; line-height: 16px; text-align: center; }

/* ---------- app shell ---------- */
body.app { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { height: var(--topbar); flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px;
          padding: 0 12px 0 8px; background: var(--chrome); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 16px; letter-spacing: .02em; color: var(--text); text-decoration: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-name { font-size: 20px; font-weight: 750; letter-spacing: -.03em; line-height: 1; }
.brand-tag { margin-top: 2px; font-size: 8.5px; font-weight: 600; letter-spacing: .17em; text-transform: uppercase; color: var(--muted); line-height: 1.1; }
.logo-mark { flex: none; }
.logo-lens { stroke: var(--accent); }
.logo-ring { stroke: var(--accent); opacity: .45; }
.logo-star { fill: var(--text); }
.top-actions { display: flex; align-items: center; gap: 8px; }
.chars-btn { height: 44px; display: inline-flex; align-items: center; gap: 10px; padding: 0 12px 0 6px; border-radius: 10px;
             border: 1px solid var(--line); background: var(--panel); color: var(--text); cursor: pointer; }
.chars-btn[aria-expanded="true"] { border-color: var(--accent); background: var(--accent-bg); }
.stack { display: flex; }
.stack img { width: 30px; height: 30px; border-radius: 7px; border: 2px solid var(--chrome); background: var(--line-2); }
.stack img + img { margin-left: -10px; }
.chars-meta { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; }
.chars-meta b { font-weight: 600; }
.chars-meta span { font-size: 12px; color: var(--muted); }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; vertical-align: middle; background: var(--faint); }
.dot.on { background: var(--hi); }
.account-btn img { width: 30px; height: 30px; border-radius: 50%; }

.shell { flex: 1; display: flex; min-height: 0; }
.sidenav { flex: none; width: var(--nav); padding: 14px 10px; display: flex; flex-direction: column; gap: 4px;
           background: var(--chrome); border-right: 1px solid var(--line); position: sticky; top: var(--topbar);
           height: calc(100vh - var(--topbar)); overflow-y: auto; }
.nav-item { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: 8px; color: var(--text-2);
            text-decoration: none; border: 0; background: transparent; cursor: pointer; text-align: left; width: 100%; position: relative; }
.nav-item:hover { background: var(--hover); }
.nav-item[aria-current="page"] { background: var(--accent-bg); color: var(--text); font-weight: 600; }
.nav-item[aria-current="page"] svg { color: var(--accent); }
.nav-item .label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-item .badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--null); color: #fff;
                   font-size: 12px; font-weight: 700; line-height: 20px; text-align: center; }
.nav-item .soon { font-size: 11px; color: var(--faint); border: 1px solid var(--line-2); border-radius: 999px; padding: 1px 7px; }
.nav-item.dim { color: var(--faint); }
.nav-spacer { flex: 1; }
.nav-sep { height: 1px; background: var(--line); margin: 8px 0; }
svg { flex: none; }

/* collapsed to icons */
body.nav-collapsed .sidenav { width: var(--nav-collapsed); align-items: center; padding: 14px 10px; }
body.nav-collapsed .nav-item { width: 44px; padding: 0; justify-content: center; }
body.nav-collapsed .nav-item .label, body.nav-collapsed .nav-item .soon { display: none; }
body.nav-collapsed .nav-item .badge { position: absolute; top: 8px; right: 8px; min-width: 9px; width: 9px; height: 9px; padding: 0;
                                      font-size: 0; border: 2px solid var(--chrome); }
body.nav-collapsed .nav-sep { width: 32px; }
.collapse-icon-expand { display: none; }
body.nav-collapsed .collapse-icon-collapse { display: none; }
body.nav-collapsed .collapse-icon-expand { display: inline; }

.view { flex: 1; min-width: 0; padding: 24px 32px 48px; }
.view h1 { margin: 0 0 4px; font-size: 22px; font-weight: 600; }
.view .lede { margin: 0 0 18px; color: var(--muted); }
.view-narrow { max-width: 720px; }
.menu-btn { display: none; }
body.logged-out .sidenav, body.logged-out .top-actions, body.logged-out .menu-btn { display: none; }

/* ---------- flyout and popovers ---------- */
.flyout { position: fixed; top: var(--topbar); right: 0; bottom: 0; width: var(--flyout); max-width: 100%; z-index: 40;
          padding: 16px; display: flex; flex-direction: column; gap: 12px; background: var(--chrome);
          border-left: 1px solid var(--line-2); box-shadow: -16px 0 40px var(--shadow); }
.flyout[hidden], .popover[hidden], .scrim[hidden] { display: none; }
.flyout-head { display: flex; align-items: center; justify-content: space-between; }
.flyout-head h2 { margin: 0; font-size: 16px; font-weight: 600; }
.flyout-list { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; min-height: 0; }
.char { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px;
        border-radius: 10px; border: 1px solid var(--line); background: var(--panel); }
.char img { width: 40px; height: 40px; border-radius: 7px; background: var(--line-2); }
.char .top { display: flex; justify-content: space-between; gap: 8px; }
.char .status { font-size: 12px; color: var(--muted); white-space: nowrap; }
.char .where { color: var(--muted); font-size: 13px; margin-top: 2px; overflow-wrap: anywhere; }
.char.offline { opacity: .75; }
.char .x { width: 32px; height: 32px; border: 0; background: transparent; color: var(--faint); border-radius: 6px; cursor: pointer; font-size: 18px; }
.char .x:hover { background: var(--line); color: var(--text); }
.sec { font-weight: 700; }
.main-tag { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 4px; font-size: 11px; font-weight: 600; line-height: 18px;
  background: var(--line); color: var(--text); vertical-align: 1px; }
.char .linkish { margin-top: 2px; padding: 0; border: 0; background: none; color: var(--accent, var(--muted)); font-size: 12px; cursor: pointer; text-decoration: underline; }
.flyout-lens { margin: 0; padding: 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 12px; color: var(--muted); line-height: 1.5; }
.flyout-lens .main-tag { margin-left: 0; }
.flyout-note { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.5; }
.scrim { position: fixed; inset: var(--topbar) 0 0 0; background: var(--shadow); z-index: 35; }

.popover { position: fixed; top: calc(var(--topbar) + 6px); right: 12px; z-index: 45; width: min(380px, calc(100vw - 24px));
           max-height: calc(100vh - var(--topbar) - 24px); overflow-y: auto; padding: 12px; border-radius: 12px;
           background: var(--panel-2); border: 1px solid var(--line-2); box-shadow: 0 12px 32px var(--shadow); }
.popover h2 { margin: 0 0 8px; font-size: 14px; font-weight: 600; }
.menu-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.menu-list a, .menu-list button { display: flex; width: 100%; min-height: 40px; align-items: center; padding: 0 10px; border-radius: 8px;
                                  border: 0; background: transparent; color: var(--text); text-decoration: none; cursor: pointer; text-align: left; }
.menu-list a:hover, .menu-list button:hover { background: var(--hover); }
.menu-list .danger { color: var(--null); }
.menu-sep { height: 1px; background: var(--line); margin: 6px 0; }
.who-line { display: flex; gap: 10px; align-items: center; padding: 4px 6px 10px; }
.who-line img { width: 36px; height: 36px; border-radius: 8px; }

/* ---------- lookup ---------- */
.search { display: flex; gap: 8px; max-width: 640px; margin-bottom: 8px; }
.ac { position: relative; flex: 1; min-width: 0; display: flex; }
.ac input { width: 100%; height: 44px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel);
            color: var(--text); font: inherit; font-size: 15px; }
.ac input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.ac-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20; list-style: none; margin: 0; padding: 4px;
           background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px var(--shadow);
           max-height: 320px; overflow: auto; }
.ac-list li { display: grid; grid-template-columns: 24px 1fr auto; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 6px; cursor: pointer; }
.ac-list li img { width: 24px; height: 24px; border-radius: 4px; pointer-events: none; }
.ac-list li span { pointer-events: none; }
.ac-list li.active, .ac-list li:hover { background: var(--hover); }
.ac-list .seen { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 1px 6px; }
.ac-hint { max-width: 640px; margin-bottom: 10px; }
.history-head { display: flex; align-items: center; justify-content: space-between; max-width: 640px; margin: 14px 0 8px; }
.history-head h2 { margin: 0; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.history { display: flex; flex-direction: column; gap: 8px; max-width: 640px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; position: relative; }
.pilot { padding: 16px 16px 14px; }
.pilot-head { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.portrait { width: 56px; height: 56px; border-radius: 8px; border: 1px solid var(--line); background: var(--line-2); }
.pilot-id .name { font-size: 18px; font-weight: 600; }
.tickers { color: var(--muted); margin-top: 2px; }
.ticker { font-weight: 600; color: var(--text); cursor: default; }
.checked { font-size: 12px; color: var(--faint); margin-top: 2px; }
.card-tools { position: absolute; top: 6px; right: 6px; display: flex; }
.card-tools button { width: 32px; height: 32px; border: 0; background: transparent; color: var(--faint); border-radius: 6px; cursor: pointer; font-size: 16px; }
.card-tools button:hover { background: var(--line); color: var(--text); }
.pilot .pilot-head { padding-right: 30px; }

.risk { position: relative; text-align: center; min-width: 84px; padding: 8px 10px; border-radius: 10px; border: 2px solid var(--faint);
        cursor: help; outline: none; }
.risk:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.risk-score { font-size: 28px; font-weight: 700; line-height: 1; }
.risk-label { font-size: 12px; margin-top: 4px; text-transform: uppercase; letter-spacing: .05em; }
.risk-delta { font-size: 11px; margin-top: 3px; font-weight: 600; }
.risk.lvl-red { border-color: var(--null); color: var(--bad-text); background: var(--bad-bg); }
.risk.lvl-amber { border-color: var(--low); color: var(--warn-text); background: var(--warn-bg); }
.risk.lvl-green { border-color: var(--hi); color: var(--good-text); background: var(--good-bg); }
.risk.loading { border-style: dashed; color: var(--muted); }
.tip { display: none; position: absolute; right: 0; top: calc(100% + 8px); z-index: 10; width: min(320px, 80vw); text-align: left;
       background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
       box-shadow: 0 8px 24px var(--shadow); font-size: 13px; }
.risk:hover .tip, .risk:focus .tip, .risk:focus-within .tip { display: block; }
.tip-title { font-weight: 600; margin-bottom: 6px; text-transform: none; letter-spacing: 0; }
.tip ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.tip li { display: flex; justify-content: space-between; gap: 10px; }
.tip b { color: var(--muted); }

.glance { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.red-icons { display: flex; gap: 6px; }
.ricon { display: inline-flex; padding: 3px; border-radius: 8px; border: 2px solid var(--null); background: var(--bad-bg); cursor: help; }
.ricon img { width: 28px; height: 28px; border-radius: 4px; display: block; }
.glance-line { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.flies { display: inline-flex; gap: 10px; align-items: flex-start; }
.flies > .muted { align-self: center; }
.fly { display: flex; flex-direction: column; align-items: center; width: 64px; }
.fly img { width: 44px; height: 44px; border-radius: 6px; border: 1px solid var(--line); }
.fly-name { margin-top: 3px; font-size: 11px; line-height: 1.2; text-align: center; max-width: 64px; overflow: hidden;
            text-overflow: ellipsis; white-space: nowrap; }

/* collapsed history row */
.row { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 10px;
       border-radius: 10px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; width: 100%; color: var(--text); text-align: left; }
.row:hover { border-color: var(--line-2); }
.row img { width: 36px; height: 36px; border-radius: 6px; background: var(--line-2); }
.row .rname { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .rsub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill { min-width: 54px; text-align: center; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--faint); font-weight: 700; font-size: 13px; }
.pill.lvl-red { border-color: var(--null); color: var(--bad-text); background: var(--bad-bg); }
.pill.lvl-amber { border-color: var(--low); color: var(--warn-text); background: var(--warn-bg); }
.pill.lvl-green { border-color: var(--hi); color: var(--good-text); background: var(--good-bg); }
.row-x { width: 32px; height: 32px; border: 0; background: transparent; color: var(--faint); border-radius: 6px; cursor: pointer; font-size: 16px; }
.row-x:hover { background: var(--line); color: var(--text); }

/* more detail */
.more { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 8px; }
.more summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.more[open] summary { margin-bottom: 6px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 8px; margin-top: 10px; }
.stat { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px; text-align: center; }
.stat .v { font-weight: 600; font-size: 17px; } .stat .k { color: var(--muted); font-size: 12px; }
.label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; margin: 14px 0 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 13px; padding: 4px 8px; border-radius: 999px; border: 1px solid var(--line); display: inline-flex; align-items: center; gap: 6px; }
.chip.lvl-red { border-color: var(--null); } .chip.lvl-amber { border-color: var(--low); color: var(--warn-text); } .chip.lvl-green { border-color: var(--hi); }
.light { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.lvl-red .light { background: var(--null); } .lvl-amber .light { background: var(--low); } .lvl-green .light { background: var(--hi); }
.ships { display: grid; gap: 4px; }
.ship { display: grid; grid-template-columns: 24px 1fr auto; gap: 8px; align-items: center; }
.ship img { width: 24px; height: 24px; border-radius: 4px; }
.hours { display: flex; align-items: flex-end; gap: 2px; height: 48px; }
.hours .bar { flex: 1; background: var(--accent); opacity: .8; border-radius: 2px 2px 0 0; min-height: 2px; }
.hours-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 2px; }

/* alerts + lists */
.section-title { margin: 22px 0 8px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.list { display: flex; flex-direction: column; gap: 8px; max-width: 720px; }
.empty { padding: 18px; border: 1px dashed var(--line-2); border-radius: 10px; color: var(--muted); max-width: 640px; }
.flash { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 60; max-width: min(560px, calc(100vw - 24px));
         padding: 10px 14px; border-radius: 10px; background: var(--good-bg); border: 1px solid var(--hi); color: var(--good-text); box-shadow: 0 8px 24px var(--shadow); }
.flash[hidden] { display: none; }

/* alerts near my characters */
.prox-settings { display: grid; gap: 10px; max-width: 720px; }
.prox-settings .feed-controls { margin: 0; }
.check { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; }
.near-item { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: start; padding: 10px 12px; border-radius: 10px;
             border: 1px solid var(--line); background: var(--panel); }
.near-item.lvl-red { border-color: var(--null); }
.near-item.lvl-amber { border-color: var(--low); }
.risk-sm { min-width: 64px; padding: 6px 8px; }
.risk-sm .risk-score { font-size: 22px; }
.risk-sm .risk-label { font-size: 10px; }
.near-main { display: grid; gap: 4px; min-width: 0; }
.near-pilots { line-height: 1.6; }
.near-item a { color: var(--text); text-decoration: underline; text-decoration-color: var(--line-2); }
.popover .near-item { grid-template-columns: auto minmax(0, 1fr); }
.popover .tip { right: auto; left: 0; }

/* kill feed */
.feed-controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 14px; }
.feed-controls label { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); }
.feed-controls select { height: 36px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel); color: var(--text); font: inherit; }
.feed-controls .check { gap: 6px; }
.feed { display: flex; flex-direction: column; gap: 8px; max-width: 920px; }
.kill { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px;
        border-radius: 10px; border: 1px solid var(--line); background: var(--panel); }
.kill-icons { position: relative; width: 44px; height: 44px; }
.kill-ship { width: 44px; height: 44px; border-radius: 6px; border: 1px solid var(--line); }
.pod { position: absolute; right: -6px; bottom: -6px; display: block; width: 22px; height: 22px; border-radius: 50%;
       border: 2px solid var(--panel); background: var(--panel-2); overflow: hidden; }
.pod img { width: 100%; height: 100%; display: block; }
.kill.loss-friendly { border-color: var(--null); background: linear-gradient(90deg, var(--bad-bg) 0, var(--panel) 55%); }
.kill.loss-hostile { border-color: var(--hi); background: linear-gradient(90deg, var(--good-bg) 0, var(--panel) 55%); }
.tk { font-weight: 600; font-size: 12px; white-space: nowrap; color: var(--text-2); }
.tk.tone-friendly { color: var(--friendly-text); }
.tk.tone-hostile { color: var(--hostile-text); }
.tk-n { font-weight: 400; color: var(--muted); margin-left: 2px; }
.feed-standings { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; color: var(--muted); margin: -4px 0 12px; max-width: 920px; }
.legend { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 14px; height: 10px; border-radius: 3px; border: 1px solid var(--line-2); display: inline-block; }
.sw.loss-friendly { background: var(--bad-bg); border-color: var(--null); }
.sw.loss-hostile { background: var(--good-bg); border-color: var(--hi); }
.kill-main { min-width: 0; display: grid; gap: 2px; }
.kill-main > div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kill-side { text-align: right; display: grid; gap: 2px; }
.kill a { color: var(--text); text-decoration: underline; text-decoration-color: var(--line-2); }
.kill a:hover { text-decoration-color: var(--accent); }
.tag { margin-left: 6px; font-size: 11px; padding: 1px 6px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted); }
.tag.red { border-color: var(--null); color: var(--bad-text); }
@media (max-width: 760px) {
  .kill { grid-template-columns: 40px minmax(0, 1fr); }
  .kill-side { grid-column: 2; text-align: left; }
}

/* gate camps */
.camp { display: grid; gap: 10px; }
.camp-active { border-color: var(--null); }
.camp-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.camp-title { font-size: 15px; }
.camp-nums { text-align: right; }
.status-pill { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
               padding: 2px 8px; border-radius: 999px; vertical-align: 2px; }
.status-pill.active { background: var(--bad-bg); color: var(--bad-text); border: 1px solid var(--null); }
.status-pill.recent { background: var(--warn-bg); color: var(--warn-text); border: 1px solid var(--low); }
.camp-who { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.camp-ships { flex-wrap: wrap; }
.camp-pilots a, .camp a { color: var(--text); text-decoration: underline; text-decoration-color: var(--line-2); }

/* help & feedback */
.ticket-form { display: grid; gap: 6px; max-width: 640px; }
.ticket-form label { color: var(--muted); font-size: 13px; margin-top: 4px; }
.ticket-form input, .ticket-form textarea, .reply textarea { width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line-2);
  background: var(--panel-2); color: var(--text); font: inherit; resize: vertical; }
.ticket-form div { margin-top: 8px; }
.ticket-row { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 12px; border-radius: 10px;
              border: 1px solid var(--line); background: var(--panel); color: var(--text); text-decoration: none; }
.ticket-row.unread { border-color: var(--accent); }
.ticket-row .new { color: var(--accent); }
.thread { display: flex; flex-direction: column; gap: 10px; margin: 8px 0 14px; max-width: 720px; }
.msg { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); max-width: 92%; }
.msg.admin { border-color: var(--accent-line); background: var(--accent-bg); align-self: flex-start; }
.msg.user { align-self: flex-end; }
.msg-meta { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.msg-body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.reply { display: grid; gap: 8px; max-width: 720px; }
.reply-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* admin */
body.admin { display: flex; flex-direction: column; min-height: 100vh; }
.admin-bar .top-actions { gap: 12px; align-items: center; }
.admin-main { flex: 1; display: grid; grid-template-columns: minmax(260px, 360px) minmax(0, 1fr); gap: 16px; padding: 16px; max-width: none !important; margin: 0 !important; }
.admin-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.admin-tabs button { min-height: 36px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); cursor: pointer; }
.admin-tabs button[aria-selected="true"] { border-color: var(--accent); color: var(--text); background: var(--accent-bg); }
.admin-ticket { display: grid; gap: 2px; text-align: left; width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
                background: var(--panel); color: var(--text); cursor: pointer; }
.admin-ticket.unread { border-color: var(--accent); }
.admin-ticket.current { background: var(--accent-bg); }
.thread-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.thread-head h2 { margin: 0 0 4px; font-size: 18px; }
@media (max-width: 760px) { .admin-main { grid-template-columns: 1fr; } }

/* logged out + plain pages */
.intro { max-width: 460px; margin: 10vh auto 0; text-align: center; padding: 0 16px; }
.intro h1 { font-size: 24px; }
.intro .btn { margin-top: 16px; min-height: 44px; }
body.page { min-height: 100vh; display: flex; flex-direction: column; }
body.page main { flex: 1; width: 100%; max-width: 960px; margin: 0 auto; padding: 24px 16px; }
footer { padding: 16px; text-align: center; font-size: 11px; color: var(--muted); line-height: 1.5; }
footer a { color: var(--muted); }
.doc { max-width: 720px; margin: 0 auto; line-height: 1.6; font-size: 15px; }
.doc h1 { font-size: 24px; margin: 8px 0 4px; } .doc h2 { font-size: 17px; margin: 28px 0 8px; }
.doc table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 8px 0; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 8px; border-bottom: 1px solid var(--line); }
.doc th { color: var(--muted); font-weight: 600; }

/* ---------- phone ---------- */
@media (max-width: 760px) {
  .menu-btn { display: inline-flex; }
  .brand-text { display: none; }
  .chars-meta { display: none; }
  .chars-btn { padding: 0 6px; }
  .sidenav, body.nav-collapsed .sidenav { position: fixed; top: var(--topbar); left: 0; bottom: 0; height: auto; z-index: 40;
            width: min(280px, 85vw); align-items: stretch; transform: translateX(-100%); transition: transform .15s ease;
            box-shadow: 16px 0 40px var(--shadow); }
  body.nav-collapsed .nav-item { width: 100%; padding: 0 12px; justify-content: flex-start; }
  body.nav-collapsed .nav-item .label, body.nav-collapsed .nav-item .soon { display: inline; }
  body.nav-open .sidenav { transform: none; }
  .collapse-btn { display: none !important; }
  .view { padding: 16px 16px 40px; }
  .flyout { width: 100%; }
  .row { grid-template-columns: 36px minmax(0, 1fr) auto auto; }
}
@media (prefers-reduced-motion: reduce) { .sidenav { transition: none; } }

/* ---------- intel map ---------- */
.map-view [hidden] { display: none !important; }
.view.view-map { padding: 0; display: flex; min-height: 0; height: calc(100vh - var(--topbar)); height: calc(100dvh - var(--topbar)); }
.map-view { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.map-bar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--chrome); flex-wrap: wrap; }
.map-region { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--panel); color: var(--text); font-size: 17px; font-weight: 700; cursor: pointer; }
.map-region .caret { color: var(--muted); font-size: 12px; }
.map-region:hover { border-color: var(--accent); }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; }
.seg button { min-height: 36px; min-width: 46px; padding: 0 10px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-weight: 600; }
.seg button + button { border-left: 1px solid var(--line-2); }
.seg button[aria-pressed="true"] { background: var(--accent-bg); color: var(--accent); }
.map-stats { font-size: 13px; color: var(--text-2); white-space: nowrap; }
.map-stats .red, .map-tip .red, .mp-camp b { color: var(--danger-2); }
.map-spacer { flex: 1; }
.map-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line-2);
  background: transparent; color: var(--text-2); cursor: pointer; }
.map-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.map-btn:hover { color: var(--text); border-color: var(--muted); }
.map-btn.on { color: var(--accent); border-color: var(--accent); }

.map-canvas { position: relative; flex: 1; min-height: 0; overflow: hidden;
  background: radial-gradient(ellipse at 50% 40%, var(--map-glow) 0%, var(--bg) 70%); }
#map-svg { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; user-select: none; --u: 1; }
#map-svg:active { cursor: grabbing; }
#map-g.animate { transition: transform .25s ease; }
.pin { transform-box: view-box; }
#map-live, .kc, .you, .cons { pointer-events: none; }
.map-zoom { position: absolute; right: 12px; bottom: 12px; display: grid; gap: 6px; z-index: 4; }
.map-zoom button { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--overlay-2); color: var(--text-2); font-size: 20px; line-height: 1; cursor: pointer; }
.map-zoom button:hover { color: var(--text); border-color: var(--muted); }
.map-zoom svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* gates */
.gate { stroke: var(--map-gate); stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.gate.cross { stroke: var(--map-gate-2); stroke-dasharray: 4 3; }
.exit-line { stroke: var(--map-gate-2); stroke-width: 1.2; stroke-dasharray: 2 3; vector-effect: non-scaling-stroke; }
.gate.camped, .exit-line.camped { stroke: var(--danger); stroke-width: 3; stroke-dasharray: none; animation: campglow 1.6s ease-in-out infinite; }
.gate.camped.stale, .exit-line.camped.stale { stroke: var(--danger-dim); stroke-width: 2.2; animation: none; }
@keyframes campglow { 50% { stroke-opacity: .45; } }

/* exits to other regions */
.exit { cursor: pointer; }
.exit rect { fill: var(--map-pill); stroke: var(--map-pill-line); stroke-width: 1; }
.exit text { fill: var(--muted); font-size: 11px; font-weight: 600; text-anchor: middle; }
.exit:hover rect, .exit:focus rect { stroke: var(--accent); fill: var(--accent-bg); }
.exit:hover text, .exit:focus text { fill: var(--accent); }
.exit:focus, .sys:focus { outline: none; }

/* constellations */
.cons text { fill: var(--map-cons); font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; text-anchor: middle; }
#map-svg.cons-off .cons { display: none; }

/* systems */
.sys { cursor: pointer; transition: opacity .3s; }
.sys .hit { fill: transparent; }
.sys .dot { stroke: var(--bg); stroke-width: 2; }
.sys .dot.null:not(.sov) { fill: var(--map-null) !important; }
.sys .name { fill: var(--text-2); font-size: 11px; font-weight: 600; text-anchor: middle; paint-order: stroke; stroke: var(--bg); stroke-width: 3px; stroke-linejoin: round; }
.sys .sec { font-size: 9.5px; font-weight: 700; text-anchor: middle; paint-order: stroke; stroke: var(--bg); stroke-width: 3px; opacity: .85; }
.sys.hot .name { fill: var(--strong); }
.sys.far { opacity: .55; }
.sys:hover .dot, .sys:focus-visible .dot { stroke: var(--text); }
.sys:hover .name, .sys:focus-visible .name { fill: var(--strong); }
.sys.sel .dot { stroke: var(--accent); stroke-width: 3; }
.sys.sel .name { fill: var(--accent); }
#map-svg.names-off .sys .name, #map-svg.sec-off .sys .sec { display: none; }

/* live layer */
.pulse { fill: none; stroke: var(--danger-2); stroke-width: 2; transform-box: fill-box; transform-origin: center; animation: pulse 2s ease-out infinite; }
.pulse.late { animation-delay: 1s; }
@keyframes pulse { from { transform: scale(.6); opacity: 1; } to { transform: scale(3.2); opacity: 0; } }
.kc { fill: var(--kc-text); font-size: 11px; font-weight: 800; paint-order: stroke; stroke: var(--kc-halo); stroke-width: 3.5px; stroke-linejoin: round; pointer-events: none; }
.camp { fill: var(--danger); stroke: var(--bg); stroke-width: 1.5; }
.camp.stale { fill: var(--danger-dim); }
.camp-x { fill: #fff; font-size: 10px; font-weight: 900; text-anchor: middle; pointer-events: none; }
.campmark { cursor: pointer; }
.you { pointer-events: none; }
.you-ring { fill: none; stroke: var(--you); stroke-width: 2.5; }
.you image { outline: none; }
.you image.off { opacity: .5; }
.you-more { fill: var(--you); font-size: 10px; font-weight: 800; paint-order: stroke; stroke: var(--bg); stroke-width: 3px; }
@media (prefers-reduced-motion: reduce) { .pulse, .gate.camped, .exit-line.camped { animation: none; } .pulse.late { display: none; } }

/* tooltip */
.map-tip { position: absolute; z-index: 5; max-width: 280px; padding: 8px 10px; border-radius: 10px; background: var(--overlay);
  border: 1px solid var(--line-2); box-shadow: 0 8px 24px var(--shadow); font-size: 13px; line-height: 1.45; pointer-events: none; }
.map-tip .you-line { color: var(--you); }

/* legend */
.map-legend { position: absolute; left: 12px; bottom: 12px; display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 6px 10px; border-radius: 10px;
  background: var(--overlay-2); border: 1px solid var(--line); font-size: 12px; color: var(--muted); pointer-events: none; max-width: calc(100% - 24px); }
.map-legend span { display: inline-flex; align-items: center; gap: 6px; }
.map-legend .lg-src { pointer-events: auto; color: var(--faint); }
.map-legend .lg-src a { color: var(--faint); }
.map-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 50%; }
.lg-heat { background: radial-gradient(var(--danger), rgba(255,122,46,0) 70%); }
.lg-pulse { border: 2px solid var(--danger-2); }
.lg-camp { border-radius: 0 !important; width: 0 !important; height: 0 !important; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 11px solid var(--danger); }
.lg-you { border: 2px solid var(--you); }
.lg-zone { background: radial-gradient(rgba(79,179,255,.45), rgba(79,179,255,0) 70%); }
.map-legend.no-you span:has(.lg-you), .map-legend.no-you span:has(.lg-zone) { display: none; }

.map-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--muted); }

/* system panel */
.map-panel { position: absolute; top: 12px; right: 12px; bottom: 12px; width: min(420px, calc(100% - 24px)); display: flex; flex-direction: column;
  background: var(--overlay); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: 0 12px 32px var(--shadow); z-index: 6; }
.mp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; padding: 12px 8px 10px 14px; border-bottom: 1px solid var(--line); }
.mp-head b { font-size: 17px; }
.mp-body { overflow-y: auto; padding: 8px 10px 12px; display: grid; gap: 8px; align-content: start; }
.mp-body .kill { grid-template-columns: 44px minmax(0, 1fr); }
.mp-body .kill-side { grid-column: 2; text-align: left; }
.mp-camp { padding: 8px 10px; border-radius: 10px; border: 1px solid var(--bad-line); background: var(--bad-bg); font-size: 13px; }

/* region picker */
.map-pop { position: absolute; top: 8px; left: 12px; z-index: 7; width: min(320px, calc(100% - 24px)); max-height: min(70%, 480px); display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 12px 32px var(--shadow); overflow: hidden; }
.map-pop input { margin: 10px; min-height: 40px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--bg); color: var(--text); font: inherit; }
.map-pop ul { list-style: none; margin: 0; padding: 0 6px 8px; overflow-y: auto; }
.map-pop li.hd { padding: 8px 8px 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); }
.map-pop button { width: 100%; display: flex; justify-content: space-between; gap: 8px; min-height: 36px; padding: 0 10px; border: 0; border-radius: 8px;
  background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.map-pop button:hover, .map-pop button:focus-visible { background: var(--accent-bg); outline: none; }
.map-pop button[aria-current="true"] { color: var(--accent); font-weight: 700; }

@media (max-width: 760px) {
  .map-bar { padding: 8px 12px; gap: 8px; }
  .map-btn span { display: none; }
  .map-stats { order: 9; width: 100%; }
  .map-legend { font-size: 11px; }
  .map-legend { right: 64px; }
  .map-panel { top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; max-height: 60%; }
}

/* ---------- intel (beta) ---------- */
.intel-src { display: grid; gap: 12px; margin-bottom: 16px; }
.intel-channels { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; }
.intel-channels .muted { width: 100%; }
.intel-row { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px; padding: 8px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--panel); }
.intel-time { display: grid; gap: 2px; font-variant-numeric: tabular-nums; }
.intel-main { min-width: 0; display: grid; gap: 3px; overflow-wrap: anywhere; }
.ik { display: inline-block; padding: 0 6px; border-radius: 4px; font-size: 11px; font-weight: 700; line-height: 18px; background: var(--line); color: var(--text-2); }
.k-hostiles { border-color: var(--bad-line); }
.k-hostiles .ik { background: var(--bad-bg-2); color: var(--bad-text); }
.k-clear .ik { background: var(--good-bg); color: var(--hi); }
.k-chat { opacity: .7; }

/* ---------- themes ----------
   Colour palettes only. Faction themes use colours inspired by each faction,
   with no CCP logos, emblems, fonts or artwork (those are CCP's). */
html[data-theme="light"], html[data-theme="custom-light"] {
  /* Space by day: cool blue-white panels with the Space blue (deepened so text reads at 4.5:1 or better), no glow. */
  color-scheme: light;
  --bg: #e9edf5; --chrome: #f3f6fb; --panel: #f9fbfe; --panel-2: #eef2f9; --line: #d3dbea; --line-2: #b9c5dc;
  --text: #121a2e; --text-2: #26304a; --muted: #4f5b7a; --faint: #55617f; --accent: #2457c5; --accent-bg: #dde7fb; --accent-fill: #2457c5;
  --hi: #106b39; --low: #8f5200; --null: #d42a1e; --strong: #000; --hover: #e4eaf5; --accent-line: #9fb7e8; --on-accent: #ffffff;
  --bad-bg: #fbe6e1; --bad-bg-2: #f8d8cf; --bad-line: #eab3a4; --bad-text: #8f1d14; --hostile-text: #c62a1c; --friendly-text: #0a5fb4;
  --danger: #e0402a; --danger-2: #d9523e; --danger-dim: #c69283; --good-bg: #e3f2e6; --good-text: #0f5f35; --warn-bg: #fbedd6; --warn-text: #6a4100;
  --overlay: rgba(249, 251, 254, .97); --overlay-2: rgba(249, 251, 254, .92); --shadow: rgba(20, 35, 70, .16);
  --map-gate: #b6c2da; --map-gate-2: #a2b0cc; --map-pill: #f9fbfe; --map-pill-line: #b9c5dc; --map-cons: #8c9abb; --map-null: #6c7896;
  --map-glow: #e6ecf7; --kc-text: #7a1b0c; --kc-halo: #ffffff; --you: #0a7f8c;
  --glow: none; --panel-glow: none; --text-glow: none;
}
html[data-theme="classic"] {
  --glow: none; --panel-glow: none; --text-glow: none; --nav-mark: none;
  --bg: #0b0f14; --chrome: #0e141b; --panel: #121923; --panel-2: #0f151d; --line: #1f2a38; --line-2: #2a3a4d;
  --text: #d7e3f0; --text-2: #c3d2e1; --muted: #9fb3c8; --faint: #8ea3b8; --accent: #4fb3ff; --accent-bg: #12202e;
  --hi: #3fd17a; --low: #e6a23c; --null: #e05555; --strong: #fff; --hover: #18212d; --accent-line: #1f4a6b; --on-accent: #05121f;
  --bad-bg: #2a1416; --bad-bg-2: #3a1610; --bad-line: #5a2a22; --bad-text: #ffc2c2; --hostile-text: #ff9a9a; --friendly-text: #7cc4ff;
  --danger: #ff5a3c; --danger-2: #ff6b57; --danger-dim: #a8503f; --good-bg: #12271b; --good-text: #a6f0c4; --warn-bg: #2a2112; --warn-text: #ffd699;
  --overlay: rgba(14, 20, 27, .96); --overlay-2: rgba(14, 20, 27, .88); --shadow: rgba(0, 0, 0, .5);
  --map-gate: #2f4257; --map-gate-2: #3b4f66; --map-pill: #121b26; --map-pill-line: #33475d; --map-cons: #3f5670; --map-null: #7d93ab;
  --map-glow: #0f1620; --kc-text: #ffd2c7; --kc-halo: #3a0f08; --page-art: none; --you: var(--accent);
}
html[data-theme="space"] {
  --glow: none; --panel-glow: none; --text-glow: none; --nav-mark: none; --you: var(--accent);
  --bg: #060913; --chrome: #0a0f1f; --panel: rgba(17, 24, 46, .86); --panel-2: rgba(12, 18, 36, .86); --line: #1d2747; --line-2: #2a3762;
  --text: #dfe6f7; --text-2: #c9d3ec; --muted: #9eabcd; --faint: #8d9abd; --accent: #8fb6ff; --accent-bg: #151f40; --accent-line: #2c4380;
  --hover: #172042; --on-accent: #08102a; --map-glow: #10173a; --map-gate: #2c3a66; --map-gate-2: #3a4a7c; --map-pill: #111a38; --map-pill-line: #34447a;
  --map-cons: #4a5a8f; --map-null: #8293c4; --overlay: rgba(10, 15, 31, .95); --overlay-2: rgba(10, 15, 31, .88);
  /* A faint starfield (tiled dots at different sizes, so no visible pattern)
     and two soft nebula glows, all drawn with gradients: no images. */
  --page-art:
    radial-gradient(1.6px 1.6px at 20px 30px, rgba(255,255,255,0.75), transparent 100%),
    radial-gradient(1.2px 1.2px at 140px 90px, rgba(200,215,255,0.6), transparent 100%),
    radial-gradient(2px 2px at 80px 210px, rgba(255,255,255,0.7), transparent 100%),
    radial-gradient(1.2px 1.2px at 250px 160px, rgba(255,255,255,0.5), transparent 100%),
    radial-gradient(1.4px 1.4px at 310px 40px, rgba(190,210,255,0.6), transparent 100%),
    radial-gradient(1.8px 1.8px at 57px 121px, rgba(255,240,220,0.55), transparent 100%),
    radial-gradient(1.2px 1.2px at 190px 270px, rgba(255,255,255,0.5), transparent 100%),
    radial-gradient(1.4px 1.4px at 33px 333px, rgba(210,220,255,0.45), transparent 100%),
    radial-gradient(60% 50% at 85% 10%, rgba(88, 60, 170, .16), transparent 70%),
    radial-gradient(55% 45% at 10% 95%, rgba(30, 120, 160, .13), transparent 70%);
  --page-art-size: 233px 233px, 311px 311px, 277px 277px, 389px 389px, 347px 347px, 419px 419px, 457px 457px, 503px 503px, 100% 100%, 100% 100%;
}
html[data-theme="amarr"] {
  --glow: none; --panel-glow: none; --text-glow: none; --nav-mark: none;
  --bg: #110d07; --chrome: #17120a; --panel: #1c160d; --panel-2: #181309; --line: #33291a; --line-2: #4b3c25;
  --text: #f0e7d3; --text-2: #e2d6bd; --muted: #bba98a; --faint: #a8977a; --accent: #d9ad4a; --accent-bg: #2b2210; --accent-line: #6b5420;
  --hover: #251d10; --on-accent: #1a1204; --map-glow: #1d160b; --map-gate: #4a3c24; --map-gate-2: #5c4b2d; --map-pill: #1d170d; --map-pill-line: #5a4728;
  --map-cons: #6e5c3b; --map-null: #a8977a; --you: #74b9e8; --overlay: rgba(23, 18, 10, .96); --overlay-2: rgba(23, 18, 10, .9);
}
html[data-theme="caldari"] {
  --glow: none; --panel-glow: none; --text-glow: none; --nav-mark: none; --you: var(--accent);
  --bg: #0a0e13; --chrome: #0e141a; --panel: #131b23; --panel-2: #10171e; --line: #233140; --line-2: #314357;
  --text: #dfe7ef; --text-2: #cad6e2; --muted: #a0b2c4; --faint: #8fa2b5; --accent: #79aee0; --accent-bg: #142231; --accent-line: #2b4c6c;
  --hover: #1a2531; --on-accent: #07131f; --map-glow: #111a24; --map-gate: #334558; --map-gate-2: #42576d; --map-pill: #131c26; --map-pill-line: #3a4f66;
  --map-cons: #4d6278; --map-null: #8fa2b5;
}
html[data-theme="gallente"] {
  --glow: none; --panel-glow: none; --text-glow: none; --nav-mark: none; --you: var(--accent);
  --bg: #07110f; --chrome: #0a1714; --panel: #0e1c19; --panel-2: #0b1815; --line: #1b302b; --line-2: #28453e;
  --text: #dbefe8; --text-2: #c5e1d8; --muted: #98bbb1; --faint: #87ab9f; --accent: #46c9a8; --accent-bg: #0f2722; --accent-line: #22594c;
  --hover: #13241f; --on-accent: #04140f; --map-glow: #0d1d19; --map-gate: #27443d; --map-gate-2: #33574e; --map-pill: #0f1f1b; --map-pill-line: #2f5249;
  --map-cons: #3f6b60; --map-null: #87ab9f; --overlay: rgba(10, 23, 20, .96); --overlay-2: rgba(10, 23, 20, .9);
}
html[data-theme="minmatar"] {
  --glow: none; --panel-glow: none; --text-glow: none; --nav-mark: none;
  --bg: #120c09; --chrome: #18100c; --panel: #1d1510; --panel-2: #19110d; --line: #36271d; --line-2: #4e392b;
  --text: #ece0d5; --text-2: #ddcdbf; --muted: #b9a594; --faint: #a69282; --accent: #e3a25c; --accent-bg: #2c1c10; --accent-line: #6e4524;
  --hover: #261a13; --on-accent: #1a0d04; --map-glow: #1e1510; --map-gate: #4a3527; --map-gate-2: #5c4332; --map-pill: #1e1611; --map-pill-line: #5a412f;
  --map-cons: #6c5240; --map-null: #a69282; --you: #74b9e8; --overlay: rgba(24, 16, 12, .96); --overlay-2: rgba(24, 16, 12, .9);
}
body { background-color: var(--bg); background-image: var(--page-art); background-size: var(--page-art-size, auto); background-attachment: fixed; }
.theme-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 4px 8px 8px; }
.theme-opt { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 4px 8px; border-radius: 8px; border: 1px solid var(--line);
  background: transparent; color: var(--text); cursor: pointer; text-align: left; font-size: 13px; }
.theme-opt:hover { background: var(--hover); }
/* Space (the default Dark), empire and other themes fill buttons with their own accent (Cockpit and Light set their own fill). */
html[data-theme]:not([data-theme="dark"]):not([data-theme="light"]):not([data-theme^="custom"]) { --accent-fill: var(--accent); }
.theme-opt[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.theme-sw { width: 22px; height: 22px; border-radius: 6px; flex: none; border: 1px solid rgba(128, 128, 128, .35); }
.menu-hd { padding: 8px 12px 2px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); }

/* ---------- help assistant ---------- */
.ask { display: grid; gap: 10px; margin-bottom: 8px; }
.ask-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.ask-thread { display: grid; gap: 8px; max-height: 420px; overflow-y: auto; }
.ask-thread:empty { display: none; }
.ask-q { justify-self: end; max-width: 85%; padding: 8px 12px; border-radius: 12px 12px 4px 12px; background: var(--accent-bg); border: 1px solid var(--accent-line); white-space: pre-wrap; overflow-wrap: anywhere; }
.ask-a { justify-self: start; max-width: 92%; padding: 8px 12px; border-radius: 12px 12px 12px 4px; background: var(--panel-2); border: 1px solid var(--line); overflow-wrap: anywhere; }
.ask-a p { margin: 0 0 6px; } .ask-a p:last-child { margin-bottom: 0; }
.ask-a ul { margin: 4px 0 6px; padding-left: 20px; }
.ask-a.error { border-color: var(--bad-line); color: var(--bad-text); background: var(--bad-bg); }
.ask-form { display: flex; gap: 8px; align-items: flex-end; }
.ask-form textarea { flex: 1; min-height: 44px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--bg); color: var(--text); font: inherit; resize: vertical; }
.ask-note { margin: 0; }
.dots { display: inline-flex; gap: 4px; padding: 4px 0; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .2s; } .dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 50% { opacity: .25; } }

/* Instrument glow (cockpit theme; other themes set these to none). */
.btn:not(.secondary) { box-shadow: var(--glow); }
.card, .kill, .intel-row, .map-panel, .ask { box-shadow: var(--panel-glow); }
.nav-item[aria-current="page"] { box-shadow: var(--panel-glow), var(--nav-mark); }
.nav-item[aria-current="page"] svg, .brand svg, .seg button[aria-pressed="true"], .map-btn.on, .theme-opt[aria-pressed="true"] { filter: drop-shadow(var(--text-glow)); }
.risk-score, .map-region { text-shadow: var(--text-glow); }

/* route scout */
.route-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 18px; box-shadow: var(--panel-glow); }
.route-field { display: flex; flex-direction: column; gap: 6px; flex: 1 1 200px; font-size: 12px; color: var(--muted); }
.route-field input, .route-field select { height: 44px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); font: inherit; font-size: 14px; }
.route-field input:focus { outline: none; border-color: var(--accent); box-shadow: var(--glow); }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.seg button { height: 44px; padding: 0 14px; border: 0; background: transparent; color: var(--text-2); cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line-2); }
.seg button[aria-pressed="true"] { background: var(--accent-bg); color: var(--accent); font-weight: 700; }
.route-avoid { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; flex: 1 1 100%; }
.route-avoid .route-field { flex: 0 1 260px; }
.route-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 44px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 4px 4px 10px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--panel-2); font-size: 13px; }
.chip-x { width: 28px; height: 28px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; font-size: 16px; }
.chip-x:hover { background: var(--hover); color: var(--text); }
.route-grid { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; }
.route-list { flex: 1 1 440px; min-width: 0; padding: 0; overflow: hidden; }
.route-map { flex: 1 1 340px; min-width: 0; display: grid; gap: 10px; }
.route-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: center; padding: 16px; border-bottom: 1px solid var(--line); }
.route-title { font-size: 17px; font-weight: 700; }
.route-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.rpill { padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.rpill.danger { background: var(--bad-bg-2); color: var(--bad-text); }
.rpill.caution { background: var(--warn-bg); color: var(--warn-text); }
.rpill.clear { background: var(--good-bg); color: var(--good-text); }
.route-msg { padding: 10px 16px; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.route-msg.ok { color: var(--good-text); }
.rj, .rj-sub { list-style: none; margin: 0; padding: 0; }
.rj-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.rj-row.lvl-caution { background: var(--warn-bg); }
.rj-row.lvl-danger { background: var(--bad-bg-2); box-shadow: inset 3px 0 0 var(--danger); }
.rj-detail { color: var(--muted); }
.lvl-caution .rj-detail { color: var(--warn-text); }
.lvl-danger .rj-detail { color: var(--bad-text); }
.rj-camp { font-size: 12px; margin-top: 4px; color: var(--text-2); }
.rj-level { font-size: 12px; font-weight: 700; }
.lvl-clear .rj-level { color: var(--good-text); }
.lvl-caution .rj-level { color: var(--warn-text); }
.lvl-danger .rj-level { color: var(--danger-2); }
.rj-quiet { border-bottom: 1px solid var(--line); }
.rj-quiet summary { padding: 12px 16px; cursor: pointer; color: var(--muted); font-size: 13px; }
.rj-quiet .rj-row { padding-left: 28px; }
.route-foot { padding: 12px 16px; }
.route-svg { width: 100%; height: auto; display: block; background: var(--map-glow); border-radius: 8px; }
.route-lbl { font-size: 12px; fill: var(--text); paint-order: stroke; stroke: var(--map-glow); stroke-width: 3px; }

/* Fitting Studio */
.fs-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: flex-start; }
.fs-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.soon-tag { font-size: 11px; font-weight: 600; color: var(--accent); border: 1px solid var(--accent-line); border-radius: 999px; padding: 1px 8px; vertical-align: 4px; }
.fs-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 14px; box-shadow: var(--panel-glow); }
.fs-select { height: 44px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); font: inherit; font-size: 14px; }
.fs-msg { padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel); margin-bottom: 14px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.fs-msg.ok { border-color: var(--hi); color: var(--good-text); }
.fs-msg.error { border-color: var(--null); color: var(--bad-text); }
.fs-link { width: 100%; max-width: 520px; padding: 6px 8px; background: var(--panel-2); color: var(--text); border: 1px solid var(--line-2); border-radius: 6px; }
.fs-grid { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.fs-browser { flex: 1 1 280px; max-width: 360px; min-width: 0; display: grid; gap: 10px; padding: 14px; }
.fs-center { flex: 2 1 460px; min-width: 0; display: grid; gap: 16px; }
.fs-side { flex: 1 1 280px; max-width: 380px; min-width: 0; display: grid; gap: 16px; }
.fs-q { height: 40px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); font: inherit; }
.fs-only { display: flex; gap: 8px; align-items: center; color: var(--text-2); }
.fs-only input { width: 18px; height: 18px; accent-color: var(--accent); }
.fs-mods { list-style: none; margin: 0; padding: 0; max-height: 560px; overflow-y: auto; display: grid; gap: 4px; }
.fs-mod button { width: 100%; text-align: left; display: grid; gap: 2px; padding: 9px 10px; border-radius: 8px; border: 1px solid transparent; background: var(--panel-2); color: var(--text); cursor: pointer; font: inherit; }
.fs-mod button:hover, .fs-mod button:focus-visible { border-color: var(--accent-line); background: var(--hover); }
.fs-mod-top { display: flex; justify-content: space-between; gap: 8px; }
.fs-note { font-size: 11px; font-weight: 700; white-space: nowrap; }
.fs-mod.over .fs-note { color: var(--warn-text); }
.fs-mod.over button { background: var(--warn-bg); }
.fs-mod.noskill button { opacity: .6; }
.fs-mod.noskill .fs-note { color: var(--muted); }
.fs-skill { color: var(--text-2); display: none; }
.fs-mod.noskill button:hover .fs-skill, .fs-mod.noskill button:focus-visible .fs-skill { display: block; }
.fs-summary { display: grid; gap: 14px; box-shadow: var(--panel-glow); }
.fs-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: baseline; }
.fs-ship { font-size: 20px; font-weight: 700; }
.fs-cost { text-align: right; }
.fs-cost b { font-size: 18px; }
.fs-res-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.fs-res-top { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-2); }
.fs-res.over b { color: var(--danger-2); }
.fs-meter { height: 10px; border-radius: 5px; background: var(--line); margin-top: 6px; overflow: hidden; }
.fs-meter > div { height: 100%; background: var(--hi); }
.fs-res.over .fs-meter > div { background: var(--danger); }
.fs-chips { display: flex; flex-wrap: wrap; gap: 8px; font-size: 12px; }
.fs-chips span { padding: 4px 10px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); color: var(--text-2); }
.fs-problems { display: grid; gap: 4px; padding: 10px 12px; border-radius: 8px; background: var(--bad-bg); border: 1px solid var(--bad-line); color: var(--bad-text); font-size: 13px; }
.fs-warn { padding: 8px 12px; border-radius: 8px; background: var(--warn-bg); color: var(--warn-text); }
.fs-layout { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.fs-slots { display: grid; gap: 6px; align-content: start; }
.fs-slot-h { font-size: 12px; color: var(--muted); }
.fs-slot { display: flex; align-items: stretch; border-radius: 6px; background: var(--panel-2); border: 1px solid transparent; }
.fs-slot.empty { background: transparent; border: 1px dashed var(--line-2); }
.fs-slot.sel { border: 1px solid var(--accent); background: var(--accent-bg); box-shadow: var(--glow); }
.fs-slot-btn { flex: 1; min-height: 40px; padding: 8px 10px; text-align: left; background: none; border: 0; color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
.fs-slot.empty .fs-slot-btn { color: var(--faint); }
.fs-slot-btn.static { cursor: default; display: flex; align-items: center; }
.fs-x { width: 36px; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 16px; border-radius: 0 6px 6px 0; }
.fs-x:hover { color: var(--text); background: var(--hover); }
.fs-mif { border-color: var(--accent-line); box-shadow: var(--glow); }
.fs-mif h2, .fs-fly h2, .fs-dlg h2 { margin: 0 0 6px; font-size: 16px; }
.fs-opts { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 10px; }
.fs-opt { display: grid; gap: 6px; padding: 12px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); font-size: 13px; }
.fs-opt.best { border-color: var(--hi); }
.fs-best { font-size: 11px; font-weight: 700; color: var(--good-text); }
.fs-opt-n { display: flex; flex-wrap: wrap; gap: 10px; }
.good { color: var(--good-text); }
.fs-train { margin-top: 10px; color: var(--text-2); }
.fs-miss { margin: 8px 0 0; padding-left: 18px; font-size: 13px; display: grid; gap: 2px; }
.fs-dialog { max-width: 560px; width: calc(100% - 32px); background: var(--panel); color: var(--text); border: 1px solid var(--line-2); border-radius: 12px; padding: 0; }
.fs-dialog::backdrop { background: var(--overlay-2); }
.fs-dlg { display: grid; gap: 10px; padding: 18px; }
.fs-dlg textarea { width: 100%; padding: 10px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); font: 13px/1.4 ui-monospace, monospace; }
.fs-dlg select { height: 36px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); }
.fs-dlg-row { display: flex; gap: 8px; justify-content: flex-end; }
.fs-dlg-sep { height: 1px; background: var(--line); }
.fs-ig ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.fs-slot { align-items: center; }
.fs-slot.off .fs-slot-btn { color: var(--faint); text-decoration: line-through; }
.fs-slot-main { flex: 1; min-width: 0; display: grid; }
.fs-state { flex: none; width: 28px; height: 40px; border: 0; background: none; cursor: pointer; display: grid; place-items: center; }
.fs-state::before { content: ""; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--muted); }
.fs-state.st-active::before { background: var(--hi); border-color: var(--hi); box-shadow: 0 0 6px var(--hi); }
.fs-state.st-online::before { background: transparent; border-color: var(--hi); }
.fs-state.st-offline::before { border-color: var(--faint); }
.fs-ammo { padding: 0 8px 6px 10px; }
.fs-ammo select { width: 100%; height: 30px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--panel); color: var(--text-2); font: inherit; font-size: 12px; }
.fs-add { justify-content: center; min-height: 40px; border: 1px dashed var(--line-2); background: transparent; color: var(--text-2); cursor: pointer; font: inherit; font-size: 13px; }
.fs-add:hover { color: var(--accent); }
.fs-add.sel { border-style: solid; }
.fs-stats { display: grid; gap: 16px; box-shadow: var(--panel-glow); }
.fs-stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.fs-big { display: grid; gap: 2px; padding: 12px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); }
.fs-big span { font-size: 12px; color: var(--muted); }
.fs-big b { font-size: 22px; font-weight: 700; color: var(--strong); text-shadow: var(--text-glow); }
.fs-big small { font-size: 12px; color: var(--muted); }
.fs-big b.good { color: var(--good-text); font-size: 18px; }
.fs-bad { color: var(--danger-2); font-size: 18px; }
.fs-stat-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.fs-stat-cols h3 { margin: 0 0 8px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.fs-wlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 13px; }
.fs-wlist li { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px; }
.fs-wlist li > .small { grid-column: 1 / -1; }
.fs-num { font-weight: 700; white-space: nowrap; }
.fs-warnx { color: var(--warn-text); font-size: 12px; }
.fs-layer { display: grid; gap: 4px; margin-bottom: 10px; }
.fs-layer-top { display: flex; justify-content: space-between; font-size: 13px; }
.fs-resists { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.fs-rbar { position: relative; height: 20px; border-radius: 4px; background: var(--line); overflow: hidden; }
.fs-rbar span { position: absolute; inset: 0 auto 0 0; opacity: .55; }
.fs-rbar em { position: relative; display: block; text-align: center; font-style: normal; font-size: 11px; line-height: 20px; color: var(--strong); font-weight: 600; }
.r-em span { background: #4d9de0; }
.r-thermal span { background: #e0574d; }
.r-kinetic span { background: #9aa3ad; }
.r-explosive span { background: #e0a84d; }
.fs-dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; font-size: 13px; }
.fs-dl dt { color: var(--muted); }
.fs-dl dd { margin: 0; text-align: right; }
.fs-msg[hidden] { display: none; }
.fs-side { flex: 1 1 320px; max-width: 420px; }
.fs-side .fs-stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fs-side .fs-stat-cols { grid-template-columns: 1fr; }

/* Fitting Studio: tabs and advisors */
.fs-tabs { display: flex; gap: 4px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.fs-tabs button { min-height: 44px; padding: 0 16px; border: 0; background: none; color: var(--text-2); font: inherit; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.fs-tabs button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); font-weight: 700; }
.adv-grid { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; margin-bottom: 10px; }
.adv-ammo { flex: 3 1 560px; min-width: 0; display: grid; gap: 12px; box-shadow: var(--panel-glow); }
.adv-drones { flex: 2 1 340px; min-width: 0; display: grid; gap: 12px; }
.adv-ammo h2, .adv-drones h2 { margin: 0; font-size: 16px; }
.adv-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; align-items: center; }
.adv-controls { margin: 0; }
.adv-range input { width: 160px; accent-color: var(--accent); }
.adv-group { display: grid; gap: 10px; padding-top: 6px; }
.adv-group + .adv-group { border-top: 1px solid var(--line); padding-top: 14px; }
.adv-chart { margin: 0; }
.adv-chart svg { width: 100%; height: auto; display: block; }
.adv-grid-l { stroke: var(--line); stroke-width: 1; }
.adv-ax { font-size: 11px; fill: var(--muted); }
.adv-at { stroke: var(--text-2); stroke-width: 1.5; stroke-dasharray: 4 4; }
.adv-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--text-2); margin-top: 4px; }
.adv-legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.adv-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.adv-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 8px; background: var(--panel-2); border: 1px solid transparent; font-size: 13px; }
.adv-list li.best { border-color: var(--hi); background: var(--good-bg); }
.adv-list li.loaded { border-color: var(--accent-line); }
.adv-list li.noskill { opacity: .65; }
.adv-dps { font-weight: 700; white-space: nowrap; }
.adv-load { min-height: 36px; padding: 0 12px; }
.adv-carry { padding: 10px 12px; border-radius: 8px; background: var(--accent-bg); border: 1px solid var(--accent-line); font-size: 13px; }
.adv-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--text-2); font: inherit; cursor: pointer; }
.chip-btn[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-bg); color: var(--accent); font-weight: 700; }
.adv-up { color: var(--text-2); margin-top: 2px; }
.adv-up .link { margin-left: 6px; }

/* Ideas and planned features */
.help-tabs a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; color: var(--text-2); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.help-tabs a[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); font-weight: 700; }
.idea-bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; align-items: center; margin: 20px 0 10px; }
.small-select { height: 36px; font-size: 13px; }
.ideas { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.idea { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: start; padding: 14px; }
.idea-top { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; justify-content: space-between; }
.idea-body { margin: 8px 0 0; color: var(--text-2); white-space: pre-line; font-size: 14px; }
.idea-note { margin-top: 8px; padding: 8px 10px; border-radius: 8px; background: var(--accent-bg); border: 1px solid var(--accent-line); font-size: 13px; }
.vote { display: grid; justify-items: center; gap: 2px; min-width: 48px; min-height: 52px; padding: 6px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text-2); cursor: pointer; font: inherit; }
.vote b { font-size: 15px; }
.vote:hover { border-color: var(--accent-line); }
.vote.on { border-color: var(--accent); background: var(--accent-bg); color: var(--accent); box-shadow: var(--glow); }
.status-tag { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted); white-space: nowrap; }
.status-tag.st-review { color: var(--warn-text); border-color: var(--warn-text); }
.status-tag.st-planned { color: var(--friendly-text); border-color: var(--friendly-text); }
.status-tag.st-building { color: var(--accent); border-color: var(--accent); }
.status-tag.st-shipped { color: var(--good-text); border-color: var(--hi); }
.i-similar { padding: 10px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line-2); }
.i-similar ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.i-similar li { display: flex; gap: 10px; align-items: center; }
.i-similar .vote { min-height: 40px; min-width: 40px; }

/* admin: ideas */
.admin-switch { display: flex; gap: 6px; padding: 12px 16px 0; }
.admin-switch button { min-height: 40px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); cursor: pointer; font: inherit; }
.admin-switch button[aria-pressed="true"] { border-color: var(--accent); color: var(--text); background: var(--accent-bg); }
.admin-ideas { padding: 16px; display: grid; gap: 12px; }
.admin-ideas[hidden], .admin-main[hidden] { display: none; }
.admin-ideas-bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; align-items: center; }
.admin-ideas-actions { display: flex; gap: 8px; }
#idea-out textarea { width: 100%; margin-top: 6px; padding: 10px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); font: 13px/1.4 ui-monospace, monospace; }
.admin-idea { display: grid; gap: 10px; }
.admin-idea.is-hidden { opacity: .6; }
.ai-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: start; }
.ai-votes { display: grid; justify-items: center; font-size: 18px; font-weight: 700; min-width: 52px; padding: 6px; border-radius: 8px; background: var(--panel-2); }
.ai-votes small { font-size: 11px; color: var(--muted); font-weight: 400; }
.ai-text input { width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); font: inherit; font-weight: 600; }
.ai-body { margin: 0; color: var(--text-2); white-space: pre-line; font-size: 14px; }
.ai-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: 13px; color: var(--muted); }
.ai-row select, .ai-row input { height: 36px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); padding: 0 8px; font: inherit; }
.ai-note { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.ai-note textarea { width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); font: inherit; }

/* dev blog */
.admin-posts[hidden] { display: none; }
.post-form textarea#p-body { font: 14px/1.5 ui-monospace, monospace; min-height: 360px; }
.posts { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 22px; }
.post-item h2 { margin: 0 0 4px; font-size: 20px; }
.post-item a { text-decoration: none; }
.post-item a:hover h2 { text-decoration: underline; }
.post-item p { margin: 6px 0 0; color: var(--text-2); }
.blog .lede { color: var(--muted); }
.post h1 { margin-bottom: 4px; }
.post h2 { margin-top: 28px; }
.post p, .post li { line-height: 1.6; }
.post blockquote { margin: 16px 0; padding: 8px 16px; border-left: 3px solid var(--accent); background: var(--panel); color: var(--text-2); }
.post pre { padding: 12px; border-radius: 8px; background: var(--panel); overflow-x: auto; }
.post code { font-family: ui-monospace, monospace; font-size: .92em; }
.post hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0 16px; }
.preview-note { padding: 8px 12px; border-radius: 8px; background: var(--warn-bg); color: var(--warn-text); font-weight: 600; }

/* my fits */
.lib { display: grid; gap: 10px; }
.lib-head { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; }
.lib-head h2 { margin: 0; font-size: 16px; }
.lib-head .fs-q { flex: 0 1 320px; }
.lib-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.lib-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px 10px; border-radius: 8px; background: var(--panel-2); border: 1px solid transparent; }
.lib-row.current { border-color: var(--accent-line); }
.lib-row img { border-radius: 6px; background: var(--line); }
.lib-act { display: flex; gap: 6px; align-items: center; }
.lib-act .btn { min-height: 36px; padding: 0 10px; }
@media (max-width: 600px) { .lib-row { grid-template-columns: 40px minmax(0, 1fr); } .lib-act { grid-column: 1 / -1; } }

/* intel overlay on the map */
.intelmark { cursor: pointer; }
.intel-mark { fill: #8b5cf6; stroke: var(--map-glow); stroke-width: 1.5; }
.intel-mark.clr { fill: var(--hi); }
.intel-mark-t { font-size: 10px; font-weight: 700; fill: #fff; text-anchor: middle; pointer-events: none; }
.lg-intel { background: #8b5cf6; border-radius: 3px !important; }
.map-legend.no-intel .lg-intel-wrap { display: none; }

.fs-state.st-overload::before { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 8px var(--accent); }
.fs-implants { grid-column: 1 / -1; grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); display: grid; min-width: 0; }
.fs-implants .fs-slot { min-width: 0; }
.fs-implants .fs-slot-h { grid-column: 1 / -1; }
.fs-islot { flex: none; width: 24px; text-align: center; font-size: 11px; color: var(--muted); }
.fs-heat-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* daily briefing */
.brief { display: grid; gap: 16px; max-width: 1100px; }
.brief-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: flex-end; }
.brief-top h1 { margin: 0; }
.brief-kicker { margin: 0 0 4px; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }
.brief-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.kpi-bad b { color: var(--hostile-text); }
.kpi-good b { color: var(--good-text); }
.brief-chart { display: grid; gap: 8px; box-shadow: var(--panel-glow); }
.brief-h { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: baseline; }
.brief h2 { margin: 0 0 8px; font-size: 15px; }
.brief-bars { width: 100%; height: 90px; display: block; }
.brief-bars .bar { fill: var(--accent); }
.brief-bars .bar.zero { fill: var(--line-2); }
.brief-axis { display: flex; justify-content: space-between; }
.brief-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.brief-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; }
.brief-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; }
.brief-list li > .small { flex-basis: 100%; }
.brief-n { font-weight: 700; white-space: nowrap; margin-left: auto; }

/* meta research */
.meta { display: grid; gap: 12px; }
.meta-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; align-items: center; }
.meta-head h2 { margin: 0; font-size: 16px; }
.meta-head .feed-controls { margin: 0; }
.meta-sum { display: flex; gap: 12px; align-items: center; }
.meta-sum img { border-radius: 8px; background: var(--line); }
.meta-fits { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.meta-fit { display: grid; gap: 8px; background: var(--panel-2); }
.meta-fit-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: center; }
.meta-share { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.meta-share span { display: block; height: 100%; background: var(--accent); }
.meta-racks { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }

/* AI guide panel */
.guide-btn { color: var(--accent); border-color: var(--accent-line); }
.guide-pop { position: fixed; right: 12px; top: calc(var(--topbar) + 8px); bottom: 12px; width: min(420px, calc(100vw - 24px)); z-index: 40;
  display: flex; flex-direction: column; gap: 10px; padding: 14px; background: var(--panel); border: 1px solid var(--accent-line); border-radius: 14px; box-shadow: 0 12px 40px var(--shadow), var(--glow); }
.guide-pop[hidden] { display: none; }
.guide-head { display: flex; justify-content: space-between; align-items: center; }
.guide-ctx { padding: 6px 10px; border-radius: 8px; background: var(--accent-bg); color: var(--text-2); }
.guide-msgs { flex: 1; overflow-y: auto; display: grid; align-content: start; gap: 10px; padding-right: 4px; }
.guide-msg { padding: 10px 12px; border-radius: 10px; font-size: 14px; line-height: 1.5; }
.guide-msg.user { background: var(--accent-bg); justify-self: end; max-width: 85%; }
.guide-msg.assistant { background: var(--panel-2); }
.guide-msg p { margin: 0 0 6px; } .guide-msg p:last-child { margin: 0; }
.guide-msg ul { margin: 4px 0; padding-left: 18px; }
.guide-prompts { display: flex; flex-wrap: wrap; gap: 6px; }
.guide-prompts .chip-btn { min-height: 36px; font-size: 13px; text-align: left; }
.guide-form { display: flex; gap: 8px; align-items: flex-end; }
.guide-form textarea { flex: 1; padding: 10px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); font: inherit; resize: none; }
.guide-foot { line-height: 1.4; }

.admin-ai[hidden] { display: none; }
.ai-card { display: grid; gap: 10px; max-width: 760px; }
.ai-card h2 { margin: 0; font-size: 18px; }
.ai-budget { display: grid; gap: 6px; padding: 12px; border-radius: 10px; background: var(--panel-2); }
.ai-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ai-list li { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 8px 12px; border-radius: 8px; background: var(--panel-2); }
.ai-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); }
.ai-add select, .ai-add input { height: 40px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); padding: 0 10px; font: inherit; }
.ai-add input { flex: 1 1 220px; }

/* corp comms (Discord) */
.brief-list li > div { flex-basis: 100%; }
.corp .card { margin-bottom: 16px; }
.dc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.dc-list li { display: grid; gap: 4px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.dc-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.dc-text { font-size: 14px; line-height: 1.5; color: var(--text); overflow-wrap: anywhere; }
.dc-text pre { margin: 6px 0; padding: 8px 10px; background: var(--panel-2); border-radius: 6px; font-size: 12px; white-space: pre-wrap; }
.dc-text code { background: var(--panel-2); padding: 0 4px; border-radius: 4px; font-size: 13px; }
.dc-quote { display: inline-block; border-left: 3px solid var(--line-2); padding-left: 8px; color: var(--text-2); }
.dc-time { font-weight: 600; color: var(--accent); }
.op-time b { color: var(--text); }
.linkish { padding: 0; border: 0; background: none; color: var(--accent); cursor: pointer; text-decoration: underline; justify-self: start; }
.corp-row { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.corp-row:first-child { border-top: 0; }
.corp-row img { border-radius: 6px; background: var(--line); }
.corp-main > .small { margin-top: 2px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.btn.danger { color: var(--bad-text); }
.corp-pick { margin-top: 10px; padding: 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--panel-2); }
.corp-chans { list-style: none; margin: 8px 0 12px; padding: 0; display: grid; gap: 6px; max-height: 420px; overflow: auto; }
.corp-chans li { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14px; }
.corp-chans li.corp-cat { margin-top: 8px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.corp-chans select { max-width: 160px; }
.dc-list li > .status-pill, .dc-list li > .status-tag { justify-self: start; }
.dc-tags { display: flex; gap: 6px; }

/* How I fly */
.me-insights { margin: 0 0 14px; padding-left: 18px; display: grid; gap: 4px; font-size: 14px; }
.me-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 8px; }
.me-stats > div { padding: 10px; border-radius: 8px; background: var(--panel-2); display: grid; }
.me-stats b { font-size: 18px; }
.me-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.me-bar { display: grid; grid-template-columns: 80px minmax(0, 1fr) 40px; gap: 8px; align-items: center; font-size: 13px; margin-bottom: 6px; }
.me-hours { display: flex; align-items: flex-end; gap: 2px; height: 42px; }
.me-hours span { flex: 1; background: var(--accent); border-radius: 2px 2px 0 0; opacity: .8; }
.me-compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.me-fit { padding: 10px; border-radius: 8px; background: var(--panel-2); }
@media (max-width: 700px) { .me-stats, .me-grid, .me-compare { grid-template-columns: repeat(2, minmax(0, 1fr)); } .me-grid { grid-template-columns: 1fr; } }
.fs-boost-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 10px 0; }
.fs-boost-grid fieldset { border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 10px; display: grid; gap: 4px; }
.fs-boost-grid legend { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 0 4px; }
.btn.on { border-color: var(--accent); color: var(--accent); }
.fs-boost-line { margin-top: 6px; }
@media (max-width: 600px) { .fs-boost-grid { grid-template-columns: 1fr; } }

/* global range picker */
.range-pick { display: flex; align-items: center; gap: 6px; height: 40px; padding: 0 4px 0 10px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--panel); font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.range-pick select { border: 0; background: transparent; color: var(--text); font: inherit; font-size: 14px; text-transform: none; letter-spacing: 0; font-weight: 600; padding: 4px 2px; cursor: pointer; }
.range-pick select option { background: var(--panel); color: var(--text); }
@media (max-width: 600px) { .range-pick span { display: none; } .range-pick { padding: 0 2px 0 6px; } }
.seg button[aria-checked="true"] { background: var(--accent-bg); color: var(--accent); }
.lib-head h2 { margin-right: auto; }

/* ---------- idea threads (replies) ---------- */
.idea-reply-btn { margin-top: 8px; font-size: 13px; }
.idea-thread { margin-top: 10px; display: grid; gap: 10px; }
.idea-replies { list-style: none; margin: 0; padding: 0 0 0 12px; border-left: 2px solid var(--line-2); display: grid; gap: 10px; }
.idea-reply .idea-body { margin-top: 2px; }
.idea-reply.team { padding: 6px 8px; border-radius: 8px; background: var(--accent-bg); }
.idea-reply-form { display: grid; gap: 6px; }
.idea-reply-form textarea { width: 100%; min-height: 60px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); font: inherit; resize: vertical; }
.idea-reply-form textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.idea-reply-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center; }
.ai-replies { margin-top: 10px; display: grid; gap: 8px; }
.ai-reply-list { list-style: none; margin: 0; padding: 0 0 0 10px; border-left: 2px solid var(--line-2); display: grid; gap: 8px; }
.ai-reply-list li.is-hidden { opacity: .55; }

/* ---------- drones: count and active ---------- */
.fs-drone { flex-wrap: wrap; }
.fs-active { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.fs-active select { height: 30px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); padding: 0 4px; }
.fs-drone-note { padding: 4px 2px; }

/* ---------- activity in neighbouring regions (exit marks) ---------- */
.exit-mark { stroke: var(--map-pill); stroke-width: 2; }
.exit-mark.report { fill: #9b7bff; }
.exit-mark.kills { fill: var(--danger); }
.exit-mark.camp { fill: var(--low); }
.exit-mark-t { fill: #fff; font-size: 10px; font-weight: 800; text-anchor: middle; pointer-events: none; }
.exitmark { cursor: pointer; }
.pop-mark { display: block; font-size: 11px; font-weight: 600; }
.pop-mark.report { color: #b9a2ff; }
.pop-mark.kills { color: var(--danger); }
.pop-mark.camp { color: var(--low); }

/* ---------- camp rules ---------- */
.camp-rules { margin: 0 0 14px; padding: 12px 14px; }
.camp-rules summary { cursor: pointer; font-weight: 600; }
.camp-rules-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; }
.camp-rules-row label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.camp-rules-row select { height: 38px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); padding: 0 8px; }

/* ---------- sidebar groups (Farsight Intel, Fitting Studio, Captain's Quarters) ---------- */
.nav-group { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 8px 12px 2px; }
.nav-sub-h { font-size: 12px; color: var(--faint); padding: 8px 12px 0; }
.nav-item.nav-sub { min-height: 36px; padding-left: 24px; font-size: 13px; color: var(--muted); }
.nav-item.nav-sub svg { width: 16px; height: 16px; }
.nav-item.nav-sub[aria-current="page"] { background: var(--accent-bg); color: var(--text); font-weight: 600; box-shadow: var(--nav-mark); }
body.nav-collapsed .nav-group, body.nav-collapsed .nav-sub-h { display: none; }
body.nav-collapsed .nav-item.nav-sub { padding: 0; min-height: 36px; }

/* ---------- Intel feed ---------- */
.far { max-width: 980px; display: grid; gap: 14px; }
.far-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 10px; }
.far-head h1 { margin-bottom: 4px; }
.far-head .lede { margin: 0; }
.far-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.far-tile { padding: 12px 14px; }
.far-n { font-size: 26px; font-weight: 800; line-height: 1.2; }
.far-n.hostile { color: var(--hostile-text); }
.far-n.camp { color: var(--warn-text); }
.far-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.far-src { color: var(--muted); text-decoration: none; }
.far-src.on { color: var(--good-text); }
.far-src:hover { text-decoration: underline; }
.far-list { padding: 0; overflow: hidden; }
.far-list .empty { margin: 14px; }
.far-row + .far-row { border-top: 1px solid var(--line); }
.far-line { all: unset; box-sizing: border-box; width: 100%; display: grid; grid-template-columns: 52px 74px minmax(0, 1fr) 20px; gap: 10px; align-items: start; padding: 10px 14px; cursor: pointer; }
.far-line:hover { background: var(--hover); }
.far-line:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.far-time { color: var(--muted); font-size: 12px; padding-top: 2px; font-variant-numeric: tabular-nums; }
.far-tag { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding-top: 2px; }
.t-kill { color: var(--text-2); }
.t-alert { color: var(--bad-text); }
.t-report { color: #b9a2ff; }
.t-clear { color: var(--good-text); }
.t-camp { color: var(--warn-text); }
.far-what { color: var(--text-2); overflow-wrap: anywhere; }
.far-what.loss-friendly { color: var(--hostile-text); }
.far-what.loss-hostile { color: var(--good-text); }
.far-more { color: var(--muted); font-weight: 700; text-align: center; }
.far-row.is-report { background: color-mix(in srgb, #8b5cf6 9%, transparent); }
.far-row.is-camp { background: var(--warn-bg); }
.far-row.is-alert { background: var(--bad-bg); }
.far-details { padding: 0 14px 12px 136px; }
.far-details .camp, .far-details .kill, .far-details .near-item { margin: 0; }
@media (max-width: 640px) {
  .far-tiles { gap: 6px; }
  .far-tile { padding: 8px 10px; }
  .far-tile .small:last-child { display: none; }
  .far-n { font-size: 20px; }
  .far-line { grid-template-columns: 44px minmax(0, 1fr) 16px; }
  .far-tag { grid-column: 2; grid-row: 1; }
  .far-body { grid-column: 2; }
  .far-more { grid-column: 3; grid-row: 1; }
  .far-details { padding-left: 14px; }
}
.settings .set-sec { margin-bottom: 18px; padding-top: 22px; border-top: 1px solid var(--line); scroll-margin-top: 12px; }
.settings .set-sec:first-of-type { border-top: 0; padding-top: 4px; }
.set-jump { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 18px; }
.set-jump a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 999px; color: var(--text-2); text-decoration: none; font-size: 13px; }
.set-jump a:hover { border-color: var(--accent); color: var(--accent); }
.set-sub { font-size: 14px; margin: 16px 0 8px; color: var(--text-2); }
.ai-sources { margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.meta-summary { margin: 12px 0; padding: 14px; }
.meta-split { margin: 10px 0; overflow-x: auto; }
.meta-split-t { border-collapse: collapse; font-size: 13px; margin-top: 4px; }
.meta-split-t th, .meta-split-t td { padding: 4px 12px 4px 0; text-align: left; white-space: nowrap; }
.meta-split-t th { color: var(--muted); font-weight: 600; font-size: 12px; }
.meta-say { margin-top: 10px; padding: 10px 12px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line); }
.t-sky { color: #7cc4ff; }
.far-row.is-sky { background: color-mix(in srgb, #4fb3ff 8%, transparent); }
.t-ours { color: #a6f0c4; }
.far-row.is-ours { background: color-mix(in srgb, #3fbf7f 8%, transparent); }
.tag.amber { border-color: #d9a441; color: #e8b85a; }
.ours .ours-corp-h { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.ours .ours-corp-h h2 { margin: 0 0 6px; }
.ours > .check { display: flex; gap: 8px; margin: 0 0 14px; }
.our-hook { padding: 10px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.our-hook.compact { border-top: 0; padding: 0; }
.our-hook-h { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- folding sidebar groups ---------- */
.nav-group-btn { display: flex; align-items: center; justify-content: space-between; width: 100%; border: 0; background: transparent; cursor: pointer;
  font: inherit; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 8px 12px 4px; min-height: 32px; border-radius: 6px; text-align: left; }
.nav-group-btn:hover { color: var(--text-2); background: var(--hover); }
.nav-group-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.nav-caret { display: inline-flex; transition: transform .15s; }
.nav-grp.closed .nav-caret { transform: rotate(-90deg); }
.nav-grp-items { display: flex; flex-direction: column; gap: 4px; }
.nav-grp { display: flex; flex-direction: column; gap: 4px; }
/* Folded: hide the group's items (Intel feed sits outside them, so it always shows). */
.nav-grp.closed .nav-grp-items { display: none; }
/* Icon-only sidebar: groups don't fold, every icon shows. */
body.nav-collapsed .nav-group-btn { display: none; }
body.nav-collapsed .nav-grp.closed .nav-grp-items { display: flex; }
body.nav-collapsed .nav-grp.closed .nav-grp-items > .nav-sub-h { display: none; }
.fs-mod-h { list-style: none; padding: 8px 4px 2px; color: var(--muted); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; font-size: 11px; }
.fs-note.sug { color: var(--good-text); background: var(--good-bg); }

/* ---------- skyhooks on the map ---------- */
.sky-mark { fill: #4fb3ff; stroke: var(--map-glow); stroke-width: 1.5; }
.sky-mark.soon { fill: transparent; stroke: #4fb3ff; stroke-width: 2; }
.sky-mark.hot { fill: var(--danger); }
.sky-ring { fill: none; stroke: #4fb3ff; stroke-width: 1; opacity: .5; }
.sky-ring.soon { stroke-dasharray: 2 2; }
.skymark { cursor: default; }
.lg-sky { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #4fb3ff; margin-right: 5px; vertical-align: middle; }
.exit-mark.sky { fill: #4fb3ff; }
.far-row.is-hot { background: color-mix(in srgb, var(--danger) 10%, transparent); }

/* ---------- Fitting Studio layout v2: fit on the left, stats pinned on the right (like Pyfa), picker floats by the slot ---------- */
.fs-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); gap: 16px; align-items: start; }
.fs-center { min-width: 0; }
.fs-side { position: sticky; top: 72px; max-width: none; max-height: calc(100vh - 88px); overflow-y: auto; overscroll-behavior: contain; display: grid; gap: 16px; }
@media (max-width: 1000px) {
  .fs-grid { grid-template-columns: minmax(0, 1fr); }
  .fs-side { position: static; max-height: none; overflow: visible; }
}
.fs-layout { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px 18px; }
.fs-slots { gap: 4px; }
.fs-layout .fs-slot { padding: 0; min-height: 0; }
.fs-pop > * { flex-shrink: 0; }
.fs-pop > .fs-mods { flex-shrink: 1; }
.fs-slot-btn { min-height: 32px; padding: 5px 10px; }
.fs-slot .fs-x { min-height: 32px; }
.fs-pop { position: absolute; z-index: 60; max-height: min(70vh, 640px); display: flex; flex-direction: column; gap: 8px; padding: 14px; margin: 0;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .55); border: 1px solid var(--accent); }
.fs-pop[hidden] { display: none; }
.fs-pop .fs-mods { max-height: none; flex: 1; min-height: 0; }
.fs-pop-x { position: absolute; top: 6px; right: 8px; width: 32px; height: 32px; border: 0; border-radius: 6px; background: none; color: var(--muted); font-size: 20px; cursor: pointer; }
.fs-pop-x:hover { color: var(--text); background: var(--panel-2); }
.fs-pop > label:first-of-type { padding-right: 34px; }
.fs-actions[hidden], .fs-bar[hidden] { display: none; }

/* Custom theme picker (account menu) */
.theme-custom { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; padding: 4px 8px 10px; }
.theme-custom label { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); }
.theme-custom input[type="color"] { width: 36px; height: 30px; padding: 0; border: 1px solid var(--line-2); border-radius: 6px; background: none; cursor: pointer; }
.theme-custom .small { grid-column: 1 / -1; }
.far-src-btn { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.fs-enemy { padding: 14px; display: grid; gap: 8px; }
.fs-enemy-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.fs-enemy h3 { margin: 0; font-size: 15px; }
.fs-enemy p { margin: 0; }
.fs-enemy .fs-stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fs-enemy-sug { display: grid; gap: 6px; margin-bottom: 4px; }
#fs-enemy-wrap[hidden] { display: none; }
.fs-bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.fs-bar .route-field { min-width: 0; }
.fs-train-h { margin: 12px 0 2px; font-size: 13px; }
.fs-train-next { margin: 6px 0 0; padding-left: 20px; display: grid; gap: 6px; font-size: 13px; }
.copy-dlg { max-width: 640px; }
.copy-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.copy-cols fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin: 0; display: grid; gap: 4px; align-content: start; }
.copy-list { max-height: 280px; overflow-y: auto; display: grid; gap: 4px; }
.usage-t { width: 100%; border-collapse: collapse; font-size: 13px; }
.usage-t th, .usage-t td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--line); }
.usage-t th { color: var(--muted); font-weight: 600; font-size: 12px; }
.usage-hot td { color: var(--warn-text); }
.fs-mining { padding: 14px; display: grid; gap: 8px; }
.fs-mining .fs-stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fs-mine-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.fs-mine-list li { display: flex; gap: 8px; justify-content: space-between; }
.fs-boost-pick { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.fs-boost-pick select { height: 32px; border-radius: 6px; background: var(--panel-2); color: var(--text); border: 1px solid var(--line-2); padding: 0 6px; }
.fs-mine-list .fs-num { white-space: nowrap; }
#fs-ore { height: 30px; border-radius: 6px; background: var(--panel-2); color: var(--text); border: 1px solid var(--line-2); }
/* Content finder (map) */
.map-cards { position: absolute; top: 12px; left: 12px; width: min(330px, calc(100% - 24px)); max-height: calc(100% - 70px); overflow-y: auto; display: grid; gap: 8px; z-index: 5; pointer-events: none; }
.map-cf { padding: 12px 14px; background: var(--overlay); pointer-events: auto; }
.map-cf[hidden] { display: none; }
.map-cf h3 { margin: 0; font-size: 15px; }
.map-cf h4 { margin: 10px 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.cf-head { display: flex; justify-content: space-between; align-items: center; }
.cf-list, .cf-loop { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 13px; }
.cf-list { list-style: none; padding: 0; }
.cf-roam { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cf-roam select { height: 32px; border-radius: 6px; background: var(--panel-2); color: var(--text); border: 1px solid var(--line-2); }
.cf-hot { fill: rgba(255, 196, 61, .16); stroke: #ffc43d; stroke-width: 2; stroke-dasharray: 3 3; }
.cf-hot.now { fill: rgba(255, 196, 61, .28); stroke-dasharray: none; }
.cf-hot.earlier { fill: none; stroke: rgba(255, 196, 61, .5); stroke-width: 1.5; }
.cf-danger { fill: rgba(255, 44, 44, .18); stroke: var(--danger); stroke-width: 2.5; }
@media (max-width: 700px) { .map-cards { top: auto; bottom: 8px; left: 8px; right: 8px; width: auto; max-height: 55%; } }
.route-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.jump-sum { padding: 14px; margin-bottom: 12px; }
.jump-sum .fs-stat-row { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.jump-legs { list-style: none; margin: 0; padding: 12px 14px; display: grid; gap: 10px; counter-reset: leg; }
.jump-legs li { border-left: 2px solid var(--accent-line); padding-left: 12px; }
.jump-legs .jump-start { border-left-color: var(--you); }
#jump-form select { height: 40px; border-radius: 8px; background: var(--panel-2); color: var(--text); border: 1px solid var(--line-2); padding: 0 8px; }
.bridge-card { margin-top: 16px; padding: 14px; }
.bridge-card h2 { margin: 0 0 6px; font-size: 16px; }
.bridge-corp { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); }
.map-me-char { height: 40px; border-radius: 10px; background: var(--panel); color: var(--text); border: 1px solid var(--line); padding: 0 8px; max-width: 160px; }
.prof-row { display: grid; grid-template-columns: 110px repeat(4, minmax(0, 1fr)); gap: 6px; align-items: center; margin: 8px 0; }
.prof-row input { width: 58px; height: 32px; border-radius: 6px; background: var(--panel-2); color: var(--text); border: 1px solid var(--line-2); padding: 0 6px; }
@media (max-width: 600px) { .prof-row { grid-template-columns: 1fr 1fr; } }
.fs-proj-h { margin: 10px 0 4px; font-size: 13px; color: var(--muted); }
.fs-proj-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 3px 0; font-size: 13px; }
.fs-proj-row input { width: 64px; height: 32px; border-radius: 6px; background: var(--panel-2); color: var(--text); border: 1px solid var(--line-2); padding: 0 6px; }
.fs-graph-dlg { max-width: 640px; }
.fs-chart { width: 100%; height: auto; display: block; }
.fs-chart .gl { stroke: var(--line); stroke-width: 1; }
.fs-chart .tl { fill: var(--muted); font-size: 11px; }
.fs-chart-key { display: flex; gap: 14px; margin-top: 4px; }
.fs-chart-key i { display: inline-block; width: 12px; height: 3px; margin-right: 6px; vertical-align: middle; }
.sov-tk { font-size: 9px; text-anchor: middle; font-weight: 700; paint-order: stroke; stroke: var(--bg); stroke-width: 2.5px; stroke-linejoin: round; }
.sov-sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin: 0 6px 0 2px; vertical-align: -1px; }
.sov-tk.tone-friendly { fill: #4fb3ff; } .sov-tk.tone-hostile { fill: var(--danger); } .sov-tk.tone-neutral { fill: var(--muted); }
.sov-timer { fill: var(--panel); stroke: #ffc43d; stroke-width: 1.5; }
.sov-timer.live { stroke: var(--danger); }
.sov-timer-t { font-size: 8px; text-anchor: middle; }
/* New Eden overview */
.uni-canvas #uni-svg { width: 100%; height: 100%; }
.uni-dot { fill: var(--faint); opacity: .45; }
.uni-kill { fill: rgba(255, 77, 61, .35); stroke: var(--danger); stroke-width: .2; }
.uni-npc { fill: rgba(255, 196, 61, .18); }
.uni-you { fill: none; stroke: var(--you); stroke-width: .35; }
.uni-name { font-size: 2.1px; fill: var(--text); text-anchor: middle; font-weight: 600; paint-order: stroke; stroke: var(--bg); stroke-width: .45px; stroke-linejoin: round; }
.uni-reg.mine .uni-name { fill: var(--you); }
.uni-n { font-size: 1.6px; fill: var(--muted); text-anchor: middle; paint-order: stroke; stroke: var(--bg); stroke-width: .4px; stroke-linejoin: round; }
.uni-reg { cursor: pointer; }
.uni-reg:hover .uni-name { fill: var(--accent); }
.lg-npc { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 196, 61, .6); }
.assets .feed-controls { margin-bottom: 12px; }
.as-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-bottom: 16px; }
.as-char { padding: 12px 14px; display: grid; gap: 6px; }
.as-char h3 { margin: 0; font-size: 15px; }
.as-list { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 6px; font-size: 13px; }
.as-place { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin-bottom: 8px; background: var(--panel); }
.as-place summary { cursor: pointer; }
.as-place table { margin-top: 8px; }
.as-need { padding: 10px 12px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 6px; }
.wl-bal { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.wl-in { color: var(--good-text, #6fd49a); font-variant-numeric: tabular-nums; }
.wl-out { color: var(--text-2); font-variant-numeric: tabular-nums; }
.wl-kinds td:nth-child(n+2) { text-align: right; white-space: nowrap; }
.wl-total { margin: 0 0 10px; }
.forge > .check { display: flex; gap: 8px; margin: 0 0 12px; }
.forge-col { padding: 12px 14px; display: grid; gap: 6px; }
.forge-col h3 { margin: 0; font-size: 15px; }
.forge-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
