/* RONA — interface styles. Tokens first; components after. */
/* Palette: neutral graphite structure with green as the accent. Red appears only as a warning colour
   (losses, critical fuel, hostiles), so it always means danger. */
/* Fonts (bundled, SIL Open Font License; see static/rona/fonts): Rajdhani for headings and numbers,
   Chakra Petch for text. Both angular and sharp-cornered. */
@font-face { font-family: "Rajdhani"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("fonts/rajdhani-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Rajdhani"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("fonts/rajdhani-latin-ext-500-normal.woff2") format("woff2"); unicode-range: U+0100-02AF,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1E00-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Rajdhani"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("fonts/rajdhani-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Rajdhani"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("fonts/rajdhani-latin-ext-600-normal.woff2") format("woff2"); unicode-range: U+0100-02AF,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1E00-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Rajdhani"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("fonts/rajdhani-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Rajdhani"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("fonts/rajdhani-latin-ext-700-normal.woff2") format("woff2"); unicode-range: U+0100-02AF,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1E00-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Chakra Petch"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/chakra-petch-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Chakra Petch"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/chakra-petch-latin-ext-400-normal.woff2") format("woff2"); unicode-range: U+0100-02AF,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1E00-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Chakra Petch"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("fonts/chakra-petch-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Chakra Petch"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("fonts/chakra-petch-latin-ext-500-normal.woff2") format("woff2"); unicode-range: U+0100-02AF,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1E00-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Chakra Petch"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("fonts/chakra-petch-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Chakra Petch"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("fonts/chakra-petch-latin-ext-600-normal.woff2") format("woff2"); unicode-range: U+0100-02AF,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1E00-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF; }

:root {
  --hull: #0F1113;
  --plate: #171A1D;
  --plate-2: #1F2327;
  --seam: #30363C;
  --signal: #E9EDF0;
  --dim: #9DA7B0;
  --trig: #2E8F60;          /* structure accent: lattice, panel notches, rails */
  --fuel: #45E08F;          /* highlight: actions, active items, healthy fuel, values */
  --fuel-ink: #071A10;
  --ice: #45E08F;
  --hostile: #FF5A4F;       /* danger: reinforced, critical, losses */
  --caution: #F2B84B;
  --focus: #A6F7CB;
  --lattice: rgba(140, 160, 175, .07);
  --glow: rgba(69, 224, 143, .07);
  --mk-fur: #8C969E; --mk-ink: #0F1113; --mk-snout: #EEF1F3; --mk-eye: var(--fuel);
  /* chart series: categorical palette, dark steps (validated on --plate, adjacent pairs) */
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
  --radius-s: 1px;
  --radius-m: 2px;
  --rail: 236px;
  --font-body: "Chakra Petch", "Segoe UI", system-ui, sans-serif;
  --font-head: "Rajdhani", "Chakra Petch", "Segoe UI", system-ui, sans-serif;
  color-scheme: dark;
}
/* Three themes, picked in the sidebar (stored per browser in a cookie; the server stamps data-theme on <html>
   so there's no flash). Dark is the default above. With no choice made, the OS light/dark setting decides. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
  --hull: #EEF1F3; --plate: #FFFFFF; --plate-2: #F5F7F8; --seam: #D3DAE0;
  --signal: #151A1E; --dim: #56616B; --trig: #2C8A5D; --fuel: #13834F; --fuel-ink: #FFFFFF;
  --ice: #13834F; --hostile: #C42B2B; --caution: #946400; --focus: #0E6B40;
  --lattice: rgba(60, 80, 95, .06); --glow: rgba(19, 131, 79, .05);
  --mk-fur: #6B757D; --mk-ink: #151A1E; --mk-snout: #FFFFFF;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --s7: #6250d6; --s8: #e34948;
  color-scheme: light;
  }
}
:root[data-theme="light"] {
  --hull: #EEF1F3; --plate: #FFFFFF; --plate-2: #F5F7F8; --seam: #D3DAE0;
  --signal: #151A1E; --dim: #56616B; --trig: #2C8A5D; --fuel: #13834F; --fuel-ink: #FFFFFF;
  --ice: #13834F; --hostile: #C42B2B; --caution: #946400; --focus: #0E6B40;
  --lattice: rgba(60, 80, 95, .06); --glow: rgba(19, 131, 79, .05);
  --mk-fur: #6B757D; --mk-ink: #151A1E; --mk-snout: #FFFFFF;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --s7: #6250d6; --s8: #e34948;
  color-scheme: light;
}
/* Medium: slate grey, softer than dark for long sessions (text 11.3:1, secondary 7.1:1). */
:root[data-theme="medium"] {
  --hull: #262A2E; --plate: #2F3439; --plate-2: #383E44; --seam: #535C64;
  --signal: #F0F3F5; --dim: #BCC4CB; --trig: #46A878; --fuel: #5FE6A2; --fuel-ink: #071A10;
  --ice: #5FE6A2; --hostile: #FF7A70; --caution: #F6C66A; --focus: #B5F8D6;
  --lattice: rgba(170, 185, 195, .06); --glow: rgba(95, 230, 162, .06);
  --mk-fur: #A3ACB3; --mk-ink: #262A2E; --mk-snout: #F0F3F5;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--signal);
  background-color: var(--hull);
  background-image:
    radial-gradient(ellipse 80% 60% at 85% -10%, var(--glow), transparent 70%),
    linear-gradient(60deg, transparent 49.4%, var(--lattice) 49.6% 50.4%, transparent 50.6%),
    linear-gradient(-60deg, transparent 49.4%, var(--lattice) 49.6% 50.4%, transparent 50.6%),
    linear-gradient(0deg, transparent 49.2%, var(--lattice) 49.4% 50.6%, transparent 50.8%);
  background-size: 100% 100%, 48px 83.14px, 48px 83.14px, 48px 41.57px;
  background-attachment: fixed;
  font: 400 15px/1.55 var(--font-body); font-variant-numeric: tabular-nums;
}
a { color: inherit; text-decoration-color: color-mix(in srgb, var(--fuel) 60%, transparent); text-underline-offset: 3px; }
a:hover { color: var(--fuel); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--font-head); font-weight: 700; line-height: 1.1; margin: 0 0 .5rem; letter-spacing: .02em; }
h1 { font-size: 2.3rem; }
h2 { font-size: 1.3rem; text-transform: uppercase; letter-spacing: .07em; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 .75rem; max-width: 72ch; }
small, .dim { color: var(--dim); }
.num { font-family: var(--font-head); font-weight: 600; font-variant-numeric: tabular-nums; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---- shell ------------------------------------------------------------------------- */
.shell { display: grid; grid-template-columns: var(--rail) 1fr; min-height: 100vh;
  background: linear-gradient(to right, var(--plate) calc(var(--rail) - 1px), var(--seam) calc(var(--rail) - 1px) var(--rail), transparent var(--rail)); }
.rail {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  background: var(--plate); border-right: 1px solid var(--seam); padding: 18px 12px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; text-decoration: none; }
.brand-mark { width: 28px; height: 28px; flex: none; }
.brand-name { font: 700 1.45rem/1 var(--font-head); letter-spacing: .14em; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-s);
  color: var(--dim); text-decoration: none; font-weight: 500;
}
.nav a:hover { background: var(--plate-2); color: var(--signal); }
.nav a[aria-current="page"] { background: var(--plate-2); color: var(--signal); box-shadow: inset 3px 0 0 var(--fuel); }
.nav svg { width: 18px; height: 18px; flex: none; }
.rail-foot { margin-top: auto; border-top: 1px solid var(--seam); padding-top: 14px; flex: none; }
/* a long menu scrolls on its own, so the pilot, links and theme switch at the bottom are always on screen */
.rail > .nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: thin; margin-bottom: 10px; }
.rail > .brand, .rail > .clock { flex: none; }
.pilot { display: flex; gap: 10px; align-items: center; padding: 0 6px; }
.pilot img { width: 40px; height: 40px; border-radius: var(--radius-s); }
.pilot-name { font-weight: 600; line-height: 1.2; }
.pilot-meta { font-size: .8rem; color: var(--dim); line-height: 1.3; }
.rail-links { display: flex; gap: 12px; padding: 10px 6px 0; font-size: .85rem; }
.rail-links button { background: none; border: 0; padding: 0; color: var(--dim); font: inherit; cursor: pointer; }
.rail-links a, .rail-links button { color: var(--dim); }
.badge { display: inline-block; min-width: 1.4em; padding: 0 .4em; border-radius: 999px; background: var(--fuel);
  color: var(--fuel-ink); font: 700 .75rem/1.4 var(--font-head); text-align: center; }

.topbar { display: none; }
main { padding: 28px clamp(16px, 3vw, 40px) 48px; min-width: 0; }
.page { max-width: 1240px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: 22px; }
.page-head p { margin: 4px 0 0; color: var(--dim); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.ccp { margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--seam); font-size: .78rem; color: var(--dim); max-width: 90ch; }
.ccp p { margin: 0 0 .3rem; max-width: none; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; background: none; }
  .rail { display: none; }
  .topbar { display: block; background: var(--plate); border-bottom: 1px solid var(--seam); position: sticky; top: 0; z-index: 5; }
  .topbar summary { list-style: none; display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; cursor: pointer; }
  .topbar summary::-webkit-details-marker { display: none; }
  .topbar .nav { padding: 0 10px 12px; }
  main { padding: 20px 16px 40px; }
  h1 { font-size: 1.6rem; }
}

/* ---- surfaces ---------------------------------------------------------------------- */
.panel { background: var(--plate); border: 1px solid var(--seam); border-radius: var(--radius-m); padding: 18px 20px; position: relative; }
.panel::before { content: ""; position: absolute; top: -1px; left: -1px; width: 14px; height: 14px;
  background: linear-gradient(135deg, var(--trig) 50%, transparent 50%); border-top-left-radius: var(--radius-m); opacity: .95; pointer-events: none; }
.panel + .panel { margin-top: 16px; }
.grid > .panel + .panel { margin-top: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.panel-head h2, .panel-head h3 { margin: 0; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.stack > * + * { margin-top: 16px; }
.empty { padding: 28px 8px; text-align: center; color: var(--dim); }
.empty strong { display: block; color: var(--signal); font-family: var(--font-head); font-size: 1.1rem; margin-bottom: 4px; }

/* readouts: a quiet row of figures, not cards */
.readouts { display: flex; flex-wrap: wrap; gap: 8px 36px; margin: 0 0 20px; padding: 0; list-style: none; }
.readouts li { display: flex; flex-direction: column; }
.readouts .num { font-size: 1.6rem; line-height: 1.1; }
.readouts small { font-size: .82rem; }

/* ---- tables ------------------------------------------------------------------------ */
.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--seam); vertical-align: middle; }
th { font: 700 .8rem/1.2 var(--font-head); color: var(--dim); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
tbody tr:hover { background: color-mix(in srgb, var(--plate-2) 70%, transparent); }
td.r, th.r { text-align: right; }
tr.sub td { border-bottom-style: dashed; font-size: .92rem; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who img { width: 32px; height: 32px; border-radius: var(--radius-s); flex: none; }
.who b { font-weight: 600; display: block; line-height: 1.2; }
.who small { display: block; line-height: 1.25; }

/* ---- controls ---------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: var(--radius-s);
  border: 1px solid var(--seam); background: var(--plate-2); color: var(--signal); font: 600 .92rem/1.2 var(--font-body);
  text-decoration: none; cursor: pointer;
}
.btn:hover { border-color: var(--fuel); color: var(--signal); }
.btn-primary { background: var(--fuel); border-color: var(--fuel); color: var(--fuel-ink); }
.btn-primary:hover { filter: brightness(1.08); color: var(--fuel-ink); }
.btn-danger { border-color: color-mix(in srgb, var(--hostile) 60%, var(--seam)); color: var(--hostile); }
.btn-small { padding: 4px 10px; font-size: .84rem; }
.btn-quiet { background: none; border-color: transparent; color: var(--dim); }
form.inline { display: inline; }
label { display: block; font-weight: 600; margin-bottom: 4px; }
input[type=text], input[type=url], input[type=number], input[type=search], input[type=datetime-local], select, textarea {
  width: 100%; padding: 8px 10px; border-radius: var(--radius-s); border: 1px solid var(--seam);
  background: var(--hull); color: var(--signal); font: inherit;
}
textarea { font: .9rem/1.5 ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.field { margin-bottom: 14px; }
.field .help { font-size: .84rem; color: var(--dim); margin-top: 4px; }
.errorlist { list-style: none; padding: 0; margin: 4px 0 0; color: var(--hostile); font-size: .9rem; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.filters input[type=search] { max-width: 280px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--radius-s); border: 1px solid var(--seam);
  font-size: .86rem; text-decoration: none; color: var(--dim); }
.chip[aria-current="true"] { border-color: var(--fuel); color: var(--signal); }
.chip .num { color: var(--signal); }
.chip-btn { border: 0; background: none; padding: 0 2px; cursor: pointer; color: inherit; font: inherit; line-height: 1; opacity: .75; }
.chip-btn:hover, .chip-btn:focus-visible { opacity: 1; color: var(--signal); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { margin-top: 4px; }

/* ---- status language --------------------------------------------------------------- */
.tag { display: inline-block; padding: 1px 8px; border-radius: var(--radius-s); font: 600 .78rem/1.5 var(--font-head);
  border: 1px solid currentColor; white-space: nowrap; }
.tag-ok { color: var(--ice); }
.tag-low, .tag-pending, .tag-stale { color: var(--caution); }
.tag-critical, .tag-empty, .tag-rejected, .tag-hostile, .tag-never { color: var(--hostile); }
.tag-approved, .tag-ready, .tag-fresh { color: var(--ice); }
.tag-paid, .tag-unfueled, .tag-unknown, .tag-closed { color: var(--dim); }
.flag { color: var(--caution); font-size: .88rem; }
.flag::before { content: "▲ "; font-size: .7em; vertical-align: 1px; }

.messages { list-style: none; padding: 0; margin: 0 0 18px; }
.messages li { padding: 10px 14px; border-radius: var(--radius-s); border-left: 3px solid var(--ice); background: var(--plate); margin-bottom: 6px; }
.messages .error { border-left-color: var(--hostile); }
.messages .warning { border-left-color: var(--caution); }

/* ---- the fuel gauge: 30 day-cells --------------------------------------------------- */
.gauge { display: grid; grid-template-columns: repeat(30, 1fr); gap: 2px; height: 14px; min-width: 150px; }
.gauge i { background: color-mix(in srgb, var(--seam) 75%, transparent); border-radius: 1px; }
.gauge i.on { background: var(--g, var(--ice)); }
.gauge.s-low { --g: var(--caution); }
.gauge.s-critical, .gauge.s-empty { --g: var(--hostile); }
.gauge.s-critical i.edge { animation: pulse 1.6s ease-in-out infinite; }
.fuel { display: flex; align-items: center; gap: 12px; }
.fuel .days { font: 600 1.05rem/1 var(--font-head); min-width: 5.2ch; text-align: right; }
.fuel .days small { font-size: .72rem; font-weight: 500; }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .gauge i.edge { animation: none !important; } }

/* chunk progress reuses the same cell language, 20 cells */
.chunk { display: grid; grid-template-columns: repeat(20, 1fr); gap: 2px; height: 10px; }
.chunk i { background: color-mix(in srgb, var(--seam) 75%, transparent); border-radius: 1px; }
.chunk i.on { background: var(--fuel); }
.chunk.ready i.on { background: var(--caution); }

/* ---- structures -------------------------------------------------------------------- */
.st-row td:first-child { width: 46%; }
.st-name { display: flex; gap: 12px; align-items: center; }
.st-name img { width: 44px; height: 44px; border-radius: var(--radius-s); background: var(--hull); }
.racks { display: grid; gap: 14px; }
.rack h3 { font-size: .95rem; color: var(--dim); margin-bottom: 6px; }
.rack ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px; }
.rack li { display: flex; gap: 8px; align-items: center; padding: 6px 8px; background: var(--hull); border-radius: var(--radius-s); border: 1px solid var(--seam); font-size: .92rem; }
.rack li img { width: 28px; height: 28px; }
.hero-render { display: flex; gap: 20px; align-items: center; }
.hero-render img { width: 128px; height: 128px; border-radius: var(--radius-m); background: var(--hull); }

/* ---- bars (mining value per day) --------------------------------------------------- */
.bars { display: flex; align-items: flex-end; gap: 3px; height: 120px; padding-top: 8px; }
.bars span { flex: 1; background: var(--fuel); border-radius: 2px 2px 0 0; min-height: 2px; opacity: .85; }
.bars span:hover { opacity: 1; }
.meter { height: 6px; background: var(--seam); border-radius: 3px; overflow: hidden; }
.meter b { display: block; height: 100%; background: var(--fuel); }

/* ---- doctrines --------------------------------------------------------------------- */
.fit-card { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: var(--radius-m); border: 1px solid var(--seam); text-decoration: none; background: var(--hull); }
.fit-card:hover { border-color: var(--fuel); color: inherit; }
.fit-card img { width: 56px; height: 56px; border-radius: var(--radius-s); }
.fit-list { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.doctrine { border-left: 3px solid var(--cat, var(--ice)); }
.slots { list-style: none; margin: 0; padding: 0; }
.slots li { display: flex; gap: 8px; align-items: center; padding: 3px 0; font-size: .93rem; }
.slots img { width: 26px; height: 26px; }
pre.eft { background: var(--hull); border: 1px solid var(--seam); border-radius: var(--radius-s); padding: 12px; overflow: auto; font-size: .85rem; margin: 0; }

/* ---- SRP ----------------------------------------------------------------------------- */
.code { font: 700 1.5rem/1 var(--font-head); letter-spacing: .12em; color: var(--fuel); }
.loss { display: flex; gap: 16px; align-items: flex-start; }
.loss img { width: 96px; height: 96px; border-radius: var(--radius-m); background: var(--hull); }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
dl.facts dt { color: var(--dim); }
dl.facts dd { margin: 0; }

/* ---- roles & matrix -------------------------------------------------------------- */
.role-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--ice)); margin-right: 6px; }
.matrix th.col { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; padding: 10px 6px; font-size: .8rem; }
.matrix td { text-align: center; padding: 6px; }
.matrix td:first-child { text-align: left; }
.matrix tr.app td { background: var(--plate-2); font-family: var(--font-head); font-weight: 600; text-align: left; }
.matrix input { width: 16px; height: 16px; accent-color: var(--fuel); }

