*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #02040a;
  font-family: "Rajdhani", "Monda", system-ui, sans-serif;
  color: rgba(170, 183, 195, 0.78);
}

#app {
  position: relative;
  width: 100%;
  height: 100%;
}

#game {
  display: block;
  width: 100%;
  height: 100%;
  cursor: var(--woc-game-cursor, crosshair);
  /* Sector / Star Map: one-finger drag pans; don't let the browser steal it. */
  touch-action: none;
}

/* Room swap: dock ↔ sector ↔ location (below side menu so rail stays visible) */
.view-fade {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 45px;
  z-index: 5000;
  background: #02040a;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}
.view-fade.is-covering {
  opacity: 1;
  pointer-events: auto;
}

/* —— Sector node inspect popover (Glass Lab shell — same tokens as windows) —— */
.sector-node-modal {
  --snm-accent: var(--lab-accent, #afcadb);
  position: absolute;
  z-index: 8;
  min-width: 196px;
  max-width: 228px;
  padding: 12px;
  border: 1px solid var(--lab-line-soft, rgba(164, 194, 214, 0.16));
  border-radius: var(--lab-radius, 2px);
  background:
    var(--lab-fx, none),
    linear-gradient(180deg, var(--lab-bg, rgba(8, 14, 22, 0.42)) 0%, var(--lab-bg-2, rgba(4, 8, 14, 0.58)) 100%);
  backdrop-filter: blur(18px) saturate(1.25);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.4) inset,
    inset 0 1px 0 rgba(200, 230, 255, 0.08),
    0 14px 32px rgba(0, 0, 0, 0.5);
  color: var(--lab-text, #f0f4f8);
  font-family: var(--lab-font, "Rajdhani", "Monda", system-ui, sans-serif);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  /* No transform — it breaks backdrop-filter (same rule as .ui-frame shell) */
  transform: none;
  transition:
    opacity 0.18s ease,
    visibility 0.18s ease;
  -webkit-font-smoothing: antialiased;
}

.sector-node-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.sector-node-modal.is-station {
  --snm-accent: #c9b07a;
  border-color: rgba(200, 170, 110, 0.4);
}

.sector-node-modal.is-unknown {
  --snm-accent: rgba(170, 183, 195, 0.7);
  border-color: var(--lab-line-soft, rgba(164, 194, 214, 0.16));
}

.sector-node-modal.is-unknown .sector-node-modal__name {
  color: var(--lab-muted, rgba(170, 183, 195, 0.78));
  text-shadow: none;
}

.sector-node-modal.is-unknown .sector-node-modal__row dt {
  color: rgba(170, 183, 195, 0.5);
}

.sector-node-modal.is-unknown .sector-node-modal__row dd {
  color: var(--lab-muted, rgba(170, 183, 195, 0.78));
}

.sector-node-modal.is-unknown .sector-node-modal__row dd.is-unknown {
  color: rgba(170, 183, 195, 0.55);
}

.sector-node-modal.is-unknown .sector-node-modal__jump {
  opacity: 0.4;
  cursor: not-allowed;
}

.sector-node-modal[hidden] {
  display: none !important;
}

.sector-node-modal__glow,
.sector-node-modal__corner {
  display: none;
}

.sector-node-modal__head {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin: 0 0 10px;
  padding-bottom: 0;
  border-bottom: none;
}

.sector-node-modal__name {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--lab-text, #f0f4f8);
  line-height: 1.15;
  text-shadow: none;
}

.sector-node-modal__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  box-sizing: border-box;
  height: 18px;
  min-height: 18px;
  padding: 3px 8px 1px;
  border: 1px solid var(--lab-line-soft, rgba(164, 194, 214, 0.16));
  border-radius: 1px;
  background: rgba(6, 12, 18, 0.55);
  color: var(--snm-accent);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1;
}

.sector-node-modal__meta {
  position: relative;
  margin: 0 0 12px;
  display: grid;
  gap: 5px;
}

.sector-node-modal__row {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 6px;
  align-items: baseline;
  font-size: 11px;
  line-height: 1.3;
}

.sector-node-modal__row dt {
  margin: 0;
  color: var(--lab-muted, rgba(170, 183, 195, 0.78));
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 10px;
}

.sector-node-modal__row dd {
  margin: 0;
  color: var(--lab-text, #f0f4f8);
  font-weight: 600;
  text-align: right;
}

.sector-node-modal__row dd.is-levels {
  color: #8fd4a8;
}

.sector-node-modal__row dd.is-station {
  color: #d4b56a;
}

.sector-node-modal__jump {
  width: 100%;
}

/* —— Left side menu —— */
#side-menu {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 5100;
  display: flex;
  align-items: stretch;
  width: 45px;
  height: 100%;
  padding: 5px;
  pointer-events: auto;
  font-family: var(--lab-font, "Rajdhani", "Monda", system-ui, sans-serif);
}

.side-menu__rail {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 45px;
  /* Full-height vertical strip — edge only on the right, no top/bottom rules */
  border: none;
  border-right: 1px solid var(--lab-line-soft);
  border-radius: 0;
  background: linear-gradient(180deg, var(--lab-bg) 0%, var(--lab-bg-2) 100%);
  /* Keep blur only on the rail layer — icons sit in a separate composited layer above */
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: inset -1px 0 0 rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.side-menu__rail::before {
  content: none;
}

.side-menu__divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 45px;
  width: 0;
  background: transparent;
  pointer-events: none;
}

.side-menu__list {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: 35px;
  height: 100%;
  list-style: none;
  /* Own layer so backdrop-filter on the rail can't soft-rasterize icons */
  isolation: isolate;
  transform: translateZ(0);
}

.side-menu__spacer {
  flex: 1 1 auto;
  min-height: 8px;
  width: 1px;
  pointer-events: none;
}

.side-menu__avatar,
.side-menu__btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 35px;
  height: 35px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--lab-radius, 2px);
  background: transparent;
  color: var(--lab-muted);
  cursor: pointer;
  /* Integer pixel layer — avoids soft subpixel raster of SVG icons */
  transform: translateZ(0);
  backface-visibility: hidden;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease,
    filter 0.15s ease;
}

.side-menu__avatar {
  border-color: var(--lab-line-soft);
  overflow: hidden;
  background: var(--lab-slot-bg);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.3);
}

.side-menu__avatar img {
  /* PNG already has a 1px edge — crop it so only the CSS border shows */
  display: block;
  width: calc(100% + 2px);
  height: calc(100% + 2px);
  max-width: none;
  margin: -1px;
  object-fit: cover;
}

.side-menu__btn img {
  display: block;
  object-fit: contain;
  pointer-events: none;
  opacity: 1;
  backface-visibility: hidden;
  transform: translateZ(0);
}

/* Native SVG artboards + filter padding read small; scale to match design fill */
.side-menu__icon--menu {
  width: 27px;
  height: 25px;
}

.side-menu__icon--location {
  width: 24px;
  height: 24px;
}

.side-menu__icon--bank {
  width: 24px;
  height: 22px;
}

.side-menu__icon--ship {
  width: 22px;
  height: 21px;
}

.side-menu__icon--message {
  width: 22px;
  height: 16px;
}

.side-menu__icon--warehouse,
.side-menu__icon--settings,
.side-menu__icon--workshop {
  width: 22px;
  height: 22px;
}

.side-menu__icon--market {
  width: 22px;
  height: 19px;
}

.side-menu__icon--scan {
  width: 22px;
  height: 17px;
}

.side-menu__icon--test {
  width: 18px;
  height: 18px;
}

.side-menu__icon--help,
.side-menu__icon--exit {
  width: 19px;
  height: 19px;
}

.side-menu__btn:hover,
.side-menu__btn.is-active {
  border-color: var(--lab-hover-line);
  background: var(--lab-btn-bg-hover);
  color: #fff;
  box-shadow: 0 0 12px rgba(var(--lab-glow-rgb), 0.18);
}

.side-menu__avatar:hover,
.side-menu__avatar.is-active {
  border-color: var(--lab-hover-line);
  box-shadow: 0 0 12px rgba(var(--lab-glow-rgb), 0.18);
}

.side-menu__btn:active:not(:disabled) {
  border-color: var(--lab-hover-line);
  background: var(--lab-btn-bg-hover);
  filter: brightness(0.96);
}

.side-menu__btn:disabled,
.side-menu__btn.is-disabled {
  opacity: 0.28;
  pointer-events: none;
  cursor: default;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  filter: none;
}

.side-menu__avatar:active {
  border-color: var(--lab-hover-line);
}

/* Pilot dossier — compact Glass Lab card */
#pilot-frame {
  width: 300px;
  max-width: 300px;
  min-width: 300px;
  /* header 26 + pads 12+12 + portrait 72 */
  height: 122px;
  max-height: 122px;
  min-height: 122px;
  left: 58px;
  top: 12px;
}

#pilot-frame .ui-frame__body {
  padding-right: 0;
  padding-bottom: 0;
}

#pilot-frame.is-minimized {
  width: 250px;
  max-width: 250px;
  min-width: 250px;
  height: calc(var(--frame-inset) * 2 + var(--frame-cell-h));
  min-height: 0;
  max-height: none;
}

.pilot-frame__content {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  padding: 12px;
  box-sizing: border-box;
  color: var(--lab-text);
  font-family: var(--lab-font, "Rajdhani", "Monda", system-ui, sans-serif);
}

.pilot-frame__dossier {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-width: 0;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.pilot-frame__portrait {
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
  object-fit: cover;
  object-position: center top;
  border: 1px solid var(--lab-line);
  border-radius: var(--lab-radius, 1px);
  background: var(--lab-slot-bg);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.3),
    0 0 10px rgba(var(--lab-glow-rgb), 0.08);
  box-sizing: border-box;
  image-rendering: auto;
  pointer-events: none;
  user-select: none;
}

.pilot-frame__meta {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  min-width: 0;
}

.pilot-frame__intro {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.pilot-frame__name {
  margin: 0;
  color: var(--lab-text);
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.15;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pilot-frame__faction {
  margin: 0;
  color: var(--lab-accent);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pilot-frame__xp-block {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.pilot-frame__level-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.pilot-frame__level {
  color: var(--lab-accent);
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1;
}

.pilot-frame__xp {
  color: var(--lab-text);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  line-height: 1;
}

.pilot-frame__xp-track {
  position: relative;
  width: 100%;
  height: 6px;
  border: 1px solid var(--lab-line-soft);
  border-radius: 1px;
  background: rgba(6, 12, 18, 0.65);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.3);
  box-sizing: border-box;
  overflow: hidden;
}

.pilot-frame__xp-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 0;
  background: linear-gradient(
    90deg,
    rgba(90, 130, 160, 0.55) 0%,
    rgba(170, 210, 235, 0.85) 55%,
    rgba(210, 235, 250, 0.95) 100%
  );
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: width 0.08s linear;
}

/* ?? Ship dock (control panel; sector chrome TBD) ?? */
#ship-dock {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8px;
  z-index: 8;
  width: min(581px, calc(100vw - 60px));
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
  user-select: none;
}

body.view-sector #ship-panel,
body.view-base #ship-panel {
  display: none;
}

body.view-sector #ship-dock,
body.view-base #ship-dock {
  bottom: 28px;
  width: auto;
  z-index: 12;
}

/* —— Star Map toggle (Glass Lab) —— */
.sector-starmap-btn {
  display: none;
  pointer-events: auto;
  align-items: center;
  justify-content: center;
  min-width: 140px;
  height: 26px;
  /* Same optical pad as .test-lab__btn — Rajdhani caps sit high */
  padding: 4px 16px 1px;
  border: 1px solid var(--lab-line-hot, rgba(183, 213, 230, 0.55));
  border-radius: var(--lab-radius, 2px);
  background: var(--lab-btn-bg, linear-gradient(180deg, rgba(74, 104, 126, 0.32), rgba(28, 40, 51, 0.48)));
  color: var(--lab-accent-strong, #e6eff6);
  font-family: var(--lab-font, "Rajdhani", "Monda", system-ui, sans-serif);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(var(--lab-glow-rgb, 149, 187, 212), 0.06);
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease;
}

body.view-sector .sector-starmap-btn {
  display: inline-flex;
}

.sector-starmap-btn:hover:not(:disabled) {
  border-color: var(--lab-hover-line, rgba(191, 218, 236, 0.75));
  background: var(--lab-btn-bg-hover, linear-gradient(180deg, rgba(88, 118, 140, 0.42), rgba(36, 50, 64, 0.58)));
  color: #fff;
  box-shadow: 0 0 12px rgba(var(--lab-glow-rgb, 149, 187, 212), 0.14);
}

.sector-starmap-btn:active:not(:disabled) {
  background: var(--lab-btn-bg-active, linear-gradient(180deg, rgba(110, 148, 172, 0.5), rgba(48, 72, 92, 0.68)));
}

.sector-starmap-btn.is-active {
  border-color: var(--lab-hover-line, rgba(191, 218, 236, 0.75));
  background: var(--lab-btn-bg-active, linear-gradient(180deg, rgba(110, 148, 172, 0.5), rgba(48, 72, 92, 0.68)));
  color: #fff;
  animation: none;
}

.sector-starmap-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  animation: none;
}

@media (max-width: 480px) {
  .sector-starmap-btn {
    min-width: 0;
    height: 26px;
    padding: 4px 12px 1px;
    font-size: 10px;
    letter-spacing: 0.1em;
  }
}

/* ?? Base / dock hangar ?? */
.base-view {
  position: absolute;
  inset: 0;
  z-index: 4;
  overflow: hidden;
  pointer-events: none;
  background: #010208;
}

.base-view.hidden {
  display: none;
}

.base-view__bg {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  /* Native pixel size ? no stretch; letterbox beyond with vignette */
  image-rendering: auto;
}

.base-view__veil {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 70% 60% at 50% 50%,
    transparent 42%,
    rgba(1, 2, 8, 0.55) 72%,
    rgba(1, 2, 8, 0.92) 100%
  );
  pointer-events: none;
}

.base-view__stage {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 0;
}

.base-view__ship {
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.55));
  animation: dock-ship-idle 5.5s ease-in-out infinite;
}

@keyframes dock-ship-idle {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .base-view__ship {
    animation: none;
  }
}

/* ?? Ship control panel ?? */
#ship-panel {
  position: relative;
  left: auto;
  right: auto;
  bottom: auto;
  z-index: auto;
  width: 100%;
  aspect-ratio: 581 / 148;
  margin-inline: 0;
  /* Avoid translateX(-50%) ? it often paints the panel on half-pixels and blurs borders/icons */
  pointer-events: auto;
  user-select: none;
}

.ship-panel__chrome {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.ship-panel__gauges {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.ship-tick--energy,
.ship-tick--armor,
.ship-tick--health {
  stroke-width: 2;
  stroke-linecap: butt;
  opacity: 0.16;
}

.ship-tick--energy {
  stroke: #0fdbfb;
}

.ship-tick--armor {
  stroke: #c8b06a;
}

.ship-tick--health {
  stroke: #d9ac3e;
}

/* Shield sits on top of armor — keep it translucent so armor reads underneath
   and any shield overhang past armor stays visible. */
.ship-tick--energy.is-on {
  opacity: 0.58;
  filter: drop-shadow(0 0 2px rgba(15, 219, 251, 0.45));
}

.ship-tick--armor.is-on {
  opacity: 1;
  filter: drop-shadow(0 0 2px rgba(200, 176, 106, 0.45));
}

.ship-tick--health.is-on {
  opacity: 1;
  filter: drop-shadow(0 0 2px rgba(217, 172, 62, 0.5));
}

.ship-speed-track {
  fill: none;
  stroke: #1a3241;
  stroke-width: 3;
  stroke-linecap: butt;
  pointer-events: none;
}

.ship-speed-arc {
  fill: none;
  stroke: #4c8096;
  stroke-width: 3;
  stroke-linecap: butt;
  pointer-events: none;
}

.ship-panel__speed {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -58%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  width: 18%;
  color: #4c8096;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 1);
  pointer-events: none;
  line-height: 1;
}

#ship-speed-value {
  font-size: clamp(0.8rem, 2.1vw, 0.95rem);
  font-weight: 700;
  color: #4c8096;
}

.ship-panel__unit {
  margin-top: 0.85em;
  font-size: clamp(0.48rem, 1.25vw, 0.6rem);
  font-weight: 700;
  color: #2e5973;
  letter-spacing: 0.08em;
}

.ship-panel__btn {
  position: absolute;
  /* Invisible hit targets ? exact sector bbox from design SVG */
  top: calc(78.5 / 148 * 100%);
  width: calc(52.819 / 581 * 100%);
  height: calc(50.942 / 148 * 100%);
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
  z-index: 2;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.ship-panel__btn--down {
  left: calc(235.539 / 581 * 100%);
}

.ship-panel__btn--up {
  left: calc(293.5 / 581 * 100%);
}

/* Wing action buttons — design space 581×148, buttons 32×32 gap 5 */
.ship-panel__actions {
  --sp-btn: 32;
  --sp-gap: 5;
  --sp-count: 4;
  --sp-row: calc(var(--sp-btn) * var(--sp-count) + var(--sp-gap) * (var(--sp-count) - 1));

  position: absolute;
  top: calc(83 / 148 * 100%);
  z-index: 3;
  display: flex;
  align-items: stretch;
  width: calc(var(--sp-row) / 581 * 100%);
  height: calc(var(--sp-btn) / 148 * 100%);
  gap: calc(var(--sp-gap) / var(--sp-row) * 100%);
  pointer-events: auto;
}

.ship-panel__actions--left {
  /* First button ~68px, shifted 5px away from center */
  left: calc(65 / 581 * 100%);
}

.ship-panel__actions--right {
  /* Warp · drone · 3 weapon turrets — mirror left block's gap from the dial */
  --sp-count: 5;
  left: calc(373 / 581 * 100%);
}

.ship-panel__action {
  display: grid;
  place-items: center;
  flex: 0 0 calc(var(--sp-btn) / var(--sp-row) * 100%);
  width: calc(var(--sp-btn) / var(--sp-row) * 100%);
  height: 100%;
  padding: 0;
  border: 1px solid #29526c;
  background: linear-gradient(180deg, #192d39 0%, #101e26 100%);
  cursor: pointer;
  box-sizing: border-box;
  outline: none;
  line-height: 0;
  font-size: 0;
  -webkit-tap-highlight-color: transparent;
}

.ship-panel__action:hover,
.ship-panel__action:focus-visible {
  border: 1px solid #34698b;
  background: linear-gradient(180deg, #244153 0%, #193140 100%);
}

.ship-panel__action:active {
  border-color: #599cc7;
}

.ship-panel__action.is-active {
  border-color: #4a9fd4;
  background: linear-gradient(180deg, #244153 0%, #193140 100%);
  box-shadow: inset 0 0 0 1px rgba(74, 159, 212, 0.35);
}

.ship-panel__action:disabled,
.ship-panel__action.is-disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

.ship-panel__action img {
  display: block;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  max-width: none;
  max-height: none;
  object-fit: contain;
  object-position: center;
  pointer-events: none;
  user-select: none;
}

.ship-panel__action--turret {
  overflow: hidden;
}

.ship-panel__action--turret.is-empty {
  opacity: 0.45;
}

.ship-panel__turret-icon {
  width: 22px !important;
  height: 22px !important;
  max-width: 22px !important;
  max-height: 22px !important;
  object-fit: contain;
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.65));
}

.ship-panel__action--turret.is-active .ship-panel__turret-icon {
  filter:
    drop-shadow(0 0 2px rgba(0, 0, 0, 0.65))
    drop-shadow(0 0 4px rgba(90, 190, 255, 0.45));
}

.ship-panel__icon--ship {
  width: 18px;
  height: 17px;
}

/* Stats sit above the cyan midline, same horizontal band as the button rows */
.ship-panel__stats {
  position: absolute;
  top: calc(30 / 148 * 100%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  /* Match action row: 4×32 + 3×5 */
  width: calc(143 / 581 * 100%);
  height: calc(40 / 148 * 100%);
  pointer-events: none;
  font-family: "Monda", sans-serif;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-shadow: 0 1px 1px #000;
  line-height: 1.05;
}

.ship-panel__stats--left {
  /* Same left edge as left buttons; right-align toward gauge */
  left: calc(65 / 581 * 100%);
  text-align: right;
}

.ship-panel__stats--right {
  /* Same left edge as right buttons; left-align toward gauge */
  left: calc(376 / 581 * 100%);
  text-align: left;
}

.ship-panel__stat {
  font-size: clamp(0.58rem, 1.4vw, 0.72rem);
  white-space: nowrap;
}

.ship-panel__stat--shield {
  color: #0fdbfb;
}

.ship-panel__stat--armor {
  color: #c8b06a;
}

.ship-panel__stat--structure {
  color: #d9ac3e;
}

.ship-panel__stat--weapon {
  color: #ffffff;
}

.ship-panel__stat--ammo {
  color: #81aecd;
}

.ship-panel__stat--ammo.is-depleted {
  color: #ff4a4a;
  animation: ship-ammo-depleted 0.7s ease-in-out infinite;
}

@keyframes ship-ammo-depleted {
  0%,
  100% {
    color: #ff2a2a;
    opacity: 1;
    text-shadow:
      0 0 6px rgba(255, 50, 50, 0.85),
      0 1px 1px #000;
  }
  50% {
    color: #ff8a8a;
    opacity: 0.45;
    text-shadow: 0 1px 1px #000;
  }
}

.ship-speed-btn__glow,
.ship-speed-btn__ring {
  opacity: 0;
}

.ship-speed-btn__arrow {
  fill: #4c8096;
}

#ship-panel:has(#ship-speed-up:hover) .ship-speed-btn--up .ship-speed-btn__glow,
#ship-panel:has(#ship-speed-up:focus-visible) .ship-speed-btn--up .ship-speed-btn__glow,
#ship-panel:has(#ship-speed-up:active) .ship-speed-btn--up .ship-speed-btn__glow,
#ship-panel:has(#ship-speed-up:hover) .ship-speed-btn--up .ship-speed-btn__ring,
#ship-panel:has(#ship-speed-up:focus-visible) .ship-speed-btn--up .ship-speed-btn__ring,
#ship-panel:has(#ship-speed-up:active) .ship-speed-btn--up .ship-speed-btn__ring {
  opacity: 1;
}

#ship-panel:has(#ship-speed-up:hover) .ship-speed-btn--up .ship-speed-btn__arrow,
#ship-panel:has(#ship-speed-up:focus-visible) .ship-speed-btn--up .ship-speed-btn__arrow,
#ship-panel:has(#ship-speed-up:active) .ship-speed-btn--up .ship-speed-btn__arrow {
  fill: #0fcfed;
}

#ship-panel:has(#ship-speed-down:hover) .ship-speed-btn--down .ship-speed-btn__glow,
#ship-panel:has(#ship-speed-down:focus-visible) .ship-speed-btn--down .ship-speed-btn__glow,
#ship-panel:has(#ship-speed-down:active) .ship-speed-btn--down .ship-speed-btn__glow,
#ship-panel:has(#ship-speed-down:hover) .ship-speed-btn--down .ship-speed-btn__ring,
#ship-panel:has(#ship-speed-down:focus-visible) .ship-speed-btn--down .ship-speed-btn__ring,
#ship-panel:has(#ship-speed-down:active) .ship-speed-btn--down .ship-speed-btn__ring {
  opacity: 1;
}

#ship-panel:has(#ship-speed-down:hover) .ship-speed-btn--down .ship-speed-btn__arrow,
#ship-panel:has(#ship-speed-down:focus-visible) .ship-speed-btn--down .ship-speed-btn__arrow,
#ship-panel:has(#ship-speed-down:active) .ship-speed-btn--down .ship-speed-btn__arrow {
  fill: #0fcfed;
}

