/* Boa Empresa - public layout (layout/header + layout/footer). One small stylesheet, loaded
   normally in <head> (no async swap that repaints the page), system fonts, inline SVG icons. */

:root {
    --brand: #c4262e;
    --brand-strong: #a11d24;
    --brand-soft: #fdeceb;
    --bg: #f5f4f1;
    --surface: #fff;
    --surface-2: #faf9f7;
    --text: #1c1b1a;
    --text-2: #4a4845;
    --muted: #6b6864;
    --line: #e5e2dc;
    --line-strong: #d4d0c8;
    --link: #0b57b8;
    --focus: #0b57b8;
    --radius: 12px;
    --radius-sm: 8px;
    /* depth: a 1px ring plus soft layers (no borders that only exist to lift a surface) */
    --shadow: 0 0 0 1px rgb(28 27 26 / .08), 0 1px 2px rgb(28 27 26 / .06), 0 1px 1px rgb(28 27 26 / .04);
    --shadow-raised: 0 0 0 1px rgb(28 27 26 / .12), 0 1px 2px rgb(28 27 26 / .06), 0 8px 24px rgb(28 27 26 / .08);
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --wrap: 1240px;
    --gutter: 16px;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
    margin: 0; background: var(--bg); color: var(--text);
    font: 16px/1.55 var(--font); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}
