/* ==========================================================================
   海克斯大乱斗 4.0 实时决策台 · 暗黑瑞士网格系统 (DARK SWISS TACTICAL GRID)
   严格规范：
   - 数学网格 + 1px 实线结构分割（彻底去阴影、去渐变、去毛玻璃）
   - 0–2px 锐利直角
   - 强对比字体组合：窄体无衬线标题 (Bahnschrift/DIN) + 等宽数据字 (JetBrains/Consolas)
   - 全站严格克制：暗黑哑光灰度 + 仅 1 个高辨识度点缀色：战术黄 #F5C400
   ========================================================================== */

:root {
  /* Dark Matte Swiss Neutral Scale (No pure white canvas -> dark LoL icons blend seamlessly!) */
  --bg-0: #0b0b0d;        /* Deep Carbon Canvas */
  --bg-1: #121215;        /* Primary Grid Cell */
  --bg-2: #18181c;        /* Secondary / Interactive Cell */
  --bg-3: #222228;        /* Hover / Active Neutral Cell */

  /* 1px Structural Grid Rules */
  --rule: #2a2a30;        /* Primary 1px Solid Hairline */
  --rule-strong: #42424c; /* Emphasized 1px Solid Rule */
  --rule-subtle: #1f1f24; /* Internal Table Hairline */

  /* High-Contrast Monochrome Typography */
  --ink-1: #f4f4f5;       /* Crisp Off-White Ink */
  --ink-2: #a1a1aa;       /* Secondary Technical Ink */
  --ink-3: #71717a;       /* Micro-Label / Index Ink */

  /* SINGLE HIGH-RECOGNITION ACCENT COLOR: TACTICAL SIGNAL YELLOW */
  --accent: #f5c400;
  --accent-dim: rgba(245, 196, 0, 0.12);
  --accent-ink: #0b0b0d;

  /* Strict Monochrome / Single-Accent Semantic Aliases */
  --text-1: var(--ink-1);
  --text-2: var(--ink-2);
  --text-3: var(--ink-3);
  --gold: var(--accent);
  --gold-bright: var(--accent);
  --cyan: var(--accent);
  --accent-soft: var(--accent);
  --green: var(--accent);
  --red: var(--ink-2);
  --warn-border: var(--rule-strong);
  --border: var(--rule);
  --border-accent: var(--accent);
  --border-strong: var(--rule-strong);
  --icon-well: #08080a;

  /* Rarity Hierarchy (Strictly Monochrome + Single Accent — ZERO rainbow colors!) */
  --rarity-prismatic: #ffffff;
  --rarity-gold: var(--accent);
  --rarity-silver: #a1a1aa;

  /* Typography Stacks */
  --font-display: "Bahnschrift", "DIN Alternate", "Arial Narrow", "PingFang SC", "Microsoft YaHei UI", sans-serif;
  --font-body: "PingFang SC", "Microsoft YaHei UI", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Mono", "Consolas", "SFMono-Regular", monospace;

  /* Sharp Swiss Corners (0–2px ONLY) */
  --r-0: 0px;
  --r-2: 2px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  box-shadow: none !important;
}

html,
body {
  background-color: var(--bg-0);
  color: var(--ink-1);
  font-family: var(--font-body);
  min-height: 100vh;
  overflow-x: clip;
  line-height: 1.48;
  -webkit-font-smoothing: antialiased;
}

/* Custom Sharp Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-0);
  border-left: 1px solid var(--rule-subtle);
}
::-webkit-scrollbar-thumb {
  background: #32323a;
  border-radius: 0px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* ==================== SWISS MATHEMATICAL TOPBAR ==================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: stretch;
  background: var(--bg-1);
  border-bottom: 1px solid var(--rule);
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-right: 1px solid var(--rule);
  cursor: pointer;
  flex-shrink: 0;
}

.brand-logo {
  width: 28px;
  height: 28px;
  border-radius: var(--r-2);
  background: var(--accent);
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-weight: 900;
  font-size: 11px;
  letter-spacing: -0.04em;
}

.brand-text h1 {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-1);
  line-height: 1.15;
}

.brand-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-3);
  margin-top: 2px;
}

.patch-pill {
  background: var(--bg-2);
  border: 1px solid var(--rule-strong);
  color: var(--accent);
  padding: 0 5px;
  border-radius: var(--r-0);
  font-weight: 700;
}

/* Global Search Cell */
.omni-search {
  position: relative;
  flex: 1;
  min-width: 190px;
  max-width: 290px;
  display: flex;
  align-items: center;
  border-right: 1px solid var(--rule);
  padding: 6px 10px;
}

