/* Manawise — site styles */
:root {
  --bg: #0b0d12;
  --bg-2: #0f1218;
  --surface: #141922;
  --surface-2: #1a202b;
  --surface-3: #222a37;
  --border: #252d3b;
  --border-2: #334054;
  --text: #eef1f6;
  --text-2: #bac2d0;
  --muted: #8a94a6;
  --accent: #f4b942;
  --accent-2: #ffd47a;
  --accent-ink: #1d1505;
  --accent-soft: rgba(244, 185, 66, 0.12);
  --good: #46d39a;
  --good-soft: rgba(70, 211, 154, 0.13);
  --bad: #ff7a7a;
  --bad-soft: rgba(255, 122, 122, 0.12);
  --warn: #ffb547;
  --info: #6cb6ff;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.7);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --mana-w: #f3ecd3;
  --mana-u: #5aa9e6;
  --mana-b: #a993c9;
  --mana-r: #f0715a;
  --mana-g: #5cc48a;
  --mana-c: #b5b0a8;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
[hidden] { display: none !important; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 0.5em; letter-spacing: -0.01em; }
h1, h2 { font-family: var(--display); font-weight: 700; }
h1 { font-size: clamp(2.1rem, 4.6vw, 3.5rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); }
h3 { font-size: 1.15rem; font-weight: 650; }
p { margin: 0 0 1em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::selection { background: rgba(244, 185, 66, 0.35); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 8px; font-weight: 600; }
.skip:focus { left: 12px; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
@media (max-width: 560px) { .container { padding: 0 16px; } }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(11, 13, 18, 0.78);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.header-inner { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 1.12rem; letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.brand img { width: 28px; height: 28px; }
.site-nav { display: flex; gap: 4px; margin-left: auto; }
.site-nav a { color: var(--text-2); padding: 8px 12px; border-radius: 10px; font-weight: 500; font-size: 0.95rem; }
.site-nav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); text-decoration: none; }
.site-nav a[aria-current="page"] { color: var(--text); background: rgba(255, 255, 255, 0.07); }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--border); border-radius: 10px; width: 42px; height: 40px; cursor: pointer; color: var(--text); }
.nav-toggle svg { margin: auto; }
@media (max-width: 820px) {
  .nav-toggle { display: grid; place-items: center; }
  .site-nav {
    display: none; position: absolute; left: 0; right: 0; top: 64px;
    flex-direction: column; gap: 2px; padding: 10px 16px 16px;
    background: rgba(11, 13, 18, 0.97); border-bottom: 1px solid var(--border);
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 12px; font-size: 1rem; }
}