#battle-banner {
  position: absolute;
  top: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 5;
  padding: 0.65rem 1.75rem;
  border: 1px solid rgba(255, 120, 90, 0.55);
  background: rgba(20, 6, 8, 0.82);
  color: #ffc8b8;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-align: center;
  opacity: 1;
  transition: opacity 0.45s ease;
}

#battle-banner.hidden {
  opacity: 0;
  visibility: hidden;
}

#battle-banner.fade {
  opacity: 0;
}

/* —— Prototype notice (logged-in, non-demo) —— */
.prototype-banner {
  position: absolute;
  top: 1.25rem;
  left: 50%;
  z-index: 6;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  max-width: min(520px, calc(100vw - 5.5rem));
  padding: 0.7rem 0.85rem 0.7rem 1rem;
  border: 1px solid rgba(129, 174, 205, 0.45);
  background: rgba(8, 16, 24, 0.9);
  color: #c5dff0;
  transform: translateX(-50%);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.35s ease,
    visibility 0.35s ease;
}

.prototype-banner.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.prototype-banner__text {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: 0.02em;
  text-align: left;
}

.prototype-banner__dismiss {
  flex: 0 0 auto;
  width: 1.5rem;
  height: 1.5rem;
  margin: -0.15rem -0.2rem 0 0;
  padding: 0;
  border: 1px solid transparent;
  background: transparent;
  color: #81aecd;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
}

.prototype-banner__dismiss:hover {
  border-color: #29526c;
  color: #e8f4ff;
}

/* ?? Combat turn timer (bottom-right) ?? */
#turn-timer {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 9;
  width: 88px;
  height: 88px;
  pointer-events: none;
  user-select: none;
  display: grid;
  place-items: center;
}

#turn-timer.hidden {
  display: none;
}

.turn-timer__ring {
  position: absolute;
  inset: 0;
}

.turn-timer__ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.turn-timer__track {
  fill: none;
  stroke: rgba(20, 40, 55, 0.85);
  stroke-width: 5;
}

.turn-timer__arc {
  fill: none;
  stroke: #0fdbfb;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 188.5;
  stroke-dashoffset: 0;
  transition: stroke 0.15s ease;
}

#turn-timer.is-urgent .turn-timer__arc {
  stroke: #ff6b4a;
}

.turn-timer__value {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 1px solid rgba(41, 82, 108, 0.9);
  background: linear-gradient(180deg, rgba(25, 45, 57, 0.95), rgba(10, 20, 28, 0.95));
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35), 0 8px 20px rgba(0, 0, 0, 0.35);
}

#turn-timer-sec {
  color: #e8f6ff;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

#turn-timer.is-urgent #turn-timer-sec {
  color: #ffb09a;
}

.turn-timer__label {
  margin-top: 2px;
  color: #81aecd;
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.16em;
}

/* ?? UI Frame (Ship window) ?? */
/* Design export: panel + corner dots + inset chrome + rule bars */
.ui-frame {
  --frame-fill: rgba(9, 16, 21, 0.9);
  --frame-border: #1a3241;
  --frame-cell-from: #192d39;
  --frame-cell-to: #101e26;
  --frame-cell-border: #29526c;
  --frame-rule: #1e293b;
  --frame-inset: 4px;
  --frame-gap: 3px;
  --frame-cell-h: 26px;
  --frame-tool: 26px;

  position: absolute;
  top: 56px;
  left: 55px;
  z-index: 12;
  width: 288px;
  height: 288px;
  min-width: 240px;
  min-height: 160px;
  pointer-events: auto;
  user-select: none;
  transition:
    top 0.28s ease,
    left 0.28s ease,
    width 0.28s ease,
    height 0.28s ease;
}

.ui-frame.is-dragging,
.ui-frame.is-resizing {
  transition: none;
}

/* Mobile / tablet: full-bleed sheet under the side menu (UiFrame.is-sheet). */
.ui-frame.is-sheet {
  min-width: 0 !important;
  max-width: none !important;
  min-height: 0 !important;
  max-height: none !important;
  transition: none;
}

.ui-frame.is-sheet .ui-frame__resize {
  display: none;
}

/* Fixed frames: never animate height (avoids shrink-from-bottom on open/fit). */
.ui-frame--no-resize {
  transition:
    top 0.28s ease,
    left 0.28s ease;
}

.ui-frame.is-sheet.ui-frame--no-resize {
  transition: none;
}

/* Cascade open position so Scan doesn't cover Ship.
   Compact Glass Lab: locator + Scan + recharge + 5 result rows. */
.ui-frame--scan {
  --scan-row-h: 32px;
  --scan-row-gap: 4px;
  --scan-rows: 5;
  --scan-pad: 12px;
  --scan-btn-h: 26px;
  --scan-cd-h: 28px;
  --scan-banner-h: 120px;
  --scan-list-h: calc(
    var(--scan-row-h) * var(--scan-rows) + var(--scan-row-gap) * (var(--scan-rows) - 1)
  );

  top: 56px;
  left: 58px;
  width: 300px;
  min-width: 300px;
  max-width: 300px;
  /* header 26 + pad*2 + banner + gaps + btn + cd + list */
  height: calc(
    26px + var(--scan-pad) * 2 + var(--scan-banner-h) + var(--scan-pad) + var(--scan-btn-h) +
      var(--scan-pad) + var(--scan-cd-h) + var(--scan-pad) + var(--scan-list-h)
  );
  min-height: 0;
  max-height: none;
}

#scan-frame.is-minimized {
  width: 250px;
  max-width: 250px;
  min-width: 250px;
  height: 26px;
  min-height: 0;
  max-height: none;
}

.scan-frame__content {
  display: flex;
  flex-direction: column;
  gap: var(--scan-pad);
  width: 100%;
  height: 100%;
  padding: var(--scan-pad);
  overflow: hidden;
  box-sizing: border-box;
  color: var(--lab-text);
  font-family: var(--lab-font, "Rajdhani", "Monda", system-ui, sans-serif);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Capsule Glass chrome — shared shell (.test-lab__*). Tokens: themes/capsule-glass.
   Sandbox widgets stay under #test-frame; .ui-frame--test = lab open size / drag.
   ═══════════════════════════════════════════════════════════════════════════ */
.ui-frame--test {
  /* 3×64 slots + 2×10 gaps + content padding */
  width: 320px;
  min-width: 280px;
  height: 640px;
  min-height: 420px;
  left: 70px;
  top: 80px;
  font-family: var(--cg-font, "Rajdhani", "Monda", system-ui, sans-serif);
  /* Position only — size must snap or Engage/content look like they scale */
  transition:
    top 0.28s ease,
    left 0.28s ease;
}

/* Ship lab — compact EVE-style fitting window */
#ship-lab-frame {
  left: 55px;
  top: 56px;
  width: 520px;
  min-width: 440px;
  height: 420px;
  min-height: 360px;
}

/* ── Ship lab content — hull center, rings, stats right ─── */
#ship-lab-frame .ship-lab {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(132px, 148px);
  gap: 10px;
  align-items: stretch;
  height: 100%;
  min-height: 0;
}

#ship-lab-frame .ship-lab__fit-stage {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 6px 8px;
  align-items: center;
  justify-items: center;
  min-width: 0;
  min-height: 0;
  padding: 14px 16px 8px;
  border: 1px solid rgba(90, 160, 200, 0.22);
  background:
    radial-gradient(ellipse 55% 50% at 50% 48%, rgba(40, 90, 130, 0.18), transparent 70%),
    rgba(4, 10, 18, 0.35);
}

#ship-lab-frame .ship-lab__ring {
  display: flex;
  gap: 4px;
  align-items: center;
  justify-content: center;
  position: relative;
}

#ship-lab-frame .ship-lab__ring::before {
  content: attr(data-fit-group);
  position: absolute;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(140, 175, 200, 0.45);
  pointer-events: none;
  white-space: nowrap;
}

#ship-lab-frame .ship-lab__ring--structure::before {
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
}

#ship-lab-frame .ship-lab__ring--defense::before {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  left: -14px;
  top: 50%;
  margin-top: -28px;
}

#ship-lab-frame .ship-lab__ring--weapons::before {
  writing-mode: vertical-rl;
  right: -14px;
  left: auto;
  top: 50%;
  margin-top: -24px;
}

#ship-lab-frame .ship-lab__ring--navigation::before,
#ship-lab-frame .ship-lab__ring--utility::before {
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
}

#ship-lab-frame .ship-lab__ring--structure {
  grid-column: 1 / -1;
  grid-row: 1;
}

#ship-lab-frame .ship-lab__ring--defense {
  grid-column: 1;
  grid-row: 2;
  flex-direction: column;
}

#ship-lab-frame .ship-lab__portrait {
  grid-column: 2;
  grid-row: 2;
  display: grid;
  place-items: center;
  width: 100%;
  min-width: 0;
  min-height: 120px;
  cursor: pointer;
  border-radius: 8px;
  outline: none;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

#ship-lab-frame .ship-lab__portrait:hover,
#ship-lab-frame .ship-lab__portrait:focus-visible {
  background: rgba(90, 160, 200, 0.08);
  box-shadow: inset 0 0 0 1px rgba(120, 180, 220, 0.28);
}

#ship-lab-frame .ship-lab__portrait-img {
  display: block;
  width: min(220px, 100%);
  height: auto;
  max-height: 120px;
  object-fit: contain;
  object-position: center;
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.45));
}

#ship-lab-frame .ship-lab__ring--weapons {
  grid-column: 3;
  grid-row: 2;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
}

#ship-lab-frame .ship-lab__hardpoint {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
}

#ship-lab-frame .ship-lab__ring--navigation {
  grid-column: 1 / -1;
  grid-row: 3;
}

#ship-lab-frame .ship-lab__ring--utility {
  grid-column: 1 / -1;
  grid-row: 4;
}

#ship-lab-frame .ship-lab__slot {
  width: 42px;
  max-width: 42px;
  gap: 0;
}

#ship-lab-frame .ship-lab__slot--ammo {
  width: 32px;
  max-width: 32px;
}

#ship-lab-frame .ship-lab__slot .test-lab__drop-frame {
  width: 42px;
  height: 42px;
}

#ship-lab-frame .ship-lab__slot--ammo .test-lab__drop-frame {
  width: 32px;
  height: 32px;
}

#ship-lab-frame .ship-lab__slot .test-lab__drop-icon {
  width: 32px;
  height: 32px;
}

#ship-lab-frame .ship-lab__slot--ammo .test-lab__drop-icon {
  width: 22px;
  height: 22px;
}

#ship-lab-frame .ship-lab__slot .test-lab__drop-hint {
  font-size: 7px;
  letter-spacing: 0.08em;
  padding: 0 2px;
}

#ship-lab-frame .ship-lab__slot--ammo .test-lab__drop-hint {
  font-size: 6px;
  letter-spacing: 0.06em;
}

#ship-lab-frame .ship-lab__slot .test-lab__drop-name {
  display: none;
}

#ship-lab-frame .ship-lab__slot .test-lab__drop-qty {
  font-size: 8px;
  min-width: 14px;
  padding: 0 3px;
}

#ship-lab-frame .ship-lab__slot--ammo .test-lab__drop-qty {
  font-size: 7px;
}

#ship-lab-frame .ship-lab__side {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: 2px 0 0;
}

#ship-lab-frame .ship-lab__side-intro {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

#ship-lab-frame .ship-lab__name {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #f2f7fb;
  line-height: 1.2;
}

#ship-lab-frame .ship-lab__class {
  margin: 0;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(180, 210, 230, 0.65);
  line-height: 1.3;
}

#ship-lab-frame .ship-lab__stats {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

#ship-lab-frame .ship-lab__stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

#ship-lab-frame .ship-lab__stat--speed {
  flex-direction: row;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

#ship-lab-frame .ship-lab__cargo-btn {
  margin-top: auto;
  width: 100%;
}

/* .ui-frame--test transition beats shared .ui-frame — clear while dragging */
.ui-frame--test.is-dragging,
.ui-frame--test.is-resizing {
  transition: none;
}

/* Animate the shell only — transform/filter on #test-frame breaks backdrop-filter glass. */
.ui-frame.is-frame-enter .ui-frame__chrome.test-lab__shell,
.ui-frame.is-frame-leave .ui-frame__chrome.test-lab__shell {
  opacity: 0;
  transform: translateY(14px) scale(0.96);
  pointer-events: none;
}

.ui-frame.is-frame-leave .ui-frame__chrome.test-lab__shell {
  transition:
    opacity 0.24s ease,
    transform 0.24s ease,
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
}

.ui-frame.is-frame-leave {
  pointer-events: none;
}

.ui-frame .ui-frame__panel,
.ui-frame .ui-frame__corner,
.ui-frame .ui-frame__rule {
  display: none !important;
}

.ui-frame__chrome.test-lab__shell {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 0;
  border: 1px solid var(--lab-line-soft);
  border-radius: var(--lab-radius);
  /* Background stays put — gradient swaps can't interpolate (snap/jerk). */
  background:
    var(--lab-fx),
    linear-gradient(180deg, var(--lab-bg) 0%, var(--lab-bg-2) 100%);
  backdrop-filter: blur(22px) saturate(1.3);
  -webkit-backdrop-filter: blur(22px) saturate(1.3);
  /* Same layer count idle/hover — mismatched shadows flash a glare during transition. */
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.4) inset,
    inset 0 1px 0 rgba(200, 230, 255, 0.08),
    0 18px 40px rgba(0, 0, 0, 0.45);
  overflow: visible;
  transform-origin: top center;
  opacity: 1;
  transform: none;
  transition:
    border-color 0.35s ease,
    box-shadow 0.4s ease,
    opacity 0.26s ease,
    transform 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Smooth fill darken via opacity (not background swap). */
.ui-frame__chrome.test-lab__shell::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  background: linear-gradient(
    180deg,
    rgba(4, 8, 14, 0.42) 0%,
    rgba(4, 8, 14, 0.14) 100%
  );
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease;
}

/* Hover + click-to-select (`.is-selected` holds the hover look until click outside). */
.ui-frame:hover .ui-frame__chrome.test-lab__shell,
.ui-frame.is-selected .ui-frame__chrome.test-lab__shell {
  border-color: var(--lab-line);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.45) inset,
    inset 0 1px 0 rgba(200, 230, 255, 0.1),
    0 20px 44px rgba(0, 0, 0, 0.55);
}

.ui-frame:hover .ui-frame__chrome.test-lab__shell::before,
.ui-frame.is-selected .ui-frame__chrome.test-lab__shell::before {
  opacity: 1;
}

.ui-frame__header.test-lab__bar {
  position: relative;
  z-index: 2;
  flex: 0 0 26px;
  display: grid;
  grid-template-columns: 1fr 26px 26px;
  align-items: stretch;
  gap: 0;
  height: 26px;
  min-height: 26px;
  max-height: 26px;
  margin: 0;
  padding: 0;
  border: none;
  border-bottom: 1px solid var(--lab-line-soft);
  background: var(--lab-bar-bg);
  box-shadow: none;
  overflow: visible;
}

.ui-frame .test-lab__drag {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 0 10px;
  cursor: grab;
  border: none !important;
  background: transparent !important;
}

.ui-frame .test-lab__drag:active {
  cursor: grabbing;
}

.ui-frame__title.test-lab__win-title {
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #ffffff;
  text-shadow: none;
  line-height: 1;
}

.ui-frame__tool.test-lab__tool,
.demo-tutorial__close.test-lab__tool,
.vesper-guide__dismiss.test-lab__tool {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-sizing: border-box;
  width: 26px;
  height: 26px;
  min-width: 26px;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  color: rgba(180, 200, 220, 0.75);
  cursor: pointer;
  line-height: 0;
  isolation: isolate;
  z-index: 2;
  /* Own layer — stays sharp inside backdrop-filter shell */
  transform: translateZ(0);
}

.ui-frame__tool.test-lab__tool:hover,
.demo-tutorial__close.test-lab__tool:hover,
.vesper-guide__dismiss.test-lab__tool:hover {
  background: rgba(var(--lab-glow-rgb), 0.12);
  color: #ffffff;
}

/* Glass tip — frame tools/resize use floating `.glass-tip` (escapes window stacking). */
.ui-frame .test-lab__tool[data-tip]::after,
.ui-frame .test-lab__resize[data-tip]::before {
  content: none !important;
  display: none !important;
}

/* Floating glass tip — menu, items, dock (same chrome + motion as Close / Resize) */
.glass-tip {
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: max-content;
  max-width: min(280px, calc(100vw - 24px));
  /* 1px more top / less bottom — caps sit optically centered in the tip box */
  padding: 4px 9px 4px;
  border: 1px solid var(--lab-line-soft);
  border-radius: 1px;
  background: #060c12;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.35) inset,
    0 8px 18px rgba(0, 0, 0, 0.35);
  color: var(--lab-text);
  font-family: "Rajdhani", "Monda", system-ui, sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
  white-space: normal;
  overflow-wrap: break-word;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition:
    opacity 0.18s ease 0.08s,
    transform 0.18s cubic-bezier(0.22, 1, 0.36, 1) 0.08s,
    visibility 0s linear 0.26s;
}

/* Compact item dossier — hover preview / click inspect for inventory & fitting */
.item-info-pop {
  position: fixed;
  z-index: 10010;
  left: 0;
  top: 0;
  box-sizing: border-box;
  width: min(280px, calc(100vw - 24px));
  padding: 12px 12px 11px;
  border: 1px solid rgba(90, 160, 200, 0.4);
  border-radius: 2px;
  background:
    linear-gradient(165deg, rgba(18, 36, 54, 0.92) 0%, rgba(6, 12, 22, 0.96) 55%, rgba(4, 10, 18, 0.98) 100%);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.45) inset,
    0 14px 32px rgba(0, 0, 0, 0.45);
  color: #d8e6f0;
  font-family: "Monda", system-ui, sans-serif;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition:
    opacity 0.16s ease,
    transform 0.18s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear 0.2s;
}

.item-info-pop.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition-delay: 0s;
}

.item-info-pop.is-pinned {
  pointer-events: auto;
  border-color: rgba(120, 200, 230, 0.55);
}

.item-info-pop__head {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.item-info-pop__icon-wrap {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(90, 160, 200, 0.35);
  background: rgba(4, 10, 18, 0.75);
}

.item-info-pop__icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.item-info-pop__titles {
  min-width: 0;
}

.item-info-pop__name {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #f2f7fb;
  line-height: 1.2;
}

.item-info-pop__type {
  margin-top: 3px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(180, 210, 230, 0.7);
}

.item-info-pop__stats {
  display: grid;
  gap: 4px;
  margin: 0 0 10px;
}

.item-info-pop__stat {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 8px;
  align-items: baseline;
}

.item-info-pop__stat dt {
  margin: 0;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(140, 175, 200, 0.65);
}

.item-info-pop__stat dd {
  margin: 0;
  font-size: 11px;
  color: #e4eef6;
  line-height: 1.25;
}

.item-info-pop__desc {
  margin: 0;
  padding-top: 8px;
  border-top: 1px solid rgba(90, 160, 200, 0.22);
  font-size: 11px;
  line-height: 1.4;
  color: rgba(200, 220, 235, 0.82);
}

.item-info-pop__combat {
  margin: 0 0 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(90, 160, 200, 0.22);
}

.item-info-pop__combat[hidden] {
  display: none;
}

.item-info-pop__combat-title {
  margin: 0 0 6px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(140, 175, 200, 0.7);
}

.item-info-pop__stats--combat {
  margin-bottom: 0;
}

.item-info-pop__combat .item-info-pop__stat dd {
  color: #9fd4f0;
}

.item-info-pop__range,
.resource-info__range {
  margin-top: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(180, 210, 230, 0.78);
}

.weapon-range__sep {
  margin: 0 1px;
  color: rgba(160, 190, 210, 0.55);
}

.weapon-range__min {
  color: #e8a040;
  font-weight: 700;
}

.weapon-range__opt {
  color: #5fd68a;
  font-weight: 700;
}

.weapon-range__max {
  color: #5eb0e0;
  font-weight: 700;
}

.item-info-pop__panel[hidden] {
  display: none;
}

.item-info-pop__icon-wrap--ship {
  width: 72px;
  height: 40px;
}

.item-info-pop__icon--ship {
  width: 64px;
  height: 32px;
  object-fit: contain;
}

/* Combat hover — hostile hull readout anchored near the sprite */
.enemy-info-pop {
  position: fixed;
  z-index: 10005;
  left: 0;
  top: 0;
  box-sizing: border-box;
  width: min(220px, calc(100vw - 24px));
  padding: 10px 11px 9px;
  border: 1px solid rgba(200, 90, 70, 0.45);
  border-radius: 2px;
  background:
    linear-gradient(165deg, rgba(42, 18, 18, 0.92) 0%, rgba(14, 8, 10, 0.96) 55%, rgba(8, 4, 6, 0.98) 100%);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.45) inset,
    0 12px 28px rgba(0, 0, 0, 0.5);
  color: #f0ddd8;
  font-family: "Monda", system-ui, sans-serif;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(5px);
  transition:
    opacity 0.14s ease,
    transform 0.16s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear 0.16s;
}