.omni-search input {
  width: 100%;
  padding: 6px 28px 6px 28px;
  border-radius: var(--r-2);
  border: 1px solid var(--rule);
  background: var(--bg-0);
  color: var(--ink-1);
  font-family: var(--font-body);
  font-size: 12.5px;
  outline: none;
}

.omni-search input::placeholder,
.rail-search::placeholder,
.filter-input::placeholder {
  color: var(--ink-3);
}

.omni-search input:focus {
  border-color: var(--accent);
}

.omni-search .search-ico {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-3);
  font-size: 11px;
  pointer-events: none;
}

.omni-search .kbd-hint {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-3);
  border: 1px solid var(--rule);
  padding: 0 4px;
  pointer-events: none;
}

.omni-dropdown {
  position: absolute;
  top: 100%;
  left: -1px;
  right: -1px;
  background: var(--bg-1);
  border: 1px solid var(--accent);
  border-radius: var(--r-0);
  max-height: 360px;
  overflow-y: auto;
  display: none;
  z-index: 90;
}

.omni-dropdown.open {
  display: block;
}

.omni-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--rule-subtle);
  color: var(--ink-1);
}
.omni-item:hover,
.omni-item.active {
  background: var(--bg-3);
}
.omni-item img {
  width: 28px;
  height: 28px;
  border-radius: var(--r-2);
  border: 1px solid var(--rule);
}

/* Segmented Swiss Nav Tabs */
.nav-tabs {
  display: flex;
  align-items: stretch;
  border-right: 1px solid var(--rule);
}

.nav-tab {
  border: none;
  border-right: 1px solid var(--rule-subtle);
  background: transparent;
  color: var(--ink-2);
  padding: 0 14px;
  min-height: 46px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
}
.nav-tab:last-child {
  border-right: none;
}
.nav-tab:hover {
  color: var(--ink-1);
  background: var(--bg-2);
}
.nav-tab.active {
  background: var(--bg-0);
  color: var(--accent);
}
.nav-tab.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--accent);
}

/* Status & Actions */
.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-2);
  background: var(--bg-0);
  border: 1px solid var(--rule);
  padding: 4px 9px;
  border-radius: var(--r-0);
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 0px;
  background: var(--accent);
}

/* Sharp Swiss Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--rule-strong);
  background: var(--bg-2);
  color: var(--ink-1);
  padding: 6px 12px;
  border-radius: var(--r-2);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  white-space: nowrap;
}

.btn:hover {
  border-color: var(--ink-1);
  background: var(--bg-3);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 800;
}
.btn-primary:hover {
  background: #ffd426;
  border-color: #ffd426;
  color: var(--accent-ink);
}

.btn-gold {
  background: var(--bg-0);
  border-color: var(--accent);
  color: var(--accent);
}
.btn-gold:hover {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn-sm {
  padding: 4px 8px;
  font-size: 11px;
}

/* ==================== MATHEMATICAL WORKSPACE GRID ==================== */
.main-container {
  max-width: 1560px;
  margin: 0 auto;
  padding: 12px;
}

.view {
  display: none;
}
.view.active {
  display: block;
}

/* Rigid 1px-Ruled Split Grid (side-by-side down to 720px, sticky left rail follows scroll!) */
.workbench-grid {
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  gap: 0;
  background: var(--bg-1);
  border: 1px solid var(--rule);
  align-items: start;
}

@media (max-width: 1150px) {
  .workbench-grid {
    grid-template-columns: 196px minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .workbench-grid {
    grid-template-columns: 1fr;
  }
  .champ-rail {
    position: static !important;
    height: auto !important;
    max-height: 190px !important;
    border-bottom: 1px solid var(--rule);
  }
  #workbenchMain {
    border-left: none !important;
  }
}

/* Left Champion Index Column — stays pinned to viewport while scrolling right panel */
.champ-rail {
  position: sticky;
  top: 49px;
  align-self: start;
  background: var(--bg-1);
  display: flex;
  flex-direction: column;
  height: calc(100vh - 61px);
  max-height: calc(100vh - 61px);
}

.rail-header {
  padding: 10px;
  border-bottom: 1px solid var(--rule);
  background: var(--bg-1);
}

