/* ════════════════════════════════════════════
   CALCULADORA HIPOTECA v2 — Mobile-first
   Dark theme · Fluid · Touch-optimized
   ════════════════════════════════════════════ */

:root {
    --bg-0: #08080d;
    --bg-1: #0e0e16;
    --bg-2: #16162a;
    --bg-3: #1e1e3a;
    --bg-hover: #222244;
    --tx-1: #eaeaf4;
    --tx-2: #9898b0;
    --tx-3: #66668a;
    --accent: #ff6b35;
    --accent-l: #ff934f;
    --accent-bg: rgba(255,107,53,.12);
    --green: #22c55e;
    --green-bg: rgba(34,197,94,.12);
    --yellow: #eab308;
    --yellow-bg: rgba(234,179,8,.12);
    --red: #ef4444;
    --red-bg: rgba(239,68,68,.12);
    --blue: #3b82f6;
    --border: #262648;
    --r: 14px;
    --r-sm: 10px;
    --max: 820px;
    --font: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }

html { scroll-behavior: smooth; font-size: 16px;
    -webkit-text-size-adjust: 100%;
}
body {
    background: var(--bg-0);
    color: var(--tx-1);
    font-family: var(--font);
    line-height: 1.6;
    min-height: 100vh;
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ─── HEADER ─── */
header {
    text-align: center;
    padding: 2.5rem 1rem 1.5rem;
    background: linear-gradient(180deg, #0c0c18 0%, var(--bg-0) 100%);
}
header h1 {
    font-size: clamp(1.6rem, 5vw, 2.8rem);
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1.15;
}
.highlight { color: var(--accent); }
.subtitle {
    color: var(--tx-2);
    font-size: clamp(.9rem, 2.5vw, 1.05rem);
    margin-top: .4rem;
}

/* ─── LAYOUT ─── */
main {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 1rem 3rem;
}
section { margin-bottom: 2.5rem; }
h2 {
    font-size: clamp(1.2rem, 3.5vw, 1.5rem);
    font-weight: 700;
    margin-bottom: .4rem;
}
.section-desc {
    color: var(--tx-2);
    font-size: .9rem;
    margin-bottom: 1.2rem;
    line-height: 1.5;
}

/* ─── HERO STAT ─── */
.hero-stat {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 1.8rem 1.2rem;
    text-align: center;
}
.hero-label {
    display: block;
    color: var(--tx-3);
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .12em;
    margin-bottom: .3rem;
}
.hero-value {
    display: block;
    font-size: clamp(2.2rem, 8vw, 3.5rem);
    font-weight: 900;
    letter-spacing: -.03em;
    line-height: 1.1;
}
.hero-sub {
    display: block;
    color: var(--tx-2);
    font-size: clamp(.82rem, 2.2vw, .95rem);
    margin-top: .3rem;
}
.hero-bar {
    display: flex;
    height: 28px;
    border-radius: 14px;
    overflow: hidden;
    margin-top: 1.2rem;
    background: var(--bg-0);
}
.bar-fill {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .7rem;
    font-weight: 600;
    color: #fff;
    background: var(--blue);
    transition: width .35s ease;
    white-space: nowrap;
    overflow: hidden;
}
.bar-fill.bar-interest { background: var(--accent); }

/* ─── CALCULATOR PANEL ─── */
.calculator {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 1.5rem 1.2rem;
}
.input-group { margin-bottom: 1.4rem; }
.input-group label {
    display: block;
    font-weight: 600;
    font-size: .92rem;
    margin-bottom: .4rem;
}
.slider-row {
    display: flex;
    align-items: center;
    gap: .8rem;
}

/* ─── EXACT NUMBER INPUT ─── */
.exact-input {
    display: flex;
    align-items: center;
    gap: .3rem;
    min-width: 120px;
    flex-shrink: 0;
}
.num-input {
    width: 100px;
    padding: .45rem .6rem;
    border-radius: var(--r-sm);
    border: 1px solid var(--border);
    background: var(--bg-0);
    color: var(--accent);
    font-size: .95rem;
    font-weight: 700;
    font-family: var(--font);
    font-variant-numeric: tabular-nums;
    text-align: right;
    outline: none;
    transition: border-color .15s;
}
.num-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 8px rgba(255,107,53,.2);
}
.num-input.num-sm { width: 65px; }
.num-suffix {
    color: var(--tx-3);
    font-size: .82rem;
    font-weight: 500;
    white-space: nowrap;
}
.input-sub {
    font-size: .78rem;
    color: var(--tx-3);
    margin-top: .25rem;
    padding-left: 2px;
}
/* ─── RANGE SLIDER ─── */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    outline: none;
    cursor: pointer;
    background: linear-gradient(to right, var(--accent) 0%, var(--accent) var(--fill, 50%), var(--border) var(--fill, 50%), var(--border) 100%);
    transition: background .1s;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--accent);
    border: 3px solid var(--bg-2);
    box-shadow: 0 0 12px rgba(255,107,53,.3);
    cursor: pointer;
    transition: transform .15s;
}
input[type="range"]::-webkit-slider-thumb:active { transform: scale(1.25); }
input[type="range"]::-moz-range-thumb {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--accent);
    border: 3px solid var(--bg-2);
    box-shadow: 0 0 12px rgba(255,107,53,.3);
    cursor: pointer;
}
input[type="range"]::-moz-range-progress {
    background: var(--accent);
    height: 6px;
    border-radius: 3px;
}
input[type="range"]::-moz-range-track {
    background: var(--border);
    height: 6px;
    border-radius: 3px;
}

