:root {
    --navy: #003399;
    --navy-2: #06245f;
    --ink: #172033;
    --muted: #5c6778;
    --red: #e10600;
    --paper: #f3f0e8;
    --card: #fffefb;
    --line: #e4dccf;
    --ok: #0d7a45;
    --warn: #8a5a00;
    --shadow: 0 24px 60px rgba(23, 32, 51, .08);
    --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
    --sans: "Outfit", "Avenir Next", "Segoe UI", sans-serif;
    --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 17px;
    line-height: 1.5;
}
img { max-width: 100%; }
a { color: var(--navy); }
h1, h2, h3 { font-family: var(--serif); font-weight: 560; letter-spacing: -0.03em; line-height: 1.08; }
h1 { font-size: clamp(2.4rem, 5vw, 4.4rem); margin: 0 0 .4em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 0 0 .4em; }
p { margin: 0 0 .8em; }
button, input, select, textarea { font: inherit; color: inherit; }
main { width: min(1120px, calc(100% - 32px)); margin: 0 auto; padding: 28px 0 72px; }

.topbar, .test-banner {
    background: var(--navy-2);
    color: #f4efe4;
    text-align: center;
    font-size: 13px;
    letter-spacing: .01em;
    padding: 8px 16px;
}
.test-banner { background: var(--red); }

