html, body {
    font-family: Arial, Helvetica, sans-serif;
    background: #f6f7f8;
}

.app-max { max-width: 1100px; }
.planner-max { max-width: 760px; }
.planner-shell { min-height: calc(100vh - 64px); }
.planner-card { border: 0; background: #fff; }
.section-heading { display: flex; align-items: center; gap: .75rem; margin-bottom: 1.25rem; }
.section-heading span { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; border-radius: 50%; background: #0d6efd; color: #fff; font-weight: 700; }
.section-heading h2 { margin: 0; font-size: 1.15rem; }
.summary-card { position: sticky; top: 1rem; }
.shopping-list .list-group-item { background: transparent; }
.fence-layout-diagram { min-width: 0; }
.fence-layout-diagram-svg { display: block; height: auto; max-height: 24rem; overflow: visible; width: 100%; }
.fence-diagram-run { fill: none; stroke: #495057; stroke-linecap: round; stroke-width: 3; }
.fence-diagram-run-label { fill: #212529; font-size: 10px; text-anchor: middle; }
.fence-diagram-gate line { stroke: #212529; stroke-dasharray: 4 3; stroke-linecap: round; stroke-width: 1.5; }
.fence-diagram-gate text { fill: #212529; font-size: 8px; font-weight: 600; pointer-events: none; }
.fence-diagram-post circle, .fence-diagram-post rect { fill: #fff; stroke: #212529; stroke-width: 1.5; }
.fence-diagram-post-corner rect { fill: #212529; }
.fence-diagram-post-gate rect { fill: #fff; stroke-width: 2; }
.explanation-detail summary { cursor: pointer; }
.explanation-detail summary::marker { color: #0d6efd; }
.table-responsive { overflow-x: auto; }
.pricing-row { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr) minmax(16rem, 1.5fr) auto; align-items: end; border-bottom: 1px solid #e9ecef; padding: .75rem 0; }
.pricing-input { min-width: 0; }
.pricing-extended { display: flex; flex-direction: column; text-align: right; white-space: nowrap; }
.pricing-total { display: flex; justify-content: space-between; gap: 1rem; font-size: 1.1rem; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
    outline: 3px solid #212529;
    outline-offset: 2px;
}

.hero { padding: 5rem 0 4rem; }

.eyebrow {
    letter-spacing: .08em;
    text-transform: uppercase;
    font-size: .8rem;
    font-weight: 700;
}

@media (max-width: 991.98px) {
    .summary-card { position: static; }
}

@media (max-width: 575.98px) {
    .planner-shell { padding-left: .25rem; padding-right: .25rem; }
    .planner-card .card-body { padding: 1.25rem !important; }
    .shopping-list .list-group-item { align-items: flex-start; flex-direction: column; gap: .25rem !important; }
    .table-responsive { overflow: visible; }
    .table thead { display: none; }
    .table tbody, .table tr, .table td, .table th { display: block; width: 100%; }
    .table tr { border: 1px solid #dee2e6; border-radius: .5rem; margin-bottom: .75rem; padding: .5rem .75rem; }
    .table th, .table td { border: 0; display: flex; justify-content: space-between; gap: 1rem; padding: .35rem 0; text-align: right; }
    .table th::before, .table td::before { color: #6c757d; content: attr(data-label); font-weight: 600; text-align: left; }
    .table th[scope="row"] { font-weight: 700; text-align: right; }
}

#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    width: 100%;
    padding: .75rem;
    background: #fff3cd;
    border-top: 1px solid #ffe69c;
    z-index: 1000;
}

.print-document {
    display: none;
}

@media screen {
    .print-only {
        display: none;
    }
}

@media print {
    @page {
        size: auto;
        margin: .5in .6in;
    }

    html, body {
        background: #fff !important;
        color: #111 !important;
        font-size: 11pt;
        height: auto !important;
        min-height: 0 !important;
        overflow: visible !important;
    }

    .screen-only,
    nav {
        display: none !important;
    }

    main {
        display: block !important;
        height: auto !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        position: static !important;
    }

    .print-only,
    .print-document {
        display: block !important;
    }

    .print-document {
        box-sizing: border-box;
        height: auto !important;
        min-height: 0 !important;
        margin: 0 !important;
        max-width: none !important;
        overflow: visible !important;
        padding: 0 .05in !important;
        position: static !important;
        transform: none !important;
        width: 100%;
        max-width: none;
        color: #111;
        background: #fff;
        font-size: 10.5pt;
        line-height: 1.3;
    }

    .print-document-header {
        border-bottom: 2px solid #111;
        margin-bottom: 1.15rem;
        padding-bottom: .75rem;
    }

    .print-brand {
        font-size: 1.15rem;
        font-weight: 700;
        letter-spacing: .02em;
    }

    .print-document h1 {
        font-size: 1.45rem;
        margin: .2rem 0 .65rem;
    }

    .print-document h2 {
        border-bottom: 1px solid #777;
        font-size: .92rem;
        letter-spacing: .04em;
        margin: 0 0 .65rem;
        padding-bottom: .3rem;
        text-transform: uppercase;
    }

    .print-document h3 {
        font-size: .82rem;
        margin: .85rem 0 .35rem;
    }

    .print-identity,
    .print-detail-grid {
        display: grid;
        grid-template-columns: minmax(9rem, 1fr) minmax(9rem, 2fr);
        margin: 0;
    }

    .print-identity dt,
    .print-identity dd,
    .print-detail-grid dt,
    .print-detail-grid dd {
        margin: 0;
        padding: .12rem 0;
    }

    .print-identity dt,
    .print-detail-grid dt {
        font-weight: 700;
    }

    .print-section,
    .print-material-category,
    .print-assumptions {
        margin-bottom: 1.1rem;
    }

    .print-material-category {
        break-inside: avoid;
        margin-bottom: .85rem;
    }

    .print-material-category ul,
    .print-gate-list {
        list-style: none;
        margin: 0;
        padding: 0;
    }

    .print-material-row {
        align-items: start;
        break-inside: avoid;
        display: grid;
        column-gap: .65rem;
        grid-template-columns: 18px 55px minmax(0, 1fr) 90px;
        line-height: 1.3;
        padding: .34rem .05in;
        border-bottom: 1px solid #d5d5d5;
    }

    .print-checkbox {
        border: 1px solid #111;
        display: inline-block;
        height: .85rem;
        margin-top: .1rem;
        width: .85rem;
    }

    .print-material-quantity {
        border-right: 1px solid #999;
        font-weight: 700;
        font-size: 10.5pt;
        padding-right: .65rem;
        text-align: right;
        white-space: nowrap;
    }

    .print-material-unit {
        font-size: 9.5pt;
        padding-left: .2rem;
        padding-right: .08in;
        text-align: right;
        white-space: nowrap;
    }

    .print-material-description {
        min-width: 0;
    }

    .print-material-description strong,
    .print-material-detail {
        display: block;
    }

    .print-material-description strong {
        font-size: 10.5pt;
    }

    .print-material-detail {
        color: #333;
        font-size: 9.5pt;
        margin-top: .08rem;
    }

    .print-gate-list {
        margin-top: .5rem;
    }

    .print-note {
        margin: .5rem 0 0;
    }

    .print-price-row,
    .print-price-total {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 7rem 7rem;
        gap: .5rem;
        padding: .1rem 0;
    }

    .print-price-row > :nth-child(2),
    .print-price-row > :nth-child(3),
    .print-price-total > :last-child {
        text-align: right;
    }

    .print-price-total {
        border-top: 1px solid #777;
        font-weight: 700;
        margin-top: .35rem;
        padding-top: .25rem;
    }

    .print-assumptions {
        break-inside: avoid;
    }

@media (max-width: 767.98px) {
    .pricing-row { grid-template-columns: 1fr; gap: .5rem; }
    .pricing-extended { text-align: left; }
}
}