/* ---- landing ------------------------------------------------------------------------- */
.landing { min-height: 100vh; display: grid; grid-template-rows: 1fr auto; padding: 32px clamp(16px, 5vw, 64px); }
.landing-main { align-self: center; max-width: 760px; }
.landing h1 { font-size: clamp(3rem, 9vw, 6rem); line-height: .9; margin-bottom: 18px; font-weight: 700; letter-spacing: .12em; }
.landing .lede { font-size: 1.15rem; color: var(--dim); max-width: 52ch; }
.landing .gauge { height: 22px; max-width: 520px; margin: 28px 0; }
.landing ul.features { list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 6px 24px; color: var(--dim); }
.landing ul.features b { color: var(--signal); font-weight: 600; }
.sso-btn { font-size: 1.05rem; padding: 12px 22px; }

/* ---- tabs ---------------------------------------------------------------------------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--seam); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 8px 14px; text-decoration: none; color: var(--dim); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a[aria-current="page"] { color: var(--signal); border-bottom-color: var(--fuel); }

/* small screens: list-like tables collapse into stacked rows */
@media (max-width: 640px) {
  table.stack-sm thead { display: none; }
  table.stack-sm tr { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 12px 0; border-bottom: 1px solid var(--seam); }
  table.stack-sm td { border: 0; padding: 0; width: auto !important; min-width: 0 !important; }
  table.stack-sm td:first-child { grid-column: 1 / -1; }
  table.stack-sm .fuel { grid-column: 1 / -1; }
  table.stack-sm td.wide-sm { grid-column: 1 / -1; }
  .st-name img { width: 36px; height: 36px; }
  .readouts { gap: 8px 24px; }
  .readouts .num { font-size: 1.3rem; }
}

