/* ===== Main game desktop layout (Claude, Oct16 evening) =====
   Owner: "remove the elements below and put it on the side so we can have bigger play space ... a phone like UI
   on the left side", "put the PWR distribution metrics below the auto stage", "modals ~75% of the current size",
   "make it more professional". Active only on the main game in portrait mode on screens >= 900 px
   (body.online-portrait.demo-desk, set by src/account-game.js fitField). Phones keep the bottom tabs. */

/* ---------- page frame ---------- */
.online-portrait.demo-desk { background: radial-gradient(120% 80% at 50% 0%, #0b1d26 0%, #050b0f 55%, #020507 100%); }
.online-portrait.demo-desk .shell { grid-template-rows: 58px minmax(0, 1fr) 0; }
.online-portrait.demo-desk .topbar { width: auto; }
.online-portrait.demo-desk .layout { padding: 0 16px; }
.online-portrait.demo-desk #view-combat {
  display: grid !important; grid-template-columns: 300px auto 330px; grid-template-areas: "left frame right";
  justify-content: center; align-items: start; column-gap: 18px; padding-top: 8px; background: transparent; overflow: visible;
}
.online-portrait.demo-desk .combat-frame { grid-area: frame; border: 1px solid #2c5361; box-shadow: 0 0 0 1px #000, 0 18px 50px #0009; }
.portrait-side { display: none; }
.online-portrait.demo-desk .portrait-side {
  display: flex; flex-direction: column; gap: 12px; min-width: 0; max-height: calc(100dvh - 74px);
  overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: #274552 transparent; padding-bottom: 6px;
  /* Owner Oct18 video: in a non-maximized window the scrollbar came and went every tick (tiles size with the panel width),
     so the whole menu jumped. Always reserve the scrollbar space: the width never changes. */
  scrollbar-gutter: stable;
}
.online-portrait.demo-desk #portrait-left { grid-area: left; }
.online-portrait.demo-desk #portrait-right { grid-area: right; }
.online-portrait.demo-desk .portrait-side > * { width: auto !important; max-width: none !important; flex: none; }

/* shared card look */
.online-portrait .portrait-card, .online-portrait.demo-desk #portrait-left .combat-information {
  border: 1px solid #22404c; border-radius: 10px; background: linear-gradient(180deg, #0a1b23 0%, #07131a 100%);
  box-shadow: inset 0 1px 0 #ffffff0a, 0 8px 24px #0006; padding: 12px;
}
.panel-head { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; }
.panel-head strong { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: #9fdcef; }

/* ---------- left: ship info ---------- */
.online-portrait.demo-desk #portrait-left .combat-information { display: block; padding: 0; overflow: hidden; }
.online-portrait.demo-desk #portrait-left .combat-footer { display: grid; grid-template-columns: 1fr 1fr !important; border: 0; background: none; }
.online-portrait.demo-desk #portrait-left .combat-footer > div { padding: 9px 12px; border: 0; border-bottom: 1px solid #1b3540; min-width: 0; }
.online-portrait.demo-desk #portrait-left .combat-footer > div:nth-child(odd) { border-right: 1px solid #1b3540; }
.online-portrait.demo-desk #portrait-left .combat-footer > div:first-child,
.online-portrait.demo-desk #portrait-left .combat-footer > div:nth-child(2) { grid-column: 1 / -1; border-right: 0; }
.online-portrait.demo-desk #portrait-left .combat-footer > div:nth-last-child(-n+2) { border-bottom: 0; }
.online-portrait.demo-desk #portrait-left .combat-footer span,
.online-portrait.demo-desk #portrait-left .combat-footer small { font-size: 10px; letter-spacing: .06em; color: #7f9ca8; }
.online-portrait.demo-desk #portrait-left .combat-footer strong { font-size: 13px; }

/* ---------- left: command phone ---------- */
.rift-phone { display: none; }
.online-portrait.demo-desk .rift-phone {
  display: block; position: relative; border-radius: 26px; padding: 10px 12px 14px;
  background: linear-gradient(160deg, #10232c 0%, #081419 60%, #060f13 100%);
  border: 1px solid #2c5361; box-shadow: inset 0 0 0 3px #04090c, inset 0 2px 0 4px #ffffff08, 0 14px 36px #000a;
}
.online-portrait.demo-desk .rift-phone::after { /* home bar */
  content: ""; display: block; width: 84px; height: 4px; margin: 12px auto 0; border-radius: 4px; background: #2c5361;
}
.phone-status { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 2px 8px 10px; font-size: 11px; font-weight: 700; color: #9fb4bf; }
.phone-os { letter-spacing: .14em; color: #64f2c7; font-size: 10px; }
#phone-clock { font-variant-numeric: tabular-nums; color: #e7f3f7; font-size: 12px; }
.phone-signal { justify-self: end; display: inline-flex; align-items: flex-end; gap: 2px; height: 10px; }
.phone-signal i { display: block; width: 3px; background: #64f2c7; border-radius: 1px; }
.phone-signal i:nth-child(1) { height: 3px; } .phone-signal i:nth-child(2) { height: 5px; }
.phone-signal i:nth-child(3) { height: 7px; } .phone-signal i:nth-child(4) { height: 10px; }
.phone-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.phone-grid .tabs, .phone-grid .combat-quick-controls { display: contents !important; }

/* tiles: every navigation tab, notifications, store, music, account */
.online-portrait.demo-desk .phone-grid .tab,
.online-portrait.demo-desk .phone-grid .combat-quick-controls > button,
.online-portrait.demo-desk .phone-grid #open-account {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  width: auto !important; height: auto !important; min-height: 0; aspect-ratio: 1 / .86; flex: none !important; margin: 0;
  padding: 6px 4px; font-size: 11px; font-weight: 600; line-height: 1.1; text-align: center; color: #d9eaf0; white-space: nowrap;
  background: linear-gradient(180deg, #123542 0%, #0c2631 100%); border: 1px solid #23505f; border-image: none; border-radius: 8px;
  box-shadow: inset 0 1px 0 #ffffff12; transition: background .15s, border-color .15s, transform .08s;
}
.online-portrait.demo-desk .phone-grid .tab:hover,
.online-portrait.demo-desk .phone-grid .combat-quick-controls > button:hover,
.online-portrait.demo-desk .phone-grid #open-account:hover { border-color: #4fd2ea; background: linear-gradient(180deg, #17485a 0%, #0f3140 100%); }
.online-portrait.demo-desk .phone-grid .tab:active,
.online-portrait.demo-desk .phone-grid .combat-quick-controls > button:active { transform: scale(.97); }
.online-portrait.demo-desk .phone-grid .tab.is-active { background: linear-gradient(180deg, #4fe0f2 0%, #2fb9d3 100%); border-color: #8ff0ff; color: #04141a; }

.online-portrait.demo-desk .phone-grid .tab-icon,
.online-portrait.demo-desk .phone-grid .combat-quick-controls > button img { width: 28px !important; height: 28px !important; flex: none; margin: 0; image-rendering: pixelated; }
.online-portrait.demo-desk .phone-grid #open-void span { font-size: 11px; }
.online-portrait.demo-desk .phone-grid #open-void small { font-size: 9px; color: inherit; opacity: .7; margin-top: -4px; }
.online-portrait.demo-desk .phone-grid #open-account::before {
  content: ""; width: 28px; height: 28px; background: url("../assets/ui/icons/astronaut.png") center / contain no-repeat; image-rendering: pixelated;
}
.online-portrait.demo-desk .phone-grid #notification-count {
  position: absolute; top: 5px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  font-size: 10px; line-height: 18px; text-align: center; color: #04141a; background: #ffb35c;
}
.online-portrait.demo-desk .phone-grid #notification-count:empty,
.online-portrait.demo-desk .phone-grid #notification-count.is-zero { display: none; }
.phone-dock { margin-top: 10px; }
.online-portrait.demo-desk .phone-dock .account-connection {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0; padding: 7px 10px; border: 1px solid #1b3540; border-radius: 8px;
  background: #050e12; font-size: 11px; line-height: 1.3; color: #9fb4bf;
}
.online-portrait.demo-desk .phone-dock .account-connection strong { color: #64f2c7; font-size: 11px; }
.online-portrait.demo-desk .phone-dock .account-connection strong::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: #64f2c7; box-shadow: 0 0 6px #64f2c7; }
.online-portrait.demo-desk .phone-dock #account-status { flex: 1 1 140px; min-width: 0; }
.online-portrait.demo-desk .phone-dock #account-action-retry { width: 100%; min-height: 28px; font-size: 11px; }

/* ---------- right: sortie card ---------- */
.sortie-card { position: relative; }
.online-portrait.demo-desk #sortie-card .combat-options {
  display: grid !important; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0; min-height: 0; border: 0; background: none; align-items: stretch;
}
.online-portrait.demo-desk #sortie-card .combat-options > label:first-child {
  grid-column: 1 / -1; display: grid; gap: 5px; font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #7f9ca8;
}
.online-portrait.demo-desk #sortie-card .combat-options select {
  width: 100% !important; min-height: 36px; padding: 0 10px; font-size: 13px; letter-spacing: 0; text-transform: none; color: #e7f3f7;
  background-color: #06141b; border: 1px solid #2c5361; border-radius: 6px;
}
/* Auto next level: whole row is the switch (input stays a real checkbox for keyboard + tests) */
.online-portrait.demo-desk #sortie-card .switch-row {
  grid-column: 1 / -1; display: grid; grid-template-columns: 40px minmax(0, 1fr); align-items: center; gap: 10px; cursor: pointer;
  padding: 8px 10px; border: 1px solid #1b3540; border-radius: 6px; background: #06141b; font-size: 12px; text-transform: none; letter-spacing: 0; color: #d9eaf0;
}
.online-portrait.demo-desk #sortie-card .switch-row:hover { border-color: #2c5361; }
.online-portrait.demo-desk #sortie-card #auto-levels, .online-portrait.demo-desk #sortie-card #repeat-sector {
  appearance: none; -webkit-appearance: none; position: relative; width: 40px; height: 22px; margin: 0; border-radius: 11px; cursor: pointer;
  background: #1a2e36; border: 1px solid #2c5361; transition: background .15s;
}
.online-portrait.demo-desk #sortie-card #auto-levels::after, .online-portrait.demo-desk #sortie-card #repeat-sector::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #9fb4bf; transition: transform .15s, background .15s;
}
.online-portrait.demo-desk #sortie-card #auto-levels:checked, .online-portrait.demo-desk #sortie-card #repeat-sector:checked { background: #157a8c; border-color: #4fd2ea; }
.online-portrait.demo-desk #sortie-card #auto-levels:checked::after, .online-portrait.demo-desk #sortie-card #repeat-sector:checked::after { transform: translateX(18px); background: #e9fbff; }
.online-portrait.demo-desk #sortie-card #auto-levels:focus-visible, .online-portrait.demo-desk #sortie-card #repeat-sector:focus-visible { outline: 2px solid #4fd2ea; outline-offset: 2px; }
.switch-text { display: grid; gap: 1px; min-width: 0; }
.switch-text b { font-size: 13px; color: #e7f3f7; }
.switch-text small { font-size: 11px; color: #7f9ca8; }
body:not(.demo-desk) .switch-text small { display: none; }
body:not(.demo-desk) .switch-text, body:not(.demo-desk) .switch-text b { display: inline; font-size: inherit; font-weight: inherit; color: inherit; }
/* Fire + Loot */
.online-portrait.demo-desk #sortie-card .combat-options > span.disabled-action { display: block; }
.online-portrait.demo-desk #sortie-card #fire-weapons,
.online-portrait.demo-desk #sortie-card #idle-summary,
.online-portrait.demo-desk #sortie-card #void-return-control {
  width: 100%; min-height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; border-radius: 6px;
}
.online-portrait.demo-desk #sortie-card #void-return-control { grid-column: 1 / -1; }
.online-portrait.demo-desk #sortie-card #fire-weapons .command-icon { width: 16px; height: 16px; }
/* status pill in the card header */
.online-portrait.demo-desk #sortie-card #combat-run-status {
  position: absolute; top: 10px; right: 12px; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 2px 10px 2px 20px; border: 1px solid #2c5361; border-radius: 999px; font-size: 11px; font-weight: 700; color: #ffb35c; background: #06141b;
}
.online-portrait.demo-desk #sortie-card #combat-run-status::before { content: ""; position: absolute; left: 8px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: currentColor; }
.online-portrait.demo-desk #sortie-card #combat-run-status:empty { display: none; }
.online-portrait.demo-desk.combat-running #sortie-card #combat-run-status { color: #64f2c7; }
.online-portrait.demo-desk #sortie-card #combat-season { display: none !important; }
/* flight controls (dock / move / dash / pulse) */
.online-portrait.demo-desk #sortie-card .combat-commandbar {
  position: static !important; display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 10px; padding: 8px 0 0; border: 0; border-top: 1px solid #1b3540; background: none;
}
.online-portrait.demo-desk #sortie-card .combat-commandbar[hidden] { display: none !important; }
.online-portrait.demo-desk #sortie-card .combat-control-group, .online-portrait.demo-desk #sortie-card .combat-controls { position: static !important; display: flex; gap: 6px; }
.online-portrait.demo-desk #sortie-card .combat-commandbar button { width: 40px; height: 36px; min-height: 36px; padding: 0; border-radius: 6px; }
/* bounty */
.online-portrait.demo-desk #sortie-card .combat-score {
  display: flex !important; position: static; align-items: baseline; justify-content: space-between; margin-top: 10px; padding: 8px 10px;
  border: 1px solid #1b3540; border-radius: 6px; background: #06141b; transform: none; width: 100% !important; margin-left: 0; box-sizing: border-box;
}
.online-portrait.demo-desk #sortie-card .combat-score span { font-size: 10px; letter-spacing: .1em; color: #7f9ca8; }
.online-portrait.demo-desk #sortie-card .combat-score strong { font-size: 18px; color: #ffcf7a; font-variant-numeric: tabular-nums; }