/* Touch: bigger hit area */
@media (pointer: coarse) {
    input[type="range"]::-webkit-slider-thumb {
        width: 32px; height: 32px;
    }
    input[type="range"]::-moz-range-thumb {
        width: 32px; height: 32px;
    }
}

/* ─── SELECT (CCAA) ─── */
.select-group { margin-bottom: 1.2rem; }
.select-group label {
    display: block;
    font-weight: 600;
    font-size: .92rem;
    margin-bottom: .4rem;
}
.select-row { display: flex; gap: .6rem; align-items: center; }
.select-row select {
    flex: 1;
    padding: .65rem .8rem;
    border-radius: var(--r-sm);
    border: 1px solid var(--border);
    background: var(--bg-0);
    color: var(--tx-1);
    font-size: .95rem;
    font-family: var(--font);
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='%239898b0'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .8rem center;
    padding-right: 2.2rem;
}
.ccaa-badge {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    min-width: 100px;
}
.ccaa-badge .badge-name {
    font-weight: 700;
    font-size: .85rem;
    color: var(--accent);
}
.ccaa-badge .badge-rate {
    font-size: .72rem;
    color: var(--tx-3);
}

/* ─── TOGGLE BUTTONS ─── */
.toggle-row {
    display: flex;
    gap: .4rem;
    margin-bottom: 1rem;
}
.toggle-btn, .vivienda-btn {
    flex: 1;
    padding: .55rem .6rem;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    background: var(--bg-0);
    color: var(--tx-2);
    font-size: .85rem;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all .15s;
    text-align: center;
    white-space: nowrap;
}
.toggle-btn:hover, .vivienda-btn:hover { border-color: var(--accent); color: var(--tx-1); }
.toggle-btn.active, .vivienda-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* ─── RESULTS ─── */
.result-card {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 1rem 1.2rem;
    display: flex;
    flex-direction: column;
}
.result-card.big {
    text-align: center;
    padding: 1.5rem 1rem;
    margin-bottom: .8rem;
    border-color: var(--accent);
    box-shadow: 0 0 40px rgba(255,107,53,.1);
}
.result-card.big .result-number {
    font-size: clamp(2rem, 7vw, 3rem);
    font-weight: 900;
    color: var(--accent);
}
.result-label {
    font-size: .72rem;
    color: var(--tx-3);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: .15rem;
}
.result-number {
    font-size: 1.2rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.result-number.accent, .accent { color: var(--accent); }

.results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .6rem;
}
.results-sub {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .6rem;
    margin-top: .6rem;
}
.results-sub .result-card { background: var(--bg-1); }

/* ─── RATIO DE ENDEUDAMIENTO ─── */
.ratio-section {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 1.2rem;
}
.ratio-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: .6rem;
}
.ratio-header h3 { font-size: 1rem; }
.ratio-value {
    font-size: 1.5rem;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}
