:root {
    color-scheme: light;
    --color-diy: #2e7d32;
    --color-hire: #e65100;
    --color-borderline: #f9a825;
    --color-primary: #1565c0;
    --color-bg: #f5f5f5;
    --color-nav-bg: var(--color-bg);
    --color-text: #212121;
    --color-border: #e0e0e0;
    --color-card-bg: #ffffff;
    --color-text-muted: #666;
    --space-page-x: 1.65rem;
    --space-page-y: 0.825rem;
    --container-max: 900px;
    --touch-min: 44px;
    --header-height: 3.5rem;
    --radius-md: 8px;
    --shadow-nav: 0 1px 0 rgba(0, 0, 0, 0.04);
    --shadow-drawer: 0 12px 32px rgba(0, 0, 0, 0.12);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
}

/*
 * Cross-document view transitions (Chrome/Edge/Safari 18.2+).
 * Keep shared chrome fixed; crossfade only the page surface so navigations
 * feel smooth instead of a full-document morph/flash.
 *
 * Firefox is intentionally excluded: as of mid-2026 its MPA / cross-document
 * support is still partial and produces a harsh flash instead of a crossfade.
 * `-moz-appearance` is a capability gate (true only in Gecko), not UA sniffing
 * of version strings. When Firefox ships solid cross-document VT, drop the
 * @supports wrapper so it joins the smooth path automatically... or switch to
 * a dedicated CSS.supports check for navigation: auto if one lands.
 */
@supports not (-moz-appearance: none) {
    @view-transition {
        navigation: auto;
    }

    /* Stable elements present on every MPA page — do not re-animate chrome. */
    .site-header {
        view-transition-name: site-header;
    }

    .footer {
        view-transition-name: site-footer;
    }

    /* Transition layer sits on the app surface, never a white flash. */
    ::view-transition {
        background-color: var(--color-bg, #f5f5f5);
    }

    /* No size/position morphing of snapshot groups (avoids stretch/zoom jank). */
    ::view-transition-group(root),
    ::view-transition-group(site-header),
    ::view-transition-group(site-footer) {
        animation: none;
    }

    ::view-transition-group(site-header) {
        z-index: 100;
    }

    ::view-transition-group(site-footer) {
        z-index: 40;
    }

    /* Header + footer: hold still across navigations. */
    ::view-transition-old(site-header),
    ::view-transition-new(site-header),
    ::view-transition-old(site-footer),
    ::view-transition-new(site-footer) {
        animation: none;
        mix-blend-mode: normal;
        height: 100%;
        overflow: clip;
    }

    /*
     * Root residual (main content + body): true crossfade.
     * plus-lighter avoids the mid-transition dark dip from stacked opacities.
     */
    ::view-transition-image-pair(root) {
        isolation: auto;
    }

    ::view-transition-old(root),
    ::view-transition-new(root) {
        animation-duration: 220ms;
        animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
        animation-fill-mode: both;
        mix-blend-mode: plus-lighter;
        /* Snapshots keep natural size; no scaling when page heights differ. */
        height: 100%;
        width: 100%;
        object-fit: none;
        object-position: left top;
        overflow: clip;
    }

    ::view-transition-old(root) {
        animation-name: page-fade-out;
    }

    ::view-transition-new(root) {
        animation-name: page-fade-in;
    }

    @keyframes page-fade-out {
        from { opacity: 1; }
        to { opacity: 0; }
    }

    @keyframes page-fade-in {
        from { opacity: 0; }
        to { opacity: 1; }
    }

    @media (prefers-reduced-motion: reduce) {
        @view-transition {
            navigation: none;
        }

        ::view-transition-old(root),
        ::view-transition-new(root),
        ::view-transition-old(site-header),
        ::view-transition-new(site-header),
        ::view-transition-old(site-footer),
        ::view-transition-new(site-footer) {
            animation: none !important;
        }
    }
}

/*
 * Firefox / Gecko fallback page fade.
 *
 * Cross-document @view-transition (the native crossfade above) is unsupported
 * in Gecko as of mid-2026 (MDN: "No support" in Firefox), so MPA navigations
 * there are a hard, jittery cut while Chromium/Safari get the smooth crossfade.
 * `-moz-appearance` is the same Gecko-only capability gate used above (here
 * inverted), so this only takes effect where the native VT path is disabled.
 *
 * The fade-in is triggered before first paint by an inline head script in
 * base.html (class on <html>, no FOUC); the fade-out is driven by
 * static/js/page-transition.js on same-origin link clicks. Animating <body>
 * (not <html>) keeps the root background opaque so the dissolve goes to the
 * page color instead of a white flash. Durations/timing match the native
 * crossfade. Drop this block when Gecko ships cross-document VT and the
 * @supports gate above is removed.
 */
@media (prefers-reduced-motion: no-preference) {
    @supports (-moz-appearance: none) {
        html.rs-fade-in body {
            animation: rs-page-fade-in 220ms cubic-bezier(0.4, 0, 0.2, 1) both;
        }

        html.rs-fade-out body {
            opacity: 0;
            transition: opacity 220ms cubic-bezier(0.4, 0, 0.2, 1);
        }

        @keyframes rs-page-fade-in {
            from { opacity: 0; }
            to { opacity: 1; }
        }
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
}

/* Skip link for keyboard / screen-reader users */
.skip-link {
    position: absolute;
    top: -100px;
    left: 1rem;
    z-index: 1000;
    padding: 0.5rem 1rem;
    background: var(--color-primary);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    border-radius: 0 0 6px 6px;
    transition: top 0.15s ease;
}

.skip-link:focus {
    top: 0;
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--color-nav-bg);
    box-shadow: var(--shadow-nav);
    padding-top: var(--safe-top);
    padding-left: var(--safe-left);
    padding-right: var(--safe-right);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.65rem var(--space-page-x);
    min-height: var(--header-height);
    background: var(--color-nav-bg);
    border-bottom: 1px solid var(--color-border);
    max-width: calc(var(--container-max) + 2 * var(--space-page-x));
    margin: 0 auto;
    width: 100%;
    position: relative;
}

.nav-brand {
    font-size: 1.45rem;
    font-weight: bold;
    color: var(--color-primary);
    text-decoration: none;
    line-height: 1.2;
    min-height: var(--touch-min);
    display: inline-flex;
    align-items: center;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: var(--touch-min);
    height: var(--touch-min);
    margin: 0;
    padding: 0;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-card-bg);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
}

.nav-toggle:hover,
.nav-toggle:focus-visible {
    border-color: var(--color-primary);
    outline: none;
}

.nav-toggle-bar {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--color-text);
    border-radius: 1px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
    opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem 0.35rem;
    flex-wrap: wrap;
    background-color: var(--color-nav-bg);
}

.nav-links a {
    display: inline-flex;
    align-items: center;
    min-height: var(--touch-min);
    padding: 0.35rem 0.75rem;
    margin-left: 0;
    text-decoration: none;
    color: var(--color-text);
    /* Keep every tab on the same surface during and after navigation. */
    background-color: var(--color-nav-bg);
    font-size: 1.05rem;
    font-weight: 500;
    border-radius: 6px;
    -webkit-tap-highlight-color: transparent;
}

.nav-links a:hover,
.nav-links a:focus-visible {
    color: var(--color-primary);
    background: #eef3fb;
    outline: none;
}

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: var(--space-page-y) var(--space-page-x);
    padding-bottom: calc(1.65rem + var(--safe-bottom));
    flex: 1 1 auto;
    width: 100%;
}

.hero {
    text-align: center;
    margin-bottom: 2rem;
}

.hero h1 {
    font-size: clamp(1.55rem, 4vw + 0.8rem, 2.2rem);
    margin-bottom: 0.5rem;
    line-height: 1.25;
}

.hero p {
    color: var(--color-text-muted);
    font-size: clamp(0.95rem, 1.2vw + 0.75rem, 1.1rem);
    max-width: 38rem;
    margin-left: auto;
    margin-right: auto;
}

/* Horizontal scroll region for wide tables */
.table-scroll {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    border-radius: 6px;
    margin: 0.5rem 0;
}

.table-scroll:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.table-scroll table {
    min-width: 100%;
}

.materials-price-table {
    min-width: 36rem;
}

.repair-form {
    background: var(--color-card-bg);
    border-radius: 8px;
    padding: 1.65rem;
    border: 1px solid var(--color-border);
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group select,
.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.7rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 1.05rem;
    /* 16px+ avoids iOS focus zoom */
    min-height: var(--touch-min);
    background: #fff;
}

.form-group select:focus,
.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.15);
}

.repair-categories {
    margin-top: 0.25rem;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 0.25rem;
}

