/* WTK KSP Multiplayer — Mission Section Styles
   Requires: tokens.css, mission-control.css
   ─────────────────────────────────────────────────────────────── */

/* ═══════════════════════════════════════════════════════════════
   MISSION SUB-NAVIGATION
═══════════════════════════════════════════════════════════════ */

.mission-subnav {
  background: rgba(10, 14, 20, 0.94);
  border-bottom: 1px solid var(--panel-edge);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  margin-bottom: var(--sp-6);
}

.tab-bar {
  display: flex;
  gap: 0;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--sp-6);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tab-bar::-webkit-scrollbar { display: none; }

.tab-bar .tab-btn,
.tab-bar a.tab-btn {
  font-family: var(--font-mono);
  font-size: var(--sz-12);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: var(--sp-2) var(--sp-3);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--dur-base), background var(--dur-base);
  line-height: inherit;
}

.tab-bar .tab-btn:hover,
.tab-bar a.tab-btn:hover {
  color: var(--text);
  background: var(--panel);
  text-decoration: none;
}

.tab-bar .tab-btn.active {
  color: var(--accent);
}

@media (max-width: 640px) {
  .tab-bar { padding-inline: var(--sp-4); }
}

/* ═══════════════════════════════════════════════════════════════
   DASHBOARD
═══════════════════════════════════════════════════════════════ */

.dash-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-3);
  margin-bottom: var(--sp-6);
}

.dash-card {
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  padding: var(--sp-4) var(--sp-5);
  position: relative;
}

.dash-card-label {
  font-family: var(--font-mono);
  font-size: var(--sz-10);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-dim);
  margin-bottom: var(--sp-2);
}

.dash-card-value {
  font-family: var(--font-mono);
  font-size: var(--sz-24);
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.dash-card-value.go      { color: var(--go); }
.dash-card-value.caution { color: var(--caution); }
.dash-card-value.nogo    { color: var(--nogo); }
.dash-card-value.accent  { color: var(--accent); }

.dash-card-delta {
  font-family: var(--font-mono);
  font-size: var(--sz-11);
  color: var(--text-dim);
  margin-top: var(--sp-1);
}

@media (max-width: 900px) {
  .dash-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 540px) {
  .dash-grid { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════════
   VESSELS
═══════════════════════════════════════════════════════════════ */

.vessel-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.vessel-row {
  display: grid;
  grid-template-columns: 2rem 1fr auto auto auto 2.5rem;
  gap: var(--sp-3);
  align-items: center;
  padding: var(--sp-3) var(--sp-4);
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  transition: background var(--dur-fast);
}

.vessel-row:hover { background: var(--panel-raised); }

.vessel-row-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
}
.vessel-row-status.active    { background: var(--go); box-shadow: 0 0 6px var(--go-glow); }
.vessel-row-status.landed    { background: var(--caution); }
.vessel-row-status.dead      { background: var(--nogo); }

.vessel-row-name {
  font-family: var(--font-mono);
  font-size: var(--sz-13);
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vessel-row-meta {
  font-family: var(--font-mono);
  font-size: var(--sz-11);
  color: var(--text-muted);
  white-space: nowrap;
}

.vessel-row-orbit {
  font-family: var(--font-mono);
  font-size: var(--sz-11);
  color: var(--accent);
  white-space: nowrap;
}

.vessel-row-chevron {
  color: var(--text-dim);
  font-family: var(--font-mono);
  text-align: right;
}

/* Masonry via CSS columns: each card flows down its own column, so expanding
   one card only pushes the cards below it in THAT column — the other columns
   keep their position instead of leaving a gap (the old grid grew the whole
   row to the tallest card). */
.vessel-grid {
  column-count: 3;
  column-gap: var(--sp-3);
}

@media (max-width: 960px) {
  .vessel-grid { column-count: 2; }
}
@media (max-width: 600px) {
  .vessel-grid { column-count: 1; }
}

/* Vessels grouped by location, two groups wide. CSS columns keep it masonry —
   a tall group doesn't leave a gap beside a short one — and break-inside:avoid
   keeps each group intact in one column. */
.vessel-location-groups {
  column-count: 2;
  column-gap: var(--sp-4);
}
@media (max-width: 760px) {
  .vessel-location-groups { column-count: 1; }
}

.vessel-group {
  break-inside: avoid;
  margin-bottom: var(--sp-5);
}
/* Each group sits in a ~half-width column, so its cards stack in one column. */
.vessel-group .vessel-grid { column-count: 1; }

.vessel-group-summary {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  margin-bottom: var(--sp-3);
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: 6px;
  cursor: pointer;
  list-style: none;
  font-family: var(--font-mono);
  font-size: var(--sz-14);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
}
.vessel-group-summary::-webkit-details-marker { display: none; }
.vessel-group-summary:hover { border-color: var(--panel-edge-hi); }

.vessel-group-chevron {
  display: inline-block;
  font-size: var(--sz-10);
  color: var(--accent);
  transition: transform 0.15s ease;
}
.vessel-group[open] > .vessel-group-summary .vessel-group-chevron { transform: rotate(90deg); }

.vessel-group-count {
  margin-left: auto;
  font-size: var(--sz-11);
  color: var(--text-dim);
  background: var(--panel-raised);
  border: 1px solid var(--panel-edge);
  border-radius: 999px;
  padding: 1px var(--sp-2);
}

.vessel-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  display: flex;
  flex-direction: column;
  transition: border-color var(--dur-base);
  /* Keep a card intact within its column and space columns vertically. */
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  margin-bottom: var(--sp-3);
}

.vessel-card--open {
  border-color: var(--panel-edge-hi);
}

.vessel-card-summary {
  padding: var(--sp-4) var(--sp-4) var(--sp-3);
}

.vessel-card-header {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-2);
}

.vessel-card-type {
  font-family: var(--font-mono);
  font-size: var(--sz-10);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
}

.vessel-card-name {
  font-family: var(--font-mono);
  font-size: var(--sz-14);
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--sp-1);
  line-height: 1.3;
}

