:root {
    --brand-blue: #00549f;
    --brand-yellow: #ffed00;
    --text-main: #1e293b;
    --text-muted: #5f6b7a;
    --bg-page: #edf5f3;
    --bg-card: #ffffff;
    --success: #13804d;
    --danger: #c62828;
}

@font-face {
    font-family: "Roboto";
    font-style: normal;
    font-weight: 400 900;
    font-display: swap;
    src: url("./assets/fonts/roboto/roboto-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

body[data-contrast="high"] {
    --brand-blue: #003b6f;
    --text-main: #07111f;
    --text-muted: #263241;
    --bg-page: #ffffff;
    --bg-card: #ffffff;
    --success: #005c35;
    --danger: #9d1c1c;
}

body {
    font-family: "Roboto", Arial, sans-serif;
    background-color: var(--bg-page);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    line-height: 1.5;
}

html,
body.iframe-page {
    background: #ffffff;
}

.skip-link {
    position: absolute;
    left: 20px;
    top: 12px;
    z-index: 1000;
    transform: translateY(-160%);
    background: #111827;
    color: #ffffff;
    padding: 10px 14px;
    font-weight: 800;
    text-decoration: none;
    transition: transform 0.15s ease;
}

.skip-link:focus {
    transform: translateY(0);
}

a:focus,
button:focus,
input:focus,
select:focus,
[tabindex]:focus {
    outline: none;
    box-shadow: none;
}

body.keyboard-navigation a:focus,
body.keyboard-navigation button:focus,
body.keyboard-navigation input:focus,
body.keyboard-navigation select:focus,
body.keyboard-navigation [tabindex]:focus {
    outline: 4px solid var(--brand-yellow);
    outline-offset: 4px;
    box-shadow: 0 0 0 3px #111827;
}

body[data-contrast="high"] .value-tag,
body[data-contrast="high"] .value-input-wrapper,
body[data-contrast="high"] .kpi-btn.active,
body[data-contrast="high"] .preset-btn.active,
body[data-contrast="high"] .toggle-btn.active {
    background: #fff6a3;
    color: #07111f;
    border-color: #111827;
}

.wrapper {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px 20px 42px;
    background: #ffffff;
}

body.iframe-page .wrapper {
    padding: 0 0 34px;
    box-sizing: border-box;
}

body.iframe-page .calculator-card {
    border: 1px solid #e5e7eb;
    box-shadow: none;
}

body.iframe-page .controls-panel {
    max-height: none;
    overflow: visible;
}

@media (max-width: 1320px) {
    body.iframe-page .wrapper {
        padding: 0 16px 34px;
    }
}

@media (max-width: 560px) {
    body.iframe-page .wrapper {
        padding: 0 0 28px;
    }
}

.page-shell {
    max-width: 1360px;
    margin: 0 auto;
    padding-top: 8px;
    background: #ffffff;
    box-shadow: 0 18px 34px -34px rgba(15, 23, 42, 0.25);
}

.sticky-site-bar {
    position: fixed;
    top: 0;
    left: 50%;
    z-index: 60;
    width: min(1360px, calc(100% - 40px));
    min-height: 72px;
    padding: 10px 42px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 16px 34px -28px rgba(15, 23, 42, 0.55);
    transform: translate(-50%, -110%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

body.is-scrolled .sticky-site-bar {
    transform: translate(-50%, 0);
    opacity: 1;
    pointer-events: auto;
}

.sticky-site-logo {
    display: inline-flex;
    align-items: center;
    color: inherit;
    text-decoration: none;
}

.sticky-site-logo img {
    display: block;
    width: 220px;
    max-width: 54vw;
    height: auto;
}

.site-header {
    position: relative;
    max-width: none;
    min-height: 340px;
    margin: 0;
    overflow: hidden;
    background: #eaf2f0;
    border-left: 8px solid rgba(255, 255, 255, 0.92);
    border-right: 8px solid rgba(255, 255, 255, 0.92);
    box-shadow: none;
}

.site-header::before,
.site-header::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.site-header::before {
    background: rgba(255, 255, 255, 0.52);
}

.site-header::after {
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.74) 0%, rgba(255, 255, 255, 0.34) 46%, rgba(255, 255, 255, 0.9) 100%),
        linear-gradient(0deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.18));
}

.site-header-inner {
    position: relative;
    z-index: 1;
    max-width: 1280px;
    margin: 0 auto;
    min-height: 340px;
    padding: 26px 42px 34px;
    display: grid;
    grid-template-columns: minmax(230px, 34%) minmax(360px, 1fr) auto;
    grid-template-rows: auto 1fr;
    gap: 20px 34px;
    align-items: start;
}

.site-logo {
    display: inline-flex;
    align-items: center;
    grid-column: 1;
    grid-row: 1;
    color: inherit;
    text-decoration: none;
}

.site-logo img {
    width: 230px;
    max-width: 52vw;
    height: auto;
    display: block;
}

.site-context {
    border-left: 6px solid var(--brand-yellow);
    padding: 8px 0 8px 16px;
    text-align: right;
}

.site-context span {
    display: block;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.site-context strong {
    display: block;
    color: #111827;
    font-size: 1.02rem;
    font-weight: 900;
}

.site-accessibility {
    display: flex;
    align-items: center;
    gap: 18px;
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    margin-left: 0;
}

.accessibility-toggle {
    border: 2px solid #111827;
    background: rgba(255, 255, 255, 0.94);
    color: #111827;
    padding: 10px 14px;
    font-size: 0.82rem;
    font-weight: 900;
    cursor: pointer;
    white-space: nowrap;
}

.accessibility-toggle[aria-pressed="true"] {
    background: var(--brand-yellow);
}

.site-hero-copy {
    grid-column: 2 / 4;
    grid-row: 2;
    align-self: center;
    justify-self: start;
    max-width: 650px;
    min-width: 0;
    color: #000000;
}

.site-hero-copy .tool-kicker {
    color: #000000;
    margin-bottom: 10px;
}

.site-hero-copy h1 {
    margin: 0 0 16px 0;
    color: #000000;
    font-size: clamp(2rem, 4vw, 3.15rem);
    font-weight: 900;
    line-height: 1.02;
    letter-spacing: 0;
    overflow-wrap: break-word;
}

.site-hero-copy p {
    margin: 0;
    max-width: 620px;
    color: #000000;
    font-size: 1rem;
    font-weight: 650;
    line-height: 1.58;
    overflow-wrap: break-word;
}

.tool-intro {
    background: #ffffff;
    border-left: 8px solid var(--brand-yellow);
    box-shadow: 0 18px 34px -22px rgba(15, 23, 42, 0.42);
    padding: 30px 34px;
    margin-bottom: 30px;
}

.tool-kicker {
    display: inline-block;
    margin-bottom: 8px;
    color: var(--brand-blue);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.tool-intro h1 {
    font-weight: 800;
    font-size: 2.4rem;
    color: var(--brand-blue);
    margin: 0 0 10px 0;
    letter-spacing: -0.02em;
}

.tool-intro p {
    color: var(--text-muted);
    font-size: 1.05rem;
    max-width: 760px;
    margin: 0;
}

.site-footer {
    background: #ffffff;
    border-top: 1px solid #d7dce3;
    max-width: 1360px;
    margin: 0 auto;
}

.site-footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 34px 20px;
    display: grid;
    grid-template-columns: minmax(360px, 1fr) minmax(220px, 280px) auto auto;
    gap: 26px;
    align-items: center;
}

.site-footer-brand {
    display: flex;
    align-items: center;
    gap: 24px;
    min-width: 0;
}

.site-footer-brand img {
    width: 190px;
    max-width: 44vw;
    height: auto;
    display: block;
}

.site-footer-brand p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.86rem;
    max-width: 360px;
}

.site-footer-funding img {
    display: block;
    width: 260px;
    max-width: 100%;
    height: auto;
}

.site-footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 22px;
    justify-content: flex-end;
    min-width: 310px;
}