.category-tile {
    background: var(--color-card-bg);
    border: 2px solid var(--color-border);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.15s ease;
}

.category-tile.expanded {
    border-color: var(--color-primary);
}

.category-tile-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.2rem 0.6rem;
    cursor: pointer;
    user-select: none;
}

.category-tile-header:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: -2px;
}

.category-name {
    flex: 1;
    font-weight: 600;
    font-size: 0.95rem;
}

.category-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 0.33rem;
    background: #e3f2fd;
    color: var(--color-primary);
    border-radius: 12px;
    font-size: 0.825rem;
    font-weight: 700;
}

.category-arrow {
    font-size: 0.66rem;
    color: #999;
    transition: transform 0.15s ease;
}

.category-tile.expanded .category-arrow {
    transform: rotate(180deg);
}

.category-repairs {
    border-top: 1px solid var(--color-border);
    padding: 0.33rem;
}

.repair-option {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.62rem;
    border-radius: 4px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.repair-option:hover,
.repair-option:focus-visible {
    background: transparent;
}

.repair-option:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: -2px;
}

.repair-option.selected {
    background: #e3f2fd;
}

.repair-option.selected:hover {
    background: #e3f2fd;
}

.repair-option.selected .repair-option-label {
    color: var(--color-primary);
    font-weight: 600;
}

.repair-option-label {
    font-size: 0.99rem;
}

/* --- Compact selection summary (shown after a repair is chosen) --- */

.selection-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.65rem;
    padding: 0.7rem 0.9rem;
    background: #e3f2fd;
    border: 2px solid var(--color-primary);
    border-radius: 8px;
    margin-top: 0.25rem;
}

.selection-summary.hidden {
    display: none;
}

.selection-summary-check {
    color: var(--color-primary);
    font-weight: 700;
    font-size: 1.1rem;
}

.selection-summary-label {
    font-weight: 600;
    font-size: 1.045rem;
    flex: 1 1 8rem;
    min-width: 0;
    line-height: 1.35;
    word-break: break-word;
}

.selection-summary-category {
    font-size: 0.88rem;
    color: #666;
    background: transparent;
    padding: 0.12rem 0.41rem;
    border-radius: 10px;
    border: 1px solid var(--color-border);
}

.selection-summary-change {
    background: transparent;
    border: 1px solid var(--color-primary);
    color: var(--color-primary);
    cursor: pointer;
    font-size: 0.935rem;
    font-weight: 600;
    padding: 0.4rem 0.75rem;
    min-height: var(--touch-min);
    border-radius: 6px;
    margin-left: auto;
    -webkit-tap-highlight-color: transparent;
}

.selection-summary-change:hover,
.selection-summary-change:focus-visible {
    background: transparent;
    text-decoration: underline;
    opacity: 1;
}

#analyze-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.7rem 1.35rem;
    min-height: var(--touch-min);
    border: none;
    border-radius: 6px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    text-decoration: none;
    line-height: 1.25;
}

.btn-primary,
.btn-secondary {
    background: transparent;
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
}

.btn-primary:hover,
.btn-primary:focus-visible,
.btn-secondary:hover,
.btn-secondary:focus-visible {
    background: transparent;
    text-decoration: underline;
}

.loading {
    text-align: center;
    padding: 0.83rem;
    color: #666;
}

.hidden {
    display: none;
}

.results-container {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    /* Equal spacing between all result sections; 30% tighter than prior 0.84375rem */
    gap: 0.590625rem;
}

/* Zero child margins so gap alone controls equal spacing between tabs */
.results-container > .card,
.results-container > .personalization-note,
.results-container > .emergency-banner,
.results-container > .caution-notice,
.results-container > .hazards-card,
.results-container > .report-toolbar-inline {
    margin-bottom: 0;
}

.emergency-banner {
    background: #e65100;
    color: #fff;
    border-radius: 8px;
    padding: 1.24rem;
    margin-bottom: 1.5rem;
    border: 2px solid #bf360c;
}

