/* -------------------------------------------------------------- missions */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; padding: 2.5rem 0 1.5rem; }
.page-head h1 { margin: 0.6rem 0 0; }
.result-count { color: var(--text-muted); font-size: 0.85rem; letter-spacing: 0.12em; }
.result-count span { color: var(--cyan); font-size: 1.3rem; }
.missions-layout { display: grid; grid-template-columns: 260px 1fr; gap: 1.4rem; align-items: start; }
.filters { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 1.1rem; }

.mission-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.1rem; }
.mcard { display: flex; flex-direction: column; gap: 0.75rem; min-height: 210px; animation: fade-in var(--slow) var(--ease) both; }
.mcard-top { display: flex; justify-content: space-between; gap: 0.6rem; align-items: flex-start; }
.mcard-type { font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--type-color, var(--cyan)); }
.mcard h3 { margin: 0.25rem 0 0; font-family: var(--font-ui); font-weight: 700; font-size: 1.12rem; letter-spacing: 0.03em; line-height: 1.2; }
.mcard .contractor { font-size: 0.8rem; color: var(--text-muted); }
.mcard-reward { font-family: var(--font-mono); font-weight: 700; font-size: 1.25rem; }
.mcard-meta { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: auto; }
.mcard-foot { display: flex; justify-content: space-between; align-items: center; padding-top: 0.6rem; border-top: 1px solid var(--line); font-size: 0.75rem; color: var(--text-muted); font-family: var(--font-mono); }
.mcard .accent { position: absolute; left: 0; top: var(--cut); bottom: 0; width: 2px; background: var(--type-color, var(--cyan)); box-shadow: 0 0 12px var(--type-color, var(--cyan)); }
.load-more { display: flex; justify-content: center; margin-top: 2rem; }

/* ---------------------------------------------------------------- drawer */
.drawer-backdrop { position: fixed; inset: 0; z-index: 30; background: rgba(2, 4, 10, 0.6); backdrop-filter: blur(3px); }
.drawer {
  position: fixed; z-index: 31; top: 0; right: 0; bottom: 0; width: min(620px, 100%);
  padding: 2rem 2rem 3rem; overflow-y: auto;
  transform: translateX(105%); transition: transform var(--slow) var(--ease);
  --cut: 26px;
}
.drawer.open { transform: none; }
.drawer-close { position: absolute; top: 1.2rem; right: 1.4rem; width: 34px; height: 34px; background: rgba(54, 227, 255, 0.08); border: 1px solid var(--line-strong); color: var(--text); cursor: pointer; }
.drawer h2 { margin: 0.6rem 0 0.4rem; font-family: var(--font-ui); font-size: 1.7rem; font-weight: 700; letter-spacing: 0.03em; line-height: 1.15; padding-right: 3rem; }
.drawer .desc { color: var(--text-muted); font-size: 0.9rem; white-space: pre-line; max-height: 9.5rem; overflow: auto; padding-right: 0.5rem; }
.d-section { margin-top: 1.6rem; }
.d-section > .hud-label { margin-bottom: 0.8rem; display: flex; }
.d-hero { display: grid; grid-template-columns: 1fr 170px; gap: 1rem; align-items: center; margin-top: 1.2rem; }
.d-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem 1.2rem; }
.d-stats .stat-value { font-size: 1.05rem; }
.diff-radar svg { width: 100%; }
.diff-radar .grid { fill: none; stroke: rgba(120, 170, 255, 0.18); stroke-width: 0.7; }
.diff-radar .shape { fill: rgba(54, 227, 255, 0.16); stroke: var(--cyan); stroke-width: 1.2; filter: drop-shadow(0 0 4px rgba(54, 227, 255, 0.7)); }
.diff-radar text { fill: var(--text-muted); font: 7px var(--font-mono); letter-spacing: 0.12em; text-anchor: middle; }
.bp-pool { margin-bottom: 1rem; }
.bp-pool-head { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-muted); letter-spacing: 0.08em; margin-bottom: 0.5rem; }
.bp-item { display: grid; grid-template-columns: 1fr 120px 48px; gap: 0.8rem; align-items: center; padding: 0.35rem 0; font-size: 0.86rem; border-bottom: 1px dashed var(--line); }
.bp-item .mono { font-size: 0.75rem; color: var(--cyan); text-align: right; }
.d-actions { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-top: 2rem; }
.token { padding: 0 0.35em; font-family: var(--font-mono); font-size: 0.85em; color: var(--cyan); background: rgba(54, 227, 255, 0.08); border-bottom: 1px dashed rgba(54, 227, 255, 0.5); text-transform: lowercase; }

/* --------------------------------------------------------------- shared page */
.page { max-width: 1480px; margin: 0 auto; padding: 0 2rem 4rem; position: relative; z-index: 1; }
.empty { padding: 3rem 1rem; text-align: center; color: var(--text-muted); font-family: var(--font-mono); letter-spacing: 0.12em; }
.drawer .strong { color: var(--text); }
.desc .em, .em { color: var(--cyan); font-weight: 600; }
.retired { opacity: 0.55; }

@media (max-width: 820px) {
  .missions-layout { grid-template-columns: 1fr; }
  .filters { position: static; }
  .d-hero { grid-template-columns: 1fr; }
  .page { padding: 0 1rem 3rem; }
}