.vessel-card-loc {
  font-family: var(--font-mono);
  font-size: var(--sz-11);
  color: var(--accent);
  margin-bottom: var(--sp-2);
}

.vessel-card-crew-preview {
  font-family: var(--font-mono);
  font-size: var(--sz-11);
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Comms LED */
.vessel-comm-led {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.vessel-comm-led.comm-on {
  background: var(--go);
  box-shadow: 0 0 5px var(--go-glow);
}
.vessel-comm-led.comm-off {
  background: var(--nogo);
}

/* Expand toggle */
.vessel-card-toggle {
  width: 100%;
  background: var(--panel-raised);
  border: none;
  border-top: 1px solid var(--panel-edge);
  padding: var(--sp-2) var(--sp-4);
  font-family: var(--font-mono);
  font-size: var(--sz-11);
  color: var(--text-muted);
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: color var(--dur-fast), background var(--dur-fast);
}
.vessel-card-toggle:hover { color: var(--text); background: var(--panel-edge); }

.vessel-card-chevron {
  display: inline-block;
  font-size: var(--sz-10);
  transition: transform 0.2s ease;
}

/* Detail panel */
.vessel-card-detail {
  padding: var(--sp-3) var(--sp-4) var(--sp-4);
  border-top: 1px solid var(--panel-edge);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.vessel-card-detail[hidden] { display: none; }

.vessel-card-stat {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: var(--sz-11);
  color: var(--text-muted);
  gap: var(--sp-2);
}

.vessel-card-stat-k { color: var(--text-dim); flex-shrink: 0; }
.vessel-card-stat-v { color: var(--text); font-variant-numeric: tabular-nums; text-align: right; }

.vessel-detail-label {
  font-family: var(--font-mono);
  font-size: var(--sz-10);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  margin-bottom: var(--sp-2);
}

/* Resource bars */
.vessel-card-resources {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.resource-bar-row {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: var(--sz-10);
  color: var(--text-muted);
  margin-bottom: 3px;
}

.resource-bar-name { color: var(--text-muted); }
.resource-bar-pct  { color: var(--text); font-variant-numeric: tabular-nums; }

.resource-bar-track {
  height: 4px;
  background: var(--panel-edge);
  border-radius: 2px;
  overflow: hidden;
}

.resource-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--accent);
  transition: width 0.3s ease;
}
.resource-bar-fill.mid { background: var(--caution); }
.resource-bar-fill.low { background: var(--nogo); }

/* Crew detail */
.vessel-card-crew-detail {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.vessel-crew-name {
  font-family: var(--font-mono);
  font-size: var(--sz-11);
  color: var(--text);
}

/* Flag plaque */
.vessel-plaque-text {
  font-family: var(--font-mono);
  font-size: var(--sz-11);
  color: var(--text-muted);
  font-style: italic;
  border-left: 2px solid var(--panel-edge-hi);
  padding-left: var(--sp-3);
  line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════════════
   KERBAL ROSTER
═══════════════════════════════════════════════════════════════ */

/* Collapsible status groups (Available / On Mission / Missing) */
.kerbal-group { margin-bottom: var(--sp-5); }

.kerbal-group-summary {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  margin-bottom: var(--sp-3);
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: 6px;
  cursor: pointer;
  list-style: none;
  font-family: var(--font-mono);
  font-size: var(--sz-14);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
}
.kerbal-group-summary::-webkit-details-marker { display: none; }
.kerbal-group-summary:hover { border-color: var(--panel-edge-hi); }

.kerbal-group-chevron {
  display: inline-block;
  font-size: var(--sz-10);
  color: var(--text-dim);
  transition: transform 0.15s ease;
}
.kerbal-group[open] > .kerbal-group-summary .kerbal-group-chevron { transform: rotate(90deg); }
.kerbal-group-chevron.available { color: var(--go); }
.kerbal-group-chevron.assigned  { color: var(--accent); }
.kerbal-group-chevron.missing   { color: var(--caution); }

.kerbal-group-count {
  margin-left: auto;
  font-size: var(--sz-11);
  color: var(--text-dim);
  background: var(--panel-raised);
  border: 1px solid var(--panel-edge);
  border-radius: 999px;
  padding: 1px var(--sp-2);
}

/* Masonry via CSS columns — see .vessel-grid note above. */
.roster-grid {
  column-count: 3;
  column-gap: var(--sp-3);
}

@media (max-width: 960px) { .roster-grid { column-count: 2; } }
@media (max-width: 600px) { .roster-grid { column-count: 1; } }

/* Mission-log timeline inside a kerbal card */
.kerbal-missionlog {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}
.kerbal-log-item {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  font-family: var(--font-mono);
  font-size: var(--sz-11);
  color: var(--text-muted);
  line-height: 1.4;
  position: relative;
  padding-left: var(--sp-1);
}
.kerbal-log-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  margin-top: 0.45em;
}
.kerbal-log-text { color: var(--text-muted); }

.kerbal-card {
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  display: flex;
  flex-direction: column;
  transition: border-color var(--dur-base);
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  margin-bottom: var(--sp-3);
}

.kerbal-card.vessel-card--open { border-color: var(--panel-edge-hi); }

.kerbal-card-summary {
  padding: var(--sp-4) var(--sp-4) var(--sp-3);
}

.kerbal-card-status {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-2);
  flex-wrap: wrap;
}

.kerbal-card-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.kerbal-card-status-dot.available { background: var(--go); box-shadow: 0 0 5px var(--go-glow); }
.kerbal-card-status-dot.assigned  { background: var(--accent); }
.kerbal-card-status-dot.missing   { background: var(--caution); box-shadow: 0 0 5px var(--caution-glow); }
.kerbal-card-status-dot.dead      { background: var(--nogo); }

.kerbal-card-status-text {
  font-family: var(--font-mono);
  font-size: var(--sz-10);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
}

.kerbal-card-name {
  font-family: var(--font-mono);
  font-size: var(--sz-16);
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--sp-1);
  line-height: 1.2;
}

.kerbal-card-role-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
}