/* ---- filter bars, paging, standings ------------------------------------------------- */
.filterbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 14px; margin-bottom: 14px;
  background: var(--plate); border: 1px solid var(--seam); border-radius: var(--radius-m); }
.filterbar input[type=search], .filterbar input[type=text], .filterbar input[type=date], .filterbar select { width: auto; padding: 6px 8px; font-size: .9rem; }
.filterbar :is(input, select).w-s { width: 160px; }
.filterbar :is(input, select).w-m { width: 210px; }
.filterbar .inline-label { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 500; font-size: .88rem; color: var(--dim); }
.filterbar .inline-check { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: .9rem; }
.filterbar .inline-check input { margin: 0; }
.filterbar .actions { margin-left: auto; }
input[type=date] { width: auto; padding: 6px 8px; border-radius: var(--radius-s); border: 1px solid var(--seam); background: var(--hull); color: var(--signal); font: inherit; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: flex-end; margin: 12px 0 0; font-size: .9rem; }
.standing { display: inline-block; min-width: 3.4em; text-align: center; padding: 1px 6px; border-radius: var(--radius-s);
  font: 600 .85rem/1.5 var(--font-head); color: #fff; }
/* EVE's own standing colours, so pilots read them instantly */
.st-excellent { background: #1F5FBF; }
.st-good { background: #4C98E0; }
.st-neutral { background: #6B7A86; }
.st-bad { background: #D9792C; }
.st-terrible { background: #C8322E; }
.holders { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
@media (max-width: 640px) {
  .filterbar :is(input, select):is(.w-s, .w-m), .filterbar select { width: 100%; }
  .filterbar .actions { margin-left: 0; }
}

/* ---- clock ------------------------------------------------------------------------------ */
.clock { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; margin: 0 6px 16px; padding: 10px 12px;
  border: 1px solid var(--seam); border-radius: var(--radius-m); background: var(--hull); }
.clock-cell { display: flex; flex-direction: column; }
.clock-cell small { font-size: .74rem; color: var(--dim); }
.clock-eve, .clock-local { font: 600 1.45rem/1.1 var(--font-head); font-variant-numeric: tabular-nums; letter-spacing: .03em; }
.clock-eve { color: var(--fuel); }
.clock-dt { grid-column: 1 / -1; font-size: .76rem; color: var(--dim); margin-top: 4px; }
.topbar-time { font-size: .9rem; color: var(--dim); }
.topbar-time b { color: var(--fuel); font-family: var(--font-head); }
.topbar .clock { margin: 0 16px 12px; }

/* ---- wiki --------------------------------------------------------------------------- */
.crumbs { font-size: .88rem; color: var(--dim); margin-bottom: 8px; }
.wiki-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; align-items: start; }
.wiki-aside .panel + .panel { margin-top: 16px; }
@media (max-width: 1000px) { .wiki-layout { grid-template-columns: 1fr; } }
.wiki-search input { width: 220px; padding: 6px 10px; }
.wiki-tree { list-style: none; margin: 0; padding: 0; }
.wiki-tree li { padding: 4px 0 4px calc(var(--d, 0) * 18px); border-left: 0; }
.wiki-tree li[style*="--d:1"], .wiki-tree li[style*="--d:2"], .wiki-tree li[style*="--d:3"] { font-size: .95rem; }
.prose { font-size: 1rem; line-height: 1.65; }
.prose > :first-child { margin-top: 0; }
.prose h1, .prose h2, .prose h3 { margin: 1.4em 0 .5em; }
.prose h2 { padding-bottom: 4px; border-bottom: 1px solid var(--seam); }
.prose p, .prose li { max-width: 78ch; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose code { background: var(--hull); border: 1px solid var(--seam); border-radius: 3px; padding: 0 4px; font-size: .9em; }
.prose pre { background: var(--hull); border: 1px solid var(--seam); border-radius: var(--radius-s); padding: 12px; overflow: auto; }
.prose pre code { border: 0; padding: 0; }
.prose blockquote { margin: 0 0 1em; padding: 4px 14px; border-left: 3px solid var(--trig); color: var(--dim); }
.prose table { margin: 0 0 1em; }
.prose img { border-radius: var(--radius-s); }
.prose a.missing { color: var(--hostile); text-decoration-style: dashed; }
.toc-wrap ul { list-style: none; margin: 0; padding-left: 12px; }
.toc-wrap > .toc > ul { padding-left: 0; }
.toc-wrap li { padding: 2px 0; font-size: .92rem; }
.wiki-edit textarea { font: .92rem/1.55 ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.check-list ul { list-style: none; margin: 0; padding: 0; columns: 2; }
.check-list label { font-weight: 400; }
pre.diff { background: var(--hull); border: 1px solid var(--seam); border-radius: var(--radius-s); padding: 10px; overflow: auto; font-size: .85rem; margin: 0; }
pre.diff span { display: block; white-space: pre-wrap; }
.d-add { background: color-mix(in srgb, var(--ice) 18%, transparent); }
.d-del { background: color-mix(in srgb, var(--hostile) 18%, transparent); }
.d-hunk { color: var(--dim); }
.rev-list { margin: 0; padding-left: 1.2em; }
.rev-list li { padding: 4px 0; }
.rev-list li[aria-current="true"] a { color: var(--fuel); font-weight: 600; }
.search-hit { padding: 10px 0; border-bottom: 1px solid var(--seam); }
.search-hit p { margin: 4px 0 0; font-size: .92rem; }

/* ---- profit and loss -------------------------------------------------------------------- */
.pl-pos { color: var(--ice); }
.pl-neg { color: var(--hostile); }
.pl-bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--seam); min-width: 120px; }
.pl-bar b { display: block; height: 100%; }
.pl-bar .cost { background: var(--hostile); }
.pl-bar .keep { background: var(--ice); }
textarea.scan { min-height: 180px; }

/* ---- recruitment timeline ------------------------------------------------------------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 10px 12px; border-left: 3px solid var(--seam); margin-bottom: 8px; background: var(--hull); border-radius: 0 var(--radius-s) var(--radius-s) 0; }
.timeline .t-message { border-left-color: var(--fuel); }
.timeline .t-note { border-left-color: var(--caution); }
.timeline .t-status { border-left-color: var(--dim); }
.timeline .t-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.timeline .t-body { margin-top: 4px; }
.tag-new, .tag-reviewing, .tag-interview { color: var(--caution); }
.tag-accepted { color: var(--ice); }
.tag-withdrawn { color: var(--dim); }

/* ---- system health ------------------------------------------------------------------------ */
.health-banner { padding: 14px 18px; border-radius: var(--radius-m); margin-bottom: 16px; font: 600 1.05rem/1.3 var(--font-head);
  border: 1px solid var(--seam); background: var(--plate); }
.hb-ok { border-left: 4px solid var(--ice); }
.hb-warn { border-left: 4px solid var(--caution); }
.hb-fail { border-left: 4px solid var(--hostile); color: var(--hostile); }
.nav .dot { width: 8px; height: 8px; border-radius: 50%; margin-left: auto; background: var(--caution); }
.nav .dot.fail { background: var(--hostile); }

/* ---- character sheet ------------------------------------------------------------------- */
.sheet { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 16px; align-items: start; }
.sheet-side .panel + .panel { margin-top: 16px; }
.sheet-card { text-align: left; }
.sheet-portrait { width: 100%; height: auto; aspect-ratio: 1; border-radius: var(--radius-m); background: var(--hull); display: block; margin-bottom: 12px; }
.sheet-card h1 { font-size: 1.5rem; margin-bottom: 8px; }
.sheet-aff { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-size: .93rem; }
.sheet-aff img { width: 24px; height: 24px; border-radius: 3px; }
.sheet-facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 12px; margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--seam); font-size: .92rem; }
.sheet-facts dt { color: var(--dim); }
.sheet-facts dd { margin: 0; }
.sheet-updated { margin: 12px 0 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: .9rem; }
.sheet-menu { padding: 6px; display: flex; flex-direction: column; }
.sheet-menu a { padding: 8px 12px; border-radius: var(--radius-s); text-decoration: none; color: var(--dim); }
.sheet-menu a:hover { background: var(--plate-2); color: var(--signal); }
.sheet-menu a[aria-current="page"] { background: var(--plate-2); color: var(--signal); box-shadow: inset 3px 0 0 var(--fuel); }
.queue-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--seam); }
.queue-row:last-child { border-bottom: 0; }
.group-row { display: grid; grid-template-columns: 1fr 90px 60px; gap: 10px; align-items: center; padding: 4px 0; font-size: .93rem; }
.group-row small { text-align: right; }
.skill-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 16px; }
.skill-groups .panel + .panel { margin-top: 0; }
.skill-list { list-style: none; margin: 0; padding: 0; }
.skill-list li { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; font-size: .92rem; }
.pips { display: inline-flex; gap: 3px; }
.pips i { width: 9px; height: 9px; border: 1px solid var(--seam); border-radius: 1px; }
.pips i.on { background: var(--fuel); border-color: var(--fuel); }
.pips i.trained { background: color-mix(in srgb, var(--fuel) 35%, transparent); border-color: var(--fuel); }
@media (max-width: 1000px) { .sheet { grid-template-columns: 1fr; } .sheet-portrait { max-width: 180px; } }

/* ---- home: tiles, character cards, bar charts ----------------------------------------------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { display: flex; flex-direction: column; padding: 14px 16px; background: var(--plate); border: 1px solid var(--seam);
  border-radius: var(--radius-m); border-top: 3px solid var(--trig); }
.tile-label { font-size: .85rem; color: var(--dim); }
.tile-value { font: 700 2.15rem/1.1 var(--font-head); font-variant-numeric: tabular-nums; margin: 2px 0; }
.tile-sub { font-size: .8rem; color: var(--dim); }
.char-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 10px; }
.char-card { display: flex; gap: 12px; padding: 10px; border: 1px solid var(--seam); border-radius: var(--radius-m);
  background: var(--hull); text-decoration: none; }
.char-card:hover { border-color: var(--fuel); color: inherit; }
.char-card img { width: 64px; height: 64px; border-radius: var(--radius-s); flex: none; }
.char-card b, .char-card small, .char-card .char-stats { display: block; line-height: 1.35; }
.char-card .char-stats { font-size: .9rem; margin-top: 2px; }
.vbars { display: flex; align-items: flex-end; gap: 2px; height: 170px; padding-bottom: 22px; position: relative;
  border-bottom: 1px solid var(--seam); }
.vbar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; position: relative; outline: none; min-width: 0; }
.vbar-fill { display: block; background: var(--fuel); border-radius: 4px 4px 0 0; min-height: 0; opacity: .9; }
.vbar:hover .vbar-fill, .vbar:focus .vbar-fill { opacity: 1; }
.vbar-label { position: absolute; bottom: -20px; left: 0; right: 0; text-align: center; font-size: .72rem; color: var(--dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vbar-tip { position: absolute; bottom: calc(100% - 10px); left: 50%; transform: translateX(-50%); z-index: 2; pointer-events: none;
  background: var(--plate-2); border: 1px solid var(--seam); border-radius: var(--radius-s); padding: 6px 8px; font-size: .8rem;
  white-space: nowrap; opacity: 0; transition: opacity .12s; }
.vbar:hover .vbar-tip, .vbar:focus .vbar-tip { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .vbar-tip { transition: none; } }

/* spacing between stacked panels and grids */
.panel + .grid, .grid + .panel, .grid + .grid, .tiles + .panel, .panel + .tiles { margin-top: 16px; }
.sheet-main .grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.char-list { list-style: none; margin: 0; padding: 0; }
.char-list li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--seam); }
.char-list li:last-child { border-bottom: 0; }
.char-list img { width: 36px; height: 36px; border-radius: var(--radius-s); flex: none; }
.char-list .meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 3px; font-size: .85rem; }
.panel + .skill-groups { margin-top: 16px; }

