:root {
    --bg: #f6f8fb;
    --surface: #ffffff;
    --surface-soft: #eef4fb;
    --text: #182230;
    --muted: #667085;
    --line: #d9e2ec;
    --brand: #1f6feb;
    --brand-dark: #174ea6;
    --brand-soft: #e8f1ff;
    --accent: #f2b705;
    --ok: #087443;
    --danger: #b42318;
    --shadow: 0 16px 40px rgba(24, 34, 48, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

img,
svg {
    max-width: 100%;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
}

.nav {
    max-width: 1180px;
    margin: 0 auto;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    letter-spacing: 0;
}

.brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--brand);
    font-weight: 900;
}

.nav-links-wrap {
    display: flex;
    align-items: center;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 8px;
    border: 1px solid #c7d7f2;
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #edf4ff 100%);
    box-shadow: 0 12px 28px rgba(31, 111, 235, 0.12);
}


.nav-links a {
    min-height: 42px;
    padding: 10px 14px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #4a5b78;
    font-size: 14px;
    font-weight: 800;
    transition: background-color 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.nav-links a:hover {
    color: var(--brand-dark);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 6px 14px rgba(31, 111, 235, 0.12);
    transform: translateY(-1px);
}

.nav-links a.active {
    color: #fff;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
    box-shadow: 0 8px 18px rgba(23, 78, 166, 0.28);
}

.hero,
.section,
.tool-shell,
.footer-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding-left: 20px;
    padding-right: 20px;
}

.hero {
    padding-top: 48px;
    padding-bottom: 24px;
}

.page-intro {
    margin-bottom: 18px;
}

.page-intro h1 {
    margin: 0 0 6px;
    font-size: clamp(34px, 5vw, 52px);
}

.page-intro p {
    margin: 0;
    color: var(--muted);
    font-size: 18px;
}

.intro-stack {
    display: grid;
    gap: 14px;
}