.emergency-banner .emergency-title {
    font-size: 1.485rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.emergency-banner .emergency-warning {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.emergency-banner h3 {
    font-size: 1.045rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.emergency-banner ul {
    padding-left: 1.5rem;
}

.emergency-banner li {
    margin-bottom: 0.4rem;
    line-height: 1.4;
}

.caution-notice {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    background: #fff8e1;
    color: #5d4037;
    border: 1px solid #ffb74d;
    border-left: 4px solid #ff9800;
    border-radius: 4px;
    padding: 0.7rem 0.83rem;
    margin-bottom: 1.5rem;
    font-size: 0.99rem;
    font-weight: 500;
    line-height: 1.5;
}

.caution-icon {
    font-size: 1.21rem;
    line-height: 1.4;
    flex-shrink: 0;
}

.card {
    background: var(--color-card-bg);
    border-radius: 8px;
    padding: 1.24rem;
    border: 1px solid var(--color-border);
    margin-bottom: 1.5rem;
}

.card h2 {
    font-size: 1.375rem;
    margin-bottom: 1rem;
}

.baseline-notice {
    display: inline-block;
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ffb74d;
    border-radius: 4px;
    padding: 0.33rem 0.62rem;
    font-size: 0.935rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.live-notice {
    display: inline-block;
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #81c784;
    border-radius: 4px;
    padding: 0.33rem 0.62rem;
    font-size: 0.935rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.source-badge {
    display: inline-block;
    padding: 0.12rem 0.41rem;
    border-radius: 3px;
    font-size: 0.825rem;
    font-weight: 600;
}

.source-badge.live {
    background: #e8f5e9;
    color: #2e7d32;
}

.source-badge.estimate {
    background: #fff3e0;
    color: #e65100;
}

.source-badge.stale {
    background: #e3f2fd;
    color: #1565c0;
}

.error {
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ffcc80;
    border-radius: 4px;
    padding: 0.83rem;
    font-weight: 500;
}

.savings-warning {
    margin-top: 1rem;
    padding: 0.62rem 0.83rem;
    background: #e3f2fd;
    color: var(--color-primary);
    border: 1px solid #90caf9;
    border-radius: 4px;
    font-size: 0.99rem;
}

table {
    width: 100%;
    border-collapse: collapse;
}

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

th {
    font-weight: 600;
    background: #f5f5f5;
}

.materials-price-table th,
.materials-price-table td {
    white-space: nowrap;
}

.materials-price-table th:nth-child(2),
.materials-price-table td:nth-child(2) {
    white-space: normal;
    min-width: 10rem;
    max-width: 18rem;
}

.score-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 0.33rem;
    border-radius: 4px;
    background: var(--color-card-bg);
    font-weight: 600;
    font-size: 0.935rem;
    border: 1px solid;
}

.score-badge.high { color: var(--color-diy); border-color: var(--color-diy); }
.score-badge.medium { color: var(--color-borderline); border-color: var(--color-borderline); }
.score-badge.low { color: var(--color-hire); border-color: var(--color-hire); }

.score-badge.difficulty-high { color: var(--color-diy); border-color: var(--color-diy); }
.score-badge.difficulty-medium { color: var(--color-borderline); border-color: var(--color-borderline); }
.score-badge.difficulty-low { color: #c62828; border-color: #c62828; }

.cost-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
    gap: 0.75rem;
}

.cost-item {
    background: #f5f5f5;
    padding: 0.83rem;
    border-radius: 4px;
    text-align: center;
}

.cost-item .label {
    font-size: 0.935rem;
    color: #666;
    margin-bottom: 0.25rem;
}

.cost-item .value {
    font-size: 1.375rem;
    font-weight: bold;
}

.borderline-note {
    margin-bottom: 1rem;
    color: #5d4037;
    font-weight: 500;
}

.material-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 1rem;
}

.material-header h3 {
    margin: 0;
}

.btn-shop,
.btn-video-search {
    display: inline-block;
    padding: 0.33rem 0.7rem;
    border-radius: 4px;
    background: transparent;
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
    text-decoration: none;
    font-size: 0.935rem;
    font-weight: 600;
    -webkit-tap-highlight-color: transparent;
}

.btn-shop:hover,
.btn-shop:focus-visible,
.btn-video-search:hover,
.btn-video-search:focus-visible {
    background: transparent;
    color: var(--color-primary);
    text-decoration: underline;
}

.shop-link,
.video-link {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
}

.shop-link:hover,
.video-link:hover {
    text-decoration: underline;
}

.video-guide-intro {
    margin-bottom: 0.75rem;
    color: #555;
}

.video-list {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 1rem;
}

.video-item {
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.video-item:last-child {
    border-bottom: none;
}

.video-channel {
    color: #666;
    font-size: 0.935rem;
}

.video-source {
    margin-left: 0.25rem;
}

.next-steps h3 {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.materials-needed {
    margin-bottom: 1rem;
}

.materials-needed h3 {
    margin-top: 0;
}

.tools-needed {
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 0.62rem 0.83rem;
    margin-bottom: 1rem;
}

.tools-needed h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.tools-needed ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tools-needed li {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: 0.21rem 0.5rem;
    font-size: 0.99rem;
    border-bottom: 1px solid var(--color-border);
}

.footer {
    /* Stack share buttons above the disclaimer so neither is squeezed into a
       narrow column (which made the footer eat ~38% of small phone screens). */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    justify-content: center;
    min-height: var(--header-height);
    padding: 0.5rem 1.25rem;
    padding-bottom: calc(0.5rem + var(--safe-bottom));
    padding-left: calc(1.25rem + var(--safe-left));
    padding-right: calc(1.25rem + var(--safe-right));
    border-top: 1px solid #e8ecf0;
    background: var(--color-card-bg);
    /* Keep share icons in view while scrolling results */
    position: sticky;
    bottom: 0;
    z-index: 40;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.06);
}

.footer .share-actions {
    margin: 0;
    padding: 0;
    border: none;
    width: 100%;
}

.footer .share-actions-buttons {
    gap: 0.42rem;
    flex-wrap: wrap;
}

.footer .share-btn:not(.share-btn-copy) {
    width: 32px;
    height: 32px;
}

.footer .share-btn-icon {
    width: 15px;
    height: 15px;
}

.footer .share-btn-copy {
    width: auto;
    height: 32px;
    min-height: 32px;
    padding: 0 0.66rem;
    font-size: 0.85rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem 0.9rem;
    margin: 0;
    padding: 0.15rem 0 0;
    font-size: 0.88rem;
}

.footer-links a {
    color: var(--color-text-muted, #5a6570);
    text-decoration: none;
}

.footer-links a:hover,
.footer-links a:focus-visible {
    color: var(--color-primary, #1e3a5f);
    text-decoration: underline;
}

.footer-tagline {
    margin: 0;
    padding: 0;
    font-size: 0.78rem;
    color: var(--color-text-muted, #8a939c);
    text-align: center;
}

.footer-tagline a {
    color: inherit;
    text-decoration: underline;
}

.seo-trust-panel h2 {
    margin-top: 0;
}

.seo-faq-list {
    margin: 0;
    padding: 0;
}

.seo-faq-item {
    margin: 0 0 1rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--color-border, #e8ecf0);
}

.seo-faq-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.seo-faq-item dt {
    font-weight: 650;
    margin: 0 0 0.35rem;
}

.seo-faq-item dd {
    margin: 0;
    color: var(--color-text-muted, #3d4650);
    line-height: 1.5;
}

.home-popular-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr));
    gap: 0.45rem 1rem;
    list-style: none;
    margin: 0.5rem 0 0.75rem;
    padding: 0;
}

.home-popular-list a {
    color: var(--color-primary, #1e3a5f);
    text-decoration: none;
    font-weight: 550;
}

.home-popular-list a:hover {
    text-decoration: underline;
}

.home-popular-repairs {
    margin-bottom: 1rem;
}

.home-categories {
    margin-bottom: 1rem;
}

.seo-intro p {
    margin: 0 0 0.75rem;
    line-height: 1.55;
    max-width: 48rem;
}

.seo-intro p:last-child {
    margin-bottom: 0;
}

.seo-bullet-list {
    margin: 0.25rem 0 0;
    padding-left: 1.2rem;
    line-height: 1.5;
}

.seo-bullet-list li {
    margin-bottom: 0.45rem;
}

.seo-bullet-list li:last-child {
    margin-bottom: 0;
}

.directory-category-hubs {
    margin-bottom: 1.25rem;
}

.directory-hub-list li {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
}

.directory-hub-count {
    font-size: 0.85rem;
    color: var(--color-text-muted, #8a939c);
}

.directory-category-name {
    color: inherit;
    text-decoration: none;
    font-weight: 650;
}

.directory-category-name:hover {
    text-decoration: underline;
    color: var(--color-primary, #1e3a5f);
}

.category-repair-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.category-repair-item {
    border-bottom: 1px solid var(--color-border, #e8ecf0);
}

.category-repair-item:last-child {
    border-bottom: none;
}

.category-repair-link {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.7rem 0.15rem;
    text-decoration: none;
    color: inherit;
}

.category-repair-link:hover .category-repair-label {
    text-decoration: underline;
    color: var(--color-primary, #1e3a5f);
}

.category-repair-label {
    font-weight: 600;
    color: var(--color-primary, #1e3a5f);
}

.category-repair-meta {
    font-size: 0.88rem;
    color: var(--color-text-muted, #5a6570);
}

.about-content {
    background: var(--color-card-bg);
    border-radius: 8px;
    padding: 1.65rem;
    border: 1px solid var(--color-border);
}

.about-content ul {
    margin: 1rem 0;
    padding-left: 2rem;
}

.about-content li {
    margin-bottom: 0.75rem;
}

.symptom-search-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.symptom-search-wrapper #symptom-search {
    width: 100%;
    min-height: 3.75rem;
    resize: vertical;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: inherit;
    font-size: 1.05rem;
    line-height: 1.5;
}

.symptom-search-btn {
    align-self: flex-start;
    padding: 0.7rem 1.1rem;
}

.triage-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: 0 0 8px 8px;
    border-top: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 10;
    max-height: 320px;
    overflow-y: auto;
}

.triage-result-item {
    display: flex;
    flex-direction: column;
    padding: 0.62rem 0.83rem;
    cursor: pointer;
    border-bottom: 1px solid var(--color-border);
    border-left: 3px solid transparent;
    -webkit-tap-highlight-color: transparent;
}

.triage-result-item:last-child {
    border-bottom: none;
}

.triage-result-item:hover,
.triage-result-item:focus {
    background: transparent;
    outline: none;
}

.triage-result-item.highlighted {
    background: transparent;
    border-left-color: var(--color-primary);
    outline: none;
}

.triage-result-label {
    font-weight: 600;
    font-size: 1.045rem;
}

.triage-result-meta {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.2rem;
}

.triage-result-category {
    font-size: 0.88rem;
    color: #888;
    text-transform: capitalize;
}

.triage-confidence-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 20px;
    padding: 0 0.29rem;
    border-radius: 10px;
    font-size: 0.77rem;
    font-weight: 700;
    background: #e8f5e9;
    color: #2e7d32;
}

.triage-confidence-badge.medium {
    background: #fff8e1;
    color: #f57f17;
}

.triage-confidence-badge.low {
    background: #fff3e0;
    color: #e65100;
}

.triage-result-reason {
    font-size: 0.88rem;
    color: #777;
    margin-top: 0.2rem;
}

.triage-searching {
    padding: 0.62rem 0.83rem;
    color: #999;
    font-size: 0.99rem;
}

.triage-no-results {
    padding: 0.62rem 0.83rem;
    color: #999;
    font-size: 0.99rem;
}

/* --- Skill picker --- */

.skill-picker {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.skill-option {
    flex: 1 1 0;
    min-width: 6.5rem;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    padding: 0.65rem 0.55rem;
    min-height: var(--touch-min);
    background: transparent;
    border: 2px solid #d7d9db;
    border-radius: 8px;
    cursor: pointer;
    font: inherit;
    -webkit-tap-highlight-color: transparent;
}

.skill-option:hover,
.skill-option:focus-visible {
    background: transparent;
    border-color: #d7d9db;
}

.skill-option.selected {
    border-color: #4a6da7;
    background: #eef3fb;
}

.skill-option.selected:hover,
.skill-option.selected:focus-visible {
    background: #eef3fb;
    border-color: #4a6da7;
}

.skill-option .skill-label {
    font-weight: 600;
    font-size: 1.045rem;
}

/* Desktop: hover tooltips. Touch/small screens show hints inline (see media queries). */
.skill-option .skill-hint {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(0.25rem);
    margin-bottom: 0.25rem;
    padding: 0.33rem 0.62rem;
    background: #333;
    color: #fff;
    font-size: 0.825rem;
    white-space: nowrap;
    border-radius: 4px;
    pointer-events: none;
    opacity: 0;
    z-index: 20;
    transition: opacity 0.15s ease;
}

.skill-option .skill-hint::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
}

@media (hover: hover) and (pointer: fine) {
    .skill-option:hover .skill-hint,
    .skill-option:focus .skill-hint,
    .skill-option:focus-visible .skill-hint {
        opacity: 1;
    }
}

/* --- Personalization note on results --- */

.personalization-note {
    background: #eef3fb;
    border: 1px solid #b9c8e0;
    border-left: 4px solid #4a6da7;
    border-radius: 4px;
    padding: 0.62rem 0.83rem;
    margin-bottom: 1.5rem;
    font-size: 0.99rem;
    color: #2c3e50;
}

/* --- Share actions --- */
.share-actions-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid #d0d7de;
    background: transparent;
    color: #57606a;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.15s ease, border-color 0.15s ease;
    padding: 0;
    font: inherit;
    -webkit-tap-highlight-color: transparent;
}

.share-btn:hover,
.share-btn:focus-visible {
    background: transparent;
}

.share-btn-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.share-btn-facebook:hover {
    color: #1877f2;
    border-color: #1877f2;
}

.share-btn-twitter:hover {
    color: #000;
    border-color: #000;
}

.share-btn-linkedin:hover {
    color: #0a66c2;
    border-color: #0a66c2;
}

.share-btn-whatsapp:hover {
    color: #25d366;
    border-color: #25d366;
}

.share-btn-email:hover {
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.share-btn-copy {
    width: auto;
    min-height: 40px;
    border-radius: 4px;
    padding: 0 0.85rem;
    gap: 0.4rem;
    font-size: 0.95rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.share-btn-label {
    white-space: nowrap;
}

.share-btn-copy:hover {
    color: var(--color-primary);
    border-color: var(--color-primary);
}

/* --- SEO landing pages --- */
.seo-cost-summary .seo-cost-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
    gap: 0.75rem;
    margin: 1rem 0;
}

.seo-cost-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.seo-cost-label {
    font-size: 0.935rem;
    color: var(--color-text-muted, #666);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.seo-cost-value {
    font-size: 1.54rem;
    font-weight: 700;
    color: var(--color-text);
}

.seo-savings {
    color: var(--color-primary);
}

.seo-facts,
.seo-materials,
.seo-steps {
    margin: 0.75rem 0 0 1.25rem;
    line-height: 1.6;
}

.seo-materials li,
.seo-steps li {
    margin-bottom: 0.35rem;
}

/* --- Repair directory --- */
.repair-directory {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1.5rem;
    max-width: 640px;
}

.directory-category {
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    overflow: hidden;
}

.directory-category[open] {
    border-color: var(--color-primary);
    box-shadow: 0 2px 8px rgba(21, 101, 192, 0.1);
}

.directory-category-summary {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.83rem 1.03rem;
    cursor: pointer;
    list-style: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.directory-category-summary:hover {
    background: transparent;
}

.directory-category-summary::-webkit-details-marker {
    display: none;
}

.directory-category-summary::after {
    content: '\25BC';
    margin-left: auto;
    font-size: 0.66rem;
    color: #999;
    transition: transform 0.15s ease;
}

.directory-category[open] .directory-category-summary::after {
    transform: rotate(180deg);
}

.directory-category-name {
    flex: 1;
    font-size: 1.21rem;
    font-weight: 600;
    color: var(--color-primary);
}

.directory-category-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 0.33rem;
    background: #e3f2fd;
    color: var(--color-primary);
    border-radius: 12px;
    font-size: 0.825rem;
    font-weight: 700;
}

.directory-repair-list {
    list-style: none;
    margin: 0;
    padding: 0.5rem 1.03rem 0.83rem;
    border-top: 1px solid var(--color-border);
    background: #fafafa;
}

.directory-repair-list li {
    margin-bottom: 0.4rem;
}

.directory-repair-list a {
    color: var(--color-primary);
    text-decoration: none;
    font-size: 1.045rem;
}

.directory-repair-list a:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

/* --- SEO landing page ZIP form --- */
.seo-analyze-form {
    margin-top: 1.25rem;
}

.seo-zip-label {
    display: block;
    font-size: 0.99rem;
    margin-bottom: 0.5rem;
    color: var(--color-text);
}

.seo-zip-row {
    display: flex;
    gap: 0.65rem;
    flex-wrap: wrap;
    align-items: stretch;
}

.seo-zip-row input[type="text"] {
    flex: 1 1 10rem;
    min-width: 0;
    max-width: 14rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 1.05rem;
    min-height: var(--touch-min);
}

.seo-zip-row .btn {
    flex: 0 0 auto;
}

.seo-zip-row input[type="text"]:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(21, 101, 192, 0.15);
}

/* Brief highlight pulse when a CTA jumps the user to the ZIP form. */
.seo-zip-row input[type="text"].seo-zip-highlight {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.25);
    transition: box-shadow 0.25s ease;
}

/* --- Batch A: SEO landing page visual polish --- */

/* Colored cost items */
.seo-cost-item-diy,
.seo-cost-item-pro,
.seo-cost-item-savings {
    background: #e3f2fd;
    border: 1px solid #90caf9;
    border-radius: 8px;
    padding: 0.83rem 1.03rem;
}

.seo-cost-item-savings {
    border-width: 2px;
    border-color: var(--color-primary);
}

.seo-cost-item-diy .seo-cost-value,
.seo-cost-item-pro .seo-cost-value,
.seo-cost-item-savings .seo-cost-value {
    color: var(--color-primary);
}

/* Difficulty meter + risk badge */
.seo-difficulty-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.seo-difficulty-meter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.seo-difficulty-label {
    font-size: 0.935rem;
    font-weight: 600;
    color: var(--color-text);
}

.seo-difficulty-dots {
    display: inline-flex;
    gap: 0.25rem;
}

.seo-difficulty-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--color-border);
    display: inline-block;
}

.seo-difficulty-dot.filled {
    background: var(--color-primary);
}

.seo-difficulty-value {
    font-size: 0.935rem;
    font-weight: 700;
    color: var(--color-primary);
}

.seo-risk-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.29rem 0.75rem;
    border-radius: 20px;
    font-size: 0.88rem;
    font-weight: 700;
    text-transform: capitalize;
}

.seo-risk-low,
.seo-risk-medium,
.seo-risk-high {
    background: #e3f2fd;
    color: var(--color-primary);
    border: 1px solid #90caf9;
}

/* Compact facts list */
.seo-facts-compact {
    list-style: none;
    margin: 0;
    padding: 0;
}

.seo-facts-compact li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.45rem 0;
    border-bottom: 1px solid var(--color-border);
}

.seo-facts-compact li:last-child {
    border-bottom: none;
}

.seo-fact-label {
    font-size: 0.99rem;
    color: #666;
}

.seo-fact-value {
    font-size: 0.99rem;
    font-weight: 600;
    color: var(--color-primary);
}

.card:has(.seo-difficulty-row) .caution-notice {
    background: #e3f2fd;
    color: var(--color-primary);
    border: 1px solid #90caf9;
    border-left: 4px solid var(--color-primary);
}

/* DIY steps teaser */
.seo-steps-teaser {
    counter-reset: step;
    list-style: none;
    padding: 0;
    margin: 0.75rem 0;
}

.seo-steps-teaser li {
    counter-increment: step;
    padding: 0.5rem 0 0.5rem 2rem;
    position: relative;
    margin-bottom: 0.35rem;
    border-bottom: 1px solid var(--color-border);
}

.seo-steps-teaser li:last-child {
    border-bottom: none;
}

.seo-steps-teaser li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0.5rem;
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    background: var(--color-primary);
    color: #fff;
    border-radius: 50%;
    font-size: 0.825rem;
    font-weight: 700;
}

.seo-steps-cta {
    margin-top: 1rem;
    text-align: center;
}

.seo-steps-cta .btn {
    display: inline-block;
    text-decoration: none;
}

/* Bottom CTA closing section */
.seo-cta-closing {
    background: linear-gradient(135deg, #eef3fb 0%, #e3f2fd 100%);
    border: 2px solid var(--color-primary);
    text-align: center;
}

.seo-cta-closing h2 {
    color: var(--color-primary);
}

/* Common DIY mistakes (results + SEO) */
.severity-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.12rem 0.45rem;
    border-radius: 3px;
    line-height: 1.3;
    flex-shrink: 0;
}

.severity-badge.severity-high {
    background: #fdecea;
    color: #b71c1c;
    border: 1px solid #ef9a9a;
}

.severity-badge.severity-medium {
    background: #fff8e1;
    color: #e65100;
    border: 1px solid #ffcc80;
}

.severity-badge.severity-low {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.common-mistakes-list,
.seo-mistakes-list,
.hire-mistakes-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.common-mistake-item,
.seo-mistake-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--color-border);
}

.common-mistake-item:last-child,
.seo-mistake-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.common-mistake-head,
.seo-mistake-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.common-mistake-title,
.seo-mistake-title {
    font-weight: 600;
    font-size: 0.99rem;
    line-height: 1.35;
}

.common-mistake-detail,
.seo-mistake-detail {
    margin: 0 0 0.35rem 0;
    font-size: 0.92rem;
    line-height: 1.45;
    color: var(--color-text-muted, #555);
}

.common-mistake-avoid {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.45;
    color: var(--color-text, #222);
}

.common-mistake-item.severity-high {
    border-left: 3px solid #c62828;
    padding-left: 0.75rem;
}

.hire-mistakes-intro {
    margin: 0 0 0.75rem 0;
    font-size: 0.95rem;
    line-height: 1.45;
}

.hire-mistake-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0;
    border-bottom: 1px solid var(--color-border);
}

.hire-mistake-item:last-child {
    border-bottom: none;
}

.hire-mistake-title {
    font-size: 0.95rem;
    font-weight: 500;
}

.hire-mistakes-cta {
    display: inline-block;
    margin-top: 0.85rem;
    font-weight: 600;
    color: var(--color-primary);
    text-decoration: none;
}

.hire-mistakes-cta:hover {
    text-decoration: underline;
}

.seo-common-mistakes .seo-steps-cta {
    margin-top: 1rem;
}

/* --- Hazards & safety alerts --- */

.hazards-card-high {
    border-color: #ef6c00;
    box-shadow: 0 0 0 1px rgba(239, 108, 0, 0.18);
}

.hazards-intro {
    margin: 0 0 0.75rem 0;
    font-size: 0.95rem;
    line-height: 1.45;
    color: var(--color-text-muted, #555);
}

.hazards-list,
.seo-hazards-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.hazard-item,
.seo-hazard-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--color-border);
}

.hazard-item:last-child,
.seo-hazard-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.hazard-item.severity-high,
.seo-hazard-item.severity-high {
    border-left: 3px solid #e65100;
    padding-left: 0.75rem;
    background: linear-gradient(90deg, rgba(255, 243, 224, 0.55), transparent 70%);
}

.hazard-head,
.seo-hazard-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.5rem;
    margin-bottom: 0.35rem;
}

.hazard-type-badge,
.seo-hazard-type-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #5d4037;
    background: #fff3e0;
    border: 1px solid #ffcc80;
    border-radius: 3px;
    padding: 0.1rem 0.4rem;
}

