.thg-calc {
    --thg-black: #0b0d0e;
    --thg-bg: #101214;
    --thg-panel: #1b1f22;
    --thg-panel-2: #22272b;
    --thg-input: #272c30;
    --thg-gold: #d0af58;
    --thg-gold-light: #ead79d;
    --thg-gold-deep: #886a1f;
    --thg-paper: #f5f5f2;
    --thg-white: #ffffff;
    --thg-muted: #b8c0c5;
    --thg-line: rgba(208, 175, 88, .3);
    --thg-error: #ff8c86;
    --thg-success: #7ed9a5;
    width: 100%;
    margin-left: 0;
    overflow: hidden;
    background: var(--thg-bg);
    color: var(--thg-paper);
    font: 16px/1.55 Arial, Helvetica, sans-serif;
}

.thg-calc *,
.thg-calc *::before,
.thg-calc *::after {
    box-sizing: border-box;
}

.thg-calc [hidden] {
    display: none !important;
}

.thg-calc__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;
}

.thg-calc button,
.thg-calc input {
    font: inherit;
}

.thg-calc button,
.thg-calc summary,
.thg-calc label,
.thg-calc a {
    -webkit-tap-highlight-color: transparent;
}

.thg-calc button:focus-visible,
.thg-calc input:focus-visible,
.thg-calc summary:focus-visible,
.thg-calc a:focus-visible {
    outline: 3px solid var(--thg-gold-light);
    outline-offset: 3px;
}

.thg-calc h1,
.thg-calc h2,
.thg-calc h3,
.thg-calc p {
    margin-top: 0;
}

.thg-calc a {
    color: var(--thg-gold-light);
    text-underline-offset: 4px;
}