.kerbal-card-role {
  font-family: var(--font-mono);
  font-size: var(--sz-11);
  color: var(--accent);
}

/* Stars */
.kerbal-stars {
  font-family: var(--font-mono);
  font-size: var(--sz-11);
  color: var(--caution);
  letter-spacing: 0.05em;
  white-space: nowrap;
}

/* Badges */
.kerbal-badges {
  display: flex;
  gap: var(--sp-1);
  margin-left: auto;
}

.kerbal-badge {
  font-family: var(--font-mono);
  font-size: var(--sz-9);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 1px 4px;
  border: 1px solid var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

.kerbal-badge.hero {
  border-color: var(--caution);
  color: var(--caution);
  background: transparent;
}

.kerbal-badge.mia-promoted {
  background: var(--caution);
  color: var(--bg);
  border-color: var(--caution);
}

/* Inventory */
.kerbal-inventory {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.kerbal-inv-item {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: var(--sz-11);
  color: var(--text-muted);
}

.kerbal-inv-qty {
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

/* ═══════════════════════════════════════════════════════════════
   OBITUARIES
═══════════════════════════════════════════════════════════════ */

/* Masonry via CSS columns (matches vessels/kerbals) so a tall memorial card
   doesn't leave an empty gap under the shorter cards in its row. */
.obituary-list {
  column-count: 3;
  column-gap: var(--sp-4);
}

@media (max-width: 960px) { .obituary-list { column-count: 2; } }

.mission-section-title {
  font-family: var(--font-mono);
  font-size: var(--sz-14);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
  margin: var(--sp-6) 0 var(--sp-3);
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--panel-edge);
}

.memorial-card {
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  padding: var(--sp-5);
  position: relative;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  margin-bottom: var(--sp-4);
}

.memorial-card-header {
  margin-bottom: var(--sp-3);
}

.memorial-card-name {
  font-family: var(--font-mono);
  font-size: var(--sz-20);
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--sp-1);
}

.memorial-card-meta {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

.memorial-card-trait {
  font-family: var(--font-mono);
  font-size: var(--sz-11);
  color: var(--accent);
}

.memorial-card-cause {
  font-family: var(--font-mono);
  font-size: var(--sz-11);
  color: var(--nogo);
  margin-bottom: var(--sp-2);
}

.memorial-card-tod {
  font-family: var(--font-mono);
  font-size: var(--sz-10);
  color: var(--text-dim);
  margin-bottom: var(--sp-3);
}

.memorial-card-epitaph {
  font-size: var(--sz-13);
  color: var(--text-muted);
  line-height: 1.7;
  font-style: italic;
  border-left: 2px solid var(--panel-edge-hi);
  padding-left: var(--sp-3);
  margin: var(--sp-3) 0;
  max-width: 32em;
}

.memorial-card-context {
  font-family: var(--font-mono);
  font-size: var(--sz-10);
  color: var(--text-dim);
  margin-bottom: var(--sp-2);
}

/* Career stats mini-grid */
.memorial-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: var(--sp-2);
  margin: var(--sp-3) 0;
  padding: var(--sp-3);
  background: var(--panel-raised);
  border: 1px solid var(--panel-edge);
}

.memorial-stat {
  text-align: center;
}

.memorial-stat-label {
  font-family: var(--font-mono);
  font-size: var(--sz-9);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-bottom: 2px;
}

.memorial-stat-val {
  font-family: var(--font-mono);
  font-size: var(--sz-16);
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.memorial-card-career {
  font-family: var(--font-mono);
  font-size: var(--sz-11);
  color: var(--text-dim);
  line-height: 1.5;
}

.obituary-empty {
  text-align: center;
  padding: var(--sp-16) var(--sp-6);
}

.obituary-empty-icon {
  font-size: var(--sz-40);
  margin-bottom: var(--sp-4);
  opacity: 0.4;
}

.obituary-empty-text {
  font-family: var(--font-mono);
  font-size: var(--sz-14);
  color: var(--text-muted);
}

/* Responsive: single column + tighter spacing on small screens so memorial
   cards don't overflow or crowd. */
@media (max-width: 600px) {
  .obituary-list { column-count: 1; }
  .memorial-card { padding: var(--sp-4); }
  .memorial-card-name { font-size: var(--sz-16); }
  .memorial-card-meta { gap: var(--sp-2); }
  .memorial-stats-grid {
    grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
    padding: var(--sp-2);
  }
  .memorial-card-epitaph { font-size: var(--sz-12); }
}

/* ═══════════════════════════════════════════════════════════════
   FLAGS & PLAQUES
═══════════════════════════════════════════════════════════════ */

/* Collapsible per-body flag groups */
.flag-group { margin-bottom: var(--sp-5); }

.flag-group-summary {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  margin-bottom: var(--sp-3);
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: 6px;
  cursor: pointer;
  list-style: none;
  font-family: var(--font-mono);
  font-size: var(--sz-14);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent);
}
.flag-group-summary::-webkit-details-marker { display: none; }
.flag-group-summary:hover { border-color: var(--panel-edge-hi); }

.flag-group-chevron {
  display: inline-block;
  font-size: var(--sz-10);
  color: var(--text-dim);
  transition: transform 0.15s ease;
}
.flag-group[open] > .flag-group-summary .flag-group-chevron { transform: rotate(90deg); }

.flag-group-count {
  margin-left: auto;
  font-size: var(--sz-11);
  color: var(--text-dim);
  background: var(--panel-raised);
  border: 1px solid var(--panel-edge);
  border-radius: 999px;
  padding: 1px var(--sp-2);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}

.flag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--sp-3);
}

