/* Funeral Succession — "private-bank navy & brass" system, ported from the
   approved Claude design comp (docs/incoming/design-drop/). Deep navy ink,
   pine green, brass accents, warm paper neutrals; Source Serif 4 headings,
   Public Sans body. Photography is always duotoned (see .duotone). */

/* Self-hosted variable fonts (latin subset) — same CWV posture as the
   previous DM Sans/Domine pair: preloaded in base.html, font-display swap. */
@font-face {
    font-family: "Source Serif 4";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("../fonts/source-serif-4-latin.e9192c2fe0a3.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "Public Sans";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("../fonts/public-sans-latin.e4c9b081863a.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    /* Palette — "private-bank navy & brass" */
    --ink-950: #071829;      /* footer, topbar, deepest surfaces */
    --ink-900: #0A2138;      /* hero & video bands, dark text on brass */
    --navy-700: #04315C;     /* logo navy — buttons, links, duotone layer, stat band */
    --navy-600: #0A4578;     /* navy button hover */
    --brass-500: #C29A55;    /* featured tag, top rules */
    --brass-400: #D8B878;    /* primary CTA, accents on dark */
    --brass-300: #E6CD9C;    /* brass CTA hover */
    --brass-700: #8C6A2F;    /* accent text on light (AA on paper/white) */
    --pine-700: #24564A;     /* "Confidential" label — the green nod */
    --paper: #F5F1E8;        /* warm section background + card stock */
    --linen: #EDE7D9;        /* deeper warm neutral */
    --white: #FDFCF9;        /* page background, cards */
    --text-900: #1B2A38;     /* body text on light */
    --text-600: #55636F;     /* secondary text on light */
    --cream: #F5F1E8;        /* text on dark (at 75–85% opacity for body) */
    --hairline: rgba(4, 49, 92, 0.2);            /* rules & card borders on light */
    --hairline-dark: rgba(245, 241, 232, 0.18);  /* rules on dark */

    /* Status hues, tuned to the palette */
    --featured: var(--brass-500);
    --contract: #8a3b1e;
    --sold: #76808a;

    /* Type */
    --font-serif: "Source Serif 4", Georgia, serif;   /* 600 headings, 700 stat numerals */
    --font-sans: "Public Sans", Helvetica, sans-serif; /* 400/500 body, 600/700 UI & labels */

    /* Signature textures — horizontal hairlines throughout: linen on paper
       bands & sealed cards, a wider-spaced weave on the dark bands. */
    --tex-linen: repeating-linear-gradient(0deg,
        rgba(4, 49, 92, 0.02) 0 1px, transparent 1px 3px);
    --tex-linen-dark: repeating-linear-gradient(0deg,
        rgba(245, 241, 232, 0.025) 0 1px, transparent 1px 4px);
    --tex-pinstripe-dark: repeating-linear-gradient(0deg,
        rgba(245, 241, 232, 0.03) 0 1px, transparent 1px 5px);

    --shadow: 0 1px 2px rgba(7, 24, 41, 0.08), 0 12px 32px -18px rgba(7, 24, 41, 0.35);
    --shadow-hover: 0 1px 2px rgba(7, 24, 41, 0.08), 0 18px 44px -16px rgba(7, 24, 41, 0.45);
    --radius: 3px;
}

/* In-page anchors must clear the sticky header. Smoothness itself comes
   from Lenis (site.js) — no CSS scroll-behavior, the two would fight. */
html {
    scroll-padding-top: 7rem;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font-sans);
    color: var(--text-900);
    background: var(--white);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
    font-family: var(--font-serif);
    font-weight: 600;
    line-height: 1.2;
    color: var(--ink-900);
    text-wrap: pretty;
}
a { color: var(--navy-700); }
a:hover { color: var(--brass-700); }
img { max-width: 100%; }

summary { list-style: none; }
summary::-webkit-details-marker { display: none; }

.hint { font-size: 0.86rem; color: var(--text-600); }

/* ---------- Shared vocabulary ---------- */

.kicker {
    color: var(--brass-700);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin: 0 0 0.85rem;
}

/* Kicker with a leading brass rule (hero treatment) */
.kicker--rule {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.kicker--rule::before {
    content: "";
    height: 1px;
    width: 44px;
    background: var(--brass-500);
    flex-shrink: 0;
}

.link-arrow {
    color: var(--navy-700);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 5px;
    white-space: nowrap;
}
.link-arrow:hover { color: var(--brass-700); }

/* Framed photograph — thin border, 10px mat, used around every image */
.frame {
    border: 1px solid rgba(4, 49, 92, 0.25);
    padding: 10px;
    background: var(--white);
}
.frame--dark {
    border-color: rgba(245, 241, 232, 0.25);
    background: rgba(245, 241, 232, 0.04);
}

/* Photo treatment: near-original image with a light navy tone layer and a
   faint brass warmth, so the photography reads as one family without going
   dark or faded. (Softened from the comp's full grayscale duotone — Matt.) */
.duotone {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}
.duotone img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(0.92) contrast(1.03);
}
.duotone::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--navy-700);
    mix-blend-mode: multiply;
    opacity: 0.18;
    z-index: 1;
}
.duotone::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(194, 154, 85, 0.14), rgba(10, 33, 56, 0.1));
    mix-blend-mode: screen;
    opacity: 0.6;
    z-index: 2;
}
.duotone--soft::before { opacity: 0.1; }

/* Hairline rule with a centered label — the sealed-card "— CONFIDENTIAL —" */
.rule-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--pine-700);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}
.rule-label::before,
.rule-label::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--hairline);
}
.rule-label--contract { color: var(--contract); }
.rule-label--sold { color: var(--sold); }
.rule-label:empty { gap: 0; }

/* Full-width bands */
.band { padding: 5.5rem 3rem; }
.band--paper { background: var(--paper); background-image: var(--tex-linen); }
.band--ink { background: var(--ink-900); background-image: var(--tex-linen-dark); }
.band--navy { background: var(--navy-700); background-image: var(--tex-pinstripe-dark); }
.band-inner { max-width: 77.5rem; margin: 0 auto; }
.band-inner.narrow { max-width: 60rem; }

.band--ink .kicker, .band--navy .kicker { color: var(--brass-400); }
.band--ink h2, .band--navy h2 { color: var(--cream); }
.band--ink .link-arrow, .band--navy .link-arrow { color: var(--brass-400); }
.band--ink .link-arrow:hover, .band--navy .link-arrow:hover { color: var(--cream); }