/* ---- standings ----------------------------------------------------------------------------- */
.source-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 12px; margin-bottom: 16px; }
.source-row .panel + .panel { margin-top: 0; }
.source-card.is-paused { opacity: .6; }
.badge-red { background: var(--hostile); color: #fff; }
.sheet-menu a .badge { margin-left: 6px; }

/* ---- suspicious activity --------------------------------------------------------------------- */
.flag-row.sev-high td:first-child { box-shadow: inset 3px 0 0 var(--hostile); }
.flag-row.sev-medium td:first-child { box-shadow: inset 3px 0 0 var(--caution); }
.flag-pair { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.flag-arrow { font-size: 1.6rem; color: var(--hostile); }
.flag-pair .who small { display: block; }

/* ---- Triglavian structure ---------------------------------------------------------------- */
.rail { box-shadow: inset -2px 0 0 color-mix(in srgb, var(--trig) 55%, transparent); }
.topbar { border-bottom-color: color-mix(in srgb, var(--trig) 60%, var(--seam)); }
.clock { border-color: color-mix(in srgb, var(--trig) 45%, var(--seam)); }
.brand-mark { width: 30px; height: 30px; }
.brand-inline { display: inline-flex; align-items: center; gap: 8px; }
.landing-mark { width: 72px; height: 72px; display: block; margin-bottom: 6px; }

/* ---- buyback ------------------------------------------------------------------------ */
.mono { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; letter-spacing: .02em; }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.plain { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
table.compact td, table.compact th { padding-top: 6px; padding-bottom: 6px; }
.bb-top textarea { width: 100%; font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: .88rem; }
.contract-card { border-color: var(--fuel); }
.contract-facts dd { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.grid-main { grid-template-columns: minmax(0, 1fr) minmax(0, 340px); align-items: start; }
@media (max-width: 980px) { .grid-main { grid-template-columns: minmax(0, 1fr); } }

/* ---- killboard ------------------------------------------------------------------------ */
.km-list { display: grid; }
.km-row { display: grid; grid-template-columns: 44px minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1.4fr) minmax(0, .8fr);
  gap: 12px; align-items: center; padding: 9px 10px 9px 12px; color: inherit; text-decoration: none;
  border-bottom: 1px solid var(--seam); box-shadow: inset 3px 0 0 transparent; }
.km-row:hover { background: var(--plate-2); color: inherit; }
.km-row, .km-row:hover, .km-row:visited { color: var(--signal); }
.km-row.is-kill { box-shadow: inset 3px 0 0 var(--fuel); }
.km-row.is-loss { box-shadow: inset 3px 0 0 var(--hostile); }
.km-ship { width: 44px; height: 44px; border-radius: var(--radius-s); background: var(--hull); }
.km-cell { min-width: 0; display: flex; flex-direction: column; }
.km-cell b, .km-cell small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.km-cell b { font-weight: 600; }
.km-cell small { color: var(--dim); font-size: .82rem; }
.km-value { text-align: right; }
.km-value b { font-family: var(--font-head); font-variant-numeric: tabular-nums; }
.is-loss .km-value b { color: var(--hostile); }
@media (max-width: 900px) {
  .km-row { grid-template-columns: 40px minmax(0, 1fr) auto; }
  .km-where, .km-killer { display: none; }
  .km-victim { grid-column: 2; }
  .km-value { grid-column: 3; grid-row: 1 / span 2; }
}
.sec { font-family: var(--font-head); font-weight: 600; font-variant-numeric: tabular-nums; }
.sec-high { color: var(--fuel); }
.sec-low { color: var(--caution); }
.sec-null { color: var(--hostile); }
.eff { display: block; width: 120px; height: 4px; margin-top: 4px; background: var(--hostile); border-radius: 2px; overflow: hidden; }
.eff i { display: block; height: 100%; background: var(--fuel); }
.rank { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rank li { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rank .who { color: inherit; text-decoration: none; }
.big-kill { color: inherit; text-decoration: none; margin-bottom: 10px; }
.big-kill img { width: 40px; height: 40px; }
.bar-row { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px solid var(--seam); font-size: .92rem; }
.km-head.is-loss h1 { color: var(--hostile); }
.attackers { list-style: none; margin: 0; padding: 0; display: grid; }
.attackers li { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--seam); }
.attackers li.ours { box-shadow: inset 3px 0 0 var(--fuel); padding-left: 8px; }
.attackers img { width: 40px; height: 40px; border-radius: var(--radius-s); }
.who-text { min-width: 0; }
.who-text small { display: block; color: var(--dim); font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-text a { color: inherit; }
.attackers .num { text-align: right; display: flex; flex-direction: column; }
.dmg { display: block; height: 3px; margin-top: 5px; background: var(--seam); border-radius: 2px; overflow: hidden; max-width: 220px; }
.dmg i { display: block; height: 100%; background: var(--hostile); opacity: .8; }
table.km-items { table-layout: fixed; width: 100%; }
table.km-items th:nth-child(2), table.km-items th:nth-child(3) { width: 92px; }
table.km-items th:nth-child(4) { width: 100px; }
@media (max-width: 600px) {
  table.km-items th:nth-child(2), table.km-items th:nth-child(3) { width: 58px; }
  table.km-items th:nth-child(4) { width: 70px; }
  table.km-items th { font-size: .75rem; }
}

/* ---- auth check ------------------------------------------------------------------------ */
.auth-check.auth-missing { border-color: var(--hostile); }
.auth-check.auth-alts { border-color: var(--caution); }
.auth-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.auth-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.auth-alts { border-top: 1px solid var(--seam); padding-top: 12px; }
.alt-list { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 4px; font-size: .85rem; }
.alt-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

/* ---- corporation audit --------------------------------------------------------------- */
.corp-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 16px; }
.corp-card { display: grid; gap: 12px; color: inherit; text-decoration: none; }
.corp-card:hover { border-color: var(--fuel); color: inherit; }
.meter { display: inline-block; vertical-align: middle; width: 90px; height: 5px; background: var(--seam); border-radius: 3px; overflow: hidden; }
.readouts .meter { display: block; margin-top: 4px; }
.meter i { display: block; height: 100%; background: var(--fuel); }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 8px; vertical-align: 0; }
.income-table td:nth-child(2) { width: 46%; }
.inbar { display: inline-block; width: calc(100% - 80px); max-width: 260px; height: 8px; background: var(--seam); border-radius: 4px; overflow: hidden; vertical-align: middle; margin-right: 8px; }
.inbar i { display: block; height: 100%; }

/* ---- discord welcome preview ------------------------------------------------------------- */
.discord-preview { display: flex; gap: 12px; padding: 12px 14px; background: #313338; color: #DBDEE1; border-radius: var(--radius-m); font-size: .93rem; }
.discord-preview img { width: 40px; height: 40px; border-radius: 50%; flex: none; }
.discord-preview b { color: #F2F3F5; }
.discord-preview .bot-tag { background: #5865F2; color: #fff; font-size: .62rem; font-weight: 700; padding: 1px 4px; border-radius: 3px; vertical-align: 1px; }
.discord-msg { margin-top: 4px; white-space: normal; overflow-wrap: anywhere; }

/* ---- characters: what each character shares --------------------------------------------- */
.bundle-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.bundle-chip { display: inline-flex; align-items: center; gap: 4px; margin: 0; padding: 3px 9px; border-radius: var(--radius-s);
  border: 1px dashed var(--seam); color: var(--dim); font-size: .82rem; text-decoration: none; white-space: nowrap; }
.bundle-chip:hover { color: var(--signal); border-color: var(--fuel); }
.bundle-chip.is-on { border-style: solid; border-color: var(--fuel); color: var(--signal); }
.bundle-chip button { border: 0; background: none; color: var(--dim); cursor: pointer; padding: 0 0 0 2px; font: inherit; line-height: 1; }
.bundle-chip button:hover, .bundle-chip button:focus-visible { color: var(--hostile); }

/* ---- task bar (system health) ---------------------------------------------------------------- */
.taskbar { --tq-ok: var(--fuel); --tq-retry: var(--caution); --tq-fail: var(--hostile); }
.seg { display: inline-flex; border: 1px solid var(--seam); border-radius: var(--radius-s); overflow: hidden; }
.seg a { padding: 4px 12px; font-size: .85rem; color: var(--dim); text-decoration: none; }
.seg a[aria-current="true"] { background: var(--plate-2); color: var(--signal); }
.tq-live { margin: 0 0 10px; }
.tq-bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--seam); }
.tq-bar i { display: block; height: 100%; }
.tq-bar.is-empty { opacity: .5; }
.tq-mini { height: 6px; border-radius: 3px; }
.tq-ok { background: var(--tq-ok, var(--fuel)); }
.tq-retry { background: var(--tq-retry, var(--caution)); }
.tq-fail { background: var(--tq-fail, var(--hostile)); }
.tq-legend { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: .92rem; }
.tq-legend li { display: flex; align-items: center; gap: 6px; }
.tq-legend span { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.dot-ok { background: var(--fuel); } .dot-retry { background: var(--caution); } .dot-fail { background: var(--hostile); }
.tq-timeline { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 3px; height: 92px; margin-top: 16px; align-items: end; }
.tq-col { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; position: relative; padding-bottom: 16px; }
.tq-stack { display: flex; flex-direction: column; min-height: 2px; border-radius: 2px 2px 0 0; overflow: hidden; background: var(--seam); }
.tq-stack i { display: block; width: 100%; }
.tq-col small { position: absolute; bottom: 0; left: 0; font-size: .68rem; color: var(--dim); white-space: nowrap; }
.tq-tasks { margin-top: 12px; }
.tq-tasks summary { cursor: pointer; color: var(--dim); }
.warn-text { color: var(--caution); }

/* ---- wormholes ------------------------------------------------------------------------------ */
.wh-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 380px); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .wh-wrap { grid-template-columns: minmax(0, 1fr); } }
.wh-board { padding: 12px; }
.wh-toolbar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-bottom: 10px; }
.wh-add { display: flex; gap: 6px; }
.wh-add input { width: 230px; padding: 6px 8px; }
.wh-hint { font-size: .85rem; }
.wh-zoom { margin-left: auto; display: flex; gap: 4px; }
.wh-map { width: 100%; height: min(70vh, 680px); min-height: 380px; display: block; border-radius: var(--radius-m); cursor: grab;
  background: radial-gradient(circle at 1px 1px, var(--seam) 1px, transparent 1.5px) 0 0 / 22px 22px, var(--hull);
  touch-action: none; user-select: none; }
.wh-map:active { cursor: grabbing; }
.wh-node { cursor: pointer; outline: none; }
.wh-node .box { fill: var(--plate); stroke: var(--seam); stroke-width: 1.5; }
.wh-node .band { fill: var(--wk, var(--plate-2)); }
.wh-node.is-sel .box, .wh-node:focus-visible .box { stroke: var(--fuel); stroke-width: 2.5; }
.wh-node.is-home .box { stroke: var(--trig); stroke-width: 2; }
.wh-node .cls { font: 700 13px var(--font-head); fill: #0F1113; }
.wh-node .home { font: 700 8px var(--font-head); letter-spacing: .12em; fill: #0F1113; opacity: .8; }
.wh-node .name { font: 600 14px var(--font-head); fill: var(--signal); }
.wh-node .sub { font: 400 11px var(--font-body); fill: var(--dim); }
.wh-node .badge { font: 600 11px var(--font-head); }
.wh-node .badge.pilots { fill: var(--fuel); } .wh-node .badge.sigs { fill: var(--dim); } .wh-node .badge.kills { fill: var(--hostile); }
.wh-node .lock { font-size: 10px; }
.k-c1 { --wk: #6FD3E8; } .k-c2 { --wk: #4CA3F0; } .k-c3 { --wk: #8C8CF7; } .k-c4 { --wk: #C27BF2; } .k-c5 { --wk: #F28FC6; } .k-c6 { --wk: #F26B6B; }
.k-hs { --wk: #45E08F; } .k-ls { --wk: #F2B84B; } .k-ns { --wk: #E5584F; } .k-thera { --wk: #F7E06B; } .k-pochven { --wk: #C8343D; }
.k-shattered { --wk: #9FB7C9; } .k-drifter { --wk: #B9A6FF; } .k-w { --wk: #7E878F; }
.wh-edge { cursor: pointer; outline: none; }
.wh-edge .hit { stroke: transparent; stroke-width: 16; }
.wh-edge .core { stroke: var(--signal); stroke-width: 3; stroke-linecap: round; opacity: .85; }
.wh-edge.k-stargate .core { stroke: var(--fuel); stroke-width: 2; }
.wh-edge.m-reduced .core { stroke: var(--caution); }
.wh-edge.m-critical .core { stroke: var(--hostile); stroke-width: 3.5; }
.wh-edge .eol { stroke: #B07CFF; stroke-width: 9; stroke-linecap: round; opacity: .75; }
.wh-edge.is-save .core { stroke-dasharray: 8 6; }
.wh-edge.is-sel .core, .wh-edge:focus-visible .core { stroke-width: 5; }
.wh-edge .tag-bg { fill: var(--plate-2); stroke: var(--seam); }
.wh-edge .tag-text { font: 700 11px var(--font-head); fill: var(--signal); }
.wh-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 10px 0 0; padding: 0; font-size: .8rem; }
.wh-legend i { display: inline-block; width: 22px; height: 4px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.lg-wh { background: var(--signal); } .lg-reduced { background: var(--caution); } .lg-critical { background: var(--hostile); }
.lg-eol { background: var(--signal); box-shadow: 0 0 0 3px #B07CFF; } .lg-gate { background: var(--fuel); height: 2px !important; }
.wh-side { display: grid; gap: 16px; }
.wh-panel-head { display: flex; gap: 12px; align-items: center; margin-bottom: 6px; }
.wh-class { display: inline-grid; place-items: center; min-width: 46px; height: 46px; padding: 0 6px; border-radius: 6px;
  background: var(--wk, var(--plate-2)); color: #0F1113; font: 700 1rem var(--font-head); }
.wh-links { font-size: .85rem; margin: 0 0 12px; }
.wh-side h3 { margin: 16px 0 8px; font-size: 1rem; }
.wh-sigs td { vertical-align: middle; }
.wh-sigs select, .wh-sigs input { padding: 3px 5px; font-size: .82rem; width: auto; max-width: 140px; }
.wh-sig { display: flex; flex-wrap: wrap; gap: 4px; }
.wh-sigs tr.is-anom td { opacity: .7; }
.wh-x { border: 0; background: none; color: var(--dim); cursor: pointer; font-size: 1rem; }
.wh-x:hover { color: var(--hostile); }
.wh-paste textarea { width: 100%; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .8rem; }
.wh-preview p { margin: 8px 0; }
.wh-track { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--seam); }
.wh-track small { display: block; }
.seg-field { border: 0; padding: 0; margin: 0 0 10px; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.seg-field legend { font-size: .85rem; color: var(--dim); margin-bottom: 4px; width: 100%; }
.seg-field label { display: inline-flex; gap: 4px; align-items: center; margin: 0; }
.wh-groups ul { list-style: none; padding: 0; margin: 0; columns: 2; }
.wh-toast { position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 50; padding: 10px 14px;
  background: var(--plate-2); border: 1px solid var(--seam); border-radius: var(--radius-m); color: var(--signal); }

/* ---- share several permission sets at once --------------------------------------------------- */
.share-form { display: grid; gap: 16px; max-width: 900px; }
.share-form .panel h2 { margin-top: 0; }
.share-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 10px; }
.share-option { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--seam);
  border-radius: var(--radius-m); font-weight: 400; cursor: pointer; }
.share-option:hover { border-color: var(--fuel); }
.share-option.is-on { border-color: var(--fuel); background: var(--plate-2); }
.share-option input { margin-top: 4px; accent-color: var(--fuel); }
.share-body { display: grid; gap: 3px; min-width: 0; }
.share-body small { color: var(--dim); }
.share-body details summary { cursor: pointer; color: var(--dim); font-size: .82rem; }
.share-body details ul { margin: 4px 0 0; padding-left: 18px; font-size: .8rem; overflow-wrap: anywhere; }
.share-submit { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.bundle-chip.pick { cursor: pointer; }
.bundle-chip.pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.bundle-chip.pick:has(input:checked) { border-style: solid; border-color: var(--fuel); color: var(--fuel); }
.bundle-chip.pick:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.share-row { display: none; margin-top: 8px; gap: 8px; align-items: center; flex-wrap: wrap; }
.share-cell:has(.pick input:checked) .share-row { display: flex; }

/* ---- line charts (Overview) ------------------------------------------------------------------- */
.lc { margin: 0; display: grid; gap: 8px; min-width: 0; }
.lc-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .82rem; color: var(--dim); }
.lc-legend li { display: inline-flex; align-items: center; gap: 6px; }
.lc-key { display: inline-block; width: 14px; height: 3px; border-radius: 2px; background: var(--c); flex: none; }
.lc-plot { position: relative; min-width: 0; }
.lc-loading { margin: 0; padding-top: 40px; text-align: center; }
.lc-svg { display: block; overflow: visible; outline: none; }
.lc-svg:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; border-radius: 2px; }
.lc-grid { stroke: var(--seam); stroke-width: 1; opacity: .55; }
.lc-base { stroke: var(--seam); stroke-width: 1; }
.lc-axis { fill: var(--dim); font: 400 11px/1 var(--font-body); font-variant-numeric: tabular-nums; }
.lc-direct { fill: var(--signal); font: 500 11.5px/1 var(--font-body); }
.lc-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.lc-end { stroke: var(--plate); stroke-width: 2; }
.lc-cross { stroke: var(--dim); stroke-width: 1; stroke-dasharray: 3 3; }
.lc-dot { stroke: var(--plate); stroke-width: 2; }
.lc-tip { position: absolute; z-index: 3; pointer-events: none; min-width: 190px; max-width: 260px; padding: 8px 10px;
  background: var(--plate-2); border: 1px solid var(--seam); border-radius: var(--radius-m); box-shadow: 0 6px 18px rgba(0,0,0,.35);
  font-size: .82rem; display: grid; gap: 3px; }
.lc-tip[hidden] { display: none; }
.lc-tip b { font-weight: 600; margin-bottom: 2px; }
.lc-tip div { display: grid; grid-template-columns: 14px 1fr auto; align-items: center; gap: 8px; }
.lc-tip span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--dim); }
.lc-table summary { cursor: pointer; color: var(--dim); font-size: .8rem; }
.lc-table .table-wrap { max-height: 260px; overflow: auto; margin-top: 6px; }
.lc-tbl { font-size: .82rem; }
.lc figcaption { font-size: .8rem; }
.nowrap { white-space: nowrap; }

/* ---- skills coverage radar --------------------------------------------------------------------- */
.radar { margin: 0; display: grid; gap: 10px; min-width: 0; }
.radar-total { display: grid; gap: 2px; }
.radar-sp { font: 700 2.3rem/1.05 var(--font-head); }
.radar-keys { display: flex; flex-wrap: wrap; gap: 6px; }
.radar-key { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border: 1px solid var(--seam); border-radius: var(--radius-s);
  background: none; color: var(--signal); font: inherit; font-size: .82rem; cursor: pointer; }
.radar-key small { color: var(--dim); }
.radar-key[aria-pressed="false"] { color: var(--dim); border-style: dashed; }
.radar-key[aria-pressed="false"] .lc-key { opacity: .3; }
.radar-key:hover { border-color: var(--fuel); }
.radar-key:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.radar-plot { position: relative; min-width: 0; }
.rd-ring { fill: none; stroke: var(--seam); stroke-width: 1; opacity: .45; }
.rd-ring.is-major { opacity: .9; }
.rd-spoke { stroke: var(--seam); stroke-width: 1; opacity: .7; }
.rd-label { fill: var(--dim); font: 400 11px/1 var(--font-body); }
.rd-label.is-small { font-size: 10px; }
.rd-tick { fill: var(--dim); font: 400 9.5px/1 var(--font-body); opacity: .8; }
.rd-area { fill-opacity: .16; stroke-width: 2; stroke-linejoin: round; }

/* ---- theme switcher ------------------------------------------------------------------------- */
.theme-switch { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; }
.theme-switch > span { font-size: .78rem; color: var(--dim); }
.theme-switch form { display: inline-flex; border: 1px solid var(--seam); border-radius: var(--radius-s); padding: 2px; gap: 2px; margin: 0; }
.theme-switch button { border: 0; background: none; color: var(--dim); font: 500 .78rem/1 var(--font-body); padding: 5px 9px;
  border-radius: var(--radius-s); cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.theme-switch button:hover { color: var(--signal); }
.theme-switch button[aria-pressed="true"] { background: var(--plate-2); color: var(--signal); box-shadow: inset 0 0 0 1px var(--fuel); }
.theme-switch button:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.theme-switch i { width: 10px; height: 10px; border-radius: 1px; transform: rotate(45deg); border: 1px solid rgba(128,128,128,.6); flex: none; }
.theme-switch .sw-light { background: #EEF1F3; } .theme-switch .sw-medium { background: #383E44; } .theme-switch .sw-dark { background: #0F1113; }
.landing-theme { position: fixed; top: 14px; right: 16px; z-index: 5; }
.landing-theme .theme-switch { margin: 0; background: var(--plate); border-radius: var(--radius-s); padding: 2px 8px 2px 10px; }
.rail .theme-switch, .topbar .theme-switch { flex-direction: column; align-items: stretch; gap: 4px; padding: 0 6px; }
.rail .theme-switch form, .topbar .theme-switch form { display: flex; }
.rail .theme-switch button, .topbar .theme-switch button { flex: 1; justify-content: center; padding: 5px 4px; }
.topbar .theme-switch { padding: 10px 0 0; max-width: 320px; }
code { overflow-wrap: anywhere; }
.panel-head { flex-wrap: wrap; row-gap: 2px; }
@media (max-width: 480px) { .panel-head .nowrap { white-space: normal; } }
.also-set { display: block; margin-top: 2px; }
.standing.is-mini { font-size: .7rem; padding: 0 5px; vertical-align: 1px; }

/* ---- secure groups ------------------------------------------------------------------------------ */
.req-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 2px; font-size: .84rem; }
.req-list .is-ok { color: var(--dim); }
.req-list .is-no { color: var(--signal); }
.req-mark { display: inline-block; width: 1.1em; font-weight: 700; }
.is-ok .req-mark { color: var(--fuel); }
.is-no .req-mark { color: var(--hostile); }
.req-edit { font-size: .8rem; }
.req-admin { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.req-admin li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px;
  border: 1px solid var(--seam); border-radius: var(--radius-m); }
.req-form label, .req-form [data-for] > label { display: grid; gap: 4px; }
.req-form [data-for] { display: grid; gap: 10px; }
.req-form [data-for][hidden] { display: none; }
fieldset.plain { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; }
.btn:disabled, .btn[disabled] { opacity: .45; cursor: not-allowed; filter: grayscale(.6); }
.btn:disabled:hover { border-color: var(--seam); color: inherit; }

/* ---- spreadsheets -------------------------------------------------------------------------------- */
.sheet-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.sheet-list li { display: flex; align-items: center; gap: 10px; }
.sheet-list li > a:first-child { flex: 1; display: flex; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--seam);
  border-radius: var(--radius-m); color: inherit; text-decoration: none; min-width: 0; }
.sheet-list li > a:first-child:hover { border-color: var(--fuel); }
.sheet-list svg { width: 22px; height: 22px; color: var(--fuel); flex: none; }
.sheet-list span { display: grid; min-width: 0; }
.sheet-list small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-form input[type=text] { flex: 1 1 200px; }
.export-pick { display: grid; gap: 8px; }
.export-pick .check span { display: grid; }
.sheet-app { display: grid; gap: 8px; }
.sheet-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sheet-addr { min-width: 64px; padding: 7px 10px; border: 1px solid var(--seam); border-radius: var(--radius-m);
  font: 700 .9rem/1 var(--font-head); text-align: center; background: var(--plate); }
.sheet-formula { flex: 1 1 300px; font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; }
.sheet-tools { display: flex; gap: 4px; flex-wrap: wrap; }
.sheet-status { font-size: .82rem; min-width: 90px; }
.sheet-scroll { overflow: auto; max-height: min(70vh, 720px); border: 1px solid var(--seam); border-radius: var(--radius-m);
  background: var(--plate); outline: none; }
.sheet-scroll:focus-visible { box-shadow: 0 0 0 2px var(--focus); }
.sheet-grid { border-collapse: separate; border-spacing: 0; table-layout: fixed; width: max-content; font-size: .88rem; }
.sheet-grid th, .sheet-grid td { border-right: 1px solid var(--seam); border-bottom: 1px solid var(--seam); height: 28px; padding: 0 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-grid thead th { position: sticky; top: 0; z-index: 2; background: var(--plate-2); text-align: center; color: var(--dim);
  font: 600 .78rem/1 var(--font-head); letter-spacing: .04em; text-transform: none; }
.sheet-grid tbody th { position: sticky; left: 0; z-index: 1; background: var(--plate-2); color: var(--dim); width: 44px; min-width: 44px;
  text-align: right; font: 600 .78rem/1 var(--font-head); letter-spacing: 0; text-transform: none; }
.sheet-grid .corner { position: sticky; left: 0; z-index: 3; width: 44px; min-width: 44px; }
.sheet-grid td { cursor: cell; max-width: 600px; }
.sheet-grid td.is-num { text-align: right; font-variant-numeric: tabular-nums; }
.sheet-grid td.is-err { color: var(--hostile); }
.sheet-grid td.is-pending { color: var(--dim); }
.sheet-grid td.is-range { background: color-mix(in srgb, var(--fuel) 12%, transparent); }
.sheet-grid td.is-sel { outline: 2px solid var(--fuel); outline-offset: -2px; background: color-mix(in srgb, var(--fuel) 8%, transparent); }
.sheet-grid td:has(.cell-input) { padding: 0; overflow: visible; }
.cell-input { width: 100%; height: 100%; border: 0; border-radius: 0; padding: 0 6px; background: var(--plate); color: var(--signal);
  font: inherit; box-shadow: inset 0 0 0 2px var(--fuel); }
.col-resize { position: absolute; right: -3px; top: 0; bottom: 0; width: 7px; cursor: col-resize; }
.sheet-grid thead th { position: sticky; }
.sheet-grid thead th[data-c] { position: sticky; }
.sheet-tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.sheet-tab { border: 1px solid var(--seam); background: var(--plate); color: var(--dim); padding: 5px 12px; border-radius: var(--radius-s);
  font: 600 .85rem/1 var(--font-body); cursor: pointer; }
.sheet-tab[aria-selected="true"] { color: var(--signal); border-color: var(--fuel); box-shadow: inset 0 -2px 0 var(--fuel); }
.sheet-tab.is-add { border-style: dashed; }
.sheet-tab.is-del { margin-left: auto; border-color: transparent; }
.sheet-tab.is-del:hover { color: var(--hostile); }
.is-readonly .sheet-grid td { cursor: default; }
.sheet-help { margin: 0; }
.sheet-settings summary { cursor: pointer; }
.share-table td, .share-table th { padding-top: 6px; padding-bottom: 6px; }

/* ---- fitting window (doctrines) --------------------------------------------------------------- */
.fitwin { margin: 0; display: grid; gap: 10px; justify-items: center; --fw-high: #e66767; --fw-med: #3987e5; --fw-low: #c98500;
  --fw-rig: #9085e9; --fw-subsystem: #199e70; }
.fitwin-svg { width: 100%; max-width: 500px; height: auto; display: block; overflow: visible; }
.fw-ring-outer { fill: none; stroke: var(--seam); stroke-width: 1; stroke-dasharray: 2 6; opacity: .7; }
.fw-ring { fill: none; stroke: var(--seam); stroke-width: 26; opacity: .35; }
.fw-hull-bg { fill: var(--plate-2); }
.fw-hull-edge { fill: none; stroke: var(--seam); stroke-width: 2; }
.fw-label { fill: var(--dim); font: 700 11px/1 var(--font-head); letter-spacing: .1em; text-transform: uppercase; }
.fw-sock { fill: var(--plate-2); stroke-width: 2.5; stroke: var(--fw-c, var(--seam)); }
.fw-high { --fw-c: var(--fw-high); } .fw-med { --fw-c: var(--fw-med); } .fw-low { --fw-c: var(--fw-low); }
.fw-rig { --fw-c: var(--fw-rig); } .fw-subsystem { --fw-c: var(--fw-subsystem); }
.fw-slot { cursor: default; outline: none; }
.fw-slot:hover .fw-sock, .fw-slot:focus-visible .fw-sock { stroke: var(--signal); stroke-width: 3; }
.fw-slot.is-empty .fw-sock { fill: transparent; stroke-dasharray: 3 3; stroke-width: 1.5; opacity: .85; }
.fw-empty-mark { stroke: var(--fw-c, var(--dim)); stroke-width: 1.5; opacity: .55; }
.fw-slot.is-offline image { opacity: .35; filter: grayscale(1); }
.fw-slot.is-offline .fw-sock { stroke: var(--hostile); stroke-dasharray: 4 2; }
.fw-charge circle { fill: var(--plate); stroke: var(--seam); stroke-width: 1; }
.fitwin-tip { min-height: 1.5em; font-size: .88rem; color: var(--signal); text-align: center; }
.fitwin-tip.is-empty { color: var(--dim); }
.fitwin-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 12px; font-size: .82rem; color: var(--dim); }
.fw-chip { display: inline-flex; align-items: center; gap: 6px; }
.fw-chip i { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--fw-c, var(--dim)); }
.fw-chip i.fw-hp { border-radius: 1px; border-color: var(--dim); }
.fw-chip b { color: var(--signal); }
.fitwin-note { flex-basis: 100%; text-align: center; }
.fitwin-bays { width: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.fitwin-bays h3 { margin: 0 0 6px; }
.fit-list summary { cursor: pointer; color: var(--dim); font-size: .85rem; margin-top: 6px; }
.bundle-chip.is-update { border-style: dashed; border-color: var(--caution); color: var(--caution); }

/* ---- monthly leaderboards (Overview) ---------------------------------------------------------- */
.lb h3 { margin: 0 0 10px; font-size: 1rem; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); }
.lb-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.lb-row { display: grid; grid-template-columns: 28px 32px 1fr auto; align-items: center; gap: 10px; padding: 6px 10px;
  border: 1px solid var(--seam); border-radius: var(--radius-m); background: var(--plate-2); }
.lb-row img { width: 32px; height: 32px; border-radius: var(--radius-s); }
.lb-rank { font-size: 1.15rem; text-align: center; color: var(--dim); }
.lb-row.rank-1 { border-color: color-mix(in srgb, var(--caution) 70%, var(--seam)); }
.lb-row.rank-1 .lb-rank { color: var(--caution); }
.lb-row.rank-2 .lb-rank { color: #c4ccd3; }
.lb-row.rank-3 .lb-rank { color: #c98a57; }
.lb-who { display: grid; min-width: 0; }
.lb-who b, .lb-who small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-bar { display: block; height: 3px; margin-top: 4px; background: var(--seam); border-radius: 2px; overflow: hidden; }
.lb-bar i { display: block; height: 100%; background: var(--fuel); }
.lb-score { font-size: 1.1rem; }
.lb-me { margin: 8px 0 0; padding: 6px 10px; border: 1px dashed var(--seam); border-radius: var(--radius-m); font-size: .88rem; }
.lb-note { margin: 10px 0 0; }

/* ---- Pyfa stats (doctrines) ------------------------------------------------------------------- */
.fitwin { --fw-service: #d55181; }
.fw-service { --fw-c: var(--fw-service); }
.pyfa[aria-busy="true"] { opacity: .55; transition: opacity .15s; }
.pyfa-head { flex-wrap: wrap; gap: 8px; }
.pyfa-as { display: flex; align-items: center; gap: 8px; margin: 0; }
.pyfa-as label { font-size: .85rem; color: var(--dim); white-space: nowrap; }
.pyfa-as select { max-width: 230px; }
.pyfa-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 10px; margin-bottom: 14px; }
.pyfa-tile { display: flex; flex-direction: column; padding: 10px 12px; background: var(--plate-2); border: 1px solid var(--seam); border-radius: 3px; min-width: 0; }
.pyfa-big { font: 700 1.7rem/1.15 var(--font-head); font-variant-numeric: tabular-nums; margin: 2px 0; overflow-wrap: anywhere; }
.pyfa-big small { font-size: .9rem; color: var(--dim); font-weight: 600; }
.pyfa-cap { font-size: 1.25rem; padding-top: 4px; }
.pyfa-cap.is-unstable { color: var(--caution); }
.pyfa-resists { width: 100%; border-collapse: collapse; font-size: .9rem; margin-bottom: 14px; }
.pyfa-resists th, .pyfa-resists td { padding: 5px 6px; text-align: left; border-bottom: 1px solid var(--seam); }
.pyfa-resists thead th { font-size: .78rem; color: var(--dim); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.pyfa-resists td.num, .pyfa-resists th.num { text-align: right; }
.pyfa-res { display: block; height: 4px; margin-top: 3px; background: var(--seam); border-radius: 2px; overflow: hidden; }
.pyfa-res i { display: block; height: 100%; background: var(--dmg, var(--dim)); border-radius: 2px; }
.dmg-em { --dmg: var(--s1); } .dmg-thermal { --dmg: var(--s8); } .dmg-kinetic { --dmg: var(--dim); } .dmg-explosive { --dmg: var(--s4); }
.pyfa-bars { display: grid; gap: 8px; margin-bottom: 14px; }
.pyfa-bar { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; font-size: .88rem; }
.pyfa-bar-label { color: var(--dim); }
.pyfa-bar-val b { color: var(--hostile); }
.pyfa-track { grid-column: 1 / -1; height: 6px; background: var(--seam); border-radius: 3px; overflow: hidden; }
.pyfa-track i { display: block; height: 100%; background: var(--fuel); border-radius: 3px; }
.pyfa-bar.is-over .pyfa-track i { background: var(--hostile); }
.pyfa-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 8px 14px; margin: 0 0 10px; }
.pyfa-facts dt { font-size: .8rem; color: var(--dim); }
.pyfa-facts dd { margin: 0; }
.pyfa-warn { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 4px; }
.pyfa-note { font-size: .8rem; margin: 0; }
.tool-form textarea { width: 100%; font-family: var(--font-mono, ui-monospace, monospace); font-size: .85rem; }
.tool-grid { align-items: start; }

/* ---- wormhole routes ------------------------------------------------------------------------- */
.wh-route { margin-bottom: 6px; }
.wh-route-path { list-style: none; display: flex; flex-wrap: wrap; gap: 3px; margin: 4px 0 2px; padding: 0; }
.wh-route-path li { width: 11px; height: 11px; border-radius: 2px; background: var(--wk, var(--seam)); }
.wh-route-path li.k-unknown { --wk: var(--seam); }
.wh-route-path li.is-chain { outline: 2px solid var(--signal); outline-offset: 1px; }
.wh-route-note { font-size: .78rem; margin: 4px 0 0; }
@media (max-width: 560px) { .pyfa-resists .pyfa-ehp { display: none; } .pyfa-resists th, .pyfa-resists td { padding: 5px 4px; } }

/* ---- member audit: account at a glance -------------------------------------------------------- */
.glance-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.glance { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.glance-title { display: flex; align-items: center; gap: 14px; margin: 10px 0 0; font: 700 1.35rem/1.1 var(--font-head);
  letter-spacing: .14em; text-transform: uppercase; color: var(--signal); }
.glance-title::before, .glance-title::after { content: ""; flex: 1; height: 1px; background: var(--seam); }
.glance-title small { font: 500 .8rem var(--font-body); letter-spacing: 0; text-transform: none; color: var(--dim); }
.glance-note { margin: 0; font-size: .82rem; text-align: center; }
.glance-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 26px; }
.glance-groups { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.ggroup { background: var(--plate); border: 1px solid var(--seam); border-radius: var(--radius-m, 4px); overflow: hidden;
  min-width: 0; max-width: 100%; }
.ggroup h3 { margin: 0; padding: 8px 14px; background: var(--plate-2); border-bottom: 1px solid var(--seam); text-align: center;
  font: 600 1rem var(--font-head); letter-spacing: .04em; }
.ggroup-tiles { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 4px; padding: 12px 10px 10px; }
.ggroup-wide { flex: 1 1 320px; }
.ggroup-wide > p { padding: 12px 14px; margin: 0; }
.gtile { width: 84px; display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; color: var(--dim); }
.gtile .gi { width: 44px; height: 44px; padding: 9px; box-sizing: border-box; border: 2px solid var(--seam); border-radius: 10px;
  background: var(--plate-2); fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.gtile b { font: 700 1.05rem/1.1 var(--font-head); color: var(--dim); }
.gtile small { font-size: .7rem; line-height: 1.2; color: var(--dim); }
.gtile.is-on .gi { border-color: var(--fuel); color: var(--signal); }
.gtile.is-on b { color: var(--fuel); }
.gtile.is-warn .gi { border-color: var(--caution); color: var(--caution); }
.gtile.is-warn b { color: var(--caution); }
.glance-top .gtile { width: 108px; }
.gtile-text { width: auto; min-width: 84px; padding: 6px 8px; border: 2px solid var(--seam); border-radius: 8px; background: var(--plate-2); }
.gtile-text .gname { font: 600 .9rem var(--font-head); }
.gtile-text.is-on { border-color: var(--fuel); color: var(--signal); }
.gtile-text.is-past { border-style: dashed; color: var(--signal); }
.glance-heat { margin: 0; }
.glance-heat .panel-head { flex-wrap: wrap; gap: 4px 12px; }
.glance-heat h3 { margin: 0; }
.heat-scroll { overflow-x: auto; padding-bottom: 4px; }
.heat { display: grid; grid-template-columns: 84px repeat(var(--days), minmax(7px, 1fr)); grid-auto-rows: 13px; gap: 2px 1px;
  min-width: calc(84px + var(--days) * 8px); padding-right: 26px; }
.heat-label { font-size: .7rem; line-height: 13px; color: var(--dim); white-space: nowrap; padding-right: 6px; text-align: right; }
.heat-label.is-band { font-variant-numeric: tabular-nums; }
.heat-gap { grid-column: 1 / -1; height: 4px; }
.hc { display: block; border-radius: 2px; background: var(--plate-2); --h: var(--s1); }
.hc.wk { box-shadow: inset 1px 0 0 var(--seam); }
.hc.k-isk { --h: var(--s3); } .hc.k-m3 { --h: var(--s4); } .hc.k-act { --h: var(--s1); }
.hc.l1 { background: color-mix(in srgb, var(--h) 28%, var(--plate-2)); }
.hc.l2 { background: color-mix(in srgb, var(--h) 45%, var(--plate-2)); }
.hc.l3 { background: color-mix(in srgb, var(--h) 62%, var(--plate-2)); }
.hc.l4 { background: color-mix(in srgb, var(--h) 80%, var(--plate-2)); }
.hc.l5 { background: var(--h); }
.heat .hc:hover { outline: 2px solid var(--signal); outline-offset: 0; }
.heat-axis { grid-column: 2 / -1; display: grid; grid-template-columns: repeat(var(--days), minmax(7px, 1fr)); height: 18px; }
.heat-axis span { font-size: .68rem; color: var(--dim); white-space: nowrap; }
.heat-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; margin-top: 8px; font-size: .8rem; }
.heat-tip { color: var(--signal); min-height: 1.3em; }
.heat-legend { display: flex; align-items: center; gap: 3px; color: var(--dim); }
.heat-legend span { margin: 0 3px 0 10px; }
.heat-legend .hc { width: 11px; height: 11px; }
@media (max-width: 560px) { .gtile { width: 72px; } .glance-top .gtile { width: 96px; } .glance-title { font-size: 1.1rem; gap: 8px; } }

/* ---- spreadsheet conditions ------------------------------------------------------------------- */
.sheet-grid td.is-bool { text-align: center; }
.cf-good { --cf: var(--s3); } .cf-warn { --cf: var(--caution); } .cf-bad { --cf: var(--hostile); }
.cf-info { --cf: var(--s1); } .cf-muted { --cf: var(--dim); }
.sheet-grid td[class*="cf-"]:not(.cf-bold), .cf-swatch:not(.cf-bold) { background: color-mix(in srgb, var(--cf) 22%, transparent);
  color: color-mix(in srgb, var(--cf) 70%, var(--signal)); }
.sheet-grid td.cf-bold, .cf-swatch.cf-bold { font-weight: 700; color: var(--signal); }
.sheet-grid td.is-sel[class*="cf-"] { background: color-mix(in srgb, var(--cf, var(--fuel)) 30%, transparent); }
.sheet-rules { display: grid; gap: 8px; padding: 12px 14px; }
.sheet-rules-head h3 { margin: 0; }
.sheet-rules-head p, .sheet-rules-empty { margin: 2px 0 0; font-size: .85rem; }
.sheet-rule-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.sheet-rule { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.sheet-rule input, .sheet-rule select { padding: 5px 8px; font-size: .88rem; width: auto; }
.sheet-rule .r-range { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; text-transform: uppercase; }
.sheet-rule .r-and { color: var(--dim); font-size: .85rem; }
.cf-swatch { display: inline-block; padding: 3px 8px; border-radius: 3px; font-size: .82rem; border: 1px solid var(--seam);
  font-variant-numeric: tabular-nums; }

/* ---- blacklist ------------------------------------------------------------------------------- */
.bl-add h2 { margin-top: 0; }
.bl-add-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 10px 14px; margin-bottom: 10px; }
.bl-add-grid label { display: grid; gap: 4px; font-size: .9rem; }
.bl-add-grid .bl-notes { grid-column: 1 / -1; }
.bl-add .actions { align-items: center; }
.bl-filter { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.bl-filter input { width: 220px; max-width: 100%; }
.bl-notes-view summary { cursor: pointer; color: var(--dim); font-size: .82rem; }
.bl-notes-view p { margin: 4px 0 0; font-size: .88rem; }