.site-footer-nav a {
    color: #111827;
    font-size: 0.92rem;
    font-weight: 700;
    text-decoration: none;
}

.site-footer-nav a:hover {
    color: var(--brand-blue);
    text-decoration: underline;
}

.back-to-top {
    appearance: none;
    border: 2px solid #111827;
    background: var(--brand-yellow);
    color: #111827;
    padding: 14px 20px;
    font-size: 0.86rem;
    font-weight: 900;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    cursor: pointer;
    white-space: nowrap;
}

.back-to-top:hover {
    background: #fff27a;
}

@media (max-width: 820px) {
    .site-header-inner,
    .site-footer-inner {
        align-items: flex-start;
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    .page-shell,
    .site-footer {
        max-width: none;
        margin-left: 0;
        margin-right: 0;
    }

    .sticky-site-bar {
        width: 100%;
        min-height: 64px;
        padding: 8px 20px;
    }

    .sticky-site-logo img {
        width: 180px;
    }

    .sticky-contrast-toggle {
        padding: 8px 10px;
        font-size: 0.76rem;
    }

    .site-header {
        min-height: 0;
        border-left-width: 0;
        border-right-width: 0;
    }

    .site-header-inner {
        min-height: 0;
        padding: 22px 20px 34px;
        display: grid;
        gap: 24px;
    }

    .site-logo,
    .site-accessibility,
    .site-hero-copy {
        grid-column: 1;
        grid-row: auto;
    }

    .site-accessibility {
        flex-direction: column;
        align-items: flex-start;
        margin-left: 0;
        justify-self: start;
    }

    .site-hero-copy {
        align-self: start;
        max-width: 100%;
    }

    .site-footer-brand,
    .site-footer-nav {
        justify-content: flex-start;
    }

    .site-footer-brand {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }

    .site-footer-nav {
        min-width: 0;
    }

    .tool-intro {
        padding: 24px;
    }
}

.calculator-card {
    background: var(--bg-card);
    border-radius: 0;
    box-shadow: 0 20px 40px -5px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(420px, 1fr) 1fr;
    align-items: start;
}

@media (max-width: 980px) {
    .calculator-card {
        grid-template-columns: 1fr;
    }
}

.controls-panel {
    padding: 34px 34px 30px 34px;
    border-right: 1px solid #e5e7eb;
    max-height: 86vh;
    overflow: auto;
}

@media (max-width: 980px) {
    .controls-panel {
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
        max-height: none;
    }
}

.section-label {
    text-transform: uppercase;
    font-size: 0.73rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--brand-blue);
    margin-bottom: 16px;
    display: block;
}

