/* ── Mana Base Calculator Styles ── */
/* Foundation (fonts, vars, nav, footer) provided by /css/base.css */

/* ── Manabase-specific overrides ── */
:root {
    --text-muted: #94949e;
    --nav-bg: #111;
    --color-W: #F9FAF4;
    --color-U: #0E68AB;
    --color-B: #150B00;
    --color-R: #D3202A;
    --color-G: #00733E;
}
html { scroll-behavior: auto; }
footer { margin-top: 4rem; }
main { padding-bottom: 2rem; }
.footer-scryfall-link { color: var(--text-muted); text-decoration: underline; }
.footer-scryfall-link:hover { color: var(--text-secondary); }
.mana-dot { width: 10px; height: 10px; }
.mana-dot-W { background: var(--color-W); }
.mana-dot-U { background: var(--color-U); }
.mana-dot-B { background: var(--color-B); border: 1px solid rgba(255,255,255,0.2); }
.mana-dot-R { background: var(--color-R); }
.mana-dot-G { background: var(--color-G); }

/* ── 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; overflow-anchor: none; }
@media (min-width: 1400px) {
    .calc-layout {
        grid-template-columns: 340px 1fr;
        margin-left: -8vw; margin-right: -8vw;
    }
}
@media (min-width: 1800px) {
    .calc-layout {
        grid-template-columns: 360px 1fr;
        margin-left: -12vw; margin-right: -12vw;
    }
}
@media (max-width: 960px) {
    .calc-layout { grid-template-columns: minmax(0, 1fr); }
    .panel { max-width: 100%; overflow-x: hidden; }
}

/* ── Collapse Bar (desktop only) ── */
.panel-collapse-bar { display: none; }
@media (min-width: 1400px) {
    .panel-collapse-bar {
        display: flex; align-items: center; gap: 0.5rem; cursor: pointer;
        padding: 0.4rem 0.5rem; margin: -1.5rem -1.5rem 1rem -1.5rem;
        border-bottom: 1px solid var(--card-border); border-radius: 12px 12px 0 0;
        background: rgba(255,255,255,0.02); user-select: none;
    }
    .collapse-icon {
        font-size: 0.7rem; color: var(--text-muted); display: inline-block;
        width: 1.2rem; text-align: center;
    }
    .collapse-label {
        font-size: 0.72rem; font-weight: 600; color: var(--text-muted);
        text-transform: uppercase; letter-spacing: 0.05em;
    }
    .collapse-recalc {
        display: none; margin-left: auto; background: none; border: 1px solid var(--card-border);
        color: var(--text-secondary); font-size: 1rem; border-radius: 6px;
        width: 28px; height: 28px; cursor: pointer; line-height: 1;
    }
    .collapse-recalc:hover { background: rgba(255,255,255,0.06); color: var(--text-primary); }
    .panel-collapse-bar:hover { background: rgba(255,255,255,0.04); }

    /* ── Collapsed state ── */
    .calc-layout.collapsed { grid-template-columns: 56px 1fr; }
    .calc-layout.collapsed #inputPanel {
        padding: 0; overflow: hidden; min-height: 200px;
    }
    .calc-layout.collapsed .panel-inner { display: none; }
    .calc-layout.collapsed .panel-collapse-bar {
        flex-direction: column; align-items: center; justify-content: flex-start;
        margin: 0; padding: 0.75rem 0; border-bottom: none; border-radius: 12px;
        height: 100%; gap: 0.75rem; min-height: 200px;
    }
    .calc-layout.collapsed .collapse-icon {
        font-size: 0.8rem; transform: rotate(180deg);
    }
    .calc-layout.collapsed .collapse-label {
        writing-mode: vertical-rl; text-orientation: mixed;
        font-size: 0.65rem; letter-spacing: 0.08em;
    }
    .calc-layout.collapsed .collapse-recalc {
        display: flex; align-items: center; justify-content: center;
        width: 32px; height: 32px; font-size: 1.1rem;
    }
}

/* ── Panels ── */
.panel { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 12px; padding: 1.5rem; }
#inputPanel { box-shadow: 0 2px 12px rgba(0,0,0,0.2); }
#resultsPanel { overflow-anchor: none; }
.panel h2 { font-size: 1.3rem; margin-bottom: 1.25rem; display: flex; align-items: center; gap: 0.5rem; }
.panel h2 .icon { font-size: 1.2rem; }
.panel h3 { font-size: 1.1rem; margin-bottom: 0.85rem; color: var(--text-secondary); font-weight: 600; }