/* Reveal-on-scroll (site.js §2). Hidden state is gated on the pre-paint
   `js` class from base.html, so content is always visible without JS.
   Opacity/transform only — no layout shift, compositor-friendly. Keep
   these attributes off above-the-fold elements (LCP must paint at once). */
.js [data-reveal],
.js [data-reveal-children] > * {
    opacity: 0;
    transform: translateY(16px);
}
.js [data-reveal].is-visible,
.js [data-reveal-children].is-visible > * {
    opacity: 1;
    transform: none;
    transition: opacity 0.65s ease, transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}
.js [data-reveal-children].is-visible > :nth-child(2) { transition-delay: 0.1s; }
.js [data-reveal-children].is-visible > :nth-child(3) { transition-delay: 0.2s; }
.js [data-reveal-children].is-visible > :nth-child(4) { transition-delay: 0.3s; }
.js [data-reveal-children].is-visible > :nth-child(n+5) { transition-delay: 0.4s; }
@media (prefers-reduced-motion: reduce) {
    .js [data-reveal],
    .js [data-reveal-children] > * {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}

/* ---------- Header ---------- */

.topbar {
    background: var(--ink-950);
    color: rgba(245, 241, 232, 0.85);
    font-size: 0.82rem;
    letter-spacing: 0.02em;
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    padding: 0.5rem 3rem;
}

.topbar a { color: rgba(245, 241, 232, 0.85); text-decoration: none; }
.topbar a[href^="tel"] { color: var(--brass-400); font-weight: 600; }
.topbar a:hover { text-decoration: underline; text-underline-offset: 3px; }

.site-header {
    background: var(--white);
    border-bottom: 1px solid rgba(4, 49, 92, 0.15);
    padding: 1.1rem 3rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 50;
}

.site-header .logo img { height: 65px; display: block; }

.site-nav { display: flex; gap: 1.4rem; align-items: center; flex-wrap: wrap; }

.site-nav a {
    color: var(--navy-700);
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
}

.site-nav a:hover {
    color: var(--brass-700);
    text-decoration: underline;
    text-underline-offset: 4px;
}
.site-nav a.active { color: var(--brass-700); }
.site-nav .nav-cta {
    background: var(--navy-700);
    color: var(--cream);
    padding: 0.6rem 1.3rem;
    border-radius: var(--radius);
    font-weight: 600;
}
.site-nav .nav-cta:hover { background: var(--navy-600); color: var(--cream); text-decoration: none; }
.site-nav form { margin: 0; }
.site-nav button.linklike {
    background: none; border: 0; color: var(--navy-700); font: inherit;
    font-weight: 500; cursor: pointer; padding: 0;
}
.site-nav button.linklike:hover { color: var(--brass-700); }

/* ---------- Account cluster (the only auth-dependent part of the nav) --- */

.nav-account {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    margin-left: 0.7rem;
    padding-left: 1.4rem;
    border-left: 1px solid rgba(4, 49, 92, 0.15);
}

.acct { position: relative; }
.acct summary {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    list-style: none;
    cursor: pointer;
    color: var(--navy-700);
    font-weight: 500;
    max-width: 15rem;
}
.acct summary::-webkit-details-marker { display: none; }
.acct summary:hover { color: var(--brass-700); }
.acct summary svg { width: 12px; height: 12px; transition: transform 0.2s ease; }
.acct[open] summary svg { transform: rotate(180deg); }
.acct-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--brass-700); flex: none;
}

.acct-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 0.8rem);
    min-width: 15rem;
    background: var(--white);
    border: 1px solid rgba(4, 49, 92, 0.15);
    border-radius: var(--radius);
    box-shadow: 0 14px 34px rgba(4, 49, 92, 0.16);
    padding: 0.4rem 0;
    display: flex;
    flex-direction: column;
}
.acct-head {
    margin: 0;
    padding: 0.7rem 1rem 0.8rem;
    border-bottom: 1px solid rgba(4, 49, 92, 0.1);
    font-size: 0.86rem;
    color: var(--navy-700);
    line-height: 1.35;
    overflow-wrap: anywhere;
}
.acct-head-email { display: block; }
.acct-plan {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.74rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--brass-700);
    font-weight: 600;
}
.acct-menu a,
.acct-menu button.linklike {
    padding: 0.6rem 1rem;
    font-size: 0.95rem;
    text-align: left;
    width: 100%;
}
.acct-menu a:hover,
.acct-menu button.linklike:hover { background: var(--paper, rgba(4, 49, 92, 0.05)); text-decoration: none; }
.acct-menu form { width: 100%; border-top: 1px solid rgba(4, 49, 92, 0.1); margin-top: 0.3rem; padding-top: 0.3rem; }
.acct-count {
    display: inline-block;
    min-width: 1.3rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: var(--brass-700);
    color: var(--white);
    font-size: 0.76rem;
    font-weight: 700;
    text-align: center;
}

/* Between the desktop and drawer breakpoints the six product links plus the
   account cluster get tight — drop the email to just the chevron. */
@media (max-width: 1180px) {
    .site-nav { gap: 1.1rem; }
    .nav-account { gap: 0.9rem; padding-left: 1rem; margin-left: 0.4rem; }
    /* Truncated, not hidden — a lone chevron is not a target anyone reads. */
    .acct-name { max-width: 6.5rem; }
}

/* Hamburger toggle — hidden on desktop, shown at the mobile breakpoint. */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 10px;
    background: none;
    border: 1px solid rgba(4, 49, 92, 0.2);
    border-radius: var(--radius);
    cursor: pointer;
}
.nav-toggle-bar {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--navy-700);
    border-radius: 2px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}
.site-header.nav-open .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.site-header.nav-open .nav-toggle-bar:nth-child(2) { opacity: 0; }
.site-header.nav-open .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */

/* Generic page hero: deep ink over the (duotone-gradient) photo. */
.hero {
    position: relative;
    color: var(--cream);
    padding: 5.5rem 2rem;
    text-align: center;
    background-image:
        var(--tex-linen-dark),
        linear-gradient(rgba(10, 33, 56, 0.92), rgba(7, 24, 41, 0.9)),
        var(--hero-img, none);
    background-color: var(--ink-900);
    background-size: auto, auto, cover;
    background-position: center;
}

.hero h1 {
    color: var(--cream);
    font-size: clamp(2rem, 4.5vw, 3.1rem);
    line-height: 1.14;
    margin: 0 auto 1.2rem;
    max-width: 46rem;
}

.hero p { max-width: 42rem; margin: 0 auto; font-size: 1.15rem; color: rgba(245, 241, 232, 0.82); }

.hero .actions {
    margin-top: 2.2rem;
    display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; align-items: center;
}

