@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
    --paper: #ffffff;
    --paper-2: #edeae0;
    --surface: #ffffff;
    --surface-2: #edeae0;
    --bg: #f4f2ea;
    --bg-2: #edeae0;
    --header-bg: #17231d;
    --ink: #17231d;
    --ink-2: #3c4a42;
    --ink-3: #5c6b62;
    --ink-4: #849088;
    --line: #dfdacb;
    --line-2: #cfc9b8;
    --brand: #176b4d;
    --brand-ink: #0f5239;
    --brand-soft: #e6efe6;
    --accent: #c8e66a;
    --accent-ink: #4a5b17;
    --accent-soft: #f1f7d9;
    --clay: #c86f52;
    --clay-soft: #f6e8e1;
    --ok: #176b4d;
    --ok-soft: #e3efe4;
    --warn: #956214;
    --danger: #b6344d;
    --radius: 10px;
    --radius-lg: 14px;
    --shadow-sm: 0 1px 2px rgba(23,35,29,.07);
    --shadow: 0 4px 14px rgba(23,35,29,.09);
    --shadow-lg: 0 10px 28px rgba(23,35,29,.12);
    font-family: Manrope, 'Segoe UI', 'PT Sans', Arial, sans-serif;
    scrollbar-color: var(--brand) #e4e0d2;
    scrollbar-width: thin;
}

