:root {
  --bg: #0b0d12;
  --surface: #12151d;
  --surface-2: #181c27;
  --surface-3: #202533;
  --border: #252b39;
  --border-strong: #343c4f;
  --text: #e9ecf2;
  --text-2: #c3c9d6;
  --muted: #8b93a7;
  --accent: #e8a33d;
  --accent-2: #f4bd63;
  --accent-ink: #1b1305;
  --accent-soft: rgba(232, 163, 61, 0.12);
  --good: #3fb97d;
  --good-soft: rgba(63, 185, 125, 0.13);
  --warn: #f08c3a;
  --warn-soft: rgba(240, 140, 58, 0.13);
  --bad: #ef5b5b;
  --bad-soft: rgba(239, 91, 91, 0.13);
  --info: #6aa7ff;
  --mana-W: #f3e9c6;
  --mana-U: #4a90d9;
  --mana-B: #8c7aa0;
  --mana-R: #e0533d;
  --mana-G: #3fa36b;
  --mana-C: #b6b0a8;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  --font: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --nav-h: 64px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(1200px 500px at 85% -10%, rgba(232, 163, 61, 0.08), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(106, 167, 255, 0.06), transparent 60%);
  pointer-events: none;
  z-index: -1;
}
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 4.2vw, 3.3rem); font-weight: 700; line-height: 1.08; }
h2 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); font-weight: 700; }
h3 { font-size: 1.12rem; font-weight: 600; }
h4 { font-size: 0.95rem; font-weight: 600; }
p { margin: 0 0 0.8em; }
.muted { color: var(--muted); }
.small { font-size: 0.84rem; }
.tiny { font-size: 0.75rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grow { flex: 1 1 auto; min-width: 0; }
.center { text-align: center; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 40px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-h);
  display: flex; align-items: center; gap: 24px;
  padding: 0 24px;
  background: rgba(11, 13, 18, 0.82);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; color: var(--text); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), #c7672a); color: var(--accent-ink); font-weight: 800; }
.nav-links { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a {
  color: var(--muted); padding: 8px 12px; border-radius: 8px; font-weight: 500; font-size: 0.92rem; white-space: nowrap;
}
.nav-links a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav-links a.active { color: var(--text); background: var(--surface-3); }
.nav-meta { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 0.82rem; white-space: nowrap; }
.nav-meta .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); display: inline-block; }
.nav-meta .dot.on { background: var(--good); }

main { max-width: 1320px; margin: 0 auto; padding: 32px 24px 96px; }

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: 0.92rem;
  padding: 10px 18px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text);
  cursor: pointer; transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap; text-decoration: none;
}
.btn:hover { background: var(--surface-3); border-color: #465068; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); box-shadow: 0 8px 22px rgba(232, 163, 61, 0.28); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--bad); }
.btn.lg { padding: 14px 26px; font-size: 1rem; }
.btn.sm { padding: 6px 12px; font-size: 0.82rem; }
.btn.icon { padding: 6px; width: 30px; height: 30px; font-size: 0.9rem; }
.btn .kbd { font-size: 0.72rem; opacity: 0.7; }

input[type=text], input[type=search], input[type=number], select, textarea {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: 10px 12px; outline: none; transition: border-color 0.15s ease, box-shadow 0.15s ease;
  max-width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
select { cursor: pointer; }
textarea { resize: vertical; width: 100%; line-height: 1.5; }
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 0.82rem; color: var(--muted); font-weight: 500; }

.segmented { display: inline-flex; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.segmented button { font: inherit; font-size: 0.85rem; font-weight: 500; border: 0; background: transparent; color: var(--muted); padding: 7px 12px; border-radius: 7px; cursor: pointer; }
.segmented button:hover { color: var(--text); }
.segmented button.on { background: var(--surface-3); color: var(--text); }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: 0.85rem; font-weight: 500;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); cursor: pointer; user-select: none;
  transition: all 0.15s ease;
}
.chip:hover { border-color: #4a5470; color: var(--text); }
.chip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.chip img { width: 16px; height: 16px; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 0.72rem; font-weight: 600; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.badge.good { background: var(--good-soft); color: var(--good); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.accent { background: var(--accent-soft); color: var(--accent-2); }
.badge.info { background: rgba(106, 167, 255, 0.12); color: var(--info); }

/* ---------- cards / panels ---------- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.panel.tight { padding: 16px; }
.panel h3 { margin-bottom: 12px; }
.panel-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.auto { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
@media (max-width: 900px) { .grid.two, .grid.three { grid-template-columns: 1fr; } }

.page-head { margin-bottom: 28px; }
.page-head p { color: var(--muted); max-width: 720px; margin-top: 8px; font-size: 1.02rem; }
.eyebrow { font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-2); font-weight: 600; margin-bottom: 10px; display: inline-block; }

/* ---------- home ---------- */
.hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: start; padding: 24px 0 8px; }
@media (max-width: 980px) { .hero { grid-template-columns: 1fr; gap: 24px; } }
.hero h1 span { color: var(--accent-2); }
.hero .lead { color: var(--text-2); font-size: 1.1rem; margin-top: 18px; max-width: 560px; }
.steps { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 10px; counter-reset: step; }
.steps li { display: flex; gap: 12px; align-items: flex-start; color: var(--text-2); }
.steps li::before { counter-increment: step; content: counter(step); flex: 0 0 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--accent-2); font-weight: 700; font-size: 0.8rem; }
.paste-box { position: relative; }
.paste-box textarea { min-height: 340px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.86rem; background: var(--bg); }
.dropzone.drag textarea { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.stat .v { font-family: var(--font-display); font-size: 1.55rem; font-weight: 700; line-height: 1.2; }
.stat .l { color: var(--muted); font-size: 0.78rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; }
.stat .s { color: var(--muted); font-size: 0.8rem; }
.stat.accent .v { color: var(--accent-2); }
.stat.good .v { color: var(--good); }
.stat.warn .v { color: var(--warn); }
.stat.bad .v { color: var(--bad); }

.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 56px; }
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; transition: transform 0.2s ease, border-color 0.2s ease; cursor: pointer; }
.feature:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.feature .ico { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-2); margin-bottom: 14px; font-size: 1.1rem; }
.feature p { color: var(--muted); font-size: 0.9rem; margin: 6px 0 0; }

