﻿    *, *::before, *::after { box-sizing: border-box; }

    .rv-shell { max-width: 860px; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }

    .rv-card {
        background: #ffffff;
        border: 1px solid #d0d8e0;
        border-radius: 10px;
        padding: 1.25rem 1.5rem;
        margin-bottom: 1rem;
        box-shadow: 0 1px 4px rgba(15,25,35,.07);
    }

    .rv-section-title {
        font-size: .95rem;
        font-weight: 700;
        color: #0f1923;
        margin: 0 0 1.1rem;
        padding-bottom: .55rem;
        border-bottom: 2px solid #b8d9f0;
    }

    /* ── Form ────────────────────────────────────────────── */
    .rv-row { display: flex; gap: .75rem; align-items: flex-end; flex-wrap: wrap; margin-bottom: .85rem; }

    .rv-field { display: flex; flex-direction: column; gap: .3rem; }

    .rv-field label { font-size: .8rem; font-weight: 700; color: #0f1923; }

    .rv-field input, .rv-field select {
        padding: .65rem .9rem;
        font-size: .9rem;
        border: 2px solid #d0d8e0;
        border-radius: 8px;
        background: #ffffff;
        color: #0f1923;
        transition: border-color .15s, box-shadow .15s;
    }

    .rv-field input:focus, .rv-field select:focus {
        outline: none;
        border-color: #005fa3;
        box-shadow: 0 0 0 3px rgba(0,95,163,.15);
    }

    .rv-field .rv-helper { font-size: .78rem; font-weight: 600; color: #0f1923; margin: .2rem 0 0; line-height: 1.4; }

    .f-sm { width: 110px; }
    .f-md { width: 170px; }
    .f-lg { flex: 1; min-width: 160px; }

    /* ── Currency toggle ─────────────────────────────────── */
    .rv-toggle { display: flex; gap: .5rem; flex-wrap: wrap; }
    .rv-toggle-btn { padding: .4rem .9rem; font-size: .8rem; font-weight: 700; border: 2px solid #b0bcc8; border-radius: 999px; background: #ffffff; color: #0f1923; cursor: pointer; transition: border-color .15s, background .15s, color .15s; }
    .rv-toggle-btn:hover:not(.active) { border-color: #005fa3; background: #e8f4fb; }
    .rv-toggle-btn.active { background: #2d3f52; border-color: #2d3f52; color: #ffffff; }

    /* ── Buttons ─────────────────────────────────────────── */
    .rv-run-btn {
        padding: .75rem 1.5rem;
        font-size: .95rem;
        font-weight: 700;
        background: #b8d9f0;
        color: #0f1923;
        border: 2px solid #7ec8f0;
        border-radius: 10px;
        cursor: pointer;
        transition: background .15s, transform .1s;
        box-shadow: 0 1px 4px rgba(15,25,35,.08);
    }

    .rv-run-btn:hover  { background: #90c5e8; }
    .rv-run-btn:active { transform: scale(.97); }

    /* ── Results header ──────────────────────────────────── */
    .rv-results-header {
        background: #2d3f52;
        border-radius: 16px;
        padding: 1.5rem 1.75rem;
        margin-bottom: 1.25rem;
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: .75rem;
        box-shadow: 0 4px 16px rgba(15,25,35,.12);
    }

    .rv-results-header h2 { font-size: 1.25rem; font-weight: 800; margin: 0 0 .2rem; color: #ffffff; }
    .rv-results-header p  { margin: 0; font-size: .875rem; color: #b8d0e8; }

    /* ── Result cards ────────────────────────────────────── */
    .results-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; margin-bottom: .85rem; }

    .result-card { border-radius: 8px; padding: .9rem 1rem; background: #b8d9f0; border: 1px solid #5da8d8; }
    .result-card .result-label { color: #0f1923; font-size: .75rem; font-weight: 700; margin: 0 0 .25rem; }
    .result-card .result-value { color: #0f1923; font-size: 1.35rem; font-weight: 800; margin: 0; font-variant-numeric: tabular-nums; }

    .result-card.dark { background: #2d3f52; border-color: #1e2d3d; }
    .result-card.dark .result-label { color: #b8d0e8; }
    .result-card.dark .result-value { color: #ffffff; }

    .result-card.good { background: #a8d8b8; border-color: #3d9a5a; }
    .result-card.warn { background: #f0d080; border-color: #b07800; }
    .result-card.bad  { background: #f5c0c0; border-color: #b03030; }
    .result-card.good .result-label, .result-card.good .result-value,
    .result-card.warn .result-label, .result-card.warn .result-value,
    .result-card.bad  .result-label, .result-card.bad  .result-value { color: #0f1923; }

    /* ── Period comparison ───────────────────────────────── */
    .rv-compare {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
        margin-bottom: 1rem;
    }

    .rv-compare-col {
        border-radius: 10px;
        padding: 1rem 1.25rem;
        background: #f0f7fd;
        border: 1px solid #b8d9f0;
        border-top: 4px solid #5da8d8;
    }

    .rv-compare-col.current  { border-top-color: #3d9a5a; background: #f0faf4; border-color: #9ad5b0; }
    .rv-compare-col.previous { border-top-color: #b07800; background: #fffbf0; border-color: #e0c060; }

    .rv-compare-title { font-size: .85rem; font-weight: 700; color: #0f1923; margin: 0 0 .75rem; }
    .rv-compare-row   { display: flex; justify-content: space-between; padding: .35rem 0; border-bottom: 1px solid rgba(0,0,0,.07); font-size: .85rem; }
    .rv-compare-row:last-child { border-bottom: none; }
    .rv-compare-row .rv-cl { color: #0f1923; font-weight: 600; }
    .rv-compare-row .rv-cv { color: #0f1923; font-weight: 700; font-variant-numeric: tabular-nums; }

    /* ── Badge / divider / note ──────────────────────────── */
    .rv-badge { display: inline-block; font-size: .75rem; font-weight: 700; padding: .25rem .7rem; border-radius: 999px; flex-shrink: 0; }
    .badge-ok   { background: #a8d8b8; color: #0f1923; border: 1px solid #3d9a5a; }
    .badge-warn { background: #f0d080; color: #0f1923; border: 1px solid #b07800; }
    .badge-crit { background: #f5c0c0; color: #0f1923; border: 1px solid #b03030; }
    .badge-info { background: #b8d9f0; color: #0f1923; border: 1px solid #5da8d8; }

    .rv-divider { border: none; border-top: 1px solid #d0d8e0; margin: 1rem 0; }
    .rv-note { font-size: .8rem; font-weight: 700; color: #0f1923 !important; margin: .5rem 0 0; line-height: 1.5; }

    /* ── Explainer ───────────────────────────────────────── */
    .rv-explainer { border: 1px solid #d0d8e0; border-radius: 10px; margin-top: 1.5rem; background: #ffffff; overflow: hidden; }
    .rv-explainer-head { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: .9rem 1.25rem; background: #ffffff; border: none; cursor: pointer; font-size: .95rem; font-weight: 700; color: #0f1923; text-align: left; transition: background .15s; }
    .rv-explainer-head:hover { background: #f0f4f8; }
    .rv-explainer-head svg { width: 18px; height: 18px; flex-shrink: 0; transition: transform .2s; }
    .rv-explainer-head[aria-expanded="true"] svg { transform: rotate(180deg); }
    .rv-explainer-body { display: none; padding: 1rem 1.25rem 1.25rem; border-top: 1px solid #d0d8e0; }
    .rv-explainer-body h3 { font-size: .9rem; font-weight: 700; margin: 1rem 0 .25rem; color: #0f1923; }
    .rv-explainer-body h3:first-child { margin-top: 0; }
    .rv-explainer-body p  { font-size: .875rem; margin: 0 0 .3rem; line-height: 1.55; color: #0f1923; }

    .hc-disclaimer { margin-top: 1.5rem; padding: .9rem 1.1rem; background: #b8d9f0; border: 1px solid #5da8d8; border-radius: 10px; font-size: .8rem; line-height: 1.5; }
    .hc-disclaimer p { color: #0f1923; margin: 0; font-weight: 600; }

    /* ── Card-scoped overrides ───────────────────────────── */
    .rv-card label, .rv-card .rv-section-title, .rv-card .rv-helper,
    .rv-card input, .rv-card select,
    .rv-compare-title, .rv-compare-row .rv-cl, .rv-compare-row .rv-cv,
    .rv-explainer-body p, .rv-explainer-body h3, .rv-explainer-head,
    .hc-disclaimer p { color: #0f1923 !important; }

    .rv-results-header h2 { color: #ffffff !important; }
    .rv-results-header p  { color: #b8d0e8 !important; }
    .rv-toggle-btn.active { color: #ffffff !important; }
    .result-card .result-label, .result-card .result-value { color: #0f1923 !important; }
    .result-card.dark .result-label { color: #b8d0e8 !important; }
    .result-card.dark .result-value { color: #ffffff !important; }

    @media (max-width: 600px) {
        .rv-compare { grid-template-columns: 1fr; }
        .rv-row { flex-direction: column; align-items: stretch; }
        .results-grid { grid-template-columns: 1fr 1fr; }
    }

    @media print {
        nav, header, footer, .rv-run-btn, .rv-explainer, .hc-disclaimer { display: none !important; }
        .rv-results-header { background: #2d3f52 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    }