/* OfferBrief. Token and component contract: /DESIGN.md. */
:root {
    --paper: #F4F4F0;
    --surface: #FFFFFF;
    --panel: #F4F4F0;
    --ink: #111111;
    --ink-soft: #555555;
    --line: #111111;
    --control-line: #111111;
    --night: #F4F4F0;
    --sand: #111111;
    --action: #111111;
    --deed: #1F7A55;
    --deed-hover: #186044;
    --below: #1F7A55;
    --around: #9A6A12;
    --caution-ink: #855B0F;
    --above: #B4233C;
    --green-wash: #EAF3EE;
    --amber-wash: #FFFBF2;
    --red-wash: #FCEEF0;
    --font: 'IBM Plex Sans', system-ui, sans-serif;
    --display: 'Archivo Black', 'IBM Plex Sans', sans-serif;
    --mono: 'IBM Plex Mono', monospace;
    --text-xs: .75rem;
    --text-sm: .875rem;
    --text-md: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.5rem;
    --text-2xl: 2rem;
    --text-3xl: 3rem;
    --text-hero: clamp(3rem, 5.5vw, 5.5rem);
    --space-1: .25rem;
    --space-2: .5rem;
    --space-3: .75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;
    --space-7: 3rem;
    --space-8: 4rem;
    --space-9: 6rem;
    --radius-sm: 0;
    --radius-card: 0;
    --radius-pill: 0;
    --shadow-popover: 4px 4px 0 var(--ink);
    --duration: 160ms;
    --ease: cubic-bezier(.2, 0, 0, 1);
    --measure: 70ch;
    --width: 1200px;
    --header-height: 72px;
    /* Compatibility names for templates outside the public migration. */
    --black: var(--paper);
    --off-white: var(--ink);
    --warning-red: var(--above);
    --data-green: var(--deed);
    --muted: var(--ink-soft);
    --border-subtle: var(--line);
}
* { box-sizing: border-box; }
/* Archivo Black ships one weight; 800 rules must not smear it with synthetic bold. */
html { font-synthesis-weight: none; }
body, h1, h2, h3, h4, p, figure { margin: 0; }
html { scroll-padding-top: calc(var(--header-height) + var(--space-4)); }
body { background: var(--paper); color: var(--ink); font: 400 var(--text-md)/1.6 var(--font); -webkit-font-smoothing: antialiased; }
::selection { background: var(--ink); color: var(--paper); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; }
a { color: var(--action); text-underline-offset: .25em; }
a:hover { text-decoration-thickness: 2px; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
img, svg { max-width: 100%; }
[hidden], .hidden { display: none !important; }
h1, .page-title, .project-name { font: 400 var(--text-3xl)/1.08 var(--display); letter-spacing: -.025em; text-wrap: balance; overflow-wrap: break-word; }
h2, h3 { line-height: 1.3; }
p { max-width: var(--measure); }
.container { max-width: var(--width); margin-inline: auto; padding-inline: var(--space-6); }
main.container { padding-top: calc(var(--header-height) + var(--space-7)); }
.page-header, .project-header { padding-bottom: var(--space-7); border-bottom: 1px solid var(--line); }
.page-subtitle, .project-location, .sub, .subtitle, .lead { color: var(--muted); margin-top: var(--space-3); }
.page-subtitle, .lead { font-size: var(--text-lg); }
.page-header + .stats-grid { margin-top: var(--space-6); }
.section, .communities-section, .projects-section, .scorecard-section { padding-block: var(--space-7); }
.section { border-bottom: 1px solid var(--line); }
.section-header { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-5); flex-wrap: wrap; margin-bottom: var(--space-5); }
.section-title, .section-title h3 { font: 500 var(--text-2xl)/1.15 var(--mono); letter-spacing: -.02em; }
.section-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2); margin-bottom: var(--space-5); }
.section-header .section-title { margin-bottom: 0; }
.section-title i { display: none; }
.section-title span { font: 400 var(--text-sm)/1.5 var(--font); color: var(--muted); letter-spacing: 0; }
.section-link, .back-link, .breadcrumb { font-size: var(--text-sm); }
.back-link { display: inline-block; margin-bottom: var(--space-5); }
.breadcrumb { margin-bottom: var(--space-4); color: var(--muted); }
.breadcrumb a { color: inherit; }

