:root {
    --horizon-blue: #0e406a;
    --harvest-orange: #faa21b;
    --freshwater-blue: #049fda;
    --summer-green: #709749;
    --earthy-teal: #087482;
    --rustic-brown: #a8353a;
    --warm-gray: #796e66;

    --horizon-blue-rgb: 14, 64, 106;
    --harvest-orange-rgb: 250, 162, 27;
    --summer-green-rgb: 112, 151, 73;
    --rustic-brown-rgb: 168, 53, 58;

    --bg: #ffffff;
    --fg: #1b2430;
    --muted: #796e66;
    --line: #d8dee4;
    --line-strong: rgba(var(--horizon-blue-rgb), 0.26);
    --soft-blue: rgba(var(--horizon-blue-rgb), 0.06);
    --soft-orange: rgba(var(--harvest-orange-rgb), 0.14);
    --soft-green: rgba(var(--summer-green-rgb), 0.16);
    --soft-error: rgba(var(--rustic-brown-rgb), 0.12);
    --focus-ring: rgba(4, 159, 218, 0.26);

    --font-sans: "Inter", "Segoe UI", Arial, system-ui, sans-serif;
    --font-heading: "DM Sans", "Inter", "Segoe UI", Arial, system-ui, sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    background: var(--bg);
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font-family: var(--font-sans);
    line-height: 1.5;
}

img {
    display: block;
    max-width: 100%;
}

input,
button {
    font: inherit;
}

a {
    color: var(--horizon-blue);
    text-underline-offset: 2px;
}

a:hover {
    color: #093758;
}

:focus-visible {
    outline: 3px solid var(--freshwater-blue);
    outline-offset: 2px;
}

::selection {
    background: rgba(var(--harvest-orange-rgb), 0.28);
}

.shell-wrap {
    margin: 0 auto;
}

.shell-wrap--wide {
    width: min(1160px, calc(100% - 28px));
}

.shell-wrap--narrow {
    width: min(880px, calc(100% - 28px));
}

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

.is-hidden {
    display: none !important;
}

.skip-link {
    position: absolute;
    left: 14px;
    top: 10px;
    z-index: 300;
    padding: 10px 14px;
    background: var(--harvest-orange);
    color: var(--horizon-blue);
    font-weight: 700;
    text-decoration: none;
    transform: translateY(-160%);
    transition: transform 0.2s ease;
}

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

.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 250;
    display: grid;
    place-items: center;
    gap: 16px;
    background: rgba(0, 0, 0, 0.34);
    color: #ffffff;
    text-align: center;
}

.loading-overlay__spinner {
    width: 68px;
    height: 68px;
    border: 6px solid rgba(255, 255, 255, 0.28);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

.loading-overlay p {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.site-header {
    background: #ffffff;
    border-bottom: 1px solid rgba(var(--horizon-blue-rgb), 0.08);
}

.official-banner {
    background: #f3f6f8;
    border-bottom: 1px solid rgba(var(--horizon-blue-rgb), 0.08);
}

.official-banner__inner {
    padding: 10px 0;
}

.official-banner__details summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.92rem;
    font-weight: 600;
    list-style: none;
}

.official-banner__details summary::-webkit-details-marker {
    display: none;
}

.official-banner__summary-link {
    color: var(--horizon-blue);
    font-weight: 700;
    text-decoration: underline;
}

.official-banner__panel {
    margin-top: 10px;
    padding: 14px 16px;
    border: 1px solid rgba(var(--horizon-blue-rgb), 0.14);
    background: #ffffff;
}

.official-banner__panel p {
    margin: 0;
    color: var(--muted);
    font-size: 0.93rem;
    line-height: 1.6;
}

.official-banner__panel p + p {
    margin-top: 10px;
}

.identity-bar {
    background: var(--horizon-blue);
}

.identity-bar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 8px 0;
}

.identity-bar__brand {
    display: inline-flex;
    align-items: center;
    max-width: 245px;
    text-decoration: none;
}

.identity-bar__note {
    margin: 0;
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.9rem;
    font-weight: 600;
}

.page-main {
    padding: 20px 0 44px;
}

.hero {
    padding: 16px 0 6px;
    text-align: center;
}

.hero__state-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 0 0 10px;
    color: var(--horizon-blue);
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
}