.enemy-info-pop.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition-delay: 0s;
}

.enemy-info-pop__head {
  display: flex;
  gap: 9px;
  align-items: center;
  margin-bottom: 8px;
}

.enemy-info-pop__icon-wrap {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(220, 110, 80, 0.4);
  background: rgba(10, 4, 6, 0.8);
}

.enemy-info-pop__icon {
  width: 40px;
  height: 40px;
  object-fit: contain;
  filter: drop-shadow(0 0 6px rgba(255, 80, 60, 0.35));
}

.enemy-info-pop__titles {
  min-width: 0;
}

.enemy-info-pop__name {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #ffe8e0;
  line-height: 1.2;
}

.enemy-info-pop__type {
  margin-top: 3px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(230, 160, 140, 0.75);
}

.enemy-info-pop__stats {
  display: grid;
  gap: 3px;
  margin: 0;
}

.enemy-info-pop__stat {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.enemy-info-pop__stat dt {
  margin: 0;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(210, 170, 160, 0.7);
}

.enemy-info-pop__stat dd {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #ffc8b8;
}

.glass-tip[data-tip-side="above"] {
  transform: translateY(-6px);
}

.glass-tip[data-tip-side="right"] {
  transform: translateX(-6px);
}

.glass-tip[data-tip-side="below"] {
  transform: translateY(6px);
}

.glass-tip.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(0, 0);
  transition:
    opacity 0.18s ease 0.08s,
    transform 0.18s cubic-bezier(0.22, 1, 0.36, 1) 0.08s,
    visibility 0s linear 0s;
}

.ui-frame .test-lab__tool-min,
.ui-frame .test-lab__tool-close,
.ui-frame .test-lab__tool-restore,
.demo-tutorial__close .test-lab__tool-close,
.vesper-guide__dismiss .test-lab__tool-close {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 10px;
  width: 10px;
  height: 10px;
  margin: 0;
  padding: 0;
  position: relative;
  color: inherit;
  line-height: 0;
  pointer-events: none;
  /* Optical center — SVG glyphs read ~1px low in the 26px tool hit area */
  transform: translateY(-1px);
}

.ui-frame .test-lab__tool-min svg,
.ui-frame .test-lab__tool-close svg,
.ui-frame .test-lab__tool-restore svg,
.demo-tutorial__close .test-lab__tool-close svg,
.vesper-guide__dismiss .test-lab__tool-close svg {
  display: block;
  width: 10px;
  height: 10px;
  overflow: hidden;
  flex-shrink: 0;
  pointer-events: none;
  shape-rendering: geometricPrecision;
}

/* Expand glyph — same SVG stroke language as min/close */
.ui-frame .test-lab__tool-restore {
  display: none;
}

.ui-frame .ui-frame__icon-min,
.ui-frame .ui-frame__icon-close,
.ui-frame .ui-frame__icon-grid,
.ui-frame .ui-frame__icon-restore {
  display: none !important;
}

.ui-frame.is-minimized .test-lab__tool-min {
  display: none;
}

.ui-frame.is-minimized .test-lab__tool-restore {
  display: flex;
}

.ui-frame:not(.is-minimized) .test-lab__tool-restore {
  display: none;
}

.ui-frame__body.test-lab__body {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  margin: 0;
  /* Clear resize grip — scrollbar lives in content above this pad */
  padding: 0 4px 12px 0;
  border: none;
  background: transparent;
}

.ui-frame--no-resize .ui-frame__body.test-lab__body {
  padding-bottom: 0;
}

.ui-frame--test .test-lab__content,
.ui-frame--test .test-frame__content {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  padding: 14px 12px 12px 16px;
  overflow: auto;
  box-sizing: border-box;
  color: var(--lab-text);
}

.ui-frame--test .test-lab__brief {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  min-width: 0;
  padding: 12px 12px 11px;
  box-sizing: border-box;
  border: 1px solid var(--lab-line-soft);
  border-radius: var(--lab-radius);
  background: var(--lab-brief-bg);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(200, 230, 255, 0.05);
}

.ui-frame--test .test-lab__intro {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ui-frame--test .test-lab__title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.15;
  text-transform: uppercase;
  color: var(--lab-text);
}

.ui-frame--test .test-lab__subtitle {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--lab-accent);
}

.ui-frame--test .test-lab__desc {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--lab-muted);
}

#test-frame .test-lab__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  min-width: 0;
}

#ship-lab-frame .test-lab__label,
#test-frame .test-lab__label,
#workshop-frame .test-lab__label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--lab-accent);
  line-height: 1;
}

#test-frame .test-lab__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  width: 100%;
  min-width: 0;
}

#test-frame .test-lab__row--btns {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

#test-frame .test-lab__search,
#cargo-frame .test-lab__search,
#warehouse-frame .test-lab__search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 26px;
  min-height: 26px;
  padding: 0 4px 0 9px;
  border: 1px solid var(--lab-line-soft);
  border-radius: 1px;
  background: var(--lab-input-bg);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.28);
  color: var(--lab-muted);
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    color 0.2s ease;
}

#test-frame .test-lab__search:focus-within,
#cargo-frame .test-lab__search:focus-within,
#warehouse-frame .test-lab__search:focus-within {
  border-color: var(--lab-line);
  background: rgba(8, 14, 22, 0.72);
  color: var(--lab-accent-strong);
}

#test-frame .test-lab__search-icon,
#cargo-frame .test-lab__search-icon,
#warehouse-frame .test-lab__search-icon {
  flex: 0 0 auto;
  display: block;
  opacity: 0.75;
}

#test-frame .test-lab__search-input,
#cargo-frame .test-lab__search-input,
#warehouse-frame .test-lab__search-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  margin: 0;
  padding: 0;
  border: none;
  outline: none;
  background: transparent;
  color: var(--lab-text);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

#test-frame .test-lab__search-input::placeholder,
#cargo-frame .test-lab__search-input::placeholder,
#warehouse-frame .test-lab__search-input::placeholder {
  color: rgba(170, 183, 195, 0.45);
  text-transform: uppercase;
}

#test-frame .test-lab__search-input::-webkit-search-cancel-button,
#cargo-frame .test-lab__search-input::-webkit-search-cancel-button,
#warehouse-frame .test-lab__search-input::-webkit-search-cancel-button {
  appearance: none;
}

#test-frame .test-lab__search-clear,
#cargo-frame .test-lab__search-clear,
#warehouse-frame .test-lab__search-clear {
  display: inline-flex;
  flex: 0 0 18px;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 1px;
  background: transparent;
  color: var(--lab-muted);
  cursor: pointer;
  line-height: 0;
  transition:
    color 0.15s ease,
    background 0.15s ease;
}

#test-frame .test-lab__search-clear[hidden],
#cargo-frame .test-lab__search-clear[hidden],
#warehouse-frame .test-lab__search-clear[hidden] {
  display: none;
}

#test-frame .test-lab__search-clear:hover,
#cargo-frame .test-lab__search-clear:hover,
#warehouse-frame .test-lab__search-clear:hover {
  color: #fff;
  background: rgba(var(--lab-glow-rgb), 0.14);
}

#test-frame .test-lab__search-clear svg,
#cargo-frame .test-lab__search-clear svg,
#warehouse-frame .test-lab__search-clear svg {
  display: block;
  width: 10px;
  height: 10px;
  pointer-events: none;
}

.ui-frame--test .test-lab__dropdown,
#cargo-frame .test-lab__dropdown,
#warehouse-frame .test-lab__dropdown {
  position: relative;
  width: 100%;
  z-index: 4;
}

.ui-frame--test .test-lab__dropdown-btn,
#cargo-frame .test-lab__dropdown-btn,
#warehouse-frame .test-lab__dropdown-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  height: 26px;
  min-height: 26px;
  padding: 0 8px 0 10px;
  border: 1px solid var(--lab-line-soft);
  border-radius: 1px;
  background: var(--lab-input-bg);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.28);
  color: var(--lab-text);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    color 0.2s ease;
}

.ui-frame--test .test-lab__dropdown-btn:hover,
.ui-frame--test .test-lab__dropdown.is-open .test-lab__dropdown-btn,
#cargo-frame .test-lab__dropdown-btn:hover,
#warehouse-frame .test-lab__dropdown-btn:hover,
#cargo-frame .test-lab__dropdown.is-open .test-lab__dropdown-btn,
#warehouse-frame .test-lab__dropdown.is-open .test-lab__dropdown-btn {
  border-color: var(--lab-line);
  background: rgba(8, 14, 22, 0.72);
  color: #fff;
}

.ui-frame--test .test-lab__dropdown-value,
#cargo-frame .test-lab__dropdown-value,
#warehouse-frame .test-lab__dropdown-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ui-frame--test .test-lab__dropdown-chevron,
#cargo-frame .test-lab__dropdown-chevron,
#warehouse-frame .test-lab__dropdown-chevron {
  flex: 0 0 auto;
  width: 0;
  height: 0;
  border-left: 3.5px solid transparent;
  border-right: 3.5px solid transparent;
  border-top: 4px solid currentColor;
  opacity: 0.7;
  transition: transform 0.2s ease;
}

.ui-frame--test .test-lab__dropdown.is-open .test-lab__dropdown-chevron,
#cargo-frame .test-lab__dropdown.is-open .test-lab__dropdown-chevron,
#warehouse-frame .test-lab__dropdown.is-open .test-lab__dropdown-chevron {
  transform: rotate(180deg);
}

.ui-frame--test .test-lab__dropdown-menu,
#cargo-frame .test-lab__dropdown-menu,
#warehouse-frame .test-lab__dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 8;
  margin: 0;
  padding: 3px;
  list-style: none;
  border: 1px solid var(--lab-line);
  border-radius: 1px;
  background: rgba(6, 12, 18, 0.96);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.4),
    0 12px 28px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
}

.ui-frame--test .test-lab__dropdown-menu[hidden],
#cargo-frame .test-lab__dropdown-menu[hidden],
#warehouse-frame .test-lab__dropdown-menu[hidden] {
  display: none;
}

.ui-frame--test .test-lab__dropdown-menu li,
#cargo-frame .test-lab__dropdown-menu li,
#warehouse-frame .test-lab__dropdown-menu li {
  display: flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 1px;
  color: var(--lab-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    background 0.12s ease,
    color 0.12s ease;
}

.ui-frame--test .test-lab__dropdown-menu li:hover,
.ui-frame--test .test-lab__dropdown-menu li[aria-selected="true"],
#cargo-frame .test-lab__dropdown-menu li:hover,
#warehouse-frame .test-lab__dropdown-menu li:hover,
#cargo-frame .test-lab__dropdown-menu li[aria-selected="true"],
#warehouse-frame .test-lab__dropdown-menu li[aria-selected="true"] {
  background: rgba(var(--lab-glow-rgb), 0.12);
  color: #fff;
}

#test-frame .test-lab__check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  cursor: pointer;
  user-select: none;
  color: var(--lab-muted);
}

#test-frame .test-lab__check-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

#test-frame .test-lab__check-box {
  position: relative;
  box-sizing: border-box;
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  border: 1px solid var(--lab-line);
  border-radius: 1px;
  background: rgba(6, 12, 18, 0.6);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.3);
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
}

#test-frame .test-lab__check-box::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 1px;
  width: 5px;
  height: 8px;
  border-right: 1.5px solid #fff;
  border-bottom: 1.5px solid #fff;
  transform: rotate(40deg) scale(0.6);
  opacity: 0;
  transition:
    opacity 0.15s ease,
    transform 0.15s ease;
}

#test-frame .test-lab__check-input:checked + .test-lab__check-box {
  border-color: var(--lab-line-hot);
  background: rgba(var(--lab-glow-rgb), 0.22);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.25),
    0 0 8px rgba(var(--lab-glow-rgb), 0.12);
}

#test-frame .test-lab__check-input:checked + .test-lab__check-box::after {
  opacity: 1;
  transform: rotate(40deg) scale(1);
}

#test-frame .test-lab__check:hover .test-lab__check-box {
  border-color: var(--lab-hover-line);
}

#test-frame .test-lab__check:hover .test-lab__check-text,
#test-frame .test-lab__check-input:checked ~ .test-lab__check-text {
  color: var(--lab-text);
}

#test-frame .test-lab__check-text {
  margin: 0;
  padding: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  line-height: 1;
  text-transform: uppercase;
  /* Descender space in the em-box lifts caps above the control — nudge down */
  transform: translateY(2px);
  transition: color 0.15s ease;
}

#test-frame .test-lab__switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  cursor: pointer;
  user-select: none;
  color: var(--lab-muted);
}

#test-frame .test-lab__switch-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

#test-frame .test-lab__switch-text {
  margin: 0;
  padding: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  line-height: 1;
  text-transform: uppercase;
  transform: translateY(2px);
  transition: color 0.15s ease;
}

#test-frame .test-lab__switch-track {
  position: relative;
  box-sizing: border-box;
  flex: 0 0 auto;
  width: 34px;
  height: 16px;
  border: 1px solid var(--lab-line-soft);
  border-radius: 1px;
  background: rgba(6, 12, 18, 0.65);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.3);
  transition:
    border-color 0.25s ease,
    background 0.25s ease,
    box-shadow 0.25s ease;
}

#test-frame .test-lab__switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 10px;
  height: 10px;
  border-radius: 1px;
  background: rgba(180, 200, 220, 0.55);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  transition:
    left 0.25s ease,
    background 0.25s ease,
    box-shadow 0.25s ease;
}

#test-frame .test-lab__switch-input:checked + .test-lab__switch-track {
  border-color: var(--lab-line-hot);
  background: rgba(var(--lab-glow-rgb), 0.2);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.25),
    0 0 10px rgba(var(--lab-glow-rgb), 0.12);
}

#test-frame .test-lab__switch-input:checked + .test-lab__switch-track .test-lab__switch-thumb {
  left: 20px;
  background: #e8f2fa;
  box-shadow: 0 0 8px rgba(var(--lab-glow-rgb), 0.35);
}

#test-frame .test-lab__switch:hover .test-lab__switch-track {
  border-color: var(--lab-line);
}

#test-frame .test-lab__switch:hover .test-lab__switch-text,
#test-frame .test-lab__switch:has(.test-lab__switch-input:checked) .test-lab__switch-text {
  color: var(--lab-text);
}

.ui-frame--test .test-lab__drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 64px;
  max-width: 64px;
  cursor: copy;
  outline: none;
}

.ui-frame--test .test-lab__drop.is-filled {
  cursor: grab;
}

.ui-frame--test .test-lab__drop.is-dragging {
  opacity: 0.45;
  cursor: grabbing;
}

.ui-frame--test .test-lab__drop.is-assign-target .test-lab__drop-frame {
  border-color: var(--lab-hover-line);
  box-shadow:
    inset 0 0 0 1px rgba(var(--lab-glow-rgb), 0.35),
    0 0 12px rgba(var(--lab-glow-rgb), 0.22);
}

.ui-frame--test.is-assign-mode .test-lab__drop:not(.is-assign-target) {
  opacity: 0.4;
}

.ui-frame--test .test-lab__drop-frame {
  position: relative;
  width: 64px;
  height: 64px;
  padding: 0;
  box-sizing: border-box;
  border: 1px dashed var(--lab-line);
  border-radius: 1px;
  background: rgba(6, 12, 18, 0.4);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
}

.ui-frame--test .test-lab__drop:not(.is-filled):hover .test-lab__drop-frame,
.ui-frame--test .test-lab__drop:not(.is-filled):focus-visible .test-lab__drop-frame {
  border-color: var(--lab-hover-line);
  background: rgba(12, 20, 30, 0.55);
}

.ui-frame--test .test-lab__drop.is-dragover .test-lab__drop-frame {
  border-style: solid;
  border-color: var(--lab-line-hot);
  background: rgba(var(--lab-glow-rgb), 0.14);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.2),
    0 0 14px rgba(var(--lab-glow-rgb), 0.2);
}

/* Filled = same chrome as inventory item slot */
.ui-frame--test .test-lab__drop.is-filled .test-lab__drop-frame {
  border-style: solid;
  border-color: var(--lab-line);
  background: var(--lab-slot-bg);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.3),
    0 0 10px rgba(var(--lab-glow-rgb), 0.08);
}

.ui-frame--test .test-lab__drop.is-filled:hover .test-lab__drop-frame {
  border-color: var(--lab-hover-line);
  background: var(--lab-slot-bg-hover);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.25),
    0 0 12px rgba(var(--lab-glow-rgb), 0.18);
}

.ui-frame--test .test-lab__drop-glow {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(
    ellipse 70% 70% at 50% 45%,
    rgba(var(--lab-glow-rgb), 0.14),
    transparent 70%
  );
}

.ui-frame--test .test-lab__drop.is-filled .test-lab__drop-glow {
  display: block;
}

.ui-frame--test .test-lab__drop-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
  color: rgba(170, 183, 195, 0.55);
  pointer-events: none;
  /* Caps glyph box sits high in Rajdhani — nudge to optical center */
  transform: translateY(1px);
}

.ui-frame--test .test-lab__drop.is-filled .test-lab__drop-hint {
  display: none;
}

.ui-frame--test .test-lab__drop-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  display: block;
  width: 58px;
  height: 58px;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  transform: translate(-50%, -50%) scale(1);
  transform-origin: center center;
  object-fit: contain;
  object-position: center;
  image-rendering: auto;
  pointer-events: none;
  user-select: none;
  transition: transform 0.18s ease;
}

.ui-frame--test .test-lab__drop.is-filled:hover .test-lab__drop-icon {
  transform: translate(-50%, -50%) scale(0.9);
}

.ui-frame--test .test-lab__drop-icon[hidden] {
  display: none;
}

.ui-frame--test .test-lab__drop-qty {
  position: absolute;
  right: 3px;
  bottom: 2px;
  z-index: 2;
  margin: 0;
  padding: 0 2px;
  min-width: 0;
  text-align: right;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.1;
  color: var(--lab-accent-strong);
  text-shadow:
    0 0 3px rgba(0, 0, 0, 0.95),
    0 1px 2px rgba(0, 0, 0, 0.9);
  pointer-events: none;
}

.ui-frame--test .test-lab__drop-qty[hidden] {
  display: none;
}

.ui-frame--test .test-lab__drop-name {
  width: 100%;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.25;
  text-align: center;
  text-transform: uppercase;
  color: var(--lab-muted);
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
  transition: color 0.15s ease;
}

.ui-frame--test .test-lab__drop.is-filled:hover .test-lab__drop-name {
  color: #ffffff;
}

#ship-lab-frame .test-lab__progress-head,
#test-frame .test-lab__progress-head,
#workshop-frame .test-lab__progress-head,
#workshop-frame .workshop-frame__progress-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

#ship-lab-frame .test-lab__progress-val,
#test-frame .test-lab__progress-val,
#workshop-frame .test-lab__progress-val,
#workshop-frame .workshop-frame__timer {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--lab-text);
  font-variant-numeric: tabular-nums;
}

#ship-lab-frame .test-lab__progress,
#test-frame .test-lab__progress,
#workshop-frame .test-lab__progress,
#workshop-frame .workshop-frame__progress {
  position: relative;
  width: 100%;
  height: 8px;
  border: 1px solid var(--lab-line-soft);
  border-radius: 1px;
  background: rgba(6, 12, 18, 0.65);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

#ship-lab-frame .test-lab__progress-fill,
#test-frame .test-lab__progress-fill,
#workshop-frame .test-lab__progress-fill,
#workshop-frame .workshop-frame__progress-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 0;
  background: linear-gradient(
    90deg,
    rgba(90, 130, 160, 0.55) 0%,
    rgba(170, 210, 235, 0.85) 55%,
    rgba(210, 235, 250, 0.95) 100%
  );
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: width 0.08s linear;
}

#ship-lab-frame .test-lab__progress-fill--armor {
  background: linear-gradient(
    90deg,
    rgba(140, 110, 50, 0.55) 0%,
    rgba(200, 170, 90, 0.85) 55%,
    rgba(230, 205, 130, 0.95) 100%
  );
}

.ui-frame--test .test-lab__slots {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
}

#test-frame .test-lab__slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 64px;
  flex: 0 0 64px;
  max-width: 64px;
  cursor: grab;
}

#test-frame .test-lab__slot.is-dragging {
  opacity: 0.45;
  cursor: grabbing;
}

#test-frame .test-lab__slot-frame {
  position: relative;
  width: 64px;
  height: 64px;
  padding: 0;
  box-sizing: border-box;
  border: 1px solid var(--lab-line);
  border-radius: 1px;
  background: var(--lab-slot-bg);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.3),
    0 0 10px rgba(var(--lab-glow-rgb), 0.08);
  overflow: hidden;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
}

#test-frame .test-lab__slot:hover .test-lab__slot-frame {
  border-color: var(--lab-hover-line);
  background: var(--lab-slot-bg-hover);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.25),
    0 0 12px rgba(var(--lab-glow-rgb), 0.18);
}