.rail-search {
  width: 100%;
  padding: 6px 9px;
  border-radius: var(--r-2);
  border: 1px solid var(--rule);
  background: var(--bg-0);
  color: var(--ink-1);
  font-size: 12px;
  outline: none;
  margin-bottom: 8px;
}
.rail-search:focus {
  border-color: var(--accent);
}

.role-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.pill {
  border: 1px solid var(--rule);
  background: var(--bg-0);
  color: var(--ink-2);
  padding: 2px 7px;
  border-radius: var(--r-0);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
}
.pill:hover {
  color: var(--ink-1);
  border-color: var(--rule-strong);
}
.pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 800;
}

.rail-list {
  overflow-y: auto;
  flex: 1;
}

.rail-champ {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  cursor: pointer;
  border-bottom: 1px solid var(--rule-subtle);
  border-left: 2px solid transparent;
}
.rail-champ:hover {
  background: var(--bg-2);
}
.rail-champ.active {
  background: var(--bg-2);
  border-left-color: var(--accent);
}

.rail-champ img {
  width: 32px;
  height: 32px;
  border-radius: var(--r-2);
  border: 1px solid var(--rule);
  flex-shrink: 0;
}

.rail-champ-info {
  min-width: 0;
  flex: 1;
}

.rail-champ-name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rail-champ-sub {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-3);
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 2px;
}

/* Swiss Monochrome + Single Accent Tier Stamps */
.tier {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--r-0);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.tier-sp { background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent); }
.tier-s { background: var(--ink-1); color: var(--bg-0); border: 1px solid var(--ink-1); }
.tier-a { background: var(--bg-2); color: var(--ink-1); border: 1px solid var(--rule-strong); }
.tier-b { background: var(--bg-0); color: var(--ink-2); border: 1px solid var(--rule); }
.tier-c,
.tier-d { background: var(--bg-0); color: var(--ink-3); border: 1px solid var(--rule-subtle); }

.wr-high { color: var(--accent); font-family: var(--font-mono); font-weight: 800; }
.wr-mid { color: var(--ink-1); font-family: var(--font-mono); font-weight: 700; }
.wr-low { color: var(--ink-3); font-family: var(--font-mono); font-weight: 600; }

/* Right Workbench Column — Rigid Interlocking 1px Grid */
#workbenchMain {
  background: var(--rule);
  border-left: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.card,
.bento-card {
  background: var(--bg-1);
  border: none;
  border-radius: var(--r-0);
  padding: 16px 18px;
}

/* Standalone views (Tier list / Augments / Combos / Bands) have outer 1px border */
.view:not(#view-workbench) > .card {
  border: 1px solid var(--rule);
}

.card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule);
  flex-wrap: wrap;
}

.card-title h2,
.card-title h3 {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-1);
  display: flex;
  align-items: center;
  gap: 8px;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  margin-bottom: 6px;
}

/* ==================== 01 SWISS HERO MASTHEAD GRID ==================== */
.bento-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) minmax(220px, 1fr);
  gap: 1px;
  background: var(--rule);
}

@media (max-width: 900px) {
  .bento-hero-grid {
    grid-template-columns: 1fr;
  }
}

.hero-bento-main {
  position: relative;
  overflow: hidden;
  background: var(--bg-1);
  padding: 18px 20px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: right 22%;
  opacity: 0.11;
  filter: grayscale(85%) contrast(1.15);
  pointer-events: none;
}

.hero-content-inner {
  position: relative;
  z-index: 2;
}

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

.hero-avatar {
  width: 64px;
  height: 64px;
  border-radius: var(--r-2);
  border: 1px solid var(--rule-strong);
  flex-shrink: 0;
}

.hero-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.hero-name-row h2 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 0.02em;
  color: var(--ink-1);
  line-height: 1.05;
}

.hero-kpi-strip {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.big-wr-kpi {
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}

.hero-bento-side {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 1px;
  background: var(--rule);
}

.bento-mini-tile {
  background: var(--bg-1);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.spell-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--r-2);
  border: 1px solid var(--rule-strong);
}

.skill-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: var(--r-0);
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 12px;
  background: var(--bg-0);
  border: 1px solid var(--rule-strong);
  color: var(--ink-1);
}

/* Swiss Barcode Distribution Plot (Zero Glow, Crisp 1px Ticks + Tactical Yellow Marker) */
.rug-wrap {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--rule);
}

.rug-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-3);
  margin-bottom: 6px;
}

.rug-track {
  position: relative;
  height: 20px;
  background: var(--bg-0);
  border: 1px solid var(--rule);
}