/* ---------- results (what can I build) ---------- */
.result-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.result {
  position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  cursor: pointer; transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease; display: flex; flex-direction: column;
}
.result:hover { transform: translateY(-3px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.result .art { height: 120px; background-size: cover; background-position: center 25%; position: relative; }
.result .art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(18, 21, 29, 0.05), rgba(18, 21, 29, 0.95)); }
.result .art.none { background: linear-gradient(135deg, #1b2030, #262c3d); }
.result .body { padding: 14px 18px 18px; margin-top: -38px; position: relative; z-index: 1; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.result .title { font-family: var(--font-display); font-size: 1.08rem; font-weight: 700; line-height: 1.25; }
.result .pct { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; }
.meter { height: 8px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.meter.good > i { background: var(--good); }
.meter.warn > i { background: var(--warn); }
.meter.bad > i { background: var(--bad); }
.rank { position: absolute; top: 10px; left: 12px; z-index: 2; background: var(--accent) !important; color: var(--accent-ink) !important; }

/* ---------- mana symbols ---------- */
.ms { display: inline-flex; gap: 1px; vertical-align: middle; }
.ms img { width: 15px; height: 15px; display: block; }
.ms.lg img { width: 20px; height: 20px; }
.pips { display: inline-flex; gap: 3px; }
.pips img { width: 18px; height: 18px; }

/* ---------- deck view ---------- */
.deck-head { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: var(--surface); margin-bottom: 20px; }
.deck-head .bg { position: absolute; inset: 0; background-size: cover; background-position: center 25%; opacity: 0.35; filter: saturate(1.1); }
.deck-head .bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(18, 21, 29, 0.97) 30%, rgba(18, 21, 29, 0.55)); }
.deck-head .inner { position: relative; padding: 24px; display: flex; gap: 22px; align-items: flex-start; flex-wrap: wrap; }
.deck-head .cmd-img { width: 150px; border-radius: 9px; box-shadow: var(--shadow); cursor: zoom-in; }
.deck-head .name-input { font-family: var(--font-display); font-size: clamp(1.4rem, 2.6vw, 2rem); font-weight: 700; background: transparent; border: 1px solid transparent; padding: 2px 6px; margin-left: -7px; width: 100%; color: var(--text); }
.deck-head .name-input:hover { border-color: var(--border-strong); }
.deck-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.deck-actions .btn { font-size: 0.85rem; padding: 8px 14px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { font: inherit; font-weight: 600; font-size: 0.92rem; color: var(--muted); background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 14px; cursor: pointer; white-space: nowrap; }
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.tabs .count { font-size: 0.72rem; background: var(--surface-3); padding: 1px 7px; border-radius: 999px; margin-left: 6px; color: var(--text-2); }

.alerts { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: var(--radius-sm); font-size: 0.88rem; border: 1px solid; }
.alert.error { background: var(--bad-soft); border-color: rgba(239, 91, 91, 0.35); color: #ffb4b4; }
.alert.warn { background: var(--warn-soft); border-color: rgba(240, 140, 58, 0.35); color: #ffc79b; }
.alert.ok { background: var(--good-soft); border-color: rgba(63, 185, 125, 0.35); color: #9ee6bf; }
.alert.info { background: rgba(106, 167, 255, 0.1); border-color: rgba(106, 167, 255, 0.3); color: #b9d4ff; }

.columns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .columns { grid-template-columns: 1fr; } }
.col { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; min-height: 200px; transition: border-color 0.15s ease, background 0.15s ease; }
.col.dragover { border-color: var(--accent); background: #161a24; }
.col-head { padding: 14px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 8px; position: sticky; top: var(--nav-h); background: var(--surface); border-radius: var(--radius) var(--radius) 0 0; z-index: 2; }
.col-head h3 { margin: 0; font-size: 0.95rem; letter-spacing: 0.04em; text-transform: uppercase; }
.col-head .sub { font-size: 0.78rem; color: var(--muted); }
.col.use .col-head h3 { color: var(--good); }
.col.add .col-head h3 { color: var(--accent-2); }
.col.bulk .col-head h3 { color: var(--muted); }
.col-body { padding: 6px 8px 12px; }
.group-label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding: 12px 8px 4px; display: flex; justify-content: space-between; }

.crow {
  display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 7px; cursor: grab; font-size: 0.88rem; position: relative;
}
.crow:hover { background: var(--surface-2); }
.crow.dragging { opacity: 0.4; }
.crow .qty { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 22px; text-align: right; font-size: 0.82rem; }
.crow .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.crow .nm:hover { color: var(--accent-2); }
.crow .price { color: var(--muted); font-size: 0.78rem; font-variant-numeric: tabular-nums; }
.crow .tools { display: none; gap: 2px; }
.crow:hover .tools, .crow:focus-within .tools { display: inline-flex; }
@media (hover: none) { .crow .tools { display: inline-flex; } }
.crow .tbtn { border: 0; background: transparent; color: var(--muted); cursor: pointer; width: 24px; height: 24px; border-radius: 5px; display: grid; place-items: center; font-size: 0.8rem; padding: 0; }
.crow .tbtn:hover { background: var(--surface-3); color: var(--text); }
.crow .tbtn.on { color: var(--accent-2); }
.crow .lock { color: var(--accent-2); font-size: 0.75rem; }
.crow .warn-ico { color: var(--warn); font-size: 0.8rem; cursor: help; }
.crow .role { font-size: 0.68rem; color: var(--muted); border: 1px solid var(--border-strong); border-radius: 4px; padding: 0 4px; white-space: nowrap; }

.visual-group { margin-bottom: 28px; }
.visual-group h4 { margin-bottom: 10px; color: var(--text-2); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.card-tile { position: relative; border-radius: 8px; overflow: hidden; cursor: pointer; aspect-ratio: 488 / 680; background: var(--surface-2); transition: transform 0.15s ease; }
.card-tile:hover { transform: translateY(-3px) scale(1.02); z-index: 2; box-shadow: var(--shadow); }
.card-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-tile .ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 10px; text-align: center; font-size: 0.8rem; color: var(--muted); }
.card-tile .tag { position: absolute; top: 6px; right: 6px; }
.card-tile .qtyb { position: absolute; top: 6px; left: 6px; background: rgba(0, 0, 0, 0.75); color: #fff; font-weight: 700; font-size: 0.78rem; padding: 2px 7px; border-radius: 6px; }
.card-tile.missing img { filter: grayscale(0.2) brightness(0.9); }
.card-tile.missing::after { content: 'NEED'; position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); background: var(--accent); color: var(--accent-ink); font-size: 0.68rem; font-weight: 800; letter-spacing: 0.08em; padding: 2px 8px; border-radius: 5px; }

/* ---------- structure bars ---------- */
.struct { display: flex; flex-direction: column; gap: 10px; }
.srow { display: grid; grid-template-columns: 130px 1fr 110px; gap: 12px; align-items: center; font-size: 0.88rem; }
@media (max-width: 560px) { .srow { grid-template-columns: 96px 1fr; } .srow .st { grid-column: 2; } }
.srow .lbl { color: var(--text-2); font-weight: 500; }
.srow .bar { position: relative; height: 14px; background: var(--surface-3); border-radius: 4px; }
.srow .bar > i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: var(--good); }
.srow .bar.warn > i { background: var(--warn); }
.srow .bar.bad > i { background: var(--bad); }
.srow .bar.muted > i { background: var(--muted); }
.srow .bar .tgt { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text); border-radius: 1px; opacity: 0.7; }
.srow .st { font-size: 0.8rem; white-space: nowrap; }
.srow .num { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--text); }

/* ---------- charts ---------- */
.chart { width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .axis { fill: var(--muted); font-size: 11px; }
.chart .val { fill: var(--text-2); font-size: 11px; font-weight: 600; }
.chart .gridline { stroke: var(--border); stroke-width: 1; }
.chart .bar { fill: var(--accent); transition: opacity 0.15s; }
.chart .bar:hover, .chart .hit:hover + .bar { opacity: 0.8; }
.hbars { display: flex; flex-direction: column; gap: 8px; }
.hbar { display: grid; grid-template-columns: 96px 1fr 40px; gap: 10px; align-items: center; font-size: 0.85rem; }
.hbar .t { height: 12px; background: var(--surface-3); border-radius: 3px; position: relative; }
.hbar .t > i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--accent); }
.hbar .n { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-2); font-weight: 600; }
.hbar .k { color: var(--text-2); display: flex; gap: 6px; align-items: center; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.8rem; color: var(--text-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.stackbar { display: flex; height: 16px; border-radius: 4px; overflow: hidden; gap: 2px; background: var(--surface); }
.stackbar > i { display: block; height: 100%; }

/* ---------- analysis text ---------- */
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 10px 16px; font-size: 0.92rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--text); }
@media (max-width: 560px) { .kv { grid-template-columns: 1fr; gap: 2px; } .kv dd { margin-bottom: 8px; } }
ul.clean { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
ul.clean li { padding-left: 18px; position: relative; color: var(--text-2); font-size: 0.92rem; }
ul.clean li::before { content: ''; position: absolute; left: 2px; top: 0.62em; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
ul.clean.good li::before { background: var(--good); }
ul.clean.bad li::before { background: var(--bad); }
ul.clean.accent li::before { background: var(--accent); }
.plan { border-left: 2px solid var(--border-strong); padding-left: 14px; }
.plan h4 { color: var(--accent-2); margin-bottom: 6px; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.08em; }
.cardlink { color: var(--text); border-bottom: 1px dotted var(--muted); cursor: pointer; }
.cardlink:hover { color: var(--accent-2); }

.missing-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; }
.missing-item .issue { display: flex; gap: 12px; align-items: flex-start; font-weight: 500; font-size: 0.98rem; }
.sev { flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%; margin-top: 7px; }
.sev.s3 { background: var(--bad); } .sev.s2 { background: var(--warn); } .sev.s1 { background: var(--info); }
.recs { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; margin-top: 14px; }
.rec { display: flex; gap: 10px; align-items: center; padding: 8px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); }
.rec img { width: 42px; border-radius: 4px; cursor: pointer; }
.rec .grow { font-size: 0.85rem; }
.rec .nm { font-weight: 600; cursor: pointer; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
table.data th { text-align: left; font-weight: 600; color: var(--muted); font-size: 0.76rem; letter-spacing: 0.06em; text-transform: uppercase; padding: 12px 14px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); cursor: pointer; white-space: nowrap; user-select: none; }
table.data th.num, table.data td.num { text-align: right; }
table.data td { padding: 8px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr:hover td { background: var(--surface-2); }
.qty-ctl { display: inline-flex; align-items: center; gap: 4px; }
.qty-ctl button { width: 24px; height: 24px; border-radius: 6px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text); cursor: pointer; font-weight: 700; line-height: 1; padding: 0; }
.qty-ctl button:hover { background: var(--surface-3); }
.qty-ctl span { min-width: 22px; text-align: center; font-variant-numeric: tabular-nums; }

/* ---------- overlays ---------- */
.preview {
  position: fixed; z-index: 200; pointer-events: none; width: 300px; background: var(--surface-2); border: 1px solid var(--border-strong);
  border-radius: 12px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55); padding: 10px; opacity: 0; transform: translateY(4px); transition: opacity 0.12s ease, transform 0.12s ease;
}
.preview.show { opacity: 1; transform: none; }
.preview img { width: 100%; border-radius: 10px; display: block; }
.preview .meta { padding: 8px 4px 2px; font-size: 0.8rem; color: var(--text-2); display: flex; justify-content: space-between; gap: 8px; }
@media (hover: none) { .preview { display: none; } }