.hazard-title,
.seo-hazard-title {
    font-weight: 600;
    font-size: 0.99rem;
    line-height: 1.35;
}

.hazard-detail,
.seo-hazard-detail {
    margin: 0 0 0.35rem 0;
    font-size: 0.92rem;
    line-height: 1.45;
    color: var(--color-text-muted, #555);
}

.hazard-stop-if,
.seo-hazard-stop-if {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.45;
    color: #bf360c;
    font-weight: 500;
}

.report-hazards .hazard-stop-if {
    color: #bf360c;
}

.seo-cta-closing p {
    margin-bottom: 1rem;
    color: #37474f;
}

.seo-cta-closing .seo-zip-row {
    justify-content: center;
}

/* --- Batch B: Content structure --- */

/* Trust signal under cost summary */
.seo-trust-signal {
    font-size: 0.825rem;
    color: #888;
    margin: 0.5rem 0 0;
    line-height: 1.4;
}

/* Materials table */
.seo-materials-table {
    margin: 0.75rem 0;
}

.seo-materials-table th {
    font-size: 0.935rem;
}

.seo-materials-table td {
    font-size: 0.99rem;
}

.seo-materials-price-col {
    text-align: right;
    white-space: nowrap;
}

.seo-materials-table tfoot td {
    font-weight: 700;
    border-top: 2px solid var(--color-border);
    border-bottom: none;
    padding-top: 0.62rem;
}

.seo-materials-total {
    color: var(--color-diy);
}

/* Related repairs */
.seo-related-card h2 {
    font-size: 1.21rem;
}

.seo-related-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.seo-related-list li {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 0.33rem 0.75rem;
    transition: border-color 0.15s ease;
}

.seo-related-list li:hover {
    border-color: var(--color-primary);
    background: var(--color-bg);
}

.seo-related-list a {
    color: var(--color-text);
    text-decoration: none;
    font-size: 0.99rem;
}

.seo-related-list a:hover {
    color: var(--color-primary);
}

.seo-related-browse {
    margin-top: 0.75rem;
    font-size: 0.935rem;
}

.seo-related-browse a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
}