.ratio-value.safe    { color: var(--green); }
.ratio-value.warning { color: var(--yellow); }
.ratio-value.danger  { color: var(--red); }
.ratio-bar {
    height: 8px;
    border-radius: 4px;
    background: var(--bg-0);
    overflow: hidden;
    margin-bottom: .6rem;
}
.ratio-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width .35s, background .2s;
}
.ratio-bar-fill.safe    { background: var(--green); }
.ratio-bar-fill.warning { background: var(--yellow); }
.ratio-bar-fill.danger  { background: var(--red); }
.ratio-msg {
    font-size: .85rem;
    font-weight: 500;
}
.ratio-msg.safe    { color: var(--green); }
.ratio-msg.warning { color: var(--yellow); }
.ratio-msg.danger  { color: var(--red); }
.ratio-afford {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}
.ratio-afford .afford-item {
    flex: 1;
    min-width: 140px;
    background: var(--bg-0);
    border-radius: var(--r-sm);
    padding: .7rem .8rem;
}
.afford-label { font-size: .72rem; color: var(--tx-3); text-transform: uppercase; letter-spacing: .05em; }
.afford-value { font-size: 1.1rem; font-weight: 700; color: var(--tx-1); display: block; }

/* ─── COSTS GRID ─── */
.costs-grid { display: flex; flex-direction: column; gap: .4rem; }
.cost-item {
    display: grid;
    grid-template-columns: 2rem 1fr auto;
    grid-template-rows: auto auto;
    gap: 0 .6rem;
    align-items: center;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: .8rem 1rem;
}
.cost-icon { grid-row: 1/3; font-size: 1.2rem; }
.cost-name { font-weight: 600; font-size: .88rem; }
.cost-value { font-weight: 700; text-align: right; color: var(--accent); font-variant-numeric: tabular-nums; }
.cost-note { grid-column: 2/4; font-size: .75rem; color: var(--tx-3); line-height: 1.4; }
.cost-item.total {
    background: var(--accent-bg);
    border-color: var(--accent);
    margin-top: .3rem;
}
.cost-item.total .cost-name { color: var(--accent); }
.cost-item.total .cost-value { font-size: 1.1rem; }
.cost-item.needed {
    background: var(--bg-1);
    border-color: var(--tx-3);
}

/* ─── MONTHLY GRID ─── */
.monthly-grid { display: flex; flex-direction: column; gap: .35rem; }
.monthly-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: .7rem 1rem;
}
.monthly-name { font-weight: 500; font-size: .9rem; }
.monthly-value { font-weight: 700; font-variant-numeric: tabular-nums; }
.monthly-note { font-size: .72rem; color: var(--tx-3); }
.monthly-item.total {
    background: var(--accent-bg);
    border-color: var(--accent);
    margin-top: .3rem;
}
.monthly-item.total .monthly-name { color: var(--accent); font-weight: 700; }
.monthly-item.total .monthly-value { color: var(--accent); font-size: 1.15rem; }
.monthly-item .monthly-extra { font-size: .75rem; color: var(--tx-3); }