.hero__state-mark::before,
.hero__state-mark::after {
    content: "";
    width: 102px;
    height: 2px;
    background: var(--harvest-orange);
}

.hero__title {
    margin: 0 auto;
    color: var(--horizon-blue);
    font-family: var(--font-heading);
    font-weight: 700;
    text-transform: uppercase;
    line-height: 0.9;
}

.hero__line {
    display: block;
    font-size: 6.2rem;
}

.hero__line--bottom {
    margin-top: -4px;
    display: inline-block;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--harvest-orange);
}

.hero__intro {
    width: min(620px, 100%);
    margin: 14px auto 0;
    color: var(--muted);
    font-size: 0.96rem;
    line-height: 1.45;
}

.instructions {
    width: min(700px, 100%);
    margin: 14px auto 0;
    padding-top: 2px;
}

.instructions__welcome {
    width: min(620px, 100%);
    margin: 0 auto 16px;
    color: var(--fg);
    text-align: center;
    font-size: 0.94rem;
    line-height: 1.5;
}

.instructions__welcome span {
    color: var(--horizon-blue);
    font-weight: 700;
}

.instructions__row {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
    padding: 6px 0;
}

.instructions__row h3 {
    margin: 0;
    color: var(--horizon-blue);
    font-family: var(--font-heading);
    font-size: 0.92rem;
    font-weight: 700;
    text-align: right;
    text-transform: uppercase;
}

.instructions__row p {
    margin: 0;
    padding-left: 14px;
    border-left: 3px solid var(--summer-green);
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.45;
}

.calculator-section {
    width: min(820px, 100%);
    margin: 18px auto 0;
}

.calculator-card {
    border: 3px solid #4e453d;
    background: #ffffff;
}

.calculator-card__header {
    padding: 10px 18px;
    background: var(--harvest-orange);
}

.calculator-card__header h2 {
    margin: 0;
    color: var(--horizon-blue);
    font-family: var(--font-heading);
    font-size: 0.92rem;
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
}

.calculator-helper {
    margin: 6px 0 0;
    color: #4e453d;
    text-align: center;
    font-size: 0.78rem;
    line-height: 1.4;
}

.shared-wage {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 18px 12px;
    border-bottom: 1px solid var(--line);
    background: #fbf7ee;
}

.shared-wage label {
    color: var(--horizon-blue);
    font-family: var(--font-heading);
    font-size: 0.86rem;
    font-weight: 700;
    text-transform: uppercase;
}

.shared-wage__help,
.shared-wage__feedback,
.comparison-actions__note {
    margin: 0;
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.45;
}

.shared-wage__input {
    width: min(300px, 100%);
    min-height: 40px;
    padding: 0 13px;
    border: 2px solid var(--harvest-orange);
    background: #ffffff;
    color: var(--fg);
    font-size: 0.94rem;
}

.shared-wage__input::placeholder,
.combobox__input::placeholder {
    color: #8a837a;
}

.shared-wage__input:focus,
.combobox__input:focus {
    outline: none;
}