h2.section-label {
    margin-top: 0;
}

.section-label.section-label-spaced {
    margin-top: 30px;
}

.input-group {
    margin-bottom: 24px;
}

.label-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 10px;
    gap: 12px;
}

label {
    font-weight: 600;
    font-size: 0.95rem;
}

.field-label {
    display: block;
    margin-bottom: 8px;
}

.value-tag {
    background: #eff6ff;
    color: var(--brand-blue);
    padding: 4px 10px;
    border-radius: 0;
    font-weight: 700;
    font-size: 0.85rem;
    min-width: 88px;
    text-align: center;
    white-space: nowrap;
}

.value-input-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-width: 88px;
    max-width: 150px;
    background: #eff6ff;
    color: var(--brand-blue);
    border: 1px solid transparent;
}

.value-input-wrapper.value-input-wide {
    min-width: 112px;
}

.value-input-wrapper.value-input-years {
    min-width: 128px;
}

.value-input-wrapper.value-input-currency {
    min-width: 96px;
}

.value-input-wrapper input {
    width: 100%;
    min-width: 0;
    padding: 4px 36px 4px 10px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 700;
    font-size: 0.85rem;
    line-height: 1.35;
    text-align: right;
    box-sizing: border-box;
}

.value-input-wrapper.value-input-wide input {
    padding-right: 34px;
}

.value-input-wrapper.value-input-years input {
    padding-right: 58px;
}

.value-input-wrapper.value-input-currency input {
    padding-right: 30px;
}

.value-input-wrapper span {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    color: inherit;
    font-weight: 700;
    font-size: 0.85rem;
    line-height: 1;
    pointer-events: none;
}

.value-input-wrapper:focus-within {
    border-color: var(--brand-blue);
    background: #dbeafe;
}