/* Pages render inside <main> (its own stacking context below the sticky topbar), so overlays start under the topbar. */
:root { --topbar-h: 86px; }
.drawer, .drawer-backdrop { top: var(--topbar-h); }
.bp-pool-head { gap: 1rem; }
.bp-pool-head span:first-child { overflow-wrap: anywhere; }
.bp-pool-head span:last-child { white-space: nowrap; }

/* ----------------------------------------------------------------- tabs */
.tabs { display: flex; gap: 0.4rem; margin-top: 1rem; }
.tabs a { padding: 0.45em 1em; font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text-muted); text-decoration: none; border: 1px solid var(--line); background: rgba(54, 227, 255, 0.03); }
.tabs a.active { color: var(--cyan); border-color: var(--line-strong); background: rgba(54, 227, 255, 0.1); box-shadow: inset 0 -2px 0 var(--cyan); }
.head-actions { display: flex; gap: 0.6rem; align-items: center; }

/* ---------------------------------------------------------------- cards */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 1.1rem; }
.card-link { color: inherit; text-decoration: none; display: block; }
.status-draft { --chip: var(--amber); }
.status-archived { --chip: var(--text-muted); }

/* ---------------------------------------------------------------- forms */
.form { display: grid; gap: 1.4rem; max-width: 1100px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem 1.2rem; }
.form-grid .wide { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 0.45rem; }
textarea.input { min-height: 7rem; resize: vertical; font-family: var(--font-body, inherit); line-height: 1.5; }
.list-editor { display: flex; flex-direction: column; gap: 0.6rem; }
.list-row { display: grid; gap: 0.6rem; align-items: center; padding: 0.6rem; border: 1px dashed var(--line); }
.list-row.phase { grid-template-columns: 2.2rem 1.2fr 2fr 1fr auto; }
.list-row.role { grid-template-columns: 1.4fr 5rem 1.2fr 1.6fr auto auto; }
.list-row .idx { font-family: var(--font-mono); color: var(--cyan); text-align: center; }
.form-actions { display: flex; gap: 0.8rem; flex-wrap: wrap; align-items: center; }
.alert { padding: 0.8rem 1rem; border: 1px solid rgba(255, 59, 92, 0.5); background: rgba(255, 59, 92, 0.08); color: #ffb3c0; }
.notice { padding: 0.8rem 1rem; border: 1px solid rgba(59, 255, 176, 0.4); background: rgba(59, 255, 176, 0.06); color: #b8ffe4; }

/* ------------------------------------------------------------- detail */
.detail-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 1.4rem; align-items: start; }
.phases { list-style: none; margin: 0; padding: 0; counter-reset: phase; display: flex; flex-direction: column; gap: 0.9rem; }
.phases li { counter-increment: phase; display: grid; grid-template-columns: 2.4rem 1fr; gap: 0.8rem; }
.phases li::before { content: counter(phase, decimal-leading-zero); font-family: var(--font-mono); color: var(--cyan); font-size: 1.1rem; }
.phases h4 { margin: 0; font-family: var(--font-ui); font-size: 1rem; letter-spacing: 0.04em; }
.phases p { margin: 0.2rem 0 0; color: var(--text-muted); font-size: 0.88rem; white-space: pre-line; }
.facts-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem 1.2rem; }
.facts-grid .stat-value { font-size: 1.05rem; }

/* ---------------------------------------------------------- operations */
.op-list { display: flex; flex-direction: column; gap: 0.8rem; }
.op-row { display: grid; grid-template-columns: 9rem 1fr auto; gap: 1.2rem; align-items: center; }
.op-when { font-family: var(--font-mono); line-height: 1.3; }
.op-when .day { color: var(--cyan); font-size: 1.05rem; letter-spacing: 0.08em; }
.op-when .time { color: var(--text-muted); font-size: 0.8rem; }
.op-title { font-family: var(--font-ui); font-weight: 700; font-size: 1.1rem; letter-spacing: 0.03em; }
.op-sub { color: var(--text-muted); font-size: 0.82rem; }
.roster { display: flex; flex-direction: column; gap: 1rem; }
.slot-head { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.12em; color: var(--text-muted); text-transform: uppercase; }
.slot-head .full { color: var(--green); }
.slot-members { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.4rem; min-height: 1.6rem; }
.signup-row { display: grid; grid-template-columns: 1fr auto 12rem; gap: 0.8rem; align-items: center; padding: 0.45rem 0; border-bottom: 1px dashed var(--line); font-size: 0.88rem; }
.signup-row .who { display: flex; flex-direction: column; }
.signup-row .who small { color: var(--text-muted); }
.select-sm { padding: 0.35em 0.6em; font-size: 0.8rem; }

@media (max-width: 1000px) {
  .detail-layout { grid-template-columns: 1fr; }
  .list-row.phase, .list-row.role { grid-template-columns: 1fr; }
  .op-row { grid-template-columns: 1fr; }
  .signup-row { grid-template-columns: 1fr; }
}
.slot-head > span:first-child, .signup-row .who > span:first-child { display: inline-flex; gap: 0.45rem; align-items: center; flex-wrap: wrap; }