.hero.compact { padding: 3.2rem 2rem; text-align: left; }
.hero.compact h1 { margin-left: 0; }
.hero.compact p { margin-left: 0; }

/* Home hero: split grid, copy left / framed photograph right. */
.hero-home {
    background: var(--ink-900);
    background-image: var(--tex-linen-dark);
    color: var(--cream);
    padding: 5.5rem 3rem 6rem;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.85fr);
    gap: 4rem;
    align-items: center;
}

.hero-copy { max-width: 42.5rem; justify-self: end; }
.hero-copy .kicker, .hero-home .kicker { color: var(--brass-400); font-size: 0.9rem; margin-bottom: 1.6rem; }

.hero-copy h1 {
    color: var(--cream);
    font-size: clamp(2.1rem, 3.8vw, 3.25rem);
    line-height: 1.14;
    margin: 0 0 1.4rem;
}

.hero-copy > p {
    font-size: 1.22rem;
    line-height: 1.6;
    color: rgba(245, 241, 232, 0.82);
    margin: 0 0 2.4rem;
    max-width: 37.5rem;
}

.hero-copy .actions {
    display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 2rem;
}

.hero-shield {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-top: 1px solid rgba(245, 241, 232, 0.15);
    padding-top: 1.4rem;
    max-width: 37.5rem;
}
.hero-shield img { width: 18px; height: 21px; flex-shrink: 0; opacity: 0.9; }
.hero-shield p { margin: 0; font-size: 0.98rem; color: rgba(245, 241, 232, 0.75); }

.hero-photo { justify-self: start; max-width: 32.5rem; width: 100%; }
.hero-photo .duotone { height: 420px; }
.hero-caption {
    margin: 0.85rem 0.25rem 0;
    font-size: 0.82rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(245, 241, 232, 0.55);
}

/* ---------- Buttons ---------- */

.btn {
    display: inline-block;
    padding: 0.85rem 1.9rem;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    border: 0;
    font-family: var(--font-sans);
    font-size: 1rem;
    cursor: pointer;
    line-height: 1.4;
}

.btn-brass { background: var(--brass-400); color: var(--ink-950); font-weight: 700; }
.btn-brass:hover { background: var(--brass-300); color: var(--ink-950); }

/* Trailing inline icon inside a .btn (currentColor inherits the label color). */
.btn-ico {
    width: 1.05em; height: 1.05em; vertical-align: -0.18em; margin-left: 0.45em;
    fill: none; stroke: currentColor; stroke-width: 1.75;
    stroke-linecap: round; stroke-linejoin: round;
}

/* Same caret family, sized for inline text links (.link-arrow). */
.link-ico {
    width: 0.95em; height: 0.95em; vertical-align: -0.14em; margin-left: 0.3em;
    fill: none; stroke: currentColor; stroke-width: 2;
    stroke-linecap: round; stroke-linejoin: round;
}
.btn-navy { background: var(--navy-700); color: var(--cream); }
.btn-navy:hover { background: var(--navy-600); color: var(--cream); }

/* Outline adapts to its band: navy on light, cream on dark. */
.btn-outline {
    border: 1px solid rgba(4, 49, 92, 0.45);
    color: var(--navy-700);
    background: transparent;
    padding: 0.8rem 1.8rem;
}
.btn-outline:hover { background: rgba(4, 49, 92, 0.06); border-color: var(--navy-700); color: var(--navy-700); }
.hero .btn-outline, .hero-home .btn-outline, .band--ink .btn-outline,
.band--navy .btn-outline, .cta-band .btn-outline {
    border-color: rgba(245, 241, 232, 0.45);
    color: var(--cream);
}
.hero .btn-outline:hover, .hero-home .btn-outline:hover, .band--ink .btn-outline:hover,
.band--navy .btn-outline:hover, .cta-band .btn-outline:hover {
    background: rgba(245, 241, 232, 0.08);
    border-color: rgba(245, 241, 232, 0.7);
    color: var(--cream);
}

.hero .link-arrow, .hero-home .link-arrow { color: var(--brass-400); }
.hero .link-arrow:hover, .hero-home .link-arrow:hover { color: var(--cream); }

/* ---------- Stat band ---------- */

.stat-band {
    background: var(--navy-700);
    background-image: var(--tex-pinstripe-dark);
    color: var(--cream);
    display: flex;
    justify-content: center;
    padding: 4rem 2rem;
    flex-wrap: wrap;
    text-align: center;
}

.stat-band .stat {
    padding: 0.5rem clamp(1.6rem, 5vw, 4.5rem);
    border-right: 1px solid var(--hairline-dark);
}
.stat-band .stat:last-child { border-right: 0; }

.stat-band .stat strong {
    display: block;
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: clamp(2.4rem, 5vw, 4rem);
    line-height: 1;
    color: var(--brass-400);
    font-variant-numeric: tabular-nums;
}

.stat-band .stat span {
    display: inline-block;
    margin-top: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(245, 241, 232, 0.8);
}

/* ---------- Sections & cards ---------- */

main.page { max-width: 77.5rem; margin: 0 auto; padding: 3.6rem 2rem; }
main.page.narrow { max-width: 46rem; }

.section-head { text-align: center; max-width: 44rem; margin: 0 auto 3rem; }
.section-head h2 { font-size: clamp(1.7rem, 3vw, 2.5rem); line-height: 1.2; margin: 0 0 0.7rem; }
.section-head p { color: var(--text-600); font-size: 1.1rem; margin: 0; }

.section-head--left { text-align: left; margin: 0 0 3.4rem; }

/* Header row with a trailing link (featured listings) */
.section-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 3.4rem;
}
.section-row .section-head { margin-bottom: 0; }
.section-row .link-arrow { padding-bottom: 0.4rem; }

/* Plain-link listing index (/listings/all/) — a crawl surface, kept bare */
.listing-index { columns: 3 20rem; gap: 2.5rem; padding: 0; margin: 2rem 0 0; list-style: none; }
.listing-index li { margin: 0 0 0.65rem; break-inside: avoid; }

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

/* Homepage featured row: one row of up to 4 on desktop */
@media (min-width: 1100px) {
    .card-grid--featured { grid-template-columns: repeat(4, 1fr); }
}

.why-card {
    background: var(--white);
    border: 1px solid rgba(4, 49, 92, 0.15);
    border-top: 3px solid var(--brass-500);
    padding: 2rem 1.9rem 2.3rem;
}

