/* Spice Pirates — app theme */

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    background:
        radial-gradient(1200px 600px at 80% -10%, rgba(232, 132, 44, .06), transparent 60%),
        radial-gradient(900px 500px at -10% 110%, rgba(55, 198, 208, .05), transparent 55%),
        var(--void);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Faint hex/star-map grid texture */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .015) 1px, transparent 1px);
    background-size: 34px 34px;
    mask-image: radial-gradient(circle at 50% 30%, #000 30%, transparent 90%);
}

/* -------------------- Brand marks -------------------- */
.hexmark {
    width: 30px; height: 34px;
    background: linear-gradient(160deg, var(--spice), var(--spice-deep));
    clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
    box-shadow: var(--glow-spice);
    flex: 0 0 auto;
}
.hexmark-lg { width: 46px; height: 52px; }

/* ==================== AUTH / GATE ==================== */
.auth-body { display: grid; place-items: center; padding: 24px; }
.gate-wrap { position: relative; z-index: 1; width: 100%; max-width: 400px; }
.gate-card {
    background: linear-gradient(180deg, var(--panel-2), var(--panel));
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    box-shadow: var(--shadow-hud), var(--glow-spice);
    padding: 26px 24px;
}
.brand { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.brand-title { font-family: var(--font-display); font-weight: 700; letter-spacing: .14em; font-size: 18px; }
.brand-sub { font-family: var(--font-mono); font-size: 10px; color: var(--ink-mute); letter-spacing: .18em; margin-top: 3px; }
.gate-foot { text-align: center; color: var(--ink-mute); font-size: 11px; font-style: italic; margin-top: 16px; }

/* ==================== APP SHELL ==================== */
.app-shell { position: relative; z-index: 1; display: grid; grid-template-columns: var(--rail-w) 1fr; min-height: 100vh; }

.navrail {
    display: flex; flex-direction: column;
    background: linear-gradient(180deg, var(--panel-2), var(--panel));
    border-right: 1px solid var(--hairline);
    padding: 18px 14px;
    position: sticky; top: 0; height: 100vh;
}
.navrail-brand { display: flex; align-items: center; gap: 11px; padding: 4px 6px 18px; }
.navrail-brand-text { font-family: var(--font-display); font-weight: 700; font-size: 13px; letter-spacing: .12em; line-height: 1.15; }
.navrail-nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.nav-item {
    display: flex; align-items: center; gap: 11px;
    padding: 9px 11px; border-radius: var(--radius-sm);
    color: var(--ink-dim); font-weight: 500; text-decoration: none;
    border: 1px solid transparent;
}
.nav-item:hover { background: var(--panel-3); color: var(--ink); text-decoration: none; }
.nav-item.is-active {
    background: linear-gradient(90deg, rgba(232, 132, 44, .16), rgba(232, 132, 44, .03));
    color: var(--ink);
    border-color: rgba(232, 132, 44, .35);
    box-shadow: inset 2px 0 0 var(--spice);
}
.nav-ico { font-family: var(--font-mono); width: 20px; text-align: center; color: var(--spice); font-size: 12px; }
.nav-lab { font-size: 13px; }

.navrail-foot { border-top: 1px solid var(--hairline); padding-top: 12px; margin-top: 8px; }
.who { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.who-handle { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.app-main { display: flex; flex-direction: column; min-width: 0; }

/* Status strip */
.statusstrip {
    display: flex; align-items: center; gap: 14px;
    padding: 10px 20px;
    background: var(--panel);
    border-bottom: 1px solid var(--hairline);
    font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em;
    color: var(--ink-dim);
    position: sticky; top: 0; z-index: 5;
}
.statusstrip strong { color: var(--ink); font-weight: 600; }
.strip-item { display: flex; align-items: center; gap: 7px; }
.strip-sep { width: 1px; height: 14px; background: var(--hairline-2); }
.strip-spacer { flex: 1; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-off { background: var(--ink-mute); box-shadow: 0 0 6px rgba(0,0,0,.4); }
.dot-ok { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.eve-clock strong { color: var(--cyan); }

/* Content */
.content { padding: 22px 24px 40px; }
.content-head { margin-bottom: 18px; }
.page-title { font-family: var(--font-display); font-weight: 500; letter-spacing: .06em; font-size: 22px; margin: 0; }

/* ==================== COMPONENTS ==================== */
.form { display: flex; flex-direction: column; gap: 14px; }
.form-sep { margin-top: 14px; border-top: 1px solid var(--hairline); padding-top: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-mute); }
.input {
    background: var(--void);
    border: 1px solid var(--hairline-2);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    color: var(--ink);
    font-family: var(--font-mono); font-size: 14px;
    width: 100%;
}
.input:focus { outline: none; border-color: var(--spice); box-shadow: 0 0 0 3px var(--spice-glow); }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 16px; border-radius: var(--radius-sm);
    border: 1px solid transparent; cursor: pointer;
    font-family: var(--font-body); font-weight: 600; font-size: 14px;
}
.btn-spice { background: linear-gradient(180deg, var(--spice), var(--spice-deep)); color: #1a0f04; box-shadow: var(--glow-spice); }
.btn-spice:hover { filter: brightness(1.08); text-decoration: none; }
.btn-ghost { background: transparent; border-color: var(--hairline-2); color: var(--ink-dim); cursor: pointer; }
.btn-ghost:hover { background: var(--panel-3); color: var(--ink); text-decoration: none; }
.btn-block { width: 100%; }

.btn-mini {
    background: var(--panel-3); border: 1px solid var(--hairline-2);
    color: var(--ink-dim); border-radius: 6px; padding: 4px 9px;
    font-family: var(--font-mono); font-size: 11px; cursor: pointer;
}
.btn-mini:hover { color: var(--ink); border-color: var(--spice); }
.btn-mini.danger:hover { color: #fff; border-color: var(--crit); background: rgba(192, 0, 0, .25); }

.hint { color: var(--ink-mute); font-size: 12px; margin: 2px 0 0; }
.code { background: var(--void); border: 1px solid var(--hairline); border-radius: 6px; padding: 8px 10px; font-family: var(--font-mono); font-size: 12px; color: var(--cyan); overflow-x: auto; }
code { font-family: var(--font-mono); color: var(--cyan); font-size: .92em; }

/* Notes / flashes */
.note { border-radius: var(--radius-sm); padding: 12px 14px; font-size: 13px; border: 1px solid var(--hairline-2); }
.note p { margin: 4px 0; }
.note-spice { border-color: rgba(232,132,44,.4); background: rgba(232,132,44,.08); }
.note-warn { border-color: rgba(237,125,49,.45); background: rgba(237,125,49,.08); }
.flashes { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.flash { padding: 10px 13px; border-radius: var(--radius-sm); font-size: 13px; border: 1px solid var(--hairline-2); }
.flash-success { border-color: rgba(63,185,80,.5); background: rgba(63,185,80,.1); color: #c9f2cf; }
.flash-error { border-color: rgba(192,0,0,.55); background: rgba(192,0,0,.14); color: #f2c9c9; }

/* Cards / panels */
.grid-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--gap); margin-bottom: var(--gap); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--gap); }
.card { background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 18px; }
.card-kicker { font-family: var(--font-mono); font-size: 10px; letter-spacing: .18em; color: var(--ink-mute); margin-bottom: 10px; }
.card-big { font-family: var(--font-display); font-size: 20px; font-weight: 500; margin-bottom: 6px; }

.panel { background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--hairline); border-radius: var(--radius); overflow: hidden; }
.panel-head { font-family: var(--font-mono); font-size: 11px; letter-spacing: .16em; color: var(--ink-mute); padding: 12px 16px; border-bottom: 1px solid var(--hairline); background: var(--panel); }

.ticklist { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.ticklist li { padding: 5px 0 5px 22px; position: relative; color: var(--ink-dim); }
.ticklist li::before { content: "\25A2"; position: absolute; left: 0; color: var(--ink-mute); font-family: var(--font-mono); }
.ticklist li.done { color: var(--ink); }
.ticklist li.done::before { content: "\25A0"; color: var(--ok); }

/* Empty states */
.empty { text-align: center; padding: 60px 20px; }
.empty-glyph-lg { font-family: var(--font-mono); font-size: 40px; color: var(--spice); opacity: .5; margin-bottom: 10px; }
.empty h2 { font-family: var(--font-display); font-weight: 500; margin: 0 0 8px; }
.empty-inline { display: flex; align-items: center; gap: 16px; padding: 22px 18px; }
.empty-glyph { font-family: var(--font-mono); font-size: 26px; color: var(--spice); opacity: .55; }
.empty-inline p { margin: 2px 0; }

.error-code { font-family: var(--font-display); font-size: 46px; color: var(--spice); }

/* Tables */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-mute); padding: 10px 14px; border-bottom: 1px solid var(--hairline); }
.tbl td { padding: 10px 14px; border-bottom: 1px solid rgba(42,44,54,.5); }
.tbl tbody tr:hover { background: rgba(255,255,255,.02); }
.tbl-tight td, .tbl-tight th { padding: 7px 12px; }
.mono { font-family: var(--font-mono); font-size: 12px; }
.muted { color: var(--ink-mute); }
.row-actions { display: flex; gap: 6px; }

/* Chips */
.chip { display: inline-block; padding: 2px 8px; border-radius: 999px; font-family: var(--font-mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; border: 1px solid var(--hairline-2); color: var(--ink-dim); }
.chip-admin { border-color: rgba(232,132,44,.5); color: var(--spice); background: rgba(232,132,44,.08); }
.chip-member { border-color: rgba(55,198,208,.4); color: var(--cyan); background: rgba(55,198,208,.06); }
.chip-ok { border-color: rgba(63,185,80,.5); color: var(--ok); background: rgba(63,185,80,.08); }
.chip-crit { border-color: rgba(192,0,0,.55); color: #ff6b6b; background: rgba(192,0,0,.12); }

/* Feed */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.input-sm { width: 116px; padding: 6px 9px; font-size: 12px; }
.chk { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--ink-dim); white-space: nowrap; }
.tbl-scroll { overflow-x: auto; }
.feed-tbl td { white-space: nowrap; }
.feed-tbl .num { text-align: right; font-family: var(--font-mono); }
.feed-tbl th.num { text-align: right; }
.sec { font-family: var(--font-mono); font-size: 11px; color: var(--ink-mute); }
.feed-live { float: right; font-family: var(--font-mono); font-size: 10px; color: var(--ink-mute); text-transform: none; letter-spacing: 0; }
.badge { display: inline-block; padding: 1px 6px; border-radius: 4px; font-family: var(--font-mono); font-size: 9px; text-transform: uppercase; margin-left: 4px; }
.badge-solo { background: rgba(55,198,208,.14); color: var(--cyan); }
.badge-npc { background: rgba(106,112,128,.2); color: var(--ink-mute); }
.v-mid { color: #e8c34a; }
.v-high { color: var(--orange); }
.v-crit { color: #ff6b6b; font-weight: 600; }

/* Rules / forms */
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.form-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 16px; }
.rule-form .note { margin: 6px 0; }
select.input { appearance: none; }

/* Pickers */
.picker { position: relative; background: var(--void); border: 1px solid var(--hairline-2); border-radius: var(--radius-sm); padding: 5px; }
.picker:focus-within { border-color: var(--spice); box-shadow: 0 0 0 3px var(--spice-glow); }
.picker-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.picker-chips:empty { display: none; }
.picker-chip { display: inline-flex; align-items: center; gap: 6px; background: rgba(232,132,44,.14); border: 1px solid rgba(232,132,44,.4); color: var(--ink); border-radius: 6px; padding: 2px 4px 2px 8px; font-size: 12px; }
.picker-x { background: none; border: none; color: var(--ink-dim); cursor: pointer; font-size: 15px; line-height: 1; padding: 0 2px; }
.picker-x:hover { color: #ff6b6b; }
.picker-input { background: transparent; border: none; outline: none; color: var(--ink); font-family: var(--font-mono); font-size: 13px; width: 100%; padding: 5px 4px; }
.picker-menu { display: none; position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20; background: var(--panel-2); border: 1px solid var(--hairline-2); border-radius: var(--radius-sm); box-shadow: var(--shadow-hud); max-height: 240px; overflow-y: auto; }
.picker-menu.open { display: block; }
.picker-opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 10px; cursor: pointer; font-size: 13px; }
.picker-opt:hover, .picker-opt.active { background: rgba(232,132,44,.14); }
.picker-opt-id { font-family: var(--font-mono); font-size: 11px; color: var(--ink-mute); }

/* Threat chips */
.threat-low { border-color: rgba(63,185,80,.5); color: var(--ok); background: rgba(63,185,80,.08); }
.threat-medium { border-color: rgba(232,132,44,.5); color: var(--spice); background: rgba(232,132,44,.1); }
.threat-high { border-color: rgba(237,125,49,.55); color: var(--orange); background: rgba(237,125,49,.12); }
.threat-critical { border-color: rgba(192,0,0,.6); color: #ff6b6b; background: rgba(192,0,0,.16); }

/* Dossier */
.dossier { display: flex; flex-direction: column; gap: var(--gap); }
.dossier-id { display: flex; gap: 16px; align-items: flex-start; }
.dossier-portrait { width: 72px; height: 72px; border-radius: 8px; border: 1px solid var(--hairline); flex: 0 0 auto; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 14px; }
.stat-grid > div { display: flex; flex-direction: column; gap: 1px; }
.stat-n { font-family: var(--font-display); font-size: 17px; }
.stat-l { font-family: var(--font-mono); font-size: 9px; letter-spacing: .1em; color: var(--ink-mute); text-transform: uppercase; }
.toplist { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.toplist li { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px solid rgba(42,44,54,.5); }
.heatmap { padding: 14px; overflow-x: auto; }
.heat-row { display: flex; align-items: center; gap: 2px; margin-bottom: 2px; }
.heat-day { width: 34px; font-family: var(--font-mono); font-size: 10px; color: var(--ink-mute); flex: 0 0 auto; }
.heat-hh { width: 14px; font-family: var(--font-mono); font-size: 9px; color: var(--ink-mute); text-align: left; flex: 0 0 auto; }
.heat-cell { width: 14px; height: 14px; border-radius: 2px; background: var(--panel-3); flex: 0 0 auto; }

/* Live intel — radial neighbor map */
.intel-mapwrap { position: relative; width: 100%; max-width: 560px; aspect-ratio: 1 / 1; margin: 0 auto 16px; }
.intel-map { position: absolute; inset: 0; }
.mapsvg { width: 100%; height: 100%; display: block; overflow: visible; }
.map-status { fill: var(--ink-mute); font-family: var(--font-mono); font-size: 11px; }
.map-center-disc { fill: var(--panel-2); stroke: var(--hairline-2); stroke-width: 1.5; }

.map-edge { stroke: var(--hairline-2); stroke-width: 1.2; opacity: .45; }
.map-edge.state-quiet { opacity: .25; }
.map-edge.state-active { stroke: var(--cyan); opacity: .4; }
.map-edge.state-pvp { stroke: var(--orange); opacity: .7; }
.map-edge.state-hostile { stroke: #ff6b6b; opacity: .85; }

.map-node { cursor: pointer; }
.map-node .mn-dot { fill: var(--panel-2); stroke: var(--hairline-2); stroke-width: 1.5; transition: stroke .12s; }
.map-node .mn-k { fill: var(--ink); font-family: var(--font-mono); font-size: 13px; font-weight: 600; text-anchor: middle; dominant-baseline: central; }
.map-node .mn-name { fill: var(--ink-dim); font-family: var(--font-mono); font-size: 11px; text-anchor: middle; }
.map-node .mn-j { fill: var(--cyan); font-family: var(--font-mono); font-size: 10px; text-anchor: middle; }
.map-node .mn-j.zero { fill: var(--cyan); opacity: .38; }
.map-node:hover .mn-dot { stroke: var(--spice); }
.map-node:hover .mn-name { fill: var(--ink); }

/* Hover-revealed zKillboard badge (click elsewhere on the node = re-center) */
.mn-zk { opacity: 0; pointer-events: none; transition: opacity .12s; }
.map-node:hover .mn-zk { opacity: 1; pointer-events: auto; }
.mn-zk-bg { fill: var(--panel-3); stroke: var(--hairline-2); stroke-width: 1; }
.mn-zk:hover .mn-zk-bg { fill: var(--spice); stroke: var(--spice); }
.mn-zk-t { fill: var(--ink-dim); font-family: var(--font-mono); font-size: 9px; font-weight: 700; text-anchor: middle; dominant-baseline: central; }
.mn-zk:hover .mn-zk-t { fill: var(--void); }

.map-node.state-quiet .mn-dot { opacity: .5; }
.map-node.state-quiet .mn-name { opacity: .7; }
.map-node.state-active .mn-dot { stroke: var(--cyan); }
.map-node.state-active .mn-name { fill: var(--cyan); }
.map-node.state-pvp .mn-dot { stroke: var(--orange); fill: rgba(237,125,49,.14); animation: pulse-amber-s 1.6s ease-in-out infinite; }
.map-node.state-pvp .mn-name { fill: var(--orange); }
.map-node.state-hostile .mn-dot { stroke: #ff6b6b; fill: rgba(192,0,0,.2); animation: pulse-red-s 1.1s ease-in-out infinite; }
.map-node.state-hostile .mn-name,
.map-node.state-hostile .mn-k { fill: #ff6b6b; }
@keyframes pulse-amber-s { 0%, 100% { filter: drop-shadow(0 0 0 rgba(237,125,49,0)); } 50% { filter: drop-shadow(0 0 5px rgba(237,125,49,.7)); } }
@keyframes pulse-red-s { 0%, 100% { filter: drop-shadow(0 0 0 rgba(255,107,107,0)); } 50% { filter: drop-shadow(0 0 6px rgba(255,107,107,.85)); } }

/* Center = the "current system" picker, sitting over the map origin */
.map-picker { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 148px; z-index: 6; }
.map-picker .picker { background: var(--panel); border: 1px solid var(--hairline-2); border-radius: 999px; padding: 8px 10px; text-align: center; box-shadow: var(--glow-spice); }
.map-picker .picker-chips { justify-content: center; }
.map-picker .picker-chips:not(:empty) { margin-bottom: 4px; }
.map-picker .picker-chip { font-family: var(--font-display); font-size: 13px; padding: 3px 6px 3px 10px; }
.map-picker .picker-input { text-align: center; padding: 4px 2px; font-size: 12px; }
.map-picker .picker-menu { text-align: left; }
.map-jumpstat { margin-top: 5px; text-align: center; font-family: var(--font-mono); font-size: 11px; color: var(--cyan); letter-spacing: .02em; white-space: nowrap; }

/* Map hover tooltip (JS, sits above the modal) */
.map-tip {
    position: fixed; z-index: 200; pointer-events: none; width: 258px; max-width: 78vw;
    background: var(--panel-2); border: 1px solid var(--hairline-2); border-radius: var(--radius-sm);
    box-shadow: var(--shadow-hud); padding: 10px 11px; color: var(--ink);
    font-family: var(--font-body); font-size: 12px; line-height: 1.5;
    animation: tip-in .1s ease both;
}
.map-tip[hidden] { display: none; }
@keyframes tip-in { from { opacity: 0; transform: translateY(-2px); } to { opacity: 1; transform: none; } }
.map-tip .tip-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.map-tip .tip-name { font-family: var(--font-display); font-size: 13px; letter-spacing: .04em; color: var(--spice); }
.map-tip .tip-state { font-family: var(--font-mono); font-size: 9px; font-weight: 700; letter-spacing: .06em; padding: 2px 5px; border-radius: 4px; border: 1px solid var(--hairline-2); color: var(--ink-dim); }
.map-tip .tip-state.s-active { color: var(--cyan); border-color: var(--cyan); }
.map-tip .tip-state.s-pvp { color: var(--orange); border-color: var(--orange); }
.map-tip .tip-state.s-hostile { color: #ff6b6b; border-color: #ff6b6b; }
.map-tip .tip-sub { font-family: var(--font-mono); font-size: 10px; color: var(--ink-mute); margin-top: 1px; }
.map-tip .tip-rows { margin-top: 7px; display: flex; flex-direction: column; gap: 3px; }
/* shared row/pilot atoms — reused by the system-intel pane */
.map-tip .tip-row, .sys-panel .tip-row { display: flex; gap: 7px; align-items: baseline; }
.map-tip .tip-ic, .sys-panel .tip-ic { flex: 0 0 12px; text-align: center; color: var(--ink-mute); font-size: 11px; }
.map-tip .tip-row b, .sys-panel .tip-row b { color: var(--cyan); font-weight: 600; }
.map-tip .tip-dim, .sys-panel .tip-dim { color: var(--ink-mute); }
.map-tip .tip-sec, .sys-panel .tip-sec { margin: 8px 0 3px; font-family: var(--font-mono); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-mute); border-top: 1px solid var(--hairline); padding-top: 6px; }
.map-tip .tip-pilots, .sys-panel .tip-pilots { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.map-tip .tip-pilots li, .sys-panel .tip-pilots li { display: flex; align-items: baseline; gap: 6px; }
.map-tip .tip-pname, .sys-panel .tip-pname { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-tip .tip-count, .sys-panel .tip-count { font-family: var(--font-mono); font-size: 10px; color: var(--ink-mute); }
.map-tip .tip-threat, .sys-panel .tip-threat { font-family: var(--font-mono); font-size: 9px; font-weight: 700; text-transform: uppercase; padding: 1px 4px; border-radius: 3px; }
.map-tip .tip-threat.t-medium, .sys-panel .tip-threat.t-medium { color: var(--warn); background: rgba(232,132,44,.15); }
.map-tip .tip-threat.t-high, .sys-panel .tip-threat.t-high { color: #ff9d5c; background: rgba(237,125,49,.18); }
.map-tip .tip-threat.t-critical, .sys-panel .tip-threat.t-critical { color: #ff6b6b; background: rgba(192,0,0,.22); }
.map-tip .tip-foot { margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--hairline); font-family: var(--font-mono); font-size: 9px; color: var(--ink-mute); letter-spacing: .04em; }

/* Map centered in the space left of the pane; intel pane pinned to the right edge. The map's
   auto side-margins absorb the free space, so the pane still sits flush right. Pane width is
   user-resizable (--sys-w, saved server-side). */
.intel-top { display: flex; align-items: flex-start; gap: var(--gap); margin-bottom: 16px; }
.intel-top .intel-mapwrap { margin: 0 auto; flex: 0 1 460px; min-width: 240px; }
.intel-sys { position: relative; flex: 0 0 var(--sys-w, 300px); min-width: 0; }
.sys-resize { position: absolute; top: 0; bottom: 0; left: calc(-1 * var(--gap) / 2 - 4px); width: 9px; cursor: col-resize; z-index: 4; touch-action: none; }
.sys-resize::before { content: ''; position: absolute; top: 0; bottom: 0; left: 3px; width: 3px; border-radius: 3px; background: var(--hairline-2); opacity: 0; transition: opacity .15s ease, background .15s ease; }
.sys-resize:hover::before, body.sys-resizing .sys-resize::before { opacity: 1; background: var(--spice); }
body.sys-resizing { cursor: col-resize; user-select: none; }
.sys-panel { height: 100%; }
.sys-panel .panel-head { display: flex; align-items: baseline; gap: 6px; }
.sys-loading { padding: 16px 14px; font-family: var(--font-mono); font-size: 12px; }
.sys-block { padding: 10px 14px; border-bottom: 1px solid var(--hairline); }
.sys-block:last-child { border-bottom: 0; }
.sys-block .tip-rows { margin-top: 0; }
.sys-block > .sys-h { margin: 0 0 6px; font-family: var(--font-mono); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-mute); }
.sys-block > .sys-h .sys-hx { color: var(--ink-dim); text-transform: none; letter-spacing: 0; }
.sys-ships { display: flex; flex-wrap: wrap; gap: 5px; }
.ship-chip { font-family: var(--font-mono); font-size: 11px; padding: 2px 7px; border-radius: 999px; background: var(--panel-3); border: 1px solid var(--hairline); color: var(--ink-dim); white-space: nowrap; }
.ship-chip b { color: var(--cyan); font-weight: 600; }
/* PvP tags on system-intel pilots (known PvPer / PvP-heavy corp / alliance) */
.sys-panel .ptag { font-family: var(--font-mono); font-size: 8.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 1px 4px; border-radius: 3px; white-space: nowrap; cursor: help; }
.sys-panel .ptag.pt-self { color: #ff6b6b; background: rgba(192,0,0,.20); }
.sys-panel .ptag.pt-corp { color: var(--orange); background: rgba(237,125,49,.16); }
.sys-panel .ptag.pt-ally { color: #ffb27a; background: rgba(237,125,49,.10); border: 1px solid rgba(237,125,49,.30); }
@media (max-width: 980px) {
    .intel-top { flex-direction: column; }
    .intel-top .intel-mapwrap { margin: 0 auto; flex: 1 1 auto; width: 100%; }
    .intel-sys { flex: 1 1 auto; width: 100%; margin-left: 0; }
    .sys-resize { display: none; } /* no side-drag when stacked */
}
.intel-bar { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 16px; }
.intel-clip { display: flex; align-items: center; gap: 10px; }
.intel-manual { margin-left: auto; }
.intel-manual summary { display: inline-block; list-style: none; cursor: pointer; }
.intel-manual summary::-webkit-details-marker { display: none; }
.intel-manual textarea { width: 340px; margin-top: 8px; }
.intel-agg { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 14px; border-bottom: 1px solid var(--hairline); }
.intel-deltas { padding: 10px 14px; font-family: var(--font-mono); font-size: 12px; border-bottom: 1px solid var(--hairline); line-height: 1.6; }
.delta-in { color: var(--orange); }
.delta-out { color: var(--ink-mute); }
.intel-grid { display: grid; grid-template-columns: minmax(0, 2.4fr) minmax(0, 1fr); gap: var(--gap); }
.prof { white-space: normal; font-size: 12px; }
.prof-tags { font-family: var(--font-mono); font-size: 11px; color: var(--ink-dim); }
.feed-tbl tr.row-watch td:first-child { box-shadow: inset 3px 0 0 var(--spice); }
.feed-tbl tr.row-red td:first-child { box-shadow: inset 3px 0 0 #ff6b6b; }
.feed-tbl tr.row-blue td:first-child { box-shadow: inset 3px 0 0 var(--ok); }
.feed-tbl tr.row-neutral td:first-child { box-shadow: inset 3px 0 0 var(--ink-mute); }

/* Responsive */
@media (max-width: 900px) {
    .intel-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
    .app-shell { grid-template-columns: 1fr; }
    .navrail { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
    .navrail-nav { flex-direction: row; flex-wrap: wrap; }
    .navrail-foot { border-top: none; margin: 0; padding: 0; }
    .nav-lab { display: none; }
}

/* ==================== MOTION: nav, map glide, expand modal ==================== */

/* Navrail — smooth hover/active + a staggered slide-in on each load */
.nav-item { transition: background .18s ease, color .18s ease, border-color .18s ease, box-shadow .2s ease, transform .16s ease; }
.nav-item:hover { transform: translateX(3px); }
.nav-item.is-active { transform: none; }
.nav-ico { transition: transform .16s ease, color .16s ease, text-shadow .18s ease; }
.nav-item:hover .nav-ico { transform: scale(1.16); }
.nav-item.is-active .nav-ico { text-shadow: 0 0 9px var(--spice-glow); }

@keyframes nav-in { from { opacity: 0; transform: translateX(-9px); } to { opacity: 1; transform: translateX(0); } }
@media (prefers-reduced-motion: no-preference) {
    .navrail-nav .nav-item { animation: nav-in .3s cubic-bezier(.2,.7,.25,1) both; }
    .navrail-nav .nav-item:nth-child(1) { animation-delay: .02s; }
    .navrail-nav .nav-item:nth-child(2) { animation-delay: .05s; }
    .navrail-nav .nav-item:nth-child(3) { animation-delay: .08s; }
    .navrail-nav .nav-item:nth-child(4) { animation-delay: .11s; }
    .navrail-nav .nav-item:nth-child(5) { animation-delay: .14s; }
    .navrail-nav .nav-item:nth-child(6) { animation-delay: .17s; }
    .navrail-nav .nav-item:nth-child(7) { animation-delay: .20s; }
    .navrail-nav .nav-item:nth-child(8) { animation-delay: .23s; }
    .navrail-nav .nav-item:nth-child(9) { animation-delay: .26s; }
}

/* Neighbor map — nodes glide out from the center when the map re-centers.
   JS adds .map-animate to the <svg> only on a center change, so background
   refresh polls update instantly without re-animating. */
.mapsvg.map-animate .map-node { transition: transform .52s cubic-bezier(.2,.75,.25,1), opacity .45s ease; }
.mapsvg.map-animate .map-edges { animation: map-fade .6s ease both; }
.mapsvg.map-animate .map-center-disc { animation: map-pop .42s cubic-bezier(.2,.8,.2,1) both; }
@keyframes map-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes map-pop { 0% { transform: scale(.2); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.map-center-name { fill: var(--spice); font-family: var(--font-display); font-size: 13px; text-anchor: middle; dominant-baseline: central; letter-spacing: .04em; }

/* Expand-to-modal button, top-right of the inline map */
.map-expand {
    position: absolute; top: 6px; right: 6px; z-index: 7;
    width: 30px; height: 30px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    background: var(--panel); color: var(--ink-dim); border: 1px solid var(--hairline-2);
    cursor: pointer; font-size: 15px; line-height: 1;
    transition: background .16s ease, color .16s ease, border-color .16s ease, transform .16s ease;
}
.map-expand:hover { background: var(--panel-3); color: var(--spice); border-color: var(--spice); transform: scale(1.07); }

/* Map modal (larger area, 1–2 jumps) */
.map-modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 24px; }
.map-modal[hidden] { display: none; }
.map-modal-backdrop { position: absolute; inset: 0; background: rgba(4, 6, 10, .72); backdrop-filter: blur(3px); }
.map-modal-panel {
    position: relative; z-index: 1; display: flex; flex-direction: column;
    max-width: 96vw; max-height: 94vh;
    background: linear-gradient(180deg, var(--panel-2), var(--panel));
    border: 1px solid var(--hairline-2); border-radius: var(--radius);
    box-shadow: var(--glow-spice), 0 20px 60px rgba(0, 0, 0, .55);
}
.map-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--hairline); }
.map-modal-title { font-family: var(--font-display); font-size: 14px; letter-spacing: .06em; }
.map-modal-title #map-modal-sys { color: var(--spice); }
.map-modal-tools { display: flex; align-items: center; gap: 6px; }
.map-zoom, .map-modal-close { width: 30px; height: 30px; border-radius: 8px; background: transparent; color: var(--ink-dim); border: 1px solid var(--hairline-2); cursor: pointer; font-size: 16px; line-height: 1; transition: background .16s ease, color .16s ease, border-color .16s ease; }
.map-modal-close { font-size: 18px; margin-left: 4px; }
.map-zoom:hover, .map-modal-close:hover { background: var(--panel-3); color: var(--ink); border-color: var(--spice); }
.map-modal-body { padding: 10px; display: flex; justify-content: center; }
.intel-map-lg { position: relative; width: min(82vh, 92vw); height: min(82vh, 92vw); }
.intel-map-lg.zoomable { cursor: grab; touch-action: none; }
.intel-map-lg.zoomable.grabbing { cursor: grabbing; }
.map-modal-foot { padding: 8px 16px 14px; text-align: center; font-size: 12px; }

@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
@media (prefers-reduced-motion: no-preference) {
    .map-modal:not([hidden]) .map-modal-backdrop { animation: map-fade .2s ease both; }
    .map-modal:not([hidden]) .map-modal-panel { animation: modal-in .24s cubic-bezier(.2,.8,.2,1) both; }
}

body.modal-open { overflow: hidden; }

/* ==================== Pilot dossier — usual victims + doctrine fits ==================== */
.vic-classes { padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; }
.vic-row { display: grid; grid-template-columns: 96px 1fr 74px; align-items: center; gap: 10px; }
.vic-label { font-family: var(--font-mono); font-size: 11px; letter-spacing: .04em; color: var(--ink-dim); }
.vic-pct { text-align: right; font-size: 11px; }
.vic-n { opacity: .55; }
.bar { display: block; height: 8px; border-radius: 999px; background: var(--panel-3); overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--spice); border-radius: 999px; }

.fits { padding: 14px 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.fit { border: 1px solid var(--hairline); border-radius: 8px; padding: 10px 12px; background: var(--panel); }
.fit-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.fit-hull { font-family: var(--font-display); font-size: 15px; }
.fit-slots { display: flex; flex-direction: column; gap: 8px; }
.fit-slot-l { font-family: var(--font-mono); font-size: 9px; letter-spacing: .12em; color: var(--ink-mute); text-transform: uppercase; margin-bottom: 2px; }
.fit-mods { list-style: none; margin: 0; padding: 0; font-size: 12px; }
.fit-mods li { padding: 2px 0; color: var(--ink-dim); }
.fit-nofit { padding: 2px 0 4px; }
@media (max-width: 760px) {
    .vic-row { grid-template-columns: 80px 1fr 64px; }
    .fits { grid-template-columns: 1fr; }
}
