:root {
    color-scheme: light;
    --ink: #374151;
    --muted: #6b7280;
    --accent: #C9A646;
    --navy: #1C1F4A;
    --line: #E2DED5;
    --paper: #fff;
    --wash: #F8F9FB;
}

* { box-sizing: border-box; }

body.calculator-page {
    margin: 0;
    background: var(--wash);
    color: var(--ink);
    font-family: Poppins, Arial, Helvetica, sans-serif;
    line-height: 1.55;
}

.calc-header {
    min-height: 70px;
    padding: 0 max(24px, calc((100% - 1160px) / 2));
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--navy);
    border-bottom: 1px solid var(--line);
}

.calc-header a, .text-link { color: var(--ink); text-decoration: none; }
.calc-header .calc-home-link { color: #fff; }
.calc-brand { display: flex; align-items: center; width: 205px; height: 44px; padding: 3px 8px; border-radius: 4px; background: #fff; }
.calc-brand img { display: block; width: 100%; height: 100%; object-fit: contain; }
.brand { font-weight: 800; letter-spacing: .16em; }
.calc-shell { max-width: 1160px; margin: 0 auto; padding: 42px 24px 72px; }
.calc-intro { max-width: 760px; margin-bottom: 26px; }
.eyebrow { margin: 0 0 5px; color: var(--accent); font-size: .72rem; font-weight: 700; letter-spacing: .15em; }
.calc-intro h1, .confirmation-card h1 { margin: 0 0 12px; font: 700 clamp(2rem, 5vw, 3.4rem)/1.1 Georgia, serif; }
.calc-intro > p:last-child, .muted, .fine-print { color: var(--muted); }
.calc-panel { margin: 18px 0; padding: 24px; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; }
.section-heading { display: flex; align-items: center; gap: 12px; }
.section-heading h2, .catalog-heading h2, .estimate-panel h2 { margin: 0; font: 700 1.55rem/1.25 Georgia, serif; }
.step-number { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; border-radius: 50%; background: #f5efd9; color: var(--navy); font-weight: 700; }
.package-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.package-option { display: flex; gap: 11px; min-height: 118px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; transition: border-color .15s, background .15s; }
.package-option:has(input:checked) { border-color: var(--accent); background: #fffdf5; box-shadow: 0 0 0 1px var(--accent); }
.package-option input, .work-modes input, .product-card input { accent-color: var(--accent); }
.package-option input { margin: 4px 0 0; }
.package-option span { display: grid; align-content: start; gap: 5px; }
.package-option strong { font-size: 1.08rem; }
.package-option small { width: fit-content; padding: 2px 8px; border-radius: 20px; background: #f5efd9; color: var(--navy); font-weight: 700; }
.package-option em { color: var(--muted); font-size: .88rem; font-style: normal; }
.setup-details { display: grid; grid-template-columns: minmax(200px, .7fr) 1.3fr; gap: 16px; align-items: stretch; margin-top: 20px; }
.area-field, .catalog-filters label, .customer-fields label { display: grid; gap: 6px; font-weight: 700; }
.area-field span { display: inline; color: var(--muted); font-size: .88rem; font-weight: 400; }
.area-field input, .catalog-filters input, .catalog-filters select, .customer-fields input, .customer-fields textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #d9d5cc; border-radius: 7px; background: #fff; color: var(--ink); font: inherit; }
.area-estimate { display: grid; align-content: center; gap: 3px; padding: 14px 16px; border: 1px solid #e5d9ad; border-radius: 9px; background: #fffdf5; }
.package-estimates { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 6px; }
.package-estimate-option { display: grid; align-content: start; gap: 4px; min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.package-estimate-option.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.package-estimate-option strong { font-size: .9rem; }
.package-estimate-value { font: 700 1.05rem Georgia, serif; }
.package-estimate-formula { color: var(--muted); font-size: .74rem; overflow-wrap: anywhere; }
.work-modes { display: flex; flex-wrap: wrap; gap: 12px 22px; margin: 20px 0 0; padding: 18px 0 0; border: 0; border-top: 1px solid var(--line); }
.work-modes legend { float: left; width: 100%; margin-bottom: 10px; padding: 0; font-weight: 700; }
.work-modes label { display: flex; align-items: center; gap: 8px; }
.fine-print { margin: 13px 0 0; font-size: .86rem; }
.catalog-section { margin: 32px 0 18px; }
.catalog-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.catalog-heading .eyebrow { margin-bottom: 3px; }
.catalog-filters { display: grid; grid-template-columns: minmax(180px, .7fr) minmax(240px, 1.3fr); gap: 12px; margin-bottom: 16px; }
.catalog-filters label { font-size: .88rem; }
.product-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.product-card { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.product-image { width: 100%; height: 170px; object-fit: cover; background: #e7e3db; }
.product-image-fallback { min-height: 78px; display: flex; align-items: center; padding: 16px; background: linear-gradient(135deg, #e8e9f1, #f4f1eb); color: var(--navy); font: 700 1rem Georgia, serif; }
.product-body { display: flex; flex: 1; flex-direction: column; padding: 16px; }
.product-body h3 { margin: 1px 0 5px; font-size: 1.08rem; }
.product-meta, .product-specs { margin: 0 0 7px; color: var(--muted); font-size: .85rem; }
.product-description, .product-scope { margin: 4px 0 10px; font-size: .91rem; }
.product-scope-list { margin: 4px 0 10px; padding-left: 19px; font-size: .9rem; }
.product-scope-list li { margin: 4px 0; }
.scope-label { margin: 8px 0 0; color: var(--navy); font-size: .76rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.product-price { margin: 8px 0 10px; font-weight: 700; }
.product-select { display: flex; align-items: center; gap: 9px; margin-top: auto; padding-top: 10px; font-size: .9rem; font-weight: 700; }
.quantity-field { display: flex; align-items: center; gap: 8px; margin-top: 9px; font-size: .88rem; }
.quantity-field input, .quantity-field select { width: 112px; min-height: 38px; padding: 7px; border: 1px solid var(--line); border-radius: 6px; background: #fff; font: inherit; }
.estimate-panel { display: grid; grid-template-columns: 1fr minmax(240px, .8fr); gap: 20px; align-items: center; }
.selected-summary { padding: 13px; border-radius: 8px; background: var(--wash); color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }
.customer-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 20px; }
.customer-fields label { font-size: .9rem; }
.customer-fields textarea { resize: vertical; }
.customer-fields input:focus, .customer-fields textarea:focus, .area-field input:focus, .catalog-filters input:focus, .catalog-filters select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.wide-field { grid-column: 1 / -1; }
.primary-button { display: inline-flex; min-height: 46px; align-items: center; justify-content: center; border: 0; border-radius: 7px; padding: 12px 19px; background: var(--navy); color: #fff; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.primary-button:hover { background: var(--accent); color: var(--navy); }
.notice { margin: 20px 0; padding: 18px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.notice-error { border-color: #cf7166; background: #fff6f4; }
.notice ul { margin: 8px 0 0; }
.confirmation-card { max-width: 720px; margin: 10vh auto; padding: 36px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.confirmation-card p { margin: 12px 0; }
.button-link { margin: 8px 0 18px; }
.text-link { display: block; margin-top: 12px; color: var(--accent); text-decoration: underline; }
.calc-shell { max-width: 1220px; }
.calc-intro { max-width: 900px; }
.calc-intro h1 { max-width: 780px; }
.calc-steps { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.calc-steps span { display: flex; align-items: center; gap: 9px; padding: 8px 13px; border: 1px solid var(--line); border-radius: 24px; background: #fff; color: #55564f; font-size: .86rem; font-weight: 700; }
.calc-steps b { display: grid; width: 23px; height: 23px; place-items: center; border-radius: 50%; background: #f5efd9; color: var(--navy); font-size: .78rem; }
.section-heading { align-items: flex-start; }
.section-heading > div { min-width: 0; }
.section-hint { margin: 5px 0 0; color: var(--muted); font-size: .9rem; font-weight: 400; }
.setup-panel { padding: 28px; }
.package-option { min-height: 132px; background: #fff; }
.work-modes { gap: 10px; }
.work-modes label { min-height: 42px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; }
.work-modes label:has(input:checked) { border-color: var(--accent); background: #fffdf5; box-shadow: 0 0 0 1px var(--accent); }
.catalog-section { padding: 8px 0; }
.catalog-heading { align-items: flex-start; }
.catalog-filters { padding: 16px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.catalog-count { margin: -3px 0 12px; color: var(--muted); font-size: .84rem; }
.product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.product-card { box-shadow: 0 8px 24px #28251b08; transition: border-color .15s, box-shadow .15s, transform .15s; }
.product-card:hover { transform: translateY(-2px); border-color: #d4c5b1; box-shadow: 0 12px 28px #28251b12; }
.product-body { padding: 18px; }
.product-meta:first-child { color: var(--accent); font-size: .76rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.included-details { margin: 8px 0 4px; border: 1px solid var(--line); border-radius: 8px; background: #fcfbf9; }
.included-details summary { padding: 9px 11px; color: #705638; font-size: .84rem; font-weight: 700; cursor: pointer; }
.included-details[open] summary { border-bottom: 1px solid var(--line); }
.included-details .product-scope-list { margin: 0; padding: 8px 12px 10px 31px; font-size: .84rem; }
.quantity-field input, .quantity-field select { min-height: 40px; }
.product-select { align-items: flex-start; padding: 12px 10px; border-radius: 8px; background: #f7f5f1; cursor: pointer; }
.product-select input { margin: 3px 0 0; }
.estimate-panel { border-color: #e5d9ad; background: #fffdf5; }
.selected-summary { max-height: 150px; overflow: auto; }
.primary-button { min-width: 210px; }
.primary-button:focus-visible, .package-option:focus-within, .work-modes label:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (max-width: 800px) {
    .calc-shell { padding: 32px 16px 56px; }
    .package-list, .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .estimate-panel, .setup-details { grid-template-columns: 1fr; }
    .calc-panel { padding: 18px; }
    .calc-header { padding: 0 16px; }
}

@media (max-width: 560px) {
    .package-list, .product-grid, .customer-fields, .catalog-filters { grid-template-columns: 1fr; }
    .package-estimates { grid-template-columns: 1fr; }
    .product-image { height: 190px; }
    .work-modes { display: grid; gap: 12px; }
    .calc-header { min-height: 62px; }
    .confirmation-card { margin: 8vh 14px; padding: 24px; }
    .calc-steps { display: grid; grid-template-columns: 1fr; gap: 7px; }
    .setup-panel { padding: 18px; }
    .catalog-heading { flex-direction: column; }
    .primary-button { width: 100%; }
}
