.abyss {
  --ink: #e6f4fa;
  --muted: #adccd9;
  --teal: #85efd9;
  --edge: #356276;
  --panel: #113140;
  --dark: #092432;
  box-sizing: border-box;
  display: grid;
  gap: 12px;
  width: min(100%, 1140px);
  margin-inline: auto;
  padding: clamp(9px, 1.9vw, 19px);
  border: 1px solid var(--edge);
  border-radius: 19px;
  color: var(--ink);
  background: linear-gradient(148deg, #163b47, #0b2436 70%, #192c49);
  font: 15px/1.38 system-ui, sans-serif;
  text-align: start;
}
.abyss *, .abyss *::before, .abyss *::after { box-sizing: border-box; }
.abyss [hidden] { display: none !important; }
.abyss h2, .abyss h3, .abyss h4, .abyss p { margin: 0; }
.abyss h2 { font-size: clamp(18px, 3.7vw, 26px); line-height: 1.2; }
.abyss h3 { font-size: 16px; line-height: 1.2; }
.abyss h4 { font-size: 14px; line-height: 1.25; }
.abyss small, .abyss .as-note { color: var(--muted); font-size: 12px; }
.abyss button {
  min-width: 0;
  min-height: 44px;
  padding: 6px 9px;
  border: 1px solid #548098;
  border-radius: 8px;
  color: var(--ink);
  background: #1b4052;
  font: 700 13px/1.14 system-ui, sans-serif;
  overflow-wrap: break-word;
  touch-action: manipulation;
  cursor: pointer;
}
.abyss button:focus-visible { outline: 2px solid #ffe2a0; outline-offset: 2px; }
.abyss button[aria-pressed=true] { color: #d7fff3; border-color: var(--teal); background: #155854; }
.abyss button:disabled { color: #9fbbc7; border-color: #365462; background: #142f3d; cursor: default; }
.abyss button.as-primary:not(:disabled) { color: #09282e; border-color: #b0ffee; background: #8ce9d1; font-weight: 850; }
.as-dashboard, .as-route {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.as-meter, .as-sector {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 3px;
  padding: 7px 9px;
  border: 1px solid #406c7d;
  border-radius: 9px;
  background: #0d2c3c;
}
.as-meter span { color: #c1d9e2; font-size: 12px; }
.as-meter strong { font-size: clamp(16px, 3vw, 22px); font-variant-numeric: tabular-nums; line-height: 1.1; }
.as-meter .as-gauge { height: 4px; margin-block-start: 2px; overflow: hidden; border-radius: 4px; background: #1a4c5e; }
.as-gauge i { display: block; width: var(--fill, 0%); height: 100%; background: #6ad8e7; border-radius: inherit; }
.as-meter.as-heat i { background: #ffc284; }
.as-meter.as-heat[data-hot=true] { border-color: #ffc284; }
.as-sector { position: relative; padding-block-start: 10px; }
.as-sector::before { position: absolute; inset: 0 0 auto; height: 3px; background: #537687; border-radius: 9px 9px 0 0; content: ""; }
.as-sector[data-status=active]::before { background: var(--teal); }
.as-sector[data-status=certified]::before { background: #c6dc9d; }
.as-sector[data-status=active] { background: #15504d; border-color: #65a9a6; }
.as-sector strong { font-size: 13px; }
.as-sector small { line-height: 1.2; }
.as-main, .as-workshop { display: grid; grid-template-columns: minmax(0, 1.24fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.as-card {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 9px;
  padding: clamp(8px, 1.4vw, 15px);
  border: 1px solid var(--edge);
  border-radius: 12px;
  background: var(--panel);
}
.as-map {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  padding: 5px;
  border: 1px solid #4d7a8b;
  border-radius: 11px;
  background: #123a4a var(--seabed) center / cover no-repeat;
  overflow: hidden;
  direction: ltr;
}
.as-map[data-depth=vent] { background-color: #29404a; background-blend-mode: luminosity; }
.as-map[data-depth=trench] { background-color: #182345; background-blend-mode: luminosity; }
.as-map .as-tile {
  position: relative;
  display: grid;
  align-content: space-between;
  justify-items: start;
  min-height: clamp(48px, 10vw, 73px);
  padding: 5px 6px;
  overflow: hidden;
  text-align: start;
  border-color: #528194;
  background: #0c2938d6;
  font-variant-numeric: tabular-nums;
  isolation: isolate;
}
.as-tile::before {
  position: absolute;
  z-index: -1;
  inset: auto 0 0;
  height: var(--progress,0%);
  content: "";
  background: var(--terrain, #429ca3) linear-gradient(145deg, #111c2200, #0b233ea8);
  opacity: .74;
}
.as-tile[data-terrain=ridge] { --terrain: #358298; }
.as-tile[data-terrain=plume] { --terrain: #b78159; }
.as-tile[data-terrain=fracture] { --terrain: #8a78b3; }
.as-tile[data-gain=true] { border-color: #8de5da; box-shadow: inset 0 0 13px #69bdbe49; }
.as-map .as-tile[aria-pressed=true] { border: 2px solid #fff1b2; padding: 4px 5px; background: #17524de8; }
.as-tile .as-coord { color: #bdd5dd; font-size: 10px; text-transform: uppercase; }
.as-tile strong { padding-block-start: 3px; font-size: clamp(13px, 3.3vw, 21px); line-height: 1; }
.as-tile .as-tile-gain { position: absolute; top: 4px; inset-inline-end: 4px; color: #a7ffea; font-size: 10px; font-weight: 900; }
.as-map[data-pulse=true] .as-tile[data-fired=true] { animation: as-pulse .55s ease-out; }
@keyframes as-pulse { 0% { filter: brightness(1.9); } 100% { filter: brightness(1); } }
.as-modes, .as-hire-buttons, .as-transfers { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 5px; }
.as-transfers { grid-template-columns: repeat(2, minmax(0,1fr)); }
.as-readout {
  display: grid;
  gap: 3px;
  min-height: 48px;
  padding: 7px 8px;
  border-inline-start: 2px solid #68b6bc;
  color: #c4e4ea;
  background: var(--dark);
  font-size: 12px;
}
.as-readout [data-impact] { color: var(--teal); font-weight: 800; }
.as-list, .as-orders, .as-crew-grid { display: grid; gap: 6px; }
.as-order, .as-upgrade, .as-role, .as-permit {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 7px 8px;
  border: 1px solid #3c687a;
  border-radius: 8px;
  background: #102a3c;
}
.as-order[data-done=true] { border-color: #567e78; background: #153a3d; }
.as-order-head, .as-section-head, .as-card > header {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 8px;
}
.as-order-head small { font-variant-numeric: tabular-nums; }
.as-order-progress { display: flex; flex-wrap: wrap; gap: 4px; padding-block: 2px; direction: ltr; }
.as-order-progress span {
  display: grid;
  place-items: center;
  min-width: 21px;
  padding: 2px 3px;
  border: 1px solid #5d7587;
  border-radius: 4px;
  color: #bdced8;
  font: 700 9px/1.15 system-ui, sans-serif;
}
.as-order-progress span[data-ready=true] { color: #b4f4d3; border-color: #739b8a; background: #194742; }
.as-order button, .as-permit button { width: 100%; }
.as-dive {
  display: flex;
  min-height: 66px;
  justify-content: space-between;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border: 1px solid #477b88;
  border-radius: 8px;
  background: linear-gradient(90deg,#0b2838eb,#0d334a84), var(--seabed) 35% 68% / cover, #0e3549;
}
.as-dive p { color: #def4f8; font-size: 12px; text-wrap: balance; }
.as-sprite { width: min(39%, 155px); height: auto; max-height: 62px; object-fit: contain; }
.as-crew-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
.as-role .as-transfers { align-self: end; }
.as-role button, .as-hire-buttons button { padding-inline: 4px; }
.as-storage, .as-archive { display: grid; gap: 7px; border: 1px solid #b78e66; border-radius: 10px; padding: 8px 10px; background: #403938; }
.as-archive { border-color: #6eaa98; background: #16483d; }
.as-storage-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.as-event { min-height: 18px; color: #a7ecd9; font-size: 12px; }
@media (max-width: 735px) {
  .as-main, .as-workshop { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 450px) {
  .as-crew-grid { grid-template-columns: minmax(0,1fr); }
  .as-route .as-sector, .as-meter { padding-inline: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .as-map[data-pulse=true] .as-tile[data-fired=true] { animation: none; }
}
.as-pulsebox { display: grid; gap: 7px; }
.as-readout [data-selected] { color: #e7f9fb; font-weight: 700; }
@media (max-width: 450px) {
  .as-pulsebox { grid-template-columns: minmax(0,1fr) minmax(81px,0.52fr); align-items: center; }
}
