/* Стили страниц сайта. Общие компоненты — в styles.css. */

.muted { color: var(--text-2); }
.center { text-align: center; }
.section { margin-top: 56px; }

/* ================= Главная ================= */

.hero { position: relative; margin-top: calc(-1 * var(--header-h)); color: #fff; overflow: hidden; background: var(--navy); }
.hero-bg { position: absolute; inset: 0; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; }
.hero-bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(11, 21, 48, .72) 0%, rgba(11, 21, 48, .35) 55%, rgba(11, 21, 48, .7) 100%),
              linear-gradient(90deg, rgba(11, 21, 48, .55) 0%, rgba(11, 21, 48, 0) 70%);
}
.hero-inner {
  position: relative; min-height: 640px; padding-top: calc(var(--header-h) + 56px); padding-bottom: 120px;
  display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center;
}
.hero-loc { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 12px; background: rgba(255, 255, 255, .16); backdrop-filter: blur(6px); font-size: 14px; margin-bottom: 18px; }
.hero h1 { font-size: clamp(40px, 6vw, 68px); line-height: .98; letter-spacing: -.02em; }
.hero-sub { font-size: clamp(16px, 1.6vw, 20px); margin-top: 16px; opacity: .92; }
.hero-cta { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 32px; margin-top: 40px; flex-wrap: wrap; }
.hero-stats b { display: block; font-size: 26px; }
.hero-stats span { font-size: 13px; opacity: .8; }

.hero-preview { justify-self: end; width: 100%; max-width: 380px; }
.preview-chat { padding: 16px; color: var(--text); display: flex; flex-direction: column; gap: 10px; transform: rotate(1.5deg); box-shadow: 0 30px 60px rgba(0, 0, 0, .3); animation: float 6s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: rotate(1.5deg) translateY(0); } 50% { transform: rotate(1.5deg) translateY(-8px); } }
.preview-head { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.preview-head img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; }
.preview-head small { display: flex; align-items: center; gap: 5px; color: var(--text-2); font-size: 12px; }
.preview-head small i { width: 8px; height: 8px; border-radius: 50%; background: var(--success); }
.bubble { padding: 10px 14px; border-radius: 18px; font-size: 14px; max-width: 88%; }
.bubble.me { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.bubble.ai { align-self: flex-start; background: var(--bubble); border-top-left-radius: 4px; }
.preview-pick { display: flex; gap: 12px; align-items: center; padding: 8px; border-radius: 16px; box-shadow: var(--shadow); }
.preview-pick:empty { display: none; }
.preview-pick img { width: 84px; height: 64px; border-radius: 12px; object-fit: cover; flex: none; }
.preview-pick b { display: block; font-size: 14px; }
.preview-pick small { display: block; color: var(--text-2); font-size: 12px; }
.preview-pick span { font-weight: 700; font-size: 14px; }

.goal-wrap { position: relative; margin-top: -72px; z-index: 2; }
.goal { padding: 24px; border-radius: 24px; }
.goal-head { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; }
.goal-icon .icon { width: 34px; height: 34px; fill: var(--primary); }
.goal-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.goal-card { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 16px; color: var(--text); transition: transform .2s, box-shadow .2s; }
.goal-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.goal-card-icon { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--chip); margin-bottom: 4px; }
.goal-card b { font-size: 16px; }
.goal-card small { color: var(--text-2); font-size: 13px; padding-right: 30px; }
.goal-card-arrow { position: absolute; right: 14px; bottom: 14px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-tint); }
.goal-card-arrow .icon { fill: var(--primary); }