/* ─── AMORTIZATION TABLE ─── */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--r);
    border: 1px solid var(--border);
}
table { width: 100%; border-collapse: collapse; font-size: .8rem; }
thead { background: var(--bg-2); position: sticky; top: 0; z-index: 1; }
th {
    padding: .65rem .6rem;
    text-align: right;
    font-weight: 600;
    color: var(--tx-2);
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
th:first-child { text-align: center; width: 3rem; }
td {
    padding: .5rem .6rem;
    text-align: right;
    border-bottom: 1px solid rgba(38,38,72,.5);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.td-year { text-align: center; font-weight: 600; color: var(--tx-3); }
tr:hover { background: var(--bg-hover); }
.td-bar { width: 60px; padding-right: .8rem; }
.mini-bar {
    height: 4px;
    background: var(--accent);
    border-radius: 2px;
    overflow: hidden;
}
.mini-bar-cap {
    height: 100%;
    background: var(--blue);
    border-radius: 2px;
    transition: width .3s;
}

/* ─── CHART ─── */
.amort-chart { margin-top: 1.5rem; }
.amort-chart h3 { font-size: 1rem; margin-bottom: .8rem; color: var(--tx-2); }
#chartContainer {
    display: flex;
    align-items: flex-end;
    gap: 1px;
    height: 180px;
}
.cbar {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    height: 100%;
    cursor: pointer;
}
.cbar-i {
    background: var(--accent);
    min-height: 0;
    transition: height .3s;
}
.cbar-c {
    background: var(--blue);
    border-radius: 2px 2px 0 0;
    min-height: 0;
    transition: height .3s;
}
.cbar:hover { opacity: .8; }
.chart-legend {
    display: flex;
    justify-content: space-between;
    font-size: .72rem;
    color: var(--tx-3);
    margin-top: .5rem;
    flex-wrap: wrap;
    gap: .3rem;
}
.chart-key {
    display: flex;
    gap: .8rem;
    margin-top: .5rem;
    font-size: .75rem;
    color: var(--tx-2);
}
.chart-key span::before {
    content: '';
    display: inline-block;
    width: 10px; height: 10px;
    border-radius: 2px;
    margin-right: .3rem;
    vertical-align: middle;
}
.chart-key .key-cap::before { background: var(--blue); }
.chart-key .key-int::before { background: var(--accent); }

/* ─── TIPS ─── */
.tips-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .6rem;
}
.tip-card {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 1rem;
}
.tip-card h3 { font-size: .95rem; margin-bottom: .4rem; }
.tip-card p { font-size: .85rem; color: var(--tx-2); line-height: 1.5; }

/* ─── FAQ ─── */
details {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    margin-bottom: .4rem;
    overflow: hidden;
}
summary {
    padding: .9rem 1rem;
    font-weight: 600;
    font-size: .92rem;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    -webkit-tap-highlight-color: transparent;
}
summary::after {
    content: '+';
    font-size: 1.2rem;
    color: var(--accent);
    font-weight: 300;
    transition: transform .2s;
    flex-shrink: 0;
    margin-left: .5rem;
}
details[open] summary::after { content: '−'; }
summary::-webkit-details-marker { display: none; }
details p {
    padding: 0 1rem 1rem;
    color: var(--tx-2);
    line-height: 1.6;
    font-size: .9rem;
}

/* ─── RESUMEN FINAL ─── */
.summary-section {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 1.5rem 1.2rem;
}
.summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .5rem;
}
.summary-item {
    background: var(--bg-0);
    border-radius: var(--r-sm);
    padding: .7rem .8rem;
}
.summary-item.full { grid-column: 1 / -1; }
.summary-item.highlight-box {
    background: var(--accent-bg);
    border: 1px solid var(--accent);
}
.summ-label { font-size: .7rem; color: var(--tx-3); text-transform: uppercase; letter-spacing: .05em; }
.summ-value { font-size: 1.1rem; font-weight: 700; display: block; font-variant-numeric: tabular-nums; }
.summ-value.big { font-size: 1.5rem; color: var(--accent); }
.summ-sub { font-size: .75rem; color: var(--tx-3); }