.value-input-wrapper.is-out-of-slider {
    background: #fff7ed;
    border-color: #f59e0b;
}

.value-input-wrapper.is-out-of-slider::after {
    content: "";
    position: absolute;
    top: -1px;
    right: -1px;
    width: 0;
    height: 0;
    border-top: 9px solid #f59e0b;
    border-left: 9px solid transparent;
}

.value-input-wrapper.is-disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.value-input-wrapper input[disabled] {
    cursor: not-allowed;
}

input[type="range"] {
    width: 100%;
    height: 6px;
    background: #e5e7eb;
    border-radius: 0;
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    background: var(--brand-blue);
    border: 3px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    border-radius: 0;
    transition: transform 0.1s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.08);
}

body.keyboard-navigation input[type="range"]:focus::-webkit-slider-thumb {
    transform: scale(1.12);
    box-shadow: 0 0 0 3px #ffffff, 0 0 0 7px #111827;
}

input[type="range"]::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: var(--brand-blue);
    border: 3px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    border-radius: 0;
}

body.keyboard-navigation input[type="range"]:focus::-moz-range-thumb {
    box-shadow: 0 0 0 3px #ffffff, 0 0 0 7px #111827;
}

input[type="number"] {
    width: 100%;
    padding: 11px 78px 11px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 0;
    font-size: 0.96rem;
    font-weight: 600;
    color: var(--text-main);
    box-sizing: border-box;
    font-family: "Roboto", Arial, sans-serif;
    -moz-appearance: textfield;
    appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

body.keyboard-navigation input[type="number"]:focus {
    border-color: var(--brand-blue);
}

select {
    width: 100%;
    padding: 11px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 0;
    font-size: 0.96rem;
    font-weight: 600;
    color: var(--text-main);
    box-sizing: border-box;
    font-family: "Roboto", Arial, sans-serif;
    background: #ffffff;
}

body.keyboard-navigation select:focus {
    border-color: var(--brand-blue);
}

body.keyboard-navigation input[type="range"]:focus,
body.keyboard-navigation input[type="number"]:focus,
body.keyboard-navigation select:focus {
    outline: 4px solid var(--brand-yellow);
    outline-offset: 4px;
    box-shadow: 0 0 0 3px #111827;
}

input[type="number"][disabled],
input[type="range"][disabled],
select[disabled] {
    opacity: 0.65;
    cursor: not-allowed;
}

.currency-input-wrapper {
    position: relative;
}

.currency-input-wrapper span {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    pointer-events: none;
}

.field-label-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.field-label-row label {
    min-width: 0;
}

#expert-panel > .grid-2 > .input-group > .field-label,
#expert-panel > .grid-2 > .input-group > .field-label-row {
    min-height: 44px;
}

#expert-panel > .grid-2 > .input-group > .field-label {
    display: flex;
    align-items: center;
}

.final-cost-grid > .input-group > .field-label-row {
    min-height: 62px;
    align-items: start;
}

.final-cost-grid .info-tooltip {
    margin-top: 3px;
}

.info-tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: 1px solid #94a3b8;
    border-radius: 999px;
    background: #ffffff;
    color: var(--brand-blue);
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
    cursor: help;
    outline: none;
    padding: 0;
    font-family: inherit;
}

body.keyboard-navigation .info-tooltip:focus {
    border-color: var(--brand-blue);
}

.info-tooltip-text {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 10px);
    transform: translateX(-50%);
    width: min(250px, calc(100vw - 48px));
    background: #0f172a;
    color: #ffffff;
    padding: 10px 12px;
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.45;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.28);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    z-index: 20;
}

.info-tooltip-text::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 100%;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #0f172a;
}

.info-tooltip.tooltip-right .info-tooltip-text {
    left: 0;
    transform: none;
}

.info-tooltip.tooltip-right .info-tooltip-text::after {
    left: 9px;
    transform: none;
}

.info-tooltip.tooltip-left .info-tooltip-text {
    left: auto;
    right: 0;
    transform: none;
}

.info-tooltip.tooltip-left .info-tooltip-text::after {
    left: auto;
    right: 9px;
    transform: none;
}