.seo-related-browse a:hover {
    text-decoration: underline;
}

/* --- Batch C: Imagery / icons --- */

/* Section header icons */
.seo-section-icon {
    display: inline-block;
    width: 22px;
    height: 22px;
    max-width: 22px;
    max-height: 22px;
    margin-right: 0.5rem;
    vertical-align: -4px;
    color: var(--color-primary);
    flex-shrink: 0;
}

/* Section header as flex for icon alignment */
.card h2:has(.seo-section-icon) {
    display: flex;
    align-items: center;
    gap: 0;
}

/* CTA closing icon color override */
.seo-cta-closing .seo-section-icon {
    color: var(--color-primary);
}



/* --- Main page / results page visual improvements --- */

/* Form labels with section icons (same approach as .card h2:has(.seo-section-icon)) */
.form-group label:has(.seo-section-icon) {
    display: flex;
    align-items: center;
    gap: 0;
}

.form-group label .seo-section-icon {
    width: 16px;
    height: 16px;
}

/* Colored cost items (results page) */
.cost-item-diy,
.cost-item-pro,
.cost-item-savings,
.cost-item-neutral {
    background: #e3f2fd;
    border: 1px solid #90caf9;
}

.cost-item-savings {
    border-width: 2px;
    border-color: var(--color-primary);
}

.cost-item-diy .value,
.cost-item-pro .value,
.cost-item-savings .value,
.cost-item-neutral .value {
    color: var(--color-primary);
}

/* --- Main page card layout (aligned with SEO / browse pages) --- */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.home-card-intro {
    color: #666;
    font-size: 0.99rem;
    margin: -0.5rem 0 1rem;
    line-height: 1.5;
}

/* Homepage: equal compact gaps (75% of previous smallest 2rem gap) */
.container:has(#analyze-form) > .hero {
    margin-bottom: 1.5rem;
}

.container:has(#analyze-form) {
    padding-bottom: 1.5rem;
}

#analyze-form .intake-card {
    margin-bottom: 0;
}

.home-card-intro a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
}

.home-card-intro a:hover {
    text-decoration: underline;
}

#analyze-form .card .form-group {
    margin-bottom: 0;
}

#analyze-form .card .form-group + .form-group {
    margin-top: 1.25rem;
}

#analyze-form .intake-footer .skill-picker {
    justify-content: center;
    margin-bottom: 0.25rem;
}

#analyze-form .intake-footer .seo-trust-signal {
    text-align: center;
    margin-top: 1rem;
}

/* Category tile icons */
.category-tile-icon {
    display: block;
    width: 18px;
    height: 18px;
    max-width: 18px;
    max-height: 18px;
    flex-shrink: 0;
    color: var(--color-primary);
}

.category-tile-header {
    gap: 0.6rem;
}

/* Align category grid with browse directory cards */
.category-tile {
    background: var(--color-card-bg);
}

.category-tile.expanded {
    box-shadow: 0 2px 8px rgba(21, 101, 192, 0.12);
}

.directory-category-name::first-letter {
    text-transform: uppercase;
}

/* --- PR1: Compact results & progressive disclosure --- */

.collapsible-card {
    /* Must win over later .card padding media-query tweaks */
    padding: 0 !important;
    overflow: hidden;
}

.collapsible-card-header {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    width: 100%;
    padding: 0.675rem 0.837rem;
    border: none;
    background: var(--color-card-bg);
    font: inherit;
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.collapsible-card-header:hover,
.collapsible-card-header:focus-visible {
    background: var(--color-card-bg);
}

.collapsible-card-title {
    font-size: 1.375rem;
    font-weight: 600;
    flex: 0 0 auto;
}

.collapsible-card-summary {
    flex: 1 1 auto;
    font-size: 0.935rem;
    color: #666;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.collapsible-card-chevron {
    font-size: 0.66rem;
    color: #999;
    transition: transform 0.15s ease;
    flex-shrink: 0;
    margin-left: auto;
}

.collapsible-card.is-collapsed .collapsible-card-chevron {
    transform: rotate(-90deg);
}

.collapsible-card-body {
    padding: 0 1.24rem 1.24rem;
    border-top: 1px solid var(--color-border);
}

.collapsible-card-body > .baseline-notice,
.collapsible-card-body > .live-notice {
    margin-top: 1rem;
}

/* --- Hire a Pro (local contractors) --- */

.field-hint {
    margin: 0.35rem 0 0;
    font-size: 0.85rem;
    color: #666;
}

.required-mark {
    color: var(--color-hire, #e65100);
    font-weight: 700;
}

.contractors-body {
    padding-top: 0.85rem;
}

.contractor-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.65rem 0.85rem;
    margin-bottom: 0.85rem;
}

.contractor-toolbar .contractor-control {
    flex: 1 1 8rem;
}

.contractor-toolbar .contractor-filters {
    flex: 1 1 100%;
}

.contractor-category-chip {
    display: inline-flex;
    align-items: center;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    border: 1px solid var(--color-border);
    background: #f0f4f8;
    color: #334;
    align-self: center;
}

.contractor-control {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 7.5rem;
}

.contractor-control label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.contractor-select {
    font: inherit;
    font-size: 1rem;
    padding: 0.55rem 0.65rem;
    min-height: var(--touch-min);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: #fff;
    color: #222;
    width: 100%;
}

.contractor-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem 0.9rem;
    align-self: center;
}