/* ------------------------------------------------------------ blueprints */
.bp-row { grid-template-columns: 1fr 9rem 140px 56px; }
.bp-link:hover .bp-item, .card-link:hover .bp-row { background: rgba(54, 227, 255, 0.05); }
.desc-block { color: var(--text-muted); font-size: 0.92rem; white-space: pre-line; line-height: 1.6; }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.slot:not(.slot-root) { padding: 0.9rem 1rem; border: 1px solid var(--line); background: rgba(54, 227, 255, 0.025); display: flex; flex-direction: column; gap: 0.7rem; }
.slot-title { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; font-family: var(--font-ui); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--cyan); }
.materials { display: flex; flex-direction: column; gap: 0.3rem; }
.material { display: grid; grid-template-columns: 1fr auto auto; gap: 0.8rem; align-items: baseline; padding: 0.3rem 0; border-bottom: 1px dashed var(--line); font-size: 0.88rem; }
.material .mat-name { color: var(--text); }
.effects { display: flex; flex-direction: column; gap: 0.35rem; }
.effect { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.8rem; min-width: 0; }
.effect-head { display: grid; grid-template-columns: minmax(0, 1fr) 70px; gap: 0.6rem; align-items: center; }
.effect-points { display: flex; flex-wrap: wrap; gap: 0.15rem 0.5rem; }
.effect-points .point + .point::before { content: "\2192"; margin-right: 0.5rem; color: var(--text-muted); }
.effect .pos { color: var(--green); }
.effect .neg { color: var(--red); }
.range { position: relative; height: 4px; background: rgba(120, 170, 255, 0.12); }
.range::after { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--line-strong); }
.range > span { position: absolute; top: 0; bottom: 0; left: min(var(--from), var(--to)); right: calc(100% - max(var(--from), var(--to))); background: var(--grad-primary); box-shadow: 0 0 8px rgba(54, 227, 255, 0.5); }

/* ----------------------------------------------------------- game art */
.gicon { display: inline-block; width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; margin-right: 0.45em;
  background: currentColor; -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }
.gicon-lg { width: 2rem; height: 2rem; color: var(--cyan); filter: drop-shadow(0 0 6px rgba(54, 227, 255, 0.45)); }
.gicon-hero { width: 4.2rem; height: 4.2rem; margin: 0; color: var(--cyan); filter: drop-shadow(0 0 12px rgba(54, 227, 255, 0.55)); }
.material .gicon { color: var(--gold, #ffc56b); }
.bp-head { display: flex; gap: 1.2rem; align-items: center; }
.bp-name { display: flex; align-items: center; gap: 0.8rem; min-width: 0; }
.mfr-logo { height: 52px; width: auto; opacity: 0.9; filter: drop-shadow(0 0 8px rgba(54, 227, 255, 0.35)); }
.mfr-logo-sm { height: 26px; width: auto; margin-left: auto; opacity: 0.75; }

/* ------------------------------------------------------------ schematics */
.schematic, .schematic-thumb {
  --bp-line: rgba(140, 210, 255, 0.18); --bp-fine: rgba(140, 210, 255, 0.07);
  background-color: #0a2a4a;
  background-image: linear-gradient(var(--bp-line) 1px, transparent 1px), linear-gradient(90deg, var(--bp-line) 1px, transparent 1px),
    linear-gradient(var(--bp-fine) 1px, transparent 1px), linear-gradient(90deg, var(--bp-fine) 1px, transparent 1px);
  border: 1px solid rgba(120, 200, 255, 0.35);
}
.schematic { position: relative; margin: 0; aspect-ratio: 4 / 3; background-size: 80px 80px, 80px 80px, 16px 16px, 16px 16px;
  box-shadow: inset 0 0 120px rgba(0, 0, 0, 0.45), 0 0 30px rgba(54, 227, 255, 0.08); overflow: hidden; }
.schematic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 0 3px rgba(160, 230, 255, 0.55)); }
.schematic figcaption { position: absolute; right: 0; bottom: 0; display: grid; grid-template-columns: auto auto auto; border-top: 1px solid rgba(160, 225, 255, 0.45);
  border-left: 1px solid rgba(160, 225, 255, 0.45); background: rgba(6, 26, 48, 0.85); font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: #cfeeff; }
.schematic figcaption span { padding: 0.45rem 0.8rem; border-right: 1px solid rgba(160, 225, 255, 0.3); }
.schematic figcaption span:last-child { border-right: 0; }
.schematic figcaption .title { font-weight: 700; color: #fff; }
.schematic .stamp { position: absolute; left: 0.8rem; top: 0.6rem; font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.18em; color: rgba(190, 235, 255, 0.55); }
.schematic-thumb { position: relative; flex: none; width: 64px; height: 48px; background-size: 16px 16px, 16px 16px, 4px 4px, 4px 4px; }
.schematic-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
@media (max-width: 700px) { .schematic figcaption { grid-template-columns: 1fr; } .schematic figcaption span { border-right: 0; } }

/* ---------------------------------------------------------------- fleet */
.fine { font-size: 0.78rem; line-height: 1.6; }
.fleet-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 1rem; margin-bottom: 1.2rem; padding: 1rem 1.2rem; border: 1px solid var(--line); background: linear-gradient(90deg, rgba(54, 227, 255, 0.05), transparent 70%); }
.fleet-stats .stat-value { font-size: 1.5rem; }
.fleet-stats .credits::after { content: none; }
.fleet-filters { grid-template-columns: 2fr 1.4fr 1fr; }
.fleet-filters .fleet-toggles { grid-column: 1 / -1; padding-bottom: 0; }
.fleet-toggles { display: flex; flex-wrap: wrap; gap: 0.6rem 1.2rem; align-items: center; padding-bottom: 0.55rem; }
.ship-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1.1rem; }
.ship-card { display: flex; flex-direction: column; padding: 0; overflow: hidden; animation: fade-in var(--slow) var(--ease) both; }
.ship-body { display: flex; flex-direction: column; gap: 0.55rem; padding: 0.9rem 1.1rem 1rem; flex: 1; }
.ship-card h3 { margin: 0; font-family: var(--font-ui); font-weight: 700; font-size: 1.15rem; letter-spacing: 0.03em; line-height: 1.2; }
.ship-focus { font-size: 0.8rem; min-height: 1.2em; }
.ship-card .mcard-meta { margin-top: 0.2rem; }
.ship-card .mcard-foot { margin-top: auto; }
.ship-card .mcard-foot .credits::after { content: none; }
.ship-actions { display: flex; gap: 0.4rem; }
.ship-img { position: relative; aspect-ratio: 16 / 9; background: radial-gradient(ellipse at 50% 120%, rgba(54, 227, 255, 0.18), transparent 70%), #050913; border-bottom: 1px solid var(--line); overflow: hidden; }
.ship-img > img:first-child { width: 100%; height: 100%; object-fit: cover; transition: transform var(--slow) var(--ease); }
.ship-card:hover .ship-img > img:first-child { transform: scale(1.04); }
.ship-img::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, transparent 55%, rgba(5, 9, 19, 0.85)), repeating-linear-gradient(0deg, rgba(54, 227, 255, 0.035) 0 1px, transparent 1px 3px); }
.ship-img--lg { margin-top: 1.2rem; border: 1px solid var(--line); }
.ship-img-none { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-dim); letter-spacing: 0.3em; font-size: 0.7rem; }
.ship-logo { position: absolute; z-index: 1; right: 0.6rem; bottom: 0.5rem; width: 40px; height: 40px; object-fit: contain; filter: drop-shadow(0 0 6px rgba(0, 0, 0, 0.8)); opacity: 0.9; }
.owner-list { display: flex; flex-direction: column; gap: 0.45rem; }
.owner-row { display: grid; grid-template-columns: 30px 1fr auto auto; gap: 0.7rem; align-items: center; padding: 0.45rem 0.6rem; border: 1px solid var(--line); background: rgba(54, 227, 255, 0.03); }
.owner-avatar { display: block; width: 30px; height: 30px; object-fit: cover; background: rgba(54, 227, 255, 0.12); clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); }
.legacy-banner { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; margin-bottom: 1.2rem; border-color: rgba(138, 92, 255, 0.5); }
.ship-picker { display: flex; flex-direction: column; gap: 0.35rem; max-height: 22rem; overflow-y: auto; margin-top: 0.6rem; padding-right: 0.3rem; }
.ship-option { display: grid; grid-template-columns: 80px 1fr; gap: 0.8rem; align-items: center; padding: 0.35rem; text-align: left; color: var(--text); font: inherit; background: rgba(54, 227, 255, 0.04); border: 1px solid var(--line); cursor: pointer; transition: border-color var(--fast), background var(--fast); }
.ship-option:hover, .ship-option:focus-visible, .ship-option.selected { border-color: var(--line-strong); background: rgba(54, 227, 255, 0.12); }
.ship-option img, .ship-option > span:first-child { width: 80px; height: 45px; object-fit: cover; background: #050913; }
.btn-danger { background: rgba(255, 59, 92, 0.18); box-shadow: inset 0 0 0 1px rgba(255, 59, 92, 0.6); color: #ffd0d8; }
.btn-danger:hover { background: rgba(255, 59, 92, 0.3); }
@media (max-width: 900px) { .fleet-filters { grid-template-columns: 1fr; } }

/* glass strip for page stats (not a .panel: no chamfer) */
.fleet-stats { background: var(--glass); box-shadow: var(--glass-edge); backdrop-filter: blur(3px) saturate(160%) brightness(1.15); -webkit-backdrop-filter: blur(3px) saturate(160%) brightness(1.15); }

/* phones: title first, actions wrap underneath at their natural size */
@media (max-width: 700px) {
  .page-head { flex-direction: column; align-items: stretch; gap: 1rem; padding-top: 1.6rem; }
  .head-actions { flex-wrap: wrap; }
  .head-actions .btn { flex: 1 1 auto; justify-content: center; white-space: nowrap; }
  .fleet-stats { grid-template-columns: repeat(3, 1fr); }
}

/* slide-out drawers cover page content (not just stars): keep them heavily frosted for reading */
.drawer.panel--strong {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 40%), radial-gradient(120% 70% at 0% 0%, rgba(54, 227, 255, 0.08), transparent 55%), rgba(8, 14, 34, 0.8);
  backdrop-filter: blur(26px) saturate(160%); -webkit-backdrop-filter: blur(26px) saturate(160%);
}

/* drawers scroll their content: the panel hairline + corner brackets would scroll with it, so use a plain edge */
.drawer.panel::before, .drawer.panel::after { display: none; }
.drawer.panel { border-left: 1px solid var(--line-strong); box-shadow: var(--glass-edge), -24px 0 60px rgba(0, 0, 0, 0.45); }

/* ---------------------------------------------------------------- resources */
.res-row { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.4fr) 8rem; }
.res-row .mcard-meta { justify-content: flex-start; }
.res-uses { display: flex; flex-direction: column; text-align: right; line-height: 1.3; }
.res-uses small { color: var(--amber, #f5b74e); }
.src-table { display: flex; flex-direction: column; margin-top: 0.4rem; }
.src-row { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) 7.5rem 7.5rem; gap: 0.8rem; align-items: center; padding: 0.45rem 0; border-bottom: 1px dashed var(--line); font-size: 0.86rem; }
.src-row .mono { font-size: 0.78rem; color: var(--cyan); }
.src-head { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-dim); border-bottom: 1px solid var(--line); }
.bar.mini { display: inline-block; width: 2.6rem; height: 4px; margin-right: 0.45rem; vertical-align: middle; }
.use-row { display: grid; grid-template-columns: 1fr auto; gap: 0.8rem; align-items: center; padding: 0.5rem 0; border-bottom: 1px dashed var(--line); font-size: 0.86rem; }
.use-row:hover strong { color: var(--cyan); }
.mat-name a { color: inherit; border-bottom: 1px dotted var(--line-strong); }
.mat-name a:hover { color: var(--cyan); }
@media (max-width: 700px) {
  .res-row { grid-template-columns: 1fr auto; }
  .res-row .mcard-meta { display: none; }
  .src-row { grid-template-columns: 1fr auto; }
  .src-row > :nth-child(2), .src-row > :nth-child(3) { display: none; }
}