.shared-wage__input:focus {
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.shared-wage__input[aria-invalid="true"] {
    border-color: var(--rustic-brown);
    box-shadow: 0 0 0 3px rgba(var(--rustic-brown-rgb), 0.16);
}

.shared-wage__feedback--invalid {
    color: #6f2227;
    font-weight: 600;
}

.info-row {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(150px, 1.4fr) minmax(150px, 1.4fr);
    gap: 16px;
    padding: 10px 18px 6px;
}

.info-row__cell h3 {
    margin: 0;
    color: #7a5010;
    font-family: var(--font-heading);
    font-size: 0.74rem;
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
}

.scenario-list {
    padding: 0 18px;
}

.scenario-row {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(150px, 1.4fr) minmax(150px, 1.4fr);
    gap: 16px;
    align-items: center;
    padding: 10px 0 8px;
    border-top: 1px solid var(--line);
}

.scenario-row:first-child {
    border-top: 0;
}

.scenario-row__cell {
    min-width: 0;
}

.scenario-row__cell--location {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.scenario-row__cell--output {
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.row-label {
    margin: 0;
    color: #7a5010;
    font-family: var(--font-heading);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.01em;
}

.row-label--anchor {
    color: var(--horizon-blue);
}

.info-mobile {
    display: none;
    margin: 0 0 6px;
    color: var(--horizon-blue);
    font-family: var(--font-heading);
    font-size: 0.84rem;
    font-weight: 700;
    text-transform: uppercase;
}

.combobox__input {
    width: 100%;
    min-height: 38px;
    padding: 0 11px;
    background: #ffffff;
    color: var(--fg);
    font-size: 0.9rem;
}

.shared-wage__input:disabled,
.combobox__input:disabled,
.combobox__toggle:disabled,
.comparison-actions__button:disabled {
    cursor: not-allowed;
    opacity: 0.62;
}

.combobox {
    position: relative;
}

.combobox__field {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--line-strong);
    background: #ffffff;
}

.combobox__field:focus-within {
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.combobox__input {
    border: 0;
    box-shadow: none;
}

.combobox__toggle {
    flex: 0 0 38px;
    border: 0;
    border-left: 1px solid rgba(var(--horizon-blue-rgb), 0.12);
    background: #f8fafb;
    color: var(--horizon-blue);
}

.combobox__listbox {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    z-index: 40;
    max-height: 260px;
    overflow: auto;
    border: 1px solid var(--line-strong);
    background: #ffffff;
    box-shadow: 0 14px 26px rgba(var(--horizon-blue-rgb), 0.14);
}

.combobox__option,
.combobox__empty {
    padding: 10px 12px;
    font-size: 0.95rem;
}

.combobox__option {
    cursor: pointer;
}

.combobox__option:hover,
.combobox__option.is-active {
    background: var(--soft-blue);
}

.combobox__option[aria-selected="true"] {
    background: var(--soft-orange);
}

.combobox__empty {
    color: var(--muted);
}

.combobox.is-invalid .combobox__field {
    border-color: var(--rustic-brown);
    box-shadow: 0 0 0 3px rgba(var(--rustic-brown-rgb), 0.16);
}

.output-value {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 10px;
    margin: 0;
    color: var(--horizon-blue);
    border: 1px solid rgba(var(--harvest-orange-rgb), 0.7);
    background: #ffffff;
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.1;
    text-align: center;
}

.output-value--strong {
    border-color: #4e453d;
    background: #4e453d;
    color: #ffffff;
    font-weight: 700;
}

.output-value:empty::before {
    content: "$";
    color: #92867d;
    font-weight: 600;
}

.output-value--strong:empty::before {
    color: rgba(255, 255, 255, 0.84);
}

.row-message {
    grid-column: 1 / -1;
    min-height: 1.3rem;
    margin: 0;
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.4;
}

.row-message--error {
    color: #6f2227;
    font-weight: 600;
}

.comparison-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 18px;
    padding: 8px 18px 0;
}

.comparison-actions__button {
    min-height: 38px;
    padding: 0 16px;
    border: 1px solid var(--harvest-orange);
    background: #ffffff;
    color: #7a5010;
    font-family: var(--font-heading);
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
}

.comparison-actions__button:hover:not(:disabled),
.comparison-actions__button:focus-visible:not(:disabled) {
    background: rgba(var(--harvest-orange-rgb), 0.14);
    color: #7a5010;
}

.calculator-card__footer {
    padding: 6px 18px 14px;
}

.form-note {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.4;
    text-align: center;
}

.status-banner {
    margin-top: 10px;
    padding: 10px 12px;
    border-left: 4px solid transparent;
    font-size: 0.84rem;
    line-height: 1.4;
}

.status-banner p,
.status-banner ul {
    margin: 0;
}

.status-banner ul {
    padding-left: 18px;
}

.status-banner li + li {
    margin-top: 4px;
}

.status-banner strong {
    display: block;
    margin-bottom: 4px;
}

.status-banner--info {
    background: var(--soft-blue);
    border-left-color: var(--freshwater-blue);
    color: var(--horizon-blue);
}

.status-banner--success {
    background: var(--soft-green);
    border-left-color: var(--summer-green);
    color: #27420f;
}

.status-banner--error {
    background: var(--soft-error);
    border-left-color: var(--rustic-brown);
    color: #6f2227;
}

.trust-panel {
    margin-top: 14px;
    padding-top: 8px;
}

.statement {
    margin: 0;
    color: var(--horizon-blue);
    font-family: var(--font-heading);
    font-size: 0.88rem;
    font-weight: 700;
    text-align: center;
}

.trust-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-top: 18px;
}

.trust-item {
    padding-top: 10px;
    border-top: 3px solid var(--summer-green);
}

.trust-item h3 {
    margin: 0;
    color: var(--horizon-blue);
    font-family: var(--font-heading);
    font-size: 0.92rem;
    font-weight: 700;
}

.trust-item p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.55;
}