.why-card img { width: 100%; height: 190px; object-fit: cover; display: block; margin-bottom: 1.2rem; }
.why-card .num {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    color: var(--brass-700);
    letter-spacing: 0.2em;
    margin: 0 0 1.3rem;
}
.why-card h3 { margin: 0 0 0.8rem; font-size: 1.45rem; }
.why-card p { margin: 0; color: var(--text-600); font-size: 1rem; line-height: 1.65; }
.why-card .body { padding: 0; }

/* Brass icon chip on cards: thin-stroke Feather-style icon on a light brass tint. */
.card-ico {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; border-radius: 50%;
    background: rgba(140, 106, 47, 0.10);
    color: var(--brass-700);
    margin-bottom: 1.3rem;
}
.card-ico svg {
    width: 22px; height: 22px;
    fill: none; stroke: currentColor; stroke-width: 1.75;
    stroke-linecap: round; stroke-linejoin: round;
}

.split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.split--top { align-items: start; }

@media (max-width: 760px) { .split { grid-template-columns: 1fr; gap: 2.4rem; } }

.cta-band {
    background: var(--navy-700);
    background-image: var(--tex-pinstripe-dark);
    color: var(--cream);
    text-align: center;
    padding: 5.5rem 2rem;
}

.cta-band h2 { color: var(--cream); font-size: clamp(1.8rem, 3.4vw, 2.75rem); margin: 0 0 1.1rem; }
.cta-band p { max-width: 46rem; margin: 0 auto 2.4rem; color: rgba(245, 241, 232, 0.8); font-size: 1.15rem; }
.cta-band .mark { width: 40px; height: 46px; margin-bottom: 1.4rem; opacity: 0.9; }

.video-wrap {
    position: relative;
    padding-top: 56.25%;
    overflow: hidden;
}

.video-wrap iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ---------- Listing cards — the sealed confidential document ---------- */

.listing-card {
    position: relative;
    background: var(--white);
    background-image: var(--tex-linen);
    border: 1px solid rgba(4, 49, 92, 0.28);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: var(--text-900);
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.listing-card:hover {
    box-shadow: var(--shadow-hover);
    border-color: rgba(4, 49, 92, 0.5);
}

/* Inner hairline mat, like a certificate border */
.listing-card::after {
    content: "";
    position: absolute;
    inset: 7px;
    border: 1px solid rgba(4, 49, 92, 0.16);
    pointer-events: none;
    z-index: 3;
}

.listing-card .thumb {
    height: 168px;
    background: var(--navy-700);
}
.listing-card .thumb img { width: 100%; height: 168px; }

.badges { position: absolute; top: 1rem; left: 1rem; display: flex; gap: 0.4rem; z-index: 4; }

.badge {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--cream);
    background: var(--navy-700);
    padding: 0.3rem 0.7rem;
}

.badge.featured { background: var(--brass-400); color: var(--ink-950); }
.badge.under_contract { background: var(--contract); }
.badge.sold { background: var(--sold); }
.badge.confidential { background: var(--pine-700); }

/* Brass-ringed seal, overlapping the photo */
.card-seal {
    position: relative;
    display: flex;
    justify-content: center;
    margin-top: -34px;
    z-index: 4;
}
.card-seal span {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: var(--paper);
    border: 1px solid rgba(4, 49, 92, 0.3);
    box-shadow:
        0 2px 8px rgba(7, 24, 41, 0.25),
        inset 0 0 0 5px var(--paper),
        inset 0 0 0 6px rgba(4, 49, 92, 0.28);
    display: flex;
    align-items: center;
    justify-content: center;
}
.card-seal img { width: 28px; height: 32px; display: block; }

.listing-card .body {
    padding: 1.1rem 1.75rem 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    flex: 1;
}
.listing-card .rule-label { margin-bottom: 0.5rem; }
.listing-card h3 { margin: 0; font-size: 1.4rem; line-height: 1.3; }
.listing-card .region { color: var(--text-600); font-size: 0.93rem; }
.listing-card .price {
    margin-top: auto;
    padding-top: 0.6rem;
    font-weight: 600;
    color: var(--navy-700);
    font-size: 1.45rem;
    font-variant-numeric: tabular-nums;
}
.listing-card .card-note {
    font-size: 0.8rem;
    color: #8c929b;
    letter-spacing: 0.06em;
}

/* ---------- Search / filters ---------- */

.filter-bar {
    background: var(--paper);
    background-image: var(--tex-linen);
    border: 1px solid var(--hairline);
    padding: 1.2rem 1.4rem;
    margin-bottom: 1.8rem;
}

.filter-bar form {
    display: flex;
    gap: 0.9rem;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-bar label { display: block; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-600); margin-bottom: 0.25rem; }
.filter-bar select, .filter-bar input[type="number"] {
    padding: 0.55rem 0.6rem;
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    font-family: var(--font-sans);
    min-width: 9.5rem;
    background: var(--white);
    color: var(--text-900);
}

/* Styled stage dropdown (pipeline dashboard) — custom brass chevron */
.stage-select {
    appearance: none;
    -webkit-appearance: none;
    padding: 0.45rem 2.1rem 0.45rem 0.7rem;
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    font-family: var(--font-sans);
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--navy-700);
    background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%238C6A2F' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 0.7rem center;
    cursor: pointer;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}
.stage-select:hover { border-color: var(--navy-700); }
.stage-select:focus-visible {
    outline: none;
    border-color: var(--navy-700);
    box-shadow: 0 0 0 3px rgba(4, 49, 92, 0.15);
}

.filter-features { width: 100%; display: flex; gap: 0.9rem 1.2rem; flex-wrap: wrap; font-size: 0.88rem; }
.filter-features label { font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--text-900); margin: 0; display: flex; gap: 0.35rem; align-items: center; }

.save-search { display: flex; gap: 0.6rem; margin-bottom: 1.4rem; flex-wrap: wrap; }
.save-search input[type="text"] {
    padding: 0.55rem 0.7rem; border: 1px solid var(--hairline);
    border-radius: var(--radius); font-family: var(--font-sans); min-width: 14rem;
    background: var(--white);
}

.save-search .field-error { order: 2; margin-top: 0; }
.save-search-hint {
    color: var(--text-600); font-size: 0.9rem;
    margin: 0 0 1.4rem;
}

.view-toggle { display: flex; gap: 0; margin-bottom: 1.4rem; align-items: center; }
.view-toggle a {
    padding: 0.5rem 1.4rem;
    border: 1px solid var(--hairline);
    text-decoration: none;
    color: var(--navy-700);
    font-weight: 600;
    background: var(--white);
}
.view-toggle a + a { border-left: 0; }
.view-toggle a.active { background: var(--navy-700); border-color: var(--navy-700); color: var(--cream); }