.flag-card {
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  overflow: hidden;
  transition: border-color var(--dur-base);
}

.flag-card:hover { border-color: var(--accent); }

.flag-card-img {
  width: 100%;
  aspect-ratio: 2 / 1;
  object-fit: cover;
  background: var(--panel-raised);
  display: block;
}

.flag-card-body {
  padding: var(--sp-3) var(--sp-4);
}

.flag-card-name {
  font-family: var(--font-mono);
  font-size: var(--sz-13);
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--sp-1);
}

.flag-card-location {
  font-family: var(--font-mono);
  font-size: var(--sz-11);
  color: var(--text-muted);
  margin-bottom: var(--sp-2);
}

.flag-card-owner {
  font-family: var(--font-mono);
  font-size: var(--sz-10);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: var(--sp-2);
}

.flag-card-plaque {
  font-size: var(--sz-13);
  color: var(--text-muted);
  line-height: 1.6;
  font-style: italic;
  border-left: 2px solid var(--panel-edge-hi);
  padding-left: var(--sp-3);
}

/* ═══════════════════════════════════════════════════════════════
   ALARM TIMELINE
═══════════════════════════════════════════════════════════════ */

.alarm-timeline {
  position: relative;
  padding-left: var(--sp-6);
}

.alarm-timeline::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--panel-edge);
}