.contractor-filter-check {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.95rem;
    color: #333;
    cursor: pointer;
    user-select: none;
    min-height: var(--touch-min);
    padding: 0.2rem 0.15rem;
}

.contractor-filter-check input {
    width: 1.1rem;
    height: 1.1rem;
    cursor: pointer;
    flex-shrink: 0;
}

.contractors-empty {
    margin: 0.25rem 0 0;
    color: #555;
    line-height: 1.45;
}

.contractor-fallback {
    margin: 0.75rem 0 0;
    padding: 0.75rem 0.9rem;
    background: #f6f8fb;
    border: 1px solid #e1e6ee;
    border-radius: 8px;
}

.contractor-fallback-heading {
    margin: 0 0 0.4rem;
    font-weight: 600;
    color: #333;
}

.contractor-fallback-list {
    margin: 0;
    padding-left: 1.1rem;
    line-height: 1.5;
}

.contractor-fallback-item {
    margin: 0.2rem 0;
    color: #444;
}

.contractor-fallback-label {
    font-weight: 600;
}

.contractor-fallback-link {
    color: #1a56db;
}

.contractor-fallback-region {
    color: #666;
    font-size: 0.9rem;
}

.contractor-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.contractor-pager-host {
    margin-top: 0.75rem;
}

.contractor-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.contractor-pager-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 0.55rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: #fff;
    color: #333;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.contractor-pager-btn:hover:not(:disabled),
.contractor-pager-btn:focus-visible:not(:disabled) {
    background: #f5f5f5;
    border-color: #bbb;
    outline: none;
}

.contractor-pager-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.contractor-pager-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #555;
    min-width: 7rem;
    text-align: center;
}

.contractor-card {
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 0.85rem 1rem;
    background: #fafafa;
}

.contractor-card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.6rem;
}

.contractor-name {
    font-weight: 600;
    font-size: 1.05rem;
    color: #222;
}

.contractor-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.contractor-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    border: 1px solid var(--color-border);
    color: #555;
    background: #fff;
}

.contractor-badge.licensed {
    color: #1b5e20;
    border-color: #a5d6a7;
    background: #e8f5e9;
}

.contractor-badge.insured {
    color: #0d47a1;
    border-color: #90caf9;
    background: #e3f2fd;
}

.contractor-detail-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 0.55rem;
    margin-top: 0.3rem;
    font-size: 0.9rem;
    color: #666;
}

.contractor-detail-row .contractor-meta,
.contractor-detail-row .contractor-years {
    margin-top: 0;
}

/* Dot separator between meta and years when both present */
.contractor-detail-row .contractor-meta + .contractor-years::before {
    content: '\00b7';
    margin-right: 0.55rem;
    color: #999;
}

.contractor-years {
    color: #37474f;
    font-weight: 500;
}

.contractor-contact {
    margin-top: 0.45rem;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 0.75rem;
    font-size: 0.9rem;
    color: #444;
}

.contractor-contact .contractor-phone-line + .contractor-website-line::before {
    content: '\00b7';
    margin-right: 0.75rem;
    color: #999;
}

.contractor-website-link {
    color: var(--color-primary, #1565c0);
    text-decoration: none;
    font-weight: 500;
    word-break: break-all;
}

.contractor-website-link:hover,
.contractor-website-link:focus-visible {
    text-decoration: underline;
}

.score-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}

.score-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: #f5f5f5;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    padding: 0.15rem 0.55rem 0.15rem 0.65rem;
    font-size: 0.88rem;
}

.score-chip-label {
    color: #555;
    font-weight: 500;
}

.score-chip .score-badge {
    min-width: 22px;
    height: 22px;
    font-size: 0.825rem;
}

.score-details {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding-top: 0.25rem;
}

.score-detail-row {
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--color-border);
}

.score-detail-row:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.score-detail-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.score-detail-label {
    font-weight: 600;
}

.score-detail-reason {
    margin: 0;
    color: #555;
    font-size: 0.99rem;
    line-height: 1.5;
}

.material-accordion-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.material-accordion {
    border: 1px solid var(--color-border);
    border-radius: 6px;
    overflow: hidden;
}

.material-accordion-trigger {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.65rem;
    width: 100%;
    padding: 0.75rem 0.85rem;
    min-height: var(--touch-min);
    border: none;
    background: #fafafa;
    font: inherit;
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.material-accordion-trigger:hover,
.material-accordion-trigger:focus-visible {
    background: #fafafa;
}

.material-accordion-name {
    font-weight: 600;
    font-size: 1rem;
}

.material-accordion-price {
    font-size: 0.935rem;
    color: #666;
}

.material-accordion-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
    flex-shrink: 0;
}

.material-accordion-chevron {
    font-size: 0.66rem;
    color: #999;
    transition: transform 0.15s ease;
    flex-shrink: 0;
    margin-left: auto;
}

.material-accordion.is-collapsed .material-accordion-chevron {
    transform: rotate(-90deg);
}

.material-accordion-panel {
    padding: 0 0.5rem 0.5rem;
    overflow-x: auto;
}

.materials-price-link {
    margin: 0 0 1rem;
    font-size: 0.99rem;
}

.materials-price-link a {
    color: var(--color-primary);
    font-weight: 600;
    text-decoration: none;
}

.materials-price-link a:hover {
    text-decoration: underline;
}

.steps-expand-btn {
    margin-top: 0.35rem;
    padding: 0.25rem 0;
    font-size: 0.99rem;
    color: var(--color-primary);
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 600;
}

.steps-expand-btn:hover {
    text-decoration: underline;
}

#analyze-form.is-collapsed .card {
    display: none;
}

.analysis-form-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    padding: 0.58rem 0.83rem;
    background: #e3f2fd;
    border: 2px solid var(--color-primary);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.analysis-form-summary.hidden {
    display: none;
}

.analysis-form-summary-label {
    font-weight: 600;
    font-size: 1.375rem;
    flex: 1 1 auto;
    min-width: 0;
}

.analysis-form-summary-meta {
    font-size: 0.88rem;
    color: #666;
}

.analysis-form-summary-edit {
    background: transparent;
    border: 1px solid var(--color-primary);
    color: var(--color-primary);
    cursor: pointer;
    font-size: 0.935rem;
    padding: 0.17rem 0.62rem;
    border-radius: 4px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    -webkit-tap-highlight-color: transparent;
}

.analysis-form-summary-edit:hover,
.analysis-form-summary-edit:focus-visible {
    background: transparent;
    text-decoration: underline;
    opacity: 1;
}

/* --- PR2: Combined intake card --- */

.intake-card h2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.intake-path-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.25rem;
    background: #f0f2f5;
    border-radius: 8px;
}

.intake-path-tab {
    flex: 1 1 0;
    padding: 0.65rem 0.75rem;
    min-height: var(--touch-min);
    border: 2px solid transparent;
    border-radius: 6px;
    background: transparent;
    font: inherit;
    font-size: 0.99rem;
    font-weight: 600;
    color: #555;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.intake-path-tab:hover {
    color: var(--color-primary);
    background: transparent;
}

.intake-path-tab.selected {
    background: transparent;
    border-color: var(--color-primary);
    color: var(--color-primary);
    box-shadow: none;
}

.intake-path-tab.selected:hover {
    background: transparent;
}

.intake-panels {
    margin-bottom: 0.5rem;
}

.intake-panel .form-group {
    margin-bottom: 0;
}

.intake-footer {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--color-border);
}

.intake-footer .form-group + .form-group {
    margin-top: 1.25rem;
}

#selection-summary {
    margin: 0.75rem 0 0;
}

.category-accordion {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.category-accordion-item {
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-card-bg);
    overflow: hidden;
}

.category-accordion-item.is-open {
    border-color: var(--color-primary);
    box-shadow: 0 2px 8px rgba(21, 101, 192, 0.1);
}