/* ---------------------------------------------------------------- starmap */
.starmap-panel { padding: 0.8rem; }
.starmap { width: 100%; height: auto; display: block; }
.starmap .tunnel { stroke: rgba(120, 170, 255, 0.22); stroke-width: 1; }
.starmap .tunnel-l { stroke-width: 1.8; }
.starmap .tunnel-s { stroke-dasharray: 3 3; }
.starmap .tunnel.oneway { stroke-dasharray: 6 4; }
.starmap .tunnel.hot { stroke: rgba(54, 227, 255, 0.45); }
.starmap .sys { fill: #5b6b8f; transition: r var(--fast); }
.starmap .sys-p { fill: var(--cyan); filter: drop-shadow(0 0 4px rgba(54, 227, 255, 0.7)); }
.starmap .sys-p.mined { fill: var(--green); filter: drop-shadow(0 0 6px rgba(59, 255, 176, 0.8)); }
.starmap .sys-m, .starmap .sys-n { fill: #3a4766; }
.starmap a:hover .sys { r: 10; }
.starmap .sys-label { fill: var(--text-muted); font-family: var(--font-mono); font-size: 11px; text-anchor: middle; letter-spacing: 0.08em; pointer-events: none; }
.starmap a:hover .sys-label { fill: var(--text); }
.starmap-legend { display: flex; flex-wrap: wrap; gap: 1.2rem; padding: 0.4rem 0.6rem 0; font-size: 0.7rem; color: var(--text-dim); letter-spacing: 0.08em; }
.starmap-legend .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 0.35rem; vertical-align: middle; background: #3a4766; }
.starmap-legend .dot.sys-p { background: var(--cyan); }
.starmap-legend .dot.sys-p.mined { background: var(--green); }
.starmap-legend .hover { margin-left: auto; color: var(--cyan); }
.sys-card h3 { margin: 0.2rem 0 0; font-family: var(--font-ui); font-size: 1.15rem; }
.sys-thumb { width: 220px; height: 120px; object-fit: cover; border: 1px solid var(--line); clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px); }
.body-row { display: grid; grid-template-columns: 5.2rem 1fr auto; gap: 0.8rem; align-items: start; padding: 0.55rem 0 0.55rem calc(var(--depth, 0) * 1.6rem); border-bottom: 1px dashed var(--line); scroll-margin-top: 90px; }
.body-row:target { background: linear-gradient(90deg, rgba(54, 227, 255, 0.12), transparent 70%); }
.body-type { font-size: 0.62rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-dim); padding-top: 0.2rem; }
.body-row.planet .body-type, .body-row.star .body-type { color: var(--cyan); }
.body-row.asteroid_belt .body-type { color: var(--amber); }
.body-row.jumppoint .body-type { color: var(--violet); }
@media (max-width: 700px) { .sys-thumb { display: none; } .body-row { grid-template-columns: 4rem 1fr; } .body-row > .btn { display: none; } }