/* Shell */
.site-header { height: var(--header-height); padding-inline: max(var(--space-6), calc((100vw - var(--width)) / 2 + var(--space-6))); position: fixed; inset: 0 0 auto; z-index: 100; display: flex; align-items: center; justify-content: space-between; gap: var(--space-5); background: var(--paper); border-bottom: 2px solid var(--line); }
.logo { display: inline-flex; align-items: center; gap: var(--space-2); font: 400 var(--text-xl)/1 var(--display); letter-spacing: -.02em; color: var(--ink); text-decoration: none; }
.logo svg { width: 24px; height: 24px; flex: none; }
.logo span { color: var(--ink); }
.brand-line { margin-right: auto; padding-left: var(--space-5); border-left: 1px solid var(--line); font: 400 var(--text-xs)/1.4 var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 1180px) { .brand-line { display: none; } }
.header-nav { display: flex; align-items: center; gap: var(--space-2); }
.header-link { padding: var(--space-3); border-radius: var(--radius-sm); font-size: var(--text-sm); color: var(--muted); text-decoration: none; }
.header-link:hover { background: var(--panel); color: var(--ink); }
.header-link i { display: none; }
.header-link, .header-cta { white-space: nowrap; }
.brand-line { min-width: 0; }
.header-account { position: relative; }
.account-toggle { display: flex; align-items: center; gap: var(--space-2); min-height: 48px; max-width: 200px; padding: var(--space-2) var(--space-3); border: 1px solid var(--control-line); border-radius: var(--radius-sm); background: transparent; color: var(--ink); font-size: var(--text-sm); }
.account-toggle:hover, .account-toggle[aria-expanded="true"] { background: var(--panel); }
.account-avatar { display: grid; place-items: center; flex: none; width: 32px; height: 32px; overflow: hidden; border-radius: 0; background: var(--panel); color: var(--ink); font-weight: 600; }
.account-avatar img { width: 100%; height: 100%; object-fit: cover; }
.account-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-menu { position: absolute; top: calc(100% + var(--space-2)); right: 0; min-width: 220px; padding: var(--space-2); border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper); color: var(--ink); box-shadow: var(--shadow-popover); }
.account-menu a { display: block; padding: var(--space-3); border-radius: var(--radius-sm); color: var(--ink); font-size: var(--text-sm); text-decoration: none; }
.account-menu a:hover { background: var(--panel); }
.account-divider { margin: var(--space-2) 0; border: 0; border-top: 1px solid var(--line); }
.mobile-account { display: flex; flex-direction: column; color: var(--ink); }
.mobile-account-name { padding: var(--space-3) var(--space-4); font-weight: 600; overflow-wrap: anywhere; }
.mobile-nav { max-height: calc(100dvh - var(--header-height)); overflow-y: auto; }

.mobile-toggle { display: none; border: 0; background: none; color: var(--ink); font-size: var(--text-xl); padding: var(--space-2); min-width: 44px; min-height: 44px; }
.mobile-nav { display: none; position: fixed; inset: var(--header-height) 0 auto; padding: var(--space-4); background: var(--paper); border-bottom: 1px solid var(--line); z-index: 99; }
.mobile-nav.active { display: flex; flex-direction: column; gap: var(--space-2); }
.mobile-nav .mobile-cta { color: white; }
.mobile-nav a { padding: var(--space-3) var(--space-4); color: var(--ink); text-decoration: none; }

.site-footer { margin-top: var(--space-8); padding: var(--space-8) 0 var(--space-6); border-top: 1px solid var(--line); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: var(--space-7); margin-bottom: var(--space-7); }
.footer-brand .logo { margin-bottom: var(--space-4); }
.footer-tagline, .footer-col a { font-size: var(--text-sm); color: var(--muted); }
.footer-tagline strong { display: block; margin-bottom: var(--space-1); color: var(--ink); font-weight: 600; }
.footer-data-source, .footer-copyright { font-size: var(--text-xs); color: var(--muted); }
.footer-data-source { margin-top: var(--space-4); }
.footer-col h4 { font-size: var(--text-sm); font-weight: 600; margin-bottom: var(--space-4); }
.footer-col ul { margin: 0; padding: 0; list-style: none; }
.footer-col li { margin-bottom: var(--space-2); }
.footer-col a { text-decoration: none; }
.footer-col a:hover { color: var(--action); text-decoration: underline; }
.footer-col i { margin-right: var(--space-2); }
.footer-bottom { display: flex; justify-content: space-between; gap: var(--space-4); padding-top: var(--space-5); border-top: 1px solid var(--line); }
.footer-social { display: flex; gap: var(--space-5); }
.footer-social a { color: var(--muted); }
.skip-link { position: fixed; top: -100px; left: var(--space-4); z-index: 200; padding: var(--space-3) var(--space-4); background: var(--paper); color: var(--ink); }
.skip-link:focus { top: var(--space-4); }