.modal-back { position: fixed; inset: 0; background: rgba(5, 6, 9, 0.72); backdrop-filter: blur(4px); z-index: 300; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; overflow-y: auto; animation: fade 0.15s ease; }
.modal { background: var(--surface); border: 1px solid var(--border-strong); border-radius: 14px; width: 100%; max-width: 880px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6); animation: pop 0.18s ease; }
.modal.narrow { max-width: 560px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 22px; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(0.98); } }
.card-detail { display: grid; grid-template-columns: 300px 1fr; gap: 24px; }
@media (max-width: 720px) { .card-detail { grid-template-columns: 1fr; } .card-detail .imgs { max-width: 300px; margin: 0 auto; } }
.card-detail .imgs img { width: 100%; border-radius: 12px; display: block; }
.card-detail .imgs .flip { margin-top: 8px; }
.oracle { white-space: pre-wrap; background: var(--bg); border: 1px solid var(--border); border-radius: 9px; padding: 12px 14px; font-size: 0.9rem; line-height: 1.55; color: var(--text-2); }
.oracle img { width: 15px; height: 15px; vertical-align: -2px; }

.toast-wrap { position: fixed; bottom: 20px; right: 20px; left: 20px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; z-index: 400; pointer-events: none; }
.toast { pointer-events: auto; background: var(--surface-3); border: 1px solid var(--border-strong); border-radius: 10px; padding: 12px 16px; box-shadow: var(--shadow); max-width: 440px; font-size: 0.88rem; animation: pop 0.18s ease; }
.toast.good { border-color: rgba(63, 185, 125, 0.5); }
.toast.bad { border-color: rgba(239, 91, 91, 0.5); }
.toast ul { margin: 6px 0 0; padding-left: 18px; color: var(--text-2); font-size: 0.82rem; }

