/* App styles. Shared by the app shell and the plain pages (privacy, messages). */
:root {
  /* Default "cockpit" theme: warm near-black panels with a burnt-orange instrument glow. */
  --bg: #0c0806; --chrome: #110b08; --panel: #17100b; --panel-2: #130d09; --line: #2e1f15; --line-2: #46301f;
  --text: #f1e2d0; --text-2: #e3ccb3; --muted: #bf9f80; --faint: #ad8e71; --accent: #ff8a3d; --accent-bg: #2a170b;
  --hi: #3fd17a; --low: #e6a23c; --null: #e05555; --strong: #fff; --hover: #21160e; --accent-line: #6e3818; --on-accent: #1a0b03;
  --bad-bg: #2a1210; --bad-bg-2: #3a150e; --bad-line: #5e2a1e; --bad-text: #ffc6b8; --hostile-text: #ff9a8a; --friendly-text: #7cc4ff;
  --danger: #ff4a3c; --danger-2: #ff6050; --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, 128, 48, .28); --panel-glow: inset 0 0 26px rgba(255, 110, 40, .05); --text-glow: 0 0 8px rgba(255, 138, 61, .35); --nav-mark: inset 3px 0 0 var(--accent);
  --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); 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: 8px; font-weight: 700; font-size: 16px; letter-spacing: .02em; color: var(--text); text-decoration: none; }
.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 { 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"] {
  /* Cockpit by day: warm cream panels, burnt-orange accents, no glow. */
  color-scheme: light;
  --bg: #efe6da; --chrome: #f8f2ea; --panel: #fbf7f1; --panel-2: #f4ece2; --line: #e0d2c1; --line-2: #ccb8a2;
  --text: #24160c; --text-2: #3a2617; --muted: #6a5140; --faint: #6b5242; --accent: #a8450f; --accent-bg: #f6e2d2;
  --hi: #106b39; --low: #8f5200; --null: #b8281f; --strong: #000; --hover: #f1e6d8; --accent-line: #e0ad8b; --on-accent: #ffffff;
  --bad-bg: #fbe6e1; --bad-bg-2: #f8d8cf; --bad-line: #eab3a4; --bad-text: #8f1d14; --hostile-text: #b0261c; --friendly-text: #0a5fb4;
  --danger: #d8402a; --danger-2: #d9523e; --danger-dim: #c69283; --good-bg: #e3f2e6; --good-text: #0f5f35; --warn-bg: #fbedd6; --warn-text: #6a4100;
  --overlay: rgba(251, 247, 241, .97); --overlay-2: rgba(251, 247, 241, .92); --shadow: rgba(60, 35, 15, .18);
  --map-gate: #cbb59d; --map-gate-2: #b9a088; --map-pill: #fbf7f1; --map-pill-line: #ccb8a2; --map-cons: #a88a70; --map-null: #8a7360;
  --map-glow: #f3e9dc; --kc-text: #7a1b0c; --kc-halo: #fff8f0; --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); }
.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); }