.category-accordion-trigger {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.7rem 0.83rem;
    border: none;
    background: transparent;
    font: inherit;
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.category-accordion-trigger:hover,
.category-accordion-trigger:focus-visible {
    background: transparent;
}

.category-accordion-name {
    flex: 1;
    font-weight: 600;
    font-size: 1.045rem;
}

.category-accordion-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 0.33rem;
    background: #e3f2fd;
    color: var(--color-primary);
    border-radius: 12px;
    font-size: 0.825rem;
    font-weight: 700;
}

.category-accordion-chevron {
    font-size: 0.66rem;
    color: #999;
    transition: transform 0.15s ease;
}

.category-accordion-item.is-open .category-accordion-chevron {
    transform: rotate(180deg);
}

.category-accordion-panel {
    border-top: 1px solid var(--color-border);
    background: #fafafa;
}

.browse-repair-list {
    max-height: 220px;
    overflow-y: auto;
    padding: 0.33rem;
}

.browse-repair-list .repair-option {
    display: flex;
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    font: inherit;
    cursor: pointer;
    padding: 0.5rem 0.62rem;
    border-radius: 4px;
    -webkit-tap-highlight-color: transparent;
}

.browse-repair-list .repair-option:hover,
.browse-repair-list .repair-option:focus-visible {
    background: transparent;
}

.browse-repair-list .repair-option.selected {
    background: #e3f2fd;
}

.browse-repair-list .repair-option.selected:hover {
    background: #e3f2fd;
}

.browse-directory-link {
    margin: 0.25rem 0 0;
    font-size: 0.99rem;
}

.browse-directory-link a {
    color: var(--color-primary);
    font-weight: 600;
    text-decoration: none;
}

.browse-directory-link a:hover {
    text-decoration: underline;
}

.browse-placeholder {
    color: #888;
    font-size: 0.99rem;
    margin: 0;
}

/* --- Printable analysis report --- */
.report-toolbar-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 1rem;
    margin-bottom: 0;
    padding: 0.85rem 1rem;
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
}

.report-save-btn {
    font-size: 1rem;
    padding: 0.5rem 1.1rem;
    flex-shrink: 0;
}

.report-toolbar-inline-hint {
    color: #666;
    font-size: 0.92rem;
}

.report-toolbar-status {
    width: 100%;
    color: #b71c1c;
    font-size: 0.92rem;
}

.report-page {
    background: #fff;
    color: var(--color-text);
}

.report-page .report-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1.25rem;
    max-width: 720px;
    margin: 0 auto;
    padding: 1rem 1.25rem 0;
}

.report-page .report-toolbar-hint {
    margin: 0;
    color: #666;
    font-size: 0.95rem;
}

.report-document {
    max-width: 720px;
    margin: 0 auto;
    padding: 1.25rem 1.25rem 2.5rem;
}

.report-header {
    border-bottom: 2px solid var(--color-border);
    padding-bottom: 1rem;
    margin-bottom: 1.25rem;
}

.report-brand {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: 0.02em;
    margin-bottom: 0.35rem;
}

.report-title {
    font-size: 1.75rem;
    line-height: 1.25;
    margin: 0 0 0.5rem;
}

.report-meta,
.report-prices-as-of {
    margin: 0.2rem 0;
    color: #555;
    font-size: 0.95rem;
}

.report-prices-as-of {
    font-weight: 600;
}

.report-section {
    margin-bottom: 1.5rem;
    page-break-inside: avoid;
}

.report-section h2 {
    font-size: 1.2rem;
    margin: 0 0 0.65rem;
    color: var(--color-text);
}

.report-section h3 {
    font-size: 1.02rem;
    margin: 0.85rem 0 0.4rem;
}

.report-recommendation {
    border-radius: 8px;
    padding: 1rem 1.1rem;
    border: 1px solid var(--color-border);
}

.report-recommendation.diy {
    background: #e8f5e9;
    border-color: #a5d6a7;
}

.report-recommendation.hire {
    background: #fff3e0;
    border-color: #ffcc80;
}

.report-recommendation.borderline {
    background: #fffde7;
    border-color: #fff59d;
}

.report-rec-title {
    font-size: 1.35rem;
    margin: 0 0 0.35rem;
}

.report-rec-meta {
    margin: 0;
    color: #444;
    font-size: 0.95rem;
}

.report-note {
    margin: 0.65rem 0 0;
    font-size: 0.95rem;
    color: #444;
}

.report-caution-note,
.report-caution {
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 6px;
    padding: 0.75rem 0.9rem;
}

.report-emergency {
    background: #ffebee;
    border: 1px solid #ef9a9a;
    border-radius: 8px;
    padding: 1rem 1.1rem;
}

.report-emergency h2 {
    color: #b71c1c;
}

.report-warning-text {
    font-weight: 600;
    margin: 0.4rem 0 0.6rem;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.report-table th,
.report-table td {
    text-align: left;
    padding: 0.45rem 0.5rem;
    border-bottom: 1px solid var(--color-border);
    vertical-align: top;
}

.report-cost-table th {
    font-weight: 500;
    color: #444;
    width: 60%;
}

.report-cost-table td {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.report-materials-total {
    margin: 0.65rem 0 0;
    font-weight: 600;
}

.report-list,
.report-steps,
.report-mistakes {
    margin: 0.35rem 0 0 1.25rem;
    line-height: 1.55;
}

.report-list li,
.report-steps li {
    margin-bottom: 0.3rem;
}

.report-mistakes {
    list-style: none;
    margin-left: 0;
    padding: 0;
}

.report-mistake {
    margin-bottom: 0.85rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--color-border);
}

.report-mistake:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.report-mistake-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.report-mistake p {
    margin: 0.25rem 0 0;
    font-size: 0.95rem;
    color: #444;
}

.report-mistake-avoid {
    font-style: italic;
}

.report-disclaimer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 2px solid var(--color-border);
    font-size: 0.85rem;
    color: #555;
    line-height: 1.5;
}

.report-disclaimer p {
    margin: 0 0 0.5rem;
}

.report-footer-meta {
    color: #888;
    font-size: 0.8rem;
}

/* ==========================================================================
   Responsive layout — desktop polish + tablet + phone
   Breakpoints: 900px (narrow desktop/tablet), 767px (mobile nav), 600px (phone)
   ========================================================================== */

/* Desktop: roomier page shell and share bar */
@media (min-width: 901px) {
    .container {
        padding-top: 1.15rem;
        padding-bottom: 2rem;
    }

    .hero {
        margin-bottom: 2.25rem;
    }

    .cost-summary {
        grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
        gap: 1rem;
    }

    .seo-cost-summary .seo-cost-row {
        grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
        gap: 1rem;
    }

    .contractor-toolbar .contractor-filters {
        flex: 0 1 auto;
        margin-left: auto;
    }

    /* Exclude collapsible result sections — they rely on padding: 0 */
    .card:not(.collapsible-card) {
        padding: 1.35rem 1.4rem;
    }
}

/* Narrow desktop / large tablet */
@media (max-width: 900px) {
    :root {
        --space-page-x: 1.15rem;
        --space-page-y: 0.75rem;
    }

    .nav-brand {
        font-size: 1.35rem;
    }

    .nav-links a {
        font-size: 1rem;
        padding: 0.35rem 0.55rem;
    }

    .category-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .repair-directory {
        max-width: none;
    }
}