.alarm-item {
  position: relative;
  padding: var(--sp-3) 0 var(--sp-4) var(--sp-4);
}

.alarm-item::before {
  content: '';
  position: absolute;
  left: calc(-1 * var(--sp-6) + 4px);
  top: var(--sp-3);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--panel-edge-hi);
  border: 2px solid var(--panel);
}

.alarm-item.urgent::before   { background: var(--nogo); }
.alarm-item.warning::before  { background: var(--caution); }
.alarm-item.nominal::before  { background: var(--go); }

.alarm-item-time {
  font-family: var(--font-mono);
  font-size: var(--sz-11);
  color: var(--text-dim);
  margin-bottom: var(--sp-1);
}

.alarm-item-label {
  font-family: var(--font-mono);
  font-size: var(--sz-13);
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--sp-1);
}

.alarm-item-detail {
  font-family: var(--font-mono);
  font-size: var(--sz-11);
  color: var(--text-muted);
}

.alarm-item-vessel {
  color: var(--accent);
}

/* ═══════════════════════════════════════════════════════════════
   CRAFT LIBRARY
═══════════════════════════════════════════════════════════════ */

.craft-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--sp-3);
}

.craft-card {
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.craft-card-name {
  font-family: var(--font-mono);
  font-size: var(--sz-14);
  font-weight: 700;
  color: var(--text);
}

.craft-card-meta {
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

.craft-card-chip {
  font-family: var(--font-mono);
  font-size: var(--sz-10);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  padding: 2px var(--sp-2);
  border: 1px solid var(--panel-edge);
}

.craft-card-stats {
  font-family: var(--font-mono);
  font-size: var(--sz-11);
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════════
   SHARED MISSION LAYOUT UTILITIES
═══════════════════════════════════════════════════════════════ */

.mission-filter {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  background: var(--panel);
  border: 1px solid var(--panel-edge);
}

.mission-filter input[type="text"] {
  background: var(--panel-raised);
  border: 1px solid var(--panel-edge-hi);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: var(--sz-12);
  padding: var(--sp-2) var(--sp-3);
  flex: 1 1 200px;
}

.mission-filter input[type="text"]::placeholder {
  color: var(--text-dim);
}

.filter-btns {
  display: flex;
  gap: 0;
  margin-left: auto;
}

.filter-btn {
  font-family: var(--font-mono);
  font-size: var(--sz-11);
  padding: var(--sp-1) var(--sp-3);
  border: 1px solid var(--panel-edge);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  white-space: nowrap;
}
.filter-btn:hover { background: var(--panel-raised); color: var(--text); }
.filter-btn.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

/* ═══════════════════════════════════════════════════════════════
   SKELETON & LOADING
═══════════════════════════════════════════════════════════════ */

.skeleton {
  background: var(--panel-raised);
  border: 1px solid var(--panel-edge);
  animation: skeleton-pulse 1.6s ease-in-out infinite;
}

@keyframes skeleton-pulse {
  0%, 100% { opacity: 0.35; }
  50%       { opacity: 0.7; }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; opacity: 0.5; }
}

/* ═══════════════════════════════════════════════════════════════
   MISSION NAV DROPDOWN
═══════════════════════════════════════════════════════════════ */

.nav-dropdown {
  position: relative;
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-top: none;
  z-index: 101;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  display: block;
}

.nav-dropdown-menu a {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--sz-11);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: var(--sp-2) var(--sp-3);
  border-bottom: 1px solid var(--panel-edge);
  white-space: nowrap;
}

.nav-dropdown-menu a:hover {
  color: var(--text);
  background: var(--panel-raised);
  text-decoration: none;
}

.nav-dropdown-menu a:last-child {
  border-bottom: none;
}

/* ═══════════════════════════════════════════════════════════════
   PAGE HEADER (for mission pages)
═══════════════════════════════════════════════════════════════ */

.page-header {
  padding-block: var(--sp-10) var(--sp-6);
  border-bottom: 1px solid var(--panel-edge);
  margin-bottom: var(--sp-6);
}

.page-header-label {
  font-family: var(--font-mono);
  font-size: var(--sz-11);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  color: var(--text-dim);
  margin-bottom: var(--sp-3);
}

.page-title {
  font-family: var(--font-mono);
  font-size: var(--sz-32);
  font-weight: 700;
  color: var(--text);
  line-height: 1.15;
  margin-bottom: var(--sp-3);
}

.page-sub {
  font-size: var(--sz-16);
  color: var(--text-muted);
  max-width: 640px;
  line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════════════ */

@media (max-width: 720px) {
  .nav-dropdown:hover .nav-dropdown-menu,
  .nav-dropdown:focus-within .nav-dropdown-menu {
    position: static;
    border: 1px solid var(--panel-edge);
    margin-top: var(--sp-2);
  }
}

@media (max-width: 640px) {
  .mission-filter { flex-direction: column; align-items: stretch; }
  .filter-btns { margin-left: 0; margin-top: var(--sp-2); }
}

/* Collapsible per-player gallery folders (rendered by mission.js render.gallery).
   Hide the native disclosure triangle — render.gallery draws its own chevron. */
.gallery-player > summary { list-style: none; }
.gallery-player > summary::-webkit-details-marker { display: none; }
.gallery-player > summary::marker { content: ""; }
.gallery-player > summary:hover { border-color: var(--accent); }

.gallery-item:hover { border-color: var(--accent) !important; }

/* In-page lightbox (built once by mission.js _ensureLightbox) */
.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(2, 6, 12, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--sp-6);
  gap: var(--sp-4);
}
.gallery-lightbox[hidden] { display: none; }

.gl-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-4);
  max-width: 100%;
  max-height: 82vh;
}