#test-frame .test-lab__slot-glow {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(
    ellipse 70% 70% at 50% 45%,
    rgba(var(--lab-glow-rgb), 0.14),
    transparent 70%
  );
}

#test-frame .test-lab__slot-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  display: block;
  width: 58px;
  height: 58px;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  transform: translate(-50%, -50%) scale(1);
  transform-origin: center center;
  object-fit: contain;
  object-position: center;
  image-rendering: auto;
  pointer-events: none;
  user-select: none;
  transition: transform 0.18s ease;
}

#test-frame .test-lab__slot:hover .test-lab__slot-icon {
  transform: translate(-50%, -50%) scale(0.9);
}

#test-frame .test-lab__slot-qty {
  position: absolute;
  right: 3px;
  bottom: 2px;
  z-index: 2;
  margin: 0;
  padding: 0 2px;
  min-width: 0;
  text-align: right;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.1;
  color: var(--lab-accent-strong);
  text-shadow:
    0 0 3px rgba(0, 0, 0, 0.95),
    0 1px 2px rgba(0, 0, 0, 0.9);
  pointer-events: none;
}

#test-frame .test-lab__slot-name {
  width: 100%;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.25;
  text-align: center;
  text-transform: uppercase;
  color: var(--lab-muted);
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
  transition: color 0.15s ease;
}

#test-frame .test-lab__slot:hover .test-lab__slot-name {
  color: #ffffff;
}

#ship-lab-frame .test-lab__btn,
#test-frame .test-lab__btn,
#cargo-frame .test-lab__btn,
#warehouse-frame .test-lab__btn,
#workshop-frame .test-lab__btn,
#scan-frame .test-lab__btn,
.demo-tutorial__btn.test-lab__btn,
.vesper-guide__btn.test-lab__btn,
.sector-node-modal__jump.test-lab__btn {
  margin-top: 0;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 26px;
  min-height: 26px;
  max-height: 26px;
  box-sizing: border-box;
  /* Asymmetric pad — Rajdhani caps sit high in the em-box (no transform: keeps glyphs sharp) */
  padding: 4px 12px 1px;
  border: 1px solid var(--lab-line-hot);
  border-radius: 1px;
  background: var(--lab-btn-bg);
  color: var(--lab-accent-strong);
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(var(--lab-glow-rgb), 0.06);
  transform: none;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease,
    opacity 0.15s ease;
}

#ship-lab-frame .test-lab__btn--inline,
#test-frame .test-lab__btn--inline,
.demo-tutorial__btn.test-lab__btn--inline,
.vesper-guide__btn.test-lab__btn--inline {
  width: auto;
  min-width: 0;
}

#ship-lab-frame .test-lab__btn-label,
#test-frame .test-lab__btn-label,
#cargo-frame .test-lab__btn-label,
#warehouse-frame .test-lab__btn-label,
#workshop-frame .test-lab__btn-label,
#scan-frame .test-lab__btn-label,
.demo-tutorial__btn .test-lab__btn-label,
.vesper-guide__btn .test-lab__btn-label,
.sector-node-modal__jump .test-lab__btn-label {
  display: block;
  margin: 0;
  padding: 0;
  font-weight: 500;
  line-height: 1;
  transform: none;
}

#ship-lab-frame .test-lab__btn:hover:not(:disabled):not(.is-active),
#test-frame .test-lab__btn:hover:not(:disabled):not(.is-active),
#cargo-frame .test-lab__btn:hover:not(:disabled):not(.is-active),
#warehouse-frame .test-lab__btn:hover:not(:disabled):not(.is-active),
#workshop-frame .test-lab__btn:hover:not(:disabled):not(.is-active),
#scan-frame .test-lab__btn:hover:not(:disabled):not(.is-active),
.demo-tutorial__btn.test-lab__btn:hover:not(:disabled):not(.is-active),
.vesper-guide__btn.test-lab__btn:hover:not(:disabled):not(.is-active),
.sector-node-modal__jump.test-lab__btn:hover:not(:disabled):not(.is-active) {
  border-color: var(--lab-hover-line);
  background: var(--lab-btn-bg-hover);
  color: #fff;
  box-shadow: 0 0 12px rgba(var(--lab-glow-rgb), 0.18);
}

/* Avoid filter on :active — it reflows glyphs and makes the button "jump" */
#ship-lab-frame .test-lab__btn:active:not(:disabled),
#test-frame .test-lab__btn:active:not(:disabled),
#cargo-frame .test-lab__btn:active:not(:disabled),
#warehouse-frame .test-lab__btn:active:not(:disabled),
#workshop-frame .test-lab__btn:active:not(:disabled),
#scan-frame .test-lab__btn:active:not(:disabled),
.demo-tutorial__btn.test-lab__btn:active:not(:disabled),
.vesper-guide__btn.test-lab__btn:active:not(:disabled),
.sector-node-modal__jump.test-lab__btn:active:not(:disabled) {
  filter: none;
  background: linear-gradient(
    180deg,
    rgba(64, 92, 112, 0.42) 0%,
    rgba(24, 36, 48, 0.62) 100%
  );
  box-shadow: 0 0 8px rgba(var(--lab-glow-rgb), 0.1);
}

#ship-lab-frame .test-lab__btn.is-active:not(:disabled),
#test-frame .test-lab__btn.is-active:not(:disabled),
.demo-tutorial__btn.test-lab__btn.is-active:not(:disabled),
.vesper-guide__btn.test-lab__btn.is-active:not(:disabled) {
  border-color: var(--lab-hover-line);
  background: linear-gradient(
    180deg,
    rgba(110, 148, 172, 0.5) 0%,
    rgba(48, 72, 92, 0.68) 100%
  );
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 0 12px rgba(var(--lab-glow-rgb), 0.22);
}

#ship-lab-frame .test-lab__btn.is-active:active:not(:disabled),
#test-frame .test-lab__btn.is-active:active:not(:disabled),
.demo-tutorial__btn.test-lab__btn.is-active:active:not(:disabled),
.vesper-guide__btn.test-lab__btn.is-active:active:not(:disabled) {
  filter: none;
  background: linear-gradient(
    180deg,
    rgba(96, 130, 152, 0.48) 0%,
    rgba(40, 60, 78, 0.72) 100%
  );
}

#ship-lab-frame .test-lab__btn.is-active:hover:not(:disabled),
#test-frame .test-lab__btn.is-active:hover:not(:disabled),
.demo-tutorial__btn.test-lab__btn.is-active:hover:not(:disabled),
.vesper-guide__btn.test-lab__btn.is-active:hover:not(:disabled) {
  border-color: rgba(210, 230, 245, 0.85);
  background: linear-gradient(
    180deg,
    rgba(128, 164, 188, 0.58) 0%,
    rgba(56, 82, 104, 0.74) 100%
  );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 0 14px rgba(var(--lab-glow-rgb), 0.28);
}

#ship-lab-frame .test-lab__btn:disabled,
#cargo-frame .test-lab__btn:disabled,
#warehouse-frame .test-lab__btn:disabled,
#workshop-frame .test-lab__btn:disabled,
#scan-frame .test-lab__btn:disabled,
#test-frame .test-lab__btn:disabled,
.demo-tutorial__btn.test-lab__btn:disabled,
.vesper-guide__btn.test-lab__btn:disabled,
.sector-node-modal__jump.test-lab__btn:disabled {
  border-color: rgba(164, 194, 214, 0.14);
  background: rgba(10, 16, 24, 0.35);
  color: rgba(170, 183, 195, 0.38);
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.72;
  filter: grayscale(0.25);
}


.ui-frame__resize.test-lab__resize {
  z-index: 5;
  width: 10px;
  height: 10px;
  overflow: visible;
  border: none;
  background:
    linear-gradient(135deg, transparent 50%, rgba(var(--lab-glow-rgb), 0.65) 50%) bottom right / 5px 5px
      no-repeat;
  opacity: 0.5;
}

.ui-frame__resize.test-lab__resize:hover {
  opacity: 0.9;
}

.ui-frame__resize.test-lab__resize img {
  display: none;
}

.ui-frame--test.is-minimized {
  width: 250px !important;
  max-width: 250px;
  min-width: 250px !important;
  height: 26px !important;
  min-height: 26px !important;
  max-height: 26px !important;
  transition:
    top 0.28s ease,
    left 0.28s ease;
}

.ui-frame.is-minimized .ui-frame__chrome.test-lab__shell {
  border-radius: var(--lab-radius);
  opacity: 1 !important;
  transform: none !important;
  overflow: visible;
  transition:
    border-color 0.35s ease,
    box-shadow 0.4s ease;
}

.ui-frame.is-minimized .ui-frame__header.test-lab__bar {
  flex: 0 0 26px;
  height: 26px !important;
  min-height: 26px !important;
  max-height: 26px !important;
  border: none !important;
  border-bottom: none !important;
  background: var(--lab-bar-bg) !important;
}

.ui-frame.is-minimized .ui-frame__tool.test-lab__tool {
  width: 26px !important;
  height: 26px !important;
  min-width: 26px !important;
  max-width: 26px;
  flex: 0 0 26px;
  border: none !important;
}

.ui-frame--test.is-minimized .test-lab__body,
.ui-frame--test.is-minimized .test-lab__content,
.ui-frame--test.is-minimized .test-lab__btn,
.ui-frame--test.is-minimized .test-lab__resize {
  display: none !important;
  transform: none !important;
}

.ui-frame.is-sheet .ui-frame__chrome.test-lab__shell {
  border-radius: 0;
}

.scan-frame__banner {
  position: relative;
  flex: 0 0 var(--scan-banner-h);
  width: 100%;
  height: var(--scan-banner-h);
  overflow: hidden;
  border: 1px solid var(--lab-line-soft);
  border-radius: var(--lab-radius, 1px);
  background:
    radial-gradient(60% 70% at 50% 55%, rgba(var(--lab-glow-rgb), 0.14), transparent 70%),
    var(--lab-brief-bg);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(200, 230, 255, 0.05);
  box-sizing: border-box;
}

.scan-locator {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.scan-locator__glow,
.scan-locator__ring,
.scan-locator__cross,
.scan-locator__sweep,
.scan-locator__core {
  position: absolute;
  left: 50%;
  top: 50%;
  box-sizing: border-box;
}

.scan-locator__glow {
  width: 88px;
  height: 88px;
  margin: -44px 0 0 -44px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--lab-glow-rgb), 0.22) 0%, transparent 70%);
  animation: scan-locator-pulse 2.8s ease-in-out infinite;
}

.scan-locator__ring {
  border: 1px solid rgba(var(--lab-glow-rgb), 0.22);
  border-radius: 50%;
}

.scan-locator__ring--outer {
  width: 96px;
  height: 96px;
  margin: -48px 0 0 -48px;
  border-color: rgba(var(--lab-glow-rgb), 0.28);
}

.scan-locator__ring--mid {
  width: 64px;
  height: 64px;
  margin: -32px 0 0 -32px;
  border-style: dashed;
  border-color: rgba(var(--lab-glow-rgb), 0.2);
  animation: scan-locator-spin 18s linear infinite;
}

.scan-locator__ring--inner {
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border-color: rgba(var(--lab-glow-rgb), 0.35);
}

.scan-locator__cross {
  width: 96px;
  height: 96px;
  margin: -48px 0 0 -48px;
  background:
    linear-gradient(90deg, transparent 49.2%, rgba(var(--lab-glow-rgb), 0.28) 49.2%, rgba(var(--lab-glow-rgb), 0.28) 50.8%, transparent 50.8%),
    linear-gradient(0deg, transparent 49.2%, rgba(var(--lab-glow-rgb), 0.28) 49.2%, rgba(var(--lab-glow-rgb), 0.28) 50.8%, transparent 50.8%);
  opacity: 0.7;
}

.scan-locator__sweep {
  width: 96px;
  height: 96px;
  margin: -48px 0 0 -48px;
  border-radius: 50%;
  /* Trail must sit counter-clockwise of the bright edge (behind clockwise spin). */
  background: conic-gradient(
    from 0deg,
    rgba(var(--lab-glow-rgb), 0.4) 0deg,
    transparent 1deg,
    transparent 270deg,
    rgba(var(--lab-glow-rgb), 0.06) 310deg,
    rgba(var(--lab-glow-rgb), 0.4) 360deg
  );
  mask: radial-gradient(circle, transparent 14px, #000 15px);
  -webkit-mask: radial-gradient(circle, transparent 14px, #000 15px);
  animation: scan-locator-spin 3.2s linear infinite;
}

.scan-locator__core {
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: #e8f4ff;
  box-shadow: 0 0 8px rgba(var(--lab-glow-rgb), 0.7);
}

.scan-locator__blip {
  position: absolute;
  width: 4px;
  height: 4px;
  margin: -2px 0 0 -2px;
  border-radius: 50%;
  background: rgba(180, 230, 255, 0.95);
  box-shadow: 0 0 6px rgba(var(--lab-glow-rgb), 0.8);
  animation: scan-locator-blip 2.4s ease-in-out infinite;
}

.scan-locator__blip--a {
  left: 64%;
  top: 34%;
  animation-delay: 0s;
}

.scan-locator__blip--b {
  left: 34%;
  top: 60%;
  animation-delay: 0.7s;
}

.scan-locator__blip--c {
  left: 58%;
  top: 68%;
  animation-delay: 1.4s;
}

#scan-locator.is-scanning .scan-locator__sweep {
  animation-duration: 1.1s;
}

#scan-locator.is-scanning .scan-locator__glow {
  animation-duration: 1s;
}

#scan-locator.is-scanning .scan-locator__ring--mid {
  animation-duration: 6s;
}

@keyframes scan-locator-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes scan-locator-pulse {
  0%,
  100% {
    opacity: 0.55;
    transform: scale(0.92);
  }
  50% {
    opacity: 1;
    transform: scale(1.06);
  }
}

@keyframes scan-locator-blip {
  0%,
  100% {
    opacity: 0.25;
  }
  40%,
  60% {
    opacity: 1;
  }
}

#scan-frame .scan-frame__btn.test-lab__btn,
#scan-frame .test-lab__btn.scan-frame__btn {
  width: 100%;
  margin: 0;
  flex: 0 0 var(--scan-btn-h);
  height: var(--scan-btn-h);
  min-height: var(--scan-btn-h);
  max-height: var(--scan-btn-h);
}

.scan-frame__btn.is-busy,
.scan-frame__btn:disabled {
  pointer-events: none;
  opacity: 0.55;
  cursor: default;
  filter: none;
}

.scan-frame__cooldown {
  display: flex;
  flex-shrink: 0;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 100%;
  height: var(--scan-cd-h);
  box-sizing: border-box;
}

.scan-frame__cooldown-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 0;
}

.scan-frame__cooldown-title {
  color: var(--lab-accent);
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
}

.scan-frame__cooldown-label {
  color: var(--lab-text);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.scan-frame__cooldown-label.is-ready {
  color: #7ec8a8;
}

.scan-frame__cooldown-bar {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 3px;
  width: 100%;
  height: 8px;
  padding: 1px;
  border: 1px solid var(--lab-line-soft);
  border-radius: 1px;
  background: rgba(6, 12, 18, 0.65);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.3);
  box-sizing: border-box;
}

.scan-frame__cooldown-seg {
  min-width: 0;
  height: 100%;
  background: rgba(var(--lab-glow-rgb), 0.08);
  transition:
    background 0.2s ease,
    box-shadow 0.2s ease;
}

.scan-frame__cooldown-seg.is-on {
  background: linear-gradient(
    180deg,
    rgba(var(--lab-glow-rgb), 0.55) 0%,
    rgba(90, 130, 160, 0.7) 100%
  );
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.scan-frame__cooldown-seg.is-on.is-ready {
  background: linear-gradient(180deg, rgba(92, 184, 146, 0.75) 0%, rgba(47, 122, 92, 0.85) 100%);
  box-shadow: inset 0 1px 0 rgba(180, 255, 220, 0.28);
}

.scan-frame__results-wrap {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  height: var(--scan-list-h);
  min-height: var(--scan-list-h);
  overflow: hidden;
}

.scan-frame__hint {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 12px;
  color: var(--lab-muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1.35;
  text-align: center;
  text-transform: none;
  pointer-events: none;
  box-sizing: border-box;
}

.scan-frame__hint.is-hidden {
  display: none;
}

.scan-frame__results {
  display: flex;
  flex-direction: column;
  gap: var(--scan-row-gap);
  width: 100%;
  height: 100%;
  overflow: auto;
  padding: 0;
  border: none;
  background: transparent;
  box-sizing: border-box;
}

.scan-result {
  display: flex;
  flex-shrink: 0;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: var(--scan-row-h);
  min-height: var(--scan-row-h);
  max-height: var(--scan-row-h);
  padding: 3px 8px 3px 3px;
  border: 1px solid var(--lab-line-soft);
  border-radius: var(--lab-radius, 1px);
  background: var(--lab-slot-bg);
  box-sizing: border-box;
  text-align: left;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background 0.15s ease;
}

.scan-result:hover {
  border-color: var(--lab-hover-line);
  background: var(--lab-btn-bg-hover);
}

.scan-result__slot {
  position: relative;
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  overflow: hidden;
  border: 1px solid var(--lab-line-soft);
  border-radius: 1px;
  background: rgba(6, 12, 18, 0.55);
  box-sizing: border-box;
}

.scan-result__icon {
  display: block;
  width: 100%;
  height: 100%;
  padding: 4px;
  object-fit: contain;
  box-sizing: border-box;
  pointer-events: none;
  user-select: none;
  opacity: 0.95;
}

.scan-result__name {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  color: var(--lab-accent);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.2;
  text-transform: uppercase;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scan-result__dist {
  flex-shrink: 0;
  margin-left: auto;
  padding-right: 0;
  color: var(--lab-text);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Fixed size: width locked; height fitted on open (data-fit-height). */
#ship-frame {
  --ship-portrait: 200px;

  width: 660px;
  max-width: 660px;
  min-width: 660px;
  /* Scaffold for layout measure; replaced by fitFixedHeight before first paint */
  height: 420px;
  min-height: 0;
  max-height: none;
}

#ship-frame .ui-frame__body {
  padding-right: 0;
  padding-bottom: 0;
}

#ship-frame.is-minimized {
  width: 250px;
  max-width: 250px;
  min-width: 250px;
  height: calc(var(--frame-inset) * 2 + var(--frame-cell-h));
  min-height: 0;
  max-height: none;
}

#cargo-frame {
  width: 520px;
  height: 420px;
  min-width: 380px;
  min-height: 320px;
  left: 720px;
  top: 120px;
}

#cargo-frame.is-minimized {
  width: 250px;
  height: calc(var(--frame-inset) * 2 + var(--frame-cell-h));
  min-width: 250px;
  min-height: 0;
}

.ship-frame__content {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  padding: 10px;
  overflow: hidden;
  box-sizing: border-box;
}

.ship-fit {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  height: auto;
  min-height: 0;
  overflow: hidden;
}

.ship-fit__hero {
  display: flex;
  align-items: stretch;
  gap: 12px;
  flex: 0 0 auto;
  padding: 10px;
  border: 1px solid #23455b;
  background: linear-gradient(180deg, rgba(20, 40, 52, 0.55) 0%, rgba(9, 16, 21, 0.9) 100%);
  box-sizing: border-box;
}

.ship-fit__actions {
  flex: 0 0 46px;
  width: 100%;
  height: 46px;
  min-height: 46px;
  max-height: 46px;
  box-sizing: border-box;
}

.ship-fit__actions .warehouse-toolbar__action {
  flex: 1 1 0;
  min-width: 0;
}

.ship-fit-panel__content {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  height: 100%;
  padding: 10px 10px 16px;
  overflow: auto;
  box-sizing: border-box;
}

.ship-fit-panel__toolbar {
  flex: 0 0 46px;
  width: 100%;
  height: 46px;
  min-height: 46px;
  max-height: 46px;
  margin-top: auto;
  box-sizing: border-box;
}

.ship-fit-panel__toolbar .warehouse-toolbar__action {
  flex: 1 1 auto;
  width: 100%;
  height: 26px;
  min-height: 26px;
  max-height: 26px;
}

.ship-fit-panel__content .ship-fit__section {
  flex: 0 0 auto;
  min-height: auto;
}

.cargo-frame__content {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  height: 100%;
  padding: 10px;
  overflow: hidden;
  box-sizing: border-box;
}

.cargo-frame__toolbar {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  min-width: 0;
}

.cargo-frame__search-row {
  display: flex;
  align-items: stretch;
  gap: 6px;
  width: 100%;
  min-width: 0;
}

.cargo-frame__search-field {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
}

.cargo-frame__search-row .ship-cargo__capacity {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  width: auto;
  min-width: 0;
  height: 26px;
  min-height: 26px;
  max-height: 26px;
  padding: 0 10px;
  border: 1px solid var(--lab-line-soft);
  border-radius: 1px;
  background: var(--lab-input-bg);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.28);
  color: var(--lab-accent-strong);
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  box-sizing: border-box;
}

/* Market still uses pill filters */
.cargo-frame__filters {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 3px;
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid #23455b;
  background: #091015;
  box-sizing: border-box;
}

.cargo-frame__filter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  height: 26px;
  padding: 0 4px;
  border: 1px solid #23455b;
  background: #091015;
  color: #5b7a90;
  font-family: "Monda", sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  cursor: pointer;
  box-sizing: border-box;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    color 0.15s ease;
}

.cargo-frame__filter:hover {
  border-color: #34698b;
  color: #9ec8e8;
}

.cargo-frame__filter.is-active {
  border-color: #34698b;
  background: linear-gradient(180deg, #244153 0%, #193140 100%);
  color: #ffffff;
}

.cargo-frame__dock-actions {
  width: 100%;
  min-width: 0;
}

.cargo-frame__dock-actions[hidden] {
  display: none !important;
}

/* Cargo hold glass panel + slots */
#cargo-frame .cargo-frame__dropzone {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  border: 1px solid var(--lab-line-soft);
  border-radius: var(--lab-radius);
  background: var(--lab-brief-bg);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(200, 230, 255, 0.05);
  box-sizing: border-box;
  overflow: hidden;
}