/* ---------- Buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 12px; border: 1px solid var(--border-2);
  background: var(--surface-2); color: var(--text); font-weight: 600; font-size: 0.95rem;
  cursor: pointer; transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap; text-decoration: none; line-height: 1.2;
}
.btn:hover { background: var(--surface-3); border-color: #3f4d64; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: linear-gradient(180deg, var(--accent-2), var(--accent)); color: var(--accent-ink); border-color: transparent; box-shadow: 0 8px 24px -10px rgba(244, 185, 66, 0.6); }
.btn-primary:hover { background: linear-gradient(180deg, #ffe09a, #f7c457); border-color: transparent; }
.btn-ghost { background: transparent; }
.btn-lg { padding: 14px 22px; font-size: 1.02rem; border-radius: 14px; }
.btn-sm { padding: 6px 11px; font-size: 0.85rem; border-radius: 9px; }
.btn-icon { padding: 7px; width: 34px; height: 34px; border-radius: 9px; }
.btn svg { flex: none; }

.input, .select, .textarea {
  width: 100%; background: var(--bg-2); border: 1px solid var(--border-2); border-radius: 12px;
  padding: 11px 14px; color: var(--text); transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input::placeholder, .textarea::placeholder { color: #6b7587; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(244, 185, 66, 0.18); }
.textarea { min-height: 260px; resize: vertical; font-family: var(--mono); font-size: 0.86rem; line-height: 1.55; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5 6 6.5l5-5' stroke='%238a94a6' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }
label.field { display: grid; gap: 6px; font-size: 0.88rem; color: var(--text-2); font-weight: 500; }
.check { display: inline-flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 0.92rem; color: var(--text-2); }
.check input { width: 18px; height: 18px; accent-color: var(--accent); margin-top: 3px; flex: none; }

.seg { display: inline-flex; padding: 4px; gap: 4px; background: var(--bg-2); border: 1px solid var(--border-2); border-radius: 13px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 8px 14px; border-radius: 9px; cursor: pointer; color: var(--text-2); font-weight: 600; font-size: 0.92rem; }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--surface-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--border-2); }

.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tabs button { background: none; border: 0; padding: 10px 14px; color: var(--muted); font-weight: 600; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }

/* ---------- Surfaces ---------- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.panel-tight { padding: 16px; }
.panel h2 { font-size: 1.35rem; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.74rem; font-weight: 700; color: var(--accent); margin-bottom: 12px; }
.lede { font-size: 1.12rem; color: var(--text-2); max-width: 62ch; }
.muted { color: var(--muted); }
.small { font-size: 0.86rem; }
.tiny { font-size: 0.78rem; }
.num { font-variant-numeric: tabular-nums; }
.good { color: var(--good); }
.bad { color: var(--bad); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; background: rgba(255, 255, 255, 0.06); color: var(--text-2); border: 1px solid rgba(255, 255, 255, 0.06); white-space: nowrap; }
.chip-accent { background: var(--accent-soft); color: var(--accent-2); border-color: rgba(244, 185, 66, 0.2); }
.chip-good { background: var(--good-soft); color: var(--good); border-color: rgba(70, 211, 154, 0.2); }
.chip-bad { background: var(--bad-soft); color: var(--bad); border-color: rgba(255, 122, 122, 0.2); }
.chip-role-ramp { background: rgba(92, 196, 138, 0.13); color: #7fdcaa; }
.chip-role-draw { background: rgba(90, 169, 230, 0.14); color: #8cc6f2; }
.chip-role-removal { background: rgba(240, 113, 90, 0.14); color: #f5a08f; }
.chip-role-wipe { background: rgba(169, 147, 201, 0.16); color: #c7b6e3; }
.chip-role-protection { background: rgba(243, 236, 211, 0.1); color: #eee3bd; }
.chip-role-lands { background: rgba(181, 176, 168, 0.13); color: #d2cdc4; }
.chip-role-theme { background: var(--accent-soft); color: var(--accent-2); }
.chip-role-staple { background: rgba(108, 182, 255, 0.1); color: #a5cff7; }

.pips { display: inline-flex; gap: 3px; vertical-align: middle; }
.pips img { width: 18px; height: 18px; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.5)); }
.pips.lg img { width: 24px; height: 24px; }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 72px 0 64px; overflow: hidden; }
.hero::before {
  content: ''; position: absolute; inset: -20% -10% auto; height: 120%;
  background:
    radial-gradient(600px 380px at 78% 30%, rgba(244, 185, 66, 0.16), transparent 70%),
    radial-gradient(520px 360px at 15% 10%, rgba(90, 169, 230, 0.12), transparent 70%),
    radial-gradient(420px 300px at 55% 90%, rgba(169, 147, 201, 0.1), transparent 70%);
  pointer-events: none;
}
.hero-inner { position: relative; display: grid; grid-template-columns: 1.08fr 0.92fr; gap: 48px; align-items: center; }
.hero h1 em { font-style: italic; color: var(--accent-2); }
.hero .lede { margin-bottom: 26px; }
.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.hero-proof { list-style: none; padding: 0; margin: 22px 0 0; display: flex; gap: 18px; flex-wrap: wrap; color: var(--text-2); font-size: 0.92rem; }
.hero-proof li { display: inline-flex; gap: 7px; align-items: center; }
.hero-proof svg { color: var(--good); }
.fan { position: relative; height: 440px; max-width: 540px; width: 100%; justify-self: center; }
.fan .card-img { position: absolute; width: 230px; top: 40px; left: 50%; border-radius: 13px; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.06); transition: transform 0.35s cubic-bezier(.2, .8, .2, 1); }
.fan .card-img:nth-child(1) { transform: translateX(-104%) rotate(-10deg) translateY(26px); }
.fan .card-img:nth-child(2) { transform: translateX(-50%) translateY(-6px); z-index: 2; }
.fan .card-img:nth-child(3) { transform: translateX(4%) rotate(10deg) translateY(26px); }
.fan:hover .card-img:nth-child(1) { transform: translateX(-112%) rotate(-13deg) translateY(20px); }
.fan:hover .card-img:nth-child(3) { transform: translateX(12%) rotate(13deg) translateY(20px); }
.fan-badge { position: absolute; z-index: 3; background: rgba(20, 25, 34, 0.92); border: 1px solid var(--border-2); border-radius: 14px; padding: 10px 14px; font-size: 0.85rem; box-shadow: var(--shadow); backdrop-filter: blur(8px); }
.fan-badge strong { display: block; font-size: 1.1rem; }
.fan-badge.b1 { left: -2%; bottom: 18px; }
.fan-badge.b2 { right: -2%; top: 6px; }
@media (max-width: 960px) {
  .hero { padding: 40px 0 36px; }
  .hero-inner { grid-template-columns: 1fr; gap: 20px; }
  .fan { height: 300px; max-width: 420px; margin: 0 auto; width: 100%; }
  .fan .card-img { width: 160px; top: 24px; }
  .fan-badge.b1 { left: 0; bottom: 0; }
  .fan-badge.b2 { right: 0; top: 0; }
}

/* typeahead */
.typeahead { position: relative; max-width: 560px; }
.typeahead .input { padding-left: 44px; height: 54px; font-size: 1.02rem; border-radius: 14px; background: rgba(15, 18, 24, 0.85); }
.typeahead .ta-icon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.ta-list { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 30; background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 14px; box-shadow: var(--shadow); padding: 6px; max-height: 360px; overflow: auto; display: none; }
.ta-list.open { display: block; }
.ta-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; cursor: pointer; color: var(--text); }
.ta-item:hover, .ta-item[aria-selected="true"] { background: var(--surface-3); text-decoration: none; }
.ta-item img.thumb { width: 44px; height: 32px; object-fit: cover; border-radius: 6px; flex: none; }
.ta-item .ta-main { min-width: 0; flex: 1; }
.ta-item .ta-title { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ta-item .ta-sub { display: block; font-size: 0.8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ta-empty { padding: 12px; color: var(--muted); font-size: 0.9rem; }

/* ---------- Sections ---------- */
.section { padding: 64px 0; }
.section-tight { padding: 40px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; flex-wrap: wrap; }
.section-head p { margin: 0; color: var(--text-2); max-width: 60ch; }
.divider { border: 0; border-top: 1px solid var(--border); margin: 0; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; counter-reset: step; }
.step { position: relative; padding: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.step::before { counter-increment: step; content: counter(step); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-2); font-weight: 700; margin-bottom: 14px; font-family: var(--display); font-size: 1.1rem; }
.step p { color: var(--text-2); margin: 0; font-size: 0.95rem; }
@media (max-width: 820px) { .steps { grid-template-columns: 1fr; } }

.features { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.feature { padding: 28px; border-radius: 20px; border: 1px solid var(--border); background: linear-gradient(160deg, var(--surface-2), var(--surface) 60%); overflow: hidden; position: relative; }
.feature h3 { font-family: var(--display); font-size: 1.5rem; font-weight: 700; }
.feature p { color: var(--text-2); }
.feature .mini { margin-top: 18px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; display: grid; gap: 8px; font-size: 0.88rem; }
.mini-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
@media (max-width: 820px) { .features { grid-template-columns: 1fr; } }

.faq { display: grid; gap: 10px; max-width: 820px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 0 18px; }
.faq summary { cursor: pointer; padding: 16px 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--muted); font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: '–'; }
.faq details p { color: var(--text-2); }

.cta-band { border-radius: 22px; padding: 36px; background: radial-gradient(500px 200px at 85% 0%, rgba(244, 185, 66, 0.18), transparent 70%), var(--surface); border: 1px solid var(--border); display: flex; gap: 24px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.cta-band h2 { margin: 0 0 6px; }
.cta-band p { margin: 0; color: var(--text-2); }

/* ---------- Deck tiles ---------- */
.deck-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.deck-tile { position: relative; display: flex; flex-direction: column; border-radius: 16px; overflow: hidden; background: var(--surface); border: 1px solid var(--border); color: var(--text); transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease; }
.deck-tile:hover { transform: translateY(-3px); border-color: var(--border-2); box-shadow: var(--shadow); text-decoration: none; }
.deck-tile .art { position: relative; aspect-ratio: 626 / 457; background: var(--surface-2) center / cover no-repeat; }
.deck-tile .art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(20, 25, 34, 0.95)); }
.deck-tile .art .pips { position: absolute; left: 12px; bottom: 10px; z-index: 1; }
.deck-tile .art .tile-value { position: absolute; right: 10px; top: 10px; z-index: 1; background: rgba(11, 13, 18, 0.78); border-radius: 8px; padding: 3px 8px; font-size: 0.8rem; font-weight: 600; backdrop-filter: blur(6px); }
.deck-tile .body { padding: 12px 14px 14px; display: grid; gap: 2px; }
.deck-tile .body > span { display: block; }
.deck-tile .title { font-weight: 700; font-size: 1.02rem; line-height: 1.3; }
.deck-tile .sub { font-size: 0.82rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deck-tile .credit { position: absolute; right: 10px; bottom: 8px; z-index: 1; font-size: 0.64rem; color: rgba(255, 255, 255, 0.55); }

.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 22px; }
.filters .input { max-width: 340px; }
.color-filter { display: inline-flex; gap: 6px; }
.color-filter button { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border-2); background: var(--bg-2); cursor: pointer; display: grid; place-items: center; opacity: 0.55; transition: opacity 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease; padding: 0; }
.color-filter button img { width: 22px; height: 22px; }
.color-filter button[aria-pressed="true"] { opacity: 1; box-shadow: 0 0 0 2px var(--accent); }
.color-filter button:hover { opacity: 1; }

