/* Horizon Operations interface ("command deck").
 *
 * The same frame as Atlas Control:
 *
 *   rail (categories)  ->  top bar + tab strip (tools)  ->  page of panels
 *
 * in navy and cyan, with Chakra Petch for headings and numerals. The first
 * half of this file is that frame (rail, top bar, tabs, command palette,
 * home); the second half is the parts the Star Citizen tools are made of
 * (filters, tables, ship cards, number tiles).
 */

@font-face {
  font-family: "Chakra Petch";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/fonts/chakra-petch-500.woff") format("woff");
}

@font-face {
  font-family: "Chakra Petch";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/chakra-petch-600.woff") format("woff");
}

@font-face {
  font-family: "Chakra Petch";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/chakra-petch-700.woff") format("woff");
}

:root {
  --ui-bg: #05080d;
  --ui-rail: #070b11;
  --ui-card: #0c131c;
  --ui-card-raised: #121d2a;
  --ui-inset: #080d14;
  --ui-field: #060a10;
  --ui-border: rgb(120 190 235 / 13%);
  --ui-border-strong: rgb(120 190 235 / 24%);
  --ui-text: #eef4fa;
  --ui-muted: #a3b4c5;
  --ui-faint: #6f8497;
  --ui-accent: #1ccdfc;
  --ui-accent-2: #46a6ff;
  --ui-accent-soft: rgb(28 205 252 / 11%);
  --ui-accent-line: rgb(28 205 252 / 55%);
  --ui-accent-ink: #03121b;
  --ui-good: #40dc96;
  --ui-good-text: #9bebc6;
  --ui-warn: #f4c65d;
  --ui-bad: #f06a76;
  --ui-bad-text: #ffb3ba;
  --ui-radius: 6px;
  --ui-radius-inner: 4px;
  --ui-radius-control: 4px;
  --ui-gap: 16px;
  --ui-pad: 22px;
  --ui-rail-w: 92px;
  --ui-bar-h: 56px;
  --ui-ease: 150ms cubic-bezier(0.2, 0.7, 0.2, 1);
  --ui-shadow: 0 14px 34px rgb(0 0 0 / 30%);
  --ui-display: "Chakra Petch", "Segoe UI", system-ui, sans-serif;
  --ui-body: Inter, "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  /* A panel: dark fill with a short cyan bracket in its top-left corner. */
  --ui-panel:
    linear-gradient(var(--ui-accent), var(--ui-accent)) left top / 22px 2px no-repeat,
    linear-gradient(var(--ui-accent), var(--ui-accent)) left top / 2px 22px no-repeat,
    linear-gradient(180deg, #0e1621, #0a1018);
  /* Chamfered corner used on primary actions. */
  --ui-chamfer: polygon(0 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%);
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  position: relative;
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--ui-bg);
  color: var(--ui-text);
  font-family: var(--ui-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Backdrop: near-black with a faint chart grid and one glow from the top. */
body::after {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  background:
    radial-gradient(ellipse 70rem 26rem at 50% -8rem, rgb(28 205 252 / 13%), transparent 70%),
    linear-gradient(rgb(120 190 235 / 3.5%) 1px, transparent 1px) 0 0 / 100% 44px,
    linear-gradient(90deg, rgb(120 190 235 / 3.5%) 1px, transparent 1px) 0 0 / 44px 100%,
    linear-gradient(180deg, rgb(5 8 13 / 86%), rgb(5 8 13 / 95%));
  pointer-events: none;
}

::selection {
  background: rgb(28 205 252 / 32%);
  color: #fff;
}

[hidden] {
  display: none !important;
}

a {
  color: var(--ui-accent);
}

button {
  font: inherit;
}

.ui-icon {
  display: block;
  flex: 0 0 auto;
}

kbd {
  display: inline-grid;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  place-items: center;
  border: 1px solid var(--ui-border-strong);
  border-radius: 3px;
  background: rgb(255 255 255 / 4%);
  color: var(--ui-muted);
  font-family: var(--ui-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1;
  white-space: nowrap;
}

/* ------------------------------------------------------------------------
   Frame
   --------------------------------------------------------------------- */

.app-shell {
  display: grid;
  grid-template-columns: var(--ui-rail-w) minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  align-items: start;
  min-height: calc(100vh - 58px);
}

.panel-main {
  grid-column: 2;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 28px 32px 72px;
}

/* ------------------------------------------------------------------------
   Rail
   --------------------------------------------------------------------- */

.deck-rail {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  grid-column: 1;
  grid-row: 1 / -1;
  flex-direction: column;
  gap: 10px;
  height: 100vh;
  padding: 10px 8px 12px;
  border-right: 1px solid var(--ui-border);
  background: var(--ui-rail);
}

.deck-logo {
  display: grid;
  flex: 0 0 auto;
  height: 46px;
  place-items: center;
  text-decoration: none;
}

.deck-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  background: linear-gradient(135deg, var(--ui-accent-2), var(--ui-accent) 60%);
  color: var(--ui-accent-ink);
  font-family: var(--ui-display);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%);
  filter: drop-shadow(0 0 12px rgb(28 205 252 / 35%));
}

.deck-rail-items,
.deck-rail-foot {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.deck-rail-items {
  flex: 1 1 auto;
  min-height: 0;
}

.rail-divider {
  height: 1px;
  margin: 4px 10px;
  background: var(--ui-border);
}

.rail-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  min-height: 54px;
  margin: 0;
  padding: 6px 2px;
  border: 0;
  border-radius: var(--ui-radius-control);
  background: none;
  color: var(--ui-faint);
  font-family: var(--ui-display);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    background var(--ui-ease),
    color var(--ui-ease),
    box-shadow var(--ui-ease);
}

.rail-item > span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rail-item:hover,
.rail-item:focus-visible {
  background: rgb(255 255 255 / 5%);
  color: var(--ui-text);
}

.rail-item:focus-visible,
.rail-tool:focus-visible,
.deck-tab:focus-visible,
.deck-search:focus-visible,
.deck-status:focus-visible,
.home-tool:focus-visible,
.home-recent:focus-visible,
.home-search:focus-visible,
.home-hero-link:focus-visible {
  outline: 2px solid var(--ui-accent);
  outline-offset: -2px;
}

.rail-group.open > .rail-item {
  background: rgb(255 255 255 / 7%);
  color: var(--ui-text);
}

.rail-item.active,
.rail-group.active > .rail-item {
  background: var(--ui-accent-soft);
  box-shadow: inset 2px 0 0 var(--ui-accent);
  color: var(--ui-accent);
}

@media (min-width: 761px) and (max-height: 720px) {
  .rail-item {
    min-height: 40px;
  }

  .rail-item > span {
    display: none;
  }
}

/* Drawer: the tools of one category, beside the rail. */
.rail-menu {
  position: fixed;
  top: 0;
  bottom: 0;
  left: var(--ui-rail-w);
  z-index: 2;
  display: none;
  flex-direction: column;
  gap: 2px;
  width: min(330px, calc(100vw - var(--ui-rail-w)));
  padding: 0 10px 16px;
  overflow-y: auto;
  border-right: 1px solid var(--ui-border-strong);
  background:
    linear-gradient(90deg, rgb(28 205 252 / 5%), transparent 60%),
    var(--ui-rail);
  /* Dim the page to the right of the drawer, not the rail. */
  box-shadow: 0 0 0 100vmax rgb(2 4 8 / 58%);
  clip-path: inset(0 -100vmax 0 0);
}

.rail-group.open > .rail-menu {
  display: flex;
  animation: deck-drawer-in 170ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

@keyframes deck-drawer-in {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
}

.rail-menu-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: var(--ui-bar-h);
  margin: 0 -10px 10px;
  padding: 0 18px;
  border-bottom: 1px solid var(--ui-border);
  background: var(--ui-rail);
  color: var(--ui-accent);
}

.rail-menu-head strong {
  color: var(--ui-text);
  font-family: var(--ui-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.rail-menu-head small {
  color: var(--ui-faint);
  font-family: var(--ui-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.rail-tool {
  display: grid;
  gap: 3px;
  width: 100%;
  margin: 0;
  padding: 11px 14px;
  border: 0;
  border-radius: var(--ui-radius-control);
  background: none;
  color: var(--ui-text);
  text-align: left;
  cursor: pointer;
  transition:
    background var(--ui-ease),
    box-shadow var(--ui-ease);
}

.rail-tool span {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
}

.rail-tool small {
  color: var(--ui-faint);
  font-size: 12px;
  line-height: 1.35;
}

.rail-tool:hover,
.rail-tool:focus-visible {
  background: rgb(255 255 255 / 5%);
}

.rail-tool.active {
  background: var(--ui-accent-soft);
  box-shadow: inset 2px 0 0 var(--ui-accent);
}

.rail-tool.active span {
  color: var(--ui-accent);
}

/* ------------------------------------------------------------------------
   Top bar
   --------------------------------------------------------------------- */

.deck-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  grid-column: 2;
  min-width: 0;
  border-bottom: 1px solid var(--ui-border);
  background: rgb(5 8 13 / 86%);
  backdrop-filter: blur(14px);
}

.deck-bar-main {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: var(--ui-bar-h);
  padding: 0 24px;
}

.deck-brand {
  display: flex;
  flex: 0 0 auto;
  gap: 7px;
  color: var(--ui-faint);
  font-family: var(--ui-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-decoration: none;
  white-space: nowrap;
}

.deck-brand strong {
  color: var(--ui-text);
  font-weight: 700;
}

.deck-search,
.home-search {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  border: 1px solid var(--ui-border-strong);
  border-radius: var(--ui-radius-control);
  background: rgb(255 255 255 / 3%);
  color: var(--ui-faint);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition:
    background var(--ui-ease),
    border-color var(--ui-ease),
    color var(--ui-ease);
}

.deck-search {
  flex: 0 1 340px;
  min-width: 0;
  height: 36px;
  padding: 0 8px 0 12px;
}

.deck-search > span,
.home-search > span {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deck-search:hover,
.home-search:hover {
  border-color: var(--ui-accent-line);
  background: rgb(28 205 252 / 6%);
  color: var(--ui-text);
}

.deck-account {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.deck-server {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 36px;
  padding: 0 9px 0 5px;
  border: 1px solid var(--ui-border-strong);
  border-radius: var(--ui-radius-control);
  background: rgb(255 255 255 / 3%);
}

.deck-server-icon {
  display: grid;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 3px;
  background: var(--ui-accent-soft);
  color: var(--ui-accent);
  font-family: var(--ui-display);
  font-size: 11px;
  font-weight: 700;
}

.deck-server-name {
  color: var(--ui-text);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.deck-server-badge {
  padding: 3px 6px;
  border-radius: 3px;
  background: var(--ui-accent-soft);
  color: var(--ui-accent);
  font-family: var(--ui-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.deck-status {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  margin: 0;
  padding: 0 11px;
  border: 1px solid rgb(64 220 150 / 26%);
  border-radius: var(--ui-radius-control);
  background: rgb(64 220 150 / 7%);
  color: var(--ui-good-text);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.deck-status-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--ui-good);
  box-shadow: 0 0 0 3px rgb(64 220 150 / 18%);
  animation: deck-pulse 2.4s ease-in-out infinite;
}

@keyframes deck-pulse {
  50% {
    box-shadow: 0 0 0 6px rgb(64 220 150 / 0%);
  }
}

.deck-status[data-state="loading"] {
  border-color: var(--ui-border-strong);
  background: rgb(255 255 255 / 3%);
  color: var(--ui-muted);
}

.deck-status[data-state="loading"] .deck-status-dot {
  background: var(--ui-faint);
  box-shadow: none;
}

.deck-status[data-state="stale"] {
  border-color: rgb(244 198 93 / 30%);
  background: rgb(244 198 93 / 8%);
  color: #f6dc9c;
}

.deck-status[data-state="stale"] .deck-status-dot {
  background: var(--ui-warn);
  box-shadow: 0 0 0 3px rgb(244 198 93 / 18%);
  animation: none;
}

.deck-status[data-state="error"] {
  border-color: rgb(240 106 118 / 40%);
  background: rgb(240 106 118 / 10%);
  color: var(--ui-bad-text);
}

.deck-status[data-state="error"] .deck-status-dot {
  background: var(--ui-bad);
  box-shadow: 0 0 0 3px rgb(240 106 118 / 18%);
  animation: none;
}

/* Tab strip: the tools of the open category. */
.deck-tabs {
  display: none;
  align-items: stretch;
  min-width: 0;
  height: 44px;
  padding: 0 24px;
  border-top: 1px solid var(--ui-border);
  background: rgb(255 255 255 / 1.5%);
}

.deck-tabs.active {
  display: flex;
}

.deck-tabs-label {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 9px;
  margin-right: 14px;
  padding-right: 18px;
  border-right: 1px solid var(--ui-border);
  color: var(--ui-accent);
  font-family: var(--ui-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.deck-tabs-label .ui-icon {
  width: 17px;
  height: 17px;
}

.deck-tabs-scroll {
  display: flex;
  flex: 1 1 auto;
  gap: 2px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.deck-tabs-scroll::-webkit-scrollbar {
  display: none;
}

.deck-tab {
  flex: 0 0 auto;
  margin: 0;
  padding: 0 13px;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--ui-muted);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition:
    color var(--ui-ease),
    box-shadow var(--ui-ease),
    background var(--ui-ease);
}

.deck-tab:hover {
  background: rgb(255 255 255 / 4%);
  color: var(--ui-text);
}

.deck-tab.active {
  box-shadow: inset 0 -2px 0 var(--ui-accent);
  color: #fff;
  font-weight: 600;
}

/* ------------------------------------------------------------------------
   Command palette
   --------------------------------------------------------------------- */

.command-palette {
  width: min(640px, calc(100vw - 32px));
  max-height: none;
  margin: 14vh auto auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--ui-border-strong);
  border-radius: var(--ui-radius);
  background: var(--ui-panel);
  background-origin: border-box;
  box-shadow: 0 40px 100px rgb(0 0 0 / 65%);
  color: var(--ui-text);
}

.command-palette[open] {
  animation: deck-pop-in 150ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

@keyframes deck-pop-in {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.985);
  }
}

.command-palette::backdrop {
  background: rgb(2 4 8 / 70%);
  backdrop-filter: blur(5px);
}

.command-palette-field {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 56px;
  padding: 0 16px 0 18px;
  border-bottom: 1px solid var(--ui-border);
  color: var(--ui-accent);
}

.command-palette-field input {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  color: var(--ui-text);
  font: inherit;
  font-size: 16px;
  outline: none;
}

.command-palette-field input::placeholder {
  color: var(--ui-faint);
}

.command-palette-list {
  display: grid;
  gap: 2px;
  max-height: min(52vh, 430px);
  padding: 8px;
  overflow-y: auto;
}

.command-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  margin: 0;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--ui-radius-control);
  background: none;
  color: var(--ui-text);
  text-align: left;
  cursor: pointer;
}

.command-option > span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.command-option strong {
  font-size: 14px;
  font-weight: 600;
}

.command-option small {
  overflow: hidden;
  color: var(--ui-faint);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.command-option em {
  flex: 0 0 auto;
  color: var(--ui-faint);
  font-family: var(--ui-display);
  font-size: 10px;
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.command-option.active {
  background: var(--ui-accent-soft);
  box-shadow: inset 2px 0 0 var(--ui-accent);
}

.command-option.active em {
  color: var(--ui-accent);
}

.command-palette-empty {
  margin: 0;
  padding: 26px 18px;
  color: var(--ui-muted);
  font-size: 14px;
  text-align: center;
}

.command-palette-foot {
  display: flex;
  gap: 18px;
  padding: 10px 16px;
  border-top: 1px solid var(--ui-border);
  color: var(--ui-faint);
  font-size: 12px;
}

.command-palette-foot span {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ------------------------------------------------------------------------
   Home
   --------------------------------------------------------------------- */

.home-view {
  display: grid;
  gap: 22px;
}

.home-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  gap: 28px 40px;
  align-items: center;
  padding: 38px 40px;
  overflow: hidden;
  border: 1px solid var(--ui-border-strong);
  border-radius: var(--ui-radius);
  background:
    linear-gradient(var(--ui-accent), var(--ui-accent)) left top / 34px 2px no-repeat,
    linear-gradient(var(--ui-accent), var(--ui-accent)) left top / 2px 34px no-repeat,
    linear-gradient(var(--ui-accent), var(--ui-accent)) right bottom / 34px 2px no-repeat,
    linear-gradient(var(--ui-accent), var(--ui-accent)) right bottom / 2px 34px no-repeat,
    radial-gradient(ellipse 44rem 22rem at 0% 0%, rgb(28 205 252 / 16%), transparent 70%),
    linear-gradient(rgb(120 190 235 / 6%) 1px, transparent 1px) 0 0 / 100% 28px,
    linear-gradient(90deg, rgb(120 190 235 / 6%) 1px, transparent 1px) 0 0 / 28px 100%,
    linear-gradient(135deg, #0d1824, #080d14);
  background-origin: border-box;
  box-shadow: var(--ui-shadow);
}

/* A ship outline, large and faint, behind the right side of the hero. */
.home-emblem {
  position: absolute;
  top: 50%;
  right: -30px;
  width: 340px;
  height: 340px;
  color: var(--ui-accent);
  opacity: 0.07;
  transform: translateY(-50%) rotate(38deg);
  pointer-events: none;
}

.home-emblem .ui-icon {
  width: 100%;
  height: 100%;
  stroke-width: 0.6;
}

.home-hero-copy,
.home-hero-side {
  position: relative;
  min-width: 0;
}

.home-hero-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  color: var(--ui-accent);
  font-family: var(--ui-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  line-height: 1.2;
  text-transform: uppercase;
}

.home-hero-kicker i {
  width: 5px;
  height: 5px;
  background: var(--ui-accent);
  transform: rotate(45deg);
}

.home-hero-kicker span + i + span {
  color: var(--ui-muted);
}

.home-hero h2 {
  margin: 0 0 12px;
  color: #fff;
  font-family: var(--ui-display);
  font-size: clamp(32px, 3.6vw, 52px);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.04;
  text-wrap: balance;
}

.home-hero h2 em {
  color: var(--ui-accent);
  font-style: normal;
  text-shadow: 0 0 34px rgb(28 205 252 / 45%);
}

.home-hero-sub {
  margin: 0 0 24px;
  color: var(--ui-muted);
  font-size: 14px;
  line-height: 1.5;
}

.home-hero-sub span {
  margin: 0 6px;
  color: var(--ui-faint);
}

.home-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.home-search {
  flex: 0 1 380px;
  min-width: 220px;
  height: 46px;
  padding: 0 10px 0 14px;
  background: rgb(5 8 13 / 62%);
  font-size: 14px;
}

.home-hero-link {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 46px;
  margin: 0;
  padding: 0 16px;
  border: 1px solid var(--ui-border-strong);
  border-radius: var(--ui-radius-control);
  background: rgb(5 8 13 / 62%);
  color: var(--ui-text);
  font-family: var(--ui-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    border-color var(--ui-ease),
    color var(--ui-ease);
}

.home-hero-link:hover {
  border-color: var(--ui-accent-line);
  color: var(--ui-accent);
}

.home-hero-side {
  display: grid;
  gap: 12px;
}

.home-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  border: 1px solid var(--ui-border-strong);
  border-radius: var(--ui-radius-control);
  background: rgb(5 8 13 / 62%);
}

.home-stats > div {
  min-width: 0;
  padding: 14px 16px;
}

.home-stats > div + div {
  border-left: 1px solid var(--ui-border);
}

.home-stats dt {
  margin: 0 0 8px;
  color: var(--ui-faint);
  font-family: var(--ui-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.home-stats dd {
  display: grid;
  gap: 5px;
  margin: 0;
}

.home-stats b {
  color: #fff;
  font-family: var(--ui-display);
  font-size: 30px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.home-stats b.home-stat-word {
  padding-top: 7px;
  color: var(--ui-accent);
  font-size: 18px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.home-stats dd span {
  overflow: hidden;
  color: var(--ui-muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Jump back in. */
.home-recents {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
}

.home-view h3 {
  margin: 0;
  color: var(--ui-text);
  font-family: var(--ui-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.home-recents h3 {
  color: var(--ui-faint);
}

.home-recents-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.home-recent {
  display: grid;
  gap: 3px;
  margin: 0;
  padding: 8px 14px;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-control);
  background: var(--ui-card);
  color: var(--ui-text);
  text-align: left;
  cursor: pointer;
  transition:
    border-color var(--ui-ease),
    background var(--ui-ease);
}

.home-recent small {
  color: var(--ui-faint);
  font-family: var(--ui-display);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.home-recent strong {
  font-size: 13px;
  font-weight: 600;
}

a.home-recent {
  text-decoration: none;
}

.home-recent:hover {
  border-color: var(--ui-accent-line);
  background: var(--ui-card-raised);
}

/* Tool board: one panel per category. */
.home-board-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 16px;
  margin-top: 6px;
}

.home-board-heading p {
  margin: 0;
  color: var(--ui-faint);
  font-size: 13px;
}

.home-board {
  column-width: 340px;
  column-gap: var(--ui-gap);
}

.home-board-card {
  margin: 0 0 var(--ui-gap);
  break-inside: avoid;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius);
  background: var(--ui-panel);
  background-origin: border-box;
  box-shadow: var(--ui-shadow);
}

.home-board-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--ui-border);
}

.home-board-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgb(28 205 252 / 28%);
  border-radius: var(--ui-radius-control);
  background: var(--ui-accent-soft);
  color: var(--ui-accent);
}

.home-board-count {
  color: var(--ui-faint);
  font-family: var(--ui-display);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
}

.home-board-tools {
  display: grid;
  padding: 6px;
}

.home-tool {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 0;
  padding: 11px 12px;
  border: 0;
  border-radius: var(--ui-radius-control);
  background: none;
  color: var(--ui-text);
  text-align: left;
  cursor: pointer;
  transition:
    background var(--ui-ease),
    box-shadow var(--ui-ease);
}

.home-tool-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.home-tool strong {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
}

.home-tool small {
  color: var(--ui-faint);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
}

.home-tool-go {
  color: var(--ui-accent);
  opacity: 0;
  transform: translateX(-6px);
  transition:
    opacity var(--ui-ease),
    transform var(--ui-ease);
}

.home-tool-go .ui-icon {
  width: 16px;
  height: 16px;
}

.home-tool:hover,
.home-tool:focus-visible {
  background: var(--ui-accent-soft);
  box-shadow: inset 2px 0 0 var(--ui-accent);
}

.home-tool:hover .home-tool-go,
.home-tool:focus-visible .home-tool-go {
  opacity: 1;
  transform: none;
}

/* ------------------------------------------------------------------------
   Page header
   --------------------------------------------------------------------- */

.hero-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 24px;
  margin-bottom: 22px;
}

.hero-row > div:first-child {
  min-width: 0;
}

.eyebrow {
  color: var(--ui-accent);
  font-family: var(--ui-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero-row h1 {
  margin: 8px 0;
  font-family: var(--ui-display);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.hero-row p {
  max-width: 70ch;
  margin: 0;
  color: var(--ui-muted);
  font-size: 14px;
  line-height: 1.55;
}

.hero-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ------------------------------------------------------------------------
   Panels
   --------------------------------------------------------------------- */

.panel-view:not(.home-view) {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--ui-gap);
}

.surface {
  min-width: 0;
  padding: var(--ui-pad);
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius);
  background: var(--ui-panel);
  background-origin: border-box;
  box-shadow: var(--ui-shadow);
}

.surface-flush {
  padding: 0;
  overflow: hidden;
}

/* Blocks stacked with the same gap as the page. */
.stack {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--ui-gap);
}

.surface > .link-row,
.surface > .chip-toggles {
  margin-top: 16px;
}

.surface-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 16px;
  margin: 0 0 16px;
}

.surface-flush > .surface-head {
  margin: 0;
  padding: 16px var(--ui-pad) 14px;
  border-bottom: 1px solid var(--ui-border);
}

.surface-head h2,
.surface h2 {
  margin: 0;
  color: var(--ui-text);
  font-family: var(--ui-display);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.3;
}

.surface-head p,
.surface-note {
  margin: 0;
  color: var(--ui-faint);
  font-size: 12px;
  line-height: 1.45;
}

.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: var(--ui-gap);
  align-items: start;
}

/* Number tiles. */
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.metrics > article {
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-inner);
  background: var(--ui-card);
  box-shadow: inset 0 2px 0 rgb(28 205 252 / 45%);
}

.metrics span {
  display: block;
  color: var(--ui-faint);
  font-family: var(--ui-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.metrics strong {
  display: block;
  margin: 8px 0 4px;
  overflow: hidden;
  color: #fff;
  font-family: var(--ui-display);
  font-size: 24px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metrics small {
  display: block;
  overflow: hidden;
  color: var(--ui-muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ------------------------------------------------------------------------
   Fields
   --------------------------------------------------------------------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}

.field {
  display: grid;
  flex: 1 1 160px;
  gap: 6px;
  min-width: 0;
  max-width: 280px;
  color: #dfe8f0;
  font-size: 13px;
  font-weight: 600;
}

.field-wide {
  flex: 2 1 240px;
  max-width: 420px;
}

.field-narrow {
  flex: 0 1 140px;
}

.field > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field input,
.field select {
  width: 100%;
  min-width: 0;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--ui-border-strong);
  border-radius: var(--ui-radius-control);
  background-color: var(--ui-field);
  color: var(--ui-text);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  transition:
    border-color var(--ui-ease),
    box-shadow var(--ui-ease);
}

.field select {
  padding-right: 30px;
}

.field :is(input, select):hover {
  border-color: rgb(148 190 230 / 30%);
}

.field :is(input, select):focus {
  border-color: rgb(28 205 252 / 70%);
  outline: none;
  box-shadow: 0 0 0 3px rgb(28 205 252 / 14%);
}

.field input::placeholder {
  color: #55687a;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-inner);
  background: var(--ui-inset);
  color: #dfe8f0;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}

.check input {
  width: 16px;
  height: 16px;
  margin: 0;
  flex: 0 0 auto;
  accent-color: var(--ui-accent);
}

.filters-count {
  margin-left: auto;
  align-self: center;
  color: var(--ui-faint);
  font-family: var(--ui-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Two or three choices in one control. */
.segmented {
  display: inline-flex;
  height: 40px;
  padding: 3px;
  border: 1px solid var(--ui-border-strong);
  border-radius: var(--ui-radius-control);
  background: var(--ui-field);
}

.segmented button {
  margin: 0;
  padding: 0 14px;
  border: 0;
  border-radius: 3px;
  background: none;
  color: var(--ui-muted);
  font-family: var(--ui-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.segmented button[aria-pressed="true"] {
  background: var(--ui-accent-soft);
  color: var(--ui-accent);
}

/* A row of on/off chips, e.g. the services a location must have. */
.chip-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-toggle {
  margin: 0;
  padding: 7px 12px;
  border: 1px solid var(--ui-border-strong);
  border-radius: 3px;
  background: rgb(255 255 255 / 3%);
  color: var(--ui-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition:
    border-color var(--ui-ease),
    color var(--ui-ease),
    background var(--ui-ease);
}

.chip-toggle:hover {
  color: var(--ui-text);
}

.chip-toggle[aria-pressed="true"] {
  border-color: var(--ui-accent-line);
  background: var(--ui-accent-soft);
  color: var(--ui-accent);
}

/* ------------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  margin: 0;
  padding: 0 18px;
  border: 1px solid var(--ui-border-strong);
  border-radius: var(--ui-radius-control);
  background: rgb(255 255 255 / 4%);
  color: var(--ui-text);
  font-family: var(--ui-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background var(--ui-ease),
    border-color var(--ui-ease),
    filter var(--ui-ease);
}

.button:hover:not(:disabled) {
  border-color: rgb(148 190 230 / 30%);
  background: rgb(255 255 255 / 8%);
}

.button .ui-icon {
  width: 16px;
  height: 16px;
}

.button-primary {
  padding-right: 22px;
  border-color: transparent;
  border-radius: 2px;
  background: linear-gradient(100deg, #46a6ff, #1ccdfc 55%);
  color: var(--ui-accent-ink);
  font-weight: 700;
  clip-path: var(--ui-chamfer);
}

.button-primary:hover:not(:disabled) {
  border-color: transparent;
  background: linear-gradient(100deg, #46a6ff, #1ccdfc 55%);
  filter: brightness(1.12) drop-shadow(0 0 10px rgb(28 205 252 / 45%));
}

.button-small {
  height: 32px;
  padding: 0 12px;
}

.button:disabled {
  filter: saturate(0.6);
  opacity: 0.5;
  cursor: not-allowed;
}

.button:focus-visible,
.chip-toggle:focus-visible,
.segmented button:focus-visible,
.sort-button:focus-visible,
.row-link:focus-visible,
.ship-card:focus-visible {
  outline: 2px solid var(--ui-accent);
  outline-offset: 2px;
}

.button-primary:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -3px;
}

/* ------------------------------------------------------------------------
   Tables
   --------------------------------------------------------------------- */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-inner);
  background: var(--ui-inset);
}

.surface-flush > .table-wrap {
  border: 0;
  border-radius: 0;
  background: none;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead th {
  padding: 0;
  border-bottom: 1px solid var(--ui-border);
  background: rgb(255 255 255 / 2%);
  color: var(--ui-faint);
  font-family: var(--ui-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

thead th > span,
.sort-button {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 12px 16px;
}

.sort-button {
  margin: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}

.sort-button:hover {
  color: var(--ui-text);
}

.sort-button::after {
  width: 0;
  height: 0;
  content: "";
  border: 4px solid transparent;
  opacity: 0;
}

th[aria-sort="ascending"] .sort-button,
th[aria-sort="descending"] .sort-button {
  color: var(--ui-accent);
}

th[aria-sort="ascending"] .sort-button::after {
  border-top: 0;
  border-bottom-color: currentColor;
  opacity: 1;
}

th[aria-sort="descending"] .sort-button::after {
  border-bottom: 0;
  border-top-color: currentColor;
  opacity: 1;
}

th.num > span,
th.num .sort-button {
  justify-content: flex-end;
}

tbody td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--ui-border);
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr {
  transition: background var(--ui-ease);
}

tbody tr:hover > td {
  background: rgb(255 255 255 / 2.5%);
}

td.num {
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

td.strong,
td .strong {
  color: #fff;
  font-weight: 600;
}

td small,
.cell-sub {
  display: block;
  color: var(--ui-faint);
  font-size: 12px;
  line-height: 1.35;
}

.money {
  color: #fff;
  font-family: var(--ui-display);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.money-unit {
  margin-left: 4px;
  color: var(--ui-faint);
  font-family: var(--ui-body);
  font-size: 11px;
  font-weight: 500;
}

.gain {
  color: var(--ui-good-text);
}

.muted {
  color: var(--ui-faint);
}

.row-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--ui-text);
  font: inherit;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.row-link:hover {
  color: var(--ui-accent);
}

.table-more {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--ui-border);
  color: var(--ui-faint);
  font-size: 12px;
}

/* ------------------------------------------------------------------------
   Pills
   --------------------------------------------------------------------- */

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill {
  display: inline-block;
  padding: 3px 8px;
  border: 1px solid var(--ui-border-strong);
  border-radius: 3px;
  background: rgb(255 255 255 / 3%);
  color: var(--ui-muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

.pill-accent {
  border-color: rgb(28 205 252 / 30%);
  background: var(--ui-accent-soft);
  color: var(--ui-accent);
}

.pill-bad {
  border-color: rgb(240 106 118 / 40%);
  background: rgb(240 106 118 / 12%);
  color: var(--ui-bad-text);
}

.pill-warn {
  border-color: rgb(244 198 93 / 34%);
  background: rgb(244 198 93 / 10%);
  color: #f6dc9c;
}

.pill-good {
  border-color: rgb(64 220 150 / 30%);
  background: rgb(64 220 150 / 9%);
  color: var(--ui-good-text);
}

/* ------------------------------------------------------------------------
   Ships
   --------------------------------------------------------------------- */

.ship-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: var(--ui-gap);
}

.ship-card {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius);
  background: var(--ui-panel);
  background-origin: border-box;
  color: var(--ui-text);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition:
    border-color var(--ui-ease),
    transform var(--ui-ease);
}

.ship-card:hover {
  border-color: var(--ui-accent-line);
  transform: translateY(-2px);
}

.ship-photo {
  position: relative;
  display: grid;
  aspect-ratio: 16 / 9;
  place-items: center;
  overflow: hidden;
  background:
    linear-gradient(rgb(120 190 235 / 5%) 1px, transparent 1px) 0 0 / 100% 18px,
    linear-gradient(90deg, rgb(120 190 235 / 5%) 1px, transparent 1px) 0 0 / 18px 100%,
    var(--ui-inset);
  color: rgb(120 190 235 / 26%);
}

.ship-photo .ui-icon {
  width: 56px;
  height: 56px;
  stroke-width: 1;
}

.ship-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ship-photo .pills {
  position: absolute;
  top: 8px;
  left: 8px;
}

.ship-photo .pill {
  border-color: transparent;
  background: rgb(5 8 13 / 78%);
  backdrop-filter: blur(4px);
}

.ship-card-body {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 14px 16px 16px;
}

.ship-card-maker {
  overflow: hidden;
  color: var(--ui-faint);
  font-family: var(--ui-display);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.ship-card-name {
  margin: 2px 0 0;
  overflow: hidden;
  color: #fff;
  font-family: var(--ui-display);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ship-card-specs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-inner);
  background: var(--ui-inset);
}

.ship-card-specs > div {
  min-width: 0;
  padding: 8px 10px;
}

.ship-card-specs > div + div {
  border-left: 1px solid var(--ui-border);
}

.ship-card-specs dt {
  color: var(--ui-faint);
  font-family: var(--ui-display);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ship-card-specs dd {
  margin: 3px 0 0;
  overflow: hidden;
  color: var(--ui-text);
  font-family: var(--ui-display);
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ship-card-price {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
}

.ship-card-price .muted {
  white-space: nowrap;
}

/* Ship page. */
.ship-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: var(--ui-gap);
  align-items: stretch;
}

.ship-hero .ship-photo {
  min-height: 260px;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius);
  aspect-ratio: auto;
}

.ship-hero-side {
  display: grid;
  align-content: start;
  gap: var(--ui-gap);
}

.ship-hero-side .metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.spec-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0 24px;
  margin: 0;
}

.spec-list > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--ui-border);
}

.spec-list dt {
  color: var(--ui-muted);
  font-size: 13px;
}

.spec-list dd {
  margin: 0;
  color: var(--ui-text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Compare. */
.compare-table th[scope="row"] {
  padding: 11px 16px;
  border-bottom: 1px solid var(--ui-border);
  background: rgb(255 255 255 / 2%);
  color: var(--ui-muted);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
}

.compare-table thead th {
  padding: 14px 16px;
  color: var(--ui-text);
  font-size: 14px;
  letter-spacing: 0.02em;
  text-transform: none;
  vertical-align: bottom;
  white-space: normal;
}

.compare-table thead th small {
  display: block;
  margin-bottom: 3px;
  color: var(--ui-faint);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.compare-table thead .button {
  margin-top: 10px;
}

.compare-table td {
  font-variant-numeric: tabular-nums;
}

.compare-table td.best {
  background: rgb(28 205 252 / 7%);
  box-shadow: inset 2px 0 0 var(--ui-accent);
  color: #fff;
  font-weight: 600;
}

/* Rating bars (refining methods). */
.rating {
  display: inline-flex;
  gap: 3px;
  vertical-align: middle;
}

.rating i {
  width: 16px;
  height: 6px;
  background: rgb(120 190 235 / 16%);
}

.rating i.on {
  background: var(--ui-accent);
}

/* Trade runs. */
.route-list {
  display: grid;
  gap: 10px;
}

.route {
  display: grid;
  grid-template-columns: minmax(150px, 0.9fr) minmax(0, 1.4fr) auto;
  gap: 12px 20px;
  align-items: center;
  padding: 14px 18px;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-inner);
  background: var(--ui-inset);
}

.route-rank {
  margin-right: 10px;
  color: var(--ui-faint);
  font-family: var(--ui-display);
  font-size: 12px;
  font-weight: 700;
}

.route-goods strong {
  color: #fff;
  font-size: 15px;
  font-weight: 600;
}

.route-goods small,
.route-leg small {
  display: block;
  color: var(--ui-faint);
  font-size: 12px;
}

.route-legs {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.route-leg {
  min-width: 0;
}

.route-leg span {
  display: block;
  color: var(--ui-faint);
  font-family: var(--ui-display);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.route-leg strong {
  display: block;
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-arrow {
  color: var(--ui-accent);
}

.route-profit {
  text-align: right;
}

.route-profit strong {
  display: block;
  color: var(--ui-good-text);
  font-family: var(--ui-display);
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  white-space: nowrap;
}

.route-profit small {
  color: var(--ui-faint);
  font-size: 12px;
  white-space: nowrap;
}

/* ------------------------------------------------------------------------
   States
   --------------------------------------------------------------------- */

.state {
  display: grid;
  gap: 8px;
  padding: 44px 20px;
  justify-items: center;
  color: var(--ui-muted);
  text-align: center;
}

.state strong {
  color: var(--ui-text);
  font-family: var(--ui-display);
  font-size: 16px;
  font-weight: 600;
}

.state p {
  max-width: 52ch;
  margin: 0;
  font-size: 13px;
}

.state .button {
  margin-top: 8px;
}

.state-loading::before {
  width: 28px;
  height: 28px;
  content: "";
  border: 2px solid var(--ui-border-strong);
  border-top-color: var(--ui-accent);
  border-radius: 50%;
  animation: deck-spin 800ms linear infinite;
}

@keyframes deck-spin {
  to {
    transform: rotate(360deg);
  }
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 60;
  max-width: min(420px, calc(100vw - 40px));
  padding: 12px 16px;
  border: 1px solid var(--ui-border-strong);
  border-radius: var(--ui-radius-inner);
  background: var(--ui-card-raised);
  box-shadow: 0 16px 40px rgb(0 0 0 / 40%);
  font-size: 13px;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition:
    opacity var(--ui-ease),
    transform var(--ui-ease);
}

.toast.show {
  opacity: 1;
  transform: none;
}

.site-footer {
  padding: 18px 28px 22px;
  border-top: 1px solid var(--ui-border);
  color: var(--ui-faint);
  font-family: var(--ui-display);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-align: center;
  text-transform: uppercase;
}

.site-footer span {
  margin: 0 6px;
}

.site-footer a {
  color: var(--ui-muted);
}

.noscript-note {
  margin: 0;
  padding: 16px;
  color: var(--ui-muted);
  text-align: center;
}

@media (min-width: 761px) {
  .app-shell + .site-footer {
    margin-left: var(--ui-rail-w);
  }
}

/* ------------------------------------------------------------------------
   Contested zones
   --------------------------------------------------------------------- */

/* The live hangar chip in the top bar. */
.deck-hangar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  margin: 0;
  padding: 0 11px;
  border: 1px solid var(--ui-border-strong);
  border-radius: var(--ui-radius-control);
  background: rgb(255 255 255 / 3%);
  color: var(--ui-muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.deck-hangar:hover {
  border-color: var(--ui-accent-line);
  color: var(--ui-text);
}

.deck-hangar:focus-visible {
  outline: 2px solid var(--ui-accent);
  outline-offset: -2px;
}

.deck-hangar-label {
  color: var(--ui-faint);
  font-family: var(--ui-display);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

#deck-hangar-text {
  font-family: var(--ui-display);
  font-variant-numeric: tabular-nums;
}

.deck-hangar-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ui-bad);
}

.deck-hangar[data-phase="open"] {
  border-color: rgb(64 220 150 / 32%);
  background: rgb(64 220 150 / 8%);
  color: var(--ui-good-text);
}

.deck-hangar[data-phase="open"] .deck-hangar-dot {
  background: var(--ui-good);
  box-shadow: 0 0 0 3px rgb(64 220 150 / 18%);
}

.deck-hangar[data-phase="reset"] .deck-hangar-dot {
  background: #2a3440;
}

/* The five hangar lights. */
.hangar-lights {
  display: inline-flex;
  gap: 6px;
}

.hangar-lights i {
  width: 12px;
  height: 12px;
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 50%;
  background: #1a222c;
}

.hangar-lights i[data-light="red"] {
  background: #e5484d;
  box-shadow: 0 0 10px rgb(229 72 77 / 55%);
}

.hangar-lights i[data-light="green"] {
  background: #3ddc84;
  box-shadow: 0 0 10px rgb(61 220 132 / 55%);
}

.hangar-lights-large {
  gap: 14px;
}

.hangar-lights-large i {
  width: 38px;
  height: 38px;
  border-width: 2px;
}

.hangar-lights-large i[data-light="red"] {
  box-shadow: 0 0 22px rgb(229 72 77 / 50%), inset 0 -6px 12px rgb(0 0 0 / 25%);
}

.hangar-lights-large i[data-light="green"] {
  box-shadow: 0 0 22px rgb(61 220 132 / 50%), inset 0 -6px 12px rgb(0 0 0 / 25%);
}

.hangar-status {
  display: grid;
  gap: 22px;
}

.hangar-status-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px 40px;
}

.hangar-copy {
  display: grid;
  gap: 6px;
}

.hangar-title {
  font-family: var(--ui-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hangar-status[data-phase="closed"] .hangar-title {
  color: #ff8a8f;
}

.hangar-status[data-phase="open"] .hangar-title {
  color: #6ff0a8;
}

.hangar-status[data-phase="reset"] .hangar-title {
  color: var(--ui-muted);
}

.hangar-count-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px;
}

.hangar-count-label {
  color: var(--ui-muted);
  font-size: 14px;
}

.hangar-count {
  color: #fff;
  font-family: var(--ui-display);
  font-size: clamp(40px, 6vw, 64px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.hangar-next {
  color: var(--ui-faint);
  font-size: 13px;
}

/* The 3 h 5 min loop with a marker for now. */
.loop-bar {
  position: relative;
  display: grid;
  grid-template-columns: 120fr 60fr 5fr;
  height: 10px;
  border-radius: 2px;
  overflow: visible;
}

.loop-red {
  background: linear-gradient(90deg, rgb(229 72 77 / 55%), rgb(229 72 77 / 30%));
}

.loop-green {
  background: rgb(61 220 132 / 50%);
}

.loop-black {
  background: #1a222c;
}

.loop-marker {
  position: absolute;
  top: -5px;
  width: 2px;
  height: 20px;
  margin-left: -1px;
  background: #fff;
  box-shadow: 0 0 10px rgb(255 255 255 / 70%);
}

.loop-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 18px;
  color: var(--ui-faint);
  font-size: 12px;
}

.plain-list {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
  padding-left: 18px;
  color: var(--ui-muted);
  font-size: 13px;
  line-height: 1.5;
}

.source-note {
  margin-bottom: 0;
}

.surface > .source-note + .link-row {
  margin-top: 12px;
}

/* Squad panel. */
.squad-bar .filters {
  align-items: flex-end;
}

.squad-bar > .surface-note {
  margin-top: 12px;
}

.squad-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  margin-left: auto;
  color: var(--ui-muted);
  font-size: 12px;
  font-weight: 600;
}

.squad-status::before {
  width: 8px;
  height: 8px;
  content: "";
  border-radius: 50%;
  background: var(--ui-faint);
}

.squad-status[data-state="shared"] {
  color: var(--ui-good-text);
}

.squad-status[data-state="shared"]::before {
  background: var(--ui-good);
  box-shadow: 0 0 0 3px rgb(64 220 150 / 18%);
}

.squad-status[data-state="error"] {
  color: var(--ui-bad-text);
}

.squad-status[data-state="error"]::before {
  background: var(--ui-bad);
}

/* Keycard timers. */
.timer-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 560px), 1fr));
  gap: var(--ui-gap);
  align-items: start;
}

.timer-list {
  display: grid;
}

.timer-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px 16px;
  padding: 12px var(--ui-pad);
  border-top: 1px solid var(--ui-border);
  transition: background var(--ui-ease);
}

.timer-row:first-child {
  border-top: 0;
}

.timer-label {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.timer-label strong {
  font-size: 14px;
  font-weight: 600;
}

.timer-meta {
  color: var(--ui-faint);
  font-size: 12px;
}

.timer-time {
  min-width: 76px;
  color: var(--ui-muted);
  font-family: var(--ui-display);
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.timer-row[data-state="running"] .timer-time {
  color: #fff;
}

.timer-row[data-state="soon"] .timer-time {
  color: var(--ui-warn);
}

.timer-row[data-state="ready"] {
  background: rgb(64 220 150 / 6%);
  box-shadow: inset 2px 0 0 var(--ui-good);
}

.timer-row[data-state="ready"] .timer-time {
  color: var(--ui-good-text);
}

.timer-controls {
  display: flex;
  gap: 6px;
}

.timer-step {
  width: 32px;
  padding: 0;
  font-size: 16px;
}

.kind-pill {
  justify-self: start;
  padding: 1px 7px;
  border-radius: 3px;
  font-family: var(--ui-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.kind-blue {
  background: rgb(70 140 255 / 18%);
  color: #9cc2ff;
}

.kind-red {
  background: rgb(229 72 77 / 18%);
  color: #ff9ea2;
}

.kind-gold {
  background: rgb(244 198 93 / 16%);
  color: #f6dc9c;
}

.kind-compboard {
  background: var(--ui-accent-soft);
  color: var(--ui-accent);
}

/* Refinery jobs. */
.job-list {
  display: grid;
}

.job {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(170px, auto) auto;
  align-items: center;
  gap: 10px 20px;
  padding: 14px var(--ui-pad);
  border-top: 1px solid var(--ui-border);
}

.job:first-child {
  border-top: 0;
}

.job[data-state="ready"] {
  background: rgb(64 220 150 / 6%);
  box-shadow: inset 2px 0 0 var(--ui-good);
}

.job-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.job-copy strong {
  font-size: 14px;
}

.job-copy span {
  color: var(--ui-muted);
  font-size: 13px;
}

.job-copy small,
.job-time small {
  color: var(--ui-faint);
  font-size: 12px;
}

.job-time {
  display: grid;
  gap: 4px;
  justify-items: end;
}

.job-time strong {
  font-family: var(--ui-display);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.job[data-state="ready"] .job-time strong {
  color: var(--ui-good-text);
}

.job-progress {
  width: 150px;
  height: 4px;
  overflow: hidden;
  border-radius: 2px;
  background: rgb(120 190 235 / 14%);
}

.job-progress i {
  display: block;
  height: 100%;
  background: var(--ui-accent);
}

.job[data-state="ready"] .job-progress i {
  background: var(--ui-good);
}

/* ------------------------------------------------------------------------
   Mining
   --------------------------------------------------------------------- */

.bonus {
  display: inline-block;
  min-width: 46px;
  padding: 2px 7px;
  border-radius: 3px;
  font-family: var(--ui-display);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.bonus-up {
  background: rgb(64 220 150 / 13%);
  color: var(--ui-good-text);
}

.bonus-down {
  background: rgb(240 106 118 / 13%);
  color: var(--ui-bad-text);
}

.bonus-flat {
  background: rgb(255 255 255 / 5%);
  color: var(--ui-muted);
}

.place-note {
  margin: 14px 0 0;
  color: var(--ui-muted);
  font-size: 13px;
}

.place-note strong {
  color: #fff;
}

.found-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px 28px;
}

.found-system h3 {
  margin: 0 0 8px;
  color: var(--ui-accent);
  font-family: var(--ui-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.found-list {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.found-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--ui-border);
}

.found-list strong {
  font-size: 13px;
  font-weight: 600;
}

.found-list small {
  color: var(--ui-faint);
  font-size: 12px;
  text-align: right;
}

/* Refinery bonus grid. */
.matrix-wrap {
  max-height: 72vh;
  overflow: auto;
}

.matrix {
  border-collapse: separate;
  border-spacing: 0;
}

.matrix thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #0b121a;
  vertical-align: bottom;
}

.matrix-head {
  display: grid;
  gap: 2px;
  padding: 12px 10px;
  text-align: center;
  white-space: nowrap;
}

.matrix-head strong {
  color: var(--ui-text);
  font-size: 12px;
  letter-spacing: 0.02em;
  text-transform: none;
}

.matrix-head small {
  font-size: 10px;
}

.matrix tbody th {
  position: sticky;
  left: 0;
  z-index: 1;
  padding: 9px 16px;
  border-bottom: 1px solid var(--ui-border);
  background: #0b121a;
  text-align: left;
  white-space: nowrap;
}

.matrix .matrix-corner {
  left: 0;
  z-index: 3;
}

.matrix-cell {
  padding: 8px 10px;
  text-align: center;
}

.matrix-cell.best .bonus {
  outline: 1px solid var(--ui-good);
  outline-offset: 1px;
}

.matrix-best {
  white-space: nowrap;
}

.matrix-best strong {
  font-size: 13px;
}

/* Haul calculator. */
.haul-lines {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}

.haul-line .field > span:empty {
  display: none;
}

.verdict {
  margin: 0;
  padding: 12px 16px;
  border: 1px solid var(--ui-border);
  border-left: 2px solid var(--ui-accent);
  border-radius: var(--ui-radius-inner);
  background: var(--ui-card);
  color: var(--ui-text);
  font-size: 14px;
}

.laser-table td:not(.num) {
  white-space: nowrap;
}

/* ------------------------------------------------------------------------
   Charts, fleet, routes extras
   --------------------------------------------------------------------- */

.field-inline {
  display: flex;
  flex: 0 1 auto;
  align-items: center;
  gap: 10px;
  max-width: 100%;
}

.field-inline select {
  width: auto;
  max-width: min(420px, 70vw);
}

.field-auto {
  flex: 0 0 auto;
  max-width: none;
}

.chart-host {
  display: grid;
  gap: 12px;
}

.chart {
  position: relative;
  min-height: 220px;
}

.chart-svg {
  display: block;
  max-width: 100%;
  overflow: visible;
  outline: none;
  cursor: crosshair;
}

.chart-svg:focus-visible {
  outline: 2px solid var(--ui-accent);
  outline-offset: 4px;
}

.chart-grid {
  stroke: rgb(120 190 235 / 10%);
  stroke-width: 1;
}

.chart-axis {
  fill: var(--ui-faint);
  font-family: var(--ui-body);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.chart-line {
  fill: none;
  stroke: var(--ui-accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-point {
  fill: var(--ui-accent);
  stroke: #0c1520;
  stroke-width: 2;
}

.chart-focus {
  fill: #fff;
  stroke: var(--ui-accent);
  stroke-width: 2;
}

.chart-crosshair {
  stroke: rgb(238 244 250 / 35%);
  stroke-width: 1;
}

.chart-tip {
  position: absolute;
  top: 0;
  display: grid;
  gap: 2px;
  min-width: 140px;
  padding: 8px 10px;
  border: 1px solid var(--ui-border-strong);
  border-radius: var(--ui-radius-inner);
  background: var(--ui-card-raised);
  box-shadow: 0 10px 24px rgb(0 0 0 / 40%);
  pointer-events: none;
}

.chart-tip strong {
  color: #fff;
  font-family: var(--ui-display);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.chart-tip span {
  color: var(--ui-faint);
  font-size: 12px;
}

.chart-summary {
  margin: 0 0 6px;
  color: var(--ui-muted);
  font-size: 13px;
}

.chart-summary strong {
  color: #fff;
}

.chart-table summary {
  color: var(--ui-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.chart-table .table-wrap {
  max-height: 260px;
  margin-top: 10px;
  overflow: auto;
}

.route-ranking {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--ui-border);
}

.route-trip {
  margin-top: 4px;
  color: var(--ui-muted) !important;
}

.route-warnings {
  grid-column: 1 / -1;
}

.route-profit small {
  display: block;
}

.fleet-filter {
  display: flex;
  padding: 12px var(--ui-pad);
  border-bottom: 1px solid var(--ui-border);
}

.fleet-filter .field {
  max-width: 260px;
}

.fleet-missing {
  margin-top: 12px !important;
}

.discord-flags {
  margin-top: 12px;
}

.surface form > .link-row {
  margin-top: 14px;
}

/* ------------------------------------------------------------------------
   Narrow screens
   --------------------------------------------------------------------- */

@media (max-width: 1240px) {
  .deck-brand {
    display: none;
  }

  .home-hero {
    grid-template-columns: minmax(0, 1fr);
    padding: 30px 28px;
  }
}

@media (max-width: 980px) {
  .deck-status {
    width: 36px;
    padding: 0;
    justify-content: center;
    overflow: hidden;
    font-size: 0;
    gap: 0;
  }

  .deck-server-badge {
    display: none;
  }

  .ship-hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .route {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .route-legs {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

/* Phones: the rail becomes a bar along the bottom and its drawer a sheet. */
@media (max-width: 760px) {
  .app-shell {
    display: block;
  }

  .deck-rail {
    position: fixed;
    inset: auto 0 0;
    flex-direction: row;
    align-items: stretch;
    gap: 0;
    width: auto;
    height: 62px;
    padding: 4px 6px;
    overflow-x: auto;
    border-top: 1px solid var(--ui-border-strong);
    border-right: 0;
    scrollbar-width: none;
  }

  .deck-rail::-webkit-scrollbar {
    display: none;
  }

  .deck-logo,
  .rail-divider {
    display: none;
  }

  .deck-rail-items,
  .deck-rail-foot {
    flex: 1 1 auto;
    flex-direction: row;
    gap: 0;
  }

  .deck-rail-foot {
    flex: 0 0 auto;
  }

  .rail-item {
    width: auto;
    min-width: 0;
    flex: 1 1 0;
    min-height: 0;
    height: 100%;
    padding: 6px 0;
    font-size: 8.5px;
    letter-spacing: 0;
  }

  .rail-group {
    display: flex;
    flex: 1 1 0;
  }

  .rail-item.active,
  .rail-group.active > .rail-item {
    box-shadow: inset 0 2px 0 var(--ui-accent);
  }

  .rail-menu {
    inset: auto 0 62px;
    clip-path: inset(-100vmax 0 0 0);
    width: auto;
    max-height: min(70vh, 520px);
    border-top: 1px solid var(--ui-border-strong);
    border-right: 0;
  }

  @keyframes deck-drawer-in {
    from {
      opacity: 0;
      transform: translateY(12px);
    }
  }

  .deck-bar {
    backdrop-filter: none;
    background: rgb(5 8 13 / 97%);
  }

  .deck-bar-main {
    gap: 8px;
    padding: 0 12px;
  }

  .deck-search {
    flex: 0 0 36px;
    width: 36px;
    padding: 0;
    justify-content: center;
  }

  .deck-search > span,
  .deck-search > kbd,
  .home-search > kbd {
    display: none;
  }

  .deck-account {
    gap: 8px;
    min-width: 0;
  }

  .deck-tabs {
    padding: 0 12px;
  }

  .deck-tabs-label > span {
    display: none;
  }

  .deck-tabs-label {
    margin-right: 6px;
    padding-right: 12px;
  }

  .panel-main {
    padding: 18px 12px 96px;
  }

  .hero-row h1 {
    font-size: 26px;
  }

  .home-hero {
    padding: 24px 18px;
  }

  .home-emblem {
    width: 220px;
    height: 220px;
  }

  .home-stats > div {
    padding: 12px 10px;
  }

  .home-stats b {
    font-size: 24px;
  }

  .home-stats b.home-stat-word {
    font-size: 14px;
  }

  .home-recents {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .surface {
    padding: 16px;
  }

  .surface-flush {
    padding: 0;
  }

  .surface-flush > .surface-head {
    padding: 14px 16px 12px;
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .field,
  .field-wide,
  .field-narrow {
    flex: 1 1 100%;
    max-width: none;
  }

  .filters-count {
    margin-left: 0;
  }

  thead th > span,
  .sort-button,
  tbody td {
    padding-inline: 12px;
  }

  .route-legs {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .route-arrow {
    display: none;
  }

  .command-palette {
    margin-top: 8vh;
  }

  .site-footer {
    padding-bottom: 84px;
  }

  .toast {
    bottom: 76px;
  }
}

@media (max-width: 1100px) {
  .deck-hangar-label {
    display: none;
  }
}

@media (max-width: 980px) {
  .job {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .job > .button {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

@media (max-width: 760px) {
  .deck-hangar {
    padding: 0 8px;
  }

  /* Data is one tap away on the status light, so the bottom bar keeps
     room for the seven sections. */
  .deck-rail-foot {
    display: none;
  }

  .timer-row {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 12px 16px;
  }

  .timer-controls {
    grid-column: 1 / -1;
  }

  .timer-controls .button-primary {
    margin-left: auto;
  }

  .timer-meta {
    white-space: normal;
  }

  .hangar-lights-large {
    gap: 10px;
  }

  .hangar-lights-large i {
    width: 30px;
    height: 30px;
  }

  .squad-status {
    margin-left: 0;
  }

  .job {
    padding: 14px 16px;
  }

  .job-time {
    justify-items: start;
  }

  .haul-line .field > span:empty {
    display: none;
  }

  .haul-line {
    padding-bottom: 10px;
    border-bottom: 1px solid var(--ui-border);
  }
}

@media (max-width: 760px) {
  .field-inline {
    flex-wrap: wrap;
  }

  .fleet-filter {
    padding: 12px 16px;
  }

  .route-ranking .field-auto {
    flex: 1 1 100%;
  }
}

/* ------------------------------------------------------------------------
   Crafting: blueprint tracker and calculator
   --------------------------------------------------------------------- */

/* Have / Want buttons. */
.bp-toggles {
  display: inline-flex;
  gap: 4px;
}

.bp-toggle {
  min-width: 52px;
  height: 28px;
  margin: 0;
  padding: 0 10px;
  border: 1px solid var(--ui-border-strong);
  border-radius: 3px;
  background: rgb(255 255 255 / 3%);
  color: var(--ui-muted);
  font-family: var(--ui-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    border-color var(--ui-ease),
    background-color var(--ui-ease),
    color var(--ui-ease);
}

.bp-toggle:hover {
  border-color: var(--ui-accent-line);
  color: var(--ui-text);
}

.bp-toggle:focus-visible {
  outline: 2px solid var(--ui-accent);
  outline-offset: 2px;
}

.bp-toggle-have[aria-pressed="true"] {
  border-color: rgb(64 220 150 / 55%);
  background: rgb(64 220 150 / 14%);
  color: var(--ui-good-text);
}

.bp-toggle-want[aria-pressed="true"] {
  border-color: rgb(244 198 93 / 55%);
  background: rgb(244 198 93 / 12%);
  color: var(--ui-warn);
}

.bp-toggles-large .bp-toggle {
  height: 40px;
  min-width: 70px;
  font-size: 12px;
}

.bp-default {
  font-size: 12px;
  white-space: nowrap;
}

.bp-materials {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 360px;
}

.bp-material {
  padding: 2px 7px;
  border: 1px solid var(--ui-border);
  border-radius: 3px;
  background: var(--ui-inset);
  color: #dfe8f0;
  font-size: 12px;
  white-space: nowrap;
}

.bp-holders {
  color: var(--ui-good-text);
  font-size: 13px;
}

/* Collection by type: one bar per type. */
.bp-progress {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 4px 18px;
}

.bp-progress-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(70px, 120px) 64px;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: var(--ui-radius-inner);
  background: none;
  color: var(--ui-text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.bp-progress-row:hover {
  background: rgb(255 255 255 / 3%);
}

.bp-progress-row[aria-pressed="true"] {
  border-color: var(--ui-accent-line);
  background: var(--ui-accent-soft);
}

.bp-progress-row:focus-visible {
  outline: 2px solid var(--ui-accent);
  outline-offset: 1px;
}

.bp-progress-label {
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bp-meter {
  display: block;
  height: 6px;
  overflow: hidden;
  border-radius: 3px;
  background: rgb(120 190 235 / 12%);
}

.bp-meter > span {
  display: block;
  width: var(--fill, 0%);
  height: 100%;
  border-radius: 3px;
  background: var(--ui-good);
}

.bp-progress-count {
  color: var(--ui-muted);
  font-family: var(--ui-display);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* Calculator: slots on the left, stats on the right. */
.bp-calc {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr);
  gap: var(--ui-gap);
  align-items: start;
}

.bp-calc-tools {
  margin-bottom: 14px;
}

.bp-calc-tools .link-row {
  align-self: flex-end;
  margin: 0 0 6px;
}

.bp-warning {
  margin: 0 0 12px;
  padding: 10px 14px;
  border: 1px solid rgb(244 198 93 / 35%);
  border-left: 2px solid var(--ui-warn);
  border-radius: var(--ui-radius-inner);
  background: rgb(244 198 93 / 7%);
  color: var(--ui-text);
  font-size: 13px;
}

.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 12px;
}

.slot-group {
  grid-column: 1 / -1;
  padding: 12px;
  border: 1px dashed var(--ui-border-strong);
  border-radius: var(--ui-radius-inner);
}

.slot-group-head {
  margin: 0 0 10px;
  color: var(--ui-faint);
  font-family: var(--ui-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.slot-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-inner);
  background: var(--ui-card);
  transition: opacity var(--ui-ease);
}

.slot-card.slot-off {
  opacity: 0.55;
}

.slot-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.slot-card header strong {
  display: block;
  color: #fff;
  font-family: var(--ui-display);
  font-size: 15px;
  font-weight: 600;
}

.slot-card header small {
  display: block;
  color: var(--ui-muted);
  font-size: 12px;
}

.slot-quality {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 2px;
  height: 32px;
  padding: 0 0 0 8px;
  border: 1px solid var(--ui-border-strong);
  border-radius: var(--ui-radius-control);
  background: var(--ui-field);
  color: var(--ui-faint);
  font-family: var(--ui-display);
  font-size: 12px;
  font-weight: 600;
}

.slot-quality:focus-within {
  border-color: rgb(28 205 252 / 70%);
  box-shadow: 0 0 0 3px rgb(28 205 252 / 14%);
}

.slot-quality input {
  width: 52px;
  height: 100%;
  padding: 0 6px 0 0;
  border: 0;
  background: none;
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  outline: none;
  -moz-appearance: textfield;
}

.slot-quality input::-webkit-outer-spin-button,
.slot-quality input::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

/* Quality slider: cyan up to the handle. */
.slot-card input[type="range"] {
  width: 100%;
  height: 22px;
  margin: 0;
  background: none;
  cursor: pointer;
  appearance: none;
}

.slot-card input[type="range"]:disabled {
  cursor: not-allowed;
}

.slot-card input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--ui-accent) var(--fill, 50%), rgb(120 190 235 / 16%) var(--fill, 50%));
}

.slot-card input[type="range"]::-moz-range-track {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--ui-accent) var(--fill, 50%), rgb(120 190 235 / 16%) var(--fill, 50%));
}

.slot-card input[type="range"]::-webkit-slider-thumb {
  width: 16px;
  height: 16px;
  margin-top: -6px;
  border: 2px solid var(--ui-bg);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 1px var(--ui-accent);
  appearance: none;
}

.slot-card input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 2px solid var(--ui-bg);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 1px var(--ui-accent);
}

.slot-card input[type="range"]:focus-visible {
  outline: 2px solid var(--ui-accent);
  outline-offset: 3px;
}

.slot-scale {
  display: flex;
  justify-content: space-between;
  margin-top: -6px;
  color: var(--ui-faint);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.slot-effects {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 10px 0 0;
  border-top: 1px solid var(--ui-border);
  list-style: none;
}

.slot-effects li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--ui-muted);
  font-size: 13px;
}

.slot-effects strong {
  color: var(--ui-text);
  font-family: var(--ui-display);
  font-variant-numeric: tabular-nums;
}

.slot-card .check {
  justify-self: start;
  height: 34px;
}

/* Stats: change from a standard craft, on a bar centred on zero. */
.stat-list {
  display: grid;
  gap: 14px;
}

.stat-row {
  display: grid;
  gap: 6px;
}

.stat-row-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.stat-row-head strong {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

.stat-change {
  color: var(--ui-muted);
  font-family: var(--ui-display);
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.stat-row > small {
  color: var(--ui-faint);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.stat-bar {
  position: relative;
  height: 8px;
  border-radius: 4px;
  background: rgb(120 190 235 / 7%);
}

.stat-bar > span {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--from, 50%);
  right: calc(100% - var(--to, 50%));
  border-radius: 4px;
}

.stat-bar-range {
  background: rgb(120 190 235 / 14%);
}

.stat-bar-fill {
  background: var(--ui-muted);
}

.stat-bar > .stat-bar-mid {
  --from: calc(50% - 1px);
  --to: calc(50% + 1px);
  top: -3px;
  bottom: -3px;
  border-radius: 1px;
  background: var(--ui-text);
}

.stat-good {
  color: var(--ui-good-text);
}

.stat-bad {
  color: var(--ui-bad-text);
}

.stat-bar-fill.stat-good {
  background: var(--ui-good);
}

.stat-bar-fill.stat-bad {
  background: var(--ui-bad);
}

.bp-missions {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bp-missions li {
  padding: 10px 12px;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-inner);
  background: var(--ui-card);
}

.bp-missions a,
.bp-missions span {
  color: #fff;
  font-weight: 600;
}

.bp-missions a:hover {
  color: var(--ui-accent);
}

.bp-missions small {
  display: block;
  color: var(--ui-faint);
  font-size: 12px;
}

.plan-count {
  width: 76px;
  height: 34px;
  padding: 0 8px;
  border: 1px solid var(--ui-border-strong);
  border-radius: var(--ui-radius-control);
  background: var(--ui-field);
  color: var(--ui-text);
  font: inherit;
  font-variant-numeric: tabular-nums;
}

.plan-count:focus {
  border-color: rgb(28 205 252 / 70%);
  outline: none;
  box-shadow: 0 0 0 3px rgb(28 205 252 / 14%);
}

@media (max-width: 1100px) {
  .bp-calc {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .bp-progress-row {
    grid-template-columns: minmax(0, 1fr) 80px 56px;
  }

  .bp-materials {
    max-width: 220px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