.site-header {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 22px;
    padding: 18px 0;
}
.logo img { height: 38px; width: 166px; display: block; }
.site-header nav { display: flex; gap: 18px; flex-wrap: wrap; margin-left: auto; }
.site-header nav a { color: var(--ink); text-decoration: none; font-weight: 500; }
.site-header nav a[aria-current="page"] { color: var(--navy); }
.cart-link span {
    display: inline-grid;
    place-items: center;
    min-width: 1.4em;
    height: 1.4em;
    margin-left: 4px;
    border-radius: 99px;
    background: var(--navy);
    color: white;
    font-family: var(--mono);
    font-size: 12px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--navy);
    color: white;
    text-decoration: none;
    border: 0;
    border-radius: 999px;
    padding: 13px 20px;
    font-weight: 600;
    cursor: pointer;
}
.btn:hover { background: var(--navy-2); }
.btn.ghost { background: transparent; color: var(--navy); border: 1px solid #c9d0ea; }
.btn.ghost:hover { background: white; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.header-cta { flex: none; }
.text-button { background: none; border: 0; color: var(--red); padding: 0; cursor: pointer; font-weight: 600; }

.eyebrow {
    margin: 0 0 8px;
    color: var(--red);
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: .14em;
    text-transform: uppercase;
}
.lead { font-size: 1.15rem; color: var(--muted); max-width: 42rem; }
.hint { color: var(--muted); font-size: .92rem; }

.hero, .quote-layout, .split, .product-page {
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    gap: 36px;
    align-items: start;
}
.hero-actions, .pills, .form-actions, .inline-forms { display: flex; flex-wrap: wrap; gap: 10px; }
.pills { list-style: none; padding: 0; margin: 22px 0 0; }
.pills li {
    border: 1px solid var(--line);
    background: rgba(255,254,251,.7);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: .92rem;
}

.estimator, .receipt, .example-card, .login-card, .empty, .note-grid article, .product-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: var(--shadow);
}
.estimator { padding: 22px; display: grid; gap: 12px; }
.estimator-head h2 { font-size: 1.7rem; }

label { display: grid; gap: 6px; font-size: .92rem; font-weight: 600; }
input, select, textarea {
    width: 100%;
    border: 1px solid #d9d1c4;
    background: white;
    border-radius: 12px;
    padding: 12px 13px;
    font-weight: 450;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid #b9c6ef; border-color: var(--navy); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dims { grid-template-columns: repeat(4, 1fr); }
.fields { display: grid; gap: 14px; align-content: start; }
.hp { position: absolute; left: -9999px; height: 0; }

.presets { display: flex; flex-wrap: wrap; gap: 8px; }
.presets button {
    border: 1px solid var(--line);
    background: #faf7f1;
    border-radius: 999px;
    padding: 8px 12px;
    cursor: pointer;
}
.presets button.is-on { border-color: var(--navy); color: var(--navy); background: #eef2ff; }

.receipt { padding: 0 0 18px; position: relative; overflow: hidden; }
.receipt-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 18px;
    background: var(--navy);
    color: white;
}
.receipt-top .eyebrow { color: #ffb4b0; }
.receipt-top strong { font-family: var(--serif); font-size: 1.4rem; }
.seal {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 2px solid #ffb4b0;
    color: #ffb4b0;
    display: grid;
    place-items: center;
    font-family: var(--mono);
    letter-spacing: .08em;
    transform: rotate(-8deg);
}
.receipt-flag, .receipt-alert, .receipt-note, .receipt-meta { margin: 12px 18px 0; }
.receipt-flag, .receipt-note, .receipt-meta { color: var(--muted); font-size: .92rem; }
.receipt-alert {
    background: #fff4e8;
    color: var(--warn);
    border-radius: 12px;
    padding: 10px 12px;
}
.receipt-lines { margin: 8px 0 0; }
.receipt-lines div, .example-card li {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 9px 18px;
    border-top: 1px solid #f0e9de;
}
.receipt-lines dt { color: var(--muted); font-weight: 450; }
.receipt-lines dd, .example-card b { margin: 0; font-family: var(--mono); font-size: .95rem; }
.receipt-summary dt { color: var(--ink); font-weight: 600; }
.receipt-summary dt small, .eta { display: block; margin-top: 2px; color: var(--muted); font-weight: 450; font-size: .82rem; }
.receipt-summary dd { font-weight: 600; }
.receipt-detail { margin: 4px 18px 0; }
.receipt-detail summary { cursor: pointer; color: var(--navy); font-weight: 600; }
.receipt-detail .receipt-lines { margin-left: -18px; margin-right: -18px; }
.cart-note {
    background: #eef3ff;
    border: 1px solid #c9d6f5;
    border-radius: 14px;
    padding: 12px 14px;
    margin-top: 14px;
}
.cart-note strong { display: block; margin-bottom: 4px; }
.cart-note p, .eta { margin: 0; }
.eta { margin: 4px 0 16px; }
.receipt-total { padding: 16px 18px 6px; }
.receipt-total span { display: block; color: var(--muted); }
.receipt-total strong {
    display: block;
    font-family: var(--mono);
    font-size: clamp(1.8rem, 3vw, 2.3rem);
    letter-spacing: -0.04em;
    color: var(--navy-2);
}
.receipt-total small, .example-total small { display: block; color: var(--muted); font-family: var(--sans); font-size: .9rem; font-weight: 450; }
.cupo { padding: 8px 18px 0; }
.cupo-track { height: 8px; background: #efeae0; border-radius: 99px; overflow: hidden; }
.cupo-track span { display: block; height: 100%; background: var(--navy); }
.cupo-track.is-over span { background: var(--red); }
.cupo p { margin: 6px 0 0; font-size: .85rem; color: var(--muted); }

.steps, .note-grid, .metrics, .catalog {
    display: grid;
    gap: 16px;
    margin-top: 54px;
}
.steps, .note-grid { grid-template-columns: repeat(3, 1fr); }
.metrics { grid-template-columns: repeat(4, 1fr); }
.steps article, .note-grid article, .metrics article {
    padding: 8px 8px 0 0;
}
.steps span, .metrics span {
    font-family: var(--mono);
    color: var(--red);
    font-size: .85rem;
}
.metrics article {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 16px;
}
.metrics strong { display: block; font-family: var(--mono); font-size: 1.35rem; margin-top: 6px; }
.split, .faq { margin-top: 64px; }
.formula { margin: 0; padding-left: 1.1rem; display: grid; gap: 12px; }
.formula li { padding-left: 6px; }
.example-card { padding: 22px; }
.example-card ul { list-style: none; margin: 0; padding: 0; }
.example-card li { padding-left: 0; padding-right: 0; }
.example-total { font-family: var(--mono); font-size: 1.7rem; color: var(--navy); margin: 16px 0 0; }

.faq details {
    border-top: 1px solid var(--line);
    padding: 14px 0;
}
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { color: var(--muted); }

.page-head { margin-bottom: 22px; max-width: 44rem; }
.page-head.narrow, .prose, .narrow-form { max-width: 720px; }
.empty { padding: 36px; max-width: 640px; }
.catalog { grid-template-columns: repeat(3, 1fr); margin-top: 0; }
.product-card { text-decoration: none; color: inherit; overflow: hidden; }
.product-card img, .product-fallback { width: 100%; aspect-ratio: 4/3; object-fit: cover; background: #e7eefc; display: block; }
.product-fallback.large { min-height: 280px; border-radius: 22px; }
.product-card div { padding: 16px; }
.product-card h2 { font-size: 1.45rem; }
.landed { font-family: var(--mono); color: var(--navy); font-size: 1.15rem; }
.product-page { align-items: start; grid-template-columns: .8fr 1fr .9fr; }
.product-buy { display: flex; gap: 12px; align-items: end; margin-top: 12px; }
.product-buy label { width: 120px; }
.checkout-go, .quote-layout .btn { margin-top: 14px; }
.cart-lines { display: grid; gap: 14px; }
.cart-lines article {
    display: grid;
    grid-template-columns: 1fr 120px auto;
    gap: 12px;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}
.cart-lines h2 { font-size: 1.35rem; }
.mini-items { padding-left: 18px; color: var(--muted); }
.form-errors, .flash {
    border-radius: 14px;
    padding: 12px 14px;
    margin: 0 0 16px;
}
.form-errors, .flash-error { background: #fff1f0; color: #8d120d; }
.flash-ok { background: #e8f6ee; color: var(--ok); }
.flash-info { background: #eef2ff; color: var(--navy-2); }
.check { grid-template-columns: auto 1fr; align-items: start; font-weight: 450; }
.pay-methods { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }
.pay-methods legend { font-weight: 700; padding: 0; margin-bottom: 6px; }
.pay-option {
    grid-template-columns: auto 1fr;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 12px;
    background: white;
}
.pay-option input { width: auto; }
.pay-option small { display: block; color: var(--muted); font-weight: 450; }
.order-copy h2 { margin-top: 22px; font-size: 1.4rem; }
.tracking { font-family: var(--mono); }

.site-footer {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.4fr repeat(3, 1fr);
    gap: 24px;
    padding: 28px 0;
    border-top: 1px solid var(--line);
}
.site-footer img { height: 28px; width: 122px; }
.site-footer strong { display: block; margin-bottom: 8px; }
.site-footer a, .site-footer p { display: block; color: var(--muted); text-decoration: none; }
.legal { width: min(1120px, calc(100% - 32px)); margin: 0 auto 28px; color: var(--muted); font-size: .85rem; }

.is-admin main { width: min(980px, calc(100% - 32px)); }
.login-card { max-width: 420px; margin: 40px auto; padding: 28px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: 16px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .8rem; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.settings-form fieldset {
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 16px;
    margin: 0 0 16px;
    background: var(--card);
}
.settings-form legend { font-family: var(--serif); font-size: 1.3rem; padding: 0 6px; }
.admin-thumb { width: 160px; border-radius: 12px; }
.danger-form { margin-top: 18px; }

@media (max-width: 980px) {
    .hero, .quote-layout, .split, .product-page, .site-footer, .steps, .note-grid, .catalog, .metrics {
        grid-template-columns: 1fr;
    }
    .product-page { grid-template-columns: 1fr; }
    .header-cta { display: none; }
    .dims, .cart-lines article { grid-template-columns: 1fr 1fr; }
    .cart-lines article { align-items: start; }
}
@media (max-width: 640px) {
    .field-row, .dims, .cart-lines article { grid-template-columns: 1fr; }
    .site-header { align-items: flex-start; }
    .logo img { width: 140px; height: 32px; }
}