#cargo-frame .cargo-frame__dropzone.is-drop-target {
  border-color: var(--lab-hover-line);
  box-shadow: inset 0 0 0 1px rgba(var(--lab-glow-rgb), 0.22);
}

#cargo-frame .cargo-frame__dropzone.is-drop-target .ship-cargo__items,
#cargo-frame .cargo-frame__dropzone.is-drop-target .ship-cargo__empty {
  filter: blur(5px);
  opacity: 0.45;
}

#cargo-frame .cargo-frame__dropzone:has(.ship-cargo__empty:not(.is-hidden)) {
  justify-content: center;
  align-items: center;
}

#cargo-frame .ship-cargo__items {
  flex: 1;
  min-height: 0;
  border: none;
  background: transparent;
  padding: 10px;
}

#cargo-frame .ship-cargo__empty {
  color: var(--lab-muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

#cargo-frame .cargo-frame__drop-hint {
  background: rgba(8, 14, 20, 0.42);
  border-color: var(--lab-hover-line);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

#cargo-frame .cargo-frame__drop-hint-title {
  color: var(--lab-text);
  font-family: inherit;
  text-shadow: none;
}

#cargo-frame .cargo-frame__drop-hint-sub {
  color: var(--lab-accent);
  font-family: inherit;
}

#cargo-frame .inv-cell__corner,
#warehouse-frame .inv-cell__corner {
  display: none;
}

#cargo-frame .inv-cell__slot::before,
#warehouse-frame .inv-cell__slot::before {
  display: none;
}

#cargo-frame .inv-cell__glow,
#warehouse-frame .inv-cell__glow {
  inset: 0;
  left: 0;
  top: 0;
  width: auto;
  height: auto;
  border-radius: 0;
  background: radial-gradient(
    ellipse 70% 70% at 50% 45%,
    rgba(var(--lab-glow-rgb), 0.14),
    transparent 70%
  );
  mix-blend-mode: normal;
  filter: none;
  transform: none;
}

#cargo-frame .inv-cell__slot,
#warehouse-frame .inv-cell__slot {
  overflow: hidden;
  border: 1px solid var(--lab-line);
  border-radius: 1px;
  background: var(--lab-slot-bg);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.3),
    0 0 10px rgba(var(--lab-glow-rgb), 0.08);
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
}

#cargo-frame .inv-cell:hover .inv-cell__slot,
#warehouse-frame .inv-cell:hover .inv-cell__slot {
  border-color: var(--lab-hover-line);
  background: var(--lab-slot-bg-hover);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.25),
    0 0 12px rgba(var(--lab-glow-rgb), 0.18);
}

#cargo-frame .inv-cell__icon,
#warehouse-frame .inv-cell__icon {
  top: 50%;
  left: 50%;
  width: 58px;
  height: 58px;
  transform: translate(-50%, -50%) scale(1);
  transform-origin: center center;
  transition: transform 0.18s ease;
}

#cargo-frame .inv-cell:hover .inv-cell__icon,
#warehouse-frame .inv-cell:hover .inv-cell__icon {
  transform: translate(-50%, -50%) scale(0.9);
}

#cargo-frame .inv-cell__qty {
  position: absolute;
  top: auto;
  right: 3px;
  bottom: 2px;
  z-index: 3;
  color: var(--lab-accent-strong);
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.1;
  text-shadow:
    0 0 3px rgba(0, 0, 0, 0.95),
    0 1px 2px rgba(0, 0, 0, 0.9);
}

#cargo-frame .inv-cell__name,
#warehouse-frame .inv-cell__name {
  color: var(--lab-muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-shadow: none;
  transition: color 0.15s ease;
}

#cargo-frame .inv-cell:hover .inv-cell__name,
#warehouse-frame .inv-cell:hover .inv-cell__name {
  color: #fff;
}

.ship-fit__portrait {
  position: relative;
  display: flex;
  flex: 0 0 var(--ship-portrait, 200px);
  align-items: center;
  justify-content: center;
  align-self: stretch;
  box-sizing: border-box;
  width: var(--ship-portrait, 200px);
  height: auto;
  min-height: 0;
  border: 1px solid #29526c;
  background: #050a10;
  overflow: hidden;
}

.ship-fit__portrait-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
}

.ship-fit__portrait-ship {
  position: relative;
  z-index: 1;
  display: block;
  width: 88%;
  max-width: 168px;
  height: auto;
  max-height: 78%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

.ship-fit__portrait-label {
  position: absolute;
  left: 8px;
  bottom: 8px;
  z-index: 2;
  color: #599cc7;
  font-family: "Monda", sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-shadow: 0 1px 2px #000;
}

.ship-fit__dossier {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  justify-content: flex-start;
}

.ship-fit__name {
  margin: 0;
  color: #ffffff;
  font-family: "Monda", sans-serif;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-shadow: 0 1px 2px #000;
}

.ship-fit__class {
  margin: 0;
  color: #81aecd;
  font-family: "Monda", sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.ship-fit__blurb {
  margin: 0;
  color: #5f849e;
  font-family: "Monda", sans-serif;
  font-size: 13px;
  font-weight: 400;
  line-height: 16px;
  letter-spacing: 0;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.5);
}

.ship-fit__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
  margin: 2px 0 0;
}

.ship-fit__stat {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: 5px 8px;
  border: 1px solid #1a3241;
  background: #091015;
}

.ship-fit__stat dt {
  color: #5f849e;
  font-family: "Monda", sans-serif;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.ship-fit__stat dd {
  margin: 0;
  color: #e8f4ff;
  font-family: "Monda", sans-serif;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.ship-fit__meters {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 2px;
}

.ship-fit__meter {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 8px;
  align-items: center;
}

.ship-fit__meter-label {
  color: #5f849e;
  font-family: "Monda", sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ship-fit__meter-track {
  height: 8px;
  padding: 1px;
  border: 1px solid #23455b;
  background: #050a10;
  box-sizing: border-box;
}

.ship-fit__meter-fill {
  height: 100%;
  width: 100%;
  max-width: 100%;
  transition: width 0.2s ease;
}

.ship-fit__meter-fill--hull {
  background: linear-gradient(90deg, #a88428 0%, #d9ac3e 100%);
  box-shadow: 0 0 6px rgba(217, 172, 62, 0.35);
}

.ship-fit__meter-fill--energy {
  background: linear-gradient(90deg, #0a8aa8 0%, #0fdbfb 100%);
  box-shadow: 0 0 6px rgba(15, 219, 251, 0.35);
}

.ship-fit__section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  padding: 10px;
  border: 1px solid #23455b;
  background: #091015;
  box-sizing: border-box;
}

.ship-fit__section--solo {
  flex: 1;
  height: 100%;
}

.ship-fit__section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
}

.ship-fit__section-head h4 {
  margin: 0;
  color: #9ec8e8;
  font-family: "Monda", sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ship-fit__section-head span {
  color: #5f849e;
  font-family: "Monda", sans-serif;
  font-size: 12px;
  font-weight: 400;
  line-height: 13px;
}

.ship-slot__name {
  color: #81aecd;
  font-family: "Monda", sans-serif;
  font-size: 12px;
  font-weight: 400;
  line-height: 13px;
  text-align: center;
  text-transform: capitalize;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.5);
  word-wrap: break-word;
  max-width: 100%;
}

.ship-slot__tag {
  color: #5f849e;
  font-family: "Monda", sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ship-slots {
  display: grid;
  gap: 8px;
  min-height: 0;
}

.ship-slots--systems {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-content: start;
}

.ship-slots--hardpoints {
  /* Same 4-col track as systems so the center gap matches shield?armor */
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-content: start;
}

.ship-fit__hardpoint {
  grid-column: span 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: stretch;
  gap: 0;
  min-width: 0;
  border: 1px solid #23455b;
  background: linear-gradient(180deg, #132029 0%, #0b141c 100%);
  box-sizing: border-box;
  transition:
    border-color 0.15s ease,
    background 0.15s ease;
}

.ship-fit__hardpoint:has(.ship-slot:hover),
.ship-fit__hardpoint:has(.ship-slot.is-drop-target),
.ship-fit__hardpoint:has(.ship-slot.is-assign-target) {
  border-color: #34698b;
  background: linear-gradient(180deg, #244153 0%, #193140 100%);
}

.ship-fit__hardpoint:has(.ship-slot.is-drop-target),
.ship-fit__hardpoint:has(.ship-slot.is-assign-target) {
  border-color: #599cc7;
  box-shadow: inset 0 0 0 1px rgba(89, 156, 199, 0.35);
}

.ship-fit__hardpoint:has(.ship-slot.is-assign-target) {
  animation: ship-assign-pulse 1.1s ease-in-out infinite;
}

.ship-fit__hardpoint .ship-slot {
  border: none;
  background: transparent;
  box-shadow: none;
}

.ship-fit__hardpoint .ship-slot:hover,
.ship-fit__hardpoint .ship-slot.is-drop-target,
.ship-fit__hardpoint .ship-slot.is-assign-target {
  border: none;
  background: transparent;
  box-shadow: none;
}

.ship-slot {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 0;
  padding: 8px 6px 7px;
  border: 1px solid #23455b;
  background: linear-gradient(180deg, #132029 0%, #0b141c 100%);
  color: inherit;
  cursor: pointer;
  box-sizing: border-box;
  transition:
    border-color 0.15s ease,
    background 0.15s ease;
}

.ship-slot:hover {
  border-color: #34698b;
  background: linear-gradient(180deg, #244153 0%, #193140 100%);
}

.ship-slot.is-empty .ship-slot__name {
  color: #5f849e;
}

.ship-slot.is-empty .ship-slot__frame {
  opacity: 0.65;
}

.ship-slot.is-dragging {
  opacity: 0.45;
}

.ship-slot.is-drop-target,
.ship-slot.is-assign-target {
  border-color: #599cc7;
  background: linear-gradient(180deg, #244153 0%, #193140 100%);
  box-shadow: inset 0 0 0 1px rgba(89, 156, 199, 0.35);
}

.ship-slot.is-assign-target {
  animation: ship-assign-pulse 1.1s ease-in-out infinite;
}

@keyframes ship-assign-pulse {
  0%,
  100% {
    box-shadow: inset 0 0 0 1px rgba(89, 156, 199, 0.25);
  }
  50% {
    box-shadow: inset 0 0 0 1px rgba(137, 196, 230, 0.7);
  }
}

#ship-lab-frame.is-assign-mode .ship-slot:not(.is-assign-target),
#ship-lab-frame.is-assign-mode .test-lab__drop:not(.is-assign-target) {
  opacity: 0.4;
}

.warehouse-frame__items.is-drop-target,
.ship-cargo__items.is-drop-target,
.cargo-frame__dropzone.is-drop-target,
.workshop-slot-wrap.is-drop-target {
  border-color: #599cc7;
  box-shadow: inset 0 0 0 1px rgba(89, 156, 199, 0.35);
}

.cargo-frame__dropzone {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  border: 1px solid transparent;
  box-sizing: border-box;
}

.cargo-frame__dropzone .ship-cargo__items {
  flex: 1;
  min-height: 0;
}

/* Empty hold: collapse the unused item grid so the hint can sit centered */
.cargo-frame__dropzone:has(.ship-cargo__empty:not(.is-hidden)) {
  justify-content: center;
  align-items: center;
  border-color: #23455b;
}

.cargo-frame__dropzone:has(.ship-cargo__empty:not(.is-hidden)) .ship-cargo__items {
  display: none;
}

.cargo-frame__drop-hint {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  pointer-events: none;
  background: rgba(9, 16, 21, 0.72);
  border: 1px solid #599cc7;
  box-sizing: border-box;
}

.cargo-frame__dropzone.is-drop-target .cargo-frame__drop-hint,
.warehouse-frame__panel.is-drop-target .cargo-frame__drop-hint {
  display: flex;
}

.cargo-frame__drop-hint-title {
  color: #ffffff;
  font-family: "Monda", sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-shadow: 0 1px 1px #000;
}

.cargo-frame__drop-hint-sub {
  color: #9ec8e8;
  font-family: "Monda", sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.fit-drag-ghost {
  position: fixed;
  top: -1000px;
  left: -1000px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 72px;
  padding: 6px 4px 5px;
  border: 1px solid #599cc7;
  background: linear-gradient(180deg, #244153 0%, #0b141c 100%);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  box-sizing: border-box;
}

.fit-drag-ghost__frame {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border: 1px solid #23455b;
  background: #0e1922;
  box-sizing: border-box;
}

.fit-drag-ghost__frame img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.fit-drag-ghost__meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  width: 100%;
}

.fit-drag-ghost__name {
  max-width: 100%;
  overflow: hidden;
  color: #c5e4f8;
  font-family: "Monda", sans-serif;
  font-size: 10px;
  line-height: 1.15;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 1px 1px #000;
}

.fit-drag-ghost__tag {
  color: #9ec8e8;
  font-family: "Monda", sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.inv-cell.is-dragging {
  opacity: 0.45;
}

.ship-slot__frame {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  overflow: visible;
  border: 1px solid #23455b;
  background: #0e1922;
  box-sizing: border-box;
}

.ship-slot__frame::before {
  content: "";
  position: absolute;
  inset: 1px;
  background: #0e1921;
  pointer-events: none;
}

.ship-slot__frame--sm {
  width: 48px;
  height: 48px;
}

.ship-slot__frame img:not(.ship-slot__corner) {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  display: block;
  width: calc(100% - 8px);
  height: calc(100% - 8px);
  max-width: none;
  object-fit: contain;
  object-position: center;
  transform: translate(-50%, -50%);
  pointer-events: none;
  user-select: none;
}

.ship-slot__frame .inv-cell__qty {
  top: auto;
  right: 3px;
  bottom: 2px;
}

.ship-slot__corner {
  position: absolute;
  z-index: 4;
  width: 6px;
  height: 6px;
  pointer-events: none;
  user-select: none;
}

.ship-slot__corner--tl {
  top: -1px;
  left: -1px;
}

.ship-slot__corner--tr {
  top: -1px;
  right: -1px;
  transform: rotate(90deg);
}

.ship-slot__corner--br {
  right: -1px;
  bottom: -1px;
  transform: rotate(180deg);
}

.ship-slot__corner--bl {
  bottom: -1px;
  left: -1px;
  transform: rotate(270deg);
}

.ship-slot__glow {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(89, 156, 199, 0.35);
  filter: blur(6px);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.ship-cargo {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}

.ship-cargo__toolbar {
  flex-shrink: 0;
}

.ship-cargo__capacity {
  display: flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border: 1px solid #23455b;
  background: #091015;
  color: #9ec8e8;
  font-family: "Monda", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  box-sizing: border-box;
}

.ship-cargo__items {
  flex: 1;
  min-height: 0;
}

.ship-cargo__empty {
  margin: 0;
  padding: 16px 20px;
  color: #5f849e;
  font-family: "Monda", sans-serif;
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
  box-sizing: border-box;
}

.ship-cargo__empty.is-hidden {
  display: none;
}

@media (max-width: 900px) {
  .ship-fit__hero {
    flex-direction: column;
  }

  .ship-fit__portrait {
    width: 100%;
    max-width: 220px;
    height: auto;
    aspect-ratio: 1 / 1;
    min-height: 0;
    align-self: center;
  }

  .ship-slots--systems {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Sheet (mobile) only — do not use .is-narrow here: Ship is ~660px and would
   always stack the hero on desktop. */
.ui-frame.is-sheet .ship-fit__hero {
  flex-direction: column;
}

.ui-frame.is-sheet .ship-fit__portrait {
  width: 100%;
  max-width: 220px;
  height: auto;
  aspect-ratio: 1 / 1;
  min-height: 0;
  align-self: center;
}

.ui-frame.is-sheet .ship-slots--systems {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ui-frame.is-sheet.ui-frame--scan,
.ui-frame.is-narrow.ui-frame--scan {
  max-width: none;
  min-width: 0;
}

.ui-frame.is-sheet .scan-frame__results-wrap,
.ui-frame.is-narrow .scan-frame__results-wrap {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  overflow: auto;
}

.ui-frame.is-sheet .scan-frame__content,
.ui-frame.is-narrow .scan-frame__content {
  min-height: 0;
}

#warehouse-frame {
  /* 6 inventory columns: chrome + content pad + items chrome/pad
     + 6×64 cells + 5×10 gaps + body pad-right + scrollbar gutter */
  width: calc(
    var(--frame-inset) * 2 + 24px + 2px + 24px + 64px * 6 + 10px * 5 + 2px + 8px
  );
  height: min(720px, calc(100vh - 48px));
  min-width: 400px;
  min-height: 360px;
}

#warehouse-frame.is-minimized {
  width: 250px;
  height: calc(var(--frame-inset) * 2 + var(--frame-cell-h));
  min-height: 0;
  min-width: 250px;
}

#market-frame {
  --market-rail-w: 220px;
  width: min(980px, calc(100vw - 70px));
  height: min(680px, calc(100vh - 48px));
  min-width: 400px;
  min-height: 420px;
}

#market-frame.is-minimized {
  width: 250px;
  height: calc(var(--frame-inset) * 2 + var(--frame-cell-h));
  min-height: 0;
  min-width: 250px;
}

#workshop-frame {
  width: min(420px, calc(100vw - 70px));
  height: min(420px, calc(100vh - 48px));
  min-width: 340px;
  min-height: 360px;
}

#workshop-frame .ui-frame__body {
  padding-right: 0;
  padding-bottom: 0;
}

#workshop-frame.is-minimized {
  width: 250px;
  height: calc(var(--frame-inset) * 2 + var(--frame-cell-h));
  min-height: 0;
  min-width: 250px;
}

.workshop-frame__content {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 10px;
  box-sizing: border-box;
  font-family: var(--cg-font, inherit);
  color: var(--lab-text);
}

.workshop-frame__section {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--lab-line-soft);
  border-radius: var(--lab-radius);
  background: var(--lab-brief-bg);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(200, 230, 255, 0.05);
  box-sizing: border-box;
}

.workshop-frame__section--result {
  margin-top: 2px;
}

.workshop-frame__section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.workshop-frame__section-head .test-lab__label {
  margin: 0;
}

.workshop-frame__hint {
  margin: 0;
  color: var(--lab-muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.workshop-frame__progress-head {
  min-width: 0;
}

.workshop-frame__status {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  padding: 0;
  border: none;
  background: none;
  color: var(--lab-muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.02em;
  text-align: left;
  box-sizing: border-box;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workshop-frame__timer {
  flex: 0 0 auto;
}

.workshop-frame__progress.is-complete .workshop-frame__progress-fill {
  background: linear-gradient(
    90deg,
    rgba(70, 150, 120, 0.55) 0%,
    rgba(120, 210, 170, 0.85) 55%,
    rgba(180, 240, 210, 0.95) 100%
  );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 0 8px rgba(70, 190, 140, 0.18);
}

.workshop-frame__slots {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-start;
  gap: 8px;
  min-width: 0;
}

.workshop-frame__result {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: flex-start;
}

#workshop-frame .workshop-frame__section--result .test-lab__btn {
  width: 100%;
}

.workshop-slot-wrap {
  flex: 0 0 auto;
  width: 64px;
  border: 1px solid transparent;
  border-radius: 1px;
  box-sizing: border-box;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.workshop-slot-wrap.is-drop-target {
  border-color: var(--lab-hover-line);
  box-shadow:
    inset 0 0 0 1px rgba(var(--lab-glow-rgb), 0.28),
    0 0 10px rgba(var(--lab-glow-rgb), 0.16);
}

.workshop-slot-wrap .inv-cell,
.workshop-frame__result .inv-cell {
  width: 64px;
}

#workshop-frame .inv-cell__corner {
  display: none;
}

#workshop-frame .inv-cell__slot::before {
  display: none;
}

#workshop-frame .inv-cell__glow {
  inset: 0;
  left: 0;
  top: 0;
  width: auto;
  height: auto;
  border-radius: 0;
  background: radial-gradient(
    ellipse 70% 70% at 50% 45%,
    rgba(var(--lab-glow-rgb), 0.14),
    transparent 70%
  );
  mix-blend-mode: normal;
  filter: none;
  transform: none;
}

#workshop-frame .inv-cell__slot {
  overflow: hidden;
  border: 1px solid var(--lab-line);
  border-radius: 1px;
  background: var(--lab-slot-bg);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.3),
    0 0 10px rgba(var(--lab-glow-rgb), 0.08);
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
}

#workshop-frame .inv-cell:hover .inv-cell__slot,
#workshop-frame .workshop-slot-wrap:hover .inv-cell__slot {
  border-color: var(--lab-hover-line);
  background: var(--lab-slot-bg-hover);
}

#workshop-frame .inv-cell__icon {
  top: 50%;
  left: 50%;
  width: 58px;
  height: 58px;
  transform: translate(-50%, -50%) scale(1);
  transform-origin: center center;
  transition: transform 0.18s ease;
}

#workshop-frame .inv-cell:hover .inv-cell__icon {
  transform: translate(-50%, -50%) scale(0.9);
}

#workshop-frame .inv-cell__qty {
  position: absolute;
  top: auto;
  right: 3px;
  bottom: 2px;
  left: auto;
  z-index: 3;
  width: auto;
  color: var(--lab-accent-strong);
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.1;
  text-shadow:
    0 0 3px rgba(0, 0, 0, 0.95),
    0 1px 2px rgba(0, 0, 0, 0.9);
}

#workshop-frame .inv-cell__name {
  color: var(--lab-muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-shadow: none;
  transition: color 0.15s ease;
}

#workshop-frame .inv-cell:hover .inv-cell__name {
  color: #fff;
}

#workshop-frame .workshop-slot.is-empty .inv-cell__slot {
  border-style: dashed;
  opacity: 1;
  background: rgba(6, 12, 18, 0.34);
}