.info-tooltip:hover .info-tooltip-text,
body.keyboard-navigation .info-tooltip:focus .info-tooltip-text,
body.keyboard-navigation .info-tooltip:focus-within .info-tooltip-text,
.info-tooltip.is-open .info-tooltip-text {
    opacity: 1;
    visibility: visible;
}

.preset-box {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 0;
    padding: 12px;
    margin: 0 0 18px 0;
}

.preset-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.preset-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.preset-btn {
    border: 1px solid #cbd5e1;
    border-radius: 0;
    background: #ffffff;
    color: #334155;
    padding: 10px 9px;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.25;
    cursor: pointer;
    text-align: left;
    font-family: "Roboto", Arial, sans-serif;
}

.preset-btn:hover {
    background: #f1f5f9;
}

.preset-btn.active {
    border-color: var(--brand-blue);
    background: #eff6ff;
    color: var(--brand-blue);
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 14px;
}

@media (max-width: 720px) {
    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }

    .preset-row {
        grid-template-columns: 1fr;
    }

    .kpi-toggle {
        grid-template-columns: 1fr;
    }
}

.mode-box {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 0;
    padding: 14px 14px 12px 14px;
    margin: 10px 0 20px 0;
}

.mode-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.mode-row label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
}

.mode-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--brand-blue);
    cursor: pointer;
}

.loss-grid {
    margin-top: -10px;
}

.loss-option {
    display: flex;
    justify-content: center;
}

.loss-label-row {
    display: flex;
    justify-content: center;
    margin-bottom: 2px;
    width: 100%;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--brand-blue);
    cursor: pointer;
}

.mode-hint {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 10px;
}

.base-assumptions {
    margin: 0 0 18px 0;
    padding: 0;
    border: 1px solid #d7e3ee;
    background: #f7fbff;
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.5;
}

.base-assumptions summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    color: var(--brand-blue);
    font-weight: 800;
    cursor: pointer;
    list-style: none;
}

.base-assumptions summary::-webkit-details-marker {
    display: none;
}

.base-assumptions summary::after {
    content: "+";
    color: var(--brand-blue);
    font-size: 1rem;
    font-weight: 800;
    line-height: 1;
    flex: 0 0 auto;
}

.base-assumptions[open] summary {
    border-bottom: 1px solid #d7e3ee;
}

.base-assumptions[open] summary::after {
    content: "–";
}

.base-assumptions-content {
    padding: 12px 16px 14px 16px;
}

.base-assumptions-content p {
    margin: 0 0 10px 0;
}

.base-assumptions-content p:last-child {
    margin-bottom: 0;
}

.caution-note {
    padding: 10px 12px;
    border-left: 3px solid #d97706;
    background: #fff7ed;
    color: #9a3412;
}

.range-boundary-note {
    padding: 8px 10px;
    border-left: 3px solid #f59e0b;
    background: #fff7ed;
    color: #7c2d12;
}

.expert-panel {
    margin-top: 18px;
    border-top: 1px dashed #d1d5db;
    padding-top: 16px;
    display: flex;
    flex-direction: column;
}

.expert-title {
    margin: 0 0 12px 0;
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--brand-blue);
    order: -2;
}

.financing-box {
    border: 1px solid #dbe5ef;
    background: #f3f8fc;
    padding: 12px;
    margin: 0 0 18px 0;
}

.financing-title {
    margin: 0 0 10px 0;
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--brand-blue);
}

.financing-title-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.financing-title-row .financing-title {
    margin-bottom: 0;
}

.financing-card {
    border: 1px solid #dbe5ef;
    background: #ffffff;
    padding: 10px;
}

.financing-card .input-group {
    margin-bottom: 12px;
}

.financing-card .input-group:last-child {
    margin-bottom: 0;
}

.financing-note {
    margin: 2px 0 10px 0;
    font-size: 0.77rem;
    color: var(--text-muted);
}

.financing-runtime-note {
    margin-top: 12px;
    padding: 10px 12px;
    border-left: 3px solid #d97706;
    background: #fff7ed;
    color: #9a3412;
    white-space: pre-line;
}

.kpi-box {
    border: 1px solid #dbe5ef;
    background: #ffffff;
    padding: 12px;
    margin: 0 0 18px 0;
    order: -1;
}

