/* ===== MySolarModel — design tokens ===== */
:root {
    --ink: #0f2742;
    --ink-2: #33475e;
    --muted: #64748b;
    --line: #e3e8ef;
    --bg: #f5f7fb;
    --card: #ffffff;
    --sun: #f5a524;
    --sun-2: #ffd166;
    --sun-ink: #4a2f00;
    --cash: #e8920c;
    --fin: #119e8a;
    --sum: #3b6fd8;
    --pos: #1c8a5a;
    --neg: #c2413b;
    --radius: 16px;
    --shadow: 0 1px 2px rgba(15, 39, 66, .06), 0 8px 24px rgba(15, 39, 66, .06);
    --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-head: "Sora", "Inter", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
    font-family: var(--font);
    color: var(--ink);
    background: var(--bg);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--font-head); line-height: 1.2; margin: 0 0 .5rem; letter-spacing: -.01em; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.02rem; }
a { color: #1d5fb8; text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-size: .85em; background: #eef2f7; padding: .1em .35em; border-radius: 4px; }
.muted { color: var(--muted); }
.center { text-align: center; }
h1:focus { outline: none; }

.shell { min-height: 100vh; display: flex; flex-direction: column; }
.main { flex: 1; }

/* ===== Top bar ===== */
.topbar {
    position: sticky; top: 0; z-index: 50;
    display: flex; align-items: center; gap: 1.5rem;
    padding: .6rem clamp(16px, 3vw, 32px);
    background: rgba(255, 255, 255, .92);
    backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: .55rem; color: var(--ink); text-decoration: none !important; }
.brand-mark { width: 34px; height: 34px; }
.brand-name { font-family: var(--font-head); font-size: 1.15rem; font-weight: 600; }
.brand-name b { color: var(--sun); font-weight: 800; }
.nav-links { display: flex; align-items: center; gap: .25rem; flex: 1; }
.nav-links > a {
    padding: .45rem .75rem; border-radius: 999px; color: var(--ink-2); font-weight: 500; font-size: .92rem;
    text-decoration: none;
}
.nav-links > a:hover { background: #eef2f7; }
.nav-links > a.active { background: var(--ink); color: #fff; }
.nav-account { margin-left: auto; display: flex; align-items: center; gap: .6rem; font-size: .88rem; }
.nav-email { color: var(--muted); max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-signin { font-weight: 600; }
.inline-form { display: inline; margin: 0; }
.nav-toggle, .nav-burger { display: none; }

@media (max-width: 1280px) {
    .nav-burger {
        display: block; margin-left: auto; width: 40px; height: 40px; border-radius: 10px; cursor: pointer;
        position: relative; border: 1px solid var(--line); background: #fff;
    }
    .nav-burger span, .nav-burger span::before, .nav-burger span::after {
        position: absolute; left: 10px; right: 10px; height: 2px; background: var(--ink); content: ""; border-radius: 2px;
    }
    .nav-burger span { top: 19px; }
    .nav-burger span::before { top: -6px; left: 0; right: 0; }
    .nav-burger span::after { top: 6px; left: 0; right: 0; }
    .topbar { flex-wrap: wrap; }
    .nav-links { display: none; flex-basis: 100%; flex-direction: column; align-items: stretch; padding-bottom: .5rem; }
    .nav-toggle:checked ~ .nav-links { display: flex; }
    .nav-account { margin-left: 0; flex-wrap: wrap; padding: .5rem .75rem 0; }
}

/* ===== Buttons & badges ===== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    padding: .6rem 1.1rem; border-radius: 999px; border: 1px solid transparent;
    font: 600 .92rem var(--font); cursor: pointer; text-decoration: none !important;
    transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-sun { background: linear-gradient(180deg, var(--sun-2), var(--sun)); color: var(--sun-ink); box-shadow: 0 4px 14px rgba(245, 165, 36, .35); }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: #f1f4f9; }
.btn-danger { background: var(--neg); color: #fff; }
.btn-sm { padding: .38rem .8rem; font-size: .84rem; }
.btn-lg { padding: .85rem 1.5rem; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-link, .btn-link-danger { background: none; border: 0; padding: 0; font: 600 .9rem var(--font); cursor: pointer; color: #1d5fb8; }
.btn-link-danger { color: var(--neg); padding: .38rem .4rem; }

.tier-badge {
    display: inline-block; padding: .18rem .6rem; border-radius: 999px;
    font: 700 .72rem var(--font); letter-spacing: .04em; text-transform: uppercase;
}
.tier-free { background: #eef2f7; color: var(--ink-2); }
.tier-registered { background: #e3effd; color: #1d5fb8; }
.tier-subscriber { background: #fff1d1; color: #8a5a06; }

/* ===== Banner ===== */
.banner { position: relative; min-height: 240px; overflow: hidden; color: #fff; display: flex; align-items: flex-end; }
.banner-art { position: absolute; inset: 0; width: 100%; height: 100%; }
.banner::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(90deg, rgba(6, 16, 32, .62) 0%, rgba(6, 16, 32, .25) 45%, transparent 70%);
    pointer-events: none;
}
.banner-text { position: relative; z-index: 1; padding: 2.4rem clamp(16px, 4vw, 48px) 2.2rem; max-width: 720px; }
.banner-text h1 { font-size: clamp(1.7rem, 3.6vw, 2.6rem); font-weight: 800; margin-bottom: .4rem; text-shadow: 0 2px 18px rgba(0, 0, 0, .25); }
.banner-text p { margin: 0; font-size: 1.04rem; opacity: .92; max-width: 560px; }
.banner-eyebrow {
    display: inline-block; margin-bottom: .6rem; padding: .2rem .7rem; border-radius: 999px;
    background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .28);
    font-size: .75rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
}

/* ===== Page layout ===== */
.page { max-width: 1240px; margin: 0 auto; padding: 1.5rem clamp(16px, 3vw, 32px) 3rem; display: grid; gap: 1.25rem; }
.page.narrow { max-width: 620px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem 1.35rem; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: .9rem; }
.card-head.sub { margin-top: 1.25rem; padding-top: 1.1rem; border-top: 1px dashed var(--line); }
.card-head h3 { display: flex; align-items: center; gap: .5rem; margin: 0; }
.card-head small { color: var(--muted); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot-sun { background: var(--sun); box-shadow: 0 0 0 4px rgba(245, 165, 36, .18); }
.dot-bolt { background: var(--sum); box-shadow: 0 0 0 4px rgba(59, 111, 216, .15); }
.dot-coin { background: var(--cash); box-shadow: 0 0 0 4px rgba(232, 146, 12, .18); }
.dot-cal { background: var(--fin); box-shadow: 0 0 0 4px rgba(17, 158, 138, .18); }
.dot-grid { background: var(--ink); box-shadow: 0 0 0 4px rgba(15, 39, 66, .1); }
.accent-cash { border-top: 4px solid var(--cash); }
.accent-finance { border-top: 4px solid var(--fin); }
.accent-summary { border-top: 4px solid var(--sum); }

.layout-2col { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
@media (max-width: 900px) { .layout-2col { grid-template-columns: 1fr; } }

/* ===== Fields ===== */
.field-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .9rem 1rem; }
.field-grid.one { grid-template-columns: 1fr; }
.field { display: flex; flex-direction: column; gap: .3rem; }
.field-label { font-size: .8rem; font-weight: 600; color: var(--ink-2); }
.field-input {
    display: flex; align-items: center; background: #f8fafc; border: 1px solid var(--line); border-radius: 10px;
    transition: border-color .12s, box-shadow .12s;
}
.field-input:focus-within { border-color: var(--sun); box-shadow: 0 0 0 3px rgba(245, 165, 36, .2); background: #fff; }
.field-input input {
    flex: 1; min-width: 0; border: 0; background: transparent; padding: .55rem .7rem;
    font: 500 .95rem var(--font); color: var(--ink); outline: none;
}
.affix { padding: 0 .65rem; color: var(--muted); font-size: .85rem; white-space: nowrap; }
.field-hint { color: var(--muted); font-size: .76rem; }

.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin-top: 1.1rem; }
.mini-stats > div { background: #f8fafc; border-radius: 10px; padding: .6rem .7rem; display: flex; flex-direction: column; }
.mini-stats span { font-size: .72rem; color: var(--muted); }
.mini-stats b { font-family: var(--font-head); font-size: 1rem; }

/* ===== Model switcher ===== */
.model-switcher { display: inline-flex; gap: .3rem; padding: .3rem; background: #fff; border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow); justify-self: start; flex-wrap: wrap; }
.model-switcher .seg { display: inline-flex; align-items: center; gap: .45rem; padding: .5rem 1rem; border-radius: 999px; color: var(--ink-2); font-weight: 600; font-size: .9rem; text-decoration: none; }
.model-switcher .seg svg { width: 18px; height: 18px; }
.model-switcher .seg:hover { background: #f1f4f9; }
.model-switcher .seg.active { background: var(--ink); color: #fff; }

/* ===== Save bar ===== */
.savebar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1rem; padding: .85rem 1rem; border-radius: var(--radius); background: #fffaf0; border: 1px solid #f6dfb0; }
.savebar-msg { font-size: .9rem; }
.savebar-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .6rem; flex: 1; }
.savebar-name { display: flex; flex-direction: column; gap: .2rem; flex: 1; min-width: 220px; font-size: .78rem; font-weight: 600; color: var(--ink-2); }
.savebar-name input { padding: .55rem .75rem; border: 1px solid #f0d49b; border-radius: 10px; font: 500 .95rem var(--font); background: #fff; }
.savebar-meta { display: flex; align-items: center; gap: .6rem; font-size: .84rem; color: var(--muted); flex-wrap: wrap; }
.toast { flex-basis: 100%; padding: .6rem .85rem; border-radius: 10px; font-size: .9rem; font-weight: 500; }
.toast-ok { background: #e6f6ee; color: #135c3c; }
.toast-warn { background: #fdecea; color: #8b2520; }

/* ===== KPI cards ===== */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .9rem; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .15rem; box-shadow: var(--shadow); }
.kpi-label { font-size: .76rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.kpi-value { font-family: var(--font-head); font-size: 1.45rem; font-weight: 700; }
.kpi-value.pos { color: var(--pos); }
.kpi-value.neg { color: var(--neg); }
.kpi-sub { font-size: .76rem; color: var(--muted); }
.kpi-hero { background: linear-gradient(135deg, #0f2742, #1d4e89); color: #fff; border: 0; }
.kpi-hero .kpi-label, .kpi-hero .kpi-sub { color: rgba(255, 255, 255, .75); }
.kpi-hero .kpi-value, .kpi-hero .kpi-value.pos { color: var(--sun-2); font-size: 1.7rem; }

/* ===== Tables ===== */
.table-scroll { overflow-x: auto; margin: 0 -1.35rem; padding: 0 1.35rem; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.projection { font-size: .84rem; min-width: 1080px; }
.projection th, .projection td { padding: .5rem .6rem; text-align: right; border-bottom: 1px solid #eef2f7; white-space: nowrap; }
.projection th:nth-child(-n+2), .projection td:nth-child(-n+2) { text-align: left; }
.projection thead th { position: sticky; top: 0; background: #f8fafc; color: var(--ink-2); font-weight: 600; font-size: .76rem; text-transform: uppercase; letter-spacing: .03em; }
.projection tbody tr:hover { background: #fbfcfe; }
.projection tr.payback td { background: #fff6dc; }
.projection tfoot td { font-weight: 700; border-top: 2px solid var(--ink); border-bottom: 0; }
td.neg { color: var(--neg); }
.table-note { font-size: .8rem; color: var(--muted); margin: .7rem 0 0; display: flex; align-items: center; gap: .4rem; }
.swatch-payback { width: 14px; height: 10px; background: #fff6dc; border: 1px solid #f0d49b; border-radius: 2px; display: inline-block; }

.compare th, .compare td { padding: .65rem .8rem; text-align: right; border-bottom: 1px solid #eef2f7; }
.compare th:first-child, .compare td:first-child { text-align: left; }
.compare thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.compare .col-cash { color: var(--cash); }
.compare .col-fin { color: var(--fin); }
.compare td.best { font-weight: 700; color: var(--pos); }
.compare td.best::after { content: " ★"; color: var(--sun); }

.assumptions summary { cursor: pointer; font-weight: 600; }
.assumptions ol { padding-left: 1.2rem; color: var(--ink-2); font-size: .9rem; }

/* ===== Summary ===== */
.verdict { display: flex; gap: 1rem; align-items: center; background: linear-gradient(135deg, #fffaf0, #fff); }
.verdict-icon svg { width: 56px; height: 56px; }
.verdict h2 { margin-bottom: .2rem; }
.verdict p { margin: 0; }
.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
@media (max-width: 900px) { .chart-grid { grid-template-columns: 1fr; } }
.chart-card h3 { margin-bottom: .1rem; }
.chart-card p { margin: 0 0 .8rem; font-size: .84rem; }
.chart-box { position: relative; height: 290px; }

/* ===== Home ===== */
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem 1rem; }
.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
@media (max-width: 900px) { .feature-grid { grid-template-columns: 1fr; } }
.feature { color: var(--ink); text-decoration: none !important; display: flex; flex-direction: column; gap: .4rem; transition: transform .15s, box-shadow .15s; }
.feature:hover { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(15, 39, 66, .12); }
.feature p { color: var(--ink-2); margin: 0; flex: 1; }
.feature-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font: 800 1.3rem var(--font-head); }
.feature-icon svg { width: 24px; height: 24px; }
.feature-icon.cash { background: #fff1d1; color: var(--cash); }
.feature-icon.fin { background: #dcf5ef; color: var(--fin); }
.feature-icon.sum { background: #e3ecfd; color: var(--sum); }
.feature-stat { font-size: .84rem; color: var(--muted); margin-top: .4rem; }
.feature-stat b { color: var(--ink); }
.steps { margin: 0; padding-left: 1.2rem; display: grid; gap: .5rem; color: var(--ink-2); }

/* ===== Tiers ===== */
.tiers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; align-items: stretch; }
@media (max-width: 900px) { .tiers { grid-template-columns: 1fr; } }
.tier { position: relative; display: flex; flex-direction: column; gap: 1rem; overflow: hidden; }
.tier-top p { margin: .2rem 0 0; color: var(--muted); font-size: .9rem; }
.tier-price { font: 800 2rem var(--font-head); margin-top: .5rem; }
.tier-price span { font-size: .9rem; font-weight: 500; color: var(--muted); }
.tier ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; flex: 1; }
.tier li { padding-left: 1.5rem; position: relative; font-size: .92rem; }
.tier li::before { content: "☀"; position: absolute; left: 0; color: var(--sun); }
.tier li.no { color: var(--muted); }
.tier li.no::before { content: "—"; color: var(--muted); }
.tier-featured { border: 2px solid var(--sun); box-shadow: 0 16px 40px rgba(245, 165, 36, .18); }
.tier-ribbon { position: absolute; top: 14px; right: -36px; transform: rotate(35deg); background: var(--sun); color: var(--sun-ink); font: 700 .7rem var(--font); padding: .25rem 2.6rem; letter-spacing: .05em; text-transform: uppercase; }
.tier.is-current { outline: 3px solid rgba(59, 111, 216, .35); outline-offset: 2px; }
.tier.is-current::after { content: "Your plan"; position: absolute; top: 14px; left: 14px; font-size: .7rem; font-weight: 700; color: var(--sum); }
.tier.is-current .tier-top { padding-top: 1rem; }
.faq details { border-top: 1px solid var(--line); padding: .75rem 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq p { color: var(--ink-2); margin: .5rem 0 0; }

/* ===== Models ===== */
.models-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; }
.usage { margin-left: .5rem; color: var(--muted); font-size: .9rem; }
.usage-bar { margin-top: .5rem; width: 240px; max-width: 100%; height: 8px; background: #e7ecf3; border-radius: 99px; overflow: hidden; }
.usage-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--sun-2), var(--sun)); }
.model-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 1.1rem; }
.model-card { display: flex; flex-direction: column; gap: .8rem; }
.model-card-head small { color: var(--muted); }
.model-card-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.model-card-stats > div { background: #f8fafc; border-radius: 10px; padding: .5rem .6rem; display: flex; flex-direction: column; }
.model-card-stats span { font-size: .7rem; color: var(--muted); }
.model-card-stats b { font-family: var(--font-head); }
.c-cash b { color: var(--cash); }
.c-fin b { color: var(--fin); }
.row-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.confirm-inline { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .4rem; font-size: .85rem; background: #fdecea; padding: .3rem .5rem; border-radius: 10px; }
.empty { text-align: center; padding: 2rem 1.5rem; }
.empty .row-actions { justify-content: center; }

/* ===== Account / subscription ===== */
.auth-card { padding: 1.6rem; }
.auth-form { display: grid; gap: .9rem; margin-bottom: 1rem; }
.subscribe-card { display: grid; gap: 1.2rem; }
.subscribe-summary ul { padding-left: 1.1rem; color: var(--ink-2); }
.paypal-box { min-height: 160px; }
.sub-details { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1.2rem; margin: 0 0 1.2rem; }
.sub-details dt { color: var(--muted); font-size: .88rem; }
.sub-details dd { margin: 0; font-weight: 600; }
.status { padding: .12rem .55rem; border-radius: 999px; font-size: .78rem; background: #eef2f7; }
.status-active, .status-trial { background: #e6f6ee; color: #135c3c; }
.status-cancelled, .status-suspended { background: #fff1d1; color: #8a5a06; }
.status-expired { background: #fdecea; color: #8b2520; }
.confirm-panel { background: #fff8f7; border: 1px solid #f3c7c3; border-radius: 12px; padding: 1rem; }
.confirm-panel p { margin-top: 0; }

/* ===== Panels & PVWatts pages ===== */
.check { display: flex; align-items: flex-start; gap: .55rem; margin-top: 1rem; font-size: .9rem; color: var(--ink-2); cursor: pointer; }
.check input { margin-top: .2rem; accent-color: var(--sun); width: 16px; height: 16px; }
.check.inline { display: inline-flex; margin: 0 .6rem 0 0; align-items: center; }
.check.inline input { margin-top: 0; }
.linked-note { margin: .9rem 0 0; font-size: .84rem; color: var(--ink-2); background: #f0f6ff; border-radius: 10px; padding: .55rem .75rem; }
.linked-note .btn-link { font-size: .84rem; margin-left: .3rem; }
.field-input input:disabled { color: var(--ink-2); cursor: not-allowed; }
.field-input select { flex: 1; min-width: 0; border: 0; background: transparent; padding: .55rem .6rem; font: 500 .92rem var(--font); color: var(--ink); outline: none; }
.span-2 { grid-column: span 2; }
@media (max-width: 600px) { .span-2 { grid-column: auto; } }
.stat-card { display: flex; align-items: stretch; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; width: 100%; }
.stat-grid > div { background: #f8fafc; border-radius: 12px; padding: .7rem .85rem; display: flex; flex-direction: column; }
.stat-grid > div:last-child { grid-column: span 2; }
.stat-grid span { font-size: .74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.stat-grid b { font-family: var(--font-head); font-size: 1.2rem; }
.stat-grid small { color: var(--muted); font-size: .76rem; }
.stat-grid .warn { background: #fff4e0; }
.arrays-table { min-width: 860px; }
.arrays-table td { vertical-align: middle; }
input.cell { width: 84px; padding: .35rem .5rem; border: 1px solid var(--line); border-radius: 8px; font: 500 .88rem var(--font); text-align: right; background: #fff; }
input.cell.wide { width: 110px; }
input.cell:focus { outline: none; border-color: var(--sun); box-shadow: 0 0 0 3px rgba(245, 165, 36, .2); }
input.cell:disabled { background: #f1f4f9; color: var(--muted); }
.cell-select { padding: .38rem .5rem; border: 1px solid var(--line); border-radius: 8px; font: 500 .88rem var(--font); background: #fff; }
.arrays-table tr.row-stale td { background: #fffaf0; }
.arrays-table tr.row-failed td { background: #fdecea; }
.arrays-table tr.row-error td { color: #8b2520; font-size: .8rem; text-align: left; padding-top: 0; background: #fdecea; }
.facing { display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; color: var(--ink-2); }
.facing-arrow { display: inline-block; color: var(--sun); font-weight: 800; transition: transform .2s ease; }
.warn-note { color: #8a5a06; }
.ref-table { width: 100%; font-size: .9rem; }
.ref-table th { text-align: left; font-weight: 600; color: var(--ink-2); padding: .55rem .8rem .55rem 0; white-space: nowrap; vertical-align: middle; width: 1%; }
.ref-table td { padding: .45rem .6rem; border-bottom: 1px solid #eef2f7; vertical-align: middle; }
.ref-table td.muted { font-size: .8rem; }
.ref-table.compact td, .ref-table.compact th { padding-top: .3rem; padding-bottom: .3rem; }
.ref-table tfoot th, .ref-table tfoot td { border-top: 2px solid var(--ink); padding-top: .6rem; }
textarea.notes { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: .55rem .7rem; font: 400 .88rem var(--font); background: #f8fafc; resize: vertical; }
.info-card p { color: var(--ink-2); }
.formula { font-family: var(--font-head); font-weight: 600; background: #f0f6ff; border-radius: 10px; padding: .7rem 1rem; color: var(--ink) !important; }
.plain-list { margin: .4rem 0 .8rem; padding-left: 1.1rem; color: var(--ink-2); display: grid; gap: .3rem; font-size: .9rem; }
.small { font-size: .8rem; }
.model-switcher .seg-sep { width: 1px; align-self: stretch; background: var(--line); margin: .2rem .2rem; }
.model-switcher .seg-setup:not(.active) { color: var(--muted); }

/* ===== Sign-in (developer-mode code) ===== */
.devcode { background: #fff4dc; border: 1px dashed var(--sun); border-radius: 10px; padding: .7rem .9rem; font-size: .88rem; color: var(--sun-ink); }
.devcode .code { font: 800 1.15rem/1 Consolas, "Courier New", monospace; letter-spacing: .25em; background: #fff; padding: .15rem .45rem; border-radius: 6px; margin-left: .2rem; }

/* ===== Preset choice chips (tax credit) ===== */
.choice-row { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: -.35rem; }
.choice {
    padding: .35rem .7rem; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink-2);
    font: 500 .8rem var(--font); cursor: pointer;
}
.choice b { font-weight: 700; }
.choice:hover { background: #f1f4f9; }
.choice:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(245, 165, 36, .3); }
.choice.on { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ===== Field tooltips ===== */
.field-label-row { display: flex; align-items: center; gap: .35rem; min-width: 0; }
.tip { position: relative; display: inline-flex; }
.tip-btn {
    width: 17px; height: 17px; border-radius: 50%; border: 1px solid #b9c6d6; background: #fff; color: var(--ink-2);
    font: italic 700 .68rem/1 Georgia, "Times New Roman", serif; display: grid; place-items: center; cursor: help; padding: 0;
}
.tip-btn:hover, .tip-btn:focus-visible { border-color: var(--sun); color: var(--sun-ink); background: #fff4dc; outline: none; box-shadow: 0 0 0 3px rgba(245, 165, 36, .25); }
.tip-bubble {
    position: absolute; z-index: 40; left: -10px; bottom: calc(100% + 8px);
    width: max-content; max-width: min(300px, 80vw); padding: .6rem .75rem; border-radius: 10px;
    background: var(--ink); color: #f3f6fa; font: 400 .8rem/1.45 var(--font); text-align: left;
    box-shadow: 0 10px 28px rgba(15, 39, 66, .25); opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity .12s ease, visibility .12s ease;
}
.tip-bubble::after {
    content: ""; position: absolute; top: 100%; left: 12px;
    border: 6px solid transparent; border-top-color: var(--ink);
}
.tip:hover .tip-bubble, .tip:focus-within .tip-bubble, .tip.open .tip-bubble { opacity: 1; visibility: visible; }
@media (prefers-reduced-motion: reduce) { .tip-bubble { transition: none; } }

/* ===== Summary print ===== */
.summary-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; }
.print-btn svg { width: 18px; height: 18px; }
.print-only { display: none; }

@media print {
    @page { size: letter; margin: 0.5in; }
    html, body { background: #fff !important; }
    body { -webkit-print-color-adjust: exact; print-color-adjust: exact; font-size: 11pt; }
    .topbar, .site-footer, .banner, .model-switcher, .savebar, .no-print, #blazor-error-ui, .nav-toggle, .nav-burger { display: none !important; }
    .print-only { display: block; }
    .page { max-width: none; padding: 0; gap: .6rem; }
    .card, .kpi { box-shadow: none !important; border: 1px solid #d6dde6; break-inside: avoid; page-break-inside: avoid; }
    .table-scroll { overflow: visible; margin: 0; padding: 0; }
    .verdict { background: #fff; }
    .chart-grid { grid-template-columns: 1fr 1fr; gap: .6rem; }
    .chart-card { break-inside: avoid; page-break-inside: avoid; padding: .6rem .8rem; }
    .chart-box { height: 2.6in; }
    .compare th, .compare td { padding: .35rem .6rem; }

    .print-header { border-bottom: 2px solid var(--ink); padding-bottom: .5rem; margin-bottom: .2rem; }
    .print-brand { font: 600 1rem var(--font-head); color: var(--ink); }
    .print-brand b { color: var(--sun); font-weight: 800; }
    .print-brand span { color: var(--muted); font-weight: 500; }
    .print-header h1 { font-size: 1.5rem; margin: .2rem 0 .3rem; }
    .print-meta { display: flex; flex-wrap: wrap; gap: .3rem 1.5rem; margin: 0 0 .5rem; font-size: .9rem; }
    .print-inputs { width: 100%; font-size: .8rem; border-collapse: collapse; }
    .print-inputs th { text-align: left; white-space: nowrap; padding: .15rem .8rem .15rem 0; color: var(--ink-2); vertical-align: top; width: 1%; }
    .print-inputs td { padding: .15rem 0; color: var(--ink); }
    .print-footnote { font-size: .72rem; color: var(--muted); margin-top: .4rem; }
}

/* ===== Footer ===== */
.site-footer { border-top: 1px solid var(--line); background: #fff; }
.footer-inner { max-width: 1240px; margin: 0 auto; padding: 1.1rem clamp(16px, 3vw, 32px); display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1.5rem; font-size: .82rem; color: var(--muted); }

/* ===== Blazor error UI ===== */
#blazor-error-ui {
    background: #fff4d6; bottom: 0; box-shadow: 0 -1px 2px rgba(0, 0, 0, .2);
    display: none; left: 0; padding: .6rem 1.25rem .7rem; position: fixed; width: 100%; z-index: 1000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }

@media (max-width: 600px) {
    .mini-stats, .model-card-stats { grid-template-columns: 1fr 1fr; }
    .banner { min-height: 210px; }
    .banner::after { background: linear-gradient(0deg, rgba(6, 16, 32, .7) 0%, rgba(6, 16, 32, .2) 70%); }
}