/* ─── SHARE ─── */
.share-row {
    text-align: center;
    margin-top: 1.2rem;
}
.share-label {
    display: block;
    font-weight: 600;
    font-size: .92rem;
    color: var(--tx-2);
    margin-bottom: .6rem;
}
.share-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .5rem;
}
.share-btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .55rem 1rem;
    background: var(--bg-0);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    color: var(--tx-1);
    font-weight: 600;
    font-size: .8rem;
    font-family: var(--font);
    cursor: pointer;
    transition: all .15s;
    -webkit-tap-highlight-color: transparent;
}
.share-btn svg { flex-shrink: 0; }
.share-btn:hover { transform: translateY(-1px); }
.share-x:hover  { border-color: #1d9bf0; color: #1d9bf0; }
.share-fb:hover { border-color: #1877f2; color: #1877f2; }
.share-li:hover { border-color: #0a66c2; color: #0a66c2; }
.share-ig:hover { border-color: #e4405f; color: #e4405f; }
.share-btn.copied { border-color: var(--green); color: var(--green); }

/* ─── SUPPORT / DONATE ─── */
.support {
    text-align: center;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 1.5rem 1.2rem;
}
.support p { color: var(--tx-2); margin-bottom: 1rem; font-size: .92rem; }
.support-options { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; margin-bottom: 1.2rem; }
.support-btn {
    padding: .7rem 1.3rem;
    border-radius: var(--r-sm);
    font-weight: 700;
    font-size: .95rem;
    text-decoration: none;
    transition: transform .15s, box-shadow .15s;
    -webkit-tap-highlight-color: transparent;
}
.support-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 15px rgba(0,0,0,.3); }
.support-btn.paypal { background: #0070ba; color: #fff; }
.support-btn.coffee { background: #fd0; color: #1a1a2e; }
.crypto-title { font-size: .8rem; color: var(--tx-3) !important; }
.crypto-grid { display: flex; flex-direction: column; gap: .5rem; text-align: left; }
.crypto-item {
    display: flex;
    align-items: center;
    gap: .6rem;
    background: var(--bg-0);
    border-radius: var(--r-sm);
    padding: .6rem .8rem;
    flex-wrap: wrap;
}
.crypto-name { font-weight: 600; min-width: 80px; font-size: .88rem; }
.crypto-addr {
    flex: 1;
    font-size: .7rem;
    color: var(--tx-3);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: 'Courier New', monospace;
}
.copy-btn {
    padding: .25rem .5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: transparent;
    color: var(--tx-2);
    font-size: .72rem;
    font-family: var(--font);
    cursor: pointer;
    transition: all .15s;
    -webkit-tap-highlight-color: transparent;
}
.copy-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ─── AD ─── */
.ad-slot { margin: 2rem 0; text-align: center; }
.ad-mock {
    background: var(--bg-2);
    border: 1px dashed var(--border);
    border-radius: var(--r);
    padding: 1.5rem;
    color: var(--tx-3);
    font-size: .8rem;
}

/* ─── FOOTER ─── */
footer {
    text-align: center;
    padding: 1.5rem 1rem;
    border-top: 1px solid var(--border);
    color: var(--tx-3);
    font-size: .8rem;
    max-width: var(--max);
    margin: 0 auto;
}
footer p { margin-bottom: .3rem; }
.footer-links { display: flex; gap: 1.2rem; justify-content: center; margin-top: .4rem; }
.footer-links a { color: var(--tx-3); text-decoration: none; font-size: .75rem; }
.footer-links a:hover { color: var(--accent); }
.footer-copy { margin-top: .6rem; font-size: .68rem; color: var(--tx-3); opacity: .7; }

/* ─── DISCLAIMER BANNER (top) ─── */
.disclaimer-banner {
    max-width: var(--max);
    margin: 0 auto .5rem;
    padding: .7rem 1.2rem;
    background: var(--yellow-bg);
    border: 1px solid rgba(234,179,8,.2);
    border-radius: var(--r-sm);
    font-size: .8rem;
    line-height: 1.5;
    color: var(--yellow);
    text-align: center;
}
.disclaimer-banner strong { color: #fbbf24; }

/* ─── DISCLAIMER INLINE (within content) ─── */
.disclaimer-inline {
    background: var(--yellow-bg);
    border: 1px solid rgba(234,179,8,.15);
    border-radius: var(--r-sm);
    padding: .8rem 1rem;
    font-size: .82rem;
    line-height: 1.6;
    color: var(--tx-2);
    margin-top: 1rem;
}
.disclaimer-inline strong { color: var(--yellow); }

/* ─── FULL DISCLAIMER SECTION ─── */
.full-disclaimer { margin-bottom: 2rem; }
.full-disclaimer h2 { margin-bottom: .6rem; }
.disclaimer-box {
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-left: 3px solid var(--yellow);
    border-radius: var(--r);
    padding: 1.2rem 1.4rem;
}
.disclaimer-box p { color: var(--tx-2); font-size: .88rem; line-height: 1.7; margin-bottom: .6rem; }
.disclaimer-box ul { padding-left: 1.2rem; margin: .6rem 0; }
.disclaimer-box li { color: var(--tx-2); font-size: .85rem; margin-bottom: .5rem; line-height: 1.6; }
.disclaimer-box li strong { color: var(--tx-1); }
.disclaimer-box a { color: var(--accent); text-decoration: none; }
.disclaimer-box a:hover { text-decoration: underline; }
.disclaimer-final { font-size: .78rem; color: var(--tx-3); font-style: italic; margin-top: .8rem; }

/* ─── SEO CONTENT BLOCK ─── */
.seo-content {
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 1.5rem 1.5rem;
    line-height: 1.7;
}
.seo-content h2 { margin-bottom: .5rem; }
.seo-content h3 { font-size: 1rem; font-weight: 700; margin-top: 1.2rem; margin-bottom: .4rem; }
.seo-content p { color: var(--tx-2); font-size: .88rem; margin-bottom: .6rem; }
.seo-content ul { padding-left: 1.2rem; margin-bottom: .8rem; }
.seo-content li { color: var(--tx-2); font-size: .85rem; margin-bottom: .3rem; }
.seo-content li strong { color: var(--tx-1); }

/* ════════════════════════════════════════
   RESPONSIVE — mobile adaptations
   ════════════════════════════════════════ */
@media (max-width: 640px) {
    main { padding: 0 .8rem 2rem; }
    section { margin-bottom: 2rem; }

    .results-grid, .results-sub, .summary-grid { grid-template-columns: 1fr; }
    .tips-grid { grid-template-columns: 1fr; }

    .slider-row { flex-direction: column; align-items: stretch; gap: .3rem; }
    .exact-input { justify-content: flex-start; }
    .num-input { width: 100%; max-width: 140px; }

    .toggle-row { flex-wrap: wrap; }

    .hero-stat { padding: 1.2rem 1rem; }
    .hero-bar { height: 22px; font-size: .62rem; }

    .cost-item { grid-template-columns: 1.5rem 1fr; padding: .7rem .8rem; }
    .cost-value { grid-column: 2; text-align: left; margin-top: .1rem; }
    .cost-note { grid-column: 2; }

    .ratio-afford { flex-direction: column; gap: .5rem; }

    .table-wrapper { max-height: 50vh; overflow-y: auto; }

    #chartContainer { height: 140px; }

    .select-row { flex-direction: column; align-items: stretch; }
    .ccaa-badge { align-items: flex-start; margin-top: .2rem; }

    .support-options { flex-direction: column; }

    .monthly-item { padding: .6rem .8rem; }
    .monthly-name { font-size: .82rem; }
}

/* ─── Animations ─── */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
section { animation: fadeUp .35s ease-out; }

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-0); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--tx-3); }

/* Selection */
::selection { background: var(--accent); color: #fff; }

/* ─── CCAA COMPARE ─── */
.ccaa-compare {
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 1.2rem;
    margin-bottom: 1rem;
}
.compare-header { margin-bottom: .8rem; }
.compare-title { font-weight: 600; font-size: .92rem; }
.compare-your {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: .8rem;
    flex-wrap: wrap;
    gap: .3rem;
}
.compare-your-label { font-size: .88rem; color: var(--tx-2); }
.compare-your-value { font-size: 1.2rem; font-weight: 800; color: var(--accent); }
.compare-bar-container {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-bottom: .8rem;
}
.compare-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .72rem;
}
.compare-row .cr-name {
    min-width: 90px;
    text-align: right;
    color: var(--tx-3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.compare-row .cr-bar {
    flex: 1;
    height: 14px;
    background: var(--bg-0);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}
.compare-row .cr-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width .4s ease;
}
.compare-row .cr-bar-fill.cheapest { background: var(--green); }
.compare-row .cr-bar-fill.normal   { background: var(--blue); opacity: .6; }
.compare-row .cr-bar-fill.current  { background: var(--accent); }
.compare-row .cr-bar-fill.expensive { background: var(--red); opacity: .7; }
.compare-row .cr-val {
    min-width: 70px;
    text-align: right;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--tx-2);
}
.compare-row.is-current .cr-name { color: var(--accent); font-weight: 700; }
.compare-row.is-current .cr-val  { color: var(--accent); font-weight: 700; }
.compare-diff {
    background: var(--bg-2);
    border-radius: var(--r-sm);
    padding: .7rem .9rem;
    font-size: .85rem;
    line-height: 1.5;
}
.compare-diff .diff-save { color: var(--green); font-weight: 700; }
.compare-diff .diff-lose { color: var(--red); font-weight: 700; }

/* ─── FLASH ANIMATION for values that change ─── */
@keyframes flashValue {
    0%   { background: var(--accent-bg); }
    100% { background: transparent; }
}
.flash {
    animation: flashValue .6s ease-out;
    border-radius: 4px;
}

@media (max-width: 640px) {
    .compare-row .cr-name { min-width: 70px; font-size: .65rem; }
    .compare-row .cr-val  { min-width: 55px; font-size: .65rem; }
}

/* ─── PROFILE SECTION ─── */
.profile-section {
    margin-top: 1.5rem;
    padding: 1.2rem;
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: var(--r);
}
.profile-section h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: .3rem;
}
.profile-desc {
    color: var(--tx-2);
    font-size: .85rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}
.profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.profile-select {
    width: 100%;
    padding: .65rem .8rem;
    border-radius: var(--r-sm);
    border: 1px solid var(--border);
    background: var(--bg-0);
    color: var(--tx-1);
    font-size: .95rem;
    font-family: var(--font);
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='%239898b0'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .8rem center;
    padding-right: 2.2rem;
}
.profile-benefit {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-top: 1rem;
    padding: .8rem 1rem;
    background: var(--green-bg);
    border: 1px solid rgba(34,197,94,.25);
    border-radius: var(--r-sm);
}
.benefit-icon { font-size: 1.3rem; }
.benefit-text {
    font-size: .88rem;
    line-height: 1.5;
    color: var(--tx-1);
}
.benefit-text strong { color: var(--green); }
.profile-disclaimer {
    margin-top: .8rem;
    font-size: .72rem;
    color: var(--tx-3);
    font-style: italic;
}
@media (max-width: 640px) {
    .profile-grid { grid-template-columns: 1fr; }
    .profile-section { padding: 1rem .8rem; }
}

/* ─── LEGAL PAGES ─── */
.legal-page {
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 2rem 2rem 2.5rem;
    line-height: 1.75;
}
.legal-page h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent);
    margin-top: 2rem;
    margin-bottom: .5rem;
}
.legal-page h2:first-of-type { margin-top: 0; }
.legal-page h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-top: 1.5rem;
    margin-bottom: .4rem;
    color: var(--tx-1);
}
.legal-page h4 {
    font-size: .95rem;
    font-weight: 600;
    margin-top: 1rem;
    margin-bottom: .3rem;
    color: var(--tx-2);
}
.legal-page p {
    color: var(--tx-2);
    font-size: .9rem;
    margin-bottom: .7rem;
}
.legal-page ul {
    padding-left: 1.4rem;
    margin-bottom: .8rem;
}
.legal-page li {
    color: var(--tx-2);
    font-size: .88rem;
    margin-bottom: .3rem;
}
.legal-page li strong { color: var(--tx-1); }
.legal-page a { color: var(--accent); text-decoration: none; }
.legal-page a:hover { text-decoration: underline; }
.legal-page hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 2.5rem 0;
}
.legal-updated {
    color: var(--tx-3);
    font-size: .8rem;
    font-style: italic;
    margin-bottom: 1.2rem;
}
.legal-note {
    background: var(--yellow-bg);
    border: 1px solid rgba(234,179,8,.2);
    border-radius: var(--r-sm);
    padding: .6rem .9rem;
    font-size: .82rem;
    color: var(--yellow);
    margin-top: .5rem;
}
.cookie-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: .82rem;
}
.cookie-table th {
    text-align: left;
    padding: .6rem .5rem;
    background: var(--bg-2);
    color: var(--tx-1);
    font-weight: 600;
    border-bottom: 2px solid var(--border);
}
.cookie-table td {
    padding: .5rem .5rem;
    color: var(--tx-2);
    border-bottom: 1px solid var(--border);
}
.cookie-table tr:hover td { background: var(--bg-hover); }
@media (max-width: 640px) {
    .legal-page { padding: 1.2rem 1rem 1.8rem; }
    .cookie-table { font-size: .72rem; }
    .cookie-table th, .cookie-table td { padding: .4rem .3rem; }
}