.rug-tick {
  position: absolute;
  bottom: 2px;
  width: 1px;
  height: 10px;
  background: #3a3a44;
}

.rug-median {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  border-left: 1px dashed var(--ink-3);
}

.rug-pin {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
  transform: translateX(-50%);
  z-index: 3;
}

.rug-pin::before {
  content: "";
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 7px;
  height: 4px;
  background: var(--accent);
}

.rug-scale {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-3);
  margin-top: 4px;
}

/* Swiss Section Index Strip */
.section-anchor-bar {
  display: flex;
  overflow-x: auto;
  background: var(--bg-0);
}

.anchor-btn {
  border: none;
  border-right: 1px solid var(--rule);
  background: transparent;
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 9px 14px;
  cursor: pointer;
  white-space: nowrap;
}
.anchor-btn:hover {
  color: var(--accent);
  background: var(--bg-2);
}
.anchor-btn span.num {
  color: var(--accent);
  margin-right: 5px;
}

/* ==================== 02 SWISS DECISION MATRIX ==================== */
.bento-decision-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 1px;
  background: var(--rule);
}

@media (max-width: 900px) {
  .bento-decision-grid {
    grid-template-columns: 1fr;
  }
}

.bento-stack {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--rule);
}

.decision-col-head {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding-bottom: 10px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--ink-1);
}

.decision-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 8px;
  border-bottom: 1px solid var(--rule-subtle);
  border-left: 2px solid transparent;
  cursor: pointer;
}
.decision-row:last-child {
  border-bottom: none;
}
.decision-row:hover {
  background: var(--bg-2);
}
.decision-row.is-selected {
  background: var(--accent-dim);
  border-left-color: var(--accent);
}
.decision-row img {
  width: 30px;
  height: 30px;
  border-radius: var(--r-2);
  background: var(--bg-0);
  padding: 2px;
  object-fit: contain;
  flex-shrink: 0;
  border: 1px solid var(--rule);
}

.dec-tag-pick {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  padding: 2px 5px;
  background: var(--accent);
  color: var(--accent-ink);
  flex-shrink: 0;
}

.dec-tag-opt {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  background: var(--bg-0);
  color: var(--ink-2);
  border: 1px solid var(--rule-strong);
  flex-shrink: 0;
}

.dec-tag-avoid {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  background: var(--bg-0);
  color: var(--ink-2);
  border: 1px dashed var(--rule-strong);
  flex-shrink: 0;
}

.destiny-bento-box {
  background: var(--bg-1);
  padding: 15px 18px;
}

/* ==================== 03 DYNAMIC AUGMENT -> BUILD ENGINE ==================== */
.dynamic-card {
  border-top: 2px solid var(--accent);
}

.sub-tabs {
  display: inline-flex;
  border: 1px solid var(--rule);
  background: var(--bg-0);
}
.sub-tab {
  border: none;
  border-right: 1px solid var(--rule);
  background: transparent;
  color: var(--ink-3);
  padding: 5px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.sub-tab:last-child {
  border-right: none;
}
.sub-tab:hover {
  color: var(--ink-1);
}
.sub-tab.active {
  background: var(--accent);
  color: var(--accent-ink);
}

/* 4-Column Interlocking Augment Slots */
.augment-slots-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  margin-bottom: 14px;
}

.aug-slot {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-0);
  cursor: pointer;
  min-height: 58px;
}

.aug-slot:hover {
  background: var(--bg-2);
}

.aug-slot.filled {
  background: var(--bg-2);
  border-top: 2px solid var(--accent);
}

.aug-slot img {
  width: 34px;
  height: 34px;
  border-radius: var(--r-2);
  background: var(--bg-0);
  padding: 2px;
  object-fit: contain;
  flex-shrink: 0;
  border: 1px solid var(--rule);
}

.aug-slot-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 18px;
  height: 18px;
  border: 1px solid var(--rule-strong);
  background: var(--bg-0);
  color: var(--ink-2);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 10px;
  display: grid;
  place-items: center;
}
.aug-slot-remove:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.archetype-banner {
  padding: 12px 14px;
  background: var(--bg-0);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  margin-bottom: 12px;
}

.archetype-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 5px;
}

.archetype-title {
  font-family: var(--font-display);
  font-size: 15.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--ink-1);
}

.forge-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--bg-2);
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 2px 8px;
  font-weight: 700;
}

.archetype-desc {
  font-size: 12.5px;
  color: var(--ink-2);
}