/* Mobile navigation drawer + compact shell */
@media (max-width: 767px) {
    :root {
        --space-page-x: 0.9rem;
        --space-page-y: 0.65rem;
        --header-height: 3.25rem;
    }

    .navbar {
        padding: 0.4rem var(--space-page-x);
        flex-wrap: nowrap;
        gap: 0.35rem;
    }

    .nav-toggle {
        display: inline-flex;
        margin-left: auto;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: calc(100% + 1px);
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0.15rem;
        padding: 0.5rem 0.65rem 0.75rem;
        background: var(--color-nav-bg);
        border-bottom: 1px solid var(--color-border);
        box-shadow: var(--shadow-drawer);
        z-index: 120;
    }

    .nav-links.is-open {
        display: flex;
    }

    .nav-links a {
        width: 100%;
        min-height: var(--touch-min);
        padding: 0.75rem 0.9rem;
        font-size: 1.05rem;
        border-radius: 8px;
        background-color: var(--color-nav-bg);
    }

    body.nav-open {
        overflow: hidden;
    }

    /* Skill hints as always-visible subtitles (no hover on touch) */
    .skill-option {
        min-width: calc(33.333% - 0.4rem);
        padding: 0.7rem 0.4rem 0.65rem;
        gap: 0.25rem;
    }

    .skill-option .skill-hint {
        position: static;
        transform: none;
        margin: 0;
        padding: 0;
        background: transparent;
        color: #777;
        font-size: 0.72rem;
        font-weight: 500;
        line-height: 1.25;
        white-space: normal;
        text-align: center;
        opacity: 1;
        max-width: 100%;
    }

    .skill-option .skill-hint::after {
        display: none;
    }

    .skill-option.selected .skill-hint {
        color: #4a6da7;
    }

    .skill-option .skill-label {
        font-size: 0.95rem;
    }

    /* ZIP + Analyze: full-width stack on phones */
    .seo-zip-row {
        flex-direction: column;
        align-items: stretch;
    }

    .seo-zip-row input[type="text"] {
        max-width: none;
        flex: 1 1 auto;
        width: 100%;
    }

    .seo-zip-row .btn {
        width: 100%;
    }

    .symptom-search-btn {
        align-self: stretch;
        width: 100%;
    }

    .selection-summary-change {
        width: 100%;
        margin-left: 0;
    }

    .selection-summary-category {
        order: 3;
    }

    .analysis-form-summary-edit {
        min-height: var(--touch-min);
        padding: 0.4rem 0.75rem;
    }

    .report-toolbar-inline {
        flex-direction: column;
        align-items: stretch;
    }

    .report-save-btn {
        width: 100%;
    }

    .seo-steps-cta .btn,
    .seo-cta-closing .btn {
        width: 100%;
        max-width: 100%;
    }

    .footer {
        /* Allow height to grow for touch targets; keep bar usable on phones */
        min-height: var(--header-height);
        gap: 0.3rem;
        padding-top: 0.4rem;
        padding-bottom: calc(0.4rem + var(--safe-bottom));
        padding-left: calc(0.75rem + var(--safe-left));
        padding-right: calc(0.75rem + var(--safe-right));
    }

    .footer .share-actions-buttons {
        gap: 0.35rem;
    }

    .footer .share-btn:not(.share-btn-copy) {
        width: var(--touch-min);
        height: var(--touch-min);
    }

    .footer .share-btn-icon {
        width: 18px;
        height: 18px;
    }

    .footer .share-btn-copy {
        height: var(--touch-min);
        min-height: var(--touch-min);
        font-size: 0.9rem;
        padding: 0 0.85rem;
    }
}

/* Phone refinements */
@media (max-width: 600px) {
    :root {
        --space-page-x: 0.8rem;
        --space-page-y: 0.5rem;
    }

    .container {
        padding-bottom: calc(1.1rem + var(--safe-bottom));
    }

    .hero {
        margin-bottom: 1.25rem;
        text-align: left;
    }

    .hero h1 {
        font-size: 1.55rem;
    }

    .hero p {
        font-size: 0.98rem;
    }

    /* Exclude collapsible result sections — they rely on padding: 0 */
    .card:not(.collapsible-card) {
        padding: 1rem 0.9rem;
        border-radius: 10px;
    }

    .collapsible-card {
        border-radius: 10px;
    }

    .repair-form,
    .about-content {
        padding: 1rem 0.9rem;
    }

    .cost-summary {
        grid-template-columns: 1fr 1fr;
        gap: 0.55rem;
    }

    .cost-item {
        padding: 0.7rem 0.55rem;
    }

    .cost-item .value {
        font-size: 1.15rem;
    }

    .cost-item .label {
        font-size: 0.8rem;
    }

    .seo-cost-summary .seo-cost-row {
        grid-template-columns: 1fr;
    }

    .seo-cost-item-diy,
    .seo-cost-item-pro,
    .seo-cost-item-savings {
        padding: 0.75rem 0.85rem;
    }

    .seo-cost-value {
        font-size: 1.35rem;
    }

    .intake-path-tab {
        font-size: 0.88rem;
        padding: 0.55rem 0.4rem;
    }

    .category-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.4rem;
    }

    .category-accordion-trigger {
        padding: 0.7rem 0.75rem;
        min-height: var(--touch-min);
    }

    .category-accordion-name {
        font-size: 1rem;
    }

    .collapsible-card-header {
        padding: 0.576rem 0.675rem;
    }

    .collapsible-card-body {
        padding: 0 1rem 1rem;
    }

    .material-accordion-actions {
        width: 100%;
        justify-content: space-between;
    }

    .material-accordion-name {
        flex: 1 1 100%;
    }

    .material-accordion-price {
        flex: 1 1 auto;
    }

    .emergency-banner {
        padding: 1rem 0.9rem;
    }

    .emergency-banner .emergency-title {
        font-size: 1.2rem;
    }

    .contractor-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .contractor-toolbar .contractor-control {
        flex: 1 1 auto;
        width: 100%;
    }

    .contractor-toolbar .contractor-filters {
        flex: 1 1 auto;
        width: 100%;
        gap: 0.35rem 0.75rem;
    }

    .contractor-card {
        padding: 0.8rem 0.85rem;
    }

    .triage-results {
        max-height: min(50vh, 280px);
    }

    .seo-difficulty-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.65rem;
    }

    .seo-facts-compact li {
        flex-wrap: wrap;
        gap: 0.25rem 0.75rem;
        align-items: flex-start;
    }

    .report-document {
        padding: 1rem 0.85rem 2rem;
    }

    .report-title {
        font-size: 1.4rem;
    }

    .report-page .report-toolbar {
        padding: 0.85rem 0.85rem 0;
    }

    .analysis-form-summary-label {
        font-size: 1.15rem;
        flex-basis: 100%;
    }

    .btn-shop,
    .btn-video-search {
        min-height: 2.25rem;
        padding: 0.4rem 0.75rem;
    }

    .share-btn {
        width: 44px;
        height: 44px;
    }

    .share-btn-copy {
        min-height: 44px;
    }

    /* Icon-only copy button on phones so all 6 share buttons fit one row,
       keeping the sticky footer compact instead of eating a third of the screen. */
    .footer .share-btn-copy {
        width: 44px;
        height: 44px;
        min-height: 44px;
        padding: 0;
        border-radius: 50%;
    }

    .footer .share-btn-copy .share-btn-label {
        display: none;
    }
}

/* Very small phones */
@media (max-width: 380px) {
    .cost-summary {
        grid-template-columns: 1fr;
    }

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

    .skill-option {
        min-width: 100%;
        flex-direction: row;
        justify-content: flex-start;
        gap: 0.65rem;
        padding: 0.7rem 0.85rem;
        text-align: left;
    }

    .skill-option .skill-hint {
        text-align: left;
        flex: 1;
    }

    .intake-path-tab {
        font-size: 0.82rem;
    }
}

/* Coarse pointers (touch): ensure comfortable targets without waiting for width */
@media (pointer: coarse) {
    .repair-option,
    .triage-result-item,
    .browse-repair-list .repair-option {
        min-height: var(--touch-min);
        padding-top: 0.65rem;
        padding-bottom: 0.65rem;
    }

    .directory-category-summary {
        min-height: var(--touch-min);
    }

    .contractor-pager-btn {
        min-width: var(--touch-min);
        height: var(--touch-min);
    }
}

/* Prefer less motion when the user requests it */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}

/* Keyboard / short viewport: don't pin share bar over focused forms */
@media (max-height: 480px) {
    .footer {
        position: static;
        box-shadow: none;
    }
}

@media print {
    .no-print,
    .site-header,
    .skip-link,
    .nav-toggle,
    .footer {
        display: none !important;
    }

    body.report-page {
        background: #fff;
    }

    .report-document {
        max-width: none;
        padding: 0;
        margin: 0;
    }

    .report-section {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .report-disclaimer {
        break-inside: avoid;
    }

    a[href]::after {
        content: none !important;
    }

    .table-scroll {
        overflow: visible;
    }
}
/* Launch trust surfaces */
.review-status {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    background: #fff8e1;
    border: 1px solid #f9a825;
}

.review-status.reviewed {
    background: #e8f5e9;
    border-color: #2e7d32;
}

.recommendation-summary {
    margin-bottom: 1rem;
    padding: 1.25rem;
    border: 2px solid;
    border-radius: 0.75rem;
}

.recommendation-summary.hire {
    background: #fff3e0;
    border-color: #ef6c00;
}

.recommendation-summary.diy {
    background: #e8f5e9;
    border-color: #2e7d32;
}

.recommendation-summary.borderline {
    background: #fffde7;
    border-color: #f9a825;
}

.recommendation-eyebrow,
.recommendation-meta {
    margin: 0;
}

.recommendation-summary h2 {
    margin: 0.25rem 0;
}

.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.footer-disclaimer {
    max-width: 52rem;
    margin: 0 auto;
    font-size: 0.8rem;
    text-align: center;
}

.legal-content {
    max-width: 52rem;
    margin-inline: auto;
}
