:root {
  color-scheme: dark;
  --bg-0: #070d15;
  --bg-1: #0a1420;
  --panel: #0e1a28;
  --line: rgba(126, 178, 230, 0.28);
  --line-hi: rgba(150, 205, 255, 0.6);
  --text: #e8f1fb;
  --muted: #8ea6bf;
  --cyan: #7cc9ff;
  --amber: #f0b453;
  --good: #7fe0a4;
  --bad: #f08a92;
  --even: #94a9bf;
  --display: "Rajdhani", "Barlow", "Segoe UI", system-ui, sans-serif;
  --body: "Barlow", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
}

body {
  min-height: 100vh;
  background-color: var(--bg-1);
  background-image:
    linear-gradient(
      180deg,
      rgba(9, 18, 30, 0.6) 0%,
      rgba(8, 18, 32, 0.76) 46%,
      rgba(5, 10, 17, 0.9) 100%
    ),
    url("bg/hangar.jpg");
  background-position: center top, center 42%;
  background-size: cover, cover;
  background-repeat: no-repeat, no-repeat;
  background-attachment: scroll, fixed;
  color: var(--text);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
}

.shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 34px 24px 40px;
}

.screen-head {
  text-align: center;
}

.eyebrow {
  margin: 0 0 6px;
  font-family: var(--display);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--amber);
  opacity: 0.9;
}

.screen-head h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.55rem, 3.2vw, 2.5rem);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #eef6ff;
  text-shadow: 0 0 30px rgba(120, 190, 255, 0.26);
}

.head-rule {
  position: relative;
  height: 1px;
  margin: 16px auto 0;
  max-width: 620px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(126, 178, 230, 0.5) 22%,
    rgba(126, 178, 230, 0.5) 78%,
    transparent
  );
}

.head-rule::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  transform: translate(-50%, -50%) rotate(45deg);
  background: var(--cyan);
  box-shadow: 0 0 10px rgba(124, 201, 255, 0.85);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 20px 0 16px;
}

.toolbar-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.toolbar-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.badge {
  min-width: 17px;
  padding: 1px 5px;
  border-radius: 2px;
  background: rgba(240, 180, 83, 0.16);
  color: var(--amber);
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
  text-align: center;
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border: 0;
  background: linear-gradient(180deg, rgba(150, 200, 250, 0.5), rgba(80, 120, 165, 0.28));
  color: #dbe9f7;
  font-family: var(--display);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  isolation: isolate;
  clip-path: polygon(
    9px 0,
    100% 0,
    100% calc(100% - 9px),
    calc(100% - 9px) 100%,
    0 100%,
    0 9px
  );
  transition:
    filter 140ms ease,
    transform 100ms ease;
}

.btn::before {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: -1;
  clip-path: inherit;
  background: linear-gradient(180deg, #29445f 0%, #192c40 55%, #101e2c 100%);
  box-shadow: inset 0 1px 0 rgba(196, 224, 248, 0.14);
}

.btn:hover {
  filter: brightness(1.14);
}

.btn:active {
  transform: translateY(1px);
}

.btn:focus-visible {
  outline: none;
  filter: brightness(1.22) drop-shadow(0 0 6px rgba(124, 201, 255, 0.55));
}

.btn.primary {
  background: linear-gradient(180deg, #ffd88b, #c98a2c);
  color: #2b1a04;
  text-shadow: 0 1px 0 rgba(255, 236, 196, 0.45);
}

.btn.primary::before {
  background: linear-gradient(180deg, #f6bd5e 0%, #d99a3a 55%, #b97d24 100%);
}

.btn.primary:hover {
  filter: brightness(1.07) drop-shadow(0 0 10px rgba(240, 180, 83, 0.3));
}

#pack-count {
  font-variant-numeric: tabular-nums;
}

.pack-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.pack {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 34px 9px 10px;
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.5));
  cursor: pointer;
  transition:
    transform 150ms ease,
    filter 150ms ease,
    opacity 150ms ease;
  -webkit-tap-highlight-color: transparent;
}