/* ------------------------------------------------------------ system map */
.sysmap-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr); gap: 1.2rem; align-items: start; margin-bottom: 1.2rem; }
.sysmap-panel { padding: 0.6rem; overflow: hidden; }
.sysmap { width: 100%; height: auto; display: block; aspect-ratio: 1; }
.sysmap-bg { fill: transparent; cursor: default; }
.sysmap .orbit { fill: none; stroke: rgba(120, 170, 255, 0.2); stroke-width: 1; pointer-events: none; transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.4s; }
.sysmap .orbit.local { stroke: rgba(54, 227, 255, 0.22); stroke-dasharray: 2 4; animation: fade-in 0.6s both; }
.sysmap .orbit.belt { stroke: rgba(255, 159, 67, 0.28); stroke-width: 7; stroke-dasharray: 1 5; }
.sysmap .orbit.belt.selected { stroke: rgba(255, 159, 67, 0.65); }
.sysmap .belt-hit { fill: none; stroke: transparent; stroke-width: 16; pointer-events: stroke; cursor: pointer; transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1); }
.sysmap .belt-hit:hover { stroke: rgba(255, 159, 67, 0.12); }
.sysmap .belt-label { fill: rgba(255, 159, 67, 0.75); font-family: var(--font-mono); letter-spacing: 0.08em; text-anchor: middle; pointer-events: none; }
.sysmap .node { cursor: pointer; transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.4s; }
.sysmap .node .hit { fill: transparent; }
.sysmap .node .body { fill: #9fb3d9; stroke: rgba(5, 8, 18, 0.9); stroke-width: 1; transition: filter var(--fast); }
.sysmap .node:hover .body { filter: brightness(1.35) drop-shadow(0 0 6px rgba(54, 227, 255, 0.8)); }
.sysmap .node-label { fill: var(--text-muted); font-family: var(--font-mono); letter-spacing: 0.06em; text-anchor: middle; pointer-events: none; paint-order: stroke; stroke: rgba(3, 6, 14, 0.85); stroke-width: 3px; transition: opacity 0.4s; }
.sysmap .node:hover .node-label, .sysmap .node.selected .node-label { fill: var(--text); }
.sysmap .node.unlabelled .node-label { opacity: 0; }
/* collapsed moons/stations: clicks go to their planet (which then zooms in) */
.sysmap .node.unlabelled { pointer-events: none; }
.sysmap .node.dimmed { opacity: 0.45; }
.sysmap .sel-ring { fill: none; stroke: var(--cyan); stroke-width: 1.5; opacity: 0; }
.sysmap .node.selected .sel-ring { opacity: 1; animation: sel-pulse 1.8s ease-in-out infinite; }
@keyframes sel-pulse { 50% { stroke-opacity: 0.35; } }
.sysmap .res-dot { fill: var(--green); filter: drop-shadow(0 0 3px rgba(59, 255, 176, 0.9)); pointer-events: none; }
/* bodies */
.sysmap .star { color: #ffe9a8; }
.sysmap .star .body { fill: #fff3c4; stroke: none; filter: drop-shadow(0 0 10px #ffd66b); }
.sysmap .star.star-k { color: #ffb36b; } .sysmap .star.star-k .body { fill: #ffd2a0; filter: drop-shadow(0 0 10px #ff9f43); }
.sysmap .star.star-f { color: #d9ecff; } .sysmap .star.star-f .body { fill: #f4f9ff; filter: drop-shadow(0 0 10px #bfe0ff); }
.sysmap .star.star-m { color: #ff7b6b; } .sysmap .star.star-m .body { fill: #ffb0a0; filter: drop-shadow(0 0 10px #ff5d4a); }
.sysmap .star .glow { pointer-events: none; }
.sysmap .planet .body { fill: #7fa7c9; }
.sysmap .planet.gas .body { fill: #d9a873; }
.sysmap .planet.ice .body { fill: #8fd8f0; }
.sysmap .planet.earth .body { fill: #59c3a8; }
.sysmap .planet.smog .body { fill: #c8c46a; }
.sysmap .planet.proto .body { fill: #8c8a99; }
.sysmap .moon .body { fill: #b8c2d6; }
.sysmap .station .body { fill: var(--cyan); }
.sysmap .jumppoint .body { fill: rgba(138, 92, 255, 0.35); stroke: var(--violet); stroke-width: 1.5; }
.sysmap .jumppoint .node-label { fill: #b9a2ff; }
.sysmap .field .body { fill: #c99a6b; stroke: none; }
.starmap-legend .dot.planet { background: #7fa7c9; }
.starmap-legend .dot.moon { background: #b8c2d6; width: 6px; height: 6px; }
.starmap-legend .dot.station { background: var(--cyan); border-radius: 0; width: 6px; height: 6px; }
.starmap-legend .dot.jump { background: transparent; border: 1.5px solid var(--violet); border-radius: 0; transform: rotate(45deg); }
.starmap-legend .dot.res { background: var(--green); width: 6px; height: 6px; }
/* detail card */
.body-card { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 0.7rem; animation: fade-in 0.35s var(--ease) both; max-height: calc(100vh - 110px); overflow-y: auto; }
.body-title { margin: 0; font-family: var(--font-ui); font-size: 1.5rem; letter-spacing: 0.03em; }
.body-card .desc-block { max-height: 14rem; overflow-y: auto; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 0.3rem 1rem; margin: 0; font-size: 0.85rem; }
.facts dt { color: var(--text-dim); letter-spacing: 0.06em; }
.facts dd { margin: 0; }
.bstats { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.78rem; }
.bstat { display: grid; grid-template-columns: 6rem 1fr 2rem; align-items: center; gap: 0.5rem; }
.bstat .bar.mini { width: 100%; }
.card-section { display: flex; flex-direction: column; gap: 0.35rem; padding-top: 0.6rem; border-top: 1px dashed var(--line); }
.body-links { display: flex; flex-wrap: wrap; gap: 0.3rem 0.9rem; }
.link-btn { background: none; border: 0; padding: 0.15rem 0; color: var(--cyan); font: inherit; font-size: 0.88rem; cursor: pointer; text-align: left; }
.link-btn:hover { color: var(--text); text-decoration: underline; }
.link-btn .body-type { font-size: 0.62rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.12em; margin-right: 0.2rem; }
.link-btn .res-mark { color: var(--green); font-size: 0.6rem; margin-left: 0.3rem; vertical-align: middle; }
.card-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; padding-top: 0.4rem; }
.body-row.current { background: linear-gradient(90deg, rgba(54, 227, 255, 0.12), transparent 70%); }
@media (max-width: 900px) {
  .sysmap-layout { grid-template-columns: 1fr; }
  .body-card { position: static; max-height: none; }
}
.sysmap .res-mark { fill: var(--green); }
.sysmap .belt-tag { cursor: pointer; } .sysmap .belt-tag .belt-label { pointer-events: auto; } .sysmap .belt-tag:hover .belt-label { fill: var(--amber); }
.res-method { margin-top: 0.3rem; }
.res-table { display: flex; flex-direction: column; font-size: 0.84rem; }
.res-trow { display: grid; grid-template-columns: minmax(0, 1fr) 6.2rem 6.4rem; gap: 0.6rem; align-items: center; padding: 0.32rem 0; border-bottom: 1px dashed var(--line); }
.res-trow.head { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-dim); border-bottom: 1px solid var(--line); }
.res-trow > span:nth-child(n+2) { text-align: right; white-space: nowrap; }
.res-trow .bar.mini { width: 2.4rem; }
.res-trow .res-content { color: var(--cyan); }

/* ------------------------------------------------------------- standing */
.ok-text { color: var(--green); }
.lock-text { color: var(--amber); }
.mcard.locked { opacity: 0.55; filter: saturate(0.6); }
.mcard.locked:hover, .mcard.locked:focus-visible { opacity: 1; filter: none; }
.card-link.locked { opacity: 0.55; }
.card-link.locked:hover { opacity: 1; }
.scroll-sentinel { display: flex; justify-content: center; min-height: 1px; padding: 1.6rem 0 0.4rem; }
.standing-filter { display: flex; flex-direction: column; gap: 0.35rem; padding-top: 0.8rem; border-top: 1px dashed var(--line); }
.standing-filter p { margin: 0; }
.req-box { margin-top: 1rem; padding: 0.8rem 1rem; border: 1px solid var(--line); background: rgba(54, 227, 255, 0.04); display: flex; flex-direction: column; gap: 0.55rem; }
.req-box.locked { border-color: rgba(255, 159, 67, 0.45); background: rgba(255, 159, 67, 0.06); }
.req-box.ok { border-color: rgba(59, 255, 176, 0.35); }
.req-head { display: flex; justify-content: space-between; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.req-text { font-size: 0.92rem; }
.req-rank { display: grid; grid-template-columns: auto minmax(0, 14rem); gap: 0.8rem; align-items: center; font-size: 0.82rem; }
.standing-intro { margin-bottom: 1.2rem; display: flex; flex-direction: column; gap: 0.8rem; }
.standing-intro p { margin: 0; color: var(--text-muted); font-size: 0.9rem; line-height: 1.6; }
.standing-tools { display: flex; flex-wrap: wrap; gap: 0.6rem 1.2rem; align-items: center; }
.standing-tools .input { max-width: 22rem; }
.faction-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 520px), 1fr)); gap: 1.1rem; margin-bottom: 1rem; }
.faction-card { display: flex; flex-direction: column; gap: 0.8rem; }
.faction-head { display: flex; justify-content: space-between; gap: 0.8rem; align-items: flex-start; }
.faction-head h3 { margin: 0; font-family: var(--font-ui); font-size: 1.15rem; }
.faction-head a { white-space: nowrap; text-decoration: none; }
.faction-desc { margin: 0; color: var(--text-muted); font-size: 0.82rem; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
.faction-desc.open { display: block; cursor: default; }
.career { display: flex; flex-direction: column; gap: 0.45rem; padding-top: 0.7rem; border-top: 1px dashed var(--line); }
.career-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.6rem; }
.ladder { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.rung { display: flex; flex-direction: column; align-items: flex-start; gap: 0.1rem; min-width: 6.2rem; flex: 1 1 6.2rem; padding: 0.4rem 0.55rem; cursor: pointer;
  background: rgba(120, 170, 255, 0.05); border: 1px solid var(--line); color: var(--text-muted); font: inherit; text-align: left; transition: background var(--fast), border-color var(--fast), color var(--fast); }
.rung:hover { border-color: var(--line-strong); color: var(--text); }
.rung .rung-name { font-size: 0.76rem; line-height: 1.2; }
.rung .rung-count { font-size: 0.68rem; color: var(--text-dim); }
.rung.passed { background: rgba(54, 227, 255, 0.07); border-color: rgba(54, 227, 255, 0.25); color: var(--text); }
.rung.current { background: rgba(54, 227, 255, 0.18); border-color: var(--cyan); color: var(--text); box-shadow: inset 0 -2px 0 var(--cyan); }
.rung.current .rung-count { color: var(--cyan); }
.rung.current.default { border-style: dashed; box-shadow: none; }
@media (max-width: 700px) { .rung { min-width: 5rem; flex-basis: 5rem; } .req-rank { grid-template-columns: 1fr; gap: 0.3rem; } }

/* ------------------------------------------------------------- shopping */
.input-sm { padding: 0.35rem 0.5rem; font-size: 0.85rem; }
.input-unit { display: flex; gap: 0.35rem; align-items: center; }
.input-unit .input { min-width: 0; flex: 1; }
.input-unit .select { width: auto; flex: 0 0 auto; }
.shop-add { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.7rem; margin-top: 0.8rem; }
.shop-add .input { width: 5rem; }
.shop-form { display: flex; flex-direction: column; gap: 0.7rem; }
.shop-form .field { display: flex; flex-direction: column; gap: 0.3rem; }
.shop-form .btn { align-self: flex-start; }
.shop-new { margin-bottom: 1.2rem; }
.shop-new-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr) minmax(0, 1.6fr) auto; gap: 0.8rem; align-items: end; }
.shop-new-grid:has(> :nth-child(5)) { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.7fr) minmax(0, 1.3fr) minmax(0, 1fr) auto; }
.shop-new-grid .field { display: flex; flex-direction: column; gap: 0.3rem; }
.shop-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.shop-toolbar .tabs { margin-top: 0; }
.shop-group { margin-bottom: 1rem; }
.shop-group-title { display: inline-flex; align-items: center; gap: 0.5rem; font-family: var(--font-ui); font-weight: 700; font-size: 1.05rem; }
.shop-group-title a { text-decoration: none; }
.shop-row { display: grid; grid-template-columns: auto minmax(0, 1fr) 9.5rem auto; gap: 0.8rem; align-items: center; padding: 0.55rem 0; border-bottom: 1px dashed var(--line); }
.shop-row:last-child { border-bottom: 0; }
.shop-row.done .shop-main { opacity: 0.5; text-decoration: line-through; }
.shop-check { width: 1.1rem; height: 1.1rem; accent-color: var(--green); cursor: pointer; }
.shop-main { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.shop-title { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; }
.shop-title a { text-decoration: none; }
.shop-amount .input { text-align: right; }
.shop-actions { display: flex; gap: 0.25rem; }
.shop-edit { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.45rem; margin-top: 0.4rem; max-width: 40rem; text-decoration: none; }
.shop-edit-actions { display: flex; gap: 0.4rem; }
@media (max-width: 900px) { .shop-new-grid, .shop-new-grid:has(> :nth-child(5)) { grid-template-columns: 1fr 1fr; } .shop-new-grid .btn { grid-column: 1 / -1; } }
@media (max-width: 600px) { .shop-row { grid-template-columns: auto minmax(0, 1fr); } .shop-amount, .shop-actions { grid-column: 2; } }
.sys-chip { margin-right: 0.4rem; font-size: 0.6rem; padding: 0.1em 0.5em; vertical-align: middle; }
.sys-chip.sys-uee { color: var(--cyan); border-color: rgba(54, 227, 255, 0.45); }
.sys-chip.sys-lawless { color: #ff8a5c; border-color: rgba(255, 120, 80, 0.55); background: rgba(255, 90, 60, 0.08); }
.sys-chip.sys-nyx { color: #c3a6ff; border-color: rgba(138, 92, 255, 0.55); background: rgba(138, 92, 255, 0.08); }

/* --------------------------------------------------------------- events */
.event-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 520px), 1fr)); gap: 1.1rem; margin-bottom: 1rem; }
.event-card { display: flex; flex-direction: column; gap: 0.75rem; }
.event-card.live { box-shadow: inset 3px 0 0 var(--green); }
.event-card.upcoming { box-shadow: inset 3px 0 0 var(--amber); }
.event-card .rung { cursor: default; }
.event-note { margin: 0; padding: 0.5rem 0.7rem; border-left: 2px solid var(--violet); background: rgba(138, 92, 255, 0.07); font-size: 0.85rem; }
.event-edit { display: flex; flex-direction: column; gap: 0.6rem; padding-top: 0.7rem; border-top: 1px dashed var(--line); }
.event-edit .field { display: flex; flex-direction: column; gap: 0.3rem; }
.event-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.event-other summary { cursor: pointer; }
.chip.event-off { opacity: 0.75; }
@media (max-width: 600px) { .event-dates { grid-template-columns: 1fr; } }

/* --------------------------------------------------------------- chains */
.chain-grantors { display: flex; flex-wrap: wrap; gap: 0.3rem 0.8rem; font-size: 0.82rem; padding-left: 1.2rem; }
.chain-grantors a { text-decoration: none; }
.chain-grantors a.done { color: var(--green); }
.chain-grantors a.locked { color: var(--text-dim); }
.chain-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.path-steps { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-direction: column; gap: 0.7rem; position: relative; }
.path-steps::before { content: ""; position: absolute; left: 1.55rem; top: 1rem; bottom: 1rem; width: 2px; background: linear-gradient(var(--cyan), var(--violet)); opacity: 0.35; }
.path-step { display: grid; grid-template-columns: 2.2rem minmax(0, 1fr) auto; gap: 1rem; align-items: center; position: relative; }
.path-num { width: 2.2rem; height: 2.2rem; display: grid; place-items: center; border: 1px solid var(--line-strong); background: var(--bg, #070b18); font-weight: 700; z-index: 1; }
.path-step.done { opacity: 0.6; }
.path-step.done .path-num { color: var(--green); border-color: var(--green); }
.path-step.current { box-shadow: inset 3px 0 0 var(--amber); }
.path-step.current .path-num { color: var(--amber); border-color: var(--amber); }
.path-step.target .path-num { color: var(--violet); border-color: var(--violet); }
.path-main { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }
.path-title { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.path-title a { text-decoration: none; }
.path-progress { display: grid; grid-template-columns: minmax(0, 14rem) auto; gap: 0.6rem; align-items: center; }
.path-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: flex-end; }
@media (max-width: 700px) { .path-step { grid-template-columns: 2.2rem minmax(0, 1fr); } .path-actions { grid-column: 2; justify-content: flex-start; } }

/* login: keep me signed in */
.toggle.remember { margin-top: 0.9rem; }