.gl-img {
  max-width: min(1400px, 90vw);
  max-height: 82vh;
  object-fit: contain;
  border: 1px solid var(--panel-edge-hi);
  border-radius: 4px;
  background: var(--bg);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6);
}

.gl-caption {
  font-family: var(--font-mono);
  font-size: var(--sz-12);
  color: var(--text-muted);
  text-align: center;
}

.gl-close {
  position: absolute;
  top: var(--sp-4);
  right: var(--sp-4);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--panel-edge-hi);
  background: var(--panel);
  color: var(--text);
  font-size: var(--sz-18);
  line-height: 1;
  cursor: pointer;
  transition: background var(--dur-fast), color var(--dur-fast);
}
.gl-close:hover { background: var(--nogo); color: #fff; border-color: var(--nogo); }

.gl-nav {
  flex-shrink: 0;
  width: 48px;
  height: 64px;
  border: 1px solid var(--panel-edge);
  background: var(--panel);
  color: var(--text);
  font-size: var(--sz-28);
  line-height: 1;
  cursor: pointer;
  border-radius: 6px;
  transition: background var(--dur-fast), border-color var(--dur-fast);
}
.gl-nav:hover { background: var(--accent-dim); border-color: var(--accent); }

@media (max-width: 600px) {
  .gallery-lightbox { padding: var(--sp-3); }
  .gl-stage { gap: var(--sp-2); }
  .gl-nav { width: 36px; height: 52px; font-size: var(--sz-20); }
  .gl-img { max-width: 96vw; }
}