.pack-frame {
  position: absolute;
  inset: 0;
  z-index: 0;
  clip-path: polygon(
    18px 0,
    100% 0,
    100% calc(100% - 18px),
    calc(100% - 18px) 100%,
    0 100%,
    0 18px
  );
  background: linear-gradient(
    180deg,
    rgba(150, 195, 235, 0.6) 0%,
    rgba(92, 128, 168, 0.4) 55%,
    rgba(64, 96, 132, 0.5) 100%
  );
  pointer-events: none;
}

.pack-frame::before {
  content: "";
  position: absolute;
  inset: 1px;
  clip-path: inherit;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(120, 170, 230, 0.05) 0 1px,
      transparent 1px 26px
    ),
    repeating-linear-gradient(
      0deg,
      rgba(120, 170, 230, 0.05) 0 1px,
      transparent 1px 26px
    ),
    linear-gradient(180deg, #1a2d45 0%, #101c2b 46%, #0a131e 100%);
}

.pack-frame::after {
  content: "";
  position: absolute;
  inset: 1px;
  clip-path: inherit;
  background: linear-gradient(180deg, transparent 56%, rgba(4, 10, 18, 0.72) 100%);
}

.pack:hover {
  transform: translateY(-2px);
  filter: drop-shadow(0 14px 20px rgba(0, 0, 0, 0.55))
    drop-shadow(0 0 6px rgba(124, 201, 255, 0.22));
}

.pack:focus-visible {
  outline: none;
  filter: drop-shadow(0 0 3px var(--cyan))
    drop-shadow(0 0 14px rgba(70, 150, 240, 0.5))
    drop-shadow(0 12px 18px rgba(0, 0, 0, 0.5));
}

.pack.picked {
  transform: translateY(-5px) scale(1.012);
  filter: drop-shadow(0 0 3px var(--cyan))
    drop-shadow(0 0 22px rgba(60, 150, 240, 0.62))
    drop-shadow(0 16px 26px rgba(0, 0, 0, 0.55));
}