.warning-banner {
  background: var(--bg-0);
  border: 1px dashed var(--accent);
  color: var(--accent);
  padding: 10px 14px;
  font-size: 12.5px;
  font-weight: 700;
  margin-bottom: 12px;
}

/* 6-Slot Mathematical 1px-Ruled Build Grid (NO gaps, NO shadows!) */
.build-six-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  margin-bottom: 14px;
}

.item-slot-card {
  position: relative;
  background: var(--bg-1);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.item-slot-card:hover {
  background: var(--bg-2);
}

.item-slot-card.is-synergy {
  background: var(--bg-2);
  border-top: 2px solid var(--accent);
}

.slot-order-num {
  position: absolute;
  top: 8px;
  right: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--ink-3);
}

.item-slot-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-right: 34px;
}

.item-slot-head img {
  width: 38px;
  height: 38px;
  border-radius: var(--r-2);
  border: 1px solid var(--rule-strong);
  flex-shrink: 0;
  background: var(--bg-0);
}

.item-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-1);
  line-height: 1.25;
}

.item-gold {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
}

.item-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  background: var(--bg-0);
  border: 1px solid var(--rule);
  color: var(--ink-2);
  width: fit-content;
}

.item-slot-card.is-synergy .item-badge {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

.item-reason {
  font-size: 11.5px;
  color: var(--ink-2);
  line-height: 1.45;
}

.synergy-notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}

.synergy-note {
  background: var(--bg-0);
  padding: 10px 12px;
  font-size: 12px;
  color: var(--ink-2);
}

.replaced-strip {
  margin-top: 10px;
  padding: 8px 12px;
  background: var(--bg-0);
  border: 1px dashed var(--rule-strong);
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.mini-item-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-2);
  border: 1px solid var(--rule);
  border-radius: var(--r-2);
  padding: 2px 7px 2px 2px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-1);
}
.mini-item-chip img {
  width: 20px;
  height: 20px;
  border-radius: var(--r-0);
}

/* ==================== 3-CHOOSE-1 COMPARATOR ==================== */
.comparator-panel {
  background: var(--bg-0);
  border: 1px solid var(--accent);
  padding: 14px;
  margin-bottom: 14px;
  display: none;
}

.comparator-panel.open {
  display: block;
}

.comp-inputs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 8px;
  margin-bottom: 12px;
}
@media (max-width: 820px) {
  .comp-inputs {
    grid-template-columns: 1fr;
  }
}

.comp-results {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}
@media (max-width: 820px) {
  .comp-results {
    grid-template-columns: 1fr;
  }
}

.comp-card {
  background: var(--bg-1);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.comp-card.best {
  background: var(--bg-2);
  border-top: 2px solid var(--accent);
}

.comp-card.trap {
  border-top: 2px dashed var(--rule-strong);
}

/* ==================== 04 AUGMENT MATRIX (3-COLUMN 1PX RULED) ==================== */
.aug-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}

.aug-col {
  background: var(--bg-1);
}

.aug-col-head {
  padding: 9px 12px;
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-0);
  border-bottom: 1px solid var(--rule);
}

.aug-col-head.prismatic {
  border-top: 2px solid var(--ink-1);
  color: var(--ink-1);
}
.aug-col-head.gold {
  border-top: 2px solid var(--accent);
  color: var(--accent);
}
.aug-col-head.silver {
  border-top: 2px solid var(--ink-3);
  color: var(--ink-2);
}

.aug-list {
  display: flex;
  flex-direction: column;
}

.aug-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bg-1);
  border-bottom: 1px solid var(--rule-subtle);
  border-left: 2px solid transparent;
  cursor: pointer;
}
.aug-card:last-child {
  border-bottom: none;
}

.aug-card:hover {
  background: var(--bg-2);
}

.aug-card.selected {
  border-left-color: var(--accent);
  background: var(--accent-dim);
}

.aug-card img {
  width: 34px;
  height: 34px;
  border-radius: var(--r-2);
  background: var(--bg-0);
  padding: 2px;
  object-fit: contain;
  flex-shrink: 0;
  border: 1px solid var(--rule);
}

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

.aug-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-1);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.aug-card-meta {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 2px;
}

.tag-new {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 800;
  background: var(--bg-0);
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 0 4px;
}

/* ==================== CORE ROUTES, SKILLS & COMBOS ==================== */
.core-route-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-0);
  border: 1px solid var(--rule);
  margin-bottom: -1px;
  flex-wrap: wrap;
}