.kpi-title {
    margin: 0 0 10px 0;
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--brand-blue);
}

.kpi-title-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.kpi-title-row .kpi-title {
    margin-bottom: 0;
}

.kpi-toggle {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}

.kpi-btn {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    padding: 8px 10px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    font-family: "Roboto", Arial, sans-serif;
}

.kpi-btn:hover {
    background: #f1f5f9;
}

.kpi-btn.active {
    border-color: var(--brand-blue);
    background: #eff6ff;
    color: var(--brand-blue);
}

.results-panel {
    background: #f4f7fa;
    padding: 34px;
    display: flex;
    flex-direction: column;
    align-self: start;
    box-sizing: border-box;
    width: 100%;
}

.result-card {
    background: white;
    border-radius: 0;
    padding: 20px 22px 16px 22px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 16px;
    border: 1px solid #f0f0f0;
}

.result-card h2 {
    margin: 0 0 12px 0;
    font-size: 0.86rem;
    color: var(--text-muted);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.result-kpi-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0;
    align-items: stretch;
    margin-bottom: 18px;
}

.result-main-kpi {
    min-width: 0;
    padding-right: clamp(18px, 3vw, 34px);
}

.saving-amount {
    font-size: 2.1rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 8px;
    color: var(--brand-blue);
}

.saving-amount.positive {
    color: #059669;
}

.saving-amount.negative {
    color: #dc2626;
}

.saving-amount.neutral {
    color: #334155;
}

.status-pill {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 0;
    font-size: 0.83rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.status-pill.positive {
    background: #d1fae5;
    color: var(--success);
}

.status-pill.negative {
    background: #fee2e2;
    color: var(--danger);
}

.status-pill.neutral {
    background: #e2e8f0;
    color: #334155;
}

.break-even-card {
    border-left: 3px solid #cbd5e1;
    padding-left: clamp(18px, 3vw, 34px);
    min-height: 0;
}

.break-even-label {
    margin-bottom: 12px;
    color: var(--text-muted);
    font-size: 0.86rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.break-even-value {
    color: var(--brand-blue);
    font-size: 2.1rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 8px;
}

.break-even-detail {
    margin-top: 0;
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.35;
}

.result-total-diff {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: baseline;
    column-gap: 10px;
    row-gap: 4px;
    margin-top: 2px;
    padding: 12px 16px;
    background: #f8fbff;
    color: #0f172a;
    line-height: 1.25;
}

.result-total-label {
    grid-column: 1 / -1;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.result-total-value {
    font-size: 1.45rem;
    font-weight: 800;
    white-space: nowrap;
}

.result-total-value.positive {
    color: #059669;
}

.result-total-value.negative {
    color: #dc2626;
}

.result-total-value.neutral {
    color: #334155;
}

.result-total-note {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 700;
    min-width: 0;
}

#break-even-text {
    font-size: 0.83rem;
    margin-top: 8px;
    color: #6b7280;
}

@media (max-width: 720px) {
    .result-kpi-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .break-even-card {
        border-left: 0;
        border-top: 3px solid #cbd5e1;
        padding-left: 0;
        padding-top: 12px;
    }

    .result-main-kpi {
        padding-right: 0;
    }

    .result-total-diff {
        grid-template-columns: 1fr;
        align-items: start;
        gap: 5px;
    }
}

.chart-toggle {
    background: #e5e7eb;
    border-radius: 0;
    padding: 4px;
    display: flex;
    margin-bottom: 16px;
    width: 100%;
}

.toggle-btn {
    flex: 1;
    border: none;
    background: transparent;
    padding: 9px 10px;
    border-radius: 0;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    font-family: "Roboto", Arial, sans-serif;
    font-size: 0.87rem;
}

.toggle-btn.active {
    background: white;
    color: var(--brand-blue);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.chart-wrapper {
    flex: 0 0 auto;
    position: relative;
    height: 330px;
    min-height: 0;
}

@media (max-width: 720px) {
    .chart-wrapper {
        height: 300px;
    }
}

canvas {
    width: 100% !important;
    height: 100% !important;
}

.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 13px;
    justify-content: center;
    margin-top: 10px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 0;
}

.dot-vehicle {
    background: #3a78b4;
}

.dot-infra {
    background: #66a9d9;
}

.dot-energy {
    background: #003b6f;
}

.dot-maint {
    background: #f4a261;
}

.dot-toll {
    background: #ffed00;
}

.dot-insurance {
    background: #a8b3bf;
}

.dot-thg {
    background: #3b9b5a;
}

.dot-line-diesel {
    background: #4b5563;
}

.dot-line-bev {
    background: #00549f;
}

[hidden] {
    display: none !important;
}

.financing-card-label {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--brand-blue);
    margin: 0 0 10px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--brand-blue);
}