#results-map { height: 620px; border: 1px solid var(--hairline); }
#detail-map { height: 320px; border: 1px solid var(--hairline); margin-top: 1rem; }

.map-note { font-size: 0.85rem; color: var(--text-600); margin-top: 0.6rem; }

/* ---------- Listing detail ---------- */

.detail-header { display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap; align-items: flex-start; }
.detail-header h1 { margin: 0.4rem 0; font-size: clamp(1.7rem, 3vw, 2.4rem); }
.detail-header .region { color: var(--text-600); }
.detail-header .badges { position: static; }

.price-box {
    background: var(--paper);
    background-image: var(--tex-linen);
    border: 1px solid var(--hairline);
    border-top: 3px solid var(--brass-500);
    padding: 1.1rem 1.5rem;
    min-width: 15rem;
}

.price-box .amount {
    font-family: var(--font-serif);
    font-size: 1.7rem;
    color: var(--navy-700);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.price-box .note { font-size: 0.88rem; color: var(--text-600); }

.metric-tables { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.6rem; margin: 1.8rem 0; }

table.metrics {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border: 1px solid var(--hairline);
    box-shadow: var(--shadow);
}
table.metrics caption {
    text-align: left; font-weight: 600; font-family: var(--font-serif);
    padding: 0.7rem 1rem; background: var(--navy-700); color: var(--cream);
    font-size: 1rem; border: 1px solid var(--navy-700); border-bottom: 0;
}
table.metrics td { padding: 0.6rem 1rem; border-bottom: 1px solid rgba(4, 49, 92, 0.1); font-size: 0.93rem; }
table.metrics td:last-child { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
table.metrics tr:last-child td { border-bottom: 0; }

/* Standalone signup card — the in-flow form of the wall (first-look
   preview, browse cap, public-source financials). Inside .gated it is
   overridden below into a blur laid over the content it hides. */
.gate-overlay {
    background: var(--paper);
    border: 1px solid var(--hairline);
    border-left: 3px solid var(--brass);
    padding: 1.4rem 1.6rem;
    margin: 1.4rem 0;
    display: flex; flex-direction: column; align-items: flex-start;
    gap: 0.8rem;
}

.gate-overlay p { margin: 0; max-width: 46rem; }

.browse-wall {
    align-items: center;
    text-align: center;
    margin-top: 2rem;
}

.gated {
    position: relative;
    overflow: hidden;
}

.gated .gate-overlay {
    position: absolute; inset: 0;
    background: rgba(245, 241, 232, 0.55);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 0.7rem; text-align: center; padding: 1rem;
}

.gated .gate-overlay p { margin: 0; font-weight: 600; }

.chips { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 1rem 0; }
.chip {
    background: var(--paper);
    border: 1px solid var(--hairline);
    border-radius: 999px;
    padding: 0.25rem 0.9rem;
    font-size: 0.85rem;
    color: var(--text-900);
}

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.8rem; margin: 1.4rem 0; }
.gallery img { width: 100%; height: 160px; object-fit: cover; border: 1px solid var(--hairline); }

.provenance { font-size: 0.85rem; color: var(--text-600); border-top: 1px solid var(--hairline); margin-top: 2rem; padding-top: 1rem; }
.provenance a { color: var(--navy-700); }

.inquiry-box {
    background: var(--paper);
    background-image: var(--tex-linen);
    border: 1px solid var(--hairline);
    padding: 1.6rem 1.8rem;
    margin-top: 2rem;
}
.inquiry-box h3 { margin-top: 0; }
.inquiry-box textarea { width: 100%; }

/* ---------- Forms ---------- */

.form-card {
    position: relative;
    background: var(--white);
    background-image: var(--tex-linen);
    border: 1px solid rgba(4, 49, 92, 0.28);
    box-shadow: var(--shadow);
    padding: 2.2rem 2.4rem;
}

/* Certificate mat, matching the listing cards */
.form-card::before {
    content: "";
    position: absolute;
    inset: 7px;
    border: 1px solid rgba(4, 49, 92, 0.12);
    pointer-events: none;
}
.form-card > * { position: relative; }

.form-card p.help, .form-card .helptext { font-size: 0.82rem; color: var(--text-600); }

.form-card label { font-weight: 600; font-size: 0.92rem; display: block; margin: 0.9rem 0 0.25rem; }

.form-card input[type="text"], .form-card input[type="email"],
.form-card input[type="password"], .form-card input[type="number"],
.form-card input[type="tel"], .form-card input[type="url"],
.form-card input[type="file"], .form-card select, .form-card textarea,
.inquiry-box textarea {
    width: 100%;
    padding: 0.6rem 0.7rem;
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    background: var(--white);
    color: var(--text-900);
}

.form-card input:focus-visible, .form-card select:focus-visible,
.form-card textarea:focus-visible, .inquiry-box textarea:focus-visible {
    outline: 2px solid var(--navy-600);
    outline-offset: 1px;
}

.form-card ul { list-style: none; padding: 0; margin: 0.2rem 0; }
.form-card ul li { margin: 0.15rem 0; }
.form-card ul li label { font-weight: 500; display: flex; gap: 0.45rem; align-items: center; margin: 0; }
.form-card .errorlist { color: var(--contract); font-size: 0.86rem; }
.form-card button[type="submit"] { margin-top: 1.4rem; }

.form-card details summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--navy-700);
    padding: 0.6rem 0;
}
.form-card details summary::before { content: "+ "; color: var(--brass-700); font-family: var(--font-serif); }
.form-card details[open] summary::before { content: "− "; }

/* Signup form layout (FireShow-derived UX) */

.form-signup { max-width: 36rem; margin: 0 auto; }

.form-section {
    margin: 1.8rem 0 0.2rem;
    padding-bottom: 0.35rem;
    border-bottom: 2px solid var(--brass-500);
    font-size: 1.15rem;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 1rem;
}

@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }

.form-card .field .label, .form-card .field label { margin-top: 0.9rem; }
.form-card .hint, .form-card .opt { font-size: 0.8rem; color: var(--text-600); font-weight: 400; }

/* Required-field markers: Django adds .required to required labels
   (required_css_class); hand-written labels use a .req span. */
.form-card label.required::after,
.form-card .label.required::after { content: "\00a0*"; }
.form-card label.required::after,
.form-card .label.required::after,
.form-card .req { color: var(--brass-700); font-weight: 700; }
.form-legend { font-size: 0.8rem; color: var(--text-600); margin: 0 0 0.4rem; }
.form-legend .req { color: var(--brass-700); font-weight: 700; }