.thg-calc__hero {
    position: relative;
    min-height: 360px;
    display: grid;
    align-items: center;
    padding: clamp(44px, 7vw, 84px) clamp(20px, 6vw, 80px) 92px;
    isolation: isolate;
    background:
        radial-gradient(circle at 14% 10%, rgba(208, 175, 88, .16), transparent 28rem),
        radial-gradient(circle at 92% 78%, rgba(136, 106, 31, .2), transparent 32rem),
        linear-gradient(145deg, #090b0c 0%, #171b1e 52%, #0e1113 100%);
    border-bottom: 1px solid var(--thg-line);
}

.thg-calc__hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    opacity: .22;
    background-image:
        linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: linear-gradient(to bottom, #000, transparent);
}

.thg-calc__hero-copy,
.thg-calc__page {
    width: min(1180px, 100%);
    margin-inline: auto;
}

.thg-calc__hero-copy {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: clamp(26px, 4vw, 54px);
    align-items: center;
}

.thg-calc__emblem {
    display: block;
    width: 100%;
    height: auto;
    max-height: 190px;
    object-fit: contain;
    filter: drop-shadow(0 10px 26px rgba(208, 175, 88, .14));
}

.thg-calc__eyebrow {
    margin-bottom: 10px;
    color: var(--thg-gold);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.thg-calc h1 {
    max-width: 900px;
    margin-bottom: 16px;
    color: var(--thg-white);
    font-size: clamp(36px, 5.3vw, 68px);
    line-height: .98;
    letter-spacing: -.045em;
}

.thg-calc__lead {
    max-width: 760px;
    margin-bottom: 20px;
    color: #dde2e4;
    font-size: clamp(17px, 2vw, 21px);
}

.thg-calc__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.thg-calc__badges span {
    display: inline-flex;
    min-height: 30px;
    align-items: center;
    border: 1px solid var(--thg-line);
    border-radius: 999px;
    padding: 5px 11px;
    color: var(--thg-gold-light);
    font-size: 12px;
    font-weight: 700;
}

.thg-calc__page {
    position: relative;
    z-index: 1;
    padding: 0 20px 72px;
}

.thg-calc__workbench,
.thg-calc__scenario,
.thg-calc__guide,
.thg-calc__method {
    border: 1px solid var(--thg-line);
    background: var(--thg-panel);
    box-shadow: 0 24px 70px rgba(0, 0, 0, .22);
}

.thg-calc__workbench {
    margin-top: -48px;
    padding: clamp(22px, 4vw, 48px);
}

.thg-calc__section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 30px;
    margin-bottom: 28px;
    padding-bottom: 22px;
    border-bottom: 1px solid rgba(255,255,255,.12);
}

.thg-calc__section-head h2,
.thg-calc__method h2 {
    margin-bottom: 0;
    color: var(--thg-white);
    font-size: clamp(28px, 3.7vw, 44px);
    line-height: 1.06;
    letter-spacing: -.03em;
}

.thg-calc__section-head > p {
    max-width: 440px;
    margin-bottom: 0;
    color: var(--thg-muted);
}

.thg-calc__mode-fieldset {
    min-width: 0;
    margin: 0 0 34px;
    border: 0;
    padding: 0;
}

.thg-calc__modes {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.thg-calc__mode {
    position: relative;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    align-items: center;
    min-height: 86px;
    gap: 13px;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 8px;
    background: var(--thg-input);
    padding: 14px;
    transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.thg-calc__mode:hover {
    border-color: var(--thg-gold);
    transform: translateY(-1px);
}

.thg-calc__mode:has(input:checked) {
    border-color: var(--thg-gold);
    background: linear-gradient(135deg, rgba(208,175,88,.18), rgba(39,44,48,.95));
    box-shadow: inset 0 0 0 1px rgba(208,175,88,.25);
}

.thg-calc__mode input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.thg-calc__mode:has(input:focus-visible) {
    outline: 3px solid var(--thg-gold-light);
    outline-offset: 3px;
}

.thg-calc__mode-icon {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border: 1px solid var(--thg-line);
    border-radius: 50%;
    color: var(--thg-gold-light);
    font-size: 24px;
    line-height: 1;
}

.thg-calc__mode strong,
.thg-calc__mode small {
    display: block;
}

.thg-calc__mode strong {
    color: var(--thg-white);
    font-size: 16px;
}

.thg-calc__mode small {
    margin-top: 2px;
    color: var(--thg-muted);
    font-size: 12px;
}

.thg-calc__layout {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr);
    gap: clamp(28px, 5vw, 62px);
    align-items: start;
}

.thg-calc__mode-copy {
    margin-bottom: 24px;
    border-left: 3px solid var(--thg-gold);
    padding: 10px 0 10px 14px;
    color: #dce1e3;
}

.thg-calc__fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 18px;
}

.thg-calc__fields--compact {
    margin-top: 18px;
}

.thg-calc__field label {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 7px;
    color: var(--thg-white);
    font-size: 14px;
    font-weight: 700;
}

.thg-calc__field label small {
    color: var(--thg-muted);
    font-size: 11px;
    font-weight: 400;
}

.thg-calc__input-wrap {
    display: flex;
    min-height: 54px;
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 5px;
    background: var(--thg-input);
    overflow: hidden;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.thg-calc__input-wrap:focus-within {
    border-color: var(--thg-gold);
    box-shadow: 0 0 0 3px rgba(208,175,88,.14);
}

.thg-calc__input-wrap:has(input[aria-invalid="true"]) {
    border-color: var(--thg-error);
}

.thg-calc__input-wrap input {
    min-width: 0;
    flex: 1;
    border: 0;
    outline: 0;
    background: transparent;
    padding: 12px 14px;
    color: var(--thg-white);
    font-size: 19px;
    font-weight: 700;
}

.thg-calc__field select {
    width: 100%;
    min-height: 48px;
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 5px;
    background: var(--thg-input);
    padding: 10px 12px;
    color: var(--thg-white);
    font: inherit;
}

.thg-calc__field select:focus-visible,
.thg-calc__area-presets button:focus-visible,
.thg-calc__inline-action:focus-visible {
    outline: 3px solid var(--thg-gold-light);
    outline-offset: 2px;
}

.thg-calc__field select[aria-invalid="true"] {
    border-color: var(--thg-error);
}

.thg-calc__input-wrap span {
    display: grid;
    place-items: center;
    border-left: 1px solid rgba(255,255,255,.14);
    padding: 8px 11px;
    color: var(--thg-muted);
    font-size: 11px;
    white-space: nowrap;
}

.thg-calc__field > small:not(.thg-calc__error) {
    display: block;
    margin-top: 6px;
    color: var(--thg-muted);
    font-size: 11px;
    line-height: 1.45;
}

.thg-calc__error {
    display: block;
    min-height: 17px;
    margin-top: 5px;
    color: var(--thg-error);
    font-size: 11px;
    line-height: 1.4;
}

.thg-calc__field-help {
    margin-top: 8px;
    color: var(--thg-muted);
    font-size: 12px;
}

.thg-calc__field-help summary,
.thg-calc__optional summary,
.thg-calc__result-details summary,
.thg-calc__faq summary {
    cursor: pointer;
    color: var(--thg-gold-light);
    font-weight: 700;
}

.thg-calc__field-help p,
.thg-calc__optional p {
    margin: 8px 0 0;
}

.thg-calc__optional {
    margin-top: 24px;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 6px;
    background: rgba(0,0,0,.14);
    padding: 16px;
}

.thg-calc__optional > p {
    color: var(--thg-muted);
    font-size: 12px;
}

.thg-calc__area-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.thg-calc__area-presets button,
.thg-calc__inline-action {
    min-height: 38px;
    border: 1px solid rgba(208,175,88,.55);
    border-radius: 4px;
    background: rgba(208,175,88,.09);
    padding: 7px 10px;
    color: var(--thg-gold-light);
    font: inherit;
    cursor: pointer;
}

.thg-calc__inline-action {
    min-height: 0;
    border: 0;
    padding: 0;
    text-decoration: underline;
}

.thg-calc__example-note {
    margin: 22px 0 0;
    border-left: 3px solid var(--thg-gold);
    background: rgba(208,175,88,.1);
    padding: 10px 13px;
    color: var(--thg-gold-light);
    font-size: 12px;
}

.thg-calc__form-actions,
.thg-calc__result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 26px;
}

.thg-calc__button {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,.26);
    border-radius: 5px;
    background: transparent;
    padding: 10px 16px;
    color: var(--thg-white);
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    transition: border-color .18s ease, background .18s ease, color .18s ease;
}