.blueprint {
  position: absolute;
  top: 40px;
  left: 50%;
  transform: translateX(-50%);
  height: 66%;
  width: auto;
  max-width: 118%;
  object-fit: contain;
  object-position: top center;
  opacity: 0.16;
  z-index: 0;
  pointer-events: none;
  mask-image: linear-gradient(to bottom, #000 58%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, #000 58%, transparent 100%);
}

.pack-grid.has-pick .pack:not(.picked) {
  opacity: 0.45;
}

.timer {
  position: absolute;
  left: 0;
  right: 18px;
  bottom: 0;
  z-index: 4;
  height: 2px;
  border-radius: 0 0 3px 3px;
  background: linear-gradient(90deg, #f0b453, #ffd88b);
  box-shadow: 0 0 10px rgba(240, 180, 83, 0.7);
  transform: scaleX(0);
  transform-origin: left center;
  pointer-events: none;
}

.pack.armed .timer {
  animation: pack-countdown var(--advance, 3000ms) linear forwards;
}

@keyframes pack-countdown {
  from {
    transform: scaleX(1);
  }

  to {
    transform: scaleX(0);
  }
}

.confirm-tag {
  position: absolute;
  top: 39px;
  left: 50%;
  z-index: 5;
  transform: translateX(-50%);
  padding: 2px 9px;
  border: 1px solid rgba(240, 180, 83, 0.55);
  border-radius: 2px;
  background: rgba(7, 13, 21, 0.82);
  color: var(--amber);
  font-family: var(--display);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
}

.pack.picked .confirm-tag {
  opacity: 1;
}

.key {
  position: absolute;
  top: 40px;
  right: 14px;
  z-index: 3;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(140, 200, 255, 0.32);
  border-radius: 2px;
  background: rgba(6, 12, 20, 0.6);
  color: var(--muted);
  font-family: var(--display);
  font-size: 0.68rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.plate {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 33px;
  padding: 0 14px 0 24px;
  clip-path: polygon(18px 0, 100% 0, 100% 100%, 0 100%, 0 18px);
  border-bottom: 1px solid rgba(178, 196, 214, 0.32);
  background:
    linear-gradient(108deg, rgba(255, 255, 255, 0.09) 0%, transparent 46%),
    linear-gradient(180deg, #3b4046 0%, #1b1e22 55%, #0b0d10 100%);
  box-shadow: inset 0 1px 0 rgba(226, 238, 250, 0.14);
}

.plate::after {
  content: "";
  position: absolute;
  left: 11px;
  top: 50%;
  width: 5px;
  height: 5px;
  margin-top: -2.5px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #d7e8f8, #47627c 62%, #1d3145);
  box-shadow: 0 0 0 1px rgba(8, 16, 26, 0.75);
}

.plate-label {
  position: relative;
  font-family: var(--display);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #aeb9c5;
}

.plate-value {
  position: relative;
  font-family: var(--display);
  font-size: 1.32rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  font-variant-numeric: tabular-nums;
  color: #f1f5f9;
  text-shadow: 0 0 12px rgba(190, 214, 236, 0.2);
}

.portrait {
  position: relative;
  z-index: 1;
  aspect-ratio: 1;
  max-height: 264px;
  margin: 2px -1px 0;
  display: grid;
  place-items: center;
  mask-image: linear-gradient(to bottom, #000 84%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, #000 84%, transparent 100%);
}

.portrait::before {
  content: "";
  position: absolute;
  inset: 6% -2% 2%;
  border-radius: 50%;
  background: radial-gradient(
    closest-side,
    rgba(124, 176, 232, 0.28),
    rgba(110, 160, 215, 0.09) 62%,
    transparent 78%
  );
  filter: blur(4px);
  pointer-events: none;
}

.portrait img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 32%;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.55));
  opacity: 0;
}

.portrait.has-art img {
  opacity: 1;
}

.portrait-fallback {
  font-family: var(--display);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: color-mix(in srgb, var(--tint) 62%, white);
  opacity: 0.55;
}

.portrait.has-art .portrait-fallback {
  opacity: 0;
}

.body {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 5px;
  padding: 2px 4px 0;
  text-align: center;
}

.spec-name {
  margin: 0;
  font-family: var(--body);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.005em;
  line-height: 1.25;
}

.spec-text {
  margin: 0;
  min-height: 4.2em;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: #9db3ca;
  font-size: 0.74rem;
  line-height: 1.4;
}

.units {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: auto;
  padding-top: 2px;
}

.unit-thumb {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid rgba(126, 178, 230, 0.42);
  border-radius: 3px;
  background: linear-gradient(180deg, #22374d 0%, #0e1a27 100%);
  box-shadow: inset 0 0 16px rgba(6, 16, 28, 0.5);
}

.unit-thumb .art {
  position: absolute;
  inset: 0 0 18px;
  width: 100%;
  height: calc(100% - 18px);
  object-fit: cover;
  opacity: 0;
}

.unit-thumb.has-art .art {
  opacity: 1;
}

.unit-thumb .initials {
  position: absolute;
  inset: 0 0 18px;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: color-mix(in srgb, var(--tint) 60%, #dbe9f7);
}

.unit-thumb.has-art .initials {
  opacity: 0;
}

.count {
  position: absolute;
  top: 3px;
  left: 3px;
  z-index: 2;
  padding: 0 4px;
  border-radius: 2px;
  background: rgba(5, 12, 20, 0.78);
  color: #f3d29a;
  font-family: var(--display);
  font-size: 0.68rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.thumb-name {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 18px;
  display: grid;
  place-items: center;
  padding: 0 3px;
  background: linear-gradient(180deg, rgba(6, 13, 22, 0.6), rgba(4, 9, 16, 0.94));
  color: #c3d7ea;
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.credit {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 26px;
  padding-top: 16px;
  border-top: 1px solid rgba(126, 178, 230, 0.14);
  color: var(--muted);
  font-family: var(--display);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.credit a {
  color: #a8c6e2;
  text-decoration: none;
  border-bottom: 1px solid rgba(168, 198, 226, 0.3);
}

.credit a:hover {
  color: var(--cyan);
  border-color: var(--cyan);
}

.dot {
  width: 3px;
  height: 3px;
  transform: rotate(45deg);
  background: rgba(168, 198, 226, 0.5);
}

.error {
  margin-top: 24px;
  padding: 16px 18px;
  border: 1px solid #5a3038;
  border-radius: 3px;
  background: #221419;
  color: #f3c9ce;
  font-size: 0.9rem;
}

.error p {
  margin: 0 0 6px;
}

.error p:last-child {
  margin-bottom: 0;
  color: #c39aa1;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85em;
  padding: 1px 5px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.08);
}

dialog {
  width: min(840px, 92vw);
  max-height: 84vh;
  margin: auto;
  padding: 0;
  border: 0;
  color: var(--text);
  background: linear-gradient(
    180deg,
    rgba(150, 195, 235, 0.6) 0%,
    rgba(92, 128, 168, 0.4) 55%,
    rgba(64, 96, 132, 0.5) 100%
  );
  clip-path: polygon(
    14px 0,
    100% 0,
    100% calc(100% - 14px),
    calc(100% - 14px) 100%,
    0 100%,
    0 14px
  );
  isolation: isolate;
  filter: drop-shadow(0 30px 60px rgba(0, 0, 0, 0.7));
}

dialog::before {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: -1;
  clip-path: inherit;
  background: linear-gradient(180deg, #122033 0%, #0a131e 100%);
}

dialog::backdrop {
  background: rgba(2, 6, 11, 0.8);
  backdrop-filter: blur(4px);
}

dialog[open] {
  display: flex;
  flex-direction: column;
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid rgba(178, 196, 214, 0.3);
  background:
    linear-gradient(105deg, rgba(255, 255, 255, 0.08) 0%, transparent 46%),
    linear-gradient(180deg, #3b4046 0%, #1b1e22 60%, #101216 100%);
}

.sheet-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.sheet-close {
  position: relative;
  width: 30px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 0;
  background: linear-gradient(
    180deg,
    rgba(186, 220, 250, 0.85),
    rgba(104, 144, 186, 0.55)
  );
  color: #dceafa;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  isolation: isolate;
  clip-path: polygon(
    6px 0,
    100% 0,
    100% calc(100% - 6px),
    calc(100% - 6px) 100%,
    0 100%,
    0 6px
  );
}

.sheet-close::before {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: -1;
  clip-path: inherit;
  background: linear-gradient(180deg, #26394e, #101c29);
}

.sheet-close:hover {
  color: #f0f7ff;
  filter: brightness(1.2);
}

.pack-list {
  overflow-y: auto;
  padding: 4px 8px 18px;
  scrollbar-width: thin;
  scrollbar-color: #3b5671 transparent;
}

.pack-row {
  display: grid;
  grid-template-columns: 30px 74px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-bottom: 1px solid rgba(126, 178, 230, 0.1);
}

.row-num {
  color: #6c8198;
  font-family: var(--display);
  font-size: 0.74rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.pack-row.alt,
.spec-row.alt {
  background: rgba(28, 46, 68, 0.32);
}

.list-section {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 10px 8px;
  border-bottom: 1px solid rgba(126, 178, 230, 0.22);
  font-family: var(--display);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #a2b8cf;
}

.list-section:first-child {
  padding-top: 6px;
}

.list-count {
  color: var(--amber);
  font-variant-numeric: tabular-nums;
}

.spec-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-bottom: 1px solid rgba(126, 178, 230, 0.1);
}

.spec-thumb {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(126, 178, 230, 0.22);
  border-radius: 2px;
  background: rgba(8, 16, 26, 0.6);
  color: #8fa5bb;
  font-family: var(--display);
  font-size: 0.8rem;
  font-weight: 700;
}

.spec-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 26%;
}

.srow-main {
  min-width: 0;
}

.srow-name {
  display: block;
  color: #d3e4f4;
  font-size: 0.84rem;
}

.srow-desc {
  display: block;
  margin-top: 1px;
  color: #8095ab;
  font-size: 0.68rem;
  line-height: 1.3;
}

.row-icons {
  display: flex;
  gap: 4px;
}

.row-icon img {
  display: block;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(126, 178, 230, 0.22);
  border-radius: 2px;
}

.row-name {
  color: #d3e4f4;
  font-size: 0.84rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-hp {
  font-family: var(--display);
  font-size: 0.98rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.row-hp.good {
  color: var(--good);
}

.row-hp.bad {
  color: var(--bad);
}

.row-hp.even {
  color: var(--even);
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding: 10px 12px 18px;
  scrollbar-width: thin;
  scrollbar-color: #3b5671 transparent;
}

.history-empty {
  margin: 24px 6px;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

.history-hint {
  margin: 0 4px;
  color: #7f94aa;
  font-family: var(--display);
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.history-limit {
  margin: 2px 4px 0;
  padding-top: 10px;
  border-top: 1px solid rgba(126, 178, 230, 0.12);
  color: #7f94aa;
  font-size: 0.68rem;
  text-align: center;
}

.history-entry {
  padding: 8px 10px 10px;
  border: 1px solid rgba(126, 178, 230, 0.16);
  border-radius: 2px;
  background: rgba(13, 24, 38, 0.6);
}

.h-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.h-label {
  margin-right: auto;
  font-family: var(--display);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8fa5bb;
}

.h-replay {
  margin-left: auto;
  padding: 3px 10px;
  border: 1px solid rgba(126, 178, 230, 0.3);
  border-radius: 2px;
  background: rgba(24, 40, 60, 0.8);
  color: #bcd2e6;
  font-family: var(--display);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}

.h-replay:hover {
  border-color: var(--line-hi);
  color: #f0f7ff;
}

.h-offers {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.h-offer {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 5px;
  border: 1px solid rgba(126, 178, 230, 0.14);
  border-radius: 2px;
  background: rgba(20, 34, 52, 0.55);
  opacity: 0.62;
}

.h-offer.chosen {
  border-color: rgba(124, 201, 255, 0.75);
  background: rgba(26, 50, 78, 0.8);
  box-shadow: inset 0 0 0 1px rgba(124, 201, 255, 0.22);
  opacity: 1;
}

.h-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.h-hp {
  font-family: var(--display);
  font-size: 0.9rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.h-picked {
  padding: 1px 4px;
  border-radius: 2px;
  background: var(--cyan);
  color: #08131f;
  font-family: var(--display);
  font-size: 0.54rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.h-icons {
  display: flex;
  gap: 3px;
}

.h-icons img {
  display: block;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(126, 178, 230, 0.2);
  border-radius: 2px;
}

.h-spec {
  color: #cfe0f0;
  font-size: 0.66rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.h-units {
  color: #7f95ab;
  font-size: 0.6rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 700px) {
  .h-offers {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.results-sub {
  margin: 14px 0 0;
  text-align: center;
  font-family: var(--display);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.panel-lead {
  margin-top: 14px;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.panel {
  padding: 12px 14px 14px;
  border: 1px solid rgba(126, 178, 230, 0.2);
  background: linear-gradient(180deg, rgba(22, 40, 60, 0.82), rgba(10, 20, 32, 0.9));
  box-shadow: inset 0 0 36px rgba(20, 44, 72, 0.26);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(126, 178, 230, 0.14);
}

.panel h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #cfe0f2;
}

.pref-toggle {
  display: flex;
  border: 1px solid rgba(126, 178, 230, 0.24);
}

.pref-toggle-btn {
  padding: 3px 8px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--display);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}

.pref-toggle-btn + .pref-toggle-btn {
  border-left: 1px solid rgba(126, 178, 230, 0.24);
}

.pref-toggle-btn:hover {
  color: #eaf4ff;
}

.pref-toggle-btn[aria-pressed="true"] {
  background: rgba(124, 201, 255, 0.16);
  color: #d6ecff;
}

.show-more {
  width: 100%;
  margin-top: 8px;
  padding: 7px 10px;
  border: 1px solid rgba(126, 178, 230, 0.24);
  background: rgba(124, 201, 255, 0.06);
  color: #b8d4ee;
  font-family: var(--display);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}

.show-more:hover {
  background: rgba(124, 201, 255, 0.14);
  color: #eaf4ff;
}

.panel p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.panel-note {
  margin: 8px 0 0;
  padding-top: 8px;
  border-top: 1px solid rgba(126, 178, 230, 0.1);
  color: #7f94aa;
  font-size: 0.68rem;
  line-height: 1.45;
}

.pref-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 5px 0;
}

.pref-thumb {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(126, 178, 230, 0.26);
  background: rgba(8, 16, 26, 0.6);
}

.pref-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 28%;
}

.pref-main {
  min-width: 0;
}

.pref-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.pref-name {
  color: #d7e6f5;
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pref-count {
  font-family: var(--display);
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--amber);
}

.pref-track {
  height: 4px;
  margin-top: 4px;
  overflow: hidden;
  background: rgba(126, 178, 230, 0.12);
}

.pref-track span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #4a8cc4, #7cc9ff);
}

.pref-sub {
  margin-top: 3px;
  color: #7f94aa;
  font-size: 0.62rem;
}

.fav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.fav-icons {
  display: flex;
  gap: 6px;
}

.fav-icons img {
  display: block;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(126, 178, 230, 0.3);
  object-fit: cover;
}

.fav-name {
  color: #e2eefb;
  font-size: 0.92rem;
}

.fav-count {
  margin-top: 2px;
  color: var(--amber);
  font-family: var(--display);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.style-top {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 10px;
}

.style-weight {
  font-family: var(--display);
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 0.02em;
  color: var(--text);
}

.style-weight.off {
  color: #f08a5f;
}

.style-weight.def {
  color: #7cc9ff;
}

.style-weight.neu {
  color: var(--text);
}

.style-lean {
  font-family: var(--display);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.hp-panel {
  margin-top: 14px;
}

.hp-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.hp-stat {
  padding: 10px 12px;
  border: 1px solid rgba(126, 178, 230, 0.14);
  background: rgba(10, 20, 32, 0.45);
}

.hp-stat span {
  display: block;
  font-family: var(--display);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.hp-stat strong {
  display: block;
  margin-top: 3px;
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  color: #f1f6fc;
}

.hp-stat strong.pos {
  color: var(--cyan);
}

.hp-stat strong.neg {
  color: var(--bad);
}

.hp-stat em {
  display: block;
  margin-top: 2px;
  font-style: normal;
  font-size: 0.62rem;
  color: #7f94aa;
}

.meter {
  display: flex;
  align-items: center;
  gap: 14px;
}

.meter strong {
  font-family: var(--display);
  font-size: 2.1rem;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--amber);
}

.meter-body {
  flex: 1;
  min-width: 0;
}

.meter-bar {
  height: 6px;
  overflow: hidden;
  background: rgba(126, 178, 230, 0.12);
}

.meter-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #c98a2c, #ffd88b);
}

.meter-body p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.7rem;
}

.meter-body .meter-split {
  margin-top: 2px;
  color: #7f94aa;
  font-size: 0.66rem;
}

.style-bar {
  display: flex;
  height: 8px;
  overflow: hidden;
  background: rgba(126, 178, 230, 0.1);
}

.style-bar span {
  display: block;
  height: 100%;
}

.style-bar .off {
  background: linear-gradient(90deg, #c9663a, #f08a5f);
}

.style-bar .neu {
  background: #a9b1ba;
}

.style-bar .def {
  background: linear-gradient(90deg, #2f6ea8, #4d9fe0);
}

.style-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.68rem;
}

.style-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.style-legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
}

.style-legend i.off {
  background: #f08a5f;
}

.style-legend i.neu {
  background: #a9b1ba;
}

.style-legend i.def {
  background: #4d9fe0;
}

.style-parts {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 8px;
}

.style-part {
  display: flex;
  gap: 6px;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.4;
}

.style-part-sign {
  font-family: var(--display);
  font-weight: 700;
}

.style-part.off .style-part-sign {
  color: #f08a5f;
}

.style-part.def .style-part-sign {
  color: #7cc9ff;
}

.style-details {
  margin-top: 10px;
}

.style-details summary {
  list-style: none;
  color: #9fb6cc;
  font-family: var(--display);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
}

.style-details summary::-webkit-details-marker {
  display: none;
}

.style-details summary::before {
  content: "+";
  display: inline-block;
  width: 10px;
  color: var(--amber);
}

.style-details[open] summary::before {
  content: "−";
}

.style-details summary:hover {
  color: #d8e8f8;
}

.style-details-body {
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(126, 178, 230, 0.16);
  background: rgba(8, 16, 26, 0.45);
}

.style-details-body p {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.5;
}

.style-details-body p:last-child {
  margin-bottom: 0;
}

.style-details-body strong {
  color: #cfe0f2;
  font-weight: 600;
}

.style-details-body .style-math {
  color: #b7c7d8;
  font-variant-numeric: tabular-nums;
}

.style-details-body .style-caveat {
  color: #7f94aa;
}

.picks-panel {
  margin-top: 14px;
}

.results-picks {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.results-picks .history-entry {
  background: rgba(13, 24, 38, 0.55);
}

.results-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin: 16px 0 2px;
}

.draft-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 16px;
}

.dp-text {
  font-family: var(--display);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.dp-text strong {
  color: #eaf3fc;
  font-size: 0.9rem;
  font-weight: 700;
}

.dp-pips {
  display: flex;
  gap: 4px;
}

.dp-pip {
  width: 18px;
  height: 3px;
  background: rgba(126, 178, 230, 0.18);
}

.dp-pip.done {
  background: var(--cyan);
  box-shadow: 0 0 8px rgba(124, 201, 255, 0.45);
}

.dp-pip.active {
  background: var(--amber);
}

.draft-progress.pending .dp-pip.active {
  box-shadow: 0 0 8px rgba(240, 180, 83, 0.6);
}

@media (max-width: 860px) {
  .hp-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .results-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 899px) {
  body {
    background-attachment: scroll, scroll;
  }
}

@media (max-width: 980px) {
  .pack-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .spec-text {
    min-height: 3em;
  }
}

@media (max-width: 620px) {
  .shell {
    padding: 26px 14px 32px;
  }

  .pack-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    justify-items: center;
  }

  .pack {
    width: 100%;
    max-width: 360px;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar-group {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    width: 100%;
  }

  .toolbar-group .btn {
    width: 100%;
  }

  .toolbar-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-left: 0;
  }

  .toolbar-actions .btn {
    width: 100%;
  }

  .draft-progress {
    flex-direction: column;
    gap: 8px;
  }

  .results-actions .btn {
    flex: 1;
  }

  .dp-pips {
    gap: 3px;
  }

  .dp-pip {
    width: 12px;
  }

  .style-weight {
    font-size: 1.45rem;
  }
}