.financing-toggle {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 14px;
}

.export-bar {
    margin-bottom: 14px;
}

.export-bar-buttons {
    display: flex;
    gap: 8px;
}

.export-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid #cbd5e1;
    border-bottom: 3px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    padding: 10px 14px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    font-family: "Roboto", Arial, sans-serif;
    transition: border-color 0.15s, background 0.15s;
}

.export-btn:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    border-bottom-color: var(--brand-blue);
}

/* ── Print view ── */
#print-view {
    display: none;
}

.pv-header {
    border-bottom: 3px solid var(--brand-blue);
    padding-bottom: 8px;
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.pv-header-copy {
    min-width: 0;
}

.pv-header-logo {
    display: block;
    width: 150px;
    height: auto;
    flex: 0 0 auto;
}

.pv-title {
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--brand-blue);
    margin: 0 0 3px 0;
}

.pv-timestamp {
    font-size: 0.82rem;
    color: #64748b;
}

.pv-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 18px;
}

.pv-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--brand-blue);
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid #e2e8f0;
}

.pv-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.pv-table tr {
    border-bottom: 1px solid #f1f5f9;
}

.pv-caption {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.pv-table td,
.pv-table th {
    padding: 4px 4px;
    vertical-align: top;
}

.pv-key {
    color: #64748b;
    font-weight: 600;
    text-align: left;
    width: 55%;
}

.pv-val {
    font-weight: 700;
    color: #1e293b;
}

.pv-highlight {
    background: #eff6ff;
    font-size: 1rem;
}

.pv-highlight .pv-key {
    color: #1e40af;
    font-weight: 700;
}

.pv-highlight .pv-val {
    color: var(--brand-blue);
    font-size: 1.1rem;
}

.pv-charts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.pv-charts-single {
    grid-template-columns: 1fr;
}

.pv-grid-single {
    grid-template-columns: 1fr;
}

.pv-page-block {
    page-break-inside: avoid;
}

.pv-page-break {
    break-before: page;
    page-break-before: always;
}

.pv-chart-img {
    width: 100%;
    height: auto;
    border: 1px solid #e2e8f0;
}

.pv-chart-img-bar {
    display: block;
    max-height: 345px;
    object-fit: contain;
}

.pv-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 7px 14px;
    margin-top: 8px;
    font-size: 0.68rem;
    color: #475569;
}

.pv-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.pv-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
}

.pv-line-key {
    width: 16px;
    height: 0;
    border-top: 2px solid currentColor;
    flex: 0 0 auto;
}

.pv-line-diesel {
    color: #4b5563;
}

.pv-line-bev {
    color: #00549f;
}

.pv-marker-key {
    display: inline-block;
    width: 9px;
    height: 9px;
    border: 2px solid #003b6f;
    background: #ffed00;
    border-radius: 50%;
    flex: 0 0 auto;
}

.pv-line-chart-block {
    margin-top: 12px;
}

.pv-line-chart-block .pv-chart-img {
    display: block;
    max-height: 360px;
    object-fit: contain;
}

.pv-footer {
    font-size: 0.72rem;
    color: #94a3b8;
    border-top: 1px solid #e2e8f0;
    padding-top: 10px;
    margin-top: 8px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
}

.pv-footer-text {
    margin: 0;
}