#workshop-frame .workshop-slot.is-empty .inv-cell__name {
  color: var(--lab-muted);
  opacity: 0.75;
}

#workshop-frame.is-narrow .workshop-frame__section--result .test-lab__btn {
  width: 100%;
}

.market-frame__content {
  position: relative;
  display: flex;
  flex-direction: row;
  gap: 10px;
  width: 100%;
  height: 100%;
  padding: 10px;
  overflow: hidden;
  box-sizing: border-box;
}

.market-frame__rail {
  display: flex;
  flex: 0 0 var(--market-rail-w);
  flex-direction: column;
  gap: 8px;
  width: var(--market-rail-w);
  min-height: 0;
}

.market-frame__main {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  min-height: 0;
}

.market-frame__command {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.market-frame__query {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px;
  min-width: 0;
}

.market-frame__query .warehouse-toolbar__search {
  flex: 1 1 180px;
  min-width: 140px;
}

.market-frame__query .market-frame__filters {
  flex: 1 1 220px;
  min-width: 200px;
}

.market-credits {
  display: flex;
  flex: 0 0 auto;
  flex-direction: row;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #29526c;
  background:
    linear-gradient(180deg, rgba(36, 65, 83, 0.45) 0%, rgba(9, 16, 21, 0.95) 100%);
  box-sizing: border-box;
}

.market-credits__label {
  color: #81aecd;
  font-family: "Monda", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.market-credits__value {
  color: #ffffff;
  font-family: "Monda", sans-serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-shadow: 0 0 12px rgba(217, 172, 62, 0.35);
  font-variant-numeric: tabular-nums;
}

.market-merchant-strip {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.market-merchant-card {
  display: flex;
  flex: 0 0 auto;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  min-width: 0;
  width: 100%;
  padding: 8px;
  border: 1px solid #23455b;
  background: #091015;
  color: #9ec8e8;
  cursor: pointer;
  box-sizing: border-box;
  text-align: left;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
}

.market-merchant-card:hover {
  border-color: #34698b;
  background: linear-gradient(180deg, #1a2f3c 0%, #0d1820 100%);
}

.market-merchant-card.is-active {
  border-color: #599cc7;
  background: linear-gradient(180deg, #244153 0%, #193140 100%);
  color: #ffffff;
  box-shadow:
    inset 0 0 0 1px rgba(89, 156, 199, 0.28),
    0 0 14px rgba(89, 156, 199, 0.2);
}

.market-merchant-card__avatar {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border: 1px solid #29526c;
  background: #050a10;
  object-fit: cover;
  pointer-events: none;
}

.market-merchant-card.is-active .market-merchant-card__avatar {
  border-color: #7eb7db;
  box-shadow: 0 0 10px rgba(89, 156, 199, 0.35);
}

.market-merchant-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
}

.market-merchant-card__name {
  color: inherit;
  font-family: "Monda", sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.15;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.market-merchant-card__title {
  color: #5b7a90;
  font-family: "Monda", sans-serif;
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.market-merchant-card.is-active .market-merchant-card__title {
  color: #9ec8e8;
}

.market-merchant-card__meta {
  display: flex;
  justify-content: flex-start;
  gap: 10px;
  margin-top: 2px;
  color: #81aecd;
  font-family: "Monda", sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.market-merchant-card.is-active .market-merchant-card__meta {
  color: #c5e4f5;
}

.market-merchant-card__timer {
  color: #d9ac3e;
}

.market-merchant-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid #23455b;
  background: linear-gradient(180deg, rgba(25, 45, 57, 0.55) 0%, #091015 100%);
  box-sizing: border-box;
}

.market-merchant-meta__who {
  min-width: 0;
}

.market-merchant-meta__name {
  margin: 0;
  color: #ffffff;
  font-family: "Monda", sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.market-merchant-meta__title {
  margin: 2px 0 0;
  color: #5b7a90;
  font-family: "Monda", sans-serif;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.market-merchant-meta__stats {
  display: flex;
  flex-shrink: 0;
  gap: 6px;
}

.market-pill {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border: 1px solid #29526c;
  background: #091015;
  color: #9ec8e8;
  font-family: "Monda", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-sizing: border-box;
  white-space: nowrap;
}

.market-pill--timer {
  border-color: #5a4a28;
  color: #d9ac3e;
}

.market-frame__tabs {
  gap: 4px;
  flex-shrink: 0;
}

.market-frame__tabs .warehouse-toolbar__action {
  flex: 1 1 0;
  min-width: 0;
}

.market-frame__filters {
  flex-shrink: 0;
  margin: 0;
}

.market-frame__items {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  align-content: start;
  padding-right: 4px;
}

.market-frame__items.is-list {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 4px;
  min-width: 0;
}

.market-frame__items.is-list .market-offer {
  flex: 0 0 48px;
  height: 48px;
  min-height: 48px;
  max-height: 48px;
  padding: 4px 12px 4px 4px;
  border: 1px solid #23455b;
  background: #091015;
}

.market-frame__items.is-list .market-offer:hover {
  border-color: #34698b;
  background: linear-gradient(180deg, #244153 0%, #193140 100%);
}

.market-frame__items.is-list .market-offer.is-selected {
  border-color: #599cc7;
  box-shadow:
    inset 0 0 0 1px rgba(89, 156, 199, 0.35),
    0 0 12px rgba(89, 156, 199, 0.2);
}

.market-offer {
  position: relative;
}

.market-offer__price {
  display: block;
  margin-left: auto;
  color: #d9ac3e;
  font-family: "Monda", sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: right;
  text-transform: uppercase;
  white-space: nowrap;
  text-shadow: 0 0 8px rgba(217, 172, 62, 0.25);
}

.market-frame__items.is-list .market-offer__price {
  margin-top: 0;
  flex: 0 0 auto;
  min-width: 88px;
}

.market-frame__items.is-list .inv-cell__name {
  flex: 1 1 auto;
  text-align: left;
}

.market-offer__ll {
  position: absolute;
  top: 3px;
  right: 3px;
  z-index: 2;
  padding: 1px 4px;
  border: 1px solid #29526c;
  background: rgba(9, 16, 21, 0.92);
  color: #9ec8e8;
  font-family: "Monda", sans-serif;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.2;
}

.market-offer.is-locked {
  opacity: 0.42;
  cursor: default;
}

.market-offer.is-selected .inv-cell__slot {
  border-color: #599cc7;
  box-shadow:
    inset 0 0 0 1px rgba(89, 156, 199, 0.45),
    0 0 10px rgba(89, 156, 199, 0.25);
}

.market-frame__action-bar {
  flex-shrink: 0;
}

@media (max-width: 820px) {
  #market-frame {
    min-width: 320px;
  }

  .market-frame__content {
    flex-direction: column;
  }

  .market-frame__rail {
    flex: 0 0 auto;
    width: 100%;
    max-height: 180px;
  }

  .market-merchant-strip {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .market-merchant-card {
    flex: 0 0 180px;
    width: 180px;
  }
}

/* Frame-width stack (desktop shrink) — same look as Market mobile MQ */
#market-frame.is-narrow .market-frame__content,
#warehouse-frame.is-narrow .warehouse-frame__content {
  flex-direction: column;
}

#market-frame.is-narrow .market-frame__rail {
  flex: 0 0 auto;
  width: 100%;
  max-height: 180px;
}

#market-frame.is-narrow .market-merchant-strip {
  flex-direction: row;
  overflow-x: auto;
  overflow-y: hidden;
}

#market-frame.is-narrow .market-merchant-card {
  flex: 0 0 180px;
  width: 180px;
}

#market-frame.is-narrow .market-merchant-meta {
  flex-wrap: wrap;
}

#market-frame.is-narrow .market-frame__tabs {
  flex-wrap: wrap;
}

#warehouse-frame.is-narrow .warehouse-frame__items {
  min-width: 0;
}

#warehouse-frame.is-narrow .warehouse-frame__search-row {
  flex-wrap: wrap;
}

#warehouse-frame.is-narrow .warehouse-source-tabs {
  max-width: 100%;
}

.resource-info-frame {
  width: 300px;
  max-width: 300px;
  min-width: 260px;
  /* Scaffold; data-fit-height sizes to summary + description on open */
  height: 180px;
  min-height: 0;
}

.resource-info-frame .ui-frame__body {
  padding-right: 0;
  padding-bottom: 0;
}

.resource-info-frame.is-minimized {
  width: 250px;
  height: calc(var(--frame-inset) * 2 + var(--frame-cell-h));
  min-height: 0;
  min-width: 250px;
}

.resource-info__content {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 0;
  padding: 8px;
  box-sizing: border-box;
  font-family: var(--cg-font, inherit);
  color: var(--lab-text);
}

.resource-info__stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.resource-info__summary {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--lab-line-soft);
  border-radius: var(--lab-radius);
  background: var(--lab-brief-bg);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(200, 230, 255, 0.05);
  box-sizing: border-box;
}

.resource-info__icon-wrap {
  flex: 0 0 auto;
  align-self: center;
  line-height: 0;
}

.resource-info__slot {
  position: relative;
  display: block;
  width: 64px;
  height: 64px;
  overflow: hidden;
  border: 1px solid var(--lab-line);
  border-radius: 1px;
  background: var(--lab-slot-bg);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.3),
    0 0 10px rgba(var(--lab-glow-rgb), 0.08);
}

.resource-info__slot .inv-cell__corner {
  display: none;
}

.resource-info__slot .inv-cell__slot::before,
.resource-info__slot::before {
  display: none;
}

.resource-info__slot .inv-cell__glow {
  inset: 0;
  left: 0;
  top: 0;
  width: auto;
  height: auto;
  border-radius: 0;
  background: radial-gradient(
    ellipse 70% 70% at 50% 45%,
    rgba(var(--lab-glow-rgb), 0.14),
    transparent 70%
  );
  mix-blend-mode: normal;
  filter: none;
  transform: none;
}

.resource-info-frame .resource-info__slot .inv-cell__icon,
.resource-info-frame .resource-info__icon {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  display: block;
  width: 56px;
  height: 56px;
  max-width: none;
  max-height: none;
  margin: 0;
  transform: translate(-50%, -50%);
  object-fit: contain;
  object-position: center;
  pointer-events: none;
}

.resource-info__stats {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  margin: 0;
}

.resource-info__stat {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.resource-info__stat-label,
.resource-info__stat-value {
  margin: 0;
  font-family: inherit;
  font-size: 11px;
  line-height: 1.25;
  text-shadow: none;
}

.resource-info__stat-label {
  flex-shrink: 0;
  color: var(--lab-muted);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.resource-info__stat-value {
  min-width: 0;
  color: var(--lab-accent-strong);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: right;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resource-info__desc {
  flex: 0 0 auto;
  margin: 0;
  padding: 0 2px;
  overflow: visible;
  border: none;
  background: transparent;
  color: var(--lab-muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.02em;
  text-shadow: none;
}

.resource-info__combat {
  flex: 0 0 auto;
  margin: 0;
  padding: 8px 2px 0;
  border-top: 1px solid rgba(90, 160, 200, 0.22);
}

.resource-info__combat[hidden] {
  display: none;
}

.resource-info__combat-title {
  margin: 0 0 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--lab-muted);
}

.resource-info__stats--combat {
  flex: 0 0 auto;
  justify-content: flex-start;
  gap: 2px;
}

.warehouse-frame__content {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  height: 100%;
  padding: 10px;
  overflow: hidden;
  box-sizing: border-box;
  min-width: 0;
  min-height: 0;
}

.warehouse-frame__toolbar {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  min-width: 0;
}

.warehouse-frame__search-row {
  display: flex;
  align-items: stretch;
  gap: 6px;
  width: 100%;
  min-width: 0;
}

.warehouse-frame__search-field {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
}

.warehouse-frame__view-toggle {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: stretch;
  gap: 3px;
}

#warehouse-frame .warehouse-toolbar__icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  min-width: 26px;
  padding: 0;
  border: 1px solid var(--lab-line-soft);
  border-radius: 1px;
  background: var(--lab-input-bg);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.28);
  color: var(--lab-muted);
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    color 0.15s ease;
}

#warehouse-frame .warehouse-toolbar__icon-btn:hover {
  border-color: var(--lab-line);
  color: #fff;
  background: rgba(8, 14, 22, 0.72);
}

#warehouse-frame .warehouse-toolbar__icon-btn.is-active {
  border-color: var(--lab-hover-line);
  background: var(--lab-btn-bg-hover);
  color: #fff;
}

.warehouse-frame__panel {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  border: 1px solid var(--lab-line-soft);
  border-radius: var(--lab-radius);
  background: var(--lab-brief-bg);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(200, 230, 255, 0.05);
  overflow: hidden;
  box-sizing: border-box;
}

#warehouse-frame .warehouse-frame__items {
  flex: 1;
  min-height: 0;
  border: none;
  background: transparent;
  padding: 10px;
}

#warehouse-frame .warehouse-frame__items:has(.warehouse-frame__empty) {
  display: flex;
  align-items: center;
  justify-content: center;
}

#warehouse-frame .warehouse-frame__empty {
  grid-column: auto;
  margin: 0;
  padding: 16px 20px;
  color: var(--lab-muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1.4;
  text-align: center;
  text-transform: none;
}

#warehouse-frame .warehouse-frame__items.is-drop-target {
  border-color: transparent;
  box-shadow: none;
}

#warehouse-frame .warehouse-frame__panel.is-drop-target,
#warehouse-frame .warehouse-frame__panel:has(.warehouse-frame__items.is-drop-target) {
  border-color: var(--lab-hover-line);
  box-shadow: inset 0 0 0 1px rgba(var(--lab-glow-rgb), 0.22);
}

#warehouse-frame .warehouse-frame__panel.is-drop-target .warehouse-frame__items,
#warehouse-frame .warehouse-frame__panel.is-drop-target .warehouse-frame__list-head {
  filter: blur(5px);
  opacity: 0.45;
}

#warehouse-frame .cargo-frame__drop-hint {
  background: rgba(8, 14, 20, 0.42);
  border-color: var(--lab-hover-line);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

#warehouse-frame .cargo-frame__drop-hint-title {
  color: var(--lab-text);
  font-family: inherit;
  text-shadow: none;
}

#warehouse-frame .cargo-frame__drop-hint-sub {
  color: var(--lab-accent);
  font-family: inherit;
}

.warehouse-frame__move-bar {
  display: flex;
  flex: 0 0 auto;
  width: 100%;
  min-width: 0;
}

#warehouse-frame .warehouse-frame__move-bar .test-lab__btn {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
}

.warehouse-frame__move-bar[hidden] {
  display: none !important;
}

#warehouse-frame .warehouse-source-tabs {
  display: flex;
  flex: 0 0 auto;
  gap: 4px;
  width: 100%;
  min-width: 0;
  padding: 0;
  border: none;
  background: transparent;
  overflow: visible;
}

#warehouse-frame .warehouse-source-tab {
  flex: 1 1 0;
  min-width: 0;
  height: 26px;
  padding: 0 10px;
  border: 1px solid var(--lab-line-soft);
  border-radius: 1px;
  background: var(--lab-input-bg);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.28);
  color: var(--lab-muted);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-shadow: none;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    color 0.15s ease;
}

#warehouse-frame .warehouse-source-tab:hover:not(:disabled):not(.is-active) {
  border-color: var(--lab-line);
  color: #fff;
  background: rgba(8, 14, 22, 0.72);
}

#warehouse-frame .warehouse-source-tab.is-active {
  border-color: var(--lab-hover-line);
  background: var(--lab-btn-bg-hover);
  color: #fff;
}

#warehouse-frame .warehouse-source-tab:disabled,
#warehouse-frame .warehouse-source-tab.is-disabled {
  opacity: 0.45;
  cursor: default;
}

#warehouse-frame .test-lab__btn.is-active:not(:disabled) {
  border-color: var(--lab-hover-line);
  background: linear-gradient(
    180deg,
    rgba(110, 148, 172, 0.5) 0%,
    rgba(48, 72, 92, 0.68) 100%
  );
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 0 12px rgba(var(--lab-glow-rgb), 0.22);
}

#warehouse-frame .warehouse-frame__list-head {
  display: none;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  height: 22px;
  padding: 0 10px 0 3px;
  border-bottom: 1px solid var(--lab-line-soft);
  box-sizing: border-box;
}

#warehouse-frame .warehouse-frame__panel:has(.warehouse-frame__items.is-list) .warehouse-frame__list-head {
  display: flex;
}

#warehouse-frame .warehouse-frame__panel:has(.warehouse-frame__empty) .warehouse-frame__list-head {
  display: none;
}

#warehouse-frame .warehouse-frame__list-col {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--lab-accent);
  line-height: 1;
  white-space: nowrap;
}

#warehouse-frame .warehouse-frame__list-col--item {
  flex: 1 1 auto;
  min-width: 0;
  padding-left: 36px; /* align under name (28px icon + 8px gap) */
}

#warehouse-frame .warehouse-frame__list-col--qty {
  flex: 0 0 52px;
  width: 52px;
  text-align: right;
}

#warehouse-frame .inv-cell__qty {
  position: absolute;
  top: 50px;
  left: 0;
  right: auto;
  bottom: auto;
  z-index: 3;
  width: 64px;
  padding: 0 3px 0 0;
  box-sizing: border-box;
  text-align: right;
  color: var(--lab-accent-strong);
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.1;
  text-shadow:
    0 0 3px rgba(0, 0, 0, 0.95),
    0 1px 2px rgba(0, 0, 0, 0.9);
}

#warehouse-frame .warehouse-frame__items.is-list .inv-cell {
  gap: 8px;
  padding: 3px 10px 3px 3px;
  border-color: var(--lab-line-soft);
  border-radius: 1px;
  background: rgba(6, 12, 18, 0.28);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.22);
  transition:
    border-color 0.15s ease,
    background 0.15s ease;
}

#warehouse-frame .warehouse-frame__items.is-list .inv-cell:hover {
  border-color: var(--lab-hover-line);
  background: rgba(var(--lab-glow-rgb), 0.1);
}

#warehouse-frame .warehouse-frame__items.is-list .inv-cell__name {
  flex: 1 1 auto;
  min-width: 0;
}

#warehouse-frame .warehouse-frame__items.is-list .inv-cell__qty {
  position: static;
  flex: 0 0 52px;
  align-self: center;
  width: 52px;
  margin: 0;
  padding: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--lab-accent-strong);
  text-shadow: none;
}

#warehouse-frame .warehouse-frame__items.is-list .inv-cell__icon {
  width: 24px;
  height: 24px;
}

#warehouse-frame .warehouse-frame__items.is-list .inv-cell:hover .inv-cell__icon {
  transform: translate(-50%, -50%) scale(0.92);
}

#warehouse-frame .warehouse-frame__items.is-list .inv-cell__slot {
  overflow: hidden;
}

.warehouse-toolbar {
  display: flex;
  flex-shrink: 0;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.warehouse-toolbar__search {
  display: block;
  width: 100%;
}

.warehouse-toolbar__search-input {
  width: 100%;
  height: 30px;
  padding: 0 10px;
  border: 1px solid #23455b;
  background: #091015;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #ffffff;
  font-family: "Monda", sans-serif;
  font-size: 13px;
  font-weight: 400;
  line-height: 12px;
  text-transform: capitalize;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.5);
  outline: none;
  box-sizing: border-box;
}

.warehouse-toolbar__search-input::placeholder {
  color: #5b7a90;
  opacity: 1;
}

.warehouse-toolbar__search-input:focus {
  border-color: #355e77;
}

.warehouse-toolbar__bar {
  display: flex;
  align-items: center;
  gap: 3px;
  width: 100%;
  height: 46px;
  padding: 0 10px;
  border: 1px solid #23455b;
  background: #091015;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-sizing: border-box;
}