/* ---------- right: PWR distribution ---------- */
.online-earnings { display: none; }
.online-portrait.demo-desk .online-earnings { display: block; }
.online-earnings .earn-head strong { font-size: 12px; letter-spacing: .12em; color: #9fdcef; }
.online-earnings .earn-tile, .online-earnings .earn-pool { border-radius: 6px; border-color: #1b3540; background: #06141b; }
.online-earnings .earn-bar { border-radius: 4px; }
.online-earnings .fine { font-size: 10.5px !important; }

/* ---------- windows / dialogs at ~75% on desktop ---------- */
@media (min-width: 900px) {
  .online-portrait #game-window { width: min(980px, calc(100vw - 48px)); height: min(840px, calc(100dvh - 48px)); border-radius: 10px; }
  .online-portrait #store-dialog { width: min(840px, calc(100vw - 48px)); max-height: min(720px, calc(100dvh - 48px)); }
  .online-portrait #recruitment-dialog { width: min(760px, calc(100vw - 48px)); max-width: 760px; }
  .online-portrait #session-dialog { max-height: min(680px, calc(100dvh - 48px)); }
  .online-portrait #game-window-content { padding: 10px 14px; }
  .online-portrait .game-window-heading { padding: 8px 12px; }
  .online-portrait .game-window-heading h2 { font-size: 17px; }
  .online-portrait #game-window::backdrop, .online-portrait dialog::backdrop { background: #000a; backdrop-filter: blur(2px); }
}

/* "Stop after this stage" choice, shown in the sortie card while the server holds a cleared stage */
.stage-slot:empty { display: none; }
.online-portrait.demo-desk #sortie-card .stage-result {
  position: static; display: grid; gap: 8px; margin: 10px 0 0; padding: 10px; border: 1px solid #ffb35c; border-radius: 6px;
  background: #1d1408; box-shadow: 0 0 18px #ffb35c22; transform: none; width: auto;
}
.online-portrait.demo-desk #sortie-card .stage-result[hidden] { display: none; }
.online-portrait.demo-desk #sortie-card #stage-result-title { font-size: 13px; color: #ffcf7a; }
.online-portrait.demo-desk #sortie-card .stage-result-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.online-portrait.demo-desk #sortie-card .stage-result-actions button { min-height: 34px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; border-radius: 6px; width: 100%; }
.online-portrait.demo-desk #sortie-card .stage-result-actions .hud-icon { width: 14px; height: 14px; }
.online-portrait.demo-desk #sortie-card #result-repeat::after { content: "Replay"; }
.online-portrait.demo-desk #sortie-card #result-progress::after { content: "Next stage"; }
.online-portrait.demo-desk #sortie-card #result-progress { order: 2; border-color: #ffb35c; }
.online-portrait.demo-desk #sortie-card #result-repeat { order: 1; }
.online-portrait.demo-desk #sortie-card #result-finish { order: 3; grid-column: 1 / -1; }
.online-portrait.demo-desk #sortie-card #combat-run-status::first-letter { text-transform: uppercase; }

/* Galaxy window at the smaller size: all ten galaxies stay visible in one row */
@media (min-width: 900px) {
  .online-portrait #galaxy-tabs { grid-template-columns: repeat(10, minmax(0, 1fr)); overflow: visible; }
  .online-portrait #galaxy-tabs .galaxy-tab { min-width: 0; width: auto; padding: 6px 7px; font-size: 11px; white-space: normal; }
  .online-portrait #galaxy-tabs .galaxy-tab small, .online-portrait #galaxy-tabs .galaxy-tab span { font-size: 9px; }
}
/* shorter screens (e.g. 1366x768): compact tiles so the phone fits without scrolling */
@media (min-width: 900px) and (max-height: 840px) {
  .online-portrait.demo-desk .phone-grid .tab,
  .online-portrait.demo-desk .phone-grid .combat-quick-controls > button,
  .online-portrait.demo-desk .phone-grid #open-account { aspect-ratio: 1 / .62; gap: 3px; }
  .online-portrait.demo-desk .phone-grid .tab-icon,
  .online-portrait.demo-desk .phone-grid .combat-quick-controls > button img,
  .online-portrait.demo-desk .phone-grid #open-account::before { width: 24px !important; height: 24px !important; }
  .online-portrait.demo-desk #portrait-left .combat-footer > div { padding: 6px 12px; }
  .online-portrait.demo-desk .rift-phone { padding: 8px 10px 10px; }
  .online-portrait.demo-desk .rift-phone::after { margin-top: 8px; }
  .online-earnings .earn-tile small { display: none; }
}
.online-portrait #galaxy-tabs .galaxy-tab strong { overflow-wrap: normal; word-break: normal; hyphens: none; font-size: 11px; }

/* ---------- phones (< 900 px): keep bottom tabs, tidy the controls above the field ---------- */
@media (max-width: 899px) {
  .online-portrait .combat-options { display: grid !important; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 6px; padding: 6px 8px; }
  .online-portrait .combat-options > label:first-child { grid-column: 1 / -1; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 8px; font-size: 11px; color: #9fb4bf; }
  .online-portrait .combat-options > label:first-child select { width: 100% !important; min-height: 32px; }
  .online-portrait .combat-options .switch-row { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; white-space: nowrap; }
  .online-portrait .combat-options > span.disabled-action { display: none; }
  .online-portrait .combat-options #combat-run-status { font-size: 11px; color: #ffb35c; text-align: right; }
  .online-portrait .combat-options #combat-run-status::first-letter { text-transform: uppercase; }
  .online-portrait .combat-options #idle-summary { min-height: 30px; padding: 0 12px; }
  .online-portrait .combat-quick-controls { grid-column: 1 / -1; display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .online-portrait .combat-quick-controls button { min-height: 32px; font-size: 11px; padding: 0 6px; }
  .online-portrait .combat-options .account-connection { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; font-size: 11px; margin: 0; }
  .online-portrait .combat-options .account-connection #account-status { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .online-portrait .combat-options .account-connection #open-account { min-height: 28px; font-size: 11px; }
}

/* ===================== Oct16 evening: window polish (owner list) ===================== */
/* Top bar: Genesis + Notifications, left of the resources */
.top-actions { display: none; }
.online-portrait .top-actions {
  display: flex; gap: 6px; align-items: stretch; position: absolute; z-index: 4; top: 6px; height: 46px;
  right: calc(min(800px, 100% - 270px) + 18px);
}
.online-portrait .top-actions > button {
  display: inline-flex; align-items: center; gap: 8px; height: 46px; min-height: 0; padding: 0 12px; margin: 0; border-radius: 8px;
  font-size: 12px; font-weight: 700; color: #d9eaf0; background: #06141b; border: 1px solid #274552; border-image: none; white-space: nowrap;
}
.online-portrait .top-actions > button:hover { border-color: #4fd2ea; }
.online-portrait .top-actions img { width: 22px; height: 22px; image-rendering: pixelated; }
.online-portrait .genesis-cta { position: relative; color: #ffe6a8 !important; border-color: #b8862e !important; background: linear-gradient(180deg, #2a1d08 0%, #150e04 100%) !important; box-shadow: 0 0 0 1px #000, 0 0 16px #ffb35c33; }
.online-portrait .genesis-cta span { display: grid; text-align: left; line-height: 1.1; }
.online-portrait .genesis-cta b { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: #ffd27a; }
.online-portrait .genesis-cta small { font-size: 10px; font-weight: 600; color: #c9a86a; }
.online-portrait .genesis-cta::after { content: ""; position: absolute; inset: -1px; border-radius: 8px; pointer-events: none; animation: genesis-glow 2.6s ease-in-out infinite; }
@keyframes genesis-glow { 0%, 100% { box-shadow: 0 0 0 0 #ffb35c00; } 50% { box-shadow: 0 0 14px 1px #ffb35c66; } }
@media (prefers-reduced-motion: reduce) { .online-portrait .genesis-cta::after { animation: none; } }
.online-portrait .top-actions #open-notifications { position: relative; }
.online-portrait .top-actions #notification-count {
  position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; font-size: 10px; line-height: 18px; text-align: center; color: #04141a; background: #ffb35c;
}
.online-portrait .top-actions #notification-count.is-zero { display: none; }
@media (max-width: 1240px) { .online-portrait .top-actions #open-notifications { font-size: 0; gap: 0; padding: 0 10px; } .online-portrait .genesis-cta small { display: none; } }
@media (max-width: 899px) {
  .online-portrait .top-actions { top: 8px; right: 8px; height: 38px; }
  .online-portrait .top-actions > button { height: 38px; padding: 0 9px; }
}
/* Loot lives on the sortie card; the phone and the bottom tabs do not repeat it */
.online-portrait #open-loot { display: none !important; }

/* Genesis window */
.online-portrait #genesis-dialog { width: min(820px, calc(100vw - 32px)); max-height: min(760px, calc(100dvh - 40px)); overflow-y: auto; border-radius: 10px; }
.online-portrait #genesis-dialog .dialog-heading h2 { color: #ffd27a; letter-spacing: .04em; }
.online-portrait #genesis-dialog .launch-heading h3 { display: none; }

/* Confirmations: a small modal on top of the window that asked */
#transaction-dialog.is-stacked { width: min(440px, calc(100vw - 32px)); box-shadow: 0 24px 60px #000c; }
#transaction-dialog.is-stacked::backdrop { background: #0007; }
#transaction-dialog #transaction-detail h3 { font-size: 16px; margin: 0 0 6px; }
#transaction-dialog #transaction-detail p { font-size: 13px; line-height: 1.45; color: #c7d8df; }
#transaction-dialog #transaction-confirm { width: 100%; min-height: 40px; margin-top: 8px; }

@media (min-width: 900px) {
  /* ---------- Recruitment: all ten candidates visible ---------- */
  .online-portrait #recruitment-dialog { width: min(820px, calc(100vw - 48px)); max-width: 820px; padding: 12px 14px; border-radius: 10px; }
  .online-portrait #recruitment-dialog .dialog-heading { margin-bottom: 4px; }
  .online-portrait #recruitment-dialog .recruitment-toolbar { margin: 4px 0 8px; gap: 10px; font-size: 12px; color: #9fb4bf; }
  .online-portrait #recruitment-dialog #refresh-recruits { min-height: 32px; padding: 0 12px; font-size: 12px; margin-left: auto; }
  .online-portrait #recruitment-dialog #recruitment-feedback:empty { display: none; }
  .online-portrait #recruitment-dialog .grid-details-layout,
  .online-portrait #view-commanders .grid-details-layout { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 12px; align-items: start; }
  .online-portrait #recruitment-grid, .online-portrait #commander-list {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)) !important; gap: 6px; max-height: none !important; overflow: visible !important; min-height: 0 !important;
  }
  .online-portrait #recruitment-grid .inventory-tile, .online-portrait #commander-list .inventory-tile {
    height: 104px; min-height: 0; grid-template-rows: 48px 18px 16px; gap: 2px; padding: 6px 3px; border-radius: 6px;
  }
  .online-portrait #recruitment-grid .commander-portrait, .online-portrait #commander-list .commander-portrait { width: 48px; height: 48px; object-fit: cover; }
  .online-portrait #recruitment-grid .tile-name, .online-portrait #commander-list .tile-name { font-size: 11px; line-height: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .online-portrait #recruitment-grid .inventory-tile small, .online-portrait #commander-list .inventory-tile small { font-size: 9.5px; line-height: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .online-portrait #recruitment-grid .tile-badge, .online-portrait #commander-list .tile-badge { font-size: 9px; padding: 0 3px; top: 3px; right: 3px; }
  .online-portrait #recruitment-details, .online-portrait #commander-details {
    order: 0 !important; display: block !important; border: 1px solid #1b3540 !important; border-radius: 8px; padding: 10px !important; background: #06141b;
    max-height: min(520px, calc(100dvh - 220px)); overflow-y: auto; font-size: 12px;
  }
  .online-portrait #recruitment-details .commander-hero, .online-portrait #commander-details .commander-hero { grid-template-columns: 64px minmax(0, 1fr); gap: 8px; padding: 8px; }
  .online-portrait #recruitment-details .commander-hero img, .online-portrait #commander-details .commander-hero img { width: 64px; height: 64px; }
  .online-portrait #recruitment-details h3, .online-portrait #commander-details h3 { font-size: 16px; }
  .online-portrait #recruitment-details button, .online-portrait #commander-details button { min-height: 34px; font-size: 12px; }

  /* ---------- Commanders: same layout as recruitment ---------- */
  .online-portrait #view-commanders .section-heading { display: flex; justify-content: flex-end; margin: 0 0 8px; }
  .online-portrait #view-commanders .section-heading h2 { display: none; }
  .online-portrait #view-commanders #recruit-commander { min-height: 32px; font-size: 12px; padding: 0 12px; }
  .online-portrait #view-commanders .inventory-controls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-bottom: 8px; }

  /* ---------- Inventory: compact three columns ---------- */
  .online-portrait #view-fleet > .section-heading { display: none; }
  .online-portrait .inv-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 10px; padding-bottom: 8px; border-bottom: 1px solid #1b3540; }
  .online-portrait .inv-toolbar .inventory-tabs { display: flex; gap: 2px; margin: 0; padding: 2px; border: 1px solid #1b3540; border-radius: 8px; background: #050e12; flex-wrap: nowrap; }
  .online-portrait .inv-toolbar .inventory-tabs button {
    min-height: 28px; height: 28px; padding: 0 10px; font-size: 12px; border: 0; border-image: none; border-radius: 6px; background: transparent; color: #9fb4bf; white-space: nowrap;
  }
  .online-portrait .inv-toolbar .inventory-tabs button:hover { color: #e7f3f7; background: #0c2631; }
  .online-portrait .inv-toolbar .inventory-tabs button.is-active, .online-portrait .inv-toolbar .inventory-tabs button[aria-pressed="true"] { color: #04141a; background: #4fd2ea; }
  .online-portrait .inv-toolbar #module-count { margin-left: auto; font-size: 11px; color: #7f9ca8; }
  .online-portrait #inventory-workbench { display: grid; grid-template-columns: 236px minmax(0, 1fr) 250px; gap: 12px; align-items: start; }
  .online-portrait #inventory-workbench > * { min-width: 0; border: 0; padding: 0; }
  .online-portrait .equipped-pane { display: grid; gap: 8px; align-content: start; }
  .online-portrait .equipped-pane > h3 { margin: 4px 0 0; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: #7f9ca8; }
  .online-portrait .equipped-pane > h3:first-child { display: none; }
  .online-portrait #ship-list { display: grid; gap: 6px; padding: 8px; border: 1px solid #1b3540; border-radius: 8px; background: #06141b; }
  .online-portrait #ship-list .equipped-ship { display: grid; grid-template-columns: 52px minmax(0, 1fr); grid-template-rows: auto auto; gap: 0 8px; align-items: center; min-height: 0; padding: 4px; text-align: left; border-radius: 6px; }
  .online-portrait #ship-list .equipped-ship .inventory-ship { grid-row: 1 / 3; width: 52px; height: 52px; }
  .online-portrait #ship-list .equipped-ship strong { font-size: 13px; line-height: 1.2; }
  .online-portrait #ship-list .equipped-ship span { font-size: 10.5px; color: #9fb4bf; }
  .online-portrait #ship-list .hull-meter { font-size: 11px; }
  .online-portrait #ship-list .ship-card-facts { display: flex; justify-content: space-between; margin: 0; font-size: 11px; color: #9fb4bf; }
  .online-portrait #ship-list .ship-repair-shortcut { min-height: 28px; font-size: 11px; }
  .online-portrait #equip-best { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; align-items: end; margin: 0; }
  .online-portrait #equip-best label { display: grid; gap: 2px; font-size: 10px; color: #7f9ca8; }
  .online-portrait #equip-best select { min-height: 30px; font-size: 12px; }
  .online-portrait #equip-best-action { min-height: 30px; padding: 0 10px; font-size: 12px; white-space: nowrap; }
  .online-portrait #module-slots { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
  .online-portrait #module-slots > .disabled-action { display: block; min-width: 0; }
  .online-portrait #module-slots .equipment-slot {
    position: relative; display: grid; justify-items: center; align-content: center; gap: 2px; width: 100%; height: 62px; min-height: 0; padding: 4px 2px;
    border-radius: 6px; text-align: center; overflow: hidden;
  }
  .online-portrait #module-slots .equipment-slot .module-icon, .online-portrait #module-slots .equipment-slot img { width: 30px; height: 30px; margin: 0; }
  .online-portrait #module-slots .equipment-slot > span { display: block; min-width: 0; max-width: 100%; }
  .online-portrait #module-slots .equipment-slot strong { display: block; font-size: 9.5px; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .online-portrait #module-slots .equipment-slot small { display: none; }
  .online-portrait #module-slots .equipment-slot > b { position: absolute; top: 2px; right: 3px; font-size: 9px; }
  .online-portrait #loadout-panel { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; align-items: end; padding: 8px 0 0; border-top: 1px solid #1b3540; }
  .online-portrait #loadout-panel h4 { grid-column: 1 / -1; margin: 0; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: #7f9ca8; }
  .online-portrait #loadout-panel label { display: grid; gap: 2px; font-size: 10px; color: #7f9ca8; }
  .online-portrait #loadout-panel input { min-height: 30px; font-size: 12px; }
  .online-portrait #save-loadout { min-height: 30px; padding: 0 10px; font-size: 12px; }
  .online-portrait #loadout-panel > .disabled-action, .online-portrait #loadout-panel > #unlock-loadout { grid-column: 1 / -1; }
  .online-portrait #loadout-panel #unlock-loadout { min-height: 26px; font-size: 11px; width: 100%; }
  .online-portrait #loadout-panel [data-apply-loadout] { min-height: 28px; font-size: 11px; }
  .online-portrait #view-fleet .inventory-pane { display: grid; gap: 8px; align-content: start; }
  .online-portrait #view-fleet .inventory-controls { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 0; }
  .online-portrait #view-fleet .inventory-controls label { display: grid; gap: 2px; font-size: 10px; color: #7f9ca8; min-width: 0; }
  .online-portrait #view-fleet .inventory-controls select { min-height: 30px; font-size: 12px; width: 100%; }
  .online-portrait #module-inventory { grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 6px; max-height: none; }
  .online-portrait #module-inventory .inventory-tile { height: 92px; grid-template-rows: 40px 18px 16px; gap: 2px; padding: 6px 3px; border-radius: 6px; }
  .online-portrait #module-inventory .inventory-tile .module-icon, .online-portrait #module-inventory .inventory-tile > img { width: 40px; height: 40px; }
  .online-portrait #module-inventory .tile-name { font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .online-portrait #module-inventory .inventory-tile small { font-size: 9.5px; }
  .online-portrait #inventory-count { margin: 0; font-size: 11px; color: #7f9ca8; }
  .online-portrait #module-salvage { border-top: 1px solid #1b3540; padding-top: 6px; font-size: 12px; }
  .online-portrait #inventory-details { border: 1px solid #1b3540 !important; border-radius: 8px; padding: 10px !important; background: #06141b; font-size: 12px; max-height: none; }
  .online-portrait #inventory-details h3 { font-size: 15px; }
  .online-portrait #inventory-details button { min-height: 32px; font-size: 12px; }
  .online-portrait #inventory-details > h3:first-child:only-of-type + .fine { margin-top: 4px; }
}

.online-portrait #view-fleet .inventory-pane > .inventory-grid { min-height: 0; }
@media (min-width: 900px) {
  /* commander card inside the narrow details column */
  .online-portrait #recruitment-dialog .grid-details-layout, .online-portrait #view-commanders .grid-details-layout { grid-template-columns: minmax(0, 1fr) 290px; }
  .online-portrait :is(#recruitment-details, #commander-details) .commander-hero { grid-template-columns: 60px minmax(0, 1fr) !important; gap: 10px; align-items: start; padding: 8px; margin-bottom: 8px; }
  .online-portrait :is(#recruitment-details, #commander-details) .commander-hero .detail-image { width: 60px; height: 60px; }
  .online-portrait :is(#recruitment-details, #commander-details) .commander-hero .commander-portrait { width: 56px; height: 56px; }
  .online-portrait :is(#recruitment-details, #commander-details) .commander-hero h3 { font-size: 15px; margin: 0 0 4px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
  .online-portrait :is(#recruitment-details, #commander-details) .commander-hero-body { min-width: 0; }
  .online-portrait :is(#recruitment-details, #commander-details) .effect-chips { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
  .online-portrait :is(#recruitment-details, #commander-details) .effect-chip { font-size: 10.5px; padding: 1px 6px; }
  .online-portrait :is(#recruitment-details, #commander-details) .commander-passive { margin: 0 0 8px; padding: 6px 8px; font-size: 12px; }
  .online-portrait :is(#recruitment-details, #commander-details) .commander-rolls-title { font-size: 12px; margin: 0 0 4px; }
  .online-portrait :is(#recruitment-details, #commander-details) .commander-rolls div { padding: 3px 0; font-size: 12px; }
  .online-portrait :is(#recruitment-details, #commander-details) .detail-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .online-portrait :is(#recruitment-details, #commander-details) .detail-actions button { width: 100%; padding: 0 6px; }
  .online-portrait :is(#recruitment-details, #commander-details) .detail-actions > :first-child:last-child,
  .online-portrait :is(#recruitment-details, #commander-details) .detail-actions > :first-child { grid-column: 1 / -1; }
  .online-portrait :is(#recruitment-details, #commander-details) details { font-size: 11px; margin-top: 6px; }
  /* tile captions wrap to two short lines instead of being cut */
  .online-portrait :is(#recruitment-grid, #commander-list) .inventory-tile { height: 112px; grid-template-rows: 48px 16px 28px; }
  .online-portrait :is(#recruitment-grid, #commander-list) .inventory-tile small { white-space: normal !important; line-height: 13px !important; text-align: center; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .online-portrait #view-commanders .inventory-controls select { min-height: 30px; font-size: 12px; }
  .online-portrait #view-commanders .inventory-controls label { display: grid; gap: 2px; font-size: 10px; color: #7f9ca8; }
}
@media (min-width: 900px) {
  /* compact form controls in every window */
  .online-portrait :is(#game-window, #recruitment-dialog, #store-dialog) select { min-height: 30px !important; height: 30px; font-size: 12px; padding-block: 0; }
  .online-portrait :is(#game-window, #recruitment-dialog, #store-dialog) .inventory-controls label,
  .online-portrait #store-dialog .store-category-label { font-size: 10px; color: #7f9ca8; display: grid; gap: 2px; }
  /* Missions */
  .online-portrait #view-missions > .section-heading { display: none; }
  .online-portrait #view-missions .mission-tabs { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid #1b3540; border-radius: 8px; background: #050e12; margin: 8px 0; }
  .online-portrait #view-missions .mission-tabs button { min-height: 28px; height: 28px; padding: 0 12px; font-size: 12px; border: 0; border-image: none; border-radius: 6px; background: transparent; color: #9fb4bf; }
  .online-portrait #view-missions .mission-tabs button[aria-selected="true"], .online-portrait #view-missions .mission-tabs button.is-active { color: #04141a; background: #4fd2ea; }
  .online-portrait #view-missions .mission-tabs .tab-count { font-size: 10px; padding: 0 5px; }
  .online-portrait #view-missions .mission-builder { gap: 8px; align-items: end; }
  .online-portrait #view-missions #launch-expedition { min-height: 32px; font-size: 12px; }
  .online-portrait #view-missions .mission-subheading { font-size: 13px; margin: 12px 0 6px; }
  .online-portrait #contract-pool article, .online-portrait #contract-pool > div > div { padding: 6px 8px; }
}

/* Inventory, second pass (owner reference: compact backpack grid, few buttons) */
@media (min-width: 900px) {
  .online-portrait #inventory-workbench > .equipped-pane,
  .online-portrait #inventory-workbench > .inventory-pane { padding: 10px; border: 1px solid #1b3540; border-radius: 10px; background: #06141b; }
  .online-portrait #inventory-workbench > .inventory-pane::before { content: "Backpack"; font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #9fdcef; }
  .online-portrait #module-inventory { grid-template-columns: repeat(auto-fill, 66px); justify-content: start; gap: 6px; }
  .online-portrait #module-inventory .inventory-tile {
    position: relative; width: 66px; height: 66px; padding: 4px; grid-template-rows: 1fr auto; place-items: center; gap: 0;
    border: 1px solid color-mix(in srgb, var(--rarity, #2c5361) 70%, #000); border-image: none; border-radius: 8px;
    background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--rarity, #2c5361) 22%, #0b1d25) 0%, #07131a 75%);
  }
  .online-portrait #module-inventory .inventory-tile:hover { border-color: var(--rarity, #4fd2ea); }
  .online-portrait #module-inventory .inventory-tile[aria-pressed="true"] { outline: 2px solid #ffd27a; outline-offset: 1px; }
  .online-portrait #module-inventory .inventory-tile .tile-name { display: none; }
  .online-portrait #module-inventory .inventory-tile small { font-size: 8.5px; line-height: 1; color: #9fb4bf; text-transform: uppercase; letter-spacing: .04em; }
  .online-portrait #module-slots .equipment-slot { border: 1px solid color-mix(in srgb, var(--rarity, #2c5361) 70%, #000); border-image: none; background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--rarity, #2c5361) 18%, #0b1d25) 0%, #07131a 75%); }
  .online-portrait #loadout-panel .disabled-action:has(#unlock-loadout[disabled]) { display: none; }
}
@media (min-width: 900px) {
  .online-portrait #module-slots .equipment-slot strong { font-size: 9px; white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.05; }
}

/* small polish (Oct16 evening) */
@media (min-width: 900px) {
  .online-portrait #game-window .equipment-slot strong { font-size: 9px; line-height: 1.1; letter-spacing: -.01em; white-space: nowrap; }
  .online-portrait #market-quote { display: block; margin: 6px 0 12px; }
}

/* ===== Oct 16 night: bag, compare, red stop reasons, Battle Lab, Admin (src/online-features.js) ===== */
.stop-reason { margin: 6px 0 0; padding: 7px 10px; border: 1px solid #7a2a2f; border-left: 3px solid #ff5a5f; border-radius: 6px; background: #2a0d10; color: #ff8a8e; font-size: 12px; font-weight: 600; line-height: 1.35; }
.stop-reason[hidden] { display: none; }
.stop-reasons { display: grid; gap: 4px; }
.stop-reasons .stop-reason { margin: 0; }
.online-portrait.demo-desk #sortie-card .sortie-stop { margin: 0 0 10px; }
.online-portrait #sortie-card .stage-result.is-bag-full { border-color: #ff5a5f; background: #2a0d10; box-shadow: 0 0 18px #ff5a5f22; }
.online-portrait #sortie-card .stage-result.is-bag-full #stage-result-title { color: #ff8a8e; }
/* bag meter in the inventory toolbar */
.bag-meter { display: flex; align-items: center; gap: 8px; margin-left: auto; padding: 4px 6px 4px 10px; border: 1px solid #1b3540; border-radius: 8px; background: #050e12; font-size: 12px; }
.bag-meter .bag-label { font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #7f9ca8; }
.bag-meter strong { font-variant-numeric: tabular-nums; color: #e7f3f7; }
.bag-meter .bag-track { width: 90px; height: 6px; border-radius: 3px; background: #10262f; overflow: hidden; }
.bag-meter .bag-track i { display: block; height: 100%; background: #64f2c7; transition: width .4s; }
.bag-meter.is-near .bag-track i { background: #ffb35c; } .bag-meter.is-near strong { color: #ffb35c; }
.bag-meter.is-full { border-color: #ff5a5f; background: #2a0d10; } .bag-meter.is-full .bag-track i { background: #ff5a5f; } .bag-meter.is-full strong { color: #ff8a8e; }
.bag-meter button { min-height: 26px; padding: 0 10px; font-size: 11px; border-radius: 6px; white-space: nowrap; }
.bag-meter .bag-max { font-size: 11px; color: #7f9ca8; }
.online-portrait .inv-toolbar #module-count { margin-left: 0; }
/* backpack tiles: bigger, rarity first */
@media (min-width: 900px) {
  .online-portrait #module-inventory { grid-template-columns: repeat(auto-fill, 76px); gap: 7px; }
  .online-portrait #module-inventory .inventory-tile { width: 76px; height: 76px; border-width: 2px; border-color: color-mix(in srgb, var(--rarity, #2c5361) 85%, #000);
    background: radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--rarity, #2c5361) 34%, #0b1d25) 0%, color-mix(in srgb, var(--rarity, #2c5361) 8%, #07131a) 70%); }
  .online-portrait #module-inventory .inventory-tile .module-icon, .online-portrait #module-inventory .inventory-tile > img { width: 46px; height: 46px; }
  .online-portrait #module-inventory .inventory-tile[data-rarity="Epic"] { box-shadow: 0 0 10px color-mix(in srgb, var(--rarity) 45%, transparent); }
  .online-portrait #module-inventory .inventory-tile[data-rarity="Legendary"] { box-shadow: 0 0 14px color-mix(in srgb, var(--rarity) 60%, transparent), inset 0 0 10px color-mix(in srgb, var(--rarity) 30%, transparent); }
  .online-portrait #module-inventory .inventory-tile small { display: none; }
}
.inventory-tile .rar-chip { position: absolute; right: 3px; bottom: 3px; min-width: 15px; height: 15px; padding: 0 3px; border-radius: 4px; font: 800 9.5px/15px system-ui, sans-serif; font-style: normal; text-align: center; color: #04141a; background: var(--rarity, #a9b4bf); }
.inventory-tile .eq-chip { position: absolute; left: 3px; top: 3px; width: 15px; height: 15px; border-radius: 4px; font: 800 9.5px/15px system-ui, sans-serif; font-style: normal; text-align: center; color: #04141a; background: #64f2c7; }
/* compact module details */
.mdx { display: grid; gap: 8px; }
.mdx-head { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px; align-items: center; }
.mdx-head .detail-image { width: 64px; height: 64px; margin: 0; display: grid; place-items: center; border: 2px solid var(--rarity, #2c5361); border-radius: 10px; background: radial-gradient(circle, color-mix(in srgb, var(--rarity, #2c5361) 30%, #0b1d25), #07131a 75%); }
.mdx-head .detail-image img, .mdx-head .detail-image .module-icon { width: 46px; height: 46px; }
.mdx-head h3 { margin: 0; font-size: 15px; line-height: 1.2; text-align: left !important; }
.mdx-sub { margin: 4px 0 0; font-size: 11px; color: #9fb4bf; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rarity-pill { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #04141a; background: var(--rarity, #a9b4bf); }
.mdx-vs { margin: 0; font-size: 11.5px; color: #9fb4bf; display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: wrap; }
.mdx-vs b { color: #e7f3f7; }
.cmp-tag { padding: 1px 7px; border-radius: 4px; font-size: 10.5px; font-weight: 700; }
.cmp-tag.up { color: #04141a; background: #64f2c7; } .cmp-tag.down { color: #fff; background: #b8343a; } .cmp-tag.same, .cmp-tag.eq { color: #cfe6ef; background: #1b3540; }
.mdx-stats { display: grid; gap: 0; margin: 0; border: 1px solid #1b3540; border-radius: 6px; overflow: hidden; }
.mdx-stats > div { display: flex; justify-content: space-between; gap: 8px; padding: 4px 8px; font-size: 12px; }
.mdx-stats > div:nth-child(odd) { background: #0a1a22; }
.mdx-stats dt { color: #9fb4bf; } .mdx-stats dd { margin: 0; font-weight: 700; color: #e7f3f7; font-variant-numeric: tabular-nums; }
.dlt { font-style: normal; font-weight: 700; margin-left: 4px; } .dlt.up { color: #64f2c7; } .dlt.down { color: #ff7a7f; } .dlt.same { color: #7f9ca8; }
.mdx-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.mdx-actions select { flex: 1 1 100%; min-height: 30px; font-size: 12px; }
.mdx-actions button { flex: 1 1 0; min-height: 34px; font-size: 12px; }
.mdx-actions button.primary { font-weight: 700; }
.mdx-toggle { justify-self: start; min-height: 26px !important; padding: 0 10px; font-size: 11.5px !important; color: #7fe7ff; background: none; border: 1px solid #1b3540; border-image: none; border-radius: 6px; }
.mdx-full { max-height: 34vh; overflow: auto; padding-right: 4px; font-size: 11.5px; }
.mdx-full[hidden] { display: none; }
.mdx-full > .detail-image, .mdx-full > h3, .mdx-full > .detail-rarity, .mdx-full > .item-summary-stats + .decision-stats ~ dl:empty { display: none; }
.mdx-vs { justify-content: flex-start; }
/* hover compare card */
.inv-tip { position: fixed; z-index: 2147483000; width: 230px; padding: 10px; border: 1px solid var(--rarity, #2c5361); border-radius: 10px; background: #071219f2; box-shadow: 0 12px 30px #000c; pointer-events: none; display: grid; gap: 6px; font-size: 12px; }
.inv-tip[hidden] { display: none; }
.inv-tip > strong { font-size: 13px; }
.inv-tip .rarity-pill { justify-self: start; }
/* extra phone tiles: Battle Lab, Admin */
.online-portrait.demo-desk .phone-grid .tab-extra {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; aspect-ratio: 1 / .86; margin: 0; padding: 6px 4px;
  font-size: 11px; font-weight: 600; color: #d9eaf0; background: linear-gradient(180deg, #123542 0%, #0c2631 100%); border: 1px solid #23505f; border-image: none; border-radius: 8px; box-shadow: inset 0 1px 0 #ffffff12;
}
.online-portrait.demo-desk .phone-grid .tab-extra:hover { border-color: #4fd2ea; }
.online-portrait.demo-desk .phone-grid .tab-extra .tab-icon { width: 28px !important; height: 28px !important; image-rendering: pixelated; }
.online-portrait.demo-desk .phone-grid .tab-extra.is-admin { background: linear-gradient(180deg, #3a2a10 0%, #251a08 100%); border-color: #8a6420; color: #ffd27a; }
@media (min-width: 900px) and (max-height: 840px) { .online-portrait.demo-desk .phone-grid .tab-extra { aspect-ratio: 1 / .62; gap: 3px; } .online-portrait.demo-desk .phone-grid .tab-extra .tab-icon { width: 24px !important; height: 24px !important; } }
body:not(.demo-desk) .tabs .tab-extra { flex: 0 0 94px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 11px; }
/* feature dialogs */
.feature-dialog { width: min(460px, calc(100vw - 24px)); }
.admin-grid, .lab-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; margin: 10px 0; }
.admin-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.admin-grid label, .lab-grid label { display: grid; gap: 4px; font-size: 11px; color: #9fb4bf; }
.admin-grid input, .lab-grid select { min-height: 32px; width: 100%; }
.lab-grid .lab-check { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; font-size: 12px; color: #d9eaf0; }
.admin-actions { display: flex; gap: 8px; }
.admin-actions button { flex: 1; min-height: 36px; }
body.lab-active .combat-frame::after { content: "BATTLE LAB · no cost · no rewards"; position: absolute; left: 50%; top: 150px; transform: translateX(-50%); padding: 2px 10px; border: 1px solid #ffb35c; border-radius: 999px; font: 700 10px/16px system-ui, sans-serif; letter-spacing: .08em; color: #ffb35c; background: #1d1408cc; pointer-events: none; z-index: 5; }

@media (min-width: 900px) {
  .online-portrait #inventory-workbench > .inventory-pane::before { content: none; }
  .online-portrait #view-fleet .inventory-pane > .bag-meter { margin: 0; justify-content: flex-start; }
  .online-portrait #view-fleet .inventory-pane > .bag-meter .bag-track { flex: 1; width: auto; }
}
.mdx-full .item-stats div, .mdx-full dt, .mdx-full dd { font-size: 11.5px !important; }
.mdx-full .item-stats { margin: 6px 0; }
.online-portrait #action-notices.is-empty { display: none !important; }
.online-portrait #action-notices [data-notice][hidden] { display: none !important; }

/* ===== Oct 16 late: Exchange (testing), layout fixes, Void HUD ===== */
.online-portrait.demo-desk .phone-grid .tab-extra.is-test { border-color: #6b5a1f; }
.tab-extra .test-chip { position: absolute; top: 4px; right: 4px; padding: 0 4px; border-radius: 3px; font: 800 8px/13px system-ui, sans-serif; letter-spacing: .06em; color: #04141a; background: #ffb35c; }
/* consumables / materials use full-width cards, not the 76 px module grid */
.online-portrait #module-inventory[data-category="consumables"], .online-portrait #module-inventory[data-category="materials"] { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important; }
.online-portrait #module-inventory[data-category="consumables"] > *, .online-portrait #module-inventory[data-category="materials"] > * { width: auto !important; min-width: 0; writing-mode: horizontal-tb; }
.online-portrait #module-inventory[data-category="consumables"] button { white-space: normal; width: 100%; }
/* Acquire / Workshop body under the toolbar */
.online-portrait #ship-workshop { margin-top: 8px; }
.online-portrait #ship-acquire-view { display: grid !important; grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); gap: 14px; align-items: start; }
.online-portrait #ship-acquire-view .acquisition-main { display: grid; gap: 10px; }
/* Void access timer: bottom-left of the field, above the weapon slots */
.online-portrait .combat-frame > #void-hud:not([hidden]) { position: absolute; left: 8px; bottom: calc(var(--weapon-hud-band) + 8px); z-index: 4; min-width: 0; padding: 4px 10px; border: 1px solid #7a4fd1; border-image: none; border-radius: 8px; background: #120a24d9; }
.online-portrait .combat-frame > #void-hud strong { font-size: 12px; }
.rar-word { font-weight: 700; }
/* Exchange window */
.exchange-dialog { width: min(1020px, calc(100vw - 32px)); max-width: none; max-height: calc(100dvh - 40px); overflow: auto; padding: 12px 16px 16px; }
.ex-head { align-items: center; margin-bottom: 8px; }
.ex-head h2 { margin: 0; }
.ex-test { margin-right: auto; margin-left: 10px; padding: 2px 8px; border: 1px solid #ffb35c; border-radius: 999px; font-size: 10px; font-weight: 800; letter-spacing: .08em; color: #ffb35c; }
.ex-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ex-pairs, .ex-intervals, .ex-side { display: flex; gap: 4px; padding: 3px; border: 1px solid #1b3540; border-radius: 10px; background: #050e12; }
.ex-pairs button, .ex-intervals button, .ex-side button { min-height: 30px; padding: 0 12px; border: 0; border-image: none; border-radius: 7px; background: transparent; color: #9fb4bf; font-size: 12px; font-weight: 700; }
.ex-pairs button.is-active, .ex-intervals button.is-active { background: #ffcf7a; color: #1a1200; }
.ex-intervals { margin-left: auto; }
.ex-price strong { font-size: 26px; font-variant-numeric: tabular-nums; color: #f4f7fb; }
.ex-price span { font-size: 12px; color: #9fb4bf; }
.ex-price em { margin-left: 10px; font-style: normal; font-weight: 700; font-size: 12px; } .ex-price em.up { color: #3ddc97; } .ex-price em.down { color: #ff5a5f; }
.ex-sub { margin: 6px 0 8px; font-size: 11.5px; color: #7f9ca8; }
.ex-chart-wrap { position: relative; border: 1px solid #1b3540; border-radius: 10px; background: #050c10; padding: 6px 0; }
#ex-chart { display: block; width: 100%; height: 240px; }
.ex-empty { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: #7f9ca8; font-size: 13px; }
.ex-empty[hidden] { display: none; }
.ex-grid { display: grid; grid-template-columns: 1fr 1fr 1.25fr; gap: 10px; margin-top: 10px; }
.ex-card { border: 1px solid #1b3540; border-radius: 10px; background: #06141b; padding: 10px; min-width: 0; }
.ex-card h3 { margin: 0 0 6px; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: #9fdcef; }
.ex-book-head, .ex-row, .ex-trade { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; font-size: 12px; font-variant-numeric: tabular-nums; }
.ex-book-head { color: #7f9ca8; font-size: 10.5px; padding: 0 6px 4px; } .ex-card:first-child .ex-book-head, .ex-row { grid-template-columns: 1fr 1fr; }
.ex-row { width: 100%; min-height: 22px; padding: 2px 6px; border: 0; border-image: none; border-radius: 4px; text-align: left; cursor: pointer; background: linear-gradient(to left, var(--bar) var(--depth), transparent var(--depth)); }
.ex-row.ask { --bar: #ff5a5f22; color: #ff8a8e; } .ex-row.bid { --bar: #3ddc9722; color: #6ff0b8; }
.ex-row span:last-child { text-align: right; color: #d9eaf0; }
.ex-spread { padding: 4px 6px; font-size: 11px; color: #7f9ca8; border-block: 1px solid #1b3540; margin: 4px 0; }
.ex-book, .ex-trades { display: grid; gap: 1px; max-height: 190px; overflow: auto; }
.ex-trade { padding: 2px 6px; } .ex-trade.buy span:first-child { color: #6ff0b8; } .ex-trade.sell span:first-child { color: #ff8a8e; } .ex-trade.mine { background: #0c2631; border-radius: 4px; }
.ex-trade span:nth-child(3) { text-align: right; color: #7f9ca8; }
.ex-form { display: grid; gap: 7px; align-content: start; }
.ex-side { width: 100%; } .ex-side button { flex: 1; }
.ex-side button[data-side="buy"].is-active { background: #3ddc97; color: #04140c; } .ex-side button[data-side="sell"].is-active { background: #ff5a5f; color: #fff; }
.ex-form label { display: grid; gap: 3px; font-size: 11px; color: #9fb4bf; } .ex-form label small { color: #7f9ca8; }
.ex-form input { min-height: 32px; font-size: 13px; }
.ex-total { display: flex; justify-content: space-between; margin: 0; font-size: 12px; color: #9fb4bf; } .ex-total strong { color: #f4f7fb; }
.ex-avail { margin: 0; font-size: 11px; color: #7f9ca8; } .ex-avail b { color: #d9eaf0; }
#ex-place { min-height: 38px; font-weight: 800; background: #3ddc97; color: #04140c; border-image: none; border: 0; border-radius: 8px; }
.exchange-dialog.is-sell #ex-place { background: #ff5a5f; color: #fff; }
.ex-mine { display: grid; gap: 3px; max-height: 150px; overflow: auto; }
.ex-order { display: grid; grid-template-columns: 42px 52px 1fr 48px 62px; gap: 6px; align-items: center; font-size: 11.5px; font-variant-numeric: tabular-nums; }
.ex-order button { min-height: 22px; padding: 0 6px; font-size: 10.5px; } .ex-order em { font-style: normal; color: #7f9ca8; font-size: 10.5px; }
.ex-tag { padding: 1px 5px; border-radius: 4px; font-size: 10px; font-weight: 800; text-align: center; } .ex-tag.buy { background: #3ddc9733; color: #6ff0b8; } .ex-tag.sell { background: #ff5a5f33; color: #ff8a8e; }
.ex-locks { margin: 0; font-size: 11px; color: #ffcf7a; }
@media (max-width: 899px) { .ex-grid { grid-template-columns: 1fr; } .ex-intervals { margin-left: 0; } }
.online-portrait.demo-desk .inv-toolbar #module-count { display: none; }
.online-portrait #ship-workshop:has(#ship-acquire-view:not([hidden])) .workshop-bands { display: none; }
.ex-order button { white-space: nowrap; height: 22px; min-height: 22px !important; padding: 0 8px; border: 1px solid #2c5361; border-image: none; border-radius: 4px; background: #0c2631; color: #d9eaf0; }
.online-portrait .rarity-name[style*="--rarity"], .online-portrait [style*="--rarity"] > .rarity-name, .online-portrait .odds-row .rarity-name { color: var(--rarity); font-weight: 700; }
.ex-permit { display: grid; gap: 4px; padding: 8px 10px; border: 1px solid #ffb35c; border-radius: 8px; background: #1d1408; font-size: 11.5px; color: #ffcf7a; }
.ex-permit strong { font-size: 12.5px; color: #ffcf7a; } .ex-permit span { color: #d9c49a; }
.ex-permit.is-active { grid-template-columns: 1fr auto; align-items: center; border-color: #2c5361; background: #06141b; }
.ex-permit .ex-permit-ok { color: #6ff0b8; font-weight: 700; }
.ex-permit button { min-height: 28px; font-size: 11.5px; }
.ex-fees { display: grid; gap: 2px; padding: 6px 8px; border: 1px solid #1b3540; border-radius: 6px; background: #050e12; }
.ex-fees p { display: flex; justify-content: space-between; margin: 0; font-size: 11.5px; color: #9fb4bf; } .ex-fees strong { color: #d9eaf0; font-variant-numeric: tabular-nums; }
.ex-fees .ex-net { padding-top: 3px; margin-top: 2px; border-top: 1px dashed #1b3540; font-size: 12.5px; } .ex-fees .ex-net strong { color: #fff; }
/* PWR ranking (Oct17) */
.online-earnings .earn-rank-btn { width: 100%; margin-top: 8px; min-height: 30px; font-size: 12px; }
#earn-ranking { width: min(560px, calc(100vw - 32px)); }
.earn-you-row { margin: 6px 0 10px; padding: 8px 10px; border: 1px solid #b4882f; border-radius: 6px; background: #1d1408; color: #ffcf7a; font-size: 12.5px; }
.earn-table { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.earn-table th { padding: 5px 6px; border-bottom: 1px solid #1b3540; color: #7fa2b0; font-size: 10.5px; letter-spacing: .08em; text-align: right; text-transform: uppercase; }
.earn-table td { padding: 5px 6px; border-bottom: 1px solid #0f2129; color: #cfe2ea; text-align: right; }
.earn-table th:nth-child(2), .earn-table td:nth-child(2) { text-align: left; } .earn-table th:first-child, .earn-table td:first-child { text-align: center; width: 34px; }
.earn-table tr.is-you td { background: #2a1d07; color: #ffd98a; font-weight: 700; }
.earn-table td:last-child { color: #6ff0b8; }
.earn-sim { margin-left: 4px; padding: 0 4px; border: 1px solid #2c5361; border-radius: 3px; color: #7fa2b0; font-size: 9.5px; font-style: normal; letter-spacing: .06em; }
/* Genesis Modification rarity (Oct17) */
.mod-rarity { display: inline-block; padding: 0 6px; border-radius: 4px; font: 800 10px/16px system-ui, sans-serif; letter-spacing: .05em; text-transform: uppercase; color: #04141a; background: #a9b4bf; vertical-align: 1px; }
.mod-rarity.rarity-uncommon { background: #64f2c7; } .mod-rarity.rarity-rare { background: #57b8ff; } .mod-rarity.rarity-epic { background: #d787ff; } .mod-rarity.rarity-legendary { background: #ffca63; }
.rarity-name-common { color: #a9b4bf; } .rarity-name-uncommon { color: #64f2c7; } .rarity-name-rare { color: #57b8ff; } .rarity-name-epic { color: #d787ff; } .rarity-name-legendary { color: #ffca63; }
.genesis-mod-badge.rarity-uncommon { border-color: #64f2c7; color: #64f2c7; } .genesis-mod-badge.rarity-rare { border-color: #57b8ff; color: #57b8ff; } .genesis-mod-badge.rarity-epic { border-color: #d787ff; color: #d787ff; }
.genesis-tier-rules { margin: 4px 0 8px; padding-left: 18px; font-size: 12px; }
#ex-place { width: 100%; }
#ex-place:disabled { opacity: .45; cursor: not-allowed; }
.ex-permit.is-active .ex-permit-ok { white-space: nowrap; }
/* Admin feature flags (Oct17) */
.admin-h { margin: 14px 0 4px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: #9fdcef; }
.admin-flags { display: grid; gap: 6px; }
.flag-row { display: grid; grid-template-columns: 1fr auto auto auto; gap: 8px; align-items: center; padding: 6px 8px; border: 1px solid #1b3540; border-radius: 6px; background: #06141b; }
.flag-row small { display: block; color: #7fa2b0; font-size: 11px; } .flag-row b { color: #d9eaf0; }
.flag-row .flag-stage { padding: 0 5px; border: 1px solid #2c5361; border-radius: 3px; font-size: 10px; color: #9fb4bf; text-transform: uppercase; }
.flag-row .flag-state { font-weight: 800; color: #ff8b9c; } .flag-row.is-on .flag-state { color: #6ff0b8; }
.flag-row button { min-height: 28px; font-size: 11.5px; }
/* ---- Rewards: chests, galaxy boss card, Arch Ship (Oct17) ---- */
.tab-extra .tile-badge { position: absolute; top: 4px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #ff5f78; color: #fff; font: 800 11px/18px system-ui, sans-serif; }
.tab-extra.is-chests, .tab-extra.is-arch { position: relative; }
.online-portrait.demo-desk .phone-grid .tab-extra.is-arch { border-color: #ff8a3d; background: linear-gradient(180deg, #3a1a0c 0%, #1d0d06 100%); color: #ffd2a6; }
.event-chip { background: #ff8a3d !important; color: #1d0d06 !important; }
.tab-icon[src*="chests/"], .chest-card img, .chest-odds img, .reveal-head img, .gb-reward img, .arch-mine img, .cine-chest img, .reveal-list img { image-rendering: pixelated; }
.chests-dialog { width: min(620px, calc(100vw - 32px)); }
.chest-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 8px; margin: 8px 0; }
.chest-card { display: grid; justify-items: center; gap: 3px; padding: 10px 8px; border: 1px solid var(--rc, #a9b4bf); border-radius: 8px; background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--rc, #a9b4bf) 22%, transparent), #06141b 70%); color: #d9eaf0; cursor: pointer; }
.chest-card img { width: 64px; height: 64px; filter: drop-shadow(0 0 10px var(--rc, #a9b4bf)); }
.chest-card small { color: #9fb4bf; font-size: 10.5px; text-align: center; } .chest-card .chest-open { margin-top: 2px; padding: 2px 12px; border-radius: 999px; background: var(--rc, #a9b4bf); color: #04141a; font-weight: 800; font-size: 11px; }
.chest-card:hover { transform: translateY(-2px); box-shadow: 0 0 18px color-mix(in srgb, var(--rc) 45%, transparent); }
.chest-card.is-opening img { animation: chest-shake .9s ease-in-out; } @keyframes chest-shake { 0%,100% { transform: none; } 20% { transform: rotate(-10deg) scale(1.1); } 40% { transform: rotate(9deg) scale(1.15); } 60% { transform: rotate(-7deg) scale(1.2); } 80% { transform: rotate(5deg) scale(1.25); filter: brightness(2) drop-shadow(0 0 20px var(--rc)); } }
.rarity-common { --rc: #a9b4bf; } .rarity-uncommon { --rc: #64f2c7; } .rarity-rare { --rc: #57b8ff; } .rarity-epic { --rc: #d787ff; } .rarity-legendary { --rc: #ffca63; }
.chest-empty { padding: 18px; text-align: center; color: #7fa2b0; border: 1px dashed #1b3540; border-radius: 8px; }
.chest-reveal { margin: 8px 0; padding: 10px 12px; border: 1px solid var(--rc, #1b3540); border-radius: 8px; background: radial-gradient(circle at 20% 0%, color-mix(in srgb, var(--rc, #1b3540) 25%, transparent), #050e12 70%); animation: reveal-in .4s ease-out; }
.reveal-head { display: flex; align-items: center; gap: 8px; } .reveal-head img { width: 40px; height: 40px; } .reveal-head strong { font-size: 15px; color: var(--rc, #fff); }
.reveal-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; } .reveal-list li { display: flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 6px; background: #071820; opacity: 0; animation: reveal-in .35s ease-out forwards; animation-delay: calc(var(--i) * .18s); font-size: 12.5px; }
.reveal-list li img { width: 22px; height: 22px; } .reveal-list li small { color: #7fa2b0; }
@keyframes reveal-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.chest-odds { margin-top: 8px; font-size: 12px; color: #9fb4bf; } .chest-odds ul { margin: 6px 0 0; padding-left: 0; list-style: none; display: grid; gap: 4px; } .chest-odds img { width: 20px; height: 20px; vertical-align: -5px; margin-right: 4px; }
.galaxy-boss-card { display: grid; grid-template-columns: 64px 1fr; gap: 10px; align-items: center; margin: 6px 0 8px; padding: 8px 10px; border: 1px solid #5a2a32; border-radius: 8px; background: linear-gradient(90deg, #1f0d12, #0a1218); }
.galaxy-boss-card.is-won { border-color: #2c6150; background: linear-gradient(90deg, #0c1f18, #0a1218); }
.gb-sprite { width: 64px; height: 64px; object-fit: contain; filter: drop-shadow(0 0 8px #ff5f7866); } .is-won .gb-sprite { filter: grayscale(.6) drop-shadow(0 0 6px #6ff0b866); }
.gb-text { display: grid; gap: 2px; font-size: 12px; } .gb-text small { color: #ff8b9c; font-size: 10px; letter-spacing: .1em; } .is-won .gb-text small { color: #6ff0b8; }
.gb-text strong { font-size: 15px; color: #fff; } .gb-text > span { color: #9fb4bf; } .gb-reward, .gb-won { margin: 2px 0 0; font-size: 12px; color: #d9eaf0; } .gb-reward img { width: 20px; height: 20px; vertical-align: -5px; } .gb-won { color: #6ff0b8; }
.boss-win-dialog { width: min(460px, calc(100vw - 32px)); } .bw-hero { display: flex; align-items: center; gap: 12px; } .bw-hero img { width: 110px; height: 110px; object-fit: contain; filter: drop-shadow(0 0 14px #ff5f78); }
.bw-hero small { color: #ffcf7a; letter-spacing: .12em; font-size: 10.5px; } .bw-hero strong { display: block; font-size: 22px; color: #fff; }
/* Arch Ship dialog */
.arch-dialog { width: min(640px, calc(100vw - 32px)); border-color: #ff8a3d !important; }
.arch-title { letter-spacing: .14em; color: #ffd2a6; }
.arch-hero { display: grid; grid-template-columns: 140px 1fr; gap: 12px; align-items: center; padding: 10px; border-radius: 10px; background: radial-gradient(circle at 18% 50%, #5a2410 0%, #12070a 60%); border: 1px solid #5a2a14; }
.arch-hero img { width: 140px; height: 140px; object-fit: contain; filter: drop-shadow(0 0 16px #ff8a3d); animation: arch-float 4s ease-in-out infinite; }
@keyframes arch-float { 50% { transform: translateY(6px); } }
.arch-hero-text { display: grid; gap: 3px; } .arch-hero-text small { color: #ff8a3d; letter-spacing: .12em; font-size: 10.5px; } .arch-hero-text strong { font-size: 20px; color: #fff; } .arch-hero-text span { color: #d9c4b0; font-size: 12.5px; } .arch-hero-text em { color: #9fb4bf; font-size: 11.5px; font-style: normal; }
.arch-life { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 10px 0; }
.arch-seg { position: relative; height: 26px; border: 1px solid #3a1f14; border-radius: 4px; background: #120a08; overflow: hidden; }
.arch-seg i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #ff5f2e, #ffb35c); } .arch-seg.is-done i { background: #4a2a1a; }
.arch-seg span { position: relative; display: block; padding: 0 6px; font: 700 10.5px/26px system-ui, sans-serif; color: #fff; text-shadow: 0 1px 2px #000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.arch-seg.is-now { border-color: #ff8a3d; box-shadow: 0 0 10px #ff8a3d66; }
.arch-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 8px; } .arch-stats div { padding: 6px 8px; border: 1px solid #1b3540; border-radius: 6px; background: #06141b; } .arch-stats span { display: block; color: #7fa2b0; font-size: 10.5px; } .arch-stats strong { font-size: 15px; color: #fff; }
.arch-go { width: 100%; min-height: 40px; font-size: 14px; letter-spacing: .06em; background: linear-gradient(180deg, #ff8a3d, #d9531d) !important; color: #1d0d06 !important; border: 0 !important; }
.arch-go:disabled { opacity: .45; }
.arch-mine { display: grid; gap: 4px; margin: 8px 0; } .arch-mine div { display: grid; grid-template-columns: 70px 60px 1fr 22px 70px; gap: 6px; align-items: center; padding: 4px 8px; border-radius: 6px; background: #071820; font-size: 12px; } .arch-mine img { width: 20px; height: 20px; }
.arch-rank-btn { width: 100%; margin: 6px 0; min-height: 30px; }
@media (max-width: 560px) { .arch-stats { grid-template-columns: repeat(2, 1fr); } .arch-hero { grid-template-columns: 90px 1fr; } .arch-hero img { width: 90px; height: 90px; } }
/* Arch Ship cinematic overlay */
body.arch-active .combat-frame .combat-top-hud { opacity: .25; } body.arch-active #boss-hud { display: none !important; }
.arch-cine { position: absolute; inset: 0; z-index: 8; pointer-events: none; }
.arch-cine .cine-bar { position: absolute; left: 0; right: 0; height: 9%; background: #000; animation: bars-in .6s ease-out; } .cine-bar.top { top: 0; } .cine-bar.bottom { bottom: 0; }
@keyframes bars-in { from { height: 0; } }
.cine-title { position: absolute; left: 0; right: 0; top: 34%; display: grid; justify-items: center; gap: 2px; text-align: center; animation: title-card 3.2s ease-in-out forwards; }
.cine-title small { color: #ff8a3d; letter-spacing: .3em; font-size: 11px; } .cine-title strong { font: 900 34px/1.05 system-ui, sans-serif; letter-spacing: .18em; color: #fff; text-shadow: 0 0 18px #ff5f2e, 0 0 40px #ff5f2e88; }
.cine-title em { font-style: normal; color: #ffd2a6; font-size: 15px; letter-spacing: .12em; text-transform: uppercase; } .cine-title span { color: #d9c4b0; font-size: 12px; max-width: 80%; }
@keyframes title-card { 0% { opacity: 0; transform: scale(1.15); } 15%, 75% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-20px); } }
.cine-dmg { position: absolute; top: calc(9% + 8px); right: 12px; display: grid; justify-items: end; } .cine-dmg span { color: #ff8a3d; font-size: 10px; letter-spacing: .2em; } .cine-dmg strong { font: 900 30px/1 system-ui, sans-serif; color: #fff; text-shadow: 0 0 12px #ff5f2e; font-variant-numeric: tabular-nums; } .cine-dmg em { color: #ffcf7a; font-size: 11px; font-style: normal; }
.cine-time { position: absolute; left: 0; right: 0; bottom: 9%; height: 4px; background: #2a1208; } .cine-time i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ffb35c, #ff3b54); }
.cine-skip { position: absolute; right: 12px; bottom: calc(9% + 12px); pointer-events: auto; min-height: 28px; padding: 0 12px; border-radius: 999px; background: #000a !important; border: 1px solid #ff8a3d !important; color: #ffd2a6 !important; font-size: 12px; }
.arch-cine.is-enraged::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 120px 30px #ff1f3a88; animation: enrage 0.7s ease-in-out infinite alternate; } @keyframes enrage { to { box-shadow: inset 0 0 160px 50px #ff1f3acc; } }
.combat-frame.cine-shake { animation: cine-shake .35s; } @keyframes cine-shake { 20% { transform: translate(-6px, 3px); } 40% { transform: translate(5px, -4px); } 60% { transform: translate(-4px, 2px); } 80% { transform: translate(3px, -1px); } }
.cine-result { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(340px, 86%); display: grid; justify-items: center; gap: 6px; padding: 16px; border: 1px solid #ff8a3d; border-radius: 12px; background: #0b0605ee; pointer-events: auto; text-align: center; animation: reveal-in .4s ease-out; }
.cine-result small { color: #ff8a3d; letter-spacing: .16em; font-size: 10.5px; } .cine-result strong { font: 900 28px/1.1 system-ui, sans-serif; color: #fff; } .cine-result p { margin: 0; color: #d9c4b0; font-size: 12px; }
.cine-chest { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid var(--rc); border-radius: 8px; background: color-mix(in srgb, var(--rc) 14%, #000); } .cine-chest img { width: 40px; height: 40px; filter: drop-shadow(0 0 10px var(--rc)); }
.cine-actions { display: flex; gap: 8px; } .cine-actions button { min-height: 32px; }
/* ---- Jobs, away report, locked balances, bound modules, roll range (Oct17) ---- */
.jobs-button { cursor: pointer; } .jobs-button:hover { border-color: #4fd2ea !important; }
.jobs-pop { position: fixed; z-index: 60; width: 350px; max-height: 70vh; overflow: auto; padding: 10px 12px; border: 1px solid #2c5361; border-radius: 10px; background: #071219f2; box-shadow: 0 12px 40px #000a; }
.jobs-pop header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; } .jobs-pop header strong { color: #fff; font-size: 14px; } .jobs-pop header button { min-height: 24px; width: 24px; padding: 0; }
.jobs-pop .job { display: grid; grid-template-columns: 26px 1fr auto; gap: 8px; align-items: center; padding: 6px 4px; border-bottom: 1px solid #10242d; }
.jobs-pop .job img { width: 24px; height: 24px; image-rendering: pixelated; object-fit: contain; } .jobs-pop .job b { display: block; color: #e6f3f8; font-size: 12.5px; } .jobs-pop .job small { color: #7fa2b0; font-size: 11px; }
.jobs-pop .job i { display: block; height: 3px; margin-top: 3px; border-radius: 2px; background: linear-gradient(90deg, #4fd2ea var(--p), #12303b var(--p)); }
.jobs-pop .job span { font: 700 12.5px/1 ui-monospace, monospace; color: #ffcf7a; } .jobs-pop .job.is-passive span { color: #6ff0b8; }
.locked-chip { position: absolute; right: 6px; bottom: 3px; font-style: normal; font-size: 10.5px; color: #ffcf7a; } header article { position: relative; }
.away-dialog { width: min(440px, calc(100vw - 32px)); } .away-list li { justify-content: space-between; } .away-list li span { flex: 1; } .away-list b.gain { color: #6ff0b8; } .away-list b.loss { color: #ff8b9c; }
.bound-tag { margin: 4px 0; padding: 4px 8px; border: 1px solid #ffb35c; border-radius: 6px; background: #1d1408; color: #ffcf7a; font-size: 11.5px; font-weight: 700; }
.roll-box { margin: 6px 0; padding: 6px 8px; border: 1px solid #1b3540; border-radius: 6px; background: #050e12; font-size: 11.5px; color: #9fb4bf; } .roll-box p { margin: 0 0 4px; }
.roll-box ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; } .roll-box li { display: grid; grid-template-columns: 1fr auto; } .roll-box li small { grid-column: 1 / -1; color: #6f8a96; font-size: 10.5px; } .roll-box li b { color: #e6f3f8; }
#module-inventory .inventory-tile.is-bound::after { content: "🔒"; position: absolute; left: 3px; top: 2px; font-size: 11px; filter: drop-shadow(0 0 2px #000); }
.away-dialog .admin-actions { margin-top: 12px; }
/* ---- Marketplace tabs + equipment market, Community (Oct17) ---- */
.market-tabs, .cm-tabs, .cm-sub { display: flex; gap: 4px; margin: 6px 0 10px; } .market-tabs button, .cm-tabs button, .cm-sub button { min-height: 30px; padding: 0 14px; border-radius: 6px; }
.market-tabs button.is-active, .cm-tabs button.is-active, .cm-sub button.is-active { background: #4fd2ea !important; color: #04141a !important; border-color: #4fd2ea !important; font-weight: 800; }
.equipment-market { display: grid; grid-template-columns: 260px 1fr; gap: 12px; } @media (max-width: 760px) { .equipment-market { grid-template-columns: 1fr; } }
.eqm-sell { display: grid; gap: 6px; align-content: start; padding: 10px; border: 1px solid #1b3540; border-radius: 8px; background: #06141b; } .eqm-sell h3, .eqm-main h3 { margin: 0 0 4px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: #9fdcef; }
.eqm-sell label, .eqm-filters label { display: grid; gap: 2px; font-size: 11.5px; color: #7fa2b0; } .eqm-quote { margin: 0; font-size: 12px; color: #cfe2ea; }
.eqm-filters { display: flex; gap: 6px; align-items: end; margin-bottom: 8px; flex-wrap: wrap; } .eqm-filters button { min-height: 32px; }
.eqm-grid { display: grid; gap: 6px; max-height: 420px; overflow: auto; }
.eqm-card { display: grid; grid-template-columns: 44px 1fr auto; gap: 8px; align-items: center; padding: 6px 8px; border: 1px solid color-mix(in srgb, var(--rarity) 55%, #1b3540); border-radius: 8px; background: linear-gradient(90deg, color-mix(in srgb, var(--rarity) 14%, #06141b), #06141b 60%); }
.eqm-card > :first-child { width: 44px; height: 44px; } .eqm-card small { display: block; color: #8fa9b4; font-size: 11px; } .eqm-buy { display: grid; justify-items: end; gap: 4px; } .eqm-buy strong { color: #6ff0b8; font-variant-numeric: tabular-nums; } .eqm-buy button { min-height: 28px; }
.eqm-mine { display: grid; gap: 3px; } .eqm-mine div { display: grid; grid-template-columns: 1fr 80px 90px; gap: 6px; padding: 3px 6px; border-radius: 4px; background: #071820; font-size: 12px; }
.community-dialog { width: min(720px, calc(100vw - 32px)); } .cm-body { max-height: 66vh; overflow: auto; }
.cm-news { padding: 8px 10px; margin-bottom: 6px; border: 1px solid #1b3540; border-radius: 8px; background: #06141b; } .cm-news small { color: #7fa2b0; font-size: 11px; } .cm-news b { display: block; color: #fff; font-size: 14px; } .cm-news p { margin: 4px 0 0; color: #cfe2ea; font-size: 12.5px; }
.cm-ref { display: grid; gap: 4px; padding: 10px; border: 1px solid #b4882f; border-radius: 8px; background: #1d1408; } .cm-ref small { color: #ffcf7a; letter-spacing: .14em; font-size: 10.5px; } .cm-ref strong { font: 900 26px/1 ui-monospace, monospace; color: #fff; letter-spacing: .12em; }
.cm-link { display: flex; gap: 6px; } .cm-link input { flex: 1; } .cm-rules { margin: 8px 0; padding-left: 18px; font-size: 12.5px; color: #cfe2ea; display: grid; gap: 3px; }
.cm-engage { display: grid; gap: 6px; padding: 8px 10px; margin-bottom: 6px; border: 1px solid #1b3540; border-radius: 8px; background: #06141b; } .cm-engage a { color: #83e9ff; word-break: break-all; } .cm-engage small { display: block; color: #9fb4bf; } .cm-reward { color: #ffcf7a; font-size: 12px; font-weight: 700; }
.cm-submit { display: flex; gap: 6px; } .cm-submit input { flex: 1; } .cm-status { font-style: normal; font-weight: 700; font-size: 12px; } .cm-status.pending { color: #ffcf7a; } .cm-status.approved { color: #6ff0b8; } .cm-status.rejected { color: #ff8b9c; }
.cm-admin { display: grid; gap: 6px; padding: 10px; margin-bottom: 8px; border: 1px solid #5a2a32; border-radius: 8px; background: #12080b; } .cm-admin h3 { margin: 0; font-size: 12.5px; letter-spacing: .1em; text-transform: uppercase; color: #ff8b9c; }
.cm-admin textarea { resize: vertical; } .cm-row { display: flex; gap: 6px; align-items: center; font-size: 12px; color: #cfe2ea; } .cm-row span { flex: 1; word-break: break-all; } .cm-row button { min-height: 26px; }
#market-tabs button.is-active, #cm-tabs button.is-active, .community-dialog .cm-sub button.is-active { border-image: none !important; border: 1px solid #4fd2ea !important; background: #4fd2ea !important; background-image: none !important; color: #04141a !important; border-color: #4fd2ea !important; box-shadow: 0 0 10px #4fd2ea55; }
/* Connect X + Share on X (Oct17) */
.cm-xlink { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin: 0 0 10px; padding: 8px 10px; border: 1px solid #285268; background: #071820; font-size: 13px; }
.cm-share { margin: 10px 0; } .cm-share .button { display: inline-block; text-decoration: none; padding: 8px 14px; }
/* Void portal sale (Oct17) */
.store-price s { color: var(--muted); font-size: 12px; }
.store-sale { color: #ffcf5a; font-style: normal; font-weight: 700; font-size: 12px; }
/* Epic Boxes in the Chests dialog (Oct17) */
.box-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.box-actions input { width: 7em; }
.chest-card.is-box { cursor: default; }
/* Daily rewards (Oct17): 7-day login calendar + share card */
.daily-dialog { width: min(920px, calc(100vw - 24px)); }
.daily-body { display: grid; gap: 18px; padding: 4px 2px 6px; }
.daily-body section > header { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.daily-body section > header span { color: #9fc3d1; font-size: 13px; }
.daily-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.daily-day { display: grid; justify-items: center; align-content: start; gap: 6px; padding: 10px 6px; min-height: 118px; text-align: center; border: 1px solid #23414f; border-radius: 4px; background: linear-gradient(180deg, #0c1c27, #08131b); }
.daily-day small { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #8fb2c1; }
.daily-day img { width: 36px; height: 36px; image-rendering: pixelated; }
.daily-day b { font-size: 12px; line-height: 1.25; }
.daily-day em { font-style: normal; font-size: 11px; color: #71ecff; }
.daily-day.is-today { border-color: #f2c35b; box-shadow: 0 0 14px #f2c35b66; }
.daily-day.is-today em { color: #f2c35b; }
.daily-day.is-done { opacity: .55; }
.daily-day.is-chest { border-color: #4f8cff; }
.daily-claim { margin-top: 12px; min-width: 200px; }
.daily-share canvas { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border: 1px solid #23414f; border-radius: 4px; background: #02060c; }
.daily-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.daily-msg { min-height: 1.2em; margin: 0; color: #f2c35b; }
.tab-extra.is-daily .tile-badge { background: #f2c35b; color: #1b1406; }
@media (max-width: 640px) { .daily-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } .daily-day { min-height: 104px; } }
/* Tradable vs locked tags (Oct17: "a visible distinction if it's tradable or not") */
.trade-tag { display: inline-block; margin: 2px 0; padding: 1px 6px; border-radius: 3px; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; vertical-align: middle; }
.trade-tag.is-tradable { color: #7dffb0; border: 1px solid #2f8a5a; background: #0b2a1c; }
.trade-tag.is-bound { color: #ffd27a; border: 1px solid #8a6a2f; background: #2a200b; }
.bound-tag.is-tradable { color: #7dffb0; }
.chest-reveal .reveal-head small { margin-left: auto; color: #9fc3d1; font-size: 11px; }
.chest-card .trade-tag { margin-top: 2px; }
/* Bug report form (Oct17) */
.cm-bug { display: grid; gap: 8px; margin: 8px 0 14px; }
.cm-bug label { display: grid; gap: 4px; font-size: 12px; color: #9fc3d1; }
.cm-bug input, .cm-bug select, .cm-bug textarea { width: 100%; }
.cm-bugrow small { color: #9fc3d1; white-space: pre-wrap; }
.cm-bugrow input { max-width: 220px; }
/* Guide, in-game Terms, event banner (Oct17) */
.pilot-guide-dialog { width: min(760px, calc(100vw - 24px)); }
.pilot-guide-dialog .guide-body, #pg-body { padding: 6px 2px 4px; }
.guide-steps, .guide-terms { display: grid; gap: 10px; padding-left: 22px; margin: 6px 0 12px; line-height: 1.45; }
.guide-lede { margin: 6px 0 10px; }
.guide-banner { margin: 4px 0 12px; padding: 8px 10px; border: 1px solid #8a6a2f; border-radius: 4px; background: #2a200b; color: #ffd27a; }
.guide-flags { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 6px 16px; padding: 0; list-style: none; }
.guide-flags li { display: flex; justify-content: space-between; gap: 8px; padding: 6px 8px; border: 1px solid #23414f; border-radius: 4px; }
.guide-on, .guide-off { font-style: normal; font-weight: 700; font-size: 11px; text-transform: uppercase; }
.guide-on { color: #7dffb0; } .guide-off { color: #ff8f8f; }
.guide-ok { color: #7dffb0; font-weight: 700; }
.guide-dialog .terms-check { display: flex; gap: 8px; align-items: center; margin: 10px 0; }
.event-banner { position: relative; z-index: 5; display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; padding: 6px 12px; font-size: 12px; color: #ffd27a; background: linear-gradient(90deg, #2a200b, #3a2b0c, #2a200b); border-bottom: 1px solid #8a6a2f; }
.event-banner b { letter-spacing: .08em; text-transform: uppercase; }
.event-banner button { padding: 2px 10px; font-size: 11px; }
#guide-accept { display: block; margin-top: 8px; min-width: 200px; }
.cm-admin textarea, .cm-bug textarea { font-family: inherit; }
@media (max-width: 700px) { .event-banner { flex-wrap: nowrap; gap: 8px; padding: 3px 8px; font-size: 11px; } .event-banner span { display: none; } .event-banner button { padding: 1px 8px; font-size: 10px; } }
.pilot-guide-dialog .cm-tabs { display: flex; flex-wrap: wrap; gap: 6px; } .pilot-guide-dialog .cm-tabs button { white-space: nowrap; padding: 6px 12px; }
.market-tabs, .cm-tabs, .cm-sub { flex-wrap: wrap; } .market-tabs button, .cm-tabs button, .cm-sub button { white-space: nowrap; flex: 0 0 auto; }
#pg-tabs button.is-active { border-image: none !important; border: 1px solid #4fd2ea !important; background: #4fd2ea !important; color: #04141a !important; }
@media (max-width: 700px) { .tabs button { word-break: keep-all; overflow-wrap: normal; hyphens: none; } .tabs .tab-extra { font-size: 10px; letter-spacing: 0; } }
/* Epic Box: two ways to open (Oct17) */
.box-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.box-choice { display: grid; gap: 3px; text-align: left; padding: 10px 12px; border: 1px solid #2c5361; border-radius: 8px; background: #0f1d24; color: var(--text, #e6f1f5); cursor: pointer; }
.box-choice b { font-size: 16px; } .box-choice span { font-size: 12px; } .box-choice small { color: #8aa4b0; font-size: 11px; }
.box-choice.is-pwr { border-color: #8b5cc4; background: #1b1426; } .box-choice.is-pwr b { color: #d787ff; }
.box-choice:hover { filter: brightness(1.2); }
@media (max-width: 520px) { .box-choices { grid-template-columns: 1fr; } }

/* ===================== Mobile first (Claude, Oct17; owner: "optimize for mobile first. make sure mobile users get
   the same experience") — phones and small tablets (< 900 px, the desktop "command phone" layout starts at 900). ===== */
@media (max-width: 899px) {
  /* header: the Epoch banner is one slim line, and the Genesis / Notifications buttons sit in the header again
     (they were positioned against the page and hidden under the banner) */
  .online-portrait .shell { position: relative; }
  .event-banner { min-height: 0; height: 30px; padding: 0 10px; gap: 10px; font-size: 11px; }
  .event-banner button { min-height: 0 !important; height: 24px; padding: 0 10px !important; line-height: 22px; font-size: 11px; border-image: none !important; border: 1px solid #8a6a2f !important; border-radius: 6px; background: #1f1708 !important; color: #ffd27a !important; }
  /* the game first: the view scrolls, so the sortie options and the PWR Core panel are reachable under the game */
  .online-portrait #view-combat.is-active { overflow-y: auto; overscroll-behavior: contain; padding-bottom: 96px; scroll-padding-bottom: 96px; }
  .online-portrait #view-combat .combat-options { margin-top: 6px; }
  .online-portrait #view-combat > #online-earnings { display: block; margin: 10px 6px 0; }
  .online-portrait #view-combat > #online-earnings [data-earn="pool"] { font-size: 18px; }
  /* Store, Music, Account in the bottom tab bar, styled like the tabs */
  .online-portrait .tabs .combat-quick-controls { display: contents; }
  .online-portrait .tabs .combat-quick-controls > button, .online-portrait .tabs > #open-account { flex: 0 0 82px; width: 82px; height: 62px; min-height: 0; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 4px; font-size: 10px; }
  .online-portrait .tabs .combat-quick-controls > button img { width: 26px; height: 26px; }
  .online-portrait .tabs > #open-account::before { content: ""; width: 26px; height: 26px; background: url("../assets/ui/items/report.png") center / contain no-repeat; image-rendering: pixelated; }
  /* HUD text that was 9 px */
  .online-portrait .combat-top-hud strong, .online-portrait #combat-hull, .online-portrait #combat-shield, .online-portrait #combat-armor { font-size: 11px; }
}
/* touch screens: the keyboard legend means nothing; the on-screen buttons do the same */
@media (pointer: coarse) { .manual-guide kbd, .manual-guide > span { display: none; } }
@media (max-width: 899px) {
  /* solid bar behind the bottom tabs so scrolled content never shows between them */
  .online-portrait .tabs { background: #050b0f; box-shadow: 0 -8px 12px #050b0f; padding-top: 4px; }
}
/* phone "Menu": pinned at the right end of the bottom bar, opens every command as a grid (src/online-mobile.js) */
#open-menu { display: none; }
@media (max-width: 899px) {
  .online-portrait .tabs > #open-menu { display: inline-flex; position: sticky; right: 0; z-index: 2; flex: 0 0 72px; width: 72px; height: 62px; min-height: 0; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 4px; font-size: 10px; font-weight: 700; color: #04141a; background: linear-gradient(180deg, #ffd27a, #e3a33a) !important; border: 1px solid #ffe6a8 !important; border-image: none !important; box-shadow: -10px 0 12px #050b0f; }
  .online-portrait .tabs > #open-menu[hidden] { display: none; }
  #open-menu .menu-icon { display: grid; gap: 4px; width: 22px; } #open-menu .menu-icon i { display: block; height: 3px; border-radius: 2px; background: #04141a; }
}
.phone-menu { width: min(560px, calc(100vw - 16px)); max-height: calc(100dvh - 32px); padding: 12px; }
.phone-menu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; margin-top: 8px; }
.phone-menu-item { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 84px; padding: 8px 4px; border: 1px solid #274552; border-radius: 10px; background: linear-gradient(180deg, #0f2a35, #0a1c24); color: #d9eaf0; font-size: 12px; font-weight: 600; text-align: center; border-image: none; }
.phone-menu-item img { width: 32px; height: 32px; image-rendering: pixelated; }
.phone-menu-item.is-active { border-color: #8ff0ff; background: linear-gradient(180deg, #1d5a6b, #0f3140); }
.phone-menu-badge { position: absolute; top: 6px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #ffb35c; color: #04141a; font: 700 11px/18px sans-serif; font-style: normal; }
/* Phones held sideways: the game is a portrait shooter, so ask to turn the phone upright (a short landscape screen
   leaves the playfield about 170 px wide) */
.rotate-hint { display: none; }
@media (orientation: landscape) and (max-height: 500px) and (pointer: coarse) {
  .online-portrait .rotate-hint { position: fixed; inset: 0; z-index: 9999; display: grid; place-content: center; gap: 14px; padding: 24px; text-align: center; background: #050b0fee; color: #e6f1f5; font-size: 16px; }
  .rotate-hint .rotate-phone { width: 44px; height: 72px; margin: 0 auto; border: 3px solid #4fd2ea; border-radius: 8px; transform: rotate(-90deg); animation: rotate-upright 2.4s ease-in-out infinite; }
  .rotate-hint small { color: #8aa4b0; font-size: 13px; }
}
@keyframes rotate-upright { 0%, 30% { transform: rotate(-90deg); } 60%, 100% { transform: rotate(0deg); } }
@media (prefers-reduced-motion: reduce) { .rotate-hint .rotate-phone { animation: none; transform: none; } }
@media (max-width: 899px) {
  /* thumb-sized controls the audit flagged (tools/mobile-audit.js) */
  .online-portrait #combat-mode { min-height: 36px; }
  .chest-odds > summary, details > summary { min-height: 36px; display: flex; align-items: center; }
  #music-volume, #sfx-volume { height: 32px; }
  #bag-expand, #idle-summary { min-height: 36px; }
}
@media (max-width: 899px) {
  /* locked Credits/Fuel chip: its own line under the amount instead of on top of it */
  .online-portrait .resource-strip article { height: auto !important; min-height: 46px; }
  .online-portrait .locked-chip { position: static; display: block; grid-column: 1 / -1; font-size: 10.5px; line-height: 12px; }
  /* the fixed "Asset credits" footer sat under the Menu button; it lives in the Menu on phones */
  .online-portrait .game-credits { display: none; }
  .phone-menu .game-credits-copy { margin-top: 12px; font-size: 12px; color: #8aa4b0; }
  .online-portrait #idle-summary { min-height: 36px !important; }
  .online-portrait #view-combat .earn-explain { font-size: 12px; }
}
/* the Genesis / Notifications buttons are positioned inside the game shell, so the Epoch banner never covers them */
.online-portrait .shell { position: relative; }
@media (max-width: 899px) {
  /* deploy panel: more room so Galaxy, Level and Deploy all show on small phones */
  .online-portrait .combat-message { max-height: calc(100% - 150px); }
}
@media (max-width: 899px) and (max-height: 780px) {
  /* short phones: drop the deploy panel's subtitle so Galaxy, Level and Deploy fit without scrolling */
  .online-portrait .combat-message h2 + p { display: none; }
  .online-portrait .combat-message h2 { font-size: 18px; margin-bottom: 2px; }
}

/* Rollout countdown + on-screen announcements (src/online-live.js) */
.rollout-timer { min-height: 0 !important; height: 28px; padding: 0 12px !important; border-radius: 999px; border: 1px solid #8a6a2f !important; border-image: none !important; background: #120d04 !important; color: #ffe6a8 !important; font: 600 12px/26px ui-monospace, SFMono-Regular, Menlo, monospace; font-variant-numeric: tabular-nums; white-space: nowrap; cursor: pointer; }
.screen-announce { position: relative; z-index: 5; display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 6px 12px; color: #e6f1f5; background: linear-gradient(90deg, #0b2a36, #10384a 50%, #0b2a36); border-bottom: 1px solid #2c6a80; font-size: 13px; }
.screen-announce .sa-icon { flex: none; font-size: 16px; color: #ffd27a; }
.screen-announce .sa-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.screen-announce.is-open .sa-text { white-space: normal; }
.screen-announce .sa-text b { color: #8ff0ff; }
.screen-announce .sa-count { flex: none; color: #8aa4b0; font-size: 11px; }
.screen-announce .sa-link { flex: none; padding: 5px 12px; border-radius: 6px; background: #4fd2ea; color: #04141a; font-weight: 700; text-decoration: none; white-space: nowrap; }
.screen-announce .sa-close { flex: none; width: 32px; height: 32px; min-height: 0 !important; padding: 0 !important; border-radius: 6px; border: 1px solid #2c6a80 !important; border-image: none !important; background: transparent !important; color: #e6f1f5; font-size: 18px; line-height: 1; }
@media (max-width: 899px) {
  .event-banner { justify-content: space-between; }
  .event-banner > b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  .rollout-timer { height: 24px; padding: 0 8px !important; font-size: 11px; line-height: 22px; overflow: hidden; text-overflow: ellipsis; }
  .screen-announce { font-size: 12px; gap: 8px; padding: 5px 8px; }
}
@media (max-width: 420px) { .event-banner:has(#rollout-timer) > b { display: none; } }
.guide-sub { margin: 12px 0 6px; font-size: 14px; color: #8ff0ff; }
.guide-schedule { margin: 0 0 10px; padding-left: 0; list-style: none; display: grid; gap: 6px; }
.guide-schedule li { padding: 8px 10px; border: 1px solid #274552; border-radius: 8px; font-size: 13px; }
.guide-schedule li small { display: block; color: #8aa4b0; margin-top: 2px; }
.guide-schedule li.is-open { border-color: #2f7d58; } .guide-schedule li.is-open small { color: #6be39a; }
.adm-duration { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; } .adm-duration label { display: grid; gap: 4px; }
.adm-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.adm-tag { color: #04141a; background: #ffd27a; border-radius: 4px; padding: 0 5px; font-size: 10.5px; }
.cm-news-link { display: inline-block; margin-top: 6px; color: #8ff0ff; font-weight: 600; }
/* Community -> Online (Oct17): who is in the game now. Dot: cyan flying, purple in the Void, grey in the hangar. */
.cm-online { display: grid; gap: 4px; }
.cm-online-row { padding: 6px 8px; border: 1px solid rgba(84,228,245,.14); background: rgba(3,12,18,.55); }
.cm-online-row span { word-break: normal; overflow-wrap: anywhere; }
.cm-online-row em { font-style: normal; color: #9fc4cf; white-space: nowrap; font-size: 11px; }
.cm-online-row.is-you { border-color: rgba(84,228,245,.55); }
.cm-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #6f8790; margin-right: 6px; vertical-align: 1px; }
.cm-dot.is-flying { background: #54e4f5; } .cm-dot.is-void { background: #b48cff; }
/* Admin: wipe + new epoch (Oct17) */
.adm-wipe { margin-top: 10px; padding: 8px; border: 1px solid rgba(255,107,122,.45); background: rgba(40,6,10,.35); }
.adm-wipe h4 { margin: 0 0 4px; color: #ff9aa5; font-size: 13px; }
.adm-wipe .adm-warn { color: #ffc857; }
.adm-wipe button.danger { border-color: #ff6b7a; color: #ffd0d5; }
@media (max-width: 600px) { .cm-online-row { flex-wrap: wrap; } .cm-online-row em { white-space: normal; } }
/* Admin: test epoch form (Oct17) */
.cm-admin .adm-feats { border: 1px solid rgba(84,228,245,.2); padding: 6px 8px; margin: 6px 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 2px 10px; }
.cm-admin .adm-feats legend { font-size: 11px; color: #9fc4cf; padding: 0 4px; }
/* Test epoch screens (src/online-live.js): waiting card before the start, closed screen with the final ranking after the end */
.epoch-screen { position: fixed; inset: 0; z-index: 900; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(2,8,12,.82); }
.epoch-screen .es-card { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: #071923; border: 1px solid #2c6d80; box-shadow: 0 0 0 1px rgba(84,228,245,.15), 0 10px 40px rgba(0,0,0,.6); padding: 18px; color: #e8f6fa; }
.epoch-screen .es-kicker { margin: 0; font-size: 12px; letter-spacing: .2em; color: #ffc857; }
.epoch-screen h2 { margin: 4px 0 6px; font-size: 26px; color: #54e4f5; }
.epoch-screen .es-clock { font-size: 34px; font-weight: 700; font-variant-numeric: tabular-nums; color: #54e4f5; margin: 6px 0; }
.epoch-screen .es-note { white-space: pre-line; background: rgba(255,200,87,.08); border: 1px solid rgba(255,200,87,.35); padding: 8px 10px; margin: 8px 0; }
.epoch-screen table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 8px 0; }
.epoch-screen td, .epoch-screen th { padding: 5px 6px; border-bottom: 1px solid rgba(84,228,245,.12); text-align: left; }
.epoch-screen td.n, .epoch-screen th.n { text-align: right; font-variant-numeric: tabular-nums; }
.epoch-screen tr.is-you td { color: #54e4f5; font-weight: 700; }
.epoch-screen .es-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.epoch-screen .es-actions button { min-height: 44px; }
/* Lock (Oct17): the countdown/ended screen covers everything (above panels and dialogs) and is fully opaque. */
.epoch-screen { z-index: 2147482000; background: rgba(2,8,12,.97); }
.epoch-screen .es-actions a.button { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; color: #e8f6fa; border: 1px solid #2c6d80; background: #0b2a36; text-decoration: none; font-weight: 700; }
.epoch-screen .es-fine { font-size: 12px; color: #9fc4cf; }
.cm-admin #adm-epoch-note { display: block; width: 100%; box-sizing: border-box; min-height: 72px; margin-top: 2px; }
.cm-admin #adm-wl-add { display: block; width: 100%; box-sizing: border-box; min-height: 60px; margin-top: 2px; }
.cm-online-row code { font-size: 11px; word-break: break-all; }
/* Narrow desktop field (Oct17): phone-size weapon HUD so the controls stay in proportion with a small battlefield. */
html.field-compact { --weapon-hud-band: 56px; --weapon-button-size: 44px; --weapon-art-size: 32px; }
html.field-compact .combat-meter { font-size: 10px; }

/* Update refresh banner (Oct18): above everything, including the epoch lock screen. */
.update-refresh { position: fixed; left: 50%; top: 12px; transform: translateX(-50%); z-index: 2147483600; display: flex; align-items: center; gap: 14px; width: min(640px, calc(100vw - 24px)); box-sizing: border-box; padding: 12px 14px 12px 18px; background: #0b2a36; border: 1px solid #54e4f5; box-shadow: 0 8px 30px rgba(0,0,0,.6); color: #e8f6fa; font-size: 15px; line-height: 1.35; }
.update-refresh span { flex: 1; } .update-refresh b { color: #54e4f5; }
.update-refresh button { flex: none; min-height: 44px; padding: 0 18px; font-weight: 800; cursor: pointer; color: #041016; background: #54e4f5; border: 0; }
@media (max-width: 520px) { .update-refresh { flex-direction: column; align-items: stretch; text-align: center; } }

/* Toast above modals (Oct18) and the low-funds warning in confirm windows. */
.rift-toast { position: fixed; inset: auto; top: 16px; left: 50%; transform: translate(-50%, -8px); margin: 0; z-index: 2147483640; display: flex; align-items: flex-start; gap: 10px; width: min(560px, calc(100vw - 24px)); box-sizing: border-box; padding: 12px 12px 12px 16px; border: 1px solid #54e4f5; border-left-width: 5px; background: #071923; color: #e8f6fa; font: 600 15px/1.4 Inter, Arial, sans-serif; box-shadow: 0 10px 30px rgba(0,0,0,.65); opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; }
.rift-toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.rift-toast:popover-open { display: flex; }
.rift-toast.error { border-color: #ff6b6b; background: #2a0b0e; }
.rift-toast.ok { border-color: #5fe08a; background: #0b2416; }
.rift-toast .rt-icon { font-size: 18px; line-height: 1.2; }
.rift-toast.error .rt-icon { color: #ff6b6b; } .rift-toast.ok .rt-icon { color: #5fe08a; }
.rift-toast .rt-text { flex: 1; }
.rift-toast .rt-close { flex: none; width: 32px; height: 32px; border: 0; background: transparent; color: #cfe6ee; font-size: 22px; cursor: pointer; }
.low-funds-warning { margin: 12px 0 0; padding: 10px 12px; border: 1px solid #e0a43a; background: rgba(224,164,58,.12); color: #ffd58a; font-weight: 600; line-height: 1.4; }

/* Void maxed -> real-space boss prompt (Oct18). */
.void-boss-hint { max-width: min(460px, calc(100vw - 24px)); padding-top: 16px; }
.void-boss-hint h3 { margin: 0 0 8px; color: #c9a8ff; }
.void-boss-hint p { margin: 0 0 14px; line-height: 1.45; }
.void-boss-hint .vbh-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.void-boss-hint .vbh-actions button { flex: 1 1 180px; min-height: 44px; }
.void-boss-hint .vbh-off { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 14px; color: #9fb6c2; }

/* Recruitment odds tooltip (Oct18). */
.recruit-odds-tip { position: relative; display: inline-flex; vertical-align: middle; align-items: center; margin-left: 10px; font-weight: 600; letter-spacing: 0; text-transform: none; padding: 4px 9px; border: 1px solid #2a5568; border-radius: 999px; font-size: 12px; color: #9fd6ee; cursor: help; user-select: none; }
.recruit-odds-tip .tip { display: none; position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; width: 210px; padding: 8px 10px; background: #071219; border: 1px solid #2a5568; border-radius: 8px; box-shadow: 0 8px 24px #000a; color: #cfe3ee; font-size: 12px; }
.recruit-odds-tip:hover .tip, .recruit-odds-tip:focus .tip, .recruit-odds-tip:focus-within .tip { display: block; }
.recruit-odds-tip .tip b { display: block; margin-bottom: 4px; }
.recruit-odds-tip .odds-row { display: flex; justify-content: space-between; padding: 2px 0; color: var(--rarity); }
.recruit-odds-tip .odds-row i { font-style: normal; opacity: .7; font-size: 11px; }
.recruit-odds-tip small { display: block; margin-top: 4px; opacity: .7; }

/* Locked buttons: clicks fall through to a handler that shows the reason (Oct18). */
button:disabled { pointer-events: none; }
.disabled-action { cursor: not-allowed; }

/* Required pilot name (Oct18). */
.ign-dialog { max-width: 420px; width: calc(100vw - 32px); padding: 22px 22px 18px; border: 1px solid #2a8fb0; border-radius: 12px; background: #07131b; color: #dcebf2; }
.ign-dialog::backdrop { background: #000c; }
.ign-dialog h2 { margin: 0 0 8px; font-size: 20px; }
.ign-dialog p { margin: 0 0 12px; font-size: 13px; line-height: 1.45; color: #a9c2ce; }
.ign-dialog label { display: block; font-size: 12px; font-weight: 700; margin-bottom: 4px; }
.ign-dialog input { width: 100%; box-sizing: border-box; padding: 10px 12px; font-size: 16px; border-radius: 8px; border: 1px solid #2a5568; background: #0b1d27; color: #fff; }
.ign-dialog .ign-error { color: #ff7b7b; min-height: 18px; margin: 6px 0 8px; }
.ign-dialog button { width: 100%; padding: 11px; font-weight: 700; }

/* Contract drop hint (Oct18). */
.contract-drop-hint { margin: 6px 0 10px; color: #9fc3d2; }
.mission-guide p { margin: 4px 0; font-size: 13px; line-height: 1.45; }
.mission-guide .mission-warn { padding: 8px 10px; border: 1px solid #a8812c; border-radius: 8px; background: #2a200a; color: #ffd98a; }
/* Marketplace switched off (Oct18): no way in. */
body.market-off [data-wb-action="sell"], body.market-off [data-wb-action="sell-commander"], body.market-off [data-open-market], body.market-off .disabled-action:has(> [data-wb-action="sell"]), body.market-off .disabled-action:has(> [data-wb-action="sell-commander"]) { display: none !important; }
/* Expedition Center hidden online (Oct18): resource expeditions are offline-only. */
body.online-game .building-card[data-building="expedition"] { display: none !important; }
/* AFK Patrol button (Oct18). */
#start-patrol { width: 100%; margin-top: 6px; padding: 8px 10px; font-size: 13px; font-weight: 700; border: 1px dashed #3b7a92; background: #0a1c25; color: #9fe3ff; }
#start-patrol:disabled { opacity: .55; }
/* Server stats popup (Oct18): same look as Jobs. */
.stats-pop .job span { color: #e6f3f8; }
/* AFK Patrol banner (Oct18): impossible to miss. */
.patrol-banner { position: absolute; left: 50%; top: 96px; transform: translateX(-50%); z-index: 30; width: calc(100% - 24px); box-sizing: border-box; flex-wrap: wrap; display: flex; align-items: center; gap: 12px; max-width: calc(100vw - 32px);
  padding: 10px 14px; border: 2px solid #ff4d4d; border-radius: 12px; background: #2a0808ee; color: #ffd6d6; box-shadow: 0 0 24px #ff4d4d66; animation: pb-glow 2s ease-in-out infinite; }
.patrol-banner > div { flex: 1 1 200px; min-width: 0; }
.patrol-banner b { display: block; font-size: 15px; letter-spacing: .08em; color: #ff5c5c; }
.patrol-banner small { display: block; font-size: 12px; color: #ff9a9a; }
.patrol-banner button { white-space: nowrap; padding: 7px 12px; font-weight: 700; margin-left: auto; }
.patrol-banner .pb-dot { width: 12px; height: 12px; border-radius: 50%; background: #ff4d4d; box-shadow: 0 0 10px #ff4d4d; flex: none; animation: pb-blink 1s steps(2) infinite; }
@keyframes pb-glow { 50% { box-shadow: 0 0 6px #ff4d4d33; } }
@keyframes pb-blink { 50% { opacity: .25; } }
@media (max-width: 620px) { .patrol-banner { top: 70px; padding: 8px 10px; } .patrol-banner small { display: none; } }
/* Same guard for other scrolling windows whose content sizes with their width (Oct18). */
.cm-body, .exchange-dialog, .epoch-screen .es-card, #game-window-content { scrollbar-gutter: stable; }
/* Game tooltips (Oct18). */
#rift-tip { position: fixed; inset: auto; margin: 0; overflow: visible; z-index: 2147483000; max-width: min(300px, calc(100vw - 12px)); padding: 7px 10px; border: 1px solid #3a8fac; border-radius: 8px;
  background: #061823f2; color: #e3f4fa; font-size: 12.5px; line-height: 1.4; box-shadow: 0 8px 22px #000b; pointer-events: none; white-space: pre-line; }
#transaction-dialog .no-ask { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 12px; color: #9fc3d2; }
/* "In use" tags (Oct18). */
.inventory-tile { position: relative; }
.use-tag { position: absolute; left: 3px; right: 3px; bottom: 3px; padding: 1px 3px; border-radius: 4px; font: 800 9px/1.3 system-ui, sans-serif; letter-spacing: .04em; text-align: center; pointer-events: none; white-space: nowrap; overflow: hidden; }
.use-banner { margin: 0 0 8px; padding: 6px 10px; border-radius: 8px; font-weight: 800; font-size: 12px; letter-spacing: .04em; }
.tag-sortie { background: #b3261e; color: #fff; } .tag-busy { background: #c77700; color: #fff; } .tag-deployed { background: #1c7a5a; color: #e9fff6; }
.tag-listed { background: #6a3fb0; color: #fff; } .tag-locked { background: #3d4b55; color: #e3eef3; }

.sim-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 8px 0; }
.sim-actions button { padding: 8px 4px; font-size: 12px; }

/* Command phone categories (owner Oct18 "ui function per category") */
.phone-cat { display: none; }
.online-portrait.demo-desk .phone-grid .phone-cat { display: flex; align-items: center; gap: 6px; grid-column: 1 / -1; margin: 0 2px -3px; font-size: 9px; font-weight: 700; line-height: 10px; letter-spacing: 2px; text-transform: uppercase; color: #6fd7ea; opacity: .8; }
.online-portrait.demo-desk .phone-grid .phone-cat::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(79,210,234,.45), transparent); }
@media (min-width: 900px) and (max-height: 900px) {
  .online-portrait.demo-desk .phone-grid .tab, .online-portrait.demo-desk .phone-grid .combat-quick-controls > button,
  .online-portrait.demo-desk .phone-grid #open-account, .online-portrait.demo-desk .phone-grid .tab-extra { aspect-ratio: 1 / .54 !important; gap: 2px !important; }
  .online-portrait.demo-desk .phone-grid .tab-icon, .online-portrait.demo-desk .phone-grid .combat-quick-controls > button img { width: 22px !important; height: 22px !important; }
}
.online-portrait.demo-desk .phone-grid .phone-cat[data-phone-cat="Flight"] { margin-top: 0; }
.online-portrait.demo-desk .phone-grid #open-account.has-app-icon::before { display: none; }
.online-portrait.demo-desk .phone-grid img[src*="assets/ui/apps/"] { image-rendering: pixelated; }
.cm-more { display: block; margin: 8px auto 0; padding: 6px 16px; font-size: 13px; }
/* Bag pages (owner Oct18): the pager already shows the item count */
.inventory-pagination:not([hidden]) + #inventory-count, .inventory-pagination:not([hidden]) ~ #inventory-count { display: none; }
/* Store category tabs (owner Oct18) */
.store-cats { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.store-cats button { padding: 7px 14px; border: 1px solid #2c5361; border-radius: 6px; background: #0e1d27; color: #cfe7ef; font-size: 13px; cursor: pointer; }
.store-cats button small { margin-left: 4px; opacity: .6; font-size: 11px; }
.store-cats button:hover { border-color: #4fd2ea; }
.store-cats button.is-active { background: linear-gradient(180deg, #4fe0f2 0%, #2fb9d3 100%); border-color: #8ff0ff; color: #04141a; font-weight: 700; }
/* Salvage always visible with rarity chips (owner Oct18) */
#module-salvage > summary { list-style: none; pointer-events: none; display: flex; gap: 8px; align-items: baseline; }
#module-salvage > summary::-webkit-details-marker { display: none; }
#module-salvage .recycle-toolbar { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
#module-salvage .recycle-choice { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
#module-salvage .recycle-choice > label[for="recycle-rarity"], #module-salvage #recycle-rarity { display: none; }
.recycle-chips { display: flex; flex-wrap: wrap; gap: 4px; width: 100%; }
.recycle-chips button { padding: 3px 8px; font-size: 11px; border: 1px solid color-mix(in srgb, var(--chip) 55%, transparent); border-radius: 5px; background: #0e1d27; color: var(--chip); cursor: pointer; }
.recycle-chips button b { color: #e6f3f8; margin-left: 2px; }
.recycle-chips button.is-active { background: color-mix(in srgb, var(--chip) 22%, #0e1d27); border-color: var(--chip); }
.recycle-chips button[data-empty] { opacity: .45; }
#module-salvage .panel-close, #module-salvage #recycle-rarity-quote, #module-salvage #recycle-all-quote, #module-salvage .recycle-label, #module-salvage .recycle-toolbar > p.fine:not(#recycle-status) { display: none !important; }
#module-salvage #recycle-status:empty { display: none; }
#module-salvage .recycle-toolbar { flex-direction: row; flex-wrap: wrap; align-items: center; }
#module-salvage .recycle-choice { display: contents; }
#module-salvage #recycle-rarity-action, #module-salvage #recycle-all-action { padding: 5px 10px; font-size: 12px; min-height: 0; }
#module-salvage .secondary-panel-body { display: contents; }
.recycle-chips button { padding: 2px 7px !important; min-height: 0 !important; line-height: 18px; }
/* Salvage window (owner Oct18 "salvage should be its own modal") */
.open-salvage { display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 8px; padding: 8px 12px; font-size: 13px; }
.open-salvage small { opacity: .75; font-size: 11.5px; }
.salvage-dialog { width: min(520px, calc(100vw - 32px)); padding: 18px 20px; border: 1px solid #2c5361; border-radius: 10px; background: #0b1820; color: #e6f3f8; }
.salvage-dialog::backdrop { background: #000a; }
.salvage-dialog > header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.salvage-dialog > header h2 { margin: 0; font-size: 18px; }
.salvage-dialog > header button { min-width: 34px; }
.salvage-dialog #module-salvage { display: block !important; border: 0; padding: 0; }
.salvage-dialog #module-salvage > summary { margin-bottom: 4px; }
.salvage-dialog .recycle-chips button { padding: 5px 10px !important; font-size: 12.5px; }
.salvage-dialog #recycle-rarity-action, .salvage-dialog #recycle-all-action { padding: 8px 14px !important; font-size: 13px !important; }
.salvage-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 6px; max-height: min(46vh, 380px); overflow-y: auto; margin: 8px 0; padding: 2px; }
.salvage-tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px 4px !important; min-height: 0 !important; border: 1px solid color-mix(in srgb, var(--rarity) 50%, transparent) !important; border-radius: 6px; background: #0e1d27; cursor: pointer; }
.salvage-tile .module-icon, .salvage-tile img { width: 34px; height: 34px; }
.salvage-tile small { font-size: 10px; color: #ffd36b; }
.salvage-tile.is-picked { background: color-mix(in srgb, var(--rarity) 22%, #0e1d27); border-color: var(--rarity) !important; box-shadow: 0 0 0 2px var(--rarity) inset; }
.salvage-tile.is-picked::after { content: "✓"; position: absolute; top: 2px; right: 4px; font-size: 11px; font-weight: 700; color: #e6f3f8; }