.route-items {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.route-arrow {
  font-family: var(--font-mono);
  color: var(--ink-3);
  font-size: 11px;
}

.item-icon-box {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-2);
  border: 1px solid var(--rule);
  border-radius: var(--r-2);
  padding: 3px 8px 3px 3px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-1);
}
.item-icon-box img {
  width: 24px;
  height: 24px;
  border-radius: var(--r-0);
}

/* Skill 1-18 Strict Monospace Matrix */
.skill-grid {
  display: grid;
  grid-template-columns: repeat(18, minmax(0, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  margin-top: 8px;
}
@media (max-width: 720px) {
  .skill-grid {
    grid-template-columns: repeat(9, minmax(0, 1fr));
  }
}

.skill-cell {
  text-align: center;
  background: var(--bg-0);
  padding: 6px 2px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  color: var(--ink-2);
}
.skill-cell .lv {
  display: block;
  font-size: 9px;
  font-weight: 500;
  color: var(--ink-3);
  margin-bottom: 2px;
}
.skill-cell.k-Q { color: var(--ink-1); }
.skill-cell.k-W { color: var(--ink-2); }
.skill-cell.k-E { color: var(--ink-3); }
.skill-cell.k-R { background: var(--accent); color: var(--accent-ink); }
.skill-cell.k-R .lv { color: var(--accent-ink); }

/* Combo 1px Grid */
.combo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}

.combo-card {
  background: var(--bg-1);
  padding: 13px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.combo-card:hover {
  background: var(--bg-2);
}
.combo-card.is-trap {
  border-top: 2px dashed var(--rule-strong);
}

.combo-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.combo-head img {
  width: 34px;
  height: 34px;
  border-radius: var(--r-2);
  border: 1px solid var(--rule);
}

.combo-desc {
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.55;
}

/* ==================== FULL TIER LIST, AUGMENT DIR & BANDS (1PX GRIDS) ==================== */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.filter-input {
  padding: 6px 10px;
  border-radius: var(--r-2);
  border: 1px solid var(--rule);
  background: var(--bg-0);
  color: var(--ink-1);
  font-size: 12.5px;
  min-width: 210px;
  outline: none;
}
.filter-input:focus {
  border-color: var(--accent);
}

.champ-grid-full {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}

.champ-tile {
  background: var(--bg-1);
  padding: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
}
.champ-tile:hover {
  background: var(--bg-2);
}
.champ-tile img {
  width: 40px;
  height: 40px;
  border-radius: var(--r-2);
  border: 1px solid var(--rule);
}

.aug-directory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(295px, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}

.aug-dir-card {
  background: var(--bg-1);
  padding: 13px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.aug-dir-card:hover {
  background: var(--bg-2);
}

.aug-dir-desc {
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.bands-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}
.band-card {
  background: var(--bg-1);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.band-mechanic {
  font-size: 13px;
  color: var(--ink-1);
  line-height: 1.55;
}
.band-tip {
  font-size: 12px;
  color: var(--ink-2);
  background: var(--bg-0);
  border: 1px solid var(--rule);
  border-left: 2px solid var(--accent);
  padding: 9px 11px;
  line-height: 1.5;
}

/* ==================== SHARP SWISS MODAL ==================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 7, 0.84);
  z-index: 120;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-backdrop.open {
  display: flex;
}

.modal-box {
  background: var(--bg-1);
  border: 1px solid var(--accent);
  border-radius: var(--r-0);
  width: 100%;
  max-width: 720px;
  max-height: 86vh;
  overflow-y: auto;
  padding: 18px;
  color: var(--ink-1);
}

.modal-desc-box {
  background: var(--bg-0);
  border: 1px solid var(--rule);
  border-left: 2px solid var(--accent);
  padding: 12px 14px;
  font-size: 13px;
  color: var(--ink-1);
  margin-bottom: 14px;
  line-height: 1.55;
}

.picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  margin-top: 10px;
  max-height: 52vh;
  overflow-y: auto;
}

/* Loading & Toast */
.loading-bar {
  text-align: center;
  padding: 36px;
  font-family: var(--font-mono);
  color: var(--ink-2);
  font-size: 12.5px;
}

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--rule-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--accent);
  border: 1px solid var(--accent);
  color: var(--accent-ink);
  padding: 9px 15px;
  border-radius: var(--r-0);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  z-index: 200;
  display: none;
}
.toast.show {
  display: block;
}