.warehouse-toolbar__icon-btn {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid #29526c;
  background: linear-gradient(180deg, #192d39 0%, #101e26 100%);
  color: #ffffff;
  cursor: pointer;
  box-sizing: border-box;
}

.warehouse-toolbar__icon-btn.is-active {
  border-color: #34698b;
  background: linear-gradient(180deg, #244153 0%, #193140 100%);
}

.warehouse-toolbar__icon-btn:hover {
  border-color: #34698b;
  background: linear-gradient(180deg, #244153 0%, #193140 100%);
}

.warehouse-toolbar__icon-grid {
  width: 10px;
  height: 10px;
  background:
    linear-gradient(currentColor, currentColor) left top / 4px 4px no-repeat,
    linear-gradient(currentColor, currentColor) right top / 4px 4px no-repeat,
    linear-gradient(currentColor, currentColor) left bottom / 4px 4px no-repeat,
    linear-gradient(currentColor, currentColor) right bottom / 4px 4px no-repeat;
}

.warehouse-toolbar__icon-list {
  width: 10px;
  height: 10px;
  background:
    linear-gradient(currentColor, currentColor) left top / 4px 2px no-repeat,
    linear-gradient(currentColor, currentColor) left center / 7px 2px no-repeat,
    linear-gradient(currentColor, currentColor) left bottom / 10px 2px no-repeat;
}

.warehouse-toolbar__action {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: 26px;
  padding: 0 8px;
  border: 1px solid #29526c;
  background: linear-gradient(180deg, #192d39 0%, #101e26 100%);
  color: #ffffff;
  font-family: "Monda", sans-serif;
  font-size: 11px;
  font-weight: 700;
  line-height: 10px;
  text-align: center;
  text-transform: uppercase;
  text-shadow: 0 1px 1px #000;
  cursor: pointer;
  box-sizing: border-box;
  white-space: nowrap;
}

.warehouse-toolbar__action:hover {
  border-color: #34698b;
  background: linear-gradient(180deg, #244153 0%, #193140 100%);
}

.warehouse-toolbar__action.is-active {
  border-color: #34698b;
  background: linear-gradient(180deg, #244153 0%, #193140 100%);
}

.warehouse-toolbar__action:disabled {
  opacity: 0.5;
  cursor: default;
  pointer-events: none;
}

/* Glass Lab scrollbars — all frames (workshop, warehouse, cargo, …) */
.ui-frame,
.ui-frame * {
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--lab-glow-rgb), 0.28) transparent;
}

.ui-frame::-webkit-scrollbar,
.ui-frame *::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

.ui-frame::-webkit-scrollbar-corner,
.ui-frame *::-webkit-scrollbar-corner {
  background: transparent;
}

.ui-frame::-webkit-scrollbar-track,
.ui-frame *::-webkit-scrollbar-track {
  /* Keep track clear of the bottom-right resize grip */
  margin: 4px 0 16px;
  background: transparent;
  border-radius: 0;
}

.ui-frame::-webkit-scrollbar-thumb,
.ui-frame *::-webkit-scrollbar-thumb {
  background: linear-gradient(
    180deg,
    rgba(var(--lab-glow-rgb), 0.22) 0%,
    rgba(120, 148, 168, 0.28) 55%,
    rgba(78, 100, 118, 0.32) 100%
  );
  border: 1px solid rgba(164, 194, 214, 0.14);
  border-radius: 1px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.ui-frame::-webkit-scrollbar-thumb:hover,
.ui-frame *::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(
    180deg,
    rgba(var(--lab-glow-rgb), 0.38) 0%,
    rgba(140, 168, 188, 0.4) 55%,
    rgba(96, 122, 142, 0.42) 100%
  );
  border-color: rgba(164, 194, 214, 0.28);
}

.ui-frame::-webkit-scrollbar-thumb:active,
.ui-frame *::-webkit-scrollbar-thumb:active {
  background: rgba(var(--lab-glow-rgb), 0.45);
}

.warehouse-frame__items {
  display: grid;
  flex: 1;
  grid-template-columns: repeat(auto-fill, 64px);
  gap: 10px;
  align-content: start;
  justify-content: start;
  min-width: calc(64px * 3 + 10px * 2);
  min-height: 0;
  padding: 12px;
  overflow: auto;
  border: 1px solid #23455b;
  background: transparent;
  box-sizing: border-box;
}

.warehouse-frame__empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 16px 20px;
  color: #5f849e;
  font-family: "Monda", sans-serif;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: none;
  box-sizing: border-box;
}

.warehouse-frame__move-bar {
  flex: 0 0 auto;
}

.warehouse-frame__move-bar[hidden] {
  display: none !important;
}

.warehouse-frame__items.is-select-move .inv-cell.is-selected .inv-cell__slot,
.inv-cell.is-selected .inv-cell__slot {
  border-color: #599cc7;
  box-shadow:
    inset 0 0 0 1px rgba(89, 156, 199, 0.45),
    0 0 10px rgba(89, 156, 199, 0.25);
}

.warehouse-frame__items.is-select-move .inv-cell.is-selected .inv-cell__name {
  color: #ffffff;
}

.warehouse-frame__items.is-list {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-content: start;
  gap: 3px;
  min-width: 0;
}

.inv-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 64px;
  min-height: 95px;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: center;
}

.warehouse-frame__items.is-list .inv-cell {
  flex: 0 0 36px;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 36px;
  min-height: 36px;
  max-height: 36px;
  padding: 3px 10px 3px 3px;
  border: 1px solid #23455b;
  background: #091015;
  box-sizing: border-box;
  text-align: left;
  overflow: visible;
}

.warehouse-frame__items.is-list .inv-cell:hover {
  border-color: #34698b;
  background: linear-gradient(180deg, #244153 0%, #193140 100%);
}

.inv-cell:focus-visible {
  outline: 1px solid #34698b;
  outline-offset: 2px;
}

.inv-cell__slot {
  position: relative;
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  overflow: visible;
  border: 1px solid #23455b;
  background: #0e1922;
  box-sizing: border-box;
}

.warehouse-frame__items.is-list .inv-cell__slot {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border-color: #23455b;
  background: #0e1922;
}

.warehouse-frame__items.is-list .inv-cell:hover .inv-cell__slot {
  border-color: #34698b;
  background: radial-gradient(ellipse 50% 50% at 50% 50%, #33607d 0%, #234052 100%);
}

.warehouse-frame__items.is-list .inv-cell__corner {
  width: 4px;
  height: 4px;
}

.warehouse-frame__items.is-list .inv-cell__glow {
  width: 20px;
  height: 20px;
  filter: blur(4px);
}

.warehouse-frame__items.is-list .inv-cell__icon {
  left: 2px;
  top: 2px;
  width: 22px;
  height: 22px;
}

.inv-cell__slot::before {
  content: "";
  position: absolute;
  inset: 1px;
  background: #0e1921;
  pointer-events: none;
}

.warehouse-frame__items.is-list .inv-cell__slot::before {
  display: none;
}

.inv-cell__corner {
  position: absolute;
  z-index: 4;
  width: 6px;
  height: 6px;
  pointer-events: none;
  user-select: none;
}

.inv-cell__corner--tl {
  top: -1px;
  left: -1px;
}

.inv-cell__corner--tr {
  top: -1px;
  right: -1px;
  transform: rotate(90deg);
}

.inv-cell__corner--br {
  right: -1px;
  bottom: -1px;
  transform: rotate(180deg);
}

.inv-cell__corner--bl {
  bottom: -1px;
  left: -1px;
  transform: rotate(270deg);
}

.inv-cell__glow {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  width: 45px;
  height: 45px;
  border-radius: 9999px;
  background: #d9d9d9;
  mix-blend-mode: overlay;
  filter: blur(7.5px);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.inv-cell__icon {
  position: absolute;
  left: 3px;
  top: 3px;
  z-index: 2;
  display: block;
  width: 56px;
  height: 56px;
  max-width: none;
  object-fit: contain;
  object-position: center;
  pointer-events: none;
  user-select: none;
}

.inv-cell__qty {
  position: absolute;
  top: 50px;
  right: 4px;
  z-index: 3;
  color: #ffffff;
  font-family: "Monda", sans-serif;
  font-size: 10px;
  font-weight: 500;
  line-height: 10px;
  text-align: right;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

.warehouse-frame__items.is-list .inv-cell__qty {
  position: static;
  flex: 0 0 52px;
  width: 52px;
  flex-shrink: 0;
  margin-left: auto;
  padding: 0;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: #ffffff;
}

.inv-cell__name {
  display: block;
  width: 64px;
  margin-top: 5px;
  color: #81aecd;
  font-family: "Monda", sans-serif;
  font-size: 12px;
  font-weight: 400;
  line-height: 13px;
  text-align: center;
  text-transform: capitalize;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.5);
  word-wrap: break-word;
}

.warehouse-frame__items.is-list .inv-cell__name {
  width: auto;
  min-width: 0;
  margin-top: 0;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inv-cell:hover .inv-cell__slot {
  border-color: #34698b;
  background: radial-gradient(ellipse 50% 50% at 50% 50%, #33607d 0%, #234052 100%);
}

.inv-cell:hover .inv-cell__slot::before {
  display: none;
}

.inv-cell:hover .inv-cell__name {
  color: #ffffff;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Capsule Glass — warehouse source tabs + filter pills */
.warehouse-source-tabs,
.warehouse-filter-pills {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
}

.warehouse-filter-pills {
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 1px;
}

.warehouse-source-tab,
.warehouse-filter-pill {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  height: 26px;
  min-height: 26px;
  max-height: 26px;
  padding: 0 12px;
  border: 1px solid rgba(164, 194, 214, 0.28);
  border-radius: 1px;
  background: rgba(6, 12, 18, 0.55);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.28);
  color: #9aa8b5;
  font-family: "Rajdhani", "Monda", system-ui, sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  box-sizing: border-box;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease;
}

.warehouse-source-tab {
  flex: 1 1 0;
  min-width: 0;
}

.warehouse-source-tab:hover:not(:disabled):not(.is-active),
.warehouse-filter-pill:hover:not(.is-active) {
  border-color: rgba(164, 194, 214, 0.5);
  background: rgba(8, 14, 22, 0.72);
  color: #fff;
}

.warehouse-source-tab.is-active,
.warehouse-filter-pill.is-active {
  border-color: rgba(210, 230, 245, 0.65);
  background: linear-gradient(
    180deg,
    rgba(110, 148, 172, 0.5) 0%,
    rgba(48, 72, 92, 0.68) 100%
  );
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 0 12px rgba(89, 156, 199, 0.22);
}

.warehouse-source-tab:disabled,
.warehouse-source-tab.is-disabled {
  border-color: rgba(164, 194, 214, 0.14);
  background: rgba(10, 16, 24, 0.35);
  color: rgba(170, 183, 195, 0.38);
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.72;
  filter: grayscale(0.25);
  pointer-events: none;
}

.ui-frame.is-hidden {
  display: none;
}

.ui-frame.is-minimized {
  width: 250px;
  height: calc(var(--frame-inset) * 2 + var(--frame-cell-h));
  min-height: 0;
  min-width: 250px;
}

.ui-frame.is-minimized .ui-frame__body,
.ui-frame.is-minimized .ui-frame__rule,
.ui-frame.is-minimized .ui-frame__resize {
  display: none;
}

.ui-frame.is-minimized .ui-frame__chrome {
  gap: 0;
}

.ui-frame.is-minimized .ui-frame__header {
  gap: 0;
  height: var(--frame-cell-h);
  border: 1px solid var(--frame-cell-border);
  background: linear-gradient(180deg, var(--frame-cell-from) 0%, var(--frame-cell-to) 100%);
  box-sizing: border-box;
}

.ui-frame.is-minimized .ui-frame__title-cell,
.ui-frame.is-minimized .ui-frame__tool:not(.test-lab__tool) {
  border: none;
  background: transparent;
  height: 100%;
}

.ui-frame.is-minimized .ui-frame__title-cell.test-lab__drag,
.ui-frame.is-minimized .ui-frame__tool.test-lab__tool {
  border: none;
  height: 100%;
}

.ui-frame.is-minimized .ui-frame__tool.test-lab__tool:hover {
  background: rgba(var(--lab-glow-rgb), 0.12);
  color: #ffffff;
}

.ui-frame.is-minimized .ui-frame__tool:not(.test-lab__tool) {
  border-left: 1px solid var(--frame-cell-border);
}

.ui-frame.is-minimized .ui-frame__icon-min {
  display: none;
}

.ui-frame.is-minimized .ui-frame__icon-restore {
  display: block;
}

.ui-frame__panel {
  position: absolute;
  inset: 0;
  border: 1px solid var(--frame-border);
  background: var(--frame-fill);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-sizing: border-box;
  pointer-events: none;
  transition:
    background 0.15s ease,
    border-color 0.15s ease;
}

.ui-frame:hover .ui-frame__panel {
  background: #0c151c;
  border-color: #355e77;
}

.ui-frame__corner {
  position: absolute;
  width: 6px;
  height: 6px;
  pointer-events: none;
  z-index: 2;
}

.ui-frame__corner--tl {
  top: 0;
  left: 0;
}

.ui-frame__corner--tr {
  top: 0;
  right: 0;
  transform: rotate(90deg);
}

.ui-frame__corner--br {
  right: 0;
  bottom: 0;
  transform: rotate(180deg);
}

.ui-frame__corner--bl {
  bottom: 0;
  left: 0;
  transform: rotate(270deg);
}

.ui-frame__chrome {
  position: absolute;
  inset: var(--frame-inset);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--frame-gap);
  min-height: 0;
  z-index: 1;
}

.ui-frame__header {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: var(--frame-gap);
}

.ui-frame__title-cell,
.ui-frame__tool {
  height: var(--frame-cell-h);
  border: 1px solid var(--frame-cell-border);
  background: linear-gradient(180deg, var(--frame-cell-from) 0%, var(--frame-cell-to) 100%);
  box-sizing: border-box;
}

.ui-frame__title-cell {
  display: flex;
  flex: 1;
  align-items: center;
  min-width: 0;
  cursor: grab;
}

.ui-frame__title-cell:active {
  cursor: grabbing;
}

.ui-frame__title {
  margin: 0;
  padding: 0 10px;
  color: #ffffff;
  font-family: "Monda", sans-serif;
  font-size: 12px;
  font-weight: 700;
  line-height: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-shadow: 0 1px 1px #000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ui-frame__tool {
  position: relative;
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: var(--frame-tool);
  padding: 0;
  color: #ffffff;
  cursor: pointer;
}

.ui-frame__tool:hover {
  border-color: #34698b;
  background: linear-gradient(180deg, #244153 0%, #193140 100%);
}

.ui-frame__tool:active {
  border-color: #34698b;
  background: linear-gradient(180deg, #244153 0%, #193140 100%);
}

.ui-frame__icon-grid {
  width: 10px;
  height: 10px;
  background:
    linear-gradient(#fff, #fff) left top / 4px 4px no-repeat,
    linear-gradient(#fff, #fff) right top / 4px 4px no-repeat,
    linear-gradient(#fff, #fff) left bottom / 4px 4px no-repeat,
    linear-gradient(#fff, #fff) right bottom / 4px 4px no-repeat;
}

.ui-frame__icon-min {
  display: block;
  width: 10px;
  height: 2px;
  background: #ffffff;
  box-shadow: 0 1px 1px #000;
}

.ui-frame__icon-restore {
  display: none;
  width: 10px;
  height: 10px;
  pointer-events: none;
  filter: drop-shadow(0 1px 1px #000);
  object-fit: contain;
}

.ui-frame__icon-close {
  position: relative;
  display: block;
  width: 10px;
  height: 10px;
  filter: drop-shadow(0 1px 1px #000);
}

.ui-frame__icon-close::before,
.ui-frame__icon-close::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 11px;
  height: 2px;
  background: #ffffff;
}

.ui-frame__icon-close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.ui-frame__icon-close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.ui-frame__rule {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-between;
  gap: var(--frame-gap);
  width: 100%;
}

.ui-frame__rule-bar {
  height: 3px;
  background: var(--frame-rule);
}

.ui-frame__rule-bar--left {
  flex: 1;
  min-width: 0;
}

.ui-frame__rule-bar--right {
  width: calc(var(--frame-tool) * 3 + var(--frame-gap) * 2);
  flex-shrink: 0;
}

.ui-frame__body {
  position: relative;
  flex: 1;
  min-height: 0;
  /* Room for corner resize handle so scrollbars don't cover it */
  padding-right: 2px;
  padding-bottom: 12px;
  box-sizing: border-box;
}

.ui-frame__content {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
}

.ui-frame__resize {
  position: absolute;
  right: 4px;
  bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 8px;
  height: 8px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: nwse-resize;
  z-index: 3;
}

.ui-frame--resize-y .ui-frame__resize {
  left: 0;
  right: 0;
  bottom: 0;
  width: auto;
  height: 12px;
  cursor: ns-resize;
}

.ui-frame--resize-y .ui-frame__resize img {
  display: none;
}

.ui-frame--resize-y .ui-frame__resize::after {
  left: 0;
  right: 0;
  bottom: 0;
  width: auto;
  height: 14px;
}

.ui-frame--no-resize .ui-frame__resize {
  display: none;
}

.ui-frame__resize img {
  display: block;
  width: 8px;
  height: 8px;
  pointer-events: none;
}

/* Larger hit area without changing the visible handle */
.ui-frame__resize::after {
  content: "";
  position: absolute;
  right: -6px;
  bottom: -6px;
  width: 20px;
  height: 20px;
}

/* —— Demo tutorial (VESPER brief) —— */
.demo-tutorial {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  /* No opacity on this root — it isolates stacking and kills child backdrop-filter glass */
  background: transparent;
  visibility: hidden;
  pointer-events: none;
}

.demo-tutorial.is-open {
  visibility: visible;
  pointer-events: auto;
}

.demo-tutorial__veil {
  position: absolute;
  inset: 0;
  z-index: 0;
  /* Dim dock behind brief — fade this layer only (not the panel, or glass breaks) */
  background: rgba(1, 4, 10, 0.72);
  opacity: 0;
  transition: opacity 0.28s ease;
  pointer-events: none;
}

.demo-tutorial.is-open .demo-tutorial__veil {
  opacity: 1;
}

.demo-tutorial__panel {
  position: relative;
  z-index: 1;
  width: min(640px, calc(100vw - 32px));
  padding: 12px 14px 14px;
  border: 1px solid var(--lab-line-soft, rgba(164, 194, 214, 0.16));
  border-radius: var(--lab-radius, 2px);
  background:
    var(--lab-fx, none),
    linear-gradient(180deg, var(--lab-bg, rgba(8, 14, 22, 0.42)) 0%, var(--lab-bg-2, rgba(4, 8, 14, 0.58)) 100%);
  backdrop-filter: blur(22px) saturate(1.3);
  -webkit-backdrop-filter: blur(22px) saturate(1.3);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.4) inset,
    inset 0 1px 0 rgba(200, 230, 255, 0.08),
    0 18px 40px rgba(0, 0, 0, 0.45);
  font-family: var(--lab-font, "Rajdhani", "Monda", system-ui, sans-serif);
  color: var(--lab-text, #f0f4f8);
  /* Opacity on this node kills frosted glass — fade the veil only */
  transform: none;
  pointer-events: auto;
}

.demo-tutorial.is-open .demo-tutorial__panel {
  transform: none;
}

.demo-tutorial__corner {
  display: none;
}

.demo-tutorial__corner--tl {
  top: -1px;
  left: -1px;
  border-top: 2px solid #0fdbfb;
  border-left: 2px solid #0fdbfb;
}

.demo-tutorial__corner--tr {
  top: -1px;
  right: -1px;
  border-top: 2px solid #0fdbfb;
  border-right: 2px solid #0fdbfb;
}

.demo-tutorial__corner--bl {
  bottom: -1px;
  left: -1px;
  border-bottom: 2px solid #0fdbfb;
  border-left: 2px solid #0fdbfb;
}

.demo-tutorial__corner--br {
  right: -1px;
  bottom: -1px;
  border-bottom: 2px solid #0fdbfb;
  border-right: 2px solid #0fdbfb;
}

.demo-tutorial__chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 0;
  border-bottom: none;
}

.demo-tutorial__channel {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--lab-accent, #afcadb);
}

.demo-tutorial__body {
  display: grid;
  grid-template-columns: 148px 1fr;
  gap: 14px;
  align-items: start;
}

.demo-tutorial__guide {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.demo-tutorial__guide-frame {
  position: relative;
  width: 132px;
  height: 132px;
  overflow: hidden;
  border: 1px solid var(--lab-line, rgba(164, 194, 214, 0.3));
  border-radius: 1px;
  background: #050c14;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35);
}

.demo-tutorial__guide-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  animation: demo-guide-breathe 4.8s ease-in-out infinite;
}

.demo-tutorial__guide-scan {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(15, 219, 251, 0.14) 48%,
    transparent 100%
  );
  background-size: 100% 220%;
  animation: demo-guide-scan 2.8s linear infinite;
  pointer-events: none;
  mix-blend-mode: screen;
}

.demo-tutorial__guide-pulse {
  position: absolute;
  inset: -1px;
  border: 1px solid rgba(15, 219, 251, 0.25);
  animation: demo-guide-pulse 2.4s ease-in-out infinite;
  pointer-events: none;
}

.demo-tutorial__guide-id {
  margin: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(158, 200, 224, 0.75);
}

.demo-tutorial__copy {
  min-width: 0;
}

.demo-tutorial__step {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(158, 200, 224, 0.7);
}

.demo-tutorial__title {
  margin: 0 0 10px;
  font-size: clamp(1.15rem, 2.4vw, 1.45rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.25;
  color: #e8f4fc;
}

.demo-tutorial__text {
  margin: 0 0 12px;
  font-size: 0.95rem;
  line-height: 1.45;
  color: rgba(200, 220, 235, 0.88);
}

.demo-tutorial__tip {
  margin: 0 0 12px;
  padding: 6px 9px;
  border: 1px solid var(--lab-line-soft, rgba(164, 194, 214, 0.16));
  border-left: 2px solid var(--lab-line-hot, rgba(183, 213, 230, 0.55));
  border-radius: 1px;
  background: rgba(6, 12, 18, 0.55);
  font-size: 12px;
  line-height: 1.35;
  color: var(--lab-accent, #afcadb);
}

.demo-tutorial__dots {
  display: flex;
  gap: 6px;
}

.demo-tutorial__dot {
  width: 6px;
  height: 6px;
  border: 1px solid var(--lab-line, rgba(164, 194, 214, 0.3));
  border-radius: 1px;
  background: transparent;
}

.demo-tutorial__dot.is-active {
  background: var(--lab-accent-strong, #e6eff6);
  border-color: var(--lab-hover-line, rgba(191, 218, 236, 0.75));
  box-shadow: none;
}

.demo-tutorial__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
  padding-top: 0;
  border-top: none;
}

@keyframes demo-guide-breathe {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.03);
  }
}

@keyframes demo-guide-scan {
  0% {
    background-position: 0 -40%;
  }
  100% {
    background-position: 0 140%;
  }
}

@keyframes demo-guide-pulse {
  0%,
  100% {
    opacity: 0.35;
    box-shadow: 0 0 0 0 rgba(15, 219, 251, 0);
  }
  50% {
    opacity: 1;
    box-shadow: 0 0 18px rgba(15, 219, 251, 0.25);
  }
}

@media (max-width: 640px) {
  .demo-tutorial__body {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .demo-tutorial__tip {
    text-align: left;
  }

  .demo-tutorial__dots {
    justify-content: center;
  }

  .demo-tutorial__actions {
    justify-content: stretch;
  }

  .demo-tutorial__btn {
    flex: 1;
  }
}

/* —— Vesper coach (Glass Lab, bottom-left) —— */
.vesper-guide {
  position: fixed;
  left: 58px;
  bottom: 18px;
  z-index: 90;
  width: min(380px, calc(100vw - 72px));
  padding: 10px 12px 12px;
  border: 1px solid var(--lab-line-soft, rgba(164, 194, 214, 0.16));
  border-radius: var(--lab-radius, 2px);
  background:
    var(--lab-fx, none),
    linear-gradient(180deg, var(--lab-bg, rgba(8, 14, 22, 0.42)) 0%, var(--lab-bg-2, rgba(4, 8, 14, 0.58)) 100%);
  backdrop-filter: blur(22px) saturate(1.3);
  -webkit-backdrop-filter: blur(22px) saturate(1.3);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.4) inset,
    inset 0 1px 0 rgba(200, 230, 255, 0.08),
    0 16px 36px rgba(0, 0, 0, 0.45);
  font-family: var(--lab-font, "Rajdhani", "Monda", system-ui, sans-serif);
  color: var(--lab-text, #f0f4f8);
  opacity: 0;
  visibility: hidden;
  transform: none;
  transition:
    opacity 0.28s ease,
    visibility 0.28s ease;
  pointer-events: none;
}

.vesper-guide.is-open {
  opacity: 1;
  visibility: visible;
  transform: none;
  pointer-events: auto;
}

.vesper-guide__corner {
  display: none;
}

.vesper-guide__chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  padding-bottom: 0;
  border-bottom: none;
}

.vesper-guide__channel {
  margin: 0;
  color: var(--lab-accent, #afcadb);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.vesper-guide__body {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 12px;
  align-items: start;
}

/* Same portrait stack as the Scout Channel brief */
.vesper-guide__guide {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.vesper-guide__guide-frame {
  position: relative;
  width: 84px;
  height: 84px;
  overflow: hidden;
  border: 1px solid var(--lab-line, rgba(164, 194, 214, 0.3));
  border-radius: 1px;
  background: #050c14;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35);
}

.vesper-guide__guide-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  animation: demo-guide-breathe 4.8s ease-in-out infinite;
}

.vesper-guide__guide-scan {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(149, 187, 212, 0.14) 48%,
    transparent 100%
  );
  background-size: 100% 220%;
  animation: demo-guide-scan 2.8s linear infinite;
  pointer-events: none;
  mix-blend-mode: screen;
}

.vesper-guide__guide-pulse {
  position: absolute;
  inset: -1px;
  border: 1px solid rgba(149, 187, 212, 0.25);
  animation: demo-guide-pulse 2.4s ease-in-out infinite;
  pointer-events: none;
}

.vesper-guide__guide-id {
  margin: 0;
  color: var(--lab-muted, rgba(170, 183, 195, 0.78));
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-align: center;
  line-height: 1.2;
  text-transform: uppercase;
}

.vesper-guide__copy {
  min-width: 0;
}

.vesper-guide__step {
  margin: 0 0 3px;
  color: var(--lab-muted, rgba(170, 183, 195, 0.78));
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.vesper-guide__title {
  margin: 0 0 5px;
  color: var(--lab-text, #f0f4f8);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.25;
}

.vesper-guide__text {
  margin: 0;
  color: var(--lab-muted, rgba(170, 183, 195, 0.78));
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
}

.vesper-guide__tip {
  margin: 7px 0 0;
  padding: 5px 8px;
  border: 1px solid var(--lab-line-soft, rgba(164, 194, 214, 0.16));
  border-left: 2px solid var(--lab-line-hot, rgba(183, 213, 230, 0.55));
  border-radius: 1px;
  background: rgba(6, 12, 18, 0.55);
  color: var(--lab-accent, #afcadb);
  font-size: 11px;
  line-height: 1.35;
  box-shadow: none;
}

.vesper-guide__progress {
  margin-top: 8px;
  height: 4px;
  border: 1px solid var(--lab-line-soft, rgba(164, 194, 214, 0.16));
  border-radius: 1px;
  background: rgba(6, 12, 18, 0.7);
  overflow: hidden;
}

.vesper-guide__progress-fill {
  display: block;
  height: 100%;
  width: var(--vesper-progress, 0%);
  background: linear-gradient(90deg, rgba(74, 104, 126, 0.8), rgba(149, 187, 212, 0.95));
  box-shadow: none;
  transition: width 0.25s ease;
}

.vesper-guide__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
  padding-top: 0;
  border-top: none;
}

.vesper-guide__btn[hidden] {
  display: none;
}

/* Animated tutorial pointer */
.tutorial-arrow {
  position: fixed;
  z-index: 45;
  width: 36px;
  height: 36px;
  margin: 0;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.tutorial-arrow.is-visible {
  display: block;
}

.tutorial-arrow__pulse {
  position: absolute;
  inset: 4px;
  border: 2px solid rgba(15, 219, 251, 0.55);
  border-radius: 50%;
  animation: tutorial-arrow-pulse 1.4s ease-out infinite;
}

.tutorial-arrow__chevron {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 14px;
  border-right: 3px solid #0fdbfb;
  border-bottom: 3px solid #0fdbfb;
  box-shadow: 2px 2px 8px rgba(15, 219, 251, 0.35);
  transform: translate(-50%, -50%) rotate(45deg);
  animation: tutorial-arrow-nudge 0.9s ease-in-out infinite;
}

.tutorial-arrow[data-from="right"] .tutorial-arrow__chevron {
  transform: translate(-30%, -50%) rotate(135deg);
  animation-name: tutorial-arrow-nudge-x;
}

.tutorial-arrow[data-from="left"] .tutorial-arrow__chevron {
  transform: translate(-70%, -50%) rotate(-45deg);
  animation-name: tutorial-arrow-nudge-x-rev;
}

.tutorial-arrow[data-from="top"] .tutorial-arrow__chevron {
  /* Arrow sits above the target — chevron points down at it */
  transform: translate(-50%, -50%) rotate(45deg);
  animation-name: tutorial-arrow-nudge-y-rev;
}

.tutorial-arrow[data-from="bottom"] .tutorial-arrow__chevron {
  transform: translate(-50%, -70%) rotate(45deg);
  animation-name: tutorial-arrow-nudge-y-rev;
}

@keyframes tutorial-arrow-pulse {
  0% {
    transform: scale(0.65);
    opacity: 0.9;
  }
  100% {
    transform: scale(1.45);
    opacity: 0;
  }
}

@keyframes tutorial-arrow-nudge-x {
  0%,
  100% {
    transform: translate(-20%, -50%) rotate(135deg);
  }
  50% {
    transform: translate(-45%, -50%) rotate(135deg);
  }
}

@keyframes tutorial-arrow-nudge-x-rev {
  0%,
  100% {
    transform: translate(-80%, -50%) rotate(-45deg);
  }
  50% {
    transform: translate(-55%, -50%) rotate(-45deg);
  }
}

@keyframes tutorial-arrow-nudge-y {
  0%,
  100% {
    transform: translate(-50%, -15%) rotate(-135deg);
  }
  50% {
    transform: translate(-50%, -40%) rotate(-135deg);
  }
}

@keyframes tutorial-arrow-nudge-y-rev {
  0%,
  100% {
    transform: translate(-50%, -85%) rotate(45deg);
  }
  50% {
    transform: translate(-50%, -60%) rotate(45deg);
  }
}

@media (max-width: 640px) {
  .vesper-guide {
    left: 8px;
    bottom: 8px;
    width: calc(100vw - 16px);
  }

  .vesper-guide__body {
    grid-template-columns: 72px 1fr;
  }

  .vesper-guide__guide-frame {
    width: 68px;
    height: 68px;
  }
}

.side-menu__btn.is-tutorial-target,
.ship-panel__action.is-tutorial-target,
#ship-panel.is-tutorial-target {
  box-shadow: 0 0 0 2px rgba(15, 219, 251, 0.85), 0 0 18px rgba(15, 219, 251, 0.35);
  animation: tutorial-target-glow 1.2s ease-in-out infinite;
}

@keyframes tutorial-target-glow {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.25);
  }
}

/**
 * Capsule Glass — production theme overrides (content / chrome companions).
 * Window shell, fade, tools, resize, tips: shared `.test-lab__*` rules in style.css
 * (promoted from Glass Lab). Tokens: themes/capsule-glass/tokens.css
 */

/* ── Global type ─────────────────────────────────────────────────────────── */
html,
body {
  font-family: var(--cg-font);
  color: var(--cg-muted);
}

body.theme-capsule-glass {
  /* Neutralize legacy cell chrome — real look is .test-lab__* shell in style.css */
  --frame-inset: 0px;
  --frame-gap: 0px;
  --frame-fill: transparent;
  --frame-border: transparent;
  --frame-cell-from: transparent;
  --frame-cell-to: transparent;
  --frame-cell-border: transparent;
  --frame-rule: transparent;
}

/* .ui-frame redefines --frame-* locally — force glass flush shell */
body.theme-capsule-glass .ui-frame {
  --frame-inset: 0px;
  --frame-gap: 0px;
  --frame-fill: transparent;
  --frame-border: transparent;
  --frame-cell-from: transparent;
  --frame-cell-to: transparent;
  --frame-cell-border: transparent;
  --frame-rule: transparent;
  font-family: var(--cg-font);
}

/* ── Side menu — Glass Lab chrome (see #side-menu in style.css) ─────────── */
#side-menu {
  font-family: var(--cg-font);
}

.side-menu__btn:disabled {
  opacity: 0.32;
}

/* ── Shared toolbar / actions (Ship, Warehouse, Market, Workshop, Cargo) ─ */
.warehouse-toolbar__search-input {
  height: var(--cg-control-h);
  border: 1px solid var(--cg-line-soft);
  border-radius: var(--cg-radius);
  background: var(--cg-input-bg);
  color: var(--cg-text);
  font-family: var(--cg-font);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-shadow: none;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.28);
}

.warehouse-toolbar__search-input::placeholder {
  color: rgba(170, 183, 195, 0.45);
  text-transform: uppercase;
}

.warehouse-toolbar__search-input:focus {
  border-color: var(--cg-line);
  background: var(--cg-input-bg-focus);
  outline: none;
}

.warehouse-toolbar__bar {
  height: auto;
  min-height: var(--cg-control-h);
  padding: 0;
  gap: 6px;
  border: none;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.warehouse-toolbar__icon-btn {
  border: 1px solid var(--cg-line-soft);
  border-radius: var(--cg-radius);
  background: var(--cg-btn-bg);
  color: var(--cg-accent-strong);
  box-shadow: none;
}

.warehouse-toolbar__icon-btn:hover,
.warehouse-toolbar__icon-btn.is-active {
  border-color: var(--cg-hover-line);
  background: var(--cg-btn-bg-hover);
  color: #fff;
}

.warehouse-toolbar__action {
  border: 1px solid var(--cg-line-hot);
  border-radius: var(--cg-radius);
  background: var(--cg-btn-bg);
  color: var(--cg-accent-strong);
  font-family: var(--cg-font);
  font-size: var(--cg-control-text);
  font-weight: 500;
  letter-spacing: 0.12em;
  line-height: 1;
  text-shadow: none;
  box-shadow: 0 0 8px rgba(var(--cg-glow-rgb), 0.06);
}

.warehouse-toolbar__action:hover:not(:disabled) {
  border-color: var(--cg-hover-line);
  background: var(--cg-btn-bg-hover);
  color: #fff;
  box-shadow: 0 0 12px rgba(var(--cg-glow-rgb), 0.18);
}

.warehouse-toolbar__action.is-active:not(:disabled) {
  border-color: var(--cg-hover-line);
  background: var(--cg-btn-bg-active);
  color: #fff;
}

.warehouse-toolbar__action:disabled {
  border-color: rgba(164, 194, 214, 0.14);
  background: rgba(10, 16, 24, 0.35);
  color: rgba(170, 183, 195, 0.38);
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.72;
}

/* ── Inventory cells ────────────────────────────────────────────────────── */
.inv-cell {
  font-family: var(--cg-font);
}

.inv-cell__slot {
  border: 1px solid var(--cg-line);
  border-radius: 1px;
  background: var(--cg-slot-bg);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.3),
    0 0 10px rgba(var(--cg-glow-rgb), 0.08);
}

.inv-cell:hover .inv-cell__slot,
.warehouse-frame__items.is-list .inv-cell:hover {
  border-color: var(--cg-hover-line);
}

.inv-cell:hover .inv-cell__slot {
  background: var(--cg-slot-bg-hover);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.25),
    0 0 12px rgba(var(--cg-glow-rgb), 0.18);
}

.inv-cell__name {
  color: var(--cg-muted);
  font-family: var(--cg-font);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-shadow: none;
}

.inv-cell:hover .inv-cell__name {
  color: #fff;
}

.inv-cell__qty {
  color: var(--cg-accent-strong);
  font-family: var(--cg-font);
  font-weight: 700;
}

.warehouse-frame__items.is-list .inv-cell {
  border: 1px solid var(--cg-line-soft);
  border-radius: var(--cg-radius);
  background: var(--cg-input-bg);
}

.warehouse-frame__items.is-list .inv-cell:hover {
  background: rgba(var(--cg-glow-rgb), 0.1);
}

.warehouse-frame__items.is-select-move .inv-cell.is-selected .inv-cell__slot,
.inv-cell.is-selected .inv-cell__slot {
  border-color: var(--cg-hover-line);
  box-shadow:
    inset 0 0 0 1px rgba(var(--cg-glow-rgb), 0.35),
    0 0 10px rgba(var(--cg-glow-rgb), 0.2);
}

/* ── Ship panel action chips ────────────────────────────────────────────── */
.ship-panel__action {
  border: 1px solid var(--cg-line-soft) !important;
  border-radius: var(--cg-radius);
  background: rgba(6, 12, 18, 0.55) !important;
  color: var(--cg-accent-strong) !important;
  font-family: var(--cg-font) !important;
  font-size: 10px !important;
  font-weight: 600 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase;
  text-shadow: none !important;
}

.ship-panel__action:hover,
.ship-panel__action.is-active {
  border-color: var(--cg-hover-line) !important;
  background: rgba(var(--cg-glow-rgb), 0.16) !important;
  color: #fff !important;
}

/* ── Pilot / ship / scan / workshop denser type ─────────────────────────── */
.ship-fit,
.scan-frame__content,
.workshop-frame__content,
.cargo-frame__content,
.market-frame__content,
.resource-info-frame .ui-frame__content {
  font-family: var(--cg-font);
  color: var(--cg-text);
}

.ship-fit__actions.warehouse-toolbar__bar {
  height: auto;
  min-height: var(--cg-control-h);
  padding: 0;
  gap: 8px;
  border: none;
  background: transparent;
}

.ship-slot__frame,
.workshop-slot .inv-cell__slot {
  border-color: var(--cg-line);
  background: var(--cg-slot-bg);
}

/* ── Sector node modal — match Glass Lab window shell ─────────────────────── */
.sector-node-modal {
  border: 1px solid var(--cg-line-soft) !important;
  border-radius: var(--cg-radius) !important;
  background:
    var(--cg-fx),
    linear-gradient(180deg, var(--cg-bg) 0%, var(--cg-bg-2) 100%) !important;
  backdrop-filter: blur(18px) saturate(1.25) !important;
  -webkit-backdrop-filter: blur(18px) saturate(1.25) !important;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.4) inset,
    inset 0 1px 0 rgba(200, 230, 255, 0.08),
    0 14px 32px rgba(0, 0, 0, 0.5) !important;
  font-family: var(--cg-font) !important;
  color: var(--cg-text) !important;
}

.sector-node-modal.is-station {
  --snm-accent: var(--cg-accent);
}

/* ── Demo brief + Vesper coach (full Capsule Glass) ─────────────────────── */
.demo-tutorial__corner,
.vesper-guide__corner {
  display: none !important;
}

.demo-tutorial__panel,
.vesper-guide {
  border: 1px solid var(--cg-line-soft) !important;
  border-radius: var(--cg-radius) !important;
  background:
    var(--cg-fx),
    linear-gradient(180deg, var(--cg-bg) 0%, var(--cg-bg-2) 100%) !important;
  backdrop-filter: blur(22px) saturate(1.3) !important;
  -webkit-backdrop-filter: blur(22px) saturate(1.3) !important;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.4) inset,
    inset 0 1px 0 rgba(200, 230, 255, 0.08),
    0 18px 40px rgba(0, 0, 0, 0.45) !important;
  font-family: var(--cg-font) !important;
  color: var(--cg-text) !important;
}

.demo-tutorial__channel,
.vesper-guide__channel {
  color: var(--cg-accent) !important;
  font-family: var(--cg-font) !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: 0.14em !important;
  text-transform: uppercase !important;
}

.demo-tutorial__title,
.vesper-guide__title,
[data-vesper-title] {
  color: var(--cg-text) !important;
  font-family: var(--cg-font) !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  letter-spacing: 0.04em !important;
}

.demo-tutorial__text,
.vesper-guide__body,
[data-vesper-body],
.demo-tutorial__step,
[data-vesper-step] {
  color: var(--cg-muted) !important;
  font-family: var(--cg-font) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  line-height: 1.45 !important;
}

.demo-tutorial__tip,
[data-vesper-tip] {
  border: 1px solid var(--cg-line-soft) !important;
  border-left: 2px solid var(--cg-line-hot) !important;
  border-radius: var(--cg-radius) !important;
  background: rgba(6, 12, 18, 0.55) !important;
  color: var(--cg-accent) !important;
  font-family: var(--cg-font) !important;
  font-size: 12px !important;
  box-shadow: none !important;
}

.demo-tutorial__guide-id,
.vesper-guide__guide-id {
  color: var(--cg-muted) !important;
  font-family: var(--cg-font) !important;
  letter-spacing: 0.12em !important;
  text-transform: uppercase !important;
}

.demo-tutorial__guide-frame,
.vesper-guide__guide-frame,
.vesper-guide__avatar-frame {
  border: 1px solid var(--cg-line) !important;
  border-radius: var(--cg-radius) !important;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35) !important;
}

.demo-tutorial__dot {
  border-color: var(--cg-line) !important;
  background: transparent !important;
  border-radius: 1px !important;
}

.demo-tutorial__dot.is-active {
  background: var(--cg-accent-strong) !important;
  border-color: var(--cg-hover-line) !important;
}

.prototype-banner {
  border-color: var(--cg-line-soft) !important;
  background: rgba(6, 12, 18, 0.88) !important;
  font-family: var(--cg-font) !important;
  color: var(--cg-muted) !important;
}

/* ── Compact interiors ──────────────────────────────────────────────────── */
.warehouse-frame__content,
.cargo-frame__content,
.market-frame__content,
.workshop-frame__content,
.ship-fit-panel__content {
  gap: 10px !important;
  padding: 12px !important;
}

#scan-frame .scan-frame__content {
  gap: 12px !important;
  padding: 12px !important;
}

#pilot-frame .pilot-frame__content {
  gap: 0 !important;
  padding: 12px !important;
}

#cargo-frame .cargo-frame__content {
  gap: 8px !important;
  padding: 10px !important;
}

#warehouse-frame .warehouse-frame__content {
  gap: 8px !important;
  padding: 10px !important;
}

#workshop-frame .workshop-frame__content {
  gap: 8px !important;
  padding: 10px !important;
}

