@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/css/fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/css/fonts/space-grotesk-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* ── Theme Variables ── */
:root {
    --bg-dark: #0f0f0f;
    --card-bg: #1a1a1a;
    --card-border: rgba(255,255,255,0.08);
    --card-hover-glow: rgba(139,92,246,0.25);
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-muted: #94949e;
    --nav-bg: rgba(15,15,15,0.95);
    --nav-border: rgba(255,255,255,0.06);
    --gradient-purple: linear-gradient(135deg, #a855f7 0%, #6366f1 100%);
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.5);
    --color-W: #F9FAF4;
    --color-U: #0E68AB;
    --color-B: #150B00;
    --color-R: #D3202A;
    --color-G: #00733E;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { /* scroll-behavior: smooth removed — causes Chrome scroll fighting on long pages */ }
body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; background: var(--bg-dark); color: var(--text-primary); line-height: 1.6; min-height: 100vh; }
h1,h2,h3,h4,h5,h6 { font-family: 'Space Grotesk', -apple-system, sans-serif; font-weight: 600; line-height: 1.3; }
a { color: inherit; text-decoration: none; transition: color 0.2s ease; }
a:hover { color: #a78bfa; }
.container { max-width: 1280px; margin: 0 auto; padding: 0 1rem; }

/* ── Nav ── */
.nav { position: fixed; top: 0; left: 0; right: 0; background: var(--nav-bg); border-bottom: 1px solid var(--nav-border); z-index: 1000; height: 64px; display: flex; align-items: center; }
.nav-content { display: flex; justify-content: space-between; align-items: center; width: 100%; }
.nav-logo { font-family: 'Space Grotesk', sans-serif; font-size: 1.5rem; font-weight: 700; background: var(--gradient-purple); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.nav-links { display: flex; gap: 2rem; list-style: none; }
.nav-links a { font-size: 0.9rem; font-weight: 500; color: var(--text-secondary); }
.nav-links a:hover, .nav-links a.active { color: var(--text-primary); }
.mobile-menu-btn { display: none; background: none; border: none; color: var(--text-primary); font-size: 1.5rem; cursor: pointer; }
@media (max-width: 768px) {
    .nav-links { display: none; position: absolute; top: 64px; left: 0; right: 0; background: var(--nav-bg); border-bottom: 1px solid var(--nav-border); flex-direction: column; padding: 1rem; gap: 0; }
    .nav-links.active { display: flex; }
    .nav-links a { padding: 0.75rem 1rem; display: block; border-bottom: 1px solid var(--card-border); }
    .nav-links a:last-child { border-bottom: none; }
    .mobile-menu-btn { display: block; }
}

/* ── Footer ── */
footer { border-top: 1px solid var(--card-border); padding: 2rem 0; margin-top: 4rem; }
.footer-content { display: flex; flex-direction: column; align-items: center; gap: 1rem; text-align: center; }
.footer-logo { font-family: 'Space Grotesk', sans-serif; font-size: 1.25rem; font-weight: 700; background: var(--gradient-purple); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.footer-text { color: var(--text-muted); font-size: 0.875rem; }
.footer-links { display: flex; gap: 1.5rem; list-style: none; }
.footer-links a { color: var(--text-secondary); font-size: 0.875rem; }
.footer-links a:hover { color: var(--text-primary); }
.wubrg-dots { display: flex; gap: 0.5rem; justify-content: center; margin-top: 0.25rem; }
.mana-dot { width: 10px; height: 10px; border-radius: 50%; }

/* ── Main ── */
main { margin-top: 64px; min-height: calc(100vh - 64px); padding-bottom: 2rem; }

/* ── Breadcrumb ── */
.breadcrumb { padding: 1.25rem 0 0; font-size: 0.85rem; color: var(--text-muted); }
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: #a78bfa; }
.breadcrumb span { margin: 0 0.4rem; }

/* ── Hero ── */
.hero-section { padding: 2rem 0 2.5rem; text-align: center; }
.hero-section h1 { font-size: 2.5rem; margin-bottom: 0.5rem; background: var(--gradient-purple); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero-section .subtitle { color: var(--text-secondary); font-size: 1.05rem; max-width: 640px; margin: 0 auto; }

/* ── Calculator Layout ── */
.calc-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; isolation: isolate; }
@media (max-width: 960px) {
    .calc-layout { grid-template-columns: 1fr; }
}

/* ── Panels ── */
.panel { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 12px; padding: 1.5rem; }
#resultsPanel { contain: layout paint; }
.panel h2 { font-size: 1.15rem; margin-bottom: 1.25rem; display: flex; align-items: center; gap: 0.5rem; }
.panel h2 .icon { font-size: 1.1rem; }
.panel h3 { font-size: 0.95rem; margin-bottom: 0.75rem; color: var(--text-secondary); }

/* ── Format Selector ── */
.format-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 0.5rem; margin-bottom: 1.5rem; }
.format-btn { padding: 0.5rem 0.75rem; background: rgba(255,255,255,0.04); border: 1px solid var(--card-border); border-radius: 8px; font-size: 0.8rem; font-weight: 500; color: var(--text-secondary); cursor: pointer; font-family: inherit; transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease; text-align: center; }
.format-btn:hover { border-color: rgba(139,92,246,0.4); color: var(--text-primary); }
.format-btn.active { background: rgba(168,85,247,0.15); border-color: rgba(168,85,247,0.5); color: var(--text-primary); }
.format-btn .fmt-detail { display: block; font-size: 0.65rem; color: var(--text-muted); margin-top: 2px; }
.format-btn.active .fmt-detail { color: var(--text-secondary); }
.budget-selector { margin-bottom: 0.75rem; }
.budget-selector label { font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 0.35rem; display: block; }
.budget-btns { display: flex; gap: 0.35rem; }
.budget-btn { flex: 1; padding: 0.4rem 0.5rem; background: rgba(255,255,255,0.04); border: 1px solid var(--card-border); border-radius: 6px; font-size: 0.75rem; font-weight: 500; color: var(--text-secondary); cursor: pointer; font-family: inherit; transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease; }
.budget-btn:hover { border-color: rgba(74,222,128,0.4); color: var(--text-primary); }
.budget-btn.active { background: rgba(74,222,128,0.12); border-color: rgba(74,222,128,0.5); color: #4ade80; }
.budget-btn[data-tier="1"].active { background: rgba(250,204,21,0.12); border-color: rgba(250,204,21,0.5); color: #facc15; }
.budget-btn[data-tier="2"].active { background: rgba(96,165,250,0.12); border-color: rgba(96,165,250,0.5); color: #60a5fa; }
.budget-btn[data-tier="3"].active { background: rgba(168,85,247,0.12); border-color: rgba(168,85,247,0.5); color: #a855f7; }

/* ── Life Cost Limit ── */
.life-limit-selector { margin-bottom: 0.75rem; }
.life-limit-selector label { font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 0.35rem; display: block; }
.life-limit-row { display: flex; align-items: center; gap: 0.5rem; }
.life-limit-row input { width: 80px; padding: 0.4rem 0.5rem; background: rgba(255,255,255,0.04); border: 1px solid var(--card-border); border-radius: 6px; font-size: 0.85rem; color: var(--text-primary); font-family: inherit; box-sizing: border-box; }
.life-limit-row input:focus { outline: none; border-color: rgba(239,68,68,0.5); }
.life-limit-row input::placeholder { color: var(--text-muted); font-size: 0.8rem; }
.life-limit-hint { font-size: 0.72rem; color: var(--text-muted); }

/* ── Commander Input ── */
.commander-input-panel { margin-bottom: 0.75rem; }
.commander-input-panel label { font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 0.35rem; display: block; }
.commander-autocomplete-wrap { position: relative; }
.commander-autocomplete-wrap input { width: 100%; padding: 0.45rem 0.6rem; background: rgba(255,255,255,0.04); border: 1px solid var(--card-border); border-radius: 6px; font-size: 0.85rem; color: var(--text-primary); font-family: inherit; box-sizing: border-box; }
.commander-autocomplete-wrap input:focus { outline: none; border-color: rgba(168,85,247,0.5); }
.commander-suggestions { position: absolute; top: 100%; left: 0; right: 0; background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 0 0 6px 6px; max-height: 180px; overflow-y: scroll; overflow-anchor: none; scrollbar-gutter: stable; z-index: 10; display: none; }
.commander-suggestions.open { display: block; }
.commander-suggestion { padding: 0.4rem 0.6rem; font-size: 0.8rem; color: var(--text-secondary); cursor: pointer; display: flex; flex-direction: column; gap: 1px; }
.commander-suggestion:hover { background: rgba(168,85,247,0.1); color: var(--text-primary); }
.cmd-sug-name { font-weight: 500; }
.cmd-sug-type { font-size: 0.65rem; opacity: 0.6; }
.commander-info { margin-top: 0.35rem; font-size: 0.75rem; color: var(--text-muted); min-height: 1.1em; }
.commander-partner-wrap { margin-top: 0.5rem; }
.commander-partner-wrap label { font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 0.35rem; display: block; }

/* ── Color Toggles ── */
.color-toggles { display: flex; gap: 0.75rem; margin-bottom: 1.5rem; justify-content: center; }
.color-toggle { width: 48px; height: 48px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; font-weight: 700; font-size: 1rem; font-family: 'Space Grotesk', sans-serif; transition: opacity 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease; display: flex; align-items: center; justify-content: center; opacity: 0.4; position: relative; }
.color-toggle:hover { opacity: 0.7; transform: scale(1.08); }
.color-toggle.active { opacity: 1; border-color: rgba(168,85,247,0.7); transform: scale(1.1); box-shadow: 0 0 16px rgba(168,85,247,0.3); }
.color-toggle[data-color="W"] { background: var(--color-W); color: #333; }
.color-toggle[data-color="U"] { background: var(--color-U); color: #fff; }
.color-toggle[data-color="B"] { background: var(--color-B); color: #aaa; border: 3px solid rgba(255,255,255,0.15); }
.color-toggle[data-color="B"].active { border-color: rgba(168,85,247,0.7); }
.color-toggle[data-color="R"] { background: var(--color-R); color: #fff; }
.color-toggle[data-color="G"] { background: var(--color-G); color: #fff; }

/* ── Pip Inputs ── */
.pip-hint { font-size: 0.78rem; color: var(--text-muted); margin: -0.25rem 0 0.5rem; }
.pip-section { margin-bottom: 1.5rem; }
.pip-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0; border-bottom: 1px solid rgba(255,255,255,0.04); }
.pip-row:last-child { border-bottom: none; }
.pip-color-dot { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.7rem; font-weight: 700; flex-shrink: 0; }
.pip-label { flex: 1; font-size: 0.85rem; color: var(--text-secondary); }
.pip-controls { display: flex; align-items: center; gap: 0; }
.pip-btn { width: 32px; height: 32px; background: rgba(255,255,255,0.06); border: 1px solid var(--card-border); color: var(--text-primary); font-size: 1rem; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 0.15s ease, border-color 0.15s ease; font-family: inherit; }
.pip-btn:hover { background: rgba(168,85,247,0.2); border-color: rgba(168,85,247,0.4); }
.pip-btn:active { background: rgba(168,85,247,0.35); transform: scale(0.92); }
.pip-btn:first-child { border-radius: 6px 0 0 6px; }
.pip-btn:last-child { border-radius: 0 6px 6px 0; }
.pip-value { width: 52px; height: 32px; background: rgba(255,255,255,0.08); border: 1px solid var(--card-border); border-left: none; border-right: none; color: var(--text-primary); font-size: 0.9rem; font-weight: 600; text-align: center; font-family: inherit; cursor: text; }
.pip-value:hover { background: rgba(255,255,255,0.12); }
.pip-value:focus { outline: none; background: rgba(168,85,247,0.15); }

/* ── Deck Size / Total Lands ── */
.size-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.5rem; }
.size-group label { display: block; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.35rem; }
.size-group input { width: 100%; padding: 0.5rem 0.75rem; background: rgba(255,255,255,0.04); border: 1px solid var(--card-border); border-radius: 8px; color: var(--text-primary); font-size: 1rem; font-weight: 600; font-family: inherit; text-align: center; }
.size-group input:focus { outline: none; border-color: rgba(168,85,247,0.5); background: rgba(168,85,247,0.08); }

/* ── Mana Curve ── */
.curve-section { margin-bottom: 1.5rem; }
.curve-inputs { display: grid; grid-template-columns: repeat(8, 1fr); gap: 0.4rem; }
.curve-col { text-align: center; }
.curve-col label { display: block; font-size: 0.7rem; color: var(--text-muted); margin-bottom: 0.3rem; font-weight: 500; }
.curve-col input { width: 100%; padding: 0.4rem; background: rgba(255,255,255,0.04); border: 1px solid var(--card-border); border-radius: 6px; color: var(--text-primary); font-size: 0.85rem; font-weight: 600; text-align: center; font-family: inherit; }
.curve-col input:focus { outline: none; border-color: rgba(168,85,247,0.5); background: rgba(168,85,247,0.08); }
.curve-total { margin-top: 0.5rem; font-size: 0.8rem; color: var(--text-muted); text-align: center; }
.curve-total strong { color: var(--text-primary); }

/* ── Calculate Button ── */
.calc-btn { display: block; width: 100%; padding: 0.85rem; background: var(--gradient-purple); border: none; border-radius: 10px; font-size: 1rem; font-weight: 600; color: white; cursor: pointer; font-family: 'Space Grotesk', sans-serif; transition: opacity 0.2s ease, transform 0.2s ease; margin-top: 0.5rem; }
.calc-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(139,92,246,0.4); }
.calc-btn:active { transform: translateY(0); }
.calc-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }

/* ── Results Panel ── */
.results-empty { text-align: center; padding: 3rem 1rem; color: var(--text-muted); }
.results-empty .empty-icon { font-size: 3rem; margin-bottom: 1rem; opacity: 0.3; }
.results-empty p { font-size: 0.9rem; }
.preset-demo { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid rgba(255,255,255,0.06); }
.preset-demo-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 0.6rem; }
.preset-btns { display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap; }
.preset-btn { padding: 0.4rem 0.85rem; background: rgba(168,85,247,0.08); border: 1px solid rgba(168,85,247,0.25); border-radius: 6px; color: #c4b5fd; font-size: 0.78rem; font-family: inherit; cursor: pointer; transition: background 0.15s ease, border-color 0.15s ease; }
.preset-btn:hover { background: rgba(168,85,247,0.18); border-color: rgba(168,85,247,0.45); }
.preset-btn:active { transform: scale(0.96); }

/* ── Land Count Cards ── */
.land-counts { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.75rem; margin-bottom: 1.75rem; }
.land-card { background: rgba(255,255,255,0.03); border: 1px solid var(--card-border); border-radius: 10px; padding: 1rem; text-align: center; transition: border-color 0.2s ease, box-shadow 0.2s ease; position: relative; overflow: clip; }
.land-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; }
.land-card[data-color="W"]::before { background: var(--color-W); }
.land-card[data-color="U"]::before { background: var(--color-U); }
.land-card[data-color="B"]::before { background: linear-gradient(90deg, #555, #333); }
.land-card[data-color="R"]::before { background: var(--color-R); }
.land-card[data-color="G"]::before { background: var(--color-G); }
.land-card[data-color="C"]::before { background: var(--gradient-purple); }
.land-card .land-count { font-family: 'Space Grotesk', sans-serif; font-size: 2rem; font-weight: 700; }
.land-card[data-color="W"] .land-count { color: var(--color-W); }
.land-card[data-color="U"] .land-count { color: var(--color-U); }
.land-card[data-color="B"] .land-count { color: #888; }
.land-card[data-color="R"] .land-count { color: var(--color-R); }
.land-card[data-color="G"] .land-count { color: var(--color-G); }
.land-card[data-color="C"] .land-count { color: #a78bfa; }
.land-card .land-label { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.2rem; }
.land-card .land-pct { font-size: 0.7rem; color: var(--text-secondary); margin-top: 0.15rem; }

/* ── Bar Chart ── */
.chart-section { margin-bottom: 1.75rem; }
.bar-chart { display: flex; align-items: flex-end; gap: 8px; height: 140px; padding: 0 0.5rem; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.bar-fill { width: 100%; border-radius: 4px 4px 0 0; transition: height 0.4s ease; min-height: 0; }
.bar-fill[data-color="W"] { background: var(--color-W); opacity: 0.85; }
.bar-fill[data-color="U"] { background: var(--color-U); }
.bar-fill[data-color="B"] { background: #555; }
.bar-fill[data-color="R"] { background: var(--color-R); }
.bar-fill[data-color="G"] { background: var(--color-G); }
.bar-fill[data-color="C"] { background: linear-gradient(180deg, #a855f7, #6366f1); }
.bar-label { font-size: 0.7rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.bar-count { font-size: 0.7rem; color: var(--text-secondary); font-weight: 600; }

/* ── Mana Curve Chart (stacked per-color bars) ── */
.curve-chart { display: flex; align-items: flex-end; gap: 6px; height: 120px; padding: 0 0.25rem; margin-bottom: 0.5rem; }
.curve-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; max-width: 60px; }
.curve-stack { width: 100%; display: flex; flex-direction: column-reverse; border-radius: 3px 3px 0 0; overflow: clip; }
.curve-seg { width: 100%; min-height: 0; }
.curve-mv-label { font-size: 0.65rem; color: var(--text-muted); }
.curve-count { font-size: 0.65rem; color: var(--text-secondary); font-weight: 600; }
.curve-chart-wrapper { background: rgba(255,255,255,0.02); border: 1px solid var(--card-border); border-radius: 8px; padding: 0.75rem; margin-bottom: 1rem; }
.curve-chart-title { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.5rem; }

/* ── What If Suggestions ── */
.whatif-section { margin-bottom: 1.75rem; }
.whatif-item { display: flex; gap: 0.5rem; align-items: flex-start; padding: 0.5rem 0.6rem; border-radius: 6px; margin-bottom: 0.35rem; font-size: 0.78rem; color: var(--text-secondary); background: rgba(255,255,255,0.02); border: 1px solid var(--card-border); }
.whatif-icon { flex-shrink: 0; font-size: 0.9rem; line-height: 1.2; }
.whatif-text { flex: 1; line-height: 1.4; }
.whatif-text strong { color: var(--text-primary); font-weight: 600; }
.whatif-add { border-left: 3px solid #4ade80; }
.whatif-swap { border-left: 3px solid #f59e0b; }
.whatif-synergy { border-left: 3px solid #a78bfa; }
.whatif-warning { border-left: 3px solid #f87171; }

/* ── Deck Health ── */
.deck-health { margin-bottom: 1.75rem; }
.deck-health h3 { margin-bottom: 0.5rem; }
.health-role { display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0.5rem; margin-bottom: 0.25rem; border-radius: 6px; font-size: 0.78rem; }
.health-icon { flex-shrink: 0; width: 1.2rem; text-align: center; }
.health-label { width: 5.5rem; color: var(--text-secondary); }
.health-count { width: 2rem; text-align: right; font-weight: 600; }
.health-bar-wrap { flex: 1; height: 6px; background: rgba(255,255,255,0.06); border-radius: 3px; overflow: hidden; position: relative; }
.health-bar { height: 100%; border-radius: 3px; }
.health-bar.good { background: #4ade80; }
.health-bar.warn { background: #f59e0b; }
.health-bar.bad { background: #f87171; }
.health-benchmark { position: absolute; top: -1px; bottom: -1px; border-left: 2px solid rgba(255,255,255,0.3); border-right: 2px solid rgba(255,255,255,0.3); background: rgba(255,255,255,0.04); }
.health-note { font-size: 0.7rem; color: var(--text-muted); margin-top: 0.15rem; padding-left: 0.5rem; }

/* ── Theme Staples ── */
.theme-staples { margin-bottom: 1.75rem; }
.staple-item { display: flex; gap: 0.5rem; align-items: center; padding: 0.4rem 0.5rem; margin-bottom: 0.25rem; border-radius: 6px; background: rgba(255,255,255,0.02); border: 1px solid var(--card-border); border-left: 3px solid #a78bfa; }
.staple-name { font-weight: 600; color: var(--text-primary); }
.staple-role { font-size: 0.65rem; padding: 0.1rem 0.4rem; border-radius: 3px; background: rgba(167,139,250,0.15); color: #a78bfa; }
.staple-reason { font-size: 0.72rem; color: var(--text-secondary); flex: 1; }

/* ── Probability Table ── */
.prob-section { margin-bottom: 1.75rem; }
.prob-table-wrapper { overflow-x: auto; }
.prob-table { width: 100%; border-collapse: collapse; font-size: 0.78rem; }
.prob-table th { padding: 0.5rem 0.6rem; text-align: center; font-weight: 600; color: var(--text-secondary); border-bottom: 2px solid var(--card-border); white-space: nowrap; background: rgba(255,255,255,0.02); }
.prob-table td { padding: 0.45rem 0.6rem; text-align: center; border-bottom: 1px solid rgba(255,255,255,0.04); color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.prob-table tr:hover td { background: rgba(168,85,247,0.05); }
.prob-table .turn-col { font-weight: 600; color: var(--text-primary); text-align: left; }
.prob-good { color: #4ade80; }
.prob-ok { color: #facc15; }
.prob-bad { color: #f87171; }

/* ── Suggested Mana Base ── */
.suggested-section { margin-bottom: 1.75rem; }
.suggest-card { background: rgba(255,255,255,0.03); border: 1px solid var(--card-border); border-radius: 8px; padding: 0.85rem 1rem; margin-bottom: 0.5rem; }
.suggest-card h4 { font-size: 0.85rem; margin-bottom: 0.35rem; color: var(--text-primary); }
.suggest-card p { font-size: 0.78rem; color: var(--text-secondary); line-height: 1.5; }
.suggest-card .suggest-lands { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.4rem; }
.suggest-land { display: inline-flex; align-items: center; gap: 0.3rem; background: rgba(168,85,247,0.1); border: 1px solid rgba(168,85,247,0.2); border-radius: 5px; padding: 0.2rem 0.5rem; font-size: 0.72rem; color: var(--text-secondary); }
.suggest-land .sl-count { font-weight: 700; color: var(--text-primary); }

/* ── Info Box ── */
.info-box { background: rgba(168,85,247,0.08); border: 1px solid rgba(168,85,247,0.2); border-radius: 10px; padding: 1.25rem; margin-top: 1.5rem; }
.info-box h3 { font-size: 0.95rem; margin-bottom: 0.5rem; color: #a78bfa; display: flex; align-items: center; gap: 0.4rem; }
.info-box p { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.65; }
.info-box a { color: #a78bfa; text-decoration: underline; }
.info-box a:hover { color: #c4b5fd; }

/* ── FAQ Section ── */
.faq-section { margin-top: 2rem; }
.faq-section h2 { font-size: 1.4rem; margin-bottom: 1rem; color: var(--text-primary); }
.faq-item { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 10px; margin-bottom: 0.75rem; }
.faq-q { padding: 1rem 1.25rem; font-weight: 600; font-size: 0.95rem; cursor: pointer; color: var(--text-primary); display: flex; justify-content: space-between; align-items: center; -webkit-user-select: none; user-select: none; }
.faq-q::after { content: '+'; font-size: 1.2rem; color: var(--text-muted); flex-shrink: 0; margin-left: 1rem; }
.faq-item.open .faq-q::after { content: '\2212'; }
.faq-item.open .faq-q { border-bottom: 1px solid var(--card-border); }
.faq-a { display: none; }
.faq-item.open .faq-a { display: block; }
.faq-a p { padding: 1rem 1.25rem; font-size: 0.88rem; color: var(--text-secondary); line-height: 1.7; margin: 0; }

/* ── Dual Lands Collapsible ── */
.dual-lands-toggle { padding:0.6rem 0;font-size:0.85rem;font-weight:600;cursor:pointer;color:var(--text-secondary);display:flex;align-items:center;gap:0.4rem;-webkit-user-select:none;user-select:none; }
.dual-lands-toggle::before { content:'\25B6';font-size:0.55rem;color:var(--text-muted);transition:transform 0.2s ease; }
.dual-lands-body { display:none; }
.dual-lands-wrap.open .dual-lands-toggle::before { transform:rotate(90deg); }
.dual-lands-wrap.open .dual-lands-body { display:block; }

/* ── Focus Styles ── */
.pip-btn:focus-visible, .color-toggle:focus-visible, .calc-btn:focus-visible,
.format-btn:focus-visible, .budget-btn:focus-visible, .input-tab:focus-visible,
.optimizer-land-exclude:focus-visible, .faq-q:focus-visible,
.dual-lands-toggle:focus-visible { outline: 2px solid #a855f7; outline-offset: 2px; }

/* ── Responsive ── */
@media (max-width: 640px) {
    .hero-section h1 { font-size: 1.75rem; }
    .color-toggles { gap: 0.5rem; }
    .color-toggle { width: 44px; height: 44px; font-size: 0.85rem; }
    .pip-btn { width: 44px; height: 44px; }
    .pip-value { height: 44px; width: 52px; }
    .curve-col input, .size-group input, .import-textarea { font-size: 16px; }
    .curve-inputs { grid-template-columns: repeat(4, 1fr); }
    .land-counts { grid-template-columns: repeat(2, 1fr); }
    .format-grid { grid-template-columns: repeat(3, 1fr); }
    .size-inputs { grid-template-columns: 1fr; }
}

/* ── Sim Engine Badge ── */
.sim-engine-badge { display: inline-block; font-size: 0.7rem; font-weight: 700; padding: 1px 6px; border-radius: 3px; vertical-align: middle; letter-spacing: 0.5px; }
.sim-engine-wasm { background: #2e7d32; color: #e8f5e9; }
.sim-engine-js { background: #555; color: #ddd; }

/* ── Ramp Analysis Banner ── */
.ramp-banner { display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0.85rem; border-radius: 8px; font-size: 0.78rem; font-weight: 500; margin-bottom: 0.75rem; background: rgba(139,92,246,0.08); border: 1px solid rgba(139,92,246,0.2); color: #c4b5fd; flex-wrap: wrap; }
.ramp-banner strong { color: #e9d5ff; }
.ramp-adjust { color: var(--text-muted); font-size: 0.72rem; }
.land-count-hint { display: flex; align-items: center; gap: 0.5rem; padding: 0.35rem 0.85rem; border-radius: 8px; font-size: 0.75rem; margin-bottom: 0.75rem; background: rgba(59,130,246,0.08); border: 1px solid rgba(59,130,246,0.2); color: #93c5fd; flex-wrap: wrap; }
.land-count-hint strong { color: #bfdbfe; }
.land-count-hint .hint-detail { color: var(--text-muted); font-size: 0.7rem; }

/* ── Smart Land Optimizer ── */
.tempo-badge { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0.85rem; border-radius: 8px; font-size: 0.78rem; font-weight: 500; margin-bottom: 0.5rem; }
.color-tempo-row { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1rem; }
.color-tempo-chip { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.25rem 0.6rem; border-radius: 6px; font-size: 0.72rem; border: 1px solid; background: rgba(255,255,255,0.03); }
.color-tempo-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.color-tempo-label { font-weight: 600; text-transform: capitalize; }
.color-tempo-mv { opacity: 0.7; font-size: 0.68rem; }
.share-btn { background: rgba(74,222,128,0.1); color: #4ade80; border: 1px solid rgba(74,222,128,0.3); padding: 0.3rem 0.75rem; border-radius: 6px; font-size: 0.75rem; cursor: pointer; font-family: inherit; transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease; }
.share-btn:hover { background: rgba(74,222,128,0.2); border-color: rgba(74,222,128,0.5); }
.share-copied { background: rgba(74,222,128,0.25) !important; color: #fff !important; }
@keyframes share-pulse { 0%,100% { box-shadow: 0 0 0 rgba(74,222,128,0); } 50% { box-shadow: 0 0 12px rgba(74,222,128,0.4); } }
.share-nudge { animation: share-pulse 0.8s ease 2; }
.results-cta { margin: 0.75rem 0 1.5rem; padding: 0.65rem 0.85rem; background: rgba(168,85,247,0.06); border: 1px solid rgba(168,85,247,0.15); border-radius: 8px; font-size: 0.78rem; color: var(--text-secondary); }
.results-cta a { color: #c4b5fd; text-decoration: none; font-weight: 500; }
.results-cta a:hover { color: #ddd6fe; text-decoration: underline; }
.optimizer-heading { font-size: 0.9rem; color: var(--text-secondary); margin: 1rem 0 0.5rem; }
.optimizer-land-row { display: flex; align-items: center; gap: 0.5rem; padding: 0.35rem 0.5rem; border-bottom: 1px solid rgba(255,255,255,0.04); font-size: 0.78rem; flex-wrap: wrap; }
.optimizer-land-row:last-child { border-bottom: none; }
.optimizer-land-qty { font-weight: 700; color: var(--text-primary); min-width: 1.5em; text-align: right; font-family: 'Space Grotesk', sans-serif; font-size: 0.9rem; }
.optimizer-land-name { font-weight: 500; color: var(--text-primary); flex-shrink: 0; }
.optimizer-land-tag { font-size: 0.65rem; font-weight: 600; padding: 1px 6px; border: 1px solid; border-radius: 4px; white-space: nowrap; flex-shrink: 0; }
.optimizer-land-reason { font-size: 0.68rem; color: var(--text-muted); margin-left: auto; text-align: right; }
.optimizer-land-price { font-size: 0.72rem; color: var(--text-secondary); font-family: 'Space Grotesk', monospace; white-space: nowrap; opacity: 0; transition: opacity 0.3s; }
.optimizer-land-price.loaded { opacity: 1; }
.manabase-total-cost { margin-top: 0.75rem; padding: 0.5rem 0.75rem; background: rgba(255,255,255,0.03); border-radius: 8px; font-size: 0.8rem; display: flex; justify-content: space-between; align-items: center; border: 1px solid rgba(255,255,255,0.06); }
.manabase-total-cost .cost-label { color: var(--text-secondary); }
.manabase-total-cost .cost-value { font-weight: 700; font-family: 'Space Grotesk', monospace; color: #4ade80; font-size: 0.95rem; }
.source-summary { margin-top: 1rem; }
.source-row { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.35rem; }
.source-label { font-size: 0.78rem; font-weight: 600; min-width: 3.5em; }
.source-bar-track { flex: 1; height: 8px; background: rgba(255,255,255,0.06); border-radius: 4px; overflow: hidden; }
.source-bar-fill { height: 100%; border-radius: 4px; transition: width 0.3s ease; }
.source-count { font-size: 0.75rem; font-weight: 600; min-width: 3.5em; text-align: right; }
.source-met { color: #4ade80; }
.source-short { color: #f87171; }
.source-chart { margin: 1rem 0; }
.source-chart-title { font-size: 0.78rem; font-weight: 600; margin-bottom: 0.5rem; color: var(--text-muted); }
.sc-row { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.35rem; }
.sc-label { font-size: 0.78rem; font-weight: 600; min-width: 3.5em; text-align: right; }
.sc-track { flex: 1; height: 14px; background: rgba(255,255,255,0.06); border-radius: 4px; position: relative; overflow: visible; }
.sc-bar { height: 100%; border-radius: 4px; transition: width 0.3s ease; }
.sc-target { position: absolute; top: -2px; bottom: -2px; width: 2px; background: rgba(255,255,255,0.5); border-radius: 1px; }
.sc-count { font-size: 0.75rem; font-weight: 600; min-width: 5.5em; }
.sc-met { color: #4ade80; }
.sc-short { color: #f87171; }
.life-estimate { margin-top: 0.75rem; font-size: 0.78rem; color: var(--text-muted); padding: 0.5rem 0.75rem; background: rgba(248,113,113,0.08); border: 1px solid rgba(248,113,113,0.15); border-radius: 6px; }
@media (max-width: 640px) {
    .optimizer-land-reason { margin-left: 0; width: 100%; padding-left: 2em; }
}
/* ── Card Image Preview ── */
.card-preview { position: fixed; left: 0; top: 0; z-index: 9999; pointer-events: none; opacity: 0; transition: opacity 0.15s ease; }
.card-preview.visible { opacity: 1; }
.card-preview img { display: block; width: 240px; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,0.7); }
.card-name-link { cursor: pointer; text-decoration: underline; text-decoration-color: rgba(255,255,255,0.15); text-underline-offset: 2px; transition: text-decoration-color 0.15s; }
.card-name-link:hover { text-decoration-color: rgba(167,139,250,0.6); color: #c4b5fd; }
@media (max-width: 768px) { .card-preview img { width: 200px; } }

/* ── Detected Themes Chips ── */
.detected-themes { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1rem; }
.theme-chip { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.2rem 0.6rem; border-radius: 5px; font-size: 0.72rem; font-weight: 600; background: rgba(167,139,250,0.1); border: 1px solid rgba(167,139,250,0.25); color: #c4b5fd; }
.theme-chip-icon { font-size: 0.8rem; line-height: 1; }

/* ── Tooltips (CSS-only) ── */
.has-tip { position: relative; cursor: help; border-bottom: 1px dotted rgba(255,255,255,0.2); }
.has-tip::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: #2a2a2e; color: #e4e4e7; font-size: 0.7rem; font-weight: 400; line-height: 1.4; padding: 0.4rem 0.6rem; border-radius: 6px; border: 1px solid rgba(255,255,255,0.1); white-space: nowrap; max-width: 260px; white-space: normal; pointer-events: none; opacity: 0; z-index: 100; box-shadow: 0 4px 12px rgba(0,0,0,0.5); transition: opacity 0.15s ease; }
.has-tip:hover::after { opacity: 1; }
@media (max-width: 640px) { .has-tip::after { left: 0; transform: none; max-width: 200px; } }

/* ── Grade Reveal Animation ── */
.grade-reveal { opacity: 0; transform: scale(0.8); }
.grade-reveal.visible { opacity: 1; transform: scale(1); transition: opacity 0.35s ease, transform 0.35s ease; }
.grade-glow { box-shadow: 0 0 16px currentColor; }

/* ── Empty State Onboarding ── */
.onboard-steps { display: flex; gap: 1.25rem; margin-top: 1.5rem; justify-content: center; flex-wrap: wrap; }
.onboard-step { text-align: center; max-width: 140px; }
.onboard-num { font-family: 'Space Grotesk', sans-serif; font-size: 1.5rem; font-weight: 700; background: var(--gradient-purple); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.onboard-icon { font-size: 1.5rem; margin: 0.3rem 0; opacity: 0.5; }
.onboard-label { font-size: 0.75rem; color: var(--text-secondary); line-height: 1.4; }
.onboard-or { font-size: 0.7rem; color: var(--text-muted); margin-top: 1rem; }

/* ── Source Donut Chart ── */
.source-donut-wrap { display: flex; align-items: center; gap: 1.25rem; margin: 0.75rem 0 1rem; }
.source-donut-svg { flex-shrink: 0; }
.source-donut-legend { display: flex; flex-direction: column; gap: 0.3rem; }
.source-donut-item { display: flex; align-items: center; gap: 0.4rem; font-size: 0.72rem; color: var(--text-secondary); }
.source-donut-swatch { width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; }
@media (max-width: 640px) { .source-donut-wrap { flex-direction: column; align-items: flex-start; } }

/* ── Export Preview ── */
.export-preview { background: rgba(0,0,0,0.3); border: 1px solid var(--card-border); border-radius: 6px; padding: 0.5rem 0.75rem; margin-top: 0.5rem; max-height: 200px; overflow-y: scroll; font-size: 0.72rem; font-family: 'Courier New', monospace; color: var(--text-secondary); line-height: 1.5; white-space: pre-wrap; display: none; }
.export-preview.visible { display: block; }

/* ── Quick Changes Summary ── */
.quick-changes { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.qc-pill { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.2rem 0.5rem; border-radius: 4px; font-size: 0.7rem; font-weight: 600; }
.qc-keep { background: rgba(74,222,128,0.1); color: #4ade80; }
.qc-upgrade { background: rgba(245,158,11,0.1); color: #f59e0b; }
.qc-cut { background: rgba(239,68,68,0.1); color: #ef4444; }
/* ── Decklist Import Feature ── */

/* Tab Toggle */
.input-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}
.input-tab {
    flex: 1;
    padding: 0.5rem 0.75rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: 'Space Grotesk', -apple-system, sans-serif;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    text-align: center;
}
.input-tab:hover {
    border-color: rgba(139,92,246,0.4);
    color: var(--text-primary);
}
.input-tab.active {
    background: rgba(168,85,247,0.15);
    border-color: rgba(168,85,247,0.5);
    color: var(--text-primary);
}

/* Import Panel */
#importPanel {
    display: none;
}
#importPanel.active {
    display: block;
}
#manualPanel {
    display: none;
}
#manualPanel.active {
    display: block;
}

/* Textarea */
.import-textarea {
    width: 100%;
    min-height: 200px;
    padding: 0.75rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    resize: vertical;
    transition: border-color 0.2s ease;
}
.import-textarea::placeholder {
    color: var(--text-muted);
}
.import-textarea:focus {
    outline: none;
    border-color: rgba(168,85,247,0.5);
    background: rgba(168,85,247,0.05);
}

/* Import description */
.import-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

/* Status area */
.import-status {
    margin-top: 0.75rem;
    padding: 0.6rem 0.75rem;
    font-size: 0.82rem;
    color: var(--text-secondary);
    border-radius: 6px;
    display: none;
    line-height: 1.5;
}
.import-status.visible {
    display: block;
}
.import-status.info {
    background: rgba(168,85,247,0.08);
    border: 1px solid rgba(168,85,247,0.2);
}
.import-status.success {
    background: rgba(74,222,128,0.08);
    border: 1px solid rgba(74,222,128,0.2);
    color: #4ade80;
}
.import-status.error {
    background: rgba(248,113,113,0.08);
    border: 1px solid rgba(248,113,113,0.2);
    color: #f87171;
}
.import-status.loading {
    background: rgba(168,85,247,0.08);
    border: 1px solid rgba(168,85,247,0.2);
}

/* Loading spinner */
.import-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(168,85,247,0.3);
    border-top-color: #a855f7;
    border-radius: 50%;
    animation: import-spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 0.4rem;
}
@keyframes import-spin {
    to { transform: rotate(360deg); }
}

/* Not-found cards list */
.import-notfound {
    margin-top: 0.5rem;
    padding: 0;
    list-style: none;
    font-size: 0.78rem;
    color: var(--text-muted);
}
.import-notfound li {
    padding: 0.15rem 0;
}
.import-notfound li::before {
    content: '\2717 ';
    color: #f87171;
}

/* ── Simulation Progress Bar ── */
.sim-progress {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    height: 32px;
    position: relative;
    overflow: hidden;
    margin: 1rem 0;
}
.sim-progress-bar {
    height: 100%;
    background: var(--gradient-purple);
    border-radius: 8px;
    transition: width 0.3s;
    opacity: 0.8;
}
.sim-progress-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* ── Simulation Summary ── */
.sim-summary {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

/* ── Cast Rate Table ── */
.cast-mana {
    font-family: monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
}
.cost-edit-btn {
    display: inline-block;
    cursor: pointer;
    opacity: 0.3;
    font-size: 0.65rem;
    margin-left: 0.25rem;
    vertical-align: middle;
    transition: opacity 0.15s;
}
.cost-edit-btn:hover { opacity: 0.8; }
.cost-edit-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}
.cost-edit-inline input {
    width: 80px;
    padding: 0.15rem 0.3rem;
    font-family: monospace;
    font-size: 0.75rem;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(168,85,247,0.4);
    border-radius: 4px;
    color: var(--text-primary);
}
.cost-edit-inline input:focus { outline: none; border-color: rgba(168,85,247,0.7); }
.cost-edit-inline button {
    padding: 0.1rem 0.4rem;
    font-size: 0.7rem;
    cursor: pointer;
    border-radius: 4px;
    border: 1px solid var(--card-border);
    background: rgba(74,222,128,0.12);
    color: #4ade80;
    font-family: inherit;
}
.cost-edit-inline button.cancel-btn {
    background: rgba(248,113,113,0.12);
    color: #f87171;
}
.sim-fallback-notice {
    font-size: 0.78rem;
    color: var(--text-muted);
    background: rgba(248,113,113,0.08);
    border: 1px solid rgba(248,113,113,0.2);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.75rem;
}

/* ── Land Pool Filter & Exclusion Styles ── */

/* Filter Panel (collapsible) */
.land-filter-panel {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    margin-bottom: 1.25rem;
}
.land-filter-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0.85rem;
    cursor: pointer;
    font-family: 'Space Grotesk', -apple-system, sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: color 0.2s ease;
    list-style: none;
}
.land-filter-toggle::after {
    content: '\25B6';
    font-size: 0.6rem;
    transition: transform 0.2s ease;
    color: var(--text-muted);
}
.land-filter-panel.open .land-filter-toggle::after {
    transform: rotate(90deg);
}
.land-filter-toggle:hover {
    color: var(--text-primary);
}

/* Exclusion count badge */
.land-filter-count {
    font-size: 0.72rem;
    font-weight: 600;
    color: #f87171;
    background: rgba(248,113,113,0.12);
    border: 1px solid rgba(248,113,113,0.25);
    border-radius: 10px;
    padding: 0.1rem 0.45rem;
    margin-left: 0.5rem;
    display: none;
}
.land-filter-count.visible {
    display: inline-block;
}
.land-filter-count.pin-count {
    color: #2dd4bf;
    background: rgba(45,212,191,0.12);
    border-color: rgba(45,212,191,0.25);
}

/* Panel body */
.land-filter-body {
    display: none;
    padding: 0 0.85rem 0.75rem;
}
.land-filter-panel.open .land-filter-body {
    display: block;
}

/* Search input */
.land-filter-search {
    width: 100%;
    padding: 0.4rem 0.6rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--card-border);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    transition: border-color 0.2s ease;
}
.land-filter-search::placeholder {
    color: var(--text-muted);
}
.land-filter-search:focus {
    outline: none;
    border-color: rgba(168,85,247,0.5);
    background: rgba(168,85,247,0.05);
}

/* Action buttons row */
.land-filter-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.land-filter-action-btn {
    flex: 1;
    padding: 0.25rem 0.5rem;
    font-size: 0.72rem;
    font-weight: 600;
    font-family: 'Space Grotesk', -apple-system, sans-serif;
    color: var(--text-muted);
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--card-border);
    border-radius: 5px;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease;
}
.land-filter-action-btn:hover {
    border-color: rgba(139,92,246,0.4);
    color: var(--text-secondary);
}

/* Scrollable list container */
.land-filter-list {
    max-height: 220px;
    overflow-y: scroll;
    scrollbar-gutter: stable;
    overflow-anchor: none;
    border: 1px solid var(--card-border);
    border-radius: 6px;
    background: rgba(0,0,0,0.15);
}
.land-filter-list::-webkit-scrollbar { width: 4px; }
.land-filter-list::-webkit-scrollbar-track { background: transparent; }
.land-filter-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

/* Flex lands heading */
.land-filter-flex-heading {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-top: 0.6rem;
    margin-bottom: 0.35rem;
    font-family: 'Space Grotesk', -apple-system, sans-serif;
}

/* Individual filter item */
.land-filter-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.5rem;
    font-size: 0.78rem;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255,255,255,0.03);
    cursor: pointer;
}
.land-filter-item:last-child { border-bottom: none; }
.land-filter-item:hover {
    background: rgba(255,255,255,0.03);
}
.land-filter-item input[type="checkbox"] {
    accent-color: #a855f7;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    cursor: pointer;
}
.land-filter-item-name {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Tier badge */
.land-filter-tier {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.08rem 0.35rem;
    border-radius: 4px;
    flex-shrink: 0;
}
.land-filter-tier.budget {
    color: #facc15;
    background: rgba(250,204,21,0.1);
    border: 1px solid rgba(250,204,21,0.2);
}
.land-filter-tier.mid {
    color: #60a5fa;
    background: rgba(96,165,250,0.1);
    border: 1px solid rgba(96,165,250,0.2);
}
.land-filter-tier.premium {
    color: #4ade80;
    background: rgba(74,222,128,0.1);
    border: 1px solid rgba(74,222,128,0.2);
}

/* ── Exclude button on optimizer results ── */
.optimizer-land-row {
    position: relative;
}
.optimizer-land-exclude {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid rgba(248,113,113,0.3);
    background: rgba(248,113,113,0.08);
    color: #f87171;
    font-size: 0.7rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s ease, background 0.15s ease;
    padding: 0;
    margin-left: auto;
    flex-shrink: 0;
}
.optimizer-land-row:hover .optimizer-land-exclude {
    opacity: 1;
}
.optimizer-land-exclude:hover {
    background: rgba(248,113,113,0.2);
    border-color: rgba(248,113,113,0.5);
}

/* ── Excluded lands section at bottom of results ── */
.excluded-lands-section {
    margin-top: 0.75rem;
    padding: 0.5rem 0.65rem;
    background: rgba(248,113,113,0.05);
    border: 1px solid rgba(248,113,113,0.15);
    border-radius: 8px;
}
.excluded-lands-heading {
    font-size: 0.72rem;
    font-weight: 600;
    color: #f87171;
    margin-bottom: 0.35rem;
    font-family: 'Space Grotesk', -apple-system, sans-serif;
}
.excluded-land-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}
.excluded-land-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.7rem;
    color: var(--text-muted);
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 0.15rem 0.5rem;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.excluded-land-chip:hover {
    color: #4ade80;
    border-color: rgba(74,222,128,0.4);
    background: rgba(74,222,128,0.08);
}
.excluded-land-chip::before {
    content: '+';
    font-weight: 700;
    font-size: 0.75rem;
}

/* ── Pin button on optimizer results ── */
.optimizer-land-pin {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid rgba(45,212,191,0.3);
    background: rgba(45,212,191,0.08);
    color: #2dd4bf;
    font-size: 0.6rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.4;
    transition: opacity 0.15s ease, background 0.15s ease;
    padding: 0;
    flex-shrink: 0;
}
.optimizer-land-row:hover .optimizer-land-pin {
    opacity: 1;
}
.optimizer-land-pin.pinned {
    opacity: 1;
    background: rgba(45,212,191,0.2);
    border-color: rgba(45,212,191,0.5);
}
.optimizer-land-pin:hover {
    background: rgba(45,212,191,0.25);
    border-color: rgba(45,212,191,0.6);
}

/* Pinned row indicator */
.optimizer-land-row.pinned {
    border-left: 2px solid rgba(45,212,191,0.5);
    padding-left: calc(0.5rem - 2px);
}

/* Pinned tag in optimizer rows */
.optimizer-land-tag.pinned-tag {
    color: #2dd4bf;
    border-color: rgba(45,212,191,0.4);
    font-size: 0.6rem;
}

/* Pinned summary line above optimizer list */
.pinned-summary {
    font-size: 0.75rem;
    color: #2dd4bf;
    padding: 0.35rem 0.5rem;
    margin: 0.5rem 0;
    background: rgba(45,212,191,0.06);
    border: 1px solid rgba(45,212,191,0.15);
    border-radius: 6px;
}

/* Pinned summary — clickable link */
.pinned-summary {
    cursor: pointer;
}
.pinned-summary:hover {
    background: rgba(45,212,191,0.1);
    border-color: rgba(45,212,191,0.3);
}
.pinned-summary-link {
    font-size: 0.65rem;
    color: rgba(45,212,191,0.6);
    margin-left: 0.5rem;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.pinned-summary:hover .pinned-summary-link {
    color: #2dd4bf;
}

/* Auto-pin import notice */
.auto-pin-notice {
    font-size: 0.7rem;
    color: #2dd4bf;
    background: rgba(45,212,191,0.08);
    border: 1px solid rgba(45,212,191,0.2);
    border-radius: 5px;
    padding: 0.35rem 0.5rem;
    margin-bottom: 0.4rem;
    transition: opacity 0.5s ease;
}
.auto-pin-notice.fade-out {
    opacity: 0;
}

/* Toast notification for pin/unpin */
.pin-toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(1rem);
    background: #1e293b;
    color: #2dd4bf;
    border: 1px solid rgba(45,212,191,0.3);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-family: 'Space Grotesk', -apple-system, sans-serif;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}
.pin-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Flash highlight for import auto-pin chips */
.included-land-chips.flash-highlight {
    animation: chipFlash 1.5s ease;
}
@keyframes chipFlash {
    0% { background: transparent; }
    15% { background: rgba(45,212,191,0.15); }
    100% { background: transparent; }
}

/* ── Included (Pinned) lands section ── */
.included-lands-section {
    margin-top: 0.75rem;
    padding: 0.5rem 0.65rem;
    background: rgba(45,212,191,0.05);
    border: 1px solid rgba(45,212,191,0.15);
    border-radius: 8px;
}
.included-lands-heading {
    font-size: 0.72rem;
    font-weight: 600;
    color: #2dd4bf;
    margin-bottom: 0.15rem;
    font-family: 'Space Grotesk', -apple-system, sans-serif;
}
.included-lands-desc {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin: 0 0 0.4rem;
    line-height: 1.35;
}
.included-count {
    font-size: 0.65rem;
    background: rgba(45,212,191,0.15);
    border-radius: 8px;
    padding: 0.05rem 0.35rem;
    margin-left: 0.25rem;
}
.included-land-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-bottom: 0.4rem;
}
.included-land-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.7rem;
    color: #2dd4bf;
    background: rgba(45,212,191,0.08);
    border: 1px solid rgba(45,212,191,0.25);
    border-radius: 12px;
    padding: 0.15rem 0.5rem;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.included-land-chip:hover {
    color: #f87171;
    border-color: rgba(248,113,113,0.4);
    background: rgba(248,113,113,0.08);
}
.included-land-chip::after {
    content: '\00d7';
    font-weight: 700;
    font-size: 0.75rem;
    margin-left: 0.15rem;
}
.included-land-chip.imported {
    border-style: dashed;
}
.included-land-chip.unpin-all {
    color: var(--text-muted);
    background: rgba(255,255,255,0.02);
    border-color: rgba(255,255,255,0.1);
    font-size: 0.65rem;
}
.included-land-chip.unpin-all::after {
    content: '';
}
.included-land-chip.unpin-all:hover {
    color: #f87171;
    border-color: rgba(248,113,113,0.4);
    background: rgba(248,113,113,0.08);
}

/* Pin input row */
.pin-input-row {
    display: flex;
    gap: 0.35rem;
    margin-top: 0.25rem;
}
.pin-land-input {
    flex: 1;
    padding: 0.3rem 0.5rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--card-border);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.75rem;
}
.pin-land-input::placeholder {
    color: var(--text-muted);
}
.pin-land-input:focus {
    outline: none;
    border-color: rgba(45,212,191,0.5);
    background: rgba(45,212,191,0.05);
}
.pin-land-btn {
    padding: 0.3rem 0.6rem;
    font-size: 0.72rem;
    font-weight: 600;
    font-family: 'Space Grotesk', -apple-system, sans-serif;
    color: #2dd4bf;
    background: rgba(45,212,191,0.1);
    border: 1px solid rgba(45,212,191,0.3);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.pin-land-btn:hover {
    background: rgba(45,212,191,0.2);
    border-color: rgba(45,212,191,0.5);
}

/* Pin autocomplete dropdown */
.pin-autocomplete {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    z-index: 50;
    background: var(--card-bg, #1a1a2e);
    border: 1px solid rgba(45,212,191,0.3);
    border-radius: 6px;
    margin-top: 2px;
    max-height: 280px;
    overflow-y: auto;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.pin-ac-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.6rem;
    font-size: 0.78rem;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}
.pin-ac-item:last-child { border-bottom: none; }
.pin-ac-item:hover, .pin-ac-item.highlighted {
    background: rgba(45,212,191,0.1);
    color: var(--text-primary);
}
.pin-ac-item.pinned {
    opacity: 0.4;
    cursor: default;
}
.pin-ac-name {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pin-ac-name strong {
    color: #2dd4bf;
    font-weight: 700;
}
.pin-ac-tag {
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--text-muted);
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 4px;
    padding: 0.05rem 0.3rem;
    flex-shrink: 0;
    white-space: nowrap;
}
.pin-ac-pinned {
    font-size: 0.58rem;
    font-weight: 700;
    color: #2dd4bf;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}
.pin-ac-empty {
    padding: 0.5rem 0.6rem;
    font-size: 0.72rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Pin warning */
.pin-warning {
    margin-top: 0.5rem;
    padding: 0.4rem 0.6rem;
    background: rgba(251,191,36,0.08);
    border: 1px solid rgba(251,191,36,0.25);
    border-radius: 6px;
    color: #fbbf24;
    font-size: 0.72rem;
    line-height: 1.4;
}

/* ── Mobile: always show exclude/pin buttons on touch devices ── */
@media (hover: none) {
    .optimizer-land-exclude {
        opacity: 0.7;
    }
    .optimizer-land-pin {
        opacity: 0.7;
    }
    .optimizer-land-pin.pinned {
        opacity: 1;
    }
}

/* Mana Base Report Card */
.report-card { display:grid; grid-template-columns:repeat(3,1fr); gap:0.75rem; margin-bottom:1.75rem; padding:1rem; background:rgba(255,255,255,0.02); border:1px solid var(--card-border); border-radius:10px; }
.report-card-metric { text-align:center; padding:0.75rem 0.5rem; border-radius:8px; background:rgba(255,255,255,0.02); }
.report-card-value { font-family:'Space Grotesk',sans-serif; font-size:2rem; font-weight:700; line-height:1.2; }
.report-card-value.placeholder { color:var(--text-muted); opacity:0.4; }
.report-card-label { font-size:0.72rem; color:var(--text-muted); margin-top:0.25rem; }
.report-card-sub { font-size:0.65rem; color:var(--text-secondary); margin-top:0.15rem; }

/* Report Card header (imported mode) */
.report-card-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:0.75rem; padding-bottom:0.75rem; border-bottom:1px solid rgba(255,255,255,0.04); grid-column:1/-1; }
.report-card-title { font-size:0.85rem; font-weight:600; color:var(--text-secondary); }
.report-card-grade { font-family:'Space Grotesk',sans-serif; font-size:1.5rem; font-weight:700; padding:0.25rem 0.75rem; border-radius:6px; border:1px solid transparent; line-height:1; }
.report-card-grade.placeholder { opacity:0.3; color:var(--text-muted); }

/* Tempo delta annotation */
.report-card-delta { font-size:0.6rem; margin-top:0.15rem; opacity:0.7; }
.report-card-delta.positive { color:#4ade80; }

/* Grade description */
.report-card-desc { font-size:0.7rem; color:var(--text-muted); text-align:center; margin-top:0.5rem; padding-top:0.5rem; border-top:1px solid rgba(255,255,255,0.04); grid-column:1/-1; }

/* Tempo per-turn breakdown */
.tempo-breakdown { display:flex; justify-content:center; gap:1rem; margin-top:0.5rem; padding-top:0.5rem; border-top:1px solid rgba(255,255,255,0.04); }
.tempo-turn { text-align:center; font-size:0.72rem; }
.tempo-turn-label { color:var(--text-muted); font-size:0.65rem; }
.tempo-turn-value { font-weight:700; font-family:'Space Grotesk',sans-serif; font-size:0.85rem; }

/* Cast rate badge (for redesigned table) */
.cast-rate-badge { font-family:'Space Grotesk',sans-serif; font-weight:700; font-size:0.9rem; }

/* Tap analysis delta display */
.tap-delta { font-weight:700; font-family:'Space Grotesk',sans-serif; }

@media (max-width:640px) {
    .report-card { grid-template-columns:1fr; gap:0.5rem; padding:0.75rem; }
    .report-card-value { font-size:1.5rem; }
    .report-card-grade { font-size:1.2rem; }
    .tempo-breakdown { flex-wrap:wrap; gap:0.5rem; }
}