@media print {
    @page {
        size: A4 portrait;
        margin: 12mm;
    }

    .site-header,
    .site-footer,
    .wrapper,
    .page-shell,
    .sticky-site-bar {
        display: none !important;
    }
    #print-view {
        display: block !important;
        padding: 0;
        font-family: "Roboto", Arial, sans-serif;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .pv-header {
        margin-bottom: 14px;
    }

    .pv-grid {
        gap: 14px;
        margin-bottom: 14px;
    }

    .pv-table {
        font-size: 0.76rem;
    }

    .pv-table td,
    .pv-table th {
        padding: 3px 4px;
    }

    .pv-section-title {
        margin-bottom: 5px;
    }

    .pv-chart-img-bar {
        max-height: 360px;
    }

    .pv-line-chart-block .pv-chart-img {
        max-height: 340px;
    }

    .pv-footer {
        margin-top: 6px;
    }

    .pv-grid,
    .pv-charts,
    .pv-page-block {
        page-break-inside: avoid;
    }
}

.next-step-card {
    margin-top: 26px;
    padding: 28px 0 4px;
    border-top: 2px solid #111827;
    background: transparent;
    display: block;
}

.next-step-card-media {
    display: block;
}

.next-step-copy {
    width: 100%;
    max-width: none;
}

.next-step-card-media .next-step-copy {
    grid-column: 1;
}

.next-step-kicker {
    display: inline-block;
    margin-bottom: 10px;
    color: var(--brand-blue);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.next-step-card h2 {
    margin: 0 0 12px 0;
    font-size: clamp(1.55rem, 2.4vw, 2rem);
    color: #000000;
    line-height: 1.16;
    max-width: 1020px;
    font-weight: 900;
}

.next-step-card p {
    margin: 0;
    color: #000000;
    font-size: 1rem;
    line-height: 1.62;
    max-width: 98ch;
}

.next-step-media {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: start;
    justify-self: end;
    width: 100%;
    height: 176px;
    border: 1px solid #d7e3ee;
    background: #ffffff;
    overflow: hidden;
}

.next-step-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center top;
}

.next-step-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
}

.next-step-card-media .next-step-brand {
    grid-column: 1;
}

.next-step-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 10px;
    width: 100%;
}

.next-step-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 220px;
    padding: 11px 15px;
    border: 1px solid var(--brand-blue);
    color: var(--brand-blue);
    background: #ffffff;
    font-size: 0.84rem;
    font-weight: 800;
    text-decoration: none;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.next-step-link:hover {
    background: var(--brand-blue);
    color: #ffffff;
}

.next-step-link.primary {
    background: var(--brand-blue);
    color: #ffffff;
}

.next-step-link.primary:hover {
    background: #003b6f;
    border-color: #003b6f;
}

.kea-text-link {
    color: #000000;
    text-decoration: underline;
    text-decoration-color: #000000;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: background-color 0.12s ease, box-shadow 0.12s ease;
}

.kea-text-link:hover,
.kea-text-link:focus-visible {
    background-color: rgba(255, 237, 0, 0.62);
    box-shadow: 0 0.12em 0 rgba(255, 237, 0, 0.62);
    text-decoration-color: #000000;
}

@media (max-width: 860px) {
    .next-step-brand,
    .next-step-links {
        align-items: flex-start;
        justify-content: flex-start;
    }

    .next-step-card-media {
        grid-template-columns: 1fr;
    }

    .next-step-card-media .next-step-copy,
    .next-step-card-media .next-step-brand {
        grid-column: 1;
    }

    .next-step-media {
        display: none;
    }
}

@media (max-width: 560px) {
    .next-step-card {
        padding: 22px 0 4px;
    }

    .next-step-link {
        width: 100%;
        min-width: 0;
    }
}

@media (max-width: 640px) {
    .loss-spacer {
        display: none;
    }
}

.tool-note {
    max-width: none;
    margin: 36px 0 0;
    padding-top: 20px;
    border-top: 2px solid #101827;
    text-align: left;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.tool-note p {
    margin: 0;
    line-height: 1.55;
}

.tool-note .tool-note-title {
    display: block;
    margin: 0 0 10px;
    color: var(--brand-blue);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    line-height: 1.2;
    text-transform: uppercase;
}

.tool-note p:not(.tool-note-title) + p:not(.tool-note-title) {
    margin-top: 8px;
}