.chips-row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips-row::-webkit-scrollbar { display: none; }
.budget-chip { padding: 12px 18px; font-size: 15px; }
.budget-chip .icon { fill: var(--text-2); }

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.tile { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 18px; border-radius: 20px; color: var(--text); min-height: 150px; transition: transform .2s; }
.tile:hover { transform: translateY(-3px); }
.tile b { font-size: 17px; margin-top: 8px; }
.tile small { color: var(--text-2); font-size: 13px; padding-right: 36px; }
.tile-icon { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; }
.tile-arrow { position: absolute; right: 16px; bottom: 16px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: #fff; }
.tile.blue { background: var(--primary-tint); } .tile.blue .tile-icon { background: var(--primary-tint-strong); } .tile.blue .icon { fill: var(--primary); }
.tile.green { background: var(--success-tint); } .tile.green .tile-icon { background: var(--success-tint-strong); } .tile.green .icon { fill: var(--success); }
.tile.purple { background: var(--accent-tint); } .tile.purple .tile-icon { background: var(--accent-tint-strong); } .tile.purple .icon { fill: var(--accent); }

.rec-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

.steps-wrap { margin-top: 72px; padding: 64px 0; background: var(--page-soft); }
.steps-wrap .section-title { font-size: 30px; }
.steps-wrap .muted { margin-top: 8px; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 36px; counter-reset: step; }
.step { position: relative; padding: 22px; border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); }
.step-n { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--primary); color: #fff; font-weight: 700; margin-bottom: 14px; }
.step b { display: block; font-size: 17px; margin-bottom: 6px; }
.step p { color: var(--text-2); font-size: 14px; }

.districts { display: flex; flex-wrap: wrap; gap: 8px; overflow: hidden; }
.districts-toggle { margin-top: 14px; }
.district { display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px; border-radius: 14px; background: var(--accent-tint); color: var(--text); font-weight: 600; font-size: 14px; transition: background .15s; }
.district:hover { background: var(--accent-tint-strong); }
.district .icon { fill: var(--accent); }