/* ---------- Upgrade tool ---------- */
.tool-head { padding: 40px 0 8px; }
.tool-head h1 { font-size: clamp(1.9rem, 3.6vw, 2.7rem); }
.tool-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 960px) { .tool-grid { grid-template-columns: minmax(0, 1fr); } }
.tool-step-title { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.05rem; margin-bottom: 14px; }
.tool-step-title .n { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-2); font-size: 0.85rem; }
.precon-list { max-height: 340px; overflow: auto; border: 1px solid var(--border); border-radius: 12px; margin-top: 10px; background: var(--bg-2); }
.precon-opt { display: flex; align-items: center; gap: 12px; padding: 9px 12px; cursor: pointer; border-bottom: 1px solid rgba(255, 255, 255, 0.04); width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; color: var(--text); }
.precon-opt:hover { background: var(--surface-2); }
.precon-opt[aria-pressed="true"] { background: var(--accent-soft); }
.precon-opt img.thumb { width: 52px; height: 38px; object-fit: cover; border-radius: 6px; flex: none; background: var(--surface-2); }
.precon-opt .po-main { min-width: 0; flex: 1; }
.precon-opt .po-title { display: block; font-weight: 600; font-size: 0.94rem; line-height: 1.35; }
.precon-opt .po-sub { display: block; font-size: 0.78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.budget-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.budget-custom { position: relative; width: 120px; }
.budget-custom .input { padding-left: 26px; }
.budget-custom::before { content: '$'; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.range { width: 100%; accent-color: var(--accent); }
.range-row { display: flex; align-items: center; gap: 14px; }
.range-row output { min-width: 66px; font-weight: 700; text-align: right; }
.stack { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }
.stack-sm { display: grid; gap: 10px; }
.cmdr-pick { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--border); }
.cmdr-pick img { width: 56px; border-radius: 6px; }

.progress { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress > span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 0.3s ease; }
.loading-card { display: grid; gap: 12px; text-align: center; padding: 34px; }
.spinner { width: 34px; height: 34px; margin: 0 auto; border-radius: 50%; border: 3px solid var(--surface-3); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.results { margin-top: 28px; display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
.results select { max-width: 100%; min-width: 0; text-overflow: ellipsis; }
.cmdr-label { display: inline-flex; gap: 8px; align-items: center; margin-top: 10px; max-width: 100%; flex-wrap: wrap; }
.result-hero { position: relative; border-radius: 20px; overflow: hidden; border: 1px solid var(--border); background: var(--surface); }
.result-hero .bg { position: absolute; inset: 0; background: center 30% / cover no-repeat; opacity: 0.35; filter: saturate(1.1); }
.result-hero .bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(20, 25, 34, 0.98) 30%, rgba(20, 25, 34, 0.6)); }
.result-hero .inner { position: relative; padding: 26px; display: grid; grid-template-columns: auto 1fr auto; gap: 22px; align-items: center; }
.result-hero .cmdr-img { width: 120px; border-radius: 9px; box-shadow: 0 16px 30px -12px rgba(0, 0, 0, 0.8); }
.result-hero h2 { margin-bottom: 6px; }
.total-box { text-align: right; }
.total-box .big { font-family: var(--display); font-size: 2.4rem; font-weight: 700; line-height: 1; color: var(--accent-2); }
.total-box .of { color: var(--muted); font-size: 0.9rem; margin-top: 4px; }
.over-budget { color: var(--bad) !important; }
@media (max-width: 760px) {
  .result-hero .inner { grid-template-columns: auto 1fr; padding: 18px; gap: 14px; }
  .result-hero .cmdr-img { width: 78px; }
  .total-box { grid-column: 1 / -1; text-align: left; display: flex; align-items: baseline; gap: 12px; }
}
.action-row { display: flex; gap: 10px; flex-wrap: wrap; }
@media (max-width: 560px) { .action-row > .btn { flex: 1 1 auto; } .hero-ctas > .btn { flex: 1 1 auto; } }

.meters { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.meter { background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.meter .m-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 0.86rem; color: var(--text-2); font-weight: 600; }
.meter .m-val { font-variant-numeric: tabular-nums; color: var(--text); font-weight: 700; }
.meter .m-val .arrow { color: var(--muted); font-weight: 500; margin: 0 3px; }
.meter .track { position: relative; height: 13px; margin-top: 9px; }
.meter .track::before, .meter .track::after { content: ''; position: absolute; left: 0; right: 0; height: 5px; border-radius: 99px; background: var(--surface-3); }
.meter .track::before { top: 0; }
.meter .track::after { bottom: 0; }
.meter .fill { position: absolute; left: 0; height: 5px; border-radius: 99px; z-index: 1; transition: width 0.4s ease; }
.meter .fill.before { top: 0; background: #5d6779; }
.meter .fill.after { bottom: 0; background: var(--accent); }
.meter .target { position: absolute; z-index: 2; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--text); border-radius: 2px; opacity: 0.75; }
.meter .m-note { font-size: 0.75rem; color: var(--muted); margin-top: 7px; }

.swap-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 960px) { .swap-grid { grid-template-columns: minmax(0, 1fr); } }
.swap-col h3 { display: flex; align-items: center; gap: 10px; }
.swap-col h3 .count { font-size: 0.8rem; padding: 2px 9px; border-radius: 99px; }
.swap-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.swap-item { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 13px; background: var(--bg-2); border: 1px solid var(--border); transition: border-color 0.15s ease, background 0.15s ease; }
.swap-item:hover { border-color: var(--border-2); }
.swap-item .thumb { width: 46px; aspect-ratio: 488 / 680; border-radius: 4px; object-fit: cover; background: var(--surface-3); }
.swap-item .si-name { font-weight: 650; line-height: 1.3; }
.swap-item .si-reason { font-size: 0.8rem; color: var(--muted); line-height: 1.4; margin-top: 3px; }
.swap-item .si-meta { display: flex; gap: 6px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.swap-item .si-right { display: grid; gap: 6px; justify-items: end; }
.swap-item .price { font-weight: 700; font-variant-numeric: tabular-nums; }
.swap-item.cut { opacity: 0.95; }
.swap-item.cut .si-name { color: var(--text-2); }
.swap-item.flash { animation: flash 0.8s ease; }
@keyframes flash { 0% { background: var(--accent-soft); border-color: var(--accent); } 100% { background: var(--bg-2); } }
.alt-pop { grid-column: 1 / -1; display: grid; gap: 6px; padding-top: 6px; border-top: 1px dashed var(--border-2); margin-top: 4px; }
.alt-opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 10px; border-radius: 9px; background: var(--surface); border: 1px solid var(--border); cursor: pointer; text-align: left; color: var(--text); width: 100%; }
.alt-opt:hover { border-color: var(--accent); }
.alt-opt .alt-name { font-weight: 600; font-size: 0.9rem; }
.alt-opt .alt-sub { font-size: 0.75rem; color: var(--muted); }

.curve { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; align-items: end; height: 150px; padding-top: 10px; }
.curve .col { display: grid; grid-template-rows: 1fr auto; height: 100%; gap: 6px; text-align: center; }
.curve .bars { display: flex; align-items: flex-end; justify-content: center; gap: 3px; height: 100%; }
.curve .bar { width: 42%; max-width: 22px; border-radius: 5px 5px 2px 2px; background: #4a5466; min-height: 2px; transition: height 0.4s ease; }
.curve .bar.after { background: var(--accent); }
.curve .lbl { font-size: 0.76rem; color: var(--muted); font-weight: 600; }
.legend { display: flex; gap: 14px; font-size: 0.8rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

.decklist { columns: 3 240px; column-gap: 28px; }
.decklist .group { break-inside: avoid; margin-bottom: 18px; }
.decklist h4 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 6px; }
.decklist ul { list-style: none; margin: 0; padding: 0; }
.decklist li { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; font-size: 0.92rem; border-bottom: 1px solid rgba(255, 255, 255, 0.03); }
.decklist li .q { color: var(--muted); margin-right: 6px; font-variant-numeric: tabular-nums; }
.decklist li .p { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 0.84rem; }
.decklist li.is-cut a { text-decoration: line-through; color: var(--muted); }
.decklist li.is-add a { color: var(--good); }

.card-link { color: var(--text); border-bottom: 1px dotted rgba(255, 255, 255, 0.25); }
.card-link:hover { color: var(--accent-2); text-decoration: none; border-bottom-color: var(--accent); }

.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; background: var(--accent-soft); border: 1px solid rgba(244, 185, 66, 0.22); color: var(--text-2); font-size: 0.92rem; }
.notice.error { background: var(--bad-soft); border-color: rgba(255, 122, 122, 0.25); }
.notice svg { flex: none; margin-top: 2px; color: var(--accent); }
.notice.error svg { color: var(--bad); }

/* ---------- Precon page ---------- */
.precon-hero { position: relative; padding: 40px 0 44px; overflow: hidden; border-bottom: 1px solid var(--border); }
.precon-hero .bg { position: absolute; inset: 0; background: center 25% / cover no-repeat; opacity: 0.22; filter: blur(2px) saturate(1.1); transform: scale(1.05); }
.precon-hero .bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11, 13, 18, 0.55), var(--bg)); }
.precon-hero .container { position: relative; }
.crumbs { font-size: 0.86rem; color: var(--muted); margin-bottom: 22px; }
.crumbs a { color: var(--text-2); }
.precon-hero-grid { display: grid; grid-template-columns: auto 1fr; gap: 36px; align-items: center; }
.cmdr-stack { position: relative; width: 250px; }
.cmdr-stack img { width: 250px; border-radius: 13px; box-shadow: 0 30px 50px -20px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.06); }
.cmdr-stack.two img + img { position: absolute; top: 34px; left: 44px; transform: rotate(6deg); }
.cmdr-stack.two { margin-right: 44px; }
.stat-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 22px; }
.stat { background: rgba(20, 25, 34, 0.8); border: 1px solid var(--border); border-radius: 12px; padding: 9px 14px; min-width: 110px; }
.stat .k { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }
.stat .v { font-weight: 700; font-size: 1.08rem; font-variant-numeric: tabular-nums; }
@media (max-width: 820px) {
  .precon-hero-grid { grid-template-columns: 1fr; gap: 22px; }
  .cmdr-stack, .cmdr-stack img { width: 180px; }
  .cmdr-stack.two img + img { left: 30px; top: 24px; }
}
.precon-body { display: grid; gap: 44px; padding-top: 40px; padding-bottom: 40px; }
.prose { max-width: 72ch; color: var(--text-2); }
.prose h2 { color: var(--text); }
.prose strong { color: var(--text); }