/* ── Format Selector ── */
.format-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 0.6rem; margin-bottom: 1.75rem; }
.format-btn { padding: 0.75rem 0.85rem; background: rgba(255,255,255,0.05); border: 2px solid rgba(255,255,255,0.1); border-radius: 12px; font-size: 0.95rem; font-weight: 700; color: var(--text-secondary); cursor: pointer; font-family: 'Space Grotesk', sans-serif; transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease; text-align: center; }
.format-btn:hover { border-color: rgba(139,92,246,0.55); color: var(--text-primary); background: rgba(139,92,246,0.1); box-shadow: 0 2px 16px rgba(139,92,246,0.15); }
.format-btn.active { background: rgba(168,85,247,0.2); border-color: rgba(168,85,247,0.7); color: var(--text-primary); box-shadow: 0 2px 20px rgba(168,85,247,0.2), inset 0 1px 0 rgba(255,255,255,0.08); }
.format-btn .fmt-detail { display: block; font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; font-family: 'Inter', sans-serif; font-weight: 400; }
.format-btn.active .fmt-detail { color: var(--text-secondary); }
.budget-selector { margin-bottom: 1.25rem; }
.budget-selector label { font-size: 0.88rem; color: var(--text-secondary); margin-bottom: 0.5rem; display: block; font-weight: 600; }
.budget-btns { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
.budget-btn { padding: 0.55rem 0.5rem; background: rgba(255,255,255,0.05); border: 2px solid rgba(255,255,255,0.1); border-radius: 10px; font-size: 0.85rem; font-weight: 600; color: var(--text-secondary); cursor: pointer; font-family: 'Space Grotesk', sans-serif; transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease; text-align: center; }
.budget-btn:hover { border-color: rgba(74,222,128,0.45); color: var(--text-primary); background: rgba(74,222,128,0.08); }
.budget-btn.active { background: rgba(74,222,128,0.15); border-color: rgba(74,222,128,0.6); color: #4ade80; box-shadow: 0 2px 16px rgba(74,222,128,0.12); }
.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: flex; align-items: center; }
.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); }

/* ── MV Cap ── */
.mv-cap-selector { margin-bottom: 0.75rem; }
.mv-cap-selector label { font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 0.35rem; display: flex; align-items: center; }
.mv-cap-row { display: flex; align-items: center; gap: 0.5rem; }
.mv-cap-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; }
.mv-cap-row input:focus { outline: none; border-color: rgba(139,92,246,0.5); }
.mv-cap-row input::placeholder { color: var(--text-muted); font-size: 0.8rem; }
.mv-cap-hint { font-size: 0.72rem; color: var(--text-muted); }

/* ── On-color Fetches Toggle ── */
.fetch-option { margin-bottom: 1rem; }
.fetch-toggle { display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; font-weight: 500; color: var(--text-secondary); cursor: pointer; padding: 0.5rem 0.65rem; background: rgba(255,255,255,0.03); border: 1px solid var(--card-border); border-radius: 8px; }
.fetch-toggle input[type="checkbox"] { accent-color: #a855f7; cursor: pointer; width: 16px; height: 16px; }
.fetch-toggle:hover { border-color: rgba(168,85,247,0.3); background: rgba(168,85,247,0.04); }

/* ── 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: 100; display: none; box-shadow: 0 8px 24px rgba(0,0,0,0.5); }
.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.7rem; 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; }
.bracket-toggle-wrap { margin-top: 0.6rem; }
.bracket-toggle-wrap > label { font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 0.35rem; display: block; }
.bracket-toggle { display: flex; gap: 0; border: 1px solid var(--card-border); border-radius: 6px; overflow: hidden; }
.bracket-toggle button { flex: 1; padding: 0.35rem 0.5rem; font-size: 0.75rem; font-family: inherit; background: rgba(255,255,255,0.03); color: var(--text-muted); border: none; cursor: pointer; transition: background 0.15s, color 0.15s; }
.bracket-toggle button:not(:last-child) { border-right: 1px solid var(--card-border); }
.bracket-toggle button:hover { background: rgba(255,255,255,0.06); color: var(--text-secondary); }
.bracket-toggle button.active { background: rgba(168,85,247,0.15); color: var(--text-primary); font-weight: 600; }
.option-hint { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; font-size: 0.65rem; font-weight: 700; color: var(--text-muted); border: 1px solid rgba(255,255,255,0.15); border-radius: 50%; cursor: help; flex-shrink: 0; position: relative; vertical-align: middle; margin-left: 4px; -webkit-tap-highlight-color: transparent; }
.option-hint:hover { border-color: rgba(168,85,247,0.5); color: var(--text-secondary); }
.option-hint .option-tip { display: none; position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); width: 230px; padding: 0.6rem 0.75rem; background: #1e1e2e; border: 1px solid rgba(168,85,247,0.3); border-radius: 8px; font-size: 0.75rem; font-weight: 400; line-height: 1.5; color: var(--text-secondary); text-align: left; white-space: normal; z-index: 200; pointer-events: none; box-shadow: 0 4px 16px rgba(0,0,0,0.5); }
.option-hint .option-tip::after { content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); border: 6px solid transparent; border-top-color: rgba(168,85,247,0.3); }
.option-hint.active .option-tip { display: block; }
@media (hover: hover) { .option-hint:hover .option-tip { display: block; } }
/* Tooltips inside advanced settings: drop below, full-width of parent */
.advanced-body .option-hint { position: static; }
.advanced-body .option-hint .option-tip { position: absolute; top: calc(100% + 4px); bottom: auto; left: 0; right: 0; width: auto; transform: none; }
.advanced-body .option-hint .option-tip::after { display: none; }
.life-limit-selector, .mv-cap-selector { position: relative; }

/* Fetch toggle tooltip: anchor left to stay in viewport */
.fetch-option .option-hint .option-tip { left: auto; right: 0; transform: none; }
.fetch-option .option-hint .option-tip::after { left: auto; right: 10px; transform: none; }

/* ── Color Toggles ── */
.color-toggles { display: flex; gap: 1rem; margin-bottom: 1.75rem; justify-content: center; }
.color-toggle { width: 58px; height: 58px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; font-weight: 700; font-size: 1.2rem; 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.35; position: relative; }
.color-toggle:hover { opacity: 0.75; transform: scale(1.12); }
.color-toggle.active { opacity: 1; border-color: rgba(168,85,247,0.8); transform: scale(1.18); box-shadow: 0 0 24px rgba(168,85,247,0.4), 0 0 48px rgba(168,85,247,0.12); }
.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); }
@media (min-width: 1400px) {
    .curve-inputs { grid-template-columns: repeat(4, 1fr); gap: 0.35rem; }
}