.thg-calc__button:hover:not(:disabled) {
    border-color: var(--thg-gold);
    background: rgba(208,175,88,.1);
}

.thg-calc__button--primary {
    border-color: var(--thg-gold);
    background: var(--thg-gold);
    color: #121416;
}

.thg-calc__button--primary:hover:not(:disabled) {
    background: var(--thg-gold-light);
    color: #0b0d0e;
}

.thg-calc__button--quiet {
    border-color: transparent;
    color: var(--thg-muted);
}

.thg-calc__button:disabled {
    cursor: not-allowed;
    opacity: .45;
}

.thg-calc__result {
    position: sticky;
    top: 20px;
    min-height: 430px;
    border: 1px solid rgba(208,175,88,.5);
    border-radius: 9px;
    background:
        radial-gradient(circle at 80% 5%, rgba(208,175,88,.14), transparent 16rem),
        linear-gradient(160deg, #171b1e, #0d0f11);
    padding: clamp(22px, 3vw, 34px);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.025), 0 20px 42px rgba(0,0,0,.26);
}

.thg-calc__result-top {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,.12);
    padding-bottom: 15px;
}

.thg-calc__result-top p {
    margin-bottom: 0;
}

.thg-calc__result-top > span {
    color: var(--thg-muted);
    font-size: 11px;
    text-align: right;
}

.thg-calc__result-empty {
    display: grid;
    min-height: 300px;
    align-content: center;
    text-align: center;
}

.thg-calc__result-empty h3 {
    margin-bottom: 10px;
    color: var(--thg-white);
    font-size: 24px;
}

.thg-calc__result-empty p {
    margin-bottom: 0;
    color: var(--thg-muted);
}

.thg-calc__display {
    padding: 28px 0 24px;
}

.thg-calc__display > span,
.thg-calc__display > strong,
.thg-calc__display > small {
    display: block;
}

.thg-calc__display > span {
    margin-bottom: 2px;
    color: var(--thg-muted);
    font-size: 13px;
}