.pw-field { position: relative; }
.pw-field input { padding-right: 3.6rem; }
.pw-toggle {
    position: absolute; right: 0.4rem; top: 50%; transform: translateY(-50%);
    background: none; border: 0; color: var(--navy-700); font-size: 0.8rem;
    font-weight: 600; cursor: pointer; padding: 0.3rem;
}

.pw-checklist { display: flex; gap: 1rem; margin-top: 0.5rem; }
.pw-check { font-size: 0.8rem; color: var(--text-600); }
.pw-check::before { content: "○ "; }
.pw-check.ok { color: var(--pine-700); font-weight: 600; }
.pw-check.ok::before { content: "✓ "; }

/* Split gap: 0.55rem row (long labels wrap without over-spacing), 1.6rem column. */
.check-row { display: flex; gap: 0.55rem 1.6rem; flex-wrap: wrap; margin: 0.9rem 0 0.5rem; }
.check-row label { display: flex; gap: 0.45rem; align-items: center; font-weight: 500; margin: 0; }
/* Django 5.2 CheckboxSelectMultiple renders nested <div>s, not a <ul> — lay the
   option wrapper out as a wrapping row and tighten it under its field label. */
.check-row > div { display: flex; gap: 0.4rem 1.6rem; flex-wrap: wrap; }
.field .check-row { margin-top: 0.25rem; }

.form-card select[multiple] { min-height: 9rem; }

.confidential-note {
    display: flex; gap: 0.7rem; align-items: flex-start;
    background: var(--paper);
    background-image: var(--tex-linen);
    border: 1px solid var(--hairline);
    border-left: 3px solid var(--pine-700);
    padding: 0.9rem 1.1rem;
    font-size: 0.9rem;
    color: var(--text-600);
    margin-bottom: 1.4rem;
}

/* ---------- Toasts (AppToast — floating flash messages) ---------- */