body { background: var(--bg); font-size: 16px; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: #e4e0d2; }
*::-webkit-scrollbar-thumb { background: var(--brand); border: 2px solid #e4e0d2; border-radius: 999px; }

/* Строгий гуманистический sans-serif для заголовков; данные — табличные цифры */
h1, h2, .section-title, .page-hero h1, .hero-full h1 { font-family: Manrope, 'Segoe UI', 'PT Sans', Arial, sans-serif; font-weight: 700; letter-spacing: -.02em; }
.price-cell strong, .stat-num, .hero-stat-num, .calc-result-num, .calc-result-sub strong, .kv-row strong, .range-val, .admin-table, .scenario-rate { font-variant-numeric: tabular-nums; }
*:focus-visible { outline-color: var(--brand); outline-width: 2px; }
.wrap { max-width: 1180px; }

.site-header { background: rgba(255,255,255,.94); border-color: var(--line); }
.site-header-inner { min-height: 64px; height: auto; }
.site-header .brand-name { font-family: Manrope, 'Segoe UI', 'PT Sans', Arial, sans-serif; font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
/* Вертикальная шкала отбора — подпись Domselect */
.site-header .brand-name::after { content: ''; display: block; width: 68%; height: 4px; margin-top: 5px; border-radius: 2px; background: linear-gradient(180deg,#176b4d 0%,#4e8f5b 40%,#9dbe4e 75%,#c8e66a 100%); }
.site-header .main-nav a { font-size: .9rem; }
.site-header .main-nav a::after { height: 3px; bottom: 10px; border-radius: 2px; background: var(--accent); }
.site-header .city-chip { background: #eef4ec; border-color: #c6d9cc; }
.brand-mark { background: var(--brand); border-radius: 10px; box-shadow: none; }
.btn { border-radius: 10px; }
.btn.primary { background: var(--brand); border-color: var(--brand); box-shadow: none; }
.btn.primary:hover { background: var(--brand-ink); }
.btn.cta { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.btn.cta:hover { background: #b9d94f; border-color: #b9d94f; }

.hero-full { min-height: clamp(480px,78vh,780px); margin: 16px auto 40px; width: min(calc(100% - 32px),1180px); border-radius: 14px; background: #0f5239; }
.hero-full::before { content: ''; position: absolute; width: 300px; height: 300px; right: -70px; top: -60px; border: 56px solid rgba(200,230,106,.22); border-radius: 50%; z-index: 1; }
/* Шкала отбора: от строгого сравнения к выбранному варианту */
.hero-full::after { content: ''; position: absolute; left: 7%; right: 7%; bottom: 30px; height: 6px; border-radius: 3px; background: linear-gradient(90deg,#176b4d 0 25%,#4e8f5b 25% 50%,#9dbe4e 50% 75%,#c8e66a 75%); z-index: 1; }
.hero-full-bg::after { background: linear-gradient(90deg,rgba(23,35,29,.88) 0%,rgba(23,35,29,.66) 48%,rgba(23,35,29,.18) 100%), linear-gradient(0deg,rgba(23,35,29,.58),transparent 60%); }
.hero-full-inner { padding: clamp(30px,5vw,56px); padding-bottom: 72px; }
.hero-full h1 { max-width: 820px; font-size: clamp(2.4rem,5.4vw,4.4rem); line-height: .98; }
.hero-full p { font-size: 1.06rem; max-width: 600px; }
.hero-eyebrow { background: rgba(200,230,106,.13); border-color: rgba(200,230,106,.42); color: #eff7ce; text-transform: none; letter-spacing: .02em; }
.hero-full .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.hero-full .btn.primary:hover { background: #b9d94f; border-color: #b9d94f; }
.hero-search { border-radius: 12px; background: rgba(255,255,255,.12); }
.hero-search .pill { border-radius: 999px; }
.hero-stat-num { font-family: Manrope, 'Segoe UI', 'PT Sans', Arial, sans-serif; font-weight: 700; }
.hero-stat-num .unit { color: var(--accent); }

.section { padding-top: clamp(28px,4.5vw,56px); padding-bottom: clamp(28px,4.5vw,56px); }
.section-title { font-size: clamp(1.6rem,3vw,2.4rem); }
.section-sub { font-size: .95rem; }
.grid-cards { grid-template-columns: repeat(auto-fill,minmax(min(300px,100%),1fr)); gap: 14px; }
.card, .panel, .filter-panel { border-color: var(--line); border-radius: 14px; background: var(--canvas); }
.building-card { border-radius: 14px; position: relative; }
.building-card:hover { border-color: var(--brand); box-shadow: var(--shadow); transform: translateY(-2px); }
.building-card-media { aspect-ratio: 16/11; }
.building-card-media:focus-visible { outline-offset: -3px; }
.building-card-body { min-width: 0; padding: 14px 16px 16px; }
.building-card-title { overflow-wrap: anywhere; font-family: Manrope, 'Segoe UI', 'PT Sans', Arial, sans-serif; font-size: 1.15rem; font-weight: 700; }
.building-card-dev { overflow-wrap: anywhere; }
.building-card-loc { overflow-wrap: anywhere; }
.price-cell { min-width: 0; }
.price-cell strong { overflow-wrap: anywhere; }
.building-card-class { background: var(--clay); color: var(--ink); box-shadow: none; text-transform: none; }
.building-card-prices .price-cell:first-child strong { color: var(--brand); }
.fav-btn { border-radius: 50%; background: rgba(23,35,29,.72); }
.fav-btn.active { background: var(--accent); color: var(--ink); }
.quick-link { border-radius: 14px; min-height: 104px; background: var(--surface-2); }
.quick-link:nth-child(3n+1) { background: #eff3e7; }
.quick-link:nth-child(3n+2) { background: #f1f5e9; }
.quick-link:nth-child(3n) { background: #f6efe8; }
.quick-link-ico { color: var(--brand); }
.alpha-letter { color: var(--brand); font-family: Manrope, 'Segoe UI', 'PT Sans', Arial, sans-serif; font-weight: 700; }
.page-hero { border-radius: 14px; background: linear-gradient(135deg,#0f5239,#176b4d); }
.filter-panel { box-shadow: var(--shadow-sm); }
.footer { background: #17231d; color: #ffffff; }
.footer a, .footer .brand-name { color: #ffffff; }
.footer h4 { color: #c8e66a; }
.footer-bottom { color: rgba(255,255,255,.72); border-color: rgba(255,255,255,.16); }
.confirm-dialog { width: min(520px,calc(100% - 28px)); max-height: calc(100dvh - 28px); padding: 0; border: 1px solid var(--line-2); border-radius: 14px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); }
.confirm-dialog::backdrop { background: rgba(23,35,29,.6); backdrop-filter: blur(4px); }
.confirm-dialog-card { padding: 24px; }
.confirm-dialog-card h2 { margin: 0 0 10px; font-size: 1.5rem; }
.confirm-dialog-card p { margin: 0 0 22px; color: var(--ink-3); }
.confirm-dialog-card .btn-row { display: flex; justify-content: flex-end; gap: 10px; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }

.pill:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.search-status { margin-bottom: 16px; padding: 12px 16px; border: 1px solid rgba(149,98,20,.35); border-radius: var(--radius); background: #fdf3dd; color: var(--warn); font-size: .92rem; font-weight: 600; }
.empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 18px; }
.filter-row input[type="number"] { min-width: 0; }

.btn:disabled { opacity: .55; cursor: progress; }
.gallery a { display: block; height: 100%; border-radius: var(--radius); overflow: hidden; }
.gallery a img { cursor: pointer; }
.gallery a:focus-visible { outline-offset: -3px; }
.progress-grid a { display: block; border-radius: var(--radius); overflow: hidden; }
.progress-grid a img { cursor: pointer; }
.progress-grid a:focus-visible { outline-offset: -3px; }
.plan-empty { display: grid; place-items: center; min-height: 220px; padding: 28px 24px; border: 1px dashed var(--line-2); border-radius: var(--radius-lg); background: var(--surface-2); color: var(--ink-2); text-align: center; }
.plan-empty p { max-width: 440px; }
.field-error { margin-top: 4px; color: var(--danger); font-size: .82rem; font-weight: 600; }
.field.has-error input, .field.has-error textarea { border-color: var(--danger); }
.inquiry-done { display: flex; align-items: flex-start; gap: 12px; background: var(--ok-soft); border-color: rgba(23,107,77,.35); color: var(--ok); }
.inquiry-done-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--ok); color: #ffffff; flex-shrink: 0; font-size: 1.1rem; }
.inquiry-done p { margin-top: 4px; font-size: .92rem; }

@media (max-width: 400px) {
    .filter-panel { padding: 16px 14px; }
}

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

@media (max-width: 760px) {
    .hero-full { width: calc(100% - 20px); min-height: 620px; border-radius: 12px; }
    .hero-full-inner { padding: 30px 22px 68px; }
    .hero-full h1 { font-size: clamp(2.2rem,10vw,3.6rem); }
    .hero-full::before { width: 190px; height: 190px; border-width: 40px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms; animation-iteration-count: 1; transition-duration: .01ms; }
}

@media (forced-colors: active) {
    :root { scrollbar-color: auto; }
    .hero-full::after, .site-header .brand-name::after { background: CanvasText; }
}

/* Domselect: досье выбора — сравнимые карточки и честные пропуски */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.building-card-media .no-photo { position: absolute; inset: 0; display: grid; place-items: center; padding: 12px; text-align: center; color: var(--ink-4); font-size: .82rem; font-weight: 600; }
.dossier-facts { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px 16px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.fact { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fact-wide { grid-column: 1 / -1; }
.fact-label { color: var(--ink-4); font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.fact-value { color: var(--ink); font-size: 1.02rem; font-weight: 800; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.fact-value.brand { color: var(--brand); }
.fact-none { color: var(--ink-4); font-weight: 600; }
.building-card-loc.is-empty { color: var(--ink-4); }
.filter-sort { display: flex; flex-direction: column; gap: 3px; }
.filter-sort label { font-size: .8rem; font-weight: 700; color: var(--ink-2); }
.filter-sort .sort-select { min-width: 220px; }
.crit-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 16px; }
.crit-chip { padding: 4px 10px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-size: .78rem; font-weight: 600; }

@media (max-width: 480px) {
    .dossier-facts { gap: 8px 12px; }
}

/* Domselect: досье объекта и планировки, безопасная заявка */
.dossier-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.dossier-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--canvas); color: var(--ink-2); font-size: .84rem; font-weight: 600; text-decoration: none; transition: border-color .15s, color .15s; }
.dossier-nav a:hover { border-color: var(--brand); color: var(--brand-ink); }
.dossier-facts-page { padding-top: 14px; gap: 12px 20px; }
.dossier-facts-page .fact-value { font-size: 1.12rem; }
.dossier-facts-page .fact-value.brand { font-size: 1.3rem; }
.plan-empty-slim { min-height: 0; padding: 20px 22px; }
.dossier-actions { display: none; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.focus-target:focus, .inquiry-done:focus { outline: 2px solid var(--brand); outline-offset: 4px; border-radius: var(--radius-lg); }
#plans, #location, #about, #advantages, #gallery, #progress, #docs, #developer, #inquiry-form-wrap { scroll-margin-top: 80px; }

@media (max-width: 1080px) {
    .dossier-actions { display: flex; }
}

@media (max-width: 480px) {
    .dossier-facts-page { gap: 10px 12px; }
}