.warehouse-toolbar {
  gap: 8px !important;
}

.ship-fit {
  gap: 10px !important;
}

.ship-fit__dossier {
  color: var(--cg-muted) !important;
  font-size: 12px !important;
  letter-spacing: 0.04em;
}

#pilot-frame .pilot-frame__meta {
  color: inherit;
  font-size: inherit;
  letter-spacing: inherit;
}

.resource-info-frame .ui-frame__content {
  padding: 8px !important;
  gap: 8px;
}

.scan-result {
  border-color: var(--cg-line-soft) !important;
  background: var(--cg-slot-bg) !important;
  border-radius: var(--cg-radius);
  font-family: var(--cg-font);
}

.scan-result:hover {
  border-color: var(--cg-hover-line) !important;
  background: var(--cg-btn-bg-hover) !important;
}

.market-frame__side,
.market-merchant-card {
  border-color: var(--cg-line-soft) !important;
  background: rgba(6, 12, 18, 0.45) !important;
  border-radius: var(--cg-radius);
}

.market-pill {
  border-color: var(--cg-line-soft) !important;
  background: var(--cg-input-bg) !important;
  color: var(--cg-muted) !important;
  font-family: var(--cg-font) !important;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ── Hide legacy layout control; search + warehouse chrome ──────────────── */
.ui-frame__tool[data-frame-action="layout"] {
  display: none !important;
}

.cg-search {
  display: flex !important;
  align-items: center;
  gap: 8px;
  height: 26px !important;
  min-height: 26px;
  padding: 0 8px 0 9px !important;
  border: 1px solid var(--cg-line-soft) !important;
  border-radius: var(--cg-radius);
  background: var(--cg-input-bg) !important;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.28);
  color: var(--cg-muted);
}

.cg-search:focus-within {
  border-color: var(--cg-line) !important;
  background: var(--cg-input-bg-focus) !important;
  color: var(--cg-accent-strong);
}

.cg-search__icon {
  flex: 0 0 auto;
  opacity: 0.75;
}

.cg-search__input,
.cg-search .warehouse-toolbar__search-input {
  flex: 1 1 auto;
  width: auto !important;
  height: 100% !important;
  min-width: 0;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--cg-text) !important;
  font-family: var(--cg-font) !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
  text-shadow: none !important;
}

.cg-search__input::placeholder,
.cg-search .warehouse-toolbar__search-input::placeholder {
  color: rgba(170, 183, 195, 0.45) !important;
  text-transform: uppercase;
}

.warehouse-frame__empty {
  color: var(--cg-muted) !important;
  font-family: var(--cg-font) !important;
  font-size: 12px !important;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: none !important;
}

.warehouse-source-tab {
  border-color: var(--cg-line-soft) !important;
  background: var(--cg-input-bg) !important;
  color: var(--cg-muted) !important;
  font-family: var(--cg-font) !important;
}

.warehouse-source-tab.is-active {
  border-color: var(--cg-hover-line) !important;
  background: var(--cg-btn-bg-active) !important;
  color: #fff !important;
}