/* Controls. Existing hook classes are component aliases, not separate designs. */
.btn, .header-cta, .mobile-cta, .hero-cta, .check-btn, .go, .attach, .share-btn, .load-more-btn, .error-back-link, .agent-wa,
.share a, .share button, .brief-form button, .auth button, .actions a, .actions button, .acts a, .acts button, .cta-box a {
    display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: 48px;
    padding: var(--space-3) var(--space-5); border: 1px solid var(--ink); border-radius: var(--radius-sm);
    background: var(--action); color: white; font: 600 var(--text-sm)/1.4 var(--font); text-align: center; text-decoration: none;
    transition: background-color var(--duration), transform var(--duration) var(--ease), opacity var(--duration); cursor: pointer;
}
:is(.btn, .header-cta, .hero-cta, .check-btn, .go, .agent-wa, .brief-form button, .auth button, .actions .primary, .acts .primary, .share .wa, .cta-box a):hover { background: var(--paper); color: var(--ink); }
.btn--secondary, .attach, .share-btn, .load-more-btn, .share button, .actions a, .acts a { background: transparent; color: var(--ink); border-color: var(--control-line); }
:is(.btn--secondary, .attach, .share-btn, .load-more-btn, .share button, .actions a, .acts a):hover { background: var(--panel); border-color: var(--ink); color: var(--ink); }
.btn--ghost, .auth .alt { background: transparent; color: var(--ink); border-color: transparent; }
:is(.btn--ghost, .auth .alt):hover { background: var(--panel); color: var(--ink); }
.hero-cta, .night .header-cta { background: var(--action); color: white; }
.hero .hero-cta:hover, .night .site-header .header-cta:hover { background: var(--paper); color: var(--ink); }
:disabled, [aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
[aria-busy="true"] { cursor: progress; }
.go, .auth button, .load-more-btn { width: 100%; }
.go, .load-more-btn { margin-top: var(--space-4); }
.share-btn { min-height: 40px; padding: var(--space-2) var(--space-4); }
:where(input:not([type="file"]):not([type="checkbox"]):not([type="radio"])), select, textarea, .input {
    min-width: 0; max-width: 100%; width: 100%; min-height: 48px; padding: var(--space-3) var(--space-4);
    background: var(--surface); border: 1px solid var(--control-line); border-radius: var(--radius-sm);
    color: var(--ink); font: 400 var(--text-md)/1.5 var(--font); caret-color: var(--action);
    transition: background-color var(--duration);
}
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
:is(input, select, textarea):focus { border-color: var(--ink); }
label, .filter-label { display: block; font-size: var(--text-sm); font-weight: 500; margin-bottom: var(--space-2); }
input[type="file"] { max-width: 100%; font-size: var(--text-sm); }
input::file-selector-button { font: inherit; padding: var(--space-2); margin-right: var(--space-2); border: 1px solid var(--control-line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); }
.filter-bar { display: flex; gap: var(--space-4); align-items: center; flex-wrap: wrap; margin-bottom: var(--space-5); }
.filter-bar .search-input { flex: 1 1 240px; max-width: 400px; }
.filter-group { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.filter-label { margin: 0; }
.pick-tabs, .filter-chips, .segmented { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.pick-tabs { margin-bottom: var(--space-5); }
.project-header .filter-chips { margin-top: var(--space-5); }
.pick-tab, .filter-chip, button.chip, .unit-toggle button, .segmented button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: var(--space-2) var(--space-4); border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--muted); font: 500 var(--text-sm)/1.4 var(--font); text-decoration: none; }
:is(.pick-tab, .filter-chip, button.chip, .unit-toggle button):hover { color: var(--ink); border-color: var(--control-line); }
:is(.pick-tab, .filter-chip, button.chip, .unit-toggle button).active, .segmented [aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.unit-toggle { display: inline-flex; gap: var(--space-1); margin-left: var(--space-2); }
.unit-toggle button { padding: var(--space-1) var(--space-2); min-height: 32px; font-size: var(--text-xs); }

/* Surface, statistics, tags and tables */
.card, .hero-example, .trending-card, .community-card, .project-card, .sc-card, .similar-card, .room-card, .check-deal {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); padding: var(--space-5); color: var(--ink); text-decoration: none;
}
a:is(.card, .hero-example, .trending-card, .community-card, .project-card, .sc-card, .similar-card, .room-card):hover { border-color: var(--control-line); }
.stats-grid, .facts, .nums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border-block: 1px solid var(--line); margin-block: var(--space-6); }
.stat, .stat-card, .stat-item, .facts > div, .num { min-width: 0; padding: var(--space-5); }
.stats-grid > * + *, .facts > * + *, .nums > * + * { border-left: 1px solid var(--line); }
.stat-value, .stat-number, .facts b, .num b, .stat .value { display: block; font: 500 var(--text-2xl)/1.15 var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.02em; color: var(--ink); overflow-wrap: anywhere; }
.stat-value small { font: 400 var(--text-sm)/1.5 var(--font); color: var(--muted); letter-spacing: 0; }
.stat-label, .facts span, .num span, .stat .label, .stat-delta { display: block; font-size: var(--text-sm); color: var(--muted); margin-top: var(--space-2); }
.stat-delta { font-size: var(--text-xs); }
.up, .positive, .val-positive, .good, .supported { color: var(--deed); }
.down, .negative, .val-negative { color: var(--caution-ink); }
.mid, .not { color: var(--around); }
.bad, .high, .facts b.bad { color: var(--above); }
.facts b.good { color: var(--below); }
.facts b.mid { color: var(--around); }
.stats-bar { display: flex; flex-wrap: wrap; gap: var(--space-7); margin-top: var(--space-6); }
.stats-bar .stat-item { padding: 0; }
.badge, .tag, .confidence-badge, .project-badge, span.chip, .result-tag { display: inline-flex; align-items: center; padding: var(--space-1) var(--space-2); border-radius: var(--radius-sm); background: var(--panel); color: var(--muted); font: 500 var(--text-xs)/1.4 var(--font); letter-spacing: 0; }
.confidence-HIGH, span.chip.supported { background: var(--green-wash); color: var(--deed); }
.confidence-MED, span.chip.not { background: var(--amber-wash); color: var(--around); }
.project-badge { margin: var(--space-2); vertical-align: middle; }
.table-wrap, .table-wrapper { width: 100%; overflow-x: auto; }
.data-table, .transactions-table, .scorecard-table, .projects-table, .checks, .comps { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
:is(.data-table, .transactions-table, .scorecard-table, .projects-table, .checks, .comps) :is(th, td) { padding: var(--space-4) var(--space-3); border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
:is(.data-table, .transactions-table, .scorecard-table, .projects-table, .comps) th { color: var(--muted); font-size: var(--text-xs); font-weight: 500; background: var(--panel); }
:is(.data-table, .transactions-table, .scorecard-table, .projects-table) tbody tr:hover { background: var(--panel); }
:is(.data-table, .scorecard-table, .projects-table, .checks) a { color: var(--ink); font-weight: 600; text-decoration: underline; }
:is(.data-table, .scorecard-table, .projects-table, .checks) a:hover { color: var(--action); text-decoration: underline; }
/* Ledger numbers use mono tabular figures. */
:is(.data-table, .scorecard-table) .num-cell, .transactions-table :is(td, th):nth-child(n+4), .projects-table :is(td, th):nth-child(n+2):nth-child(-n+4), .comps :is(td, th):nth-child(n+3) { text-align: right; white-space: nowrap; }
:is(.data-table, .scorecard-table) td.num-cell, .transactions-table td:nth-child(n+4), .projects-table td:nth-child(n+2):nth-child(-n+4), .comps td:nth-child(n+3) { font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 500; }
.scorecard-table th[data-sort] { cursor: pointer; }
.scorecard-table th.sorted-asc::after { content: ' ↑'; }
.scorecard-table th.sorted-desc::after { content: ' ↓'; }
.community-cell, .muted-cell, .date-cell, .results-count { color: var(--muted); font-size: var(--text-xs); }
.price-cell { color: var(--ink); }

/* The ruler: percentile geometry is supplied by the macro, not CSS. */
.ruler { --flag: var(--around); position: relative; padding-top: var(--space-8); margin: var(--space-6) 0 var(--space-5); }
.ruler-track { position: relative; height: 16px; border-bottom: 2px solid var(--ink); }
.ruler-band { position: absolute; bottom: 0; height: 16px; background: #DDDDD7; border: 1px solid var(--ink); }
.ruler-tick { position: absolute; bottom: 0; width: 1px; height: 8px; background: var(--ink); }
.ruler-tick--mid { height: 20px; width: 2px; margin-left: -1px; }
.ruler-flag { position: absolute; left: var(--pos); bottom: 0; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; font: 400 var(--text-xs)/1.4 var(--mono); text-transform: uppercase; color: var(--flag); white-space: nowrap; z-index: 1; }
.ruler-flag b { font: 500 var(--text-xl)/1.2 var(--mono); font-variant-numeric: tabular-nums; color: var(--flag); }
.ruler-flag::after { content: ''; width: 2px; height: 28px; margin-top: var(--space-1); background: var(--flag); }
.ruler-flag--start { transform: translateX(-1px); align-items: flex-start; }
.ruler-flag--end { transform: translateX(calc(-100% + 1px)); align-items: flex-end; }
.ruler--below { --flag: var(--below); }
.ruler--above { --flag: var(--above); }
.ruler-scale { position: relative; display: flex; justify-content: space-between; padding-top: var(--space-2); min-height: 48px; font: 400 var(--text-xs)/1.4 var(--mono); color: var(--ink); }
.ruler-median { position: absolute; top: 28px; left: 50%; transform: translateX(-50%); white-space: nowrap; }
.ruler figcaption { margin-top: var(--space-2); color: var(--muted); font-size: var(--text-xs); max-width: var(--measure); }

/* Ledger skyline, with data and labels visible by default. */
.skyline { position: relative; margin-top: auto; padding-top: var(--space-6); }
.skyline svg { display: block; width: 100%; height: clamp(180px, 30vw, 320px); }
.skyline .reflection { height: 64px; opacity: .18; mask-image: linear-gradient(#000, transparent); }
.skyline .tower { cursor: crosshair; transform-box: fill-box; transform-origin: 50% 100%;  }
.skyline .reflection .tower { animation: none; }
.skyline .body { fill: var(--ink); }
.skyline .roof { fill: var(--ink); }
.skyline .tower.on .body, .skyline .tower:focus .body { fill: var(--ink-soft); }
.skyline .tower.on .roof, .skyline .tower:focus .roof { fill: white; }
.skyline-read { width: 100%; max-width: var(--width); margin-inline: auto; padding: var(--space-4) var(--space-6) var(--space-5); display: flex; flex-direction: column; gap: var(--space-2); font-size: var(--text-xs); color: var(--ink-soft); border-top: 2px solid var(--ink); }
.skyline-read output { color: var(--ink); font-size: var(--text-sm); font-weight: 500; min-height: 3em; }
.skyline-read a { color: var(--sand); }


/* Shared reading and task shells */
.page-narrow, .chk, .check-card, .acct, .brief, .legal-container, .auth, .today, .saved-analysis { max-width: 800px; margin-inline: auto; padding: calc(var(--header-height) + var(--space-7)) var(--space-6) var(--space-7); }
.auth { max-width: 480px; }
.brief { max-width: 896px; }
:is(.chk, .check-card, .acct, .brief, .auth, .legal-container, .today, .saved-analysis) h1 { font-size: var(--text-2xl); }
:is(.check-card, .acct, .brief) section { padding-block: var(--space-6); border-top: 1px solid var(--line); }
:is(.check-card, .acct, .brief) h2, .result-label { font-size: var(--text-lg); font-weight: 600; color: var(--ink); margin-bottom: var(--space-4); }
.sub, .subtitle { font-size: var(--text-sm); }
.note, .disclaimer, .brief-fine, .filter-note, .dna-subtitle { font-size: var(--text-sm); line-height: 1.6; color: var(--muted); margin-top: var(--space-3); }
.status, .brief-status { min-height: 1.5em; margin-top: var(--space-3); font-size: var(--text-sm); color: var(--muted); }
.status.err, .brief-status.err, .note.err { color: var(--around); }
.status.ok, .brief-status.ok, .note.ok { color: var(--deed); }
.empty, .empty-state, .no-data-message { padding: var(--space-6); border: 1px solid var(--control-line); border-radius: var(--radius-card); color: var(--muted); }
.empty a:not(.btn), .no-data-message a { color: var(--action); }
.no-data-message h3 { margin-bottom: var(--space-2); color: var(--ink); font-size: var(--text-lg); }
.error-container { min-height: 70vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: calc(var(--header-height) + var(--space-7)) var(--space-4) var(--space-8); text-align: center; gap: var(--space-5); }
.error-code { font: 800 var(--text-3xl)/1 var(--display); color: var(--muted); }
.error-content { max-width: 560px; }
.error-content h1 { font-size: var(--text-2xl); }
.error-content p { margin: var(--space-4) auto var(--space-5); color: var(--muted); }
.legal-header { margin-bottom: var(--space-7); }
.legal-updated { margin-top: var(--space-3); font-size: var(--text-sm); color: var(--muted); }
.legal-content h2 { margin: var(--space-7) 0 var(--space-4); font-size: var(--text-xl); }
.legal-content p, .legal-content li { margin-bottom: var(--space-4); }
.legal-content ul { padding-left: var(--space-5); }
.highlight-box, .methodology, .low-confidence-warning { padding: var(--space-5); background: var(--panel); border-radius: var(--radius-sm); margin-block: var(--space-5); font-size: var(--text-sm); color: var(--muted); }
.highlight-box p { margin: 0; }
.low-confidence-warning { background: var(--amber-wash); color: var(--around); }

/* Contextual explanations are shared by the project, report and scorecard. */
.confidence-tip, .filter-help { position: relative; display: inline-flex; align-items: center; gap: var(--space-1); font-family: var(--font); }
.tip-icon, .filter-help > i { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; min-height: 24px; font-size: var(--text-xs); font-weight: 600; font-style: normal; color: var(--muted); cursor: help; }
th .tip-icon { min-height: 0; }
.tip-text, .filter-help-tooltip { display: none; position: absolute; top: calc(100% + 8px); right: 0; width: min(280px, 75vw); padding: var(--space-4); border-radius: var(--radius-sm); background: var(--ink); color: var(--paper); box-shadow: var(--shadow-popover); font: 400 var(--text-xs)/1.6 var(--font); white-space: normal; z-index: 90; }
:is(.confidence-tip, .filter-help):is(:hover, :focus-within) :is(.tip-text, .filter-help-tooltip) { display: block; }

@media (max-width: 900px) {
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stats-grid > :nth-child(odd) { border-left: 0; }
    .stats-grid > :nth-child(n+3) { border-top: 1px solid var(--line); }
    .footer-grid { grid-template-columns: 2fr 1fr 1fr; gap: var(--space-5); }
    .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
    :root { --header-height: 64px; --text-3xl: 2rem; }
    .container, .site-header, .skyline-read { padding-inline: var(--space-4); }
    .page-narrow, .chk, .check-card, .acct, .brief, .legal-container, .auth, .today, .saved-analysis { padding-inline: var(--space-4); }
    .header-nav { display: none; }
    .mobile-toggle { display: block; }
    .page-header, .project-header { padding-bottom: var(--space-5); }
    .section-title, .section-title h3 { font-size: var(--text-xl); }
    .stat, .stat-card, .facts > div, .num { padding: var(--space-4) var(--space-3); }
    .stat-value, .stat-number, .facts b, .num b { font-size: var(--text-xl); }
    .filter-bar { align-items: stretch; }
    .filter-bar .search-input { max-width: none; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .footer-bottom { flex-direction: column; }
    .footer-col a { display: inline-block; padding-block: var(--space-1); }
    .ruler-median { left: 50% !important; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print {
    body { background: white; color: var(--ink); }
    .site-header, .mobile-nav, .site-footer, .actions, .skip-link { display: none !important; }
    .brief { padding: 0; max-width: none; }
    .brief section { break-inside: avoid; }
    .ruler { print-color-adjust: exact; }
}

/* Report and offer form compositions shared across routes. */
.brief-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-3); margin-top: var(--space-4); }
.flags { list-style: none; padding: 0; margin: 0; }
.flags li { padding: var(--space-4); margin-bottom: var(--space-3); background: var(--amber-wash); border-radius: var(--radius-sm); font-size: var(--text-sm); }
.size-label { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-2); }
.size-label label { margin: 0; }
.stat-unit { font: 400 var(--text-sm)/1.5 var(--font); letter-spacing: 0; }
@media (max-width: 640px) { .brief-form { grid-template-columns: 1fr; } }

/* Ledger foundation also covers page-local compositions. */
h1, h2, h3, .page-title, .project-name, .section-title, .section-title h3 {
    font-family: var(--display); font-weight: 400; text-transform: uppercase; letter-spacing: -.045em;
}
.header-link, .mobile-nav a, .account-name, .footer-col h4, .section-link,
.stat-label, .stat-delta, .filter-label, .badge, .tag, .confidence-badge,
.project-badge, .result-tag, .legal-updated, .skyline-read {
    font-family: var(--mono); text-transform: uppercase; letter-spacing: .05em;
}
.header-link, .mobile-nav a, .account-menu a, .footer-col a { color: var(--ink); text-decoration: underline; }
.night .hero { background: var(--paper); color: var(--ink); border-bottom: 2px solid var(--ink); }
.night .hero .hero-headline { color: var(--ink); }
.night .hero .hero-headline .opinion, .night .hero .hero-sub { color: var(--ink-soft); }
.night .hero .search-input { background: var(--surface); border-color: var(--ink); color: var(--ink); caret-color: var(--ink); }
.night .hero .search-input::placeholder { color: var(--ink-soft); }
.night .hero .search-input:focus { border-color: var(--ink); }
.skyline .reflection { display: none; }
.skyline-read a { color: var(--action); }
.stat-number, .stat-value, .ruler-scale, .ruler-flag b, .data-table td.num-cell,
.night .market-number, .night .pick-metric { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.ruler-track::after { content: ''; position: absolute; inset: auto 0 0; height: 8px; background: repeating-linear-gradient(to right, transparent 0, transparent calc(5% - 1px), var(--ink) calc(5% - 1px), var(--ink) 5%); }
.ruler-flag span, .ruler-flag b { background: var(--paper); padding-inline: var(--space-1); }
:is(.header-link, .mobile-nav a, .account-menu a):hover { background: var(--ink); color: var(--paper); }
:is(.btn, .header-cta, .mobile-cta, .hero-cta, .check-btn, .go, .attach, .share-btn, .load-more-btn, .error-back-link, .agent-wa, .share a, .share button, .brief-form button, .auth button, .actions a, .actions button, .acts a, .acts button, .cta-box a):hover { background: var(--paper); color: var(--ink); border-color: var(--ink); }
:is(button, .btn, .header-cta, .mobile-cta, .hero-cta, .check-btn, .go, .attach, .share-btn, .load-more-btn, .error-back-link, .agent-wa, .share a, .actions a, .acts a, .cta-box a):active:not(:disabled):not([aria-disabled="true"]) { transform: translateY(1px); }
a:is(.card, .hero-example, .trending-card, .community-card, .project-card, .sc-card, .similar-card, .room-card):hover { background: var(--panel); }
.night .sales-row:hover, .night .price-move:hover, .search-result-item:hover { background: var(--panel); }
:is(a.card, a.hero-example, a.trending-card, a.community-card, a.project-card, a.sc-card, a.similar-card, a.room-card, .sales-row, .price-move, .header-link, .mobile-nav a, .account-menu a, button) { transition: background-color var(--duration), transform var(--duration) var(--ease), opacity var(--duration); }
.js .motion-pending[data-reveal] { opacity: 0; transform: translateY(12px); }
.js .motion-pending[data-grow] { transform: scaleX(0); }
.js [data-reveal], .js [data-grow] { transition: transform var(--duration) var(--ease), opacity var(--duration) var(--ease); }
@media (prefers-reduced-motion: reduce) {
    .js .motion-pending[data-reveal], .js .motion-pending[data-grow] { opacity: 1; transform: none; }
    :is(button, a):active { transform: none !important; }
    *, *::before, *::after { transition: none !important; }
}
@media print {
    .js .motion-pending[data-reveal], .js .motion-pending[data-grow] { opacity: 1; transform: none; }
}

:is(.data-table, .transactions-table, .scorecard-table, .projects-table, .checks, .comps) th,
label, .stat-unit, .stat-value small, .ruler figcaption { font-family: var(--mono); }
:is(.data-table, .transactions-table, .scorecard-table, .projects-table, .checks, .comps) th { text-transform: uppercase; letter-spacing: .05em; }

/* Cross-page fade between same-origin navigations; browsers without support just navigate. */
@media (prefers-reduced-motion: no-preference) {
    @view-transition { navigation: auto; }
}