.app-promo { display: grid; grid-template-columns: 1.2fr .8fr; gap: 40px; align-items: center; padding: 48px; border-radius: 32px; background: linear-gradient(135deg, #EEF4FF 0%, #F1EEFF 100%); overflow: hidden; }
.app-text h2 { font-size: 32px; }
.app-text > p { color: var(--text-2); margin-top: 12px; font-size: 16px; }
.app-features { list-style: none; padding: 0; margin: 22px 0 26px; display: grid; gap: 10px; }
.app-features li { position: relative; padding-left: 30px; }
.app-features li::before { content: ""; position: absolute; left: 0; top: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M9 16.17L4.83 12l-1.4 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E") center / 14px no-repeat; }
.stores { display: flex; gap: 10px; flex-wrap: wrap; }
.store { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 18px 0 14px; border-radius: 12px; background: var(--navy); color: #fff; line-height: 1.1; }
.store .icon { width: 26px; height: 26px; flex: none; }
.store > span { display: flex; flex-direction: column; }
.store small { font-size: 10px; opacity: .8; }
.store b { font-size: 17px; }
.store.soon { opacity: .45; cursor: default; }
.app-phone { display: flex; justify-content: center; }
.phone { position: relative; width: 264px; height: 540px; border-radius: 44px; padding: 9px; background: var(--navy); box-shadow: 0 30px 60px rgba(14, 27, 61, .25), inset 0 0 0 2px #24345E; transform: rotate(-4deg); }
.phone::before { content: ""; position: absolute; left: 50%; top: 16px; z-index: 3; width: 74px; height: 20px; margin-left: -37px; border-radius: 12px; background: var(--navy); }
.phone-screen { position: relative; height: 100%; border-radius: 36px; overflow: hidden; background: #fff; display: flex; flex-direction: column; font-size: 9px; line-height: 1.25; color: var(--text); }
.ps-hero { flex: none; height: 158px; padding: 36px 14px 0; background: var(--navy) center / cover; position: relative; color: #fff; }
.ps-hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11, 21, 48, .6), rgba(11, 21, 48, .2)); }
.ps-hero > * { position: relative; }
.ps-loc { display: flex; align-items: center; gap: 3px; font-size: 9px; }
.ps-loc .icon { width: 10px; height: 10px; }
.ps-hero b { display: block; margin-top: 6px; font-size: 19px; line-height: 1.02; letter-spacing: -.01em; }
.ps-goal { position: relative; margin: -30px 6px 0; padding: 8px 6px 7px; border-radius: 14px; background: #fff; box-shadow: 0 4px 14px rgba(14, 27, 61, .12); }
.ps-goal-head { display: flex; align-items: center; gap: 4px; padding: 0 3px 6px; font-weight: 700; font-size: 10px; }
.ps-goal-head .icon { width: 13px; height: 13px; color: var(--primary); }
.ps-goals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.ps-goals div { padding: 5px; border-radius: 9px; box-shadow: 0 2px 6px rgba(14, 27, 61, .1); min-width: 0; }
.ps-goals i { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: var(--chip); margin-bottom: 3px; }
.ps-goals .icon { width: 10px; height: 10px; }
.ps-goals b { display: block; font-size: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ps-label { padding: 9px 10px 5px; font-weight: 700; font-size: 10px; }
.ps-chips { display: flex; gap: 4px; padding: 0 8px; overflow: hidden; }
.ps-chips span { flex: none; display: flex; align-items: center; gap: 3px; padding: 5px 7px; border-radius: 8px; background: var(--chip); font-weight: 600; font-size: 8px; }
.ps-chips .icon { width: 9px; height: 9px; color: var(--text-2); }
.ps-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 0 8px; }
.ps-tile { padding: 6px; border-radius: 10px; font-weight: 600; font-size: 8px; display: flex; flex-direction: column; gap: 4px; min-height: 44px; }
.ps-tile-icon { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; }
.ps-tile .icon { width: 10px; height: 10px; }
.ps-tile.blue { background: var(--primary-tint); } .ps-tile.blue .ps-tile-icon { background: var(--primary-tint-strong); color: var(--primary); }
.ps-tile.green { background: var(--success-tint); } .ps-tile.green .ps-tile-icon { background: var(--success-tint-strong); color: var(--success); }
.ps-tile.purple { background: var(--accent-tint); } .ps-tile.purple .ps-tile-icon { background: var(--accent-tint-strong); color: var(--accent); }
.ps-cards { display: flex; gap: 6px; padding: 0 8px; overflow: hidden; }
.ps-card { flex: 0 0 116px; border-radius: 10px; overflow: hidden; box-shadow: 0 2px 8px rgba(14, 27, 61, .12); }
.ps-card-img { position: relative; height: 74px; background: var(--chip) center / cover; }
.ps-card-img span { position: absolute; left: 4px; bottom: 4px; padding: 2px 5px; border-radius: 6px; background: var(--price); font-weight: 600; font-size: 8px; color: var(--text); }
.ps-card b { display: block; padding: 4px 6px 0; font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ps-card small { display: block; padding: 0 6px 5px; color: var(--text-2); font-size: 7.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ps-tabbar { margin-top: auto; display: grid; grid-template-columns: repeat(4, 1fr); padding: 7px 10px 12px; border-top: 1px solid var(--line); }
.ps-tabbar span { display: grid; place-items: center; color: var(--muted); }
.ps-tabbar span.on { color: var(--primary); }
.ps-tabbar .icon { width: 15px; height: 15px; }

.cta-banner { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 40px 48px; margin-bottom: 64px; border-radius: 32px; color: #fff; background: radial-gradient(120% 140% at 0% 0%, #4C8DFF 0%, #1E6BFF 45%, #1650C7 100%); }
.cta-banner h2 { font-size: 30px; }
.cta-banner p { margin-top: 8px; opacity: .9; max-width: 560px; }
.cta-actions { display: flex; gap: 10px; flex-wrap: wrap; }

@media (max-width: 1024px) {
  .rec-list { grid-template-columns: repeat(2, 1fr); }
  .rec-list > :nth-child(n+5) { display: none; }
  .steps { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .section { margin-top: 36px; }
  .hero-inner { grid-template-columns: 1fr; min-height: 0; padding-top: calc(var(--header-h) + 28px); padding-bottom: 104px; }
  .hero-preview { display: none; }
  .hero-stats { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 18px; margin-top: 28px; }
  .hero-stats b { font-size: 20px; }
  .hero-stats span { font-size: 12px; display: block; line-height: 1.25; }
  .section-title { font-size: 20px; }
  .section-link { white-space: nowrap; }
  .hero-cta .btn { flex: 1; padding: 0 14px; }
  .goal-wrap { margin-top: -64px; }
  .goal { padding: 18px 12px 14px; }
  .goal-head { padding: 0 6px; }
  .goal-list { display: flex; overflow-x: auto; scrollbar-width: none; gap: 8px; margin: -4px -12px -14px; padding: 4px 12px 14px; scroll-snap-type: x mandatory; }
  .goal-list::-webkit-scrollbar { display: none; }
  .goal-card { flex: 0 0 max(150px, calc((100% - 16px) / 3)); padding: 12px; scroll-snap-align: start; }
  .goal-card b { font-size: 14px; }
  .goal-card small { font-size: 12px; }
  .goal-card-icon { width: 36px; height: 36px; }
  .goal-card-icon .icon { width: 18px; height: 18px; }
  .tiles { gap: 8px; }
  .tile { padding: 12px; min-height: 140px; border-radius: 18px; }
  .tile b { font-size: 14px; }
  .tile small { font-size: 12px; padding-right: 0; padding-bottom: 28px; }
  .tile-icon { width: 36px; height: 36px; }
  .tile-icon .icon { width: 18px; height: 18px; }
  .tile-arrow { width: 26px; height: 26px; right: 10px; bottom: 10px; }
  .rec-list { display: flex; overflow-x: auto; scrollbar-width: none; gap: 12px; margin: 0 calc(-1 * var(--gutter)); padding: 4px var(--gutter) 16px; scroll-snap-type: x mandatory; }
  .rec-list::-webkit-scrollbar { display: none; }
  .rec-list > :nth-child(n) { display: flex; }
  .rec-list > * { flex: 0 0 78%; max-width: 300px; scroll-snap-align: start; }
  .steps-wrap { margin-top: 48px; padding: 40px 0; }
  .steps-wrap .section-title { font-size: 24px; }
  .steps { grid-template-columns: 1fr; gap: 10px; margin-top: 24px; }
  .step { display: grid; grid-template-columns: auto 1fr; column-gap: 14px; padding: 16px; }
  .step-n { grid-row: span 2; margin: 0; }
  .app-promo { grid-template-columns: 1fr; padding: 28px 20px; gap: 24px; border-radius: 24px; }
  .app-text h2 { font-size: 24px; }
  .app-phone { margin: -24px 0 -30px; }
  .phone { transform: rotate(-4deg) scale(.88); }
  .cta-banner { flex-direction: column; align-items: stretch; padding: 28px 20px; border-radius: 24px; margin-bottom: 32px; }
  .cta-banner h2 { font-size: 24px; }
  .cta-actions .btn { flex: 1; }
}

@media (max-width: 400px) {
  .hero-cta { flex-direction: column; }
  .hero-cta .btn { flex: none; width: 100%; }
  .tile small { display: none; }
  .tile { min-height: 116px; }
}

/* ================= Каталог ================= */

.catalog { padding-top: 24px; padding-bottom: 56px; }
.catalog-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.catalog-top h1 { font-size: 34px; margin-top: 12px; }
.catalog-top .muted { margin-top: 2px; font-size: 15px; }
.loc-btn { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; color: var(--text); padding: 4px 0; }
.loc-btn .icon-sm { fill: var(--primary); width: 18px; height: 18px; }
.round-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); box-shadow: var(--shadow); flex: none; }
.round-btn svg { width: 20px; height: 20px; fill: none; stroke: var(--text); stroke-width: 2; }
.round-btn.on svg { fill: var(--danger); stroke: var(--danger); }

.catalog-bar { display: flex; gap: 12px; margin-top: 20px; align-items: center; flex-wrap: wrap; }
.catalog-bar[hidden] { display: none; }
.search-box { flex: 1 1 320px; display: flex; align-items: center; gap: 8px; height: 50px; padding: 0 14px; border-radius: 16px; }
.search-box .icon { fill: var(--text-2); }
.search-box input { flex: 1; border: 0; outline: none; background: none; height: 100%; min-width: 0; }
.search-box:focus-within { box-shadow: 0 0 0 2px var(--primary), var(--shadow); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }

.catalog-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 18px; }
.catalog-row b { font-size: 15px; white-space: nowrap; }
.catalog-row-tools { display: flex; gap: 8px; min-width: 0; }
.catalog-row-tools .chip { min-width: 0; }
.catalog-row-tools .chip span { overflow: hidden; text-overflow: ellipsis; }
#map-btn { flex: none; }
#map-btn .icon { fill: var(--primary); width: 16px; height: 16px; }
.categories { margin-top: 14px; }
.categories[hidden] { display: none; }

.results { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 20px; }
.results .empty, .results .ask-ai { grid-column: 1 / -1; }
.ask-ai { display: flex; align-items: center; gap: 14px; padding: 18px 20px; border-radius: 20px; background: var(--primary-tint); }
.ask-ai p { flex: 1; font-weight: 600; }
.ask-ai-icon .icon { width: 28px; height: 28px; fill: var(--primary); }

.catalog-map { margin-top: 20px; height: calc(100vh - 300px); min-height: 420px; border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); z-index: 0; position: relative; }
.map-price { padding: 5px 10px; border-radius: 10px; background: var(--primary); color: #fff; font: 600 12px "Open Sans", sans-serif; white-space: nowrap; box-shadow: 0 2px 8px rgba(14, 27, 61, .3); cursor: pointer; }
.map-marker { position: absolute; transform: translate(-50%, -100%); }
.map-popup { cursor: pointer; max-width: 220px; font-family: "Open Sans", sans-serif; }
.map-popup img { width: 100%; height: 100px; object-fit: cover; border-radius: 10px; margin-bottom: 8px; }
.map-popup b { display: block; font-size: 14px; color: var(--text); }
.map-popup small { display: block; color: var(--text-2); }
.map-popup span { font-weight: 700; color: var(--text); }
.leaflet-popup-content-wrapper { border-radius: 16px !important; }

/* Выпадающий список фильтра */
.picker-backdrop { position: fixed; inset: 0; z-index: 90; }
.picker-backdrop.dim { background: rgba(14, 27, 61, .45); }
.picker {
  position: fixed; z-index: 91; max-height: 360px; overflow-y: auto; padding: 6px;
  background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(-4px); transition: opacity .15s, transform .15s;
}
.picker.shown { opacity: 1; transform: none; }
.picker-title { display: none; }
.picker-list button { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 10px; text-align: left; font-size: 14px; }
.picker-list button:hover { background: var(--chip); }
.picker-list button.on { color: var(--primary); font-weight: 600; }
.picker-list .icon { fill: var(--primary); }
.picker.sheet {
  left: 0; right: 0; bottom: 0; top: auto; max-height: 70dvh; padding: 8px 8px calc(16px + env(safe-area-inset-bottom));
  border-radius: 24px 24px 0 0; transform: translateY(100%);
  transition: transform .25s cubic-bezier(.2, .8, .2, 1);
}
.picker.sheet.shown { transform: none; }
.picker.sheet .picker-title { display: block; padding: 12px 12px 8px; font-weight: 700; font-size: 17px; }
.picker.sheet .picker-list button { padding: 14px 12px; font-size: 16px; }

@media (max-width: 1024px) { .results { grid-template-columns: repeat(2, 1fr); } }

@media (max-width: 860px) {
  .catalog { padding-top: 12px; }
  .catalog-top h1 { font-size: 26px; margin-top: 8px; }
  .catalog-top .muted { font-size: 14px; }
  .catalog-bar { margin-top: 14px; gap: 10px; }
  .search-box { flex-basis: 100%; }
  .filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter); width: calc(100% + 2 * var(--gutter)); }
  .filters::-webkit-scrollbar { display: none; }
  .catalog-map { height: calc(100dvh - 330px); min-height: 360px; }
}

@media (max-width: 640px) {
  .results { grid-template-columns: 1fr; gap: 12px; margin-top: 16px; }
  /* На телефоне карточка горизонтальная, как в каталоге приложения */
  .results .pc { flex-direction: row; min-height: 138px; }
  .results .pc-img { flex: 0 0 128px; aspect-ratio: auto; position: static; }
  .results .pc-body { padding: 10px 10px 10px 12px; gap: 4px; justify-content: center; min-width: 0; }
  .results .pc-name { font-size: 15px; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; padding-right: 30px; }
  .results .pc-price { font-size: 16px; }
  .results .pc-specs { font-size: 12px; }
  .results .fav { left: auto; right: 8px; top: 8px; width: 32px; height: 32px; background: var(--chip); box-shadow: none; }
  .results .badge { left: 8px; top: 8px; font-size: 11px; padding: 3px 8px; }
  .results .tag { font-size: 11px; padding: 3px 7px; }
  .ask-ai { flex-wrap: wrap; }
  .ask-ai .btn { width: 100%; }
}

/* ================= ИИ подбор ================= */

.ai-page .ai { max-width: 860px; margin: 0 auto; min-height: calc(100dvh - var(--header-h)); display: flex; flex-direction: column; }
.ai-intro, .ai-chat { flex: 1; }

.ai-hero { position: relative; height: 330px; overflow: hidden; }
.ai-hero img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; }
.ai-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255, 255, 255, .85) 0%, rgba(255, 255, 255, 0) 45%, rgba(245, 247, 251, 0) 78%, #F5F7FB 100%); }
.ai-hero-text { position: absolute; left: 28px; top: 24px; z-index: 1; max-width: 340px; }
.ai-hero-text h1 { font-size: 40px; }
.ai-hero-text p { font-size: 16px; margin-top: 4px; }

.ai-start { position: relative; z-index: 1; margin-top: -64px; padding: 0 20px 24px; display: flex; flex-direction: column; gap: 12px; }
.ai-greeting { align-self: flex-end; max-width: 380px; padding: 14px 16px; font-size: 15px; border-top-right-radius: 4px; }
.ai-prompts-title { color: var(--text-2); margin: 6px 2px 0; }
.ai-prompts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ai-prompt { display: flex; align-items: center; gap: 12px; padding: 14px; text-align: left; transition: transform .2s, box-shadow .2s; }
.ai-prompt:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.ai-prompt-icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; flex: none; }
.ai-prompt-icon .icon { width: 22px; height: 22px; }
.ai-prompt-icon.blue { background: var(--primary-tint); fill: var(--primary); }
.ai-prompt-icon.green { background: var(--success-tint); fill: var(--success); }
.ai-prompt-icon.purple { background: var(--accent-tint); fill: var(--accent); }
.ai-prompt-icon.orange { background: var(--orange-tint); fill: var(--orange); }
.ai-prompt-text { flex: 1; min-width: 0; }
.ai-prompt-text b { display: block; font-size: 15px; }
.ai-prompt-text small { display: block; color: var(--text-2); font-size: 12px; }
.ai-prompt-chevron { fill: var(--text-2); }

.ai-chat-head {
  position: sticky; top: var(--header-h); z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.ai-chat-title { display: flex; align-items: center; gap: 10px; }
.ai-chat-title img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.ai-chat-title b { display: block; font-size: 16px; }
.ai-chat-title small { display: flex; align-items: center; gap: 5px; color: var(--text-2); font-size: 12px; }
.ai-chat-title small i { width: 8px; height: 8px; border-radius: 50%; background: var(--success); }
.ai-new { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); font-size: 13px; font-weight: 600; }
.ai-new .icon { fill: var(--primary); }

.ai-messages { display: flex; flex-direction: column; gap: 14px; padding: 18px 0 8px; }
.ai-message { display: flex; flex-direction: column; gap: 10px; }
.ai-row { display: flex; gap: 8px; align-items: flex-start; padding: 0 56px 0 12px; }
.ai-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex: none; }
.ai-bubble { padding: 10px 14px 8px; border-radius: 18px; font-size: 15px; max-width: 640px; }
.ai-bubble p { white-space: pre-wrap; overflow-wrap: anywhere; }
.ai-bubble time { display: block; text-align: right; font-size: 11px; margin-top: 2px; color: var(--text-2); }
.ai-bubble.assistant { background: var(--bubble); border-top-left-radius: 4px; }
.ai-thinking .ai-bubble { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 14px; padding: 10px 14px; }
.ai-bubble.mine { align-self: flex-end; margin: 0 12px 0 72px; background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.ai-bubble.mine time { color: rgba(255, 255, 255, .8); }

.ai-picks { display: flex; gap: 12px; overflow-x: auto; padding: 2px 12px 10px 54px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.ai-pick { flex: 0 0 240px; scroll-snap-align: start; align-self: flex-start; }
.ai-pick .pc-img { aspect-ratio: auto; height: 130px; }
.ai-pick .pc-name { font-size: 15px; }
.ai-pick .pc-price { font-size: 17px; }
.ai-pick .pc-body { padding: 12px; gap: 4px; }

.ai-why { margin: 0 12px 0 54px; padding: 14px 16px; border-radius: 18px; background: var(--bubble); display: flex; flex-direction: column; gap: 8px; }
.ai-why b { font-size: 15px; }
.ai-why-row { display: flex; gap: 10px; font-size: 14px; }
.ai-why-row .icon { width: 18px; height: 18px; fill: var(--primary); margin-top: 1px; }

.ai-suggestions { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 12px 0 54px; }
.ai-suggestion { padding: 8px 14px; border-radius: 16px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--primary); font-weight: 600; font-size: 13px; text-align: left; transition: background .15s; }
.ai-suggestion:hover { background: var(--primary-tint); }
.btn.ai-lead { width: auto; margin: 2px 12px 0 54px; }

.ai-thinking { display: flex; gap: 8px; align-items: center; padding: 4px 12px 8px; }
.ai-error { display: flex; align-items: center; gap: 12px; justify-content: space-between; margin: 0 12px 8px; padding: 10px 14px; border-radius: 14px; background: var(--danger-tint); font-size: 14px; }
.ai-error button { padding: 7px 12px; border-radius: 12px; background: var(--surface); color: var(--primary); font-weight: 600; font-size: 13px; flex: none; }

.ai-composer {
  position: sticky; bottom: 0; z-index: 20;
  display: flex; align-items: flex-end; gap: 10px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: var(--surface); border-top: 1px solid var(--line);
}
.ai-input { flex: 1; display: flex; padding: 0 18px; border-radius: 24px; border: 1px solid #DDE3EE; background: var(--surface); box-shadow: 0 2px 8px rgba(14, 27, 61, .06); transition: border-color .15s; }
.ai-input:focus-within { border-color: var(--primary); }
.ai-input textarea { flex: 1; border: 0; outline: none; resize: none; background: none; padding: 13px 0; min-height: 48px; max-height: 160px; font-size: 15px; line-height: 22px; }
.ai-input textarea::placeholder { color: var(--muted); }
.ai-send { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); flex: none; transition: opacity .15s, transform .1s; }
.ai-send:active { transform: scale(.94); }
.ai-send:disabled { opacity: .55; cursor: default; }
.ai-send .icon { fill: #fff; width: 20px; height: 20px; }

@media (min-width: 861px) {
  .ai-page .ai { padding: 0 20px; }
  .ai-composer { border: 0; background: transparent; padding: 12px 0 20px; }
  .ai-composer::before { content: ""; position: absolute; top: 0; bottom: 0; left: -20px; right: -20px; background: linear-gradient(180deg, rgba(245, 247, 251, 0), var(--page-soft) 30%); z-index: -1; }
  .ai-hero { border-radius: 0 0 32px 32px; margin: 0 -20px; }
  .ai-chat-head { margin: 0 -20px; padding: 12px 20px; border-radius: 0 0 20px 20px; box-shadow: var(--shadow); border-bottom: 0; }
}

@media (max-width: 860px) {
  .ai-composer { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: 10px; }
  body.typing .tabbar { display: none; }
  body.typing .ai-composer { bottom: 0; padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
  .ai-page .ai { min-height: calc(100dvh - var(--header-h) - var(--tabbar-h)); }
  .ai-hero { height: 290px; }
  .ai-hero-text { left: 20px; top: 14px; max-width: 250px; }
  .ai-hero-text h1 { font-size: 30px; }
  .ai-hero-text p { font-size: 14px; }
  .ai-start { margin-top: -56px; padding: 0 16px 16px; }
  .ai-greeting { max-width: 280px; font-size: 14px; }
  .ai-prompts { grid-template-columns: 1fr; }
  .ai-prompt { padding: 12px 14px; }
  .ai-pick { flex-basis: 236px; }
  .ai-picks { padding-left: 12px; }
  .ai-why { margin: 0 12px; }
  .ai-suggestions { padding: 0 12px; }
  .btn.ai-lead { margin: 2px 12px 0; }
}

/* ================= Квизы ================= */

.quiz-page { background: var(--page-soft); }
.quiz { min-height: calc(100dvh - var(--header-h)); padding-bottom: 48px; }
.quiz-hero { position: relative; height: 260px; overflow: hidden; color: #fff; background: var(--navy); transition: height .3s; }
.quiz-hero.tall { height: 340px; }
.quiz-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.quiz-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11, 21, 48, .7) 0%, rgba(11, 21, 48, .35) 100%); }
.quiz-hero-bar { position: relative; z-index: 1; display: flex; justify-content: space-between; padding-top: 16px; }
.glass-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .25); backdrop-filter: blur(6px); }
.glass-btn .icon { fill: #fff; }
.glass-btn[hidden] { display: grid !important; visibility: hidden; }
.quiz-hero-text { position: relative; z-index: 1; margin-top: 14px; max-width: 760px; }
.quiz-hero-text h1 { font-size: 40px; }
.quiz-hero-text p { margin-top: 10px; font-size: 16px; opacity: .92; max-width: 560px; }

.quiz-body { position: relative; z-index: 2; margin-top: -60px; max-width: 760px; }
.quiz-card { background: var(--surface); border-radius: 28px; padding: 28px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 18px; }
.quiz-card.plain { background: none; box-shadow: none; padding: 0; }
.quiz-tag { display: flex; align-items: center; gap: 8px; color: var(--primary); font-weight: 600; font-size: 14px; }
.quiz-tag .icon { fill: var(--primary); }
.quiz-progress { display: flex; align-items: center; gap: 12px; color: var(--text-2); font-size: 13px; }
.quiz-progress .bar { flex: 1; height: 6px; border-radius: 3px; background: var(--chip); overflow: hidden; }
.quiz-progress .bar i { display: block; height: 100%; border-radius: 3px; background: var(--primary); transition: width .4s cubic-bezier(.2, .8, .2, 1); }
.quiz-step h1 { font-size: 30px; }
.quiz-hint { color: var(--text-2); font-size: 15px; margin-top: 8px; }
.quiz-step.from-right { animation: slideRight .3s ease both; }
.quiz-step.from-left { animation: slideLeft .3s ease both; }
@keyframes slideRight { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes slideLeft { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }

.quiz-options, .quiz-list { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.quiz-list { margin-top: 0; }
.quiz-option, .quiz-item {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; text-align: left;
  border-radius: 16px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  transition: border-color .15s, background .15s, transform .1s;
}
.quiz-option:hover, .quiz-item:hover { border-color: #C9D6F2; }
.quiz-option:active { transform: scale(.99); }
.quiz-option.on { border: 1.5px solid var(--primary); padding: 11.5px; background: var(--primary-tint); }
.quiz-option-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-tint); flex: none; }
.quiz-option.on .quiz-option-icon { background: var(--primary-tint-strong); }
.quiz-option-icon .icon { fill: var(--primary); }
.quiz-option-text { flex: 1; min-width: 0; }
.quiz-option-text b { display: block; font-size: 16px; }
.quiz-option-text small { display: block; color: var(--text-2); font-size: 13px; }
.quiz-option-mark { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-tint); flex: none; transition: background .15s; }
.quiz-option-mark .icon { fill: var(--primary); }
.quiz-option.on .quiz-option-mark { background: var(--primary); }
.quiz-option.on .quiz-option-mark .icon { fill: #fff; }

.quiz-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.quiz-panel { padding: 20px; border-radius: 20px; display: flex; flex-direction: column; gap: 14px; }
.quiz-panel h2 { font-size: 18px; }
.quiz-panel-head { display: flex; justify-content: space-between; align-items: center; }
.answers { display: flex; flex-direction: column; gap: 12px; }
.answer { display: flex; gap: 12px; align-items: center; }
.answer-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-tint); flex: none; }
.answer-icon .icon { fill: var(--primary); }
.answer small { display: block; color: var(--text-2); font-size: 12px; }
.answer b { display: block; font-size: 15px; }
.quiz-actions { display: flex; flex-direction: column; gap: 10px; }

@media (max-width: 860px) {
  .quiz-hero { height: 220px; }
  .quiz-hero.tall { height: 300px; }
  .quiz-hero-text h1 { font-size: 30px; }
  .quiz-hero-text p { font-size: 14px; }
  .quiz-body { margin-top: -48px; padding: 0; }
  .quiz-card { border-radius: 28px 28px 0 0; padding: 22px 20px 24px; min-height: calc(100dvh - 260px); }
  .quiz-card.plain { padding: 0 12px; min-height: 0; }
  .quiz-step h1 { font-size: 26px; }
  .quiz-grid { grid-template-columns: 1fr; gap: 12px; }
}

/* Страница объекта */
.project-page { max-width: 928px; padding-top: 20px; padding-bottom: 56px; }
.project-back { display: inline-block; margin-bottom: 14px; font-weight: 600; }
.project-page .pd { overflow: hidden; border-radius: 28px; }
@media (max-width: 700px) {
  .project-page { padding-top: 12px; }
  .project-page .pd { border-radius: 20px; }
}