img, svg { vertical-align: middle; }
img { max-width: 100%; height: auto; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; text-wrap: balance; letter-spacing: -.01em; }
h1 { font-size: clamp(1.5rem, 1.15rem + 1.6vw, 2.1rem); font-weight: 750; }
h2 { font-size: 1.25rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 1em; text-wrap: pretty; }
ul, ol { margin: 0 0 1em; padding-left: 1.25em; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.icon { width: 20px; height: 20px; flex: none; stroke-width: 1.5; }
/* beside semibold text (buttons, labels, links, phones): 2px */
.btn .icon, .text-link .icon, .company-card-cta .icon, .company-card-phone .icon, .fact > .icon,
.exit-host .icon, .icon-btn .icon, .faq summary .icon { stroke-width: 2; }
.visually-hidden {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link { position: absolute; left: 8px; top: -48px; z-index: 50; padding: 8px 14px; background: var(--text); color: #fff; border-radius: var(--radius-sm); }
.skip-link:focus { top: 8px; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- header ---------- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding-block: 8px; }
.logo { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-weight: 750; font-size: 1.15rem; letter-spacing: -.02em; min-height: 40px; }
.logo:hover { text-decoration: none; }
.logo-mark { color: var(--brand); }
.header-cta { margin-left: auto; }
@media (max-width: 419px) { .hide-narrow { display: none; } }
.header-search { order: 3; flex: 1 1 100%; }
/* phones: the header search is behind a button (keeps the page top short; set before first paint) */
.search-toggle { display: none; }
@media (max-width: 719px) {
    .site-header .wrap { gap: 8px 4px; }
    .js .search-toggle { display: inline-grid; order: 1; margin-left: auto; }
    .js .header-cta { order: 2; margin-left: 0; padding-inline: 8px; }
    .js .site-header:not(.search-open) .header-search { display: none; }
}
@media (min-width: 720px) {
    .site-header .wrap { flex-wrap: nowrap; padding-block: 10px; }
    .header-search { order: 0; flex: 1 1 auto; max-width: 560px; margin-left: 16px; }
}

/* search field (header and home hero) */
.search { display: flex; position: relative; }
.search input {
    flex: 1; min-width: 0; height: 44px; padding: 0 14px 0 42px;
    background: var(--surface-2); border: 1px solid var(--line-strong); border-right: 0;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: none; background: var(--surface); border-color: var(--focus); box-shadow: inset 0 0 0 1px var(--focus); }
.search .search-icon { position: absolute; left: 12px; top: 12px; color: var(--muted); pointer-events: none; }
.search button { height: 44px; padding: 0 16px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.search-lg input { height: 52px; font-size: 1.05rem; background: var(--surface); }
.search-lg .search-icon { top: 16px; }
.search-lg button { height: 52px; padding: 0 22px; font-size: 1.05rem; }

/* ---------- buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 44px; padding: 0 18px; border: 1px solid transparent; border-radius: var(--radius-sm);
    font-weight: 650; line-height: 1.2; cursor: pointer; text-decoration: none; white-space: nowrap;
    transition-property: background-color, border-color, color, box-shadow, scale;
    transition-duration: .15s; transition-timing-function: ease-out;
}
.btn:hover { text-decoration: none; }
.btn:active { scale: .96; }
.btn:has(> .icon:first-child) { padding-inline-start: 16px; }
.btn-sm:has(> .icon:first-child) { padding-inline-start: 10px; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-strong); }
.btn-secondary { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.btn-secondary:hover { box-shadow: var(--shadow-raised); }
.btn-ghost { background: transparent; color: var(--text-2); padding-inline: 12px; }
.btn-ghost:hover { background: var(--bg); color: var(--text); }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: .9rem; }
.btn[disabled] { opacity: .55; cursor: progress; }

/* ---------- page grid (with the ad rail: see "Ads") ---------- */
main { display: block; padding-block: 16px 40px; }
.content { min-width: 0; }
.lead-area { min-width: 0; }

.breadcrumbs { font-size: .875rem; color: var(--muted); margin-bottom: 10px; }
/* one line; long trails scroll sideways instead of wrapping (keeps the page top short on phones) */
.breadcrumbs ol { list-style: none; margin: 0; padding: 0; display: flex; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.breadcrumbs ol::-webkit-scrollbar { display: none; }
.breadcrumbs li { display: inline-flex; align-items: center; flex: none; line-height: 24px; }
.breadcrumbs li + li::before { content: "/"; margin: 0 8px; color: var(--line-strong); }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--text); }
.breadcrumbs [aria-current] { color: var(--text-2); }

.page-head { margin-bottom: 14px; }
.page-head h1 { margin-bottom: 6px; }
.page-head .lede { color: var(--text-2); margin: 0; max-width: 70ch; }
/* links inside running text: underlined, not told apart by color alone */
.lede a, .hero-hints a, .prose p a, .hint a, .phone-note a, .dialog-foot a { text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
.count { font-variant-numeric: tabular-nums; }

.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel { padding: 20px; margin-bottom: 20px; }
.panel > :last-child { margin-bottom: 0; }
.section { margin-top: 32px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-title h2 { margin: 0; }
.section-title a { white-space: nowrap; }

/* ---------- link grids: states, cities, categories ---------- */
.link-columns { list-style: none; margin: 0; padding: 0; columns: 2 150px; column-gap: 24px; }
@media (min-width: 720px) { .link-columns { columns: 4 170px; } }
.link-columns li { break-inside: avoid; padding: 0; }
.link-columns a { display: block; padding: 7px 0; color: var(--text); border-bottom: 1px solid transparent; }
.link-columns a:hover { color: var(--brand); text-decoration: none; }
.link-columns .letter { display: block; font-weight: 750; color: var(--brand); padding: 12px 0 2px; scroll-margin-top: 12px; }

.state-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.state-grid a {
    display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 12px 8px 8px;
    background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); color: var(--text);
    transition-property: box-shadow; transition-duration: .15s; transition-timing-function: ease-out;
}
.state-grid a:hover { text-decoration: none; box-shadow: var(--shadow-raised); }
.state-grid abbr { text-decoration: none; display: inline-grid; place-items: center; width: 32px; height: 26px; border-radius: 4px; background: var(--brand-soft); color: var(--brand-strong); font-size: .8rem; font-weight: 750; flex: none; }

.letter-nav { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 4px; padding: 0; list-style: none; }
.letter-nav a, .letter-nav span {
    display: inline-grid; place-items: center; min-width: 36px; height: 36px; padding: 0 6px;
    border-radius: var(--radius-sm); font-weight: 650; font-size: .9rem;
}
.letter-nav a { background: var(--surface); box-shadow: var(--shadow); color: var(--text); transition-property: color, box-shadow; transition-duration: .15s; transition-timing-function: ease-out; }
.letter-nav a:hover { box-shadow: 0 0 0 1px var(--brand); color: var(--brand); text-decoration: none; }
.letter-nav span { color: var(--line-strong); }

.filter { position: relative; margin-bottom: 4px; max-width: 420px; }
.filter input { width: 100%; height: 44px; padding: 0 14px 0 42px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); }
.filter input:focus { outline: none; border-color: var(--focus); box-shadow: inset 0 0 0 1px var(--focus); }
.filter .icon { position: absolute; left: 12px; top: 12px; color: var(--muted); pointer-events: none; }
.filter-empty { color: var(--muted); }

.section-first { margin-top: 0; }
.top-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.top-grid a {
    display: flex; flex-direction: column; gap: 2px; min-height: 64px; padding: 10px 14px; justify-content: center;
    background: var(--surface); border-radius: var(--radius-sm); box-shadow: var(--shadow); color: var(--text); font-weight: 650;
    transition-property: box-shadow; transition-duration: .15s; transition-timing-function: ease-out;
}
.top-grid a:hover { text-decoration: none; box-shadow: var(--shadow-raised); }
.top-grid .count { font-weight: 400; color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.pills { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.pills li { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 4px 12px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); font-size: .9rem; }
.pills .count, .link-columns-counted .count { color: var(--muted); font-size: .825rem; font-variant-numeric: tabular-nums; }
.link-columns-counted a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: baseline; overflow-wrap: anywhere; }
.link-columns-counted a:hover .count { color: var(--brand); }

/* ---------- company lists ---------- */
.company-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.company-card {
    position: relative; padding: 14px 16px;
    transition-property: box-shadow; transition-duration: .15s; transition-timing-function: ease-out;
}
.company-card:hover { box-shadow: var(--shadow-raised); }
.company-card-name { font-size: 1.05rem; margin: 0 0 4px; }
.company-card-name a { color: var(--text); }
.company-card-name a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.company-card-name a:hover { text-decoration: none; }
.company-card:hover .company-card-name a { color: var(--brand); }
.company-card-address { display: flex; gap: 6px; margin: 0 0 6px; color: var(--text-2); font-size: .925rem; }
.company-card-address .icon { width: 18px; height: 18px; margin-top: 2px; color: var(--muted); }
.company-card-phone { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.company-card-phone > .icon { width: 18px; height: 18px; color: var(--brand); }
/* above the card's stretched link, so the button opens the phone dialog instead of the page */
.company-card-phone .phone-reveal { position: relative; z-index: 1; }
button.text-link { border: 0; background: none; padding: 0 4px; color: var(--link); cursor: pointer; font: inherit; font-weight: 600; font-size: .9rem; }
button.text-link:hover { text-decoration: underline; text-underline-offset: 2px; }
.phone-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.phone-masked { font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.phone-list { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; }
.phone-list a { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; border-radius: var(--radius-sm); background: var(--brand); color: #fff; font-size: 1.2rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.phone-list a:hover { background: var(--brand-strong); text-decoration: none; }
.phone-list span { display: flex; align-items: center; justify-content: center; min-height: 52px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); font-size: 1.1rem; font-weight: 700; }
.phone-note { margin: 0; color: var(--muted); font-size: .875rem; }
.company-card-cta { display: inline-flex; align-items: center; gap: 6px; margin: 0; color: var(--link); font-size: .9rem; font-weight: 600; }
.company-card-cta .icon { width: 18px; height: 18px; }
.company-card-cta .icon-end { width: 16px; height: 16px; }

.pagination { margin-top: 20px; }
.pagination ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.pagination a, .pagination span {
    display: inline-grid; place-items: center; min-width: 44px; height: 44px; padding: 0 12px;
    border-radius: var(--radius-sm); font-weight: 650; font-variant-numeric: tabular-nums;
}
.pagination a { background: var(--surface); box-shadow: var(--shadow); color: var(--text); transition-property: box-shadow; transition-duration: .15s; transition-timing-function: ease-out; }
.pagination a:hover { box-shadow: var(--shadow-raised); text-decoration: none; }
.pagination [aria-current] { background: var(--text); color: #fff; }
@media (max-width: 479px) { .pagination-edge { display: none; } }

/* ---------- company page ---------- */
.chips { list-style: none; margin: 0 0 4px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips a { display: inline-flex; align-items: center; min-height: 32px; padding: 4px 12px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-strong); font-size: .875rem; font-weight: 600; }
.chips a:hover { background: #fadcda; text-decoration: none; }

.facts { padding: 4px 16px; margin-bottom: 0; }
.fact { display: flex; gap: 12px; padding: 10px 0; }
.fact + .fact { border-top: 1px solid var(--line); }
.fact > .icon { margin-top: 2px; color: var(--brand); }
.fact-body { min-width: 0; flex: 1; }
.fact-label { display: block; font-size: .8rem; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.fact-value { display: block; overflow-wrap: anywhere; }
.phones { list-style: none; margin: 0; padding: 0; }
.phones a { font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); }
.phones a:hover { color: var(--brand); }
.fact-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.details { margin-bottom: 0; }
/* embedded map: fixed box (no layout shift while it loads), loaded only near the viewport */
.map { margin: 4px 0 14px; height: 280px; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); box-shadow: 0 0 0 1px rgb(28 27 26 / .08); }
@media (min-width: 800px) { .map { height: 340px; } }
.map iframe { display: block; width: 100%; height: 100%; border: 0; }
/* placeholder drawn in CSS: streets grid, a pin and the button (nothing to download) */
.map-facade {
    position: relative; display: grid; place-items: center; height: 100%; text-decoration: none;
    background-color: #eef0eb;
    background-image:
        linear-gradient(90deg, rgb(255 255 255 / .9) 0 10px, transparent 10px),
        linear-gradient(rgb(255 255 255 / .9) 0 10px, transparent 10px),
        linear-gradient(35deg, transparent 48%, rgb(255 255 255 / .8) 48% 52%, transparent 52%);
    background-size: 120px 120px, 120px 90px, 100% 100%;
    background-position: 30px 0, 0 40px, 0 0;
}
.map-facade:hover { text-decoration: none; }
.map-facade .btn { position: absolute; bottom: 16px; }
.map-pin { width: 44px; height: 44px; color: var(--brand); stroke-width: 2; fill: #fff; translate: 0 -14px; filter: drop-shadow(0 2px 3px rgb(0 0 0 / .25)); }
@media (max-width: 479px) {
    .fact-label-optional { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .page-head h1 { font-size: 1.375rem; }
}
.phones-inline { display: flex; flex-wrap: wrap; gap: 0 18px; }
.fact-actions-main { margin: 0; padding: 0 0 14px 32px; align-items: center; gap: 8px 16px; }
.text-link { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; font-weight: 600; font-size: .9rem; }
.text-link .icon { width: 18px; height: 18px; }
.company-description { margin-top: 24px; }
.update-box-strong { border-color: #f2c4c4; background: var(--brand-soft); }
.more-links ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; }
.more-links a { display: inline-block; padding: 4px 0; }
.company-description > :last-child { margin-bottom: 0; }
.company-extra h2, .company-extra h3 { font-size: 1.05rem; margin-top: 1.25em; }
.company-extra ul { padding-left: 1.1em; }
.company-extra li { margin-bottom: 2px; }
.update-box { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; margin-top: 28px; }
.update-box p { margin: 0; color: var(--text-2); }

.similar { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.similar li + li { border-top: 1px solid var(--line); }
.similar a { display: block; padding: 10px 0; color: var(--text); font-weight: 600; }
.similar a:hover { color: var(--brand); text-decoration: none; }
.similar span { display: block; color: var(--muted); font-size: .875rem; font-weight: 400; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- FAQ (native <details>) ---------- */
.faq { padding: 0; overflow: hidden; }
.faq details + details { border-top: 1px solid var(--line); }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; cursor: pointer; font-weight: 650; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .icon { color: var(--muted); transition: rotate .2s cubic-bezier(.2, 0, 0, 1); }
.faq details[open] summary .icon { rotate: 180deg; }
.faq summary:hover { background: var(--surface-2); }
.faq .faq-answer { padding: 0 18px 14px; color: var(--text-2); }
.faq .faq-answer > :last-child { margin-bottom: 0; }

/* ---------- home ---------- */
.hero { padding: 20px 0 8px; }
.hero h1 { margin-bottom: 8px; }
.hero .lede { color: var(--text-2); margin-bottom: 16px; max-width: 60ch; }
.hero .search { max-width: 720px; }
.hero-hints { margin: 10px 0 0; color: var(--muted); font-size: .9rem; }
.hero-hints a { color: var(--text-2); }
.company-card-about { margin: 0; color: var(--text-2); font-size: .9rem; }
.dialog-foot { margin: 14px 0 0; color: var(--muted); font-size: .875rem; }

/* ---------- forms ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 650; margin-bottom: 4px; font-size: .925rem; }
.field .label-note { font-weight: 400; color: var(--muted); }
.field .hint { display: block; color: var(--muted); font-size: .825rem; margin-top: 4px; }
.input, .field input:not([type=checkbox]):not([type=radio]), .field select, .field textarea {
    width: 100%; min-height: 44px; padding: 10px 12px; background: var(--surface);
    border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
}
.field textarea { min-height: 120px; resize: vertical; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--focus); box-shadow: inset 0 0 0 1px var(--focus); }
.inline-form { display: flex; gap: 8px; }
.inline-form .input { flex: 1; min-width: 0; }
.result { margin-top: 12px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); }
.result:empty { display: none; }
.result > :last-child { margin-bottom: 0; }
.result dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 0; }
.result dt { color: var(--muted); }
.result dd { margin: 0; }
.result + .result { margin-top: 8px; }
.alert { padding: 12px 14px; border-radius: var(--radius-sm); margin-bottom: 14px; border: 1px solid; }
.alert-success { background: #ecf7ee; border-color: #bfe3c6; color: #1d5a2b; }
.alert-error { background: #fdeeee; border-color: #f2c4c4; color: #8a1f1f; }
.alert p { margin: 0; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-grid { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 800px) { .form-grid { grid-template-columns: 1fr 1fr; } }
.table { width: 100%; border-collapse: collapse; font-size: .925rem; }
.table td, .table th { padding: 8px 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table td:last-child { text-align: right; font-variant-numeric: tabular-nums; font-weight: 650; white-space: nowrap; padding-left: 12px; }
.table tr:last-child td { border-bottom: 0; }

/* ---------- dialog ---------- */
dialog {
    width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0;
    border: 0; border-radius: 16px; background: var(--surface); color: var(--text); box-shadow: 0 24px 64px rgb(0 0 0 / .25);
}
dialog::backdrop { background: rgb(20 18 16 / .45); }
dialog, dialog::backdrop {
    transition-property: opacity, translate, overlay, display; transition-duration: .2s; transition-timing-function: ease-out;
    transition-behavior: allow-discrete;
}
dialog:not([open]) { opacity: 0; translate: 0 4px; }
dialog:not([open])::backdrop { opacity: 0; }
@starting-style { dialog[open] { opacity: 0; translate: 0 8px; } dialog[open]::backdrop { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { dialog, dialog::backdrop { transition-duration: 0s; } }

/* copy button: copy icon cross-fades to a check (both icons stay in the DOM) */
.swap-icon { position: relative; display: inline-grid; width: 18px; height: 18px; }
.swap-icon .icon { grid-area: 1 / 1; width: 18px; height: 18px; transition-property: opacity, scale, filter; transition-duration: .2s; transition-timing-function: cubic-bezier(.2, 0, 0, 1); }
.swap-icon .icon:last-child { opacity: 0; scale: .25; filter: blur(4px); }
.is-done .swap-icon .icon:first-child { opacity: 0; scale: .25; filter: blur(4px); }
.is-done .swap-icon .icon:last-child { opacity: 1; scale: 1; filter: blur(0); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.dialog-head .dialog-title { margin: 0; font-size: 1.1rem; font-weight: 700; line-height: 1.2; text-wrap: balance; }
.dialog-body { padding: 20px; }
.dialog-body > :last-child { margin-bottom: 0; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn { transition-property: background-color, color, scale; transition-duration: .15s; transition-timing-function: ease-out; }
.icon-btn:hover { background: var(--bg); color: var(--text); }
.icon-btn:active { scale: .96; }

.exit-page { max-width: 640px; margin: 24px auto; }
.exit-host { display: flex; align-items: center; gap: 8px; font-size: 1.15rem; font-weight: 700; overflow-wrap: anywhere; }
.exit-host .icon { color: var(--brand); }

/* ---------- prose (privacy, terms, category text) ---------- */
.prose { max-width: 72ch; }
.prose h2 { margin-top: 1.5em; }
.prose h3 { margin-top: 1.25em; }

/* ---------- footer ---------- */
.site-footer { background: #1f1d1b; color: #cfcac2; padding: 32px 0 24px; font-size: .925rem; }
.site-footer a { color: #fff; }
.site-footer .footer-title { color: #fff; font-size: 1rem; font-weight: 700; margin: 0 0 12px; }
.footer-states { list-style: none; margin: 0 0 24px; padding: 0; columns: 2 140px; column-gap: 24px; }
@media (min-width: 720px) { .footer-states { columns: 5 140px; } }
.footer-states a { display: block; padding: 4px 0; color: #cfcac2; }
.footer-states a:hover { color: #fff; }
.footer-bottom { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; padding-top: 20px; border-top: 1px solid #3a3734; }
.footer-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 20px; }
.footer-links a { color: #cfcac2; display: inline-block; padding: 4px 0; }
.footer-links a:hover { color: #fff; }
.footer-bottom p { margin: 0; padding: 4px 0; }

/* ---------- Ads (skill adsense-placements): rail layout, fixed size per ad block, dev placeholders ---------- */
.rail { display: none; }
@media (min-width: 1100px) {
    main.has-rail { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 0 40px; align-items: start; }
    /* Page top (breadcrumbs, H1, main block, top ad) spans content + rail: room for the 970x250 top ad. */
    main.has-rail > .lead-area { grid-column: 1 / -1; }
    .rail { display: block; position: sticky; top: 16px; padding-top: 4px; }
}

/* Every block has a FIXED width and height at each breakpoint (real units and placeholders), so
   loading, resizing or not filling never moves the page (CLS).
     top        250x250 (<340px) · 300x250 (340-799px) · 728x90 (800-1099px) · 970x250 (>=1100px)
     middle     250x250 (<340px) · 300x250 (340-799px) · 728x90 (>=800px)
     rail       300x600 (>=1100px only)
     multiplex  column width x 600 (<800px) · x 360 (>=800px) */
.ad { margin: 24px 0; text-align: center; }
.ad-label { display: block; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; line-height: 14px; }
.ad .ad-unit, .ad-placeholder-box { box-sizing: border-box; overflow: hidden; vertical-align: top; }
.ad-placeholder-box { margin-inline: auto; }

.ad-top .ad-unit, .ad-middle .ad-unit,
.ad-top .ad-placeholder-box, .ad-middle .ad-placeholder-box { width: 300px; height: 250px; }
@media (max-width: 339px) {
    .ad-top .ad-unit, .ad-middle .ad-unit,
    .ad-top .ad-placeholder-box, .ad-middle .ad-placeholder-box { width: 250px; height: 250px; }
}
@media (min-width: 800px) {
    .ad-top .ad-unit, .ad-middle .ad-unit,
    .ad-top .ad-placeholder-box, .ad-middle .ad-placeholder-box { width: 728px; height: 90px; }
}
@media (min-width: 1100px) {
    .ad-top .ad-unit, .ad-top .ad-placeholder-box { width: 970px; height: 250px; }
}

/* phone dialog: 24px + label away from the call button (accidental clicks policy) */
.ad-modal { margin: 24px 0 0; }
.ad-modal .ad-unit, .ad-modal .ad-placeholder-box { width: 250px; height: 250px; }
@media (min-width: 400px) { .ad-modal .ad-unit, .ad-modal .ad-placeholder-box { width: 300px; height: 250px; } }

.ad-rail { margin: 0; }
.ad-rail .ad-unit, .ad-rail .ad-placeholder-box { width: 300px; height: 600px; }

.ad-multiplex .ad-unit, .ad-multiplex .ad-placeholder-box { width: 100% !important; height: 600px !important; }
@media (min-width: 800px) { .ad-multiplex .ad-unit, .ad-multiplex .ad-placeholder-box { height: 360px !important; } }

/* Unfilled: keep the box (collapsing it would pull the content below upwards), hide the label. */
.ad:has(ins[data-ad-status="unfilled"]) .ad-label { visibility: hidden; }

.ad-placeholder-box {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    padding: 6px; border: 3px dashed #e0006c; border-radius: var(--radius);
    background: repeating-linear-gradient(45deg, #ffe3f0, #ffe3f0 12px, #fff4f9 12px, #fff4f9 24px);
    color: #8a0042; font-size: .9rem; line-height: 1.25;
}
.ad-placeholder-name { font-size: 1.1rem; }
.ad-placeholder-info { font-size: .8rem; }
.ad-ph-desktop { display: none; }
@media (min-width: 800px) { .ad-ph-mobile { display: none; } .ad-ph-desktop { display: inline; } }
.ad-placeholder-env { font: .75rem var(--mono); background: #fff; border: 1px solid #f3a6c8; border-radius: 4px; padding: 1px 6px; max-width: 100%; overflow-wrap: anywhere; }
.env-dev .ad:not(.ad-placeholder) .ad-unit { outline: 3px dashed #e0006c; outline-offset: 2px; background: #fff4f9; }

@media (max-width: 599px) { .ad { margin: 20px 0; } }
/* clear gap between the main block (buttons, forms) and the first ad (accidental clicks policy) */
.answer + .ad, .hero + .ad, .page-head + .ad { margin-top: 24px; }
