* {
    box-sizing: border-box;
}

:root {
    --bg: #f5f5f5;
    --text: #111;
    --muted: #666;
    --border: #d8d8d8;
    --card: #fff;
    --soft: #efefef;
    --danger: #7a1d1d;
    --success: #145a32;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.45;
}

.page {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 32px 0;
}

.hero {
    margin-bottom: 24px;
}

.eyebrow {
    text-transform: lowercase;
    font-weight: 700;
    letter-spacing: .04em;
    margin-bottom: 8px;
}

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

h1 {
    font-size: clamp(28px, 4vw, 44px);
    line-height: 1.05;
    margin-bottom: 12px;
}

h2 {
    font-size: 20px;
    margin: 0 0 16px;
}

h3 {
    font-size: 16px;
    margin: 0 0 10px;
}

.hero p {
    max-width: 760px;
    color: var(--muted);
    font-size: 18px;
}

.layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, .95fr);
    gap: 20px;
    align-items: start;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 22px;
}

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

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

label,
.full-field {
    display: grid;
    gap: 7px;
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 18px;
}

.grid label {
    margin-bottom: 0;
}

input,
select,
button {
    font: inherit;
}

input,
select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 11px 12px;
    background: #fff;
    color: var(--text);
}

input:disabled {
    background: #f0f0f0;
    color: #777;
}

input:focus,
select:focus,
button:focus {
    outline: 2px solid #111;
    outline-offset: 2px;
}

.field-note,
.small-text {
    color: var(--muted);
    font-weight: 400;
    font-size: 12px;
    margin: -6px 0 18px;
}

.small-text {
    margin: 0 0 14px;
}

.hidden {
    display: none !important;
}

.alert {
    border: 1px solid var(--border);
    background: var(--soft);
    color: var(--danger);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 18px;
    font-size: 14px;
}

.actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

button {
    border: 1px solid #111;
    background: #111;
    color: #fff;
    border-radius: 8px;
    padding: 12px 16px;
    cursor: pointer;
    font-weight: 700;
}

button.secondary {
    background: #fff;
    color: #111;
}

.form-status {
    margin: 10px 0 0;
    font-size: 14px;
    color: var(--muted);
}

.form-status.error {
    color: var(--danger);
}

.form-status.success {
    color: var(--success);
}

.results {
    position: sticky;
    top: 20px;
}

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

.result-card {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
    background: #fff;
}

.result-card.primary {
    background: #111;
    color: #fff;
    margin-bottom: 10px;
}

.result-card span {
    display: block;
    color: inherit;
    opacity: .75;
    font-size: 13px;
    margin-bottom: 6px;
}

.result-card strong {
    display: block;
    font-size: 20px;
    line-height: 1.1;
}

.result-card.primary strong {
    font-size: 34px;
}

.summary,
.contact-form,
.disclaimer {
    border-top: 1px solid var(--border);
    padding-top: 18px;
    margin-top: 18px;
}

.summary p,
.disclaimer {
    color: var(--muted);
    font-size: 14px;
}

.table-wrapper {
    width: 100%;
    overflow-x: auto;
    margin-bottom: 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 560px;
}

th,
td {
    text-align: left;
    padding: 10px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

tr:last-child td {
    border-bottom: 0;
}

th {
    font-size: 13px;
    background: var(--soft);
}

td {
    font-size: 14px;
}

.muted-row td {
    color: var(--muted);
}

.result-actions {
    border-top: 1px solid var(--border);
    padding-top: 18px;
    margin-top: 18px;
}

.hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

@media (max-width: 960px) {
    .layout,
    .grid.two,
    .result-grid {
        grid-template-columns: 1fr;
    }

    .results {
        position: static;
    }
}

@media print {
    body {
        background: #fff;
    }

    .page {
        width: 100%;
        padding: 0;
    }

    .hero,
    #taxCalculator,
    .contact-form,
    .result-actions,
    .disclaimer {
        display: none !important;
    }

    .layout {
        display: block;
    }

    .card {
        border: 0;
        border-radius: 0;
        padding: 0;
    }

    .results {
        position: static;
    }
}