.progress { position: fixed; inset: 0; z-index: 350; background: rgba(5, 6, 9, 0.75); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 16px; }
.progress .box { background: var(--surface); border: 1px solid var(--border-strong); border-radius: 14px; padding: 28px 30px; width: min(440px, 100%); text-align: center; box-shadow: var(--shadow); }
.spinner { width: 38px; height: 38px; border-radius: 50%; border: 3px solid var(--surface-3); border-top-color: var(--accent); animation: spin 0.8s linear infinite; margin: 0 auto 16px; }
@keyframes spin { to { transform: rotate(360deg); } }
.progress .meter { margin-top: 14px; }

.tip { position: fixed; z-index: 250; pointer-events: none; background: #05070b; color: var(--text); border: 1px solid var(--border-strong); border-radius: 7px; padding: 6px 10px; font-size: 0.8rem; max-width: 280px; box-shadow: var(--shadow); }

.autocomplete { position: relative; }
.ac-list { position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: 9px; box-shadow: var(--shadow); z-index: 60; max-height: 320px; overflow-y: auto; }
.ac-list div { padding: 8px 12px; cursor: pointer; font-size: 0.9rem; display: flex; justify-content: space-between; gap: 8px; }
.ac-list div:hover, .ac-list div.on { background: var(--surface-3); }

.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty h3 { color: var(--text); margin-bottom: 8px; }

.filters { display: flex; flex-direction: column; gap: 18px; }
.filters .grp > .lbl { font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.discover-layout { display: grid; grid-template-columns: 320px 1fr; gap: 24px; align-items: start; }
@media (max-width: 960px) { .discover-layout { grid-template-columns: 1fr; } }

.deck-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; cursor: pointer; transition: transform 0.2s ease, border-color 0.2s ease; }
.deck-card:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.deck-card .art { height: 110px; background-size: cover; background-position: center 25%; }
.deck-card .body { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }

footer.site { border-top: 1px solid var(--border); padding: 28px 24px; color: var(--muted); font-size: 0.8rem; text-align: center; }

@media (max-width: 720px) {
  .nav { padding: 0 12px; gap: 10px; }
  .nav-meta { display: none; }
  .brand span.full { display: none; }
  .hero .steps { display: none; }
  .hero .lead { font-size: 1rem; margin-top: 12px; }
  .paste-box textarea { min-height: 220px; }
  main { padding: 20px 16px 80px; }
  .panel { padding: 18px; }
  .deck-head .cmd-img { width: 110px; }
  .deck-head .inner { padding: 16px; gap: 14px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