.app-toast-region {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: min(45rem, calc(100vw - 24px));
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.app-toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0.95rem 1.1rem;
    background: var(--white);
    color: var(--text-900);
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    box-shadow: var(--shadow-hover);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    line-height: 1.5;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.app-toast.is-open { opacity: 1; transform: none; }
.app-toast.is-leaving { opacity: 0; transform: translateY(-8px); }

.app-toast--success {
    background: color-mix(in oklab, var(--pine-700) 10%, var(--white));
    border-color: color-mix(in oklab, var(--pine-700) 35%, transparent);
}
.app-toast--success .app-toast__icon {
    background: color-mix(in oklab, var(--pine-700) 18%, transparent);
    color: var(--pine-700);
}

.app-toast--error,
.app-toast--danger {
    background: color-mix(in oklab, var(--contract) 10%, var(--white));
    border-color: color-mix(in oklab, var(--contract) 35%, transparent);
}
.app-toast--error .app-toast__icon,
.app-toast--danger .app-toast__icon {
    background: color-mix(in oklab, var(--contract) 18%, transparent);
    color: var(--contract);
}

.app-toast--warning {
    background: color-mix(in oklab, var(--brass-700) 10%, var(--white));
    border-color: color-mix(in oklab, var(--brass-700) 35%, transparent);
}
.app-toast--warning .app-toast__icon {
    background: color-mix(in oklab, var(--brass-700) 18%, transparent);
    color: var(--brass-700);
}

.app-toast--info {
    background: color-mix(in oklab, var(--navy-700) 8%, var(--white));
    border-color: color-mix(in oklab, var(--navy-700) 30%, transparent);
}
.app-toast--info .app-toast__icon {
    background: color-mix(in oklab, var(--navy-700) 15%, transparent);
    color: var(--navy-700);
}

.app-toast__icon {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    font-weight: 700;
    line-height: 1;
}

.app-toast__body { flex: 1 1 auto; min-width: 0; }

.app-toast__title {
    font-family: var(--font-serif);
    font-weight: 600;
    color: var(--ink-900);
    margin: 0 0 2px;
}

.app-toast__message { word-wrap: break-word; }

.app-toast__close {
    flex: 0 0 auto;
    appearance: none;
    background: transparent;
    border: 0;
    color: var(--text-600);
    font-size: 24px;
    line-height: 1;
    padding: 0 6px;
    cursor: pointer;
    border-radius: var(--radius);
    transition: color 0.15s ease, background-color 0.15s ease;
}

.app-toast__close:hover,
.app-toast__close:focus-visible {
    color: var(--text-900);
    background: rgba(27, 42, 56, 0.08);
    outline: none;
}

@media (max-width: 640px) {
    .app-toast-region { top: 12px; width: calc(100vw - 16px); }
    .app-toast { font-size: 0.9rem; padding: 0.8rem; gap: 12px; }
    .app-toast__icon { width: 28px; height: 28px; font-size: 15px; }
}

/* ---------- Client-side field validation (form-validate.js) ---------- */

.is-invalid,
input.is-invalid, textarea.is-invalid, select.is-invalid {
    border-color: var(--contract);
    outline-color: var(--contract);
}
.field-error {
    color: var(--contract);
    font-size: 0.86rem;
    margin: 0.3rem 0 0;
    /* In flex/grid form rows, drop to its own line under the field
       instead of sitting beside it as another item. */
    flex-basis: 100%;
    grid-column: 1 / -1;
}

/* ---------- Footer ---------- */

.site-footer { background: var(--ink-950); color: rgba(245, 241, 232, 0.7); padding: 4rem 3rem 2.4rem; }
.site-footer .cols {
    max-width: 77.5rem; margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 4rem;
    align-items: start;
    padding-bottom: 2.8rem;
    border-bottom: 1px solid rgba(245, 241, 232, 0.12);
}
.site-footer img { height: 44px; }
.site-footer nav {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.85rem 2rem;
    align-content: start;
}
.site-footer a { color: rgba(245, 241, 232, 0.8); text-decoration: none; font-size: 0.95rem; }
.site-footer a:hover { color: var(--brass-400); }
.site-footer .fine { max-width: 77.5rem; margin: 1.9rem auto 0; font-size: 0.82rem; line-height: 1.7; color: rgba(245, 241, 232, 0.5); }
.site-footer .contact { font-size: 0.95rem; line-height: 1.8; margin: 1.4rem 0 0; }
.site-footer .contact a { color: var(--brass-400); font-weight: 600; }
.site-footer .subfooter {
    max-width: 77.5rem;
    margin: 1.4rem auto 0;
    display: flex;
    justify-content: flex-start;
    gap: 2rem;
    flex-wrap: wrap;
    font-size: 0.82rem;
    color: rgba(245, 241, 232, 0.5);
}
.site-footer .subfooter a { color: rgba(245, 241, 232, 0.6); }

.empty-state { text-align: center; color: var(--text-600); padding: 3rem 1rem; }

.pagination { display: flex; gap: 0.6rem; justify-content: center; margin-top: 2rem; }
.pagination a, .pagination span { padding: 0.4rem 0.9rem; border: 1px solid var(--hairline); text-decoration: none; }
.pagination .current { background: var(--navy-700); color: var(--cream); border-color: var(--navy-700); }

/* ---------- Mobile ---------- */

@media (max-width: 960px) {
    .hero-home { grid-template-columns: 1fr; padding: 3.6rem 1.6rem 4rem; gap: 2.6rem; }
    .hero-copy { justify-self: stretch; }
    .hero-photo { max-width: none; }
    .hero-photo .duotone { height: 300px; }
    .band { padding: 4rem 1.6rem; }
    .section-row { flex-direction: column; align-items: flex-start; gap: 1rem; margin-bottom: 2.4rem; }
    .site-footer .cols { grid-template-columns: 1fr; gap: 2.4rem; }
}

@media (max-width: 720px) {
    .topbar { justify-content: center; flex-wrap: wrap; gap: 0.4rem 1.4rem; padding: 0.35rem 1rem; }
    .site-header { padding: 0.8rem 1rem; gap: 0.8rem; justify-content: space-between; }
    .site-header .logo img { height: 52px; }

    .nav-toggle { display: flex; }

    /* Collapsed by default; the toggle drops it in as a full-width panel. */
    .site-nav {
        display: none;
        flex-basis: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        font-size: 1rem;
        margin-top: 0.4rem;
        border-top: 1px solid rgba(4, 49, 92, 0.12);
    }
    .site-header.nav-open .site-nav { display: flex; }
    .site-nav a,
    .site-nav button.linklike {
        padding: 0.85rem 0.25rem;
        border-bottom: 1px solid rgba(4, 49, 92, 0.08);
        text-align: left;
        width: 100%;
    }
    .site-nav .nav-cta {
        margin-top: 0.7rem;
        text-align: center;
        border-bottom: 0;
    }

    /* In the drawer the account cluster is just the last section, and the
       menu expands inline instead of floating. */
    .nav-account {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        margin-left: 0;
        padding-left: 0;
        border-left: 0;
        border-top: 1px solid rgba(4, 49, 92, 0.12);
        margin-top: 0.7rem;
        padding-top: 0.3rem;
    }
    .acct summary { max-width: none; padding: 0.85rem 0.25rem; justify-content: space-between; }
    .acct-name { max-width: none; }  /* the drawer has room; the tight desktop range doesn't */
    .acct-menu {
        position: static;
        border: 0;
        box-shadow: none;
        min-width: 0;
        padding: 0 0 0 0.9rem;
    }
    .acct-menu a, .acct-menu button.linklike { padding: 0.75rem 0.25rem; }
    /* The drawer's summary already shows the email — don't say it twice. */
    .acct-head { padding: 0.55rem 0.25rem; }
    .acct-head-email { display: none; }
    .acct-plan { margin-top: 0; }

    .hero { padding: 3.2rem 1.2rem; }
    .hero p { font-size: 1.02rem; }
    .hero .actions .btn { width: 100%; max-width: 22rem; }

    main.page { padding: 2.2rem 1.2rem; }
    .stat-band { padding: 2.4rem 1.2rem; }
    .stat-band .stat { padding: 0.5rem 1.2rem; }

    .detail-header { flex-direction: column; }
    .price-box { width: 100%; }
    .metric-tables { grid-template-columns: 1fr; }

    .filter-bar form > div { width: 100%; }
    .filter-bar select, .filter-bar input[type="number"] { width: 100%; }
    .filter-bar button[type="submit"] { width: 100%; }

    #results-map { height: 420px; }
    .form-card { padding: 1.6rem 1.3rem; }
    .site-footer { padding: 2.6rem 1.4rem 2rem; }
    .site-footer nav { grid-template-columns: repeat(2, 1fr); }
}

/* AppModal (ported from FireShow) — class contract required by
   static/js/app-modal.js: .modal[hidden] > .modal-backdrop +
   .modal-panel, states .is-open / .is-leaving, body.app-modal-open. */
.modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}
.modal[hidden] { display: none; }
.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(7, 24, 41, 0.6);
    opacity: 0;
    transition: opacity 0.3s ease 0.1s;
}
.modal-panel {
    position: relative;
    background: var(--white);
    border: 1px solid rgba(4, 49, 92, 0.28);
    border-top: 3px solid var(--brass-500);
    box-shadow: 0 12px 40px rgba(7, 24, 41, 0.4);
    max-width: 560px;
    width: 100%;
    max-height: calc(100vh - 3rem);
    overflow-y: auto;
    padding: 2rem;
    opacity: 0;
    transform: translateY(14px) scale(0.98);
    transition: opacity 0.28s ease, transform 0.28s ease;
}
.modal.is-open .modal-backdrop { opacity: 1; transition-delay: 0s; }
.modal.is-open .modal-panel { opacity: 1; transform: none; }
.modal.is-leaving .modal-backdrop,
.modal.is-leaving .modal-panel { opacity: 0; }
.modal-close {
    position: absolute;
    top: 0.7rem;
    right: 0.9rem;
    border: 0;
    background: none;
    font-size: 1.6rem;
    line-height: 1;
    color: var(--text-600);
    cursor: pointer;
}
.modal-close:hover { color: var(--ink-900); }
@media (max-width: 640px) {
    .modal { padding: 0; align-items: flex-end; }
    .modal-panel {
        max-width: none;
        max-height: 88vh;
        transform: translateY(100%);
        transition: opacity 0.45s ease, transform 0.45s ease;
    }
}

/* FAQ accordion — native details/summary, ledger rules & serif questions. */
.faq { max-width: 54rem; margin: 0 auto; border-top: 1px solid var(--hairline); }
.faq details {
    border-bottom: 1px solid var(--hairline);
}
.faq summary {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem 0.5rem;
    font-family: var(--font-serif);
    font-weight: 600;
    font-size: 1.35rem;
    color: var(--ink-900);
    line-height: 1.3;
}
.faq summary:hover { background: rgba(4, 49, 92, 0.03); }
.faq summary::after {
    content: "+";
    font-size: 1.75rem;
    color: var(--brass-700);
    line-height: 1;
    flex-shrink: 0;
}
.faq details[open] summary::after { content: "−"; }
.faq details p {
    margin: 0;
    padding: 0 3rem 1.75rem 0.5rem;
    color: var(--text-600);
    font-size: 1.02rem;
    line-height: 1.7;
}