.thg-calc__display > strong {
    color: var(--thg-white);
    font-size: clamp(54px, 7vw, 82px);
    line-height: 1;
    letter-spacing: -.055em;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.thg-calc__display > small {
    margin-top: 5px;
    color: var(--thg-gold-light);
    font-size: 14px;
}

.thg-calc__comparison {
    margin-bottom: 18px;
    border-left: 3px solid var(--thg-gold);
    background: rgba(208,175,88,.09);
    padding: 10px 12px;
    color: var(--thg-gold-light);
    font-size: 13px;
}

.thg-calc__result-grid,
.thg-calc__result-details > div {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-top: 1px solid rgba(255,255,255,.12);
    border-left: 1px solid rgba(255,255,255,.12);
}

.thg-calc__metric {
    min-width: 0;
    border-right: 1px solid rgba(255,255,255,.12);
    border-bottom: 1px solid rgba(255,255,255,.12);
    padding: 14px;
}

.thg-calc__metric span,
.thg-calc__metric strong,
.thg-calc__metric small {
    display: block;
}

.thg-calc__metric span {
    color: var(--thg-muted);
    font-size: 10px;
}

.thg-calc__metric strong {
    margin-top: 3px;
    color: var(--thg-white);
    font-size: 20px;
    line-height: 1.15;
    overflow-wrap: anywhere;
    font-variant-numeric: tabular-nums;
}

.thg-calc__metric small {
    margin-top: 3px;
    color: var(--thg-muted);
    font-size: 9px;
}

.thg-calc__result-details {
    margin-top: 18px;
}

.thg-calc__result-details > div {
    margin-top: 12px;
}

.thg-calc__status {
    min-height: 20px;
    margin: 16px 0 0;
    color: var(--thg-muted);
    font-size: 12px;
}

.thg-calc__status[data-kind="success"] {
    color: var(--thg-success);
}

.thg-calc__status[data-kind="error"] {
    color: var(--thg-error);
}

.thg-calc__result-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.thg-calc__result-actions .thg-calc__button {
    width: 100%;
    font-size: 12px;
}

.thg-calc__next {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    margin-top: 20px;
    border-top: 1px solid rgba(255,255,255,.12);
    padding-top: 18px;
    font-size: 12px;
}

.thg-calc__next span {
    width: 100%;
    color: var(--thg-muted);
    font-size: 10px;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.thg-calc__scenario,
.thg-calc__guide,
.thg-calc__method {
    margin-top: 28px;
    padding: clamp(22px, 4vw, 42px);
}

.thg-calc__scenario-table {
    display: grid;
    grid-template-columns: 150px repeat(2, minmax(0, 1fr));
    border-top: 1px solid rgba(255,255,255,.14);
    border-left: 1px solid rgba(255,255,255,.14);
}

.thg-calc__scenario-table > div {
    border-right: 1px solid rgba(255,255,255,.14);
    border-bottom: 1px solid rgba(255,255,255,.14);
    padding: 12px;
    overflow-wrap: anywhere;
}

.thg-calc__scenario-table strong {
    color: var(--thg-white);
}

.thg-calc__scenario-table span {
    color: var(--thg-muted);
}

.thg-calc__range-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.thg-calc__range-grid > div {
    min-height: 148px;
    border: 1px solid rgba(255,255,255,.14);
    border-top: 3px solid var(--thg-gold);
    background: var(--thg-panel-2);
    padding: 18px;
}

.thg-calc__range-grid strong,
.thg-calc__range-grid span,
.thg-calc__range-grid small {
    display: block;
}

.thg-calc__range-grid strong {
    color: var(--thg-gold-light);
    font-size: 34px;
    line-height: 1;
}

.thg-calc__range-grid span {
    margin-top: 8px;
    color: var(--thg-white);
    font-weight: 700;
}

.thg-calc__range-grid small {
    margin-top: 5px;
    color: var(--thg-muted);
}

.thg-calc__source-note {
    margin: 18px 0 0;
    color: var(--thg-muted);
    font-size: 12px;
}

.thg-calc__method {
    display: grid;
    grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
    gap: clamp(30px, 6vw, 76px);
}

.thg-calc__method > div > p:not(.thg-calc__eyebrow) {
    color: var(--thg-muted);
}

.thg-calc__sources,
.thg-calc__faq ul {
    padding-left: 20px;
}

.thg-calc__sources li + li,
.thg-calc__faq li + li {
    margin-top: 7px;
}

.thg-calc__faq details {
    border-top: 1px solid rgba(255,255,255,.14);
    padding: 15px 2px;
}

.thg-calc__faq details:last-of-type {
    border-bottom: 1px solid rgba(255,255,255,.14);
}

.thg-calc__faq details p {
    margin: 10px 0 0;
    color: var(--thg-muted);
}

.thg-calc__faq h3 {
    margin: 24px 0 10px;
    color: var(--thg-white);
}

.thg-calc__preview {
    width: min(620px, calc(100% - 28px));
    max-height: calc(100vh - 28px);
    border: 1px solid var(--thg-gold);
    border-radius: 10px;
    background: var(--thg-panel);
    padding: 0;
    color: var(--thg-paper);
}

.thg-calc__preview::backdrop {
    background: rgba(0,0,0,.78);
}

.thg-calc__preview > div {
    padding: 20px;
}

.thg-calc__preview-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.thg-calc__preview-head h2 {
    margin: 0;
    color: var(--thg-white);
}

.thg-calc__preview-head button {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border: 0;
    background: transparent;
    color: var(--thg-white);
    font-size: 30px;
}

.thg-calc__preview p {
    color: var(--thg-muted);
    font-size: 12px;
}

.thg-calc__preview img {
    display: block;
    width: min(100%, 360px);
    max-height: 62vh;
    margin: 0 auto 16px;
    object-fit: contain;
    background: #090b0c;
}

.thg-calc__preview .thg-calc__button {
    width: 100%;
}

@media (max-width: 900px) {
    .thg-calc__hero-copy {
        grid-template-columns: 112px minmax(0, 1fr);
    }

    .thg-calc__layout,
    .thg-calc__method {
        grid-template-columns: 1fr;
    }

    .thg-calc__result {
        position: static;
    }

    .thg-calc__range-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .thg-calc__hero {
        min-height: 0;
        padding: 28px 20px 70px;
    }

    .thg-calc__hero-copy {
        grid-template-columns: 74px minmax(0, 1fr);
        gap: 16px;
        align-items: start;
    }

    .thg-calc__emblem {
        max-height: 94px;
    }

    .thg-calc h1 {
        font-size: clamp(30px, 9vw, 42px);
        line-height: 1;
    }

    .thg-calc__lead {
        grid-column: 1 / -1;
        font-size: 16px;
    }

    .thg-calc__badges {
        grid-column: 1 / -1;
    }

    .thg-calc__page {
        padding-inline: 10px;
    }

    .thg-calc__workbench {
        margin-top: -38px;
        padding: 20px 15px 24px;
    }

    .thg-calc__section-head {
        display: block;
        margin-bottom: 20px;
    }

    .thg-calc__section-head > p {
        margin: 12px 0 0;
        font-size: 13px;
    }

    .thg-calc__modes {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
    }

    .thg-calc__mode {
        display: flex;
        min-height: 92px;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        padding: 9px 5px;
        text-align: center;
    }

    .thg-calc__mode-icon {
        width: 38px;
        height: 38px;
        font-size: 19px;
    }

    .thg-calc__mode strong {
        font-size: 12px;
    }

    .thg-calc__mode small {
        display: none;
    }

    .thg-calc__fields,
    .thg-calc__result-grid,
    .thg-calc__result-details > div,
    .thg-calc__result-actions,
    .thg-calc__range-grid {
        grid-template-columns: 1fr;
    }

    .thg-calc__form-actions .thg-calc__button {
        width: 100%;
    }

    .thg-calc__result {
        min-height: 0;
        padding: 20px 16px;
    }

    .thg-calc__scenario,
    .thg-calc__guide,
    .thg-calc__method {
        margin-top: 16px;
        padding: 22px 16px;
    }

    .thg-calc__scenario-table {
        grid-template-columns: 105px repeat(2, minmax(0, 1fr));
        font-size: 12px;
    }

    .thg-calc__scenario-table > div {
        padding: 9px 7px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .thg-calc *,
    .thg-calc *::before,
    .thg-calc *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}

@media print {
    .thg-calc__result-actions,
    .thg-calc__form-actions,
    .thg-calc__next,
    .thg-calc__preview {
        display: none !important;
    }
}