.trust-strip {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.trust-pill {
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid #d6e3f7;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    background: #fff;
    color: #3e516f;
    font-size: 13px;
    font-weight: 750;
}

.tool-intro {
    max-width: 1180px;
    margin: 0 auto;
    padding: 34px 20px 8px;
}

.tool-intro h1 {
    margin: 8px 0 8px;
    font-size: clamp(34px, 5vw, 52px);
}

.tool-intro p {
    max-width: 720px;
    margin: 0;
    color: var(--muted);
    font-size: 18px;
}

.breadcrumb {
    margin-bottom: 18px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 14px;
}

.breadcrumb a {
    color: var(--brand-dark);
    font-weight: 650;
}

.eyebrow {
    color: var(--brand-dark);
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
}

h1,
h2,
h3 {
    line-height: 1.18;
    letter-spacing: 0;
}

h1 {
    margin: 10px 0 16px;
    max-width: 850px;
    font-size: clamp(36px, 6vw, 64px);
}

.lead {
    max-width: 760px;
    color: var(--muted);
    font-size: 19px;
}

.hero-actions {
    margin-top: 24px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.button {
    min-height: 44px;
    padding: 10px 15px;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #fff;
    color: var(--text);
    font-weight: 750;
    cursor: pointer;
}

.button.primary {
    border-color: var(--brand);
    background: var(--brand);
    color: #fff;
}

.button-link {
    text-align: center;
}

.button:hover {
    transform: translateY(-1px);
}

.tool-shell {
    padding-top: 12px;
    padding-bottom: 42px;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
    gap: 24px;
    align-items: start;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.panel-body {
    padding: 24px;
}

.panel + .panel {
    margin-top: 18px;
}

.panel-title {
    margin: 0 0 16px;
    font-size: 22px;
}

.helper-text {
    margin: -6px 0 18px;
    color: var(--muted);
    font-size: 14px;
}

.panel-kicker {
    margin: 0 0 6px;
    color: var(--brand-dark);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

.type-picker {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.type-option {
    min-height: 94px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    text-align: left;
    cursor: pointer;
}

.type-option strong {
    display: block;
    margin-bottom: 6px;
    font-size: 18px;
}

.type-option span {
    display: block;
    color: var(--muted);
    font-size: 13px;
}

.type-option:hover,
.type-option.active {
    border-color: var(--brand);
    background: var(--brand-soft);
}

.type-option.active strong {
    color: var(--brand-dark);
}

.tool-actions {
    margin-top: 18px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.field {
    display: grid;
    gap: 7px;
}

.field label {
    color: #344054;
    font-size: 14px;
    font-weight: 750;
}

.field-hint {
    margin: -2px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.input-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 132px;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.input-row input,
.input-row select,
.plain-input {
    min-width: 0;
    width: 100%;
    border: 0;
    padding: 11px 12px;
    color: var(--text);
    background: #fff;
    font: inherit;
    font-weight: 650;
    transition: color 160ms ease, background-color 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.input-row input:focus,
.input-row select:focus,
.plain-input:focus {
    outline: none;
}

.input-row select {
    border-left: 1px solid var(--line);
    background: var(--surface-soft);
}

.plain-input {
    border: 1px solid var(--line);
    border-radius: 8px;
}

.input-row:focus-within,
.plain-input:focus {
    border-color: #8bb7ff;
    box-shadow: 0 0 0 4px rgba(31, 111, 235, 0.14);
}

.input-row input.is-pristine,
.plain-input.is-pristine {
    color: var(--muted);
    background: #fbfdff;
}

.input-row:focus-within input.is-pristine,
.plain-input.is-pristine:focus {
    color: var(--text);
}

.range-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
}

input[type="range"] {
    width: 100%;
    accent-color: var(--brand);
}

.diagram {
    min-height: 230px;
    display: grid;
    place-items: center;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.result-panel {
    position: sticky;
    top: 86px;
    color: #fff;
    background: #101828;
    border-color: #101828;
}

.result-panel .panel-body {
    padding: 28px;
}

.result-label {
    margin: 0 0 8px;
    color: #cbd5e1;
    font-size: 14px;
    font-weight: 750;
}

.result-value {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
}

.result-number {
    font-family: "Roboto Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: clamp(42px, 7vw, 68px);
    font-weight: 900;
    line-height: 1;
}

.result-unit {
    color: #93c5fd;
    font-size: 24px;
    font-weight: 850;
}

.result-grid {
    margin-top: 24px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.metric {
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
}

.metric span {
    display: block;
    color: #cbd5e1;
    font-size: 12px;
}

.metric strong {
    display: block;
    margin-top: 5px;
    font-size: 22px;
}

.note {
    margin-top: 18px;
    color: #cbd5e1;
    font-size: 13px;
}

.inline-disclosure {
    margin-top: 14px;
    padding: 14px 16px;
    border: 1px solid #d6e3f7;
    border-radius: 8px;
    background: #f9fbff;
    color: #44536d;
    font-size: 13px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.tool-card,
.result-card,
.link-card {
    display: block;
    padding: 18px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.tool-card:hover,
.link-card:hover {
    border-color: var(--brand);
    box-shadow: var(--shadow);
}

.tool-card strong,
.result-card strong,
.link-card strong {
    display: block;
    margin-bottom: 7px;
    color: var(--text);
    font-size: 18px;
}

.tool-card p,
.result-card p,
.link-card p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.featured-card {
    min-height: 190px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 22px;
    padding: 28px;
}

.featured-card strong {
    font-size: 30px;
    line-height: 1.12;
}

.card-action {
    display: inline-flex;
    width: 100%;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    margin-top: auto;
    padding: 11px 16px;
    border-radius: 8px;
    background: var(--brand);
    color: #fff;
    font-weight: 800;
}

.featured-card:hover .card-action {
    background: var(--brand-dark);
}

.section {
    padding-top: 34px;
    padding-bottom: 34px;
}

.section h2 {
    margin: 0 0 14px;
    font-size: 32px;
}

.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 28px;
    align-items: start;
}

.content-grid-single {
    grid-template-columns: minmax(0, 1fr);
}

.content {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 28px;
}

.content p,
.content li {
    color: var(--muted);
}

.content h3 {
    margin-top: 26px;
}

.content h2:first-child,
.content h3:first-child {
    margin-top: 0;
}

.formula {
    margin: 18px 0;
    padding: 16px;
    border-left: 4px solid var(--brand);
    background: var(--surface-soft);
    border-radius: 8px;
    font-family: "Roboto Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
    font-weight: 750;
}

.sidebar {
    display: grid;
    gap: 14px;
}

.related-calculators {
    margin-top: 34px;
    padding: 22px;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    background: var(--brand-soft);
}

.related-calculators h3 {
    margin-top: 0;
    margin-bottom: 14px;
    color: var(--brand-dark);
}

.calculator-switch-card {
    display: flex;
    min-height: 96px;
    flex-direction: column;
    justify-content: space-between;
    gap: 14px;
    padding: 18px;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    background: #fff;
}

.calculator-switch-card strong {
    color: var(--text);
    font-size: 18px;
}

.calculator-switch-card span {
    display: inline-flex;
    width: fit-content;
    min-height: 36px;
    align-items: center;
    justify-content: center;
    padding: 7px 11px;
    border-radius: 8px;
    background: var(--brand);
    color: #fff;
    font-size: 14px;
    font-weight: 800;
}

.calculator-switch-card:hover {
    border-color: var(--brand);
    box-shadow: var(--shadow);
}

.calculator-switch-card:hover span {
    background: var(--brand-dark);
}

.footer {
    margin-top: 40px;
    background: #101828;
    color: #cbd5e1;
}

.footer-inner {
    padding-top: 30px;
    padding-bottom: 30px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 20px;
}

.footer-links {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.footer-inner-wide {
    align-items: start;
}

.footer a {
    color: #e2e8f0;
}

.legal-content ul {
    padding-left: 18px;
}

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

@media (max-width: 900px) {
    .nav,
    .footer-inner {
        align-items: flex-start;
        flex-direction: column;
    }

    .tool-shell,
    .content-grid {
        grid-template-columns: 1fr;
    }

    .result-panel {
        position: static;
    }

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

    .type-picker {
        grid-template-columns: 1fr;
    }

    .nav-links-wrap {
        width: 100%;
        align-items: stretch;
    }

    .nav-links {
        width: 100%;
    }

}

@media (max-width: 640px) {
    .hero {
        padding-top: 32px;
    }

    .form-grid,
    .result-grid {
        grid-template-columns: 1fr;
    }

    .input-row {
        grid-template-columns: 1fr 112px;
    }

    .panel-body,
    .content {
        padding: 18px;
    }

    .nav-links a {
        flex: 1 1 calc(50% - 5px);
    }

    .trust-strip {
        flex-direction: column;
    }
}
