/* Ship tree — RustyBot styling
   Palette, font stack and breadcrumb follow the rest of rustybot.co.uk. */
:root {
  --bg: #121212;
  --panel: #1e1e1e;
  --panel-2: #2a2a2a;
  --line: #333;
  --line-strong: #444;
  --text: #e0e0e0;
  --dim: #aaa;
  --accent: #e8d900;
  --accent-hover: #f5e53b;
  --accent-dark: #b5a800;
  --accent-dim: rgba(232, 217, 0, .14);
  --ok: #4caf50;
  --warn: #ff9800;
  --bad: #f44336;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  display: flex;
  flex-direction: column;
  /* panning the tree must not paint a blue text selection across the canvas */
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
/* inputs still need to be usable */
input { user-select: text; -webkit-user-select: text; }
/* keyboard focus is visible everywhere (mouse clicks stay outline-free) */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
svg :focus-visible { outline: none; }        /* SVG outline is unreliable; tiles use .tile-mark */

/* ---------------------------------------------------------------- top bar */

#topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 8px 14px;
  background: var(--panel);
  border-bottom: 1px solid var(--line-strong);
  flex: none; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand .logo { width: 36px; height: 36px; border-radius: 4px; }
.brand-text { display: flex; flex-direction: column; }
.breadcrumb {
  display: flex; align-items: center; gap: 7px;
  font-size: .7rem; line-height: 1.2; margin-bottom: 1px;
}
.breadcrumb-item { display: flex; align-items: center; gap: 7px; }
.breadcrumb-item:not(:last-child)::after { content: '/'; color: var(--dim); }
.breadcrumb-item a { color: var(--dim); text-decoration: none; transition: color .2s; }
.breadcrumb-item a:hover { color: var(--accent); }
.breadcrumb-item:last-child a { color: #dfeffb; font-weight: 500; }
#topbar h1 {
  font-size: 1.15rem; font-weight: 600; letter-spacing: .3px;
  line-height: 1.15; white-space: nowrap;
}
#topbar h1 .accent { color: var(--accent); }
#topbar h1 small {
  margin-left: 9px; font-size: .62rem; letter-spacing: .6px;
  color: var(--dim); font-weight: 400; text-transform: uppercase;
}
.fld { position: relative; }
#q {
  width: 260px; padding: 7px 9px;
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 5px;
  font: inherit; font-size: 13px;
}
#q:focus { outline: none; border-color: var(--accent); }
#hits {
  position: absolute; top: 100%; left: 0; right: 0; margin-top: 3px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 5px;
  max-height: 340px; overflow-y: auto; display: none; z-index: 30;
}
#hits.open { display: block; }
.hit {
  display: flex; align-items: center; gap: 9px;
  padding: 5px 8px; cursor: pointer; font-size: 13px;
}
.hit:hover, .hit.on { background: #2a2a2a; }
.hit img { width: 26px; height: 26px; border-radius: 4px; background: #000; }
.hit .kind { margin-left: auto; font-size: 10px; letter-spacing: 1px; color: var(--dim); text-transform: uppercase; }
.tools { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chips { display: flex; border: 1px solid var(--line); border-radius: 5px; overflow: hidden; }
.chips button, .chip {
  background: transparent; border: 0; color: var(--dim);
  font: inherit; font-size: 11px; letter-spacing: 1px; text-transform: uppercase;
  padding: 6px 10px; cursor: pointer;
}
.chips button + button { border-left: 1px solid var(--line); }
.chip { border: 1px solid var(--line); border-radius: 5px; }
.chips button:hover, .chip:hover { color: var(--text); }
.chips button.on, .chip.on { background: var(--accent-dim); color: var(--accent); }
/* a chip whose data is not available yet (e.g. mastery V before skills load) */
.chips button:disabled, .chip:disabled { opacity: .45; cursor: not-allowed; }
.chips button:disabled:hover, .chip:disabled:hover { color: var(--dim); }
.zoomer { display: flex; gap: 4px; }
.zoomer button {
  background: var(--panel-2); border: 1px solid var(--line); color: var(--dim);
  border-radius: 5px; width: 28px; height: 28px; cursor: pointer; font: inherit;
}
.zoomer button:hover { color: var(--accent); border-color: var(--accent); }

/* ---------------------------------------------------------------- stage */

#main { flex: 1; min-height: 0; display: flex; }
#stage { flex: 1; min-width: 0; position: relative; overflow: hidden; }
#canvas { width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
#canvas.dragging { cursor: grabbing; }
#empty[hidden] { display: none; }
#empty {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--dim); font-size: 13px; letter-spacing: 1px; pointer-events: none;
}
/* a hard failure (data missing/corrupt) gets a readable card, not the status line */
.error-box[hidden] { display: none; }
.error-box {
  position: absolute; inset: 0; z-index: 30; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px; text-align: center;
  background: var(--bg); color: var(--text); padding: 24px;
}
.error-box h2 { font-size: 15px; letter-spacing: .5px; color: var(--bad); }
.error-box p { font-size: 12.5px; color: var(--dim); max-width: 460px; line-height: 1.5; }
.error-box code { color: var(--accent); font-size: 12px; }
/* screen-reader-only announcements (live region) */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
/* mobile drawer backdrop */
#scrim[hidden] { display: none; }
#scrim {
  position: absolute; inset: 0; z-index: 14; background: rgba(0,0,0,.5);
  border: 0; opacity: 0; pointer-events: none; transition: opacity .2s;
}
#scrim.show { opacity: 1; pointer-events: auto; cursor: pointer; }


/* lane band */
.band-bg { fill: #171717; stroke: #333; stroke-width: 1; }
.band-head { fill: #242424; }
.band-head-line { stroke: var(--accent); stroke-opacity: .5; stroke-width: 2; }
.band-title {
  fill: var(--text); font-size: 13px; font-weight: 700; letter-spacing: 2px;
  text-transform: uppercase;
}
.band-count { fill: var(--dim); font-size: 11px; letter-spacing: 1px; }
.row-label {
  fill: var(--dim); font-size: 9.5px; letter-spacing: 1.4px; text-transform: uppercase;
}
.band-sub { fill: var(--dim); font-size: 9px; letter-spacing: 1.2px; text-transform: uppercase; }

/* ship tiles */
.tile-box { fill: #242424; stroke: #3a3a3a; stroke-width: 1; }
.tile-plate { fill: url(#tileGlow); }
.tile-accent { fill: #444; }
/* the renders are dark silhouettes; lift them a little off the dark tile.
   The lit plate below does most of the work - a big brightness boost just
   blows out the nebula backgrounds baked into CCP's icons. */
.tile-img { filter: brightness(1.12) contrast(1.05); }
.tile-name { fill: #e0e0e0; font-size: 8px; letter-spacing: .1px; }
.tile-hit { fill: transparent; cursor: pointer; }
.ship.t1 .tile-accent { fill: #4a6b96; }
.ship.t2 .tile-accent { fill: #2f8f5f; }
.ship.faction .tile-accent { fill: #c8a45a; }
.ship.t3 .tile-accent { fill: #8a5fb0; }
.ship.storyline .tile-accent { fill: #b06a3a; }
.ship.premium .tile-accent, .ship.limited .tile-accent { fill: #b04a6a; }
/* Flyability is ONLY the left bar: green = can fly, orange = partial, red = can't.
   The tile box keeps its neutral border, and selection is still gold. */
.ship.fly .tile-accent { fill: var(--ok); }
.ship.partial .tile-accent { fill: var(--warn); }
.ship.no .tile-accent { fill: var(--bad); }
/* hover / selection show as a bar under the tile, not a box around it */
.tile-mark { fill: var(--accent); opacity: 0; }
.ship.lit .tile-mark { opacity: .7; }
.ship.selected .tile-mark { opacity: 1; }
.ship.match .tile-box { stroke: #f5e53b; stroke-width: 2; }

/* hovering a hull or a skill row lights the matching hulls — no connector lines */


/* skills side panel */
.hint {
  font-size: 11.5px; line-height: 1.45; color: var(--dim);
  border-left: 2px solid var(--accent); padding: 2px 0 2px 9px;
}
.skill-tree { display: flex; flex-direction: column; }
.skill-row {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 0 4px var(--indent, 0);
  border-bottom: 1px solid #2a2a2a; font-size: 12.5px;
  transition: background .12s;
}
.skill-row:last-child { border-bottom: 0; }
.skill-row:hover { background: #2a2a2a; }
.skill-row.flash { background: var(--accent-dim); }
.skill-row .lvl {
  flex: none; min-width: 26px; text-align: center; cursor: pointer;
  border: 1px solid var(--line); border-radius: 4px; padding: 0 5px;
  color: var(--accent); font-weight: 700; font-size: 12px;
}
.skill-row .lvl:hover { border-color: var(--accent); }
.skill-row .lvl.have { background: var(--accent-dim); }
.skill-row .nm { flex: 1; min-width: 0; }
.skill-row .nm small { display: block; color: var(--dim); font-size: 10px; letter-spacing: .4px; }
.skill-row.support .nm { color: #c4c4c4; }
/* hull stat grid + market price */
.statgrid { display: flex; flex-direction: column; }
.stat {
  display: flex; align-items: baseline; gap: 10px;
  padding: 3px 0; border-bottom: 1px solid #2a2a2a; font-size: 12px;
}
.stat:last-child { border-bottom: 0; }
.stat span { flex: 1; color: var(--dim); font-size: 11px; letter-spacing: .3px; }
.stat b { color: var(--text); font-weight: 600; }
.stat b.isk { color: var(--accent); }
.stat b.dim { color: var(--dim); font-weight: 400; }
.stat i.arrow { color: var(--dim); font-style: normal; }
.stat b.yours { color: var(--accent); cursor: help; }
.note-dim { font-size: 11px; color: var(--dim); line-height: 1.45; }
/* a skill the selected hull actually needs */
.skill-row.needed { background: rgba(200, 164, 90, .07); box-shadow: inset 2px 0 0 var(--accent); }
.skill-row.needed .nm { color: #f0f0f0; }
.skill-row.needed .nm small { color: var(--accent); }

/* skill plan pane: target selector, totals, export buttons, ordered steps */
.plan-modes { display: flex; gap: 2px; margin-bottom: 10px; }
.plan-mode {
  flex: 1; padding: 5px 3px 4px;
  font: inherit; font-size: 9.5px; font-weight: 600; letter-spacing: 1px;
  text-transform: uppercase; text-align: center;
  color: var(--dim); background: var(--panel-2);
  border: 1px solid var(--line); cursor: pointer;
  transition: color .15s, background .15s;
}
.plan-mode:first-child { border-radius: 3px 0 0 3px; }
.plan-mode:last-child { border-radius: 0 3px 3px 0; }
.plan-mode:hover:not(:disabled) { color: var(--text); }
.plan-mode.on { color: var(--accent); background: var(--accent-dim); border-color: var(--line-strong); }
.plan-mode:disabled { opacity: .4; cursor: default; }
.plan-summary { font-size: 12px; color: var(--text); margin-bottom: 9px; line-height: 1.4; }
.plan-summary b { color: var(--accent); }
.plan-summary .dim { color: var(--dim); }
.plan-actions { display: flex; gap: 6px; margin-bottom: 12px; }
.plan-actions .ghost { flex: 1; }
.plan-row .lvl { color: var(--dim); }
.plan-row .lvl.have { color: var(--ok); }
.lane-toggle rect { stroke-opacity: .8; }
.lane-toggle:hover rect { stroke: var(--accent); }
.lane-toggle:hover text { fill: var(--accent); }
.lane-toggle:focus-visible rect, .lane-toggle:focus rect { stroke: var(--accent); stroke-width: 2; }

/* ---------------------------------------------------------------- panel */

#panel {
  flex: none; width: 340px; background: var(--panel);
  border-left: 1px solid var(--line);
  display: flex; flex-direction: column; overflow: hidden;
  transition: width .26s cubic-bezier(.4, 0, .2, 1), opacity .2s ease;
}
/* the panel slides out by animating its width to 0 (display:none can't animate) */
#panel.hidden { width: 0; border-left-width: 0; opacity: 0; pointer-events: none; }
/* fixed content width so nothing reflows while the panel slides */
/* fixed content width so nothing reflows while the panel slides; the body keeps
   its flex sizing so it is the part that scrolls */
#panel .panel-head, #panel .panel-foot { width: 340px; flex: none; }
#panel .panel-body { width: 340px; }
/* the head, tabs and foot stay put; only the body scrolls between them */
#panel .panel-head, #skillsPanel .panel-head { position: sticky; top: 0; z-index: 2; }
#panel .panel-body, #skillsPanel .panel-body { flex: 1 1 auto; overflow-y: auto; min-height: 0; }
/* right-panel footer: the per-hull links sit left of the faction logo, outside
   every pane, so they survive a tab switch */
#panel .panel-foot {
  width: 340px; flex: none;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 7px 12px 8px; border-top: 1px solid var(--line);
}
#panel .panel-foot .links { flex: 1; min-width: 0; }
#panel .panel-foot .panel-logo { padding: 0; border: none; flex: none; }
.panel-logo {
  flex: none; display: flex; justify-content: flex-end; align-items: flex-end;
  padding: 4px 12px 10px; border-top: 1px solid var(--line);
}
.panel-logo img { width: 64px; height: 64px; opacity: .4; display: block; }
.panel-emblem {
  width: 64px; height: 64px; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 22px; color: #121212; opacity: .4;
  clip-path: polygon(0 0, 100% 0, 100% 72%, 72% 100%, 0 100%);
}
.emblem-star { font-size: 1.4em; line-height: 1; }

/* ------------------------------------------------------- right-panel tabs */

/* fixed width like the head and body, so nothing reflows under the panel */
#panel .panel-tabs { width: 340px; flex: none; box-sizing: border-box; }
.panel-tabs {
  display: flex; gap: 2px;
  padding: 0 10px 8px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.panel-tab {
  flex: 1; padding: 6px 4px 5px;
  font: inherit; font-size: 9.5px; font-weight: 600; letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--dim); background: var(--panel-2);
  border: 1px solid var(--line); border-bottom: none;
  cursor: pointer; transition: color .15s, background .15s;
}
.panel-tab:first-child { border-radius: 3px 0 0 0; }
.panel-tab:last-child { border-radius: 0 3px 0 0; }
.panel-tab:hover { color: var(--text); }
.panel-tab.on {
  color: var(--accent); background: var(--accent-dim);
  border-color: var(--line-strong);
  box-shadow: inset 0 2px 0 var(--accent);
}
.panel-tab:focus-visible { outline: 1px solid var(--accent); outline-offset: -2px; }
.pane[hidden] { display: none; }

/* ---------------------------------------------------------- hull description */

.lore { font-size: 12px; line-height: 1.55; color: #b9b9b9; }
.lore p { margin-bottom: 8px; }
.lore p:last-child { margin-bottom: 0; }
.lore i { color: #d6d6d6; }
.lore.clamped {
  display: -webkit-box; -webkit-line-clamp: 4; line-clamp: 4;
  -webkit-box-orient: vertical; overflow: hidden;
}
.lore-toggle {
  align-self: flex-start; margin-top: -6px;
  background: transparent; border: none; color: var(--accent);
  font: inherit; font-size: 10px; letter-spacing: 1px; text-transform: uppercase;
  cursor: pointer; padding: 2px 0;
}
.lore-toggle:hover { color: var(--accent-hover); }
#panel .stat i { color: var(--dim); font-style: normal; letter-spacing: 1px; }

/* ----------------------------------------------------------------- compare */

#panelCompare {
  position: absolute; top: 10px; right: 42px;
  background: transparent; border: 1px solid var(--line); color: var(--dim);
  border-radius: 5px; width: 24px; height: 24px; cursor: pointer; font: inherit;
}
#panelCompare:hover { color: var(--accent); border-color: var(--accent); }
#panelCompare.armed {
  color: var(--accent); border-color: var(--accent); background: var(--accent-dim);
  animation: cmpPulse 1.1s ease-in-out infinite;
}
@keyframes cmpPulse { 50% { background: rgba(232, 217, 0, .3); } }
@media (prefers-reduced-motion: reduce) { #panelCompare.armed { animation: none; } }

.cmp-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.cmp-head img {
  width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 5px;
  background: radial-gradient(circle at 50% 40%, #2a3340, #14181f);
}
.cmp-head b {
  flex: none; width: 14px; height: 14px; line-height: 14px; text-align: center;
  font-size: 9px; color: var(--accent); border: 1px solid var(--accent); border-radius: 3px;
}
.cmp-head span { font-size: 13px; font-weight: 600; }
.cmp-row {
  display: grid; grid-template-columns: 1fr 74px 74px; gap: 4px;
  padding: 2px 0; font-size: 11px; align-items: baseline;
}
.cmp-row .ck { color: var(--dim); }
.cmp-row .cv { text-align: right; font-variant-numeric: tabular-nums; }
.cmp-row .cv.win { color: var(--accent); font-weight: 700; }
.cmp-sk {
  display: flex; justify-content: space-between; gap: 8px;
  padding: 3px 0 3px 8px; border-left: 2px solid var(--line-strong);
  font-size: 12px; color: #cfcfcf;
}
.cmp-sk b { color: var(--accent); font-size: 11px; }
.cmp-sk.a { border-left-color: #4a6b96; }
.cmp-sk.b { border-left-color: #4a6b96; }
.cmp-sk.none { color: var(--dim); border-left-color: transparent; }
.cmp-clear {
  align-self: flex-start; margin-top: 6px;
  font-size: 10px; letter-spacing: 1px; text-transform: uppercase;
  color: var(--dim); background: transparent; border: 1px solid var(--line);
  border-radius: 4px; padding: 4px 8px; cursor: pointer;
}
.cmp-clear:hover { color: var(--accent); border-color: var(--accent); }
.bonus-line.flash { background: var(--accent-dim); border-left-color: var(--accent); }

/* -------------------------------------------------------- grouped search hits */

.hit-group {
  display: flex; justify-content: space-between;
  padding: 5px 10px 3px; color: var(--accent);
  font-size: 9px; letter-spacing: 1.6px; text-transform: uppercase;
}
.hit-group span { color: var(--dim); }
.hit .why {
  margin-left: auto; max-width: 46%; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
  color: var(--dim); font-size: 10px;
}

/* ----------------------------------------------------------------- bonuses */

.bonus-list, .bonus-group { margin-bottom: 10px; }
.bonus-line {
  display: flex; gap: 8px; align-items: baseline;
  padding: 3px 0 3px 8px;
  border-left: 2px solid var(--line-strong);
  font-size: 12px; color: #cfcfcf;
}
.bonus-line:hover { border-left-color: var(--accent); }
.bonus-line .bn {
  flex: none; min-width: 46px; text-align: right;
  color: var(--accent); font-weight: 700; font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}
.bonus-line .bn.none { min-width: 0; }
.bonus-line .bt { flex: 1; }
.bonus-src {
  display: flex; align-items: baseline; gap: 7px;
  margin: 10px 0 5px; padding-bottom: 3px;
  border-bottom: 1px dashed var(--line);
  font-size: 11px;
}
.bonus-src b { color: var(--text); font-weight: 600; }
.bonus-src small {
  color: var(--dim); font-size: 9.5px; letter-spacing: .6px; text-transform: uppercase;
}

/* left skills panel */
#skillsPanel {
  flex: none; width: 300px; background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; overflow: hidden;
  transition: width .26s cubic-bezier(.4, 0, .2, 1), opacity .2s ease;
}
#skillsPanel.hidden { width: 0; border-right-width: 0; opacity: 0; pointer-events: none; }
#skillsPanel .panel-head, #skillsPanel .panel-logo { width: 300px; flex: none; }
#skillsPanel .panel-body { width: 300px; }
#skillsPanel .panel-head { border-bottom: 1px solid var(--line); }
#skillsPanel .panel-body { padding: 12px 12px 20px; display: flex; flex-direction: column; gap: 12px; }
.panel-head {
  position: relative; padding: 12px 44px 12px 14px;
  border-bottom: 1px solid var(--line-strong);
  background: var(--panel-2);
}
/* The hull picture lives in the head, not in a pane, so it stays put while the
   overview/stats/bonuses tabs switch underneath it. Scoped to #panel: the left
   skills panel shares .panel-head but has no picture, and its kicker/title/sub
   must stay stacked rather than laid out in a row. */
#panel .panel-head { display: flex; gap: 11px; align-items: center; }
#panel .panel-head .head-txt { flex: 1; min-width: 0; }
.panel-head .head-img {
  flex: none; width: 68px; height: 68px;
  border: 1px solid var(--line); border-radius: 6px;
  background: radial-gradient(circle at 50% 40%, #2a3340, #14181f);
}
.panel-head .kicker {
  font-size: 9.5px; letter-spacing: 1.8px; text-transform: uppercase; color: var(--accent);
}
.panel-head h2 { font-size: 19px; font-weight: 700; letter-spacing: .5px; }
.panel-head .sub { font-size: 11px; color: var(--dim); }
#panelClose {
  position: absolute; top: 10px; right: 10px;
  background: transparent; border: 1px solid var(--line); color: var(--dim);
  border-radius: 5px; width: 24px; height: 24px; cursor: pointer; font: inherit;
}
#panelClose:hover { color: var(--accent); border-color: var(--accent); }
.panel-body { padding: 12px 14px 20px; display: flex; flex-direction: column; gap: 14px; }
.chips-row { display: flex; flex-wrap: wrap; gap: 5px; }
.tag {
  font-size: 9.5px; letter-spacing: 1px; text-transform: uppercase;
  border: 1px solid var(--line); border-radius: 4px; padding: 2px 6px; color: var(--dim);
}
.tag.tier { color: var(--accent); border-color: rgba(200,164,90,.4); }
.tag.t1 { color: #7f9cc4; }
.tag.t2 { color: #4fbf85; }
.tag.faction { color: var(--accent); }
.tag.t3 { color: #a878d0; }
.tag.alpha { color: var(--ok); border-color: rgba(63,185,80,.4); }
.tag.omega { color: #e0a45c; border-color: rgba(224,164,92,.45); }
.sect { font-size: 9.5px; letter-spacing: 1.8px; text-transform: uppercase; color: var(--dim); }
.req {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 0; border-bottom: 1px solid #2a2a2a; font-size: 13px;
}
.req:last-child { border-bottom: 0; }
.req .lvl {
  min-width: 30px; text-align: center; cursor: pointer;
  border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px;
  color: var(--accent); font-weight: 700; font-size: 12px;
}
.req .lvl:hover { border-color: var(--accent); }
.req .lvl.have { background: var(--accent-dim); }
.req .nm { flex: 1; }
.req .nm small { display: block; color: var(--dim); font-size: 10px; }
.req.missing .nm { color: var(--warn); }
.verdict {
  border: 1px solid var(--line); border-radius: 5px; padding: 9px 11px;
  font-size: 13px; letter-spacing: .3px;
}
.verdict.ok { border-color: rgba(63,185,80,.5); color: var(--ok); }
.verdict.next { border-color: rgba(216,161,58,.5); color: var(--warn); }
.verdict.no { border-color: rgba(224,82,79,.5); color: var(--bad); }
.verdict.unknown { border-color: #444; color: var(--dim); }
.verdict.omega { border-color: rgba(224,164,92,.5); color: #e0a45c; }
/* omega-only marker on hull tiles */
.omega-pill { fill: rgba(224, 164, 92, .16); stroke: rgba(224, 164, 92, .55); stroke-width: 1; }
.omega-badge { fill: #e0a45c; font-size: 10px; font-weight: 700; }
.links { display: flex; flex-wrap: wrap; gap: 6px; }
.links a {
  color: var(--accent); text-decoration: none; font-size: 11px;
  letter-spacing: 1px; text-transform: uppercase;
  border: 1px solid var(--line); border-radius: 5px; padding: 5px 9px;
}
.links a:hover { border-color: var(--accent); background: var(--accent-dim); }

/* ---------------------------------------------------------------- status */

#status {
  flex: none; display: flex; align-items: center; gap: 16px;
  padding: 5px 14px; border-top: 1px solid var(--line);
  background: var(--panel); color: var(--dim); font-size: 11px; letter-spacing: .8px;
}
#status b { color: var(--accent); font-weight: 600; }

/* ---------------------------------------------------------------- popover */

.pop {
  position: absolute; z-index: 40; background: var(--panel);
  border: 1px solid var(--line-strong); border-radius: 8px; padding: 12px 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,.6);
}
.pop.hidden { display: none; }
.pop h3 { font-size: 10px; letter-spacing: 1.8px; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.pop label { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--dim); }
.pop input {
  width: 64px; padding: 4px 6px; background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 4px; font: inherit; font-size: 12px;
}
.pop .note { margin-top: 8px; font-size: 10.5px; color: var(--dim); }
.pop .reset { margin-top: 10px; width: 100%; }
button.ghost {
  background: transparent; border: 1px solid var(--line); color: var(--dim);
  border-radius: 5px; padding: 5px 10px; font: inherit; font-size: 11px;
  letter-spacing: 1px; text-transform: uppercase; cursor: pointer;
}
button.ghost:hover { color: var(--accent); border-color: var(--accent); }

/* faction key */
#keyPop { width: 372px; }
.pop-hint { color: var(--dim); font-weight: 400; letter-spacing: 1px; text-transform: none; }
#keyGrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.key-item {
  display: flex; align-items: center; gap: 7px; min-width: 0;
  background: transparent; border: 1px solid var(--line); border-radius: 5px;
  padding: 5px 6px; cursor: pointer; font: inherit; text-align: left;
  color: var(--text);
}
.key-item:hover { border-color: var(--accent); background: var(--accent-dim); }
.key-item.off { opacity: .4; }
.key-emblem {
  flex: none; width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; letter-spacing: .5px; color: #121212;
  clip-path: polygon(0 0, 100% 0, 100% 72%, 72% 100%, 0 100%);
}
.key-item .key-txt { min-width: 0; overflow: hidden; }
.key-item .key-name {
  display: block; font-size: 11px; line-height: 1.15; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.key-item .key-count { display: block; font-size: 9.5px; color: var(--dim); letter-spacing: .6px; }

/* the lane whose skills the left panel is showing */
.band.focused .band-bg { stroke: rgba(200, 164, 90, .55); stroke-width: 1.5; }
.band.focused .band-title { fill: var(--accent); }
.band.focused .band-head { fill-opacity: .3; }

/* the band you jumped to, briefly outlined */
.band.flash .band-bg { stroke: var(--accent); stroke-width: 2; }

/* EVE SSO: login chip / signed-in pilot */
.auth { display: flex; align-items: center; gap: 6px; }
.auth-btn { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.auth-btn .dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
}
.pilot {
  display: flex; align-items: center; gap: 7px;
  background: var(--panel-2); border: 1px solid var(--line-strong);
  border-radius: 5px; padding: 2px 4px 2px 2px;
}
.pilot img { width: 26px; height: 26px; border-radius: 3px; display: block; }
.pilot-name { font-size: 11.5px; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pilot-btn {
  background: transparent; border: 0; color: var(--dim); cursor: pointer;
  font: inherit; font-size: 12px; line-height: 1; padding: 3px 4px; border-radius: 3px;
}
.pilot-btn:hover { color: var(--accent); background: var(--bg); }
.skill-row .lvl.locked { cursor: default; border-color: var(--line); color: var(--ok); }
.skill-row .lvl.locked.have { background: rgba(76, 175, 80, .12); }
/* the skill ESI is training at this instant */
.skill-row .lvl.locked.training {
  border-color: var(--accent); color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-dim);
}
.skill-row.queue .nm { color: #c4c4c4; }
.skill-row.queue.now .nm { color: #f0f0f0; }
.train-row {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 0; border-bottom: 1px solid var(--line); font-size: 12.5px;
}
.train-row:last-child { border-bottom: 0; }
.train-row .lvl {
  flex: none; min-width: 44px; text-align: center; font-weight: 700; font-size: 11px;
  color: var(--accent); border: 1px solid var(--line); border-radius: 4px; padding: 1px 4px;
}
.train-row .nm { flex: 1; min-width: 0; }
.train-row .nm small { display: block; color: var(--dim); font-size: 10px; }

.band-logo { opacity: .14; }
.band-emblem { pointer-events: none; }

/* collapsible faction sections */
.lane-toggle-box { fill: var(--panel-2); stroke: var(--line-strong); }
.lane-toggle:hover .lane-toggle-box { stroke: var(--accent); }
.lane-toggle-glyph { fill: var(--dim); font-size: 12px; }
.lane-toggle:hover .lane-toggle-glyph { fill: var(--accent); }
.band-collapsed-note { fill: var(--dim); font-size: 10px; letter-spacing: 1px; text-transform: uppercase; }
.band.collapsed .band-bg { fill: #171717; }
.band.collapsed .band-title { fill: var(--dim); }

/* flyability legend in the status bar */
#status .legend { display: flex; align-items: center; gap: 4px; }
#status .legend .dot {
  width: 8px; height: 8px; border-radius: 2px; display: inline-block; margin-left: 6px;
}
#status .legend .dot.ok { background: var(--ok); }
#status .legend .dot.warn { background: var(--warn); }
#status .legend .dot.bad { background: var(--bad); }

/* themed scrollbars (Firefox + WebKit/Blink) so they match the panels */
* { scrollbar-color: #3a3a3a var(--panel); scrollbar-width: thin; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--panel); }
::-webkit-scrollbar-thumb {
  background: #3a3a3a; border-radius: 6px; border: 2px solid var(--panel);
}
::-webkit-scrollbar-thumb:hover { background: #4d4d4d; }
::-webkit-scrollbar-corner { background: var(--panel); }

/* collapse / expand all, inside the faction key popover */
.key-actions { display: flex; gap: 6px; margin-bottom: 9px; }
.key-actions .ghost { flex: 1; text-align: center; }

/* real faction logos in the key grid */
.key-logo { width: 26px; height: 26px; object-fit: contain; flex: none; }

/* mastery line in the ship panel */
.mastery { display: flex; align-items: center; gap: 10px; }
.m-badge {
  flex: none; min-width: 40px; text-align: center;
  font-weight: 700; font-size: 15px; color: var(--accent);
  border: 1px solid var(--line-strong); border-radius: 5px; padding: 3px 8px;
}
.m-text { flex: 1; font-size: 12.5px; }
.m-text small { display: block; color: var(--dim); font-size: 10.5px; }

/* 2-second hover card */
.tip {
  position: absolute; z-index: 30; display: flex; gap: 10px;
  width: 300px; padding: 9px; pointer-events: none;
  background: rgba(20, 20, 20, .97); border: 1px solid var(--line-strong);
  border-radius: 8px; box-shadow: 0 12px 34px rgba(0, 0, 0, .6);
}
.tip.hidden { display: none; }
.tip img {
  width: 92px; height: 92px; flex: none; border-radius: 5px;
  background: radial-gradient(circle at 50% 42%, #33445f, #0f141d);
}
.tip-body { min-width: 0; }
.tip-name { font-size: 14px; font-weight: 600; }
.tip-sub { font-size: 10.5px; color: var(--dim); margin-bottom: 4px; }
.tip-tags { display: flex; flex-wrap: wrap; gap: 3px; margin-bottom: 5px; }
.tip-tags span {
  font-size: 9px; letter-spacing: .6px; text-transform: uppercase;
  color: var(--dim); border: 1px solid var(--line); border-radius: 3px; padding: 1px 4px;
}
.tip-line { font-size: 11px; color: var(--dim); }
.tip-line.fly { color: var(--ok); }
.tip-line.partial { color: var(--warn); }
.tip-line.no { color: var(--bad); }
.tip-line.omega { color: #e0a45c; }
.tip-needs { font-size: 10.5px; color: var(--dim); margin-top: 4px; }

/* keyboard focus on a hull tile mirrors the hover/selected marker */
.ship:focus { outline: none; }
.ship:focus-visible .tile-mark, .ship:focus .tile-mark { opacity: 1; }
.ship:focus-visible .tile-box, .ship:focus .tile-box { stroke: var(--accent); stroke-width: 2; }

/* keep the search input's options semantics invisible to layout */
#hits[role="listbox"] { list-style: none; }

/* -------------------------------------------------------------- motion */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --------------------------------------------------------- small screens */
/* Under 900px the two side panels become slide-over drawers and the header
   wraps. The canvas stays the whole stage behind them. */
@media (max-width: 900px) {
  #topbar { flex-wrap: wrap; gap: 8px; padding: 8px 10px; }
  .fld { order: 3; width: 100%; }
  #q { width: 100%; }
  .tools { margin-left: 0; width: 100%; }
  #status { flex-wrap: wrap; gap: 10px; row-gap: 2px; }
  #status > span:last-child { margin-left: 0 !important; width: 100%; }

  #main { position: relative; }
  #skillsPanel, #panel {
    position: absolute; top: 0; bottom: 0; z-index: 16;
    width: min(86vw, 340px);
    box-shadow: 0 0 40px rgba(0,0,0,.6);
    transition: transform .26s cubic-bezier(.4, 0, .2, 1), opacity .2s ease;
  }
  #skillsPanel { left: 0; border-right: 1px solid var(--line-strong); transform: translateX(-102%); }
  #panel { right: 0; border-left: 1px solid var(--line-strong); transform: translateX(102%); }
  #skillsPanel:not(.hidden), #panel:not(.hidden) { transform: none; }
  /* width:0 from the desktop rule would collapse a drawer, so keep its width */
  #skillsPanel.hidden, #panel.hidden { width: min(86vw, 340px); opacity: 1; pointer-events: none; }
  #skillsPanel .panel-head, #skillsPanel .panel-logo, #skillsPanel .panel-body,
  #panel .panel-head, #panel .panel-foot, #panel .panel-body, #panel .panel-tabs { width: auto; }
}

/* ================================================================ welcome */
/* First-load entry page (doubles as Help). Sits above the top bar + canvas. */
.welcome-dom {
  position: fixed; inset: 0; z-index: 1000;
  background: var(--bg);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.welcome-dom.hidden { display: none; }

.welcome-inner { max-width: 980px; margin: 0 auto; padding: 36px 22px 64px; }

.welcome-hero { display: flex; gap: 22px; align-items: flex-start; }
.welcome-logo { width: 76px; height: 76px; border-radius: 8px; flex: none; }
.welcome-hero-text { min-width: 0; }
.welcome-hero-text h2 { margin: 0; font-size: 1.9rem; font-weight: 700; letter-spacing: .3px; }
.welcome-hero-text h2 .accent { color: var(--accent); }
.welcome-subtitle { margin: 6px 0 0; font-size: 1.05rem; color: var(--text); }
.welcome-tagline { margin: 6px 0 0; color: var(--dim); font-size: .92rem; }

.welcome-cta-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

.welcome-cta {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 15px; border-radius: 6px; cursor: pointer;
  font: inherit; font-size: .9rem; font-weight: 600; line-height: 1;
  background: var(--accent); color: #111; border: 1px solid var(--accent);
  transition: background .15s, border-color .15s, color .15s, transform .1s;
}
.welcome-cta:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.welcome-cta:active { transform: translateY(1px); }
.welcome-cta.secondary { background: transparent; color: var(--text); border-color: var(--line-strong); }
.welcome-cta.secondary:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-dim); }
.welcome-cta.is-done { background: transparent; color: var(--ok); border-color: var(--ok); cursor: default; }

.welcome-sso {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 14px 16px; margin-top: 22px;
}
.welcome-sso-text { display: flex; align-items: center; gap: 12px; color: var(--dim); }
.welcome-sso-text > i { font-size: 1.3rem; color: var(--accent); flex: none; }
.welcome-sso-text strong { color: var(--text); display: block; margin-bottom: 2px; }
.welcome-sso-text p { margin: 0; font-size: .88rem; }

.welcome-grid {
  display: grid; gap: 12px; margin-top: 20px;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}
.welcome-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 15px 16px; cursor: pointer;
  transition: border-color .15s, background .15s, transform .1s;
}
.welcome-card:hover { border-color: var(--accent); background: var(--panel-2); }
.welcome-card:active { transform: translateY(1px); }
.welcome-card--muted { cursor: default; opacity: .72; }
.welcome-card--muted:hover { border-color: var(--line); background: var(--panel); }
.welcome-card-head {
  display: flex; align-items: center; gap: 8px;
  font-size: .74rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--accent);
}
.welcome-card-title { font-weight: 700; margin: 7px 0 5px; }
.welcome-card p { margin: 0 0 11px; color: var(--dim); font-size: .88rem; line-height: 1.5; }
.welcome-card-link { color: var(--accent); font-size: .82rem; font-weight: 600; }

.welcome-steps, .welcome-tips {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; padding: 16px 18px; margin-top: 16px;
}
.welcome-steps h3, .welcome-tips h3 { margin: 0 0 10px; font-size: 1rem; }
.welcome-steps h3 i, .welcome-tips h3 i { color: var(--accent); margin-right: 6px; }
.welcome-steps ol, .welcome-tips ul { margin: 0; padding-left: 20px; color: var(--dim); line-height: 1.8; font-size: .9rem; }
.welcome-steps em, .welcome-tips em { color: var(--text); font-style: normal; }

.welcome-dom kbd {
  background: var(--panel-2); border: 1px solid var(--line-strong);
  border-radius: 4px; padding: 1px 6px; font-family: inherit; font-size: .82em; color: var(--text);
}

.welcome-foot {
  display: flex; align-items: center; gap: 10px; margin-top: 22px;
  color: var(--dim); font-size: .84rem;
}
.welcome-foot-logo { width: 26px; height: 26px; border-radius: 4px; }

.welcome-support { margin-top: 20px; }
.welcome-support-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 20px; text-align: center;
}
.welcome-support-icon { font-size: 1.5rem; color: var(--accent); }
.welcome-support-title { margin: 8px 0 4px; font-size: 1.15rem; }
.welcome-support-desc { margin: 0 auto; max-width: 460px; color: var(--dim); font-size: .9rem; }
.ko-fi-wrap { display: flex; justify-content: center; margin-top: 14px; }

.welcome-seo { margin-top: 26px; color: var(--dim); font-size: .9rem; line-height: 1.7; }
.welcome-seo h2 { color: var(--text); font-size: 1.1rem; margin: 0 0 10px; }
.welcome-seo p { margin: 0 0 10px; }
.welcome-seo a { color: var(--accent); text-decoration: none; }
.welcome-seo a:hover { text-decoration: underline; }

.welcome-legal { margin-top: 22px; color: #777; font-size: .78rem; text-align: center; line-height: 1.6; }
.welcome-legal a { color: var(--dim); }

@media (max-width: 620px) {
  .welcome-hero { flex-direction: column; gap: 14px; }
  .welcome-hero-text h2 { font-size: 1.5rem; }
  .welcome-sso { flex-direction: column; align-items: stretch; }
  .welcome-sso .welcome-cta { justify-content: center; }
  .welcome-inner { padding: 24px 16px 52px; }
}