/* ── Calculate Button ── */
.calc-btn { display: block; width: 100%; padding: 1.1rem 1.25rem; background: var(--gradient-purple); border: none; border-radius: 14px; font-size: 1.15rem; font-weight: 700; color: white; cursor: pointer; font-family: 'Space Grotesk', sans-serif; transition: box-shadow 0.2s ease; margin-top: 1rem; letter-spacing: 0.03em; box-shadow: 0 4px 14px rgba(139,92,246,0.3); }
/* No transform on hover — Chrome Rule #10: transform inside isolation:isolate
   context creates nested compositor layers that cause flicker. Use box-shadow only. */
.calc-btn:hover { box-shadow: 0 10px 32px rgba(139,92,246,0.5); }
.calc-btn:active { box-shadow: 0 4px 14px rgba(139,92,246,0.3); }
.calc-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }

/* ── Results Panel ── */
/* ── Empty State ── */
.results-empty { text-align: center; padding: 2.5rem 1.25rem; color: var(--text-muted); }
.results-empty-headline { font-family: 'Space Grotesk', sans-serif; font-size: 1.15rem; font-weight: 600; color: var(--text-primary); margin-bottom: 1rem; }
.preset-demo { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,0.06); }
.preset-demo-label { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.7px; color: var(--text-muted); margin-bottom: 0.85rem; font-weight: 500; }
.preset-btns { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }
.preset-btn { padding: 0.7rem 1.4rem; background: rgba(168,85,247,0.12); border: 2px solid rgba(168,85,247,0.35); border-radius: 10px; color: #c4b5fd; font-size: 0.9rem; font-weight: 700; font-family: 'Space Grotesk', sans-serif; cursor: pointer; transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease; }
.preset-btn:hover { background: rgba(168,85,247,0.22); border-color: rgba(168,85,247,0.6); color: #ddd6fe; box-shadow: 0 2px 18px rgba(168,85,247,0.2); }
.preset-btn:active { transform: scale(0.97); }

/* ── 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: 2.25rem; 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.85rem; color: var(--text-muted); margin-top: 0.25rem; }
.land-card .land-pct { font-size: 0.78rem; 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: 140px; padding: 0 0.25rem; margin-bottom: 0.5rem; }
.curve-chart .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.75rem; color: var(--text-muted); }
.curve-count { font-size: 0.75rem; 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.85rem; margin-bottom: 1rem; }
.curve-chart-title { font-size: 0.82rem; 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.55rem 0.75rem; border-radius: 6px; margin-bottom: 0.35rem; font-size: 0.85rem; 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.45rem 0.6rem; margin-bottom: 0.3rem; border-radius: 6px; font-size: 0.85rem; }
.health-icon { flex-shrink: 0; width: 1.3rem; text-align: center; }
.health-label { width: 6rem; color: var(--text-secondary); }
.health-count { width: 2.25rem; text-align: right; font-weight: 600; }
.health-bar-wrap { flex: 1; height: 8px; background: rgba(255,255,255,0.06); border-radius: 4px; 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.78rem; 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.88rem; }
.prob-table th { padding: 0.6rem 0.7rem; 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.55rem 0.7rem; 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: 1rem 1.15rem; margin-bottom: 0.6rem; }
.suggest-card h4 { font-size: 0.95rem; margin-bottom: 0.4rem; color: var(--text-primary); }
.suggest-card p { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.55; }
.suggest-card .suggest-lands { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.5rem; }
.suggest-land { display: inline-flex; align-items: center; gap: 0.35rem; background: rgba(168,85,247,0.1); border: 1px solid rgba(168,85,247,0.2); border-radius: 5px; padding: 0.25rem 0.6rem; font-size: 0.8rem; 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.35rem; margin-top: 1.5rem; }
.info-box h3 { font-size: 1.05rem; margin-bottom: 0.5rem; color: #a78bfa; display: flex; align-items: center; gap: 0.4rem; }
.info-box p { font-size: 0.88rem; color: var(--text-secondary); line-height: 1.65; margin-top: 0.5rem; }
.info-box p:first-of-type { margin-top: 0; }
.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: none; box-shadow: 0 0 0 3px rgba(168,85,247,0.4); }

/* ── Responsive ── */
@media (max-width: 640px) {
    .hero-section { padding: 1rem 0 1rem; }
    .hero-section h1 { font-size: 1.5rem; margin-bottom: 0.25rem; }
    .hero-section .subtitle { font-size: 0.9rem; margin-bottom: 0; }
    .breadcrumb { padding-top: 0.5rem; }
    .panel h2 { font-size: 1.1rem; margin-bottom: 0.75rem; }
    .color-toggles { gap: 0.5rem; }
    .color-toggle { width: 50px; height: 50px; font-size: 1rem; }
    .pip-btn { width: 44px; height: 44px; }
    .pip-value { height: 44px; width: 52px; }
    .curve-col input, .size-group input, .import-textarea, .url-input-group input { font-size: 16px; }
    .url-input-group { flex-direction: column; }
    .btn-import { width: 100%; }
    .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-wrap { margin-bottom: 0.75rem; }
.ramp-banner { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.95rem; border-radius: 8px; font-size: 0.85rem; font-weight: 500; 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.78rem; }
.ramp-toggle { background: none; border: none; color: #a78bfa; font-size: 0.78rem; font-weight: 600; cursor: pointer; padding: 0; text-decoration: underline; text-underline-offset: 2px; }
.ramp-toggle:hover { color: #c4b5fd; }
.ramp-details-list { display: none; padding: 0.5rem 0.85rem 0.4rem; background: rgba(139,92,246,0.04); border: 1px solid rgba(139,92,246,0.12); border-top: none; border-radius: 0 0 8px 8px; }
.ramp-details-list.open { display: block; }
.ramp-group { margin-bottom: 0.35rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.5rem; }
.ramp-group:last-child { margin-bottom: 0; }
.ramp-group-label { font-size: 0.78rem; font-weight: 700; color: #e9d5ff; min-width: 110px; }
.ramp-card { font-size: 0.8rem; color: var(--text-secondary); background: rgba(255,255,255,0.04); padding: 0.2rem 0.5rem; border-radius: 4px; border: 1px solid rgba(255,255,255,0.06); cursor: pointer; text-decoration: underline; text-decoration-color: rgba(255,255,255,0.12); text-underline-offset: 2px; }
.ramp-card:hover { border-color: rgba(167,139,250,0.35); color: #c4b5fd; text-decoration-color: rgba(167,139,250,0.5); background: rgba(167,139,250,0.08); }
.ramp-banner-wrap .ramp-banner { border-radius: 8px 8px 8px 8px; }
.ramp-banner-wrap:has(.ramp-details-list.open) .ramp-banner { border-radius: 8px 8px 0 0; }
.land-count-hint { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.95rem; border-radius: 8px; font-size: 0.85rem; 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.78rem; }

/* ── Smart Land Optimizer ── */
.tempo-badge { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.95rem; border-radius: 8px; font-size: 0.85rem; 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.3rem 0.7rem; border-radius: 6px; font-size: 0.8rem; 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.75rem 1rem; background: rgba(168,85,247,0.06); border: 1px solid rgba(168,85,247,0.15); border-radius: 8px; font-size: 0.88rem; 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: 1rem; color: var(--text-secondary); margin: 1rem 0 0.5rem; }
.optimizer-land-row { display: flex; align-items: center; gap: 0.6rem; padding: 0.45rem 0.6rem; border-bottom: 1px solid rgba(255,255,255,0.04); font-size: 0.88rem; 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: 1rem; }
.optimizer-land-name { font-weight: 500; color: var(--text-primary); flex-shrink: 0; }
.optimizer-land-tag { font-size: 0.72rem; font-weight: 600; padding: 2px 7px; border: 1px solid; border-radius: 4px; white-space: nowrap; flex-shrink: 0; }
.optimizer-land-reason { font-size: 0.75rem; color: var(--text-muted); margin-left: auto; text-align: right; }
.optimizer-land-price { font-size: 0.8rem; 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.6rem 0.85rem; background: rgba(255,255,255,0.03); border-radius: 8px; font-size: 0.88rem; 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: 1.05rem; }
.basic-land-summary {
    padding: 0.5rem 0.6rem; margin-top: 0.5rem; margin-bottom: 0.25rem;
    font-size: 0.82rem; color: var(--text-secondary);
    background: rgba(255,255,255,0.02); border-radius: 6px;
    border-left: 2px solid rgba(139,92,246,0.3);
}
.basic-label { font-weight: 600; color: var(--text-muted); margin-right: 0.4rem; }
.source-summary { margin-top: 1rem; }
.source-row { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.4rem; }
.source-label { font-size: 0.88rem; font-weight: 600; min-width: 3.5em; }
.source-bar-track { flex: 1; height: 10px; background: rgba(255,255,255,0.06); border-radius: 5px; overflow: hidden; }
.source-bar-fill { height: 100%; border-radius: 5px; transition: width 0.3s ease; }
.source-count { font-size: 0.85rem; 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.88rem; font-weight: 600; margin-bottom: 0.5rem; color: var(--text-muted); }
.sc-row { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.4rem; }
.sc-label { font-size: 0.88rem; font-weight: 600; min-width: 3.5em; text-align: right; }
.sc-track { flex: 1; height: 18px; background: rgba(255,255,255,0.06); border-radius: 5px; position: relative; overflow: visible; }
.sc-bar { height: 100%; border-radius: 5px; 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.85rem; font-weight: 600; min-width: 5.5em; }
.sc-met { color: #4ade80; }
.sc-short { color: #f87171; }
.sc-role-badge { font-size: 0.65rem; font-weight: 500; padding: 0.1em 0.35em; border-radius: 3px; background: rgba(255,255,255,0.08); color: var(--text-muted); vertical-align: middle; text-transform: uppercase; letter-spacing: 0.03em; }
.life-estimate { margin-top: 0.75rem; font-size: 0.85rem; color: var(--text-muted); padding: 0.55rem 0.85rem; 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; }
}
@media (min-width: 1400px) {
    .optimizer-land-row { gap: 0.85rem; }
    .optimizer-land-reason { font-size: 0.78rem; }
    .optimizer-land-name { font-size: 0.92rem; }
}
/* ── 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-preview-price { position: absolute; bottom: 0; left: 0; right: 0; text-align: center; background: #111; color: #4ade80; font-family: 'Space Grotesk', monospace; font-size: 0.85rem; font-weight: 700; padding: 0.3rem 0; border-radius: 0 0 10px 10px; white-space: nowrap; border-top: 1px solid rgba(74,222,128,0.25); visibility: hidden; }
.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.35rem; padding: 0.25rem 0.7rem; border-radius: 5px; font-size: 0.82rem; 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; } }


/* ── Empty State Onboarding ── */
.onboard-steps { display: flex; gap: 1rem; margin-top: 1.5rem; justify-content: center; flex-wrap: wrap; }
.onboard-step { text-align: center; max-width: 140px; position: relative; }
.onboard-num { font-family: 'Space Grotesk', sans-serif; font-size: 1.25rem; font-weight: 700; width: 32px; height: 32px; line-height: 32px; margin: 0 auto 0.35rem; border-radius: 50%; background: rgba(168,85,247,0.12); color: #c4b5fd; }
.onboard-icon { font-size: 1.25rem; margin: 0.2rem 0; opacity: 0.4; }
.onboard-label { font-size: 0.78rem; color: var(--text-secondary); line-height: 1.4; }
.onboard-or { font-size: 0.75rem; 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.82rem; color: var(--text-secondary); }
.source-donut-swatch { width: 12px; height: 12px; border-radius: 3px; 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: 0 0 1rem;
}
.input-tab {
    flex: 1;
    padding: 0.85rem 0.85rem;
    background: rgba(255,255,255,0.05);
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    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, box-shadow 0.2s ease;
    text-align: center;
}
.input-tab .tab-hint { display: block; font-size: 0.78rem; font-weight: 400; color: var(--text-muted); margin-top: 4px; font-family: 'Inter', sans-serif; }
.input-tab:hover {
    border-color: rgba(139,92,246,0.55);
    color: var(--text-primary);
    background: rgba(139,92,246,0.1);
}
.input-tab.active {
    background: rgba(168,85,247,0.2);
    border-color: rgba(168,85,247,0.7);
    color: var(--text-primary);
    box-shadow: 0 2px 20px rgba(168,85,247,0.18), inset 0 1px 0 rgba(255,255,255,0.08);
}
.input-tab.active .tab-hint { color: var(--text-secondary); }

/* Import Panel */
/* Chrome Rule #11: never toggle display on children inside compositor-promoted
   elements (calc-layout has isolation:isolate). Use visibility + height instead
   to avoid layout thrash that causes page flicker/repeat artifacts. */
#importPanel {
    visibility: hidden;
    height: 0;
    overflow: hidden;
    pointer-events: none;
}
#importPanel.active {
    visibility: visible;
    height: auto;
    overflow: visible;
    pointer-events: auto;
}
#manualPanel {
    visibility: hidden;
    height: 0;
    overflow: hidden;
    pointer-events: none;
}
#manualPanel.active {
    visibility: visible;
    height: auto;
    overflow: visible;
    pointer-events: auto;
}

/* 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;
}

/* ── URL Import ── */
.url-import-section {
    margin-bottom: 0.75rem;
}
.url-import-section label {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}
.url-input-group {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}
.url-input-group input {
    flex: 1;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 0.6rem 0.75rem;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    transition: border-color 0.2s ease;
}
.url-input-group input:focus {
    outline: none;
    border-color: rgba(168,85,247,0.5);
    background: rgba(168,85,247,0.05);
}
.url-input-group input::placeholder { color: var(--text-muted); }
.btn-import {
    background: rgba(168,85,247,0.15);
    color: #c4b5fd;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid rgba(168,85,247,0.3);
    border-radius: 8px;
    padding: 0.6rem 1.2rem;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
    white-space: nowrap;
}
.btn-import:hover { background: rgba(168,85,247,0.25); border-color: rgba(168,85,247,0.5); }
.btn-import:disabled { opacity: 0.5; cursor: not-allowed; }
.import-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.6rem 0;
}
.import-divider::before, .import-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255,255,255,0.06);
}
.import-divider span {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Status area */
.import-status {
    margin-top: 0.25rem;
    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: 0;
    right: 0;
    text-align: center;
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.pin-toast > span {
    display: inline-block;
    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;
}
.pin-toast.visible {
    opacity: 1;
}

/* 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: scroll;
    scrollbar-gutter: stable;
    overflow-anchor: none;
    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.85rem; margin-bottom:1.75rem; padding:1.15rem; background:rgba(255,255,255,0.02); border:1px solid var(--card-border); border-radius:10px; }
.report-card-metric { text-align:center; padding:0.85rem 0.6rem; border-radius:8px; background:rgba(255,255,255,0.02); }
.report-card-value { font-family:'Space Grotesk',sans-serif; font-size:2.25rem; font-weight:700; line-height:1.2; }
.report-card-value.placeholder { color:var(--text-muted); opacity:0.4; }
.report-card-label { font-size:0.82rem; color:var(--text-muted); margin-top:0.25rem; }
.report-card-sub { font-size:0.72rem; 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.95rem; font-weight:600; color:var(--text-secondary); }
.report-card-grade { font-family:'Space Grotesk',sans-serif; font-size:1.75rem; font-weight:700; padding:0.3rem 0.85rem; 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.68rem; margin-top:0.15rem; opacity:0.7; }
.report-card-delta.positive { color:#4ade80; }

/* Grade description */
.report-card-desc { font-size:0.8rem; 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.82rem; }
.tempo-turn-label { color:var(--text-muted); font-size:0.72rem; }
.tempo-turn-value { font-weight:700; font-family:'Space Grotesk',sans-serif; font-size:0.95rem; }

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

/* 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; }
}

/* ══════════════════════════════════════════════
   UX & Visual Consistency Overhaul (2026-03-10)
   ══════════════════════════════════════════════ */

/* ── Budget detail text (replaces inline styles) ── */
.budget-detail {
    font-size: 0.68rem;
    opacity: 0.6;
    font-weight: 400;
}

/* ── Results header (replaces inline styles) ── */
.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-bottom: 1rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.results-header h2 { margin: 0; }

/* ── Info box heading (replaces inline h2 styles) ── */
.info-box h2 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

/* ── SEO footer text (replaces inline div styles) ── */
.seo-footer-text {
    max-width: 900px;
    margin: 1.5rem auto 0;
    padding: 0 1rem;
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.6;
}
.seo-footer-text a { color: #a78bfa; }

/* ── Import panel calc button spacing ── */
#importPanel .calc-btn { margin-top: 0.75rem; }

/* ── Visual section dividers in input panel ── */
.input-section {
    padding-bottom: 1.15rem;
    margin-bottom: 1.15rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

/* ── Advanced settings collapsible ── */
.advanced-section {
    margin-bottom: 1rem;
}
.advanced-toggle {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: color 0.2s ease;
    user-select: none;
}
.advanced-toggle::after {
    content: '\25B6';
    font-size: 0.5rem;
    transition: transform 0.2s ease;
    margin-left: auto;
}
.advanced-section.open .advanced-toggle::after {
    transform: rotate(90deg);
}
.advanced-toggle:hover {
    color: var(--text-secondary);
}
.advanced-body {
    display: none;
    padding-top: 0.35rem;
}
.advanced-section.open .advanced-body {
    display: block;
}

/* ── Sticky calculate button on mobile ── */
@media (max-width: 960px) {
    #calcBtn {
        position: sticky;
        bottom: 0.75rem;
        z-index: 10;
        box-shadow: 0 -4px 20px rgba(0,0,0,0.6), 0 0 24px rgba(139,92,246,0.12);
    }
}

/* ── Improved format button active state ── */
.format-btn.active {
    background: rgba(168,85,247,0.2);
    border-color: rgba(168,85,247,0.6);
    box-shadow: 0 0 10px rgba(168,85,247,0.12);
}

/* ── Second info-box spacing ── */
.info-box + .info-box {
    margin-top: 1.5rem;
}

/* ══════════════════════════════════════════════
   Extracted Inline Styles — No-Blend Compliance
   Static CSS previously embedded in JS innerHTML
   ══════════════════════════════════════════════ */

/* Section subtitles (muted helper text below headings) */
.section-subtitle { font-size: 0.72rem; color: var(--text-muted); margin: 0.25rem 0 0.5rem; }
.section-subtitle-lg { font-size: 0.75rem; color: var(--text-muted); margin: -0.5rem 0 0.75rem; }
.section-subtitle-narrow { font-size: 0.75rem; color: var(--text-muted); margin: -0.5rem 0 0.5rem; }

/* Tag color variants on .optimizer-land-tag */
.tag-basic { color: #94949e; border-color: rgba(148,148,158,0.4); }
.tag-imported { color: #4ade80; border-color: rgba(74,222,128,0.4); }
.tag-utility-purple { color: #a78bfa; border-color: rgba(167,139,250,0.4); }

/* Semantic text colors */
.text-error { color: #f87171; }
.text-success { color: #4ade80; }
.text-warn { color: #f59e0b; }
.text-accent-blue { color: #bfdbfe; }

/* Untapped source indicator */
.untapped-indicator { font-size: 0.7rem; opacity: 0.85; }

/* Effective basics footnote row */
.effective-basics-row { opacity: 0.6; font-size: 0.8rem; padding-left: 0.5rem; }
.effective-basics-text { font-size: 0.75rem; }
.optimizer-total-row { text-align: right; padding: 0.5rem 0.75rem 0.25rem; font-size: 0.85rem; color: #9ca3af; border-top: 1px solid #ffffff10; margin-top: 0.25rem; }

/* Optimizer header with export buttons */
.optimizer-header-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; }
.optimizer-header-row h3 { margin: 0; }
.export-btn-sm { font-size: 0.78rem; padding: 0.35rem 0.7rem; }
.export-preview-btn { font-size: 0.72rem; padding: 0.35rem 0.6rem; opacity: 0.7; }

/* Import summary success banner */
.import-success-banner { padding: 0.5rem 0.75rem; margin-bottom: 1rem; border-radius: 6px; font-size: 0.8rem; background: rgba(74,222,128,0.08); border: 1px solid rgba(74,222,128,0.2); color: #4ade80; }

/* Error / empty states */
.results-error { padding: 1.5rem; color: #f87171; font-size: 0.85rem; }
.results-error-hint { color: var(--text-muted); font-size: 0.75rem; }
.results-error-sm { color: #f87171; font-size: 0.8rem; }
.results-empty { color: var(--text-muted); font-size: 0.85rem; text-align: center; padding: 1rem 0; }

/* Mono-color sub-sections */
.mono-subsection { margin-top: 0.75rem; }
.mono-subsection h5 { font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 0.5rem; }

/* Suggestion panel */
.suggest-pair-heading { display: flex; align-items: center; gap: 0.5rem; }
.suggest-lands-col { flex-direction: column; gap: 0.3rem; }
.suggest-land-between { justify-content: space-between; width: 100%; }
.suggest-land-desc { color: var(--text-muted); font-size: 0.65rem; }
.suggest-conditional-note { color: var(--text-muted); font-size: 0.6rem; margin-top: 0.3rem; }
.tier-label { font-size: 0.65rem; font-weight: 600; }
.pip-dot-lg { width: 20px; height: 20px; font-size: 0.55rem; }

/* Lands explorer CTA */
.explore-link-wrap { text-align: center; padding: 1rem 0 0.5rem; }
.explore-link { display: inline-flex; align-items: center; gap: 0.4rem; color: #a78bfa; font-size: 0.85rem; font-weight: 500; border-bottom: 1px dashed rgba(168,85,247,0.4); }

/* Ramp banner variants */
.ramp-banner-cost { border-left-color: #f59e0b; }
.ramp-banner-cost strong { color: #f59e0b; }
.ramp-banner-effect { border-left-color: #8b5cf6; }
.ramp-banner-effect strong { color: #8b5cf6; }
.ramp-banner-fixer { border-left-color: #06b6d4; }
.ramp-banner-fixer strong { color: #06b6d4; }

/* Hint detail */
.hint-detail { padding-left: 0.15rem; }
.hint-sources-label { color: #bfdbfe; }
.hint-opacity { opacity: 0.7; }

/* Sim notes */
.sim-note { color: var(--text-muted); font-size: 0.72rem; margin-top: 0.5rem; padding: 0 0.5rem; }

/* Detected themes label */
.detected-label { font-size: 0.72rem; color: var(--text-muted); margin-right: 0.25rem; }

/* Cost sublabel */
.cost-sublabel { font-size: 0.65rem; opacity: 0.6; font-weight: 400; }

/* Muted small opacity */
.muted-opacity { opacity: 0.6; }
.tag-sm { font-size: 0.65rem; }

/* Prob table alignment */
.prob-table th.th-left, .prob-table td.td-left { text-align: left; }
.prob-table th.th-right, .prob-table td.td-right { text-align: right; }

/* Life cost note */
.life-limit-note { color: #4ade80; font-size: 0.75rem; }

/* Optimizer intro note */
.optimizer-intro { font-size: 0.72rem; color: var(--text-muted); margin: 1rem 0 0.25rem; }

/* Tempo explanation */
.tempo-explain { font-size: 0.72rem; color: var(--text-muted); margin: 0.25rem 0 0.5rem; }

/* Budget label in tempo */
.budget-label { font-size: 0.72rem; }

/* Also suggested note */
.also-suggested { color: var(--text-muted); font-size: 0.65rem; }

/* Mismatch warning text */
.mismatch-expected { color: #f87171; font-size: 0.75rem; }

/* Floor note */
.floor-note { color: #f59e0b; }

/* Synergy note */
.synergy-note { color: #f59e0b; }

/* ══════════════════════════════════════════════
   Desktop Results Panel — Scale Up (≥960px)
   ══════════════════════════════════════════════ */
@media (min-width: 960px) {
    #resultsPanel { padding: 1.75rem; }
    #resultsPanel h2 { font-size: 1.4rem; }
    #resultsPanel h3 { font-size: 1.2rem; }
    .land-counts { grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 0.85rem; }
    .land-card { padding: 1.15rem; }
    .land-card .land-count { font-size: 2.5rem; }
    .curve-chart { height: 160px; gap: 8px; }
    .curve-chart .curve-col { max-width: 72px; }
    .source-bar-track { height: 12px; }
    .sc-track { height: 22px; border-radius: 6px; }
    .sc-bar { border-radius: 6px; }
    .health-bar-wrap { height: 10px; }
    .prob-table { font-size: 0.92rem; }
    .prob-table th { padding: 0.65rem 0.8rem; }
    .prob-table td { padding: 0.6rem 0.8rem; }
    .report-card { gap: 1rem; padding: 1.35rem; }
    .report-card-metric { padding: 1rem 0.75rem; }
    .report-card-value { font-size: 2.5rem; }
    .report-card-grade { font-size: 2rem; padding: 0.35rem 1rem; }
    .source-donut-wrap { gap: 1.5rem; }
}

@media (min-width: 1400px) {
    #resultsPanel { padding: 2rem; }
    #resultsPanel h2 { font-size: 1.5rem; }
    #resultsPanel h3 { font-size: 1.3rem; }
    .land-counts { grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 1rem; }
    .land-card { padding: 1.25rem; border-radius: 12px; }
    .land-card .land-count { font-size: 2.75rem; }
    .land-card .land-label { font-size: 0.9rem; }
    .land-card .land-pct { font-size: 0.82rem; }
    .curve-chart { height: 180px; }
    .source-bar-track { height: 14px; border-radius: 7px; }
    .source-bar-fill { border-radius: 7px; }
    .sc-track { height: 24px; }
    .health-bar-wrap { height: 12px; border-radius: 6px; }
    .health-bar { border-radius: 6px; }
    .prob-table { font-size: 0.95rem; }
    .prob-table th { padding: 0.75rem 0.9rem; }
    .prob-table td { padding: 0.65rem 0.9rem; }
    .report-card-value { font-size: 2.75rem; }
    .report-card-grade { font-size: 2.25rem; }
    .suggest-card { padding: 1.15rem 1.3rem; border-radius: 10px; }
    .suggest-card h4 { font-size: 1.05rem; }
    .suggest-card p { font-size: 0.92rem; }
    .suggest-land { font-size: 0.85rem; padding: 0.3rem 0.65rem; }
    .info-box { padding: 1.5rem; }
    .info-box h3 { font-size: 1.15rem; }
    .info-box p { font-size: 0.92rem; }
    .ramp-banner { font-size: 0.9rem; padding: 0.55rem 1rem; }
    .land-count-hint { font-size: 0.88rem; padding: 0.55rem 1rem; }
    .optimizer-land-row { font-size: 0.92rem; padding: 0.5rem 0.75rem; }
    .optimizer-land-qty { font-size: 1.1rem; }
    .optimizer-land-tag { font-size: 0.75rem; }
    .optimizer-heading { font-size: 1.1rem; }
    .source-donut-wrap { gap: 1.75rem; margin: 1rem 0 1.25rem; }
    .source-donut-item { font-size: 0.88rem; }
    .source-donut-swatch { width: 14px; height: 14px; }
}

/* Land database load failure notice (shown only when fetch fails or 10s timeout). */
.land-db-error {
    display: none;
    padding: 1.5rem;
    background: #2a1a1a;
    border: 1px solid #ff4444;
    border-radius: 8px;
    margin-bottom: 1rem;
    color: #ff8888;
    text-align: center;
}
.land-db-error.is-visible { display: block; }
.land-db-error-hint { color: #999; font-size: 0.9rem; }

/* ── Paste button + restore chip (added 2026-04-12) ── */
.paste-row { display: flex; align-items: center; gap: 0.75rem; margin: 0.5rem 0; flex-wrap: wrap; }
.paste-btn { padding: 0.5rem 1rem; font-size: 0.85rem; }
.paste-hint { font-size: 0.78rem; color: var(--text-muted); }
.restore-chip { display: inline-block; margin: 0.5rem 0 0.25rem 0; padding: 0.4rem 0.9rem; background: rgba(168,85,247,0.08); border: 1px solid rgba(168,85,247,0.25); border-radius: 999px; color: #c4b5fd; font-size: 0.8rem; font-weight: 500; cursor: pointer; transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease; font-family: inherit; }
.restore-chip:hover { background: rgba(168,85,247,0.16); border-color: rgba(168,85,247,0.45); color: #e9d5ff; }
.restore-chip[hidden] { display: none; }