.page-actions {
    display: flex;
    justify-content: center;
    gap: 18px;
    margin-top: 18px;
}

.page-actions__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 144px;
    min-height: 36px;
    padding: 0 16px;
    border: 1px solid var(--harvest-orange);
    background: #ffffff;
    color: #7a5010;
    font-family: var(--font-heading);
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    text-transform: uppercase;
}

.page-actions__button:hover,
.page-actions__button:focus-visible {
    background: rgba(var(--harvest-orange-rgb), 0.14);
    color: #7a5010;
}

.content-section {
    margin-top: 34px;
    padding-top: 16px;
    border-top: 2px solid var(--harvest-orange);
}

#learn-more {
    border-top-color: var(--summer-green);
}

.content-section__header h2 {
    margin: 0;
    color: var(--horizon-blue);
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
}

.content-section__body {
    margin-top: 16px;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.64;
}

.content-section__body h3 {
    margin: 18px 0 6px;
    color: var(--horizon-blue);
    font-family: var(--font-heading);
    font-size: 0.98rem;
    font-weight: 700;
}

.content-section__body p {
    margin: 0;
}

.content-section__body p + p {
    margin-top: 10px;
}

.formula-block {
    margin: 10px 0 0;
    padding: 14px;
    overflow-x: auto;
    border: 1px solid var(--line);
    background: #f8fafb;
    color: var(--fg);
    font-family: "SFMono-Regular", ui-monospace, "Cascadia Code", "Roboto Mono", monospace;
    font-size: 0.88rem;
    line-height: 1.6;
}

.site-footer {
    margin-top: 42px;
    padding: 22px 0 28px;
    background: var(--horizon-blue);
    color: #ffffff;
}

.site-footer__inner {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr) auto;
    gap: 24px;
    align-items: center;
}

.site-footer__logo {
    max-width: 220px;
}

.site-footer__copy {
    font-size: 0.95rem;
    line-height: 1.65;
}

.site-footer__copy p {
    margin: 0;
}

.site-footer__title {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
}

.site-footer__links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.site-footer__links a {
    color: rgba(255, 255, 255, 0.92);
    text-decoration: none;
}

.site-footer__links a:hover,
.site-footer__links a:focus-visible {
    color: #ffffff;
    text-decoration: underline;
}

@media (max-width: 991px) {
    .hero__line {
        font-size: 4.8rem;
    }

    .instructions__row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .instructions__row h3 {
        text-align: left;
    }

    .info-row {
        display: none;
    }

    .scenario-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .info-mobile {
        display: block;
    }

    .output-value {
        justify-content: flex-start;
        text-align: left;
    }

    .trust-grid,
    .site-footer__inner {
        grid-template-columns: 1fr;
    }

    .site-footer__links {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 12px 16px;
    }
}

@media (max-width: 760px) {
    .identity-bar__inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-main {
        padding: 18px 0 38px;
    }

    .hero__line {
        font-size: 3.8rem;
    }

    .hero__state-mark::before,
    .hero__state-mark::after {
        width: 64px;
    }

    .hero__intro,
    .instructions__welcome {
        font-size: 0.92rem;
    }

    .calculator-card__header,
    .shared-wage,
    .scenario-list,
    .comparison-actions,
    .calculator-card__footer {
        padding-left: 16px;
        padding-right: 16px;
    }

    .page-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .page-actions__button {
        width: 100%;
    }
}

@media (max-width: 540px) {
    .shell-wrap--wide,
    .shell-wrap--narrow {
        width: min(980px, calc(100% - 22px));
    }

    .hero__line {
        font-size: 3.2rem;
    }

    .hero__state-mark {
        gap: 8px;
        font-size: 0.84rem;
    }

    .hero__state-mark::before,
    .hero__state-mark::after {
        width: 36px;
    }

    .statement {
        font-size: 0.82rem;
    }

    .output-value {
        font-size: 0.96rem;
    }
}