/* ============================================================
   Financing calculator (core:financing) — free SBA 7(a) tool
   ============================================================ */
.calc {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 2rem;
    align-items: start;
}
.calc-inputs h2 { font-size: 1.15rem; margin: 1.6rem 0 0.4rem; }
.calc-inputs h2:first-child { margin-top: 0; }
.calc-money, .calc-range { display: flex; align-items: center; gap: 0.5rem; }
.calc-money span { color: var(--text-600); font-weight: 600; }
.calc-money input { flex: 1; margin: 0; }
.calc-range input[type="range"] { flex: 1; accent-color: var(--navy-700); }
.calc-range output {
    font-family: var(--font-serif);
    font-weight: 700;
    color: var(--navy-700);
    min-width: 3ch;
    text-align: right;
}

.calc-results {
    position: sticky;
    top: 6rem;
    background: var(--paper);
    background-image: var(--tex-linen);
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.6rem 1.8rem;
}
.calc-verdict {
    text-align: center;
    padding: 1.2rem 1rem 1.4rem;
    border-radius: var(--radius);
    background: var(--white);
    border: 1px solid var(--hairline);
    border-top: 3px solid var(--sold);
}
.calc-verdict-label {
    display: block;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-600);
    font-weight: 600;
}
.calc-dscr {
    display: block;
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 2.8rem;
    line-height: 1.1;
    color: var(--sold);
    margin: 0.2rem 0;
}
.calc-verdict-note { font-size: 0.9rem; color: var(--text-600); display: block; }
.calc-verdict--strong, .calc-verdict--solid { border-top-color: var(--pine-700); }
.calc-verdict--strong .calc-dscr, .calc-verdict--solid .calc-dscr { color: var(--pine-700); }
.calc-verdict--tight { border-top-color: var(--brass-500); }
.calc-verdict--tight .calc-dscr { color: var(--brass-700); }
.calc-verdict--short { border-top-color: var(--contract); }
.calc-verdict--short .calc-dscr { color: var(--contract); }

.calc-figures { margin: 1.4rem 0 0; }
.calc-figures > div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--hairline);
}
.calc-figures dt { color: var(--text-600); font-size: 0.94rem; }
.calc-figures dd {
    margin: 0;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--text-900);
    white-space: nowrap;
}
.calc-figures-strong dt, .calc-figures-strong dd {
    font-weight: 700;
    color: var(--navy-700);
}
.calc-assumptions {
    font-size: 0.82rem;
    color: var(--text-600);
    margin: 1rem 0 0.4rem;
    line-height: 1.5;
}

@media (max-width: 860px) {
    .calc { grid-template-columns: 1fr; }
    .calc-results { position: static; }
}

/* ============================================================
   Resource directory (core:directory)
   ============================================================ */
.directory-group { margin-bottom: 4.75rem; }
.directory-group:last-of-type { margin-bottom: 3rem; }
.group-count {
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--brass-700);
    letter-spacing: 0.02em;
    vertical-align: middle;
    margin-left: 0.4rem;
}
/* Compact "find your state" grid — no repetitive per-item copy. */
.state-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
    gap: 0.7rem;
}
.state-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    background: var(--white);
    text-decoration: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.state-item:hover {
    border-color: var(--navy-700);
    box-shadow: var(--shadow);
    transform: translateY(-1px);
    text-decoration: none;
}
.state-name { font-weight: 700; color: var(--navy-700); font-size: 0.95rem; }
.state-assoc { font-size: 0.78rem; color: var(--text-600); line-height: 1.35; }
.state-item:hover .state-name { color: var(--brass-700); }

.resource-card .body { display: flex; flex-direction: column; gap: 0.5rem; }
.resource-card h3 { margin: 0; }
.resource-card p { margin: 0; }
.resource-region {
    align-self: flex-start;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    color: var(--brass-700);
}
.resource-card .link-arrow { margin-top: auto; padding-top: 0.4rem; }
.directory-empty {
    border: 1px dashed var(--hairline);
    border-radius: var(--radius);
    background: var(--paper);
    padding: 1.4rem 1.6rem;
    color: var(--text-600);
}
.directory-empty p { margin: 0; }

/* ---------- Member welcome strip (dashboard = the signed-in home) ------- */

.member-welcome {
    background: var(--paper);
    background-image: var(--tex-linen);
    border: 1px solid rgba(4, 49, 92, 0.12);
    border-radius: var(--radius);
    padding: 1.8rem 2rem 1.6rem;
    margin-bottom: 2.6rem;
}
.member-welcome-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.member-welcome h1 { margin: 0.2rem 0 0; }
.member-welcome .kicker { margin: 0; }

.member-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-top: 1.6rem;
}
.member-stat {
    display: block;
    background: var(--white);
    border: 1px solid rgba(4, 49, 92, 0.12);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
    text-decoration: none;
    color: var(--navy-700);
}
.member-stat:hover { border-color: var(--brass-700); text-decoration: none; }
.member-stat strong {
    display: block;
    font-family: var(--font-serif, inherit);
    font-size: 2rem;
    line-height: 1.1;
    color: rgba(4, 49, 92, 0.45);
}
.member-stat span { font-size: 0.86rem; line-height: 1.35; display: block; margin-top: 0.3rem; }
/* Only a non-zero count earns the accent — otherwise the strip reads as
   four alerts when nothing has happened. */
.member-stat--live strong { color: var(--brass-700); }

@media (max-width: 900px) {
    .member-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
    .member-welcome { padding: 1.4rem 1.2rem; }
    .member-welcome-head .btn { width: 100%; text-align: center; }
}

/* ---------- Seller-referral band (members only, /sellers/) ------------- */

.referral-band {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
    background: var(--paper);
    background-image: var(--tex-linen);
    border: 1px solid var(--hairline);
    border-left: 3px solid var(--brass-500);
    border-radius: var(--radius);
    padding: 1.6rem 1.9rem;
    margin-bottom: 2.6rem;
}
.referral-band h2 { margin: 0 0 0.5rem; font-size: 1.5rem; }
.referral-band > div > p:last-child { margin: 0; max-width: 44rem; }
.referral-actions { display: flex; gap: 0.8rem; flex-wrap: wrap; flex-shrink: 0; }

@media (max-width: 720px) {
    .referral-band { padding: 1.3rem 1.2rem; }
    .referral-actions { width: 100%; }
    .referral-actions .btn { flex: 1; text-align: center; white-space: nowrap; padding-inline: 0.9rem; }
}