/* ---------- Tables ---------- */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.tbl { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.tbl th, .tbl td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl th { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 700; background: var(--surface-2); white-space: nowrap; }
.tbl th button { all: unset; cursor: pointer; }
.tbl th button:hover { color: var(--text); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: rgba(255, 255, 255, 0.02); }
.tbl .r { text-align: right; }
.tbl .card-cell { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.tbl .card-cell img { width: 40px; border-radius: 4px; flex: none; }
.tbl .card-cell .cc-name { font-weight: 650; }
.tbl .card-cell .cc-sub { font-size: 0.78rem; color: var(--muted); }

.risk { display: inline-flex; align-items: center; gap: 8px; min-width: 130px; }
.risk .bar { flex: 1; height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; min-width: 50px; }
.risk .bar span { display: block; height: 100%; border-radius: 99px; }
.risk-Low .bar span { background: var(--good); }
.risk-Medium .bar span { background: var(--warn); }
.risk-High .bar span, .risk-Very .bar span { background: var(--bad); }
.risk-None .bar span { background: var(--info); }
.risk .lv { font-size: 0.8rem; font-weight: 700; white-space: nowrap; }

/* ---------- Price watch ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; }
.kpi .k { font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 700; }
.kpi .v { font-family: var(--display); font-size: 1.8rem; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.kpi .s { font-size: 0.82rem; color: var(--muted); }
@media (max-width: 860px) { .kpis { grid-template-columns: 1fr 1fr; } }
.watch-table td .delta { font-weight: 650; font-variant-numeric: tabular-nums; }
.spark { width: 90px; height: 28px; display: block; }
.alert-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 0.78rem; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: var(--good-soft); color: var(--good); }
.alert-pill.idle { background: rgba(255, 255, 255, 0.05); color: var(--muted); font-weight: 600; }
tr.hit { background: rgba(70, 211, 154, 0.05); }
.empty-state { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty-state h3 { color: var(--text); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-bottom: 14px; }

/* ---------- Modal / sheet ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(4, 6, 10, 0.72); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: 20px; opacity: 0; animation: fadeIn 0.18s ease forwards; }
@keyframes fadeIn { to { opacity: 1; } }
.modal { position: relative; width: 100%; max-width: 760px; max-height: calc(100vh - 40px); overflow: auto; background: var(--surface); border: 1px solid var(--border-2); border-radius: 20px; box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.9); padding: 24px; transform: translateY(8px); animation: rise 0.22s ease forwards; }
@keyframes rise { to { transform: none; } }
.modal-close { position: absolute; top: 14px; right: 14px; }
.card-sheet { display: grid; grid-template-columns: 260px 1fr; gap: 24px; }
.card-sheet .cs-img { position: relative; }
.card-sheet .cs-img img { width: 100%; border-radius: 12px; box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.9); }
.card-sheet h3 { font-family: var(--display); font-size: 1.6rem; font-weight: 700; margin-right: 40px; }
.price-big { display: flex; gap: 18px; margin: 12px 0 18px; flex-wrap: wrap; }
.price-big > div { background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; min-width: 110px; }
.price-big .k { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }
.price-big .v { font-size: 1.3rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.buy-row { display: flex; flex-wrap: wrap; gap: 10px; }
.print-list { max-height: 260px; overflow: auto; border: 1px solid var(--border); border-radius: 12px; }
.print-opt { display: grid; grid-template-columns: auto 1fr auto auto; gap: 10px; align-items: center; padding: 9px 12px; border-bottom: 1px solid var(--border); cursor: pointer; font-size: 0.88rem; }
.print-opt:last-child { border-bottom: 0; }
.print-opt:hover { background: var(--surface-2); }
.print-opt input { accent-color: var(--accent); }
.print-opt .po-set { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.form-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 680px) {
  .modal { padding: 18px; border-radius: 18px 18px 0 0; max-height: 92vh; align-self: flex-end; }
  .modal-backdrop { padding: 0; align-items: flex-end; }
  .card-sheet { grid-template-columns: 1fr; }
  .card-sheet .cs-img { max-width: 220px; margin: 0 auto; }
  .form-row { grid-template-columns: 1fr 1fr; }
}

/* hover preview */
.hover-preview { position: fixed; z-index: 90; width: 250px; pointer-events: none; border-radius: 12px; box-shadow: 0 24px 50px -16px rgba(0, 0, 0, 0.9); opacity: 0; transition: opacity 0.12s ease; }
.hover-preview.show { opacity: 1; }
@media (hover: none) { .hover-preview { display: none; } }

/* toast */
.toasts { position: fixed; z-index: 100; left: 50%; bottom: 22px; transform: translateX(-50%); display: grid; gap: 8px; width: min(92vw, 420px); }
.toast { background: var(--surface-3); border: 1px solid var(--border-2); color: var(--text); padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow); font-size: 0.92rem; animation: rise 0.2s ease; display: flex; gap: 10px; align-items: center; }
.toast.good { border-color: rgba(70, 211, 154, 0.4); }

/* ad slot */
.ad-slot { min-height: 0; }
.ad-slot.on { min-height: 120px; display: grid; place-items: center; }
.ad-slot .ad-label { font-size: 0.68rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 4px; text-align: center; }

/* skeleton */
.skel { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Footer ---------- */
.site-footer { margin-top: 40px; border-top: 1px solid var(--border); padding: 44px 0 34px; background: var(--bg-2); }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 24px; margin-bottom: 26px; }
.footer-grid h4 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 10px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.footer-grid a { color: var(--text-2); font-size: 0.92rem; }
.footer-grid p { color: var(--muted); font-size: 0.9rem; max-width: 40ch; margin-top: 10px; }
.fine { font-size: 0.78rem; color: #6f798b; max-width: 92ch; margin: 0 0 8px; }
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > :first-child { grid-column: 1 / -1; } }

.newsletter[hidden] { display: none !important; }
[data-config-hide][hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
