/* CheckPhangan — стиль iOS, как Mini App (ТЗ 5.27): системный шрифт, фон #F2F2F7, белые группы со скруглением 12,
   тонкие разделители, синий — главное действие (Telegram), серый — второстепенное; тёмная тема — по настройке устройства.
   Без JS и без своих шрифтов; телефон первым (320–390 px). */
:root {
  --bg: #f2f2f7; --card: #fff; --fg: #000; --fg2: #6c6c70; --fg3: #c7c7cc; --sep: rgba(60, 60, 67, .2);
  --fill: rgba(118, 118, 128, .12); --seg-on: #fff; --bar: rgba(249, 249, 249, .86);
  --blue: #007aff; --red: #ff3b30; --r: 12px; --max: 1080px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #000; --card: #1c1c1e; --fg: #fff; --fg2: #98989f; --fg3: #48484a; --sep: rgba(84, 84, 88, .6);
    --fill: rgba(118, 118, 128, .24); --seg-on: #636366; --bar: rgba(22, 22, 24, .86); --blue: #0a84ff; --red: #ff453a; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 17px/1.45 var(--font); letter-spacing: -.01em;
  padding-bottom: calc(76px + env(safe-area-inset-bottom)); -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.02em; overflow-wrap: anywhere; }
h1 { font-size: clamp(26px, 7.6vw, 34px); font-weight: 700; margin: 6px 0 8px; }
h2 { font-size: 21px; font-weight: 700; margin: 26px 0 10px; }
h3 { font-size: 17px; font-weight: 600; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; }
.muted { color: var(--fg2); }

/* Шапка: знак и язык (сегмент), ниже — разделы строкой с прокруткой вбок и затуханием у края. */
.top { background: var(--bar); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: .5px solid var(--sep); }
.top .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 0 12px; padding-top: 8px; }
.brand { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--fg); font-weight: 700; font-size: 18px; letter-spacing: -.02em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand svg { width: 28px; height: 28px; flex: none; }
.seg { display: inline-flex; background: var(--fill); border-radius: 9px; padding: 2px; }
.seg > * { flex: 1 1 0; min-width: 44px; min-height: 30px; display: grid; place-items: center; padding: 0 10px; border-radius: 7px;
  color: var(--fg); font-size: 14px; font-weight: 600; white-space: nowrap; }
.seg > a:hover { text-decoration: none; background: rgba(127, 127, 127, .1); }
.seg > [aria-current] { background: var(--seg-on); box-shadow: 0 1px 3px rgba(0, 0, 0, .16), 0 0 0 .5px rgba(0, 0, 0, .04); }
.top .lang { margin-left: auto; }
.top .tg-mini { display: none; }
.menu { order: 3; flex: 1 1 100%; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 4px -16px 0; padding: 6px 40px 10px 16px;
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 44px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 44px), transparent); }
.menu::-webkit-scrollbar { display: none; }
.menu a { flex: none; min-height: 34px; display: inline-grid; place-items: center; padding: 0 14px; border-radius: var(--r); background: var(--card);
  color: var(--fg); font-size: 15px; font-weight: 500; white-space: nowrap; }
.menu a:hover { text-decoration: none; background: var(--fill); }
.menu a[aria-current] { color: var(--blue); font-weight: 600; }
@media (min-width: 900px) {
  .top { position: sticky; top: 0; z-index: 10; }
  .top .wrap { flex-wrap: nowrap; padding-bottom: 8px; }
  .menu { order: 0; flex: 1 1 auto; margin: 0; padding: 0; justify-content: center; -webkit-mask-image: none; mask-image: none; }
  .menu a { background: none; padding: 0 10px; }
  .menu a[aria-current] { background: var(--card); }
  .top .lang { margin-left: 0; }
  .top .tg-mini { display: inline-flex; }
}

/* Telegram — главное действие: синяя кнопка; на телефоне — в нижней панели. */
.tg { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; max-width: 100%; padding: 0 20px;
  border-radius: var(--r); background: var(--blue); color: #fff; font-weight: 600; font-size: 17px; line-height: 1.2; }
.tg:hover { text-decoration: none; filter: brightness(1.08); }
.tg svg { width: 22px; height: 22px; fill: currentColor; flex: none; }
.tg span { min-width: 0; text-align: center; }
.tg-mini { min-height: 34px; padding: 0 14px; font-size: 15px; }
.tg-mini svg { width: 18px; height: 18px; }
.tg-dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: center;
  padding: 8px 16px calc(8px + env(safe-area-inset-bottom)); background: var(--bar); border-top: .5px solid var(--sep);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); }
.tg-dock .tg { width: 100%; max-width: 440px; }
@media (min-width: 900px) { .tg-dock { display: none; } body { padding-bottom: 0; } }

main { padding-top: 10px; padding-bottom: 32px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 2px 6px; margin: 4px 0 0; font-size: 15px; color: var(--fg2); }
.crumbs a + a::before, .crumbs span::before { content: "›"; margin-right: 6px; color: var(--fg3); }
.kicker { margin: 8px 0 0; font-size: 15px; color: var(--fg2); }
.lead { margin: 0 0 16px; color: var(--fg2); max-width: 60ch; }
.tabs { display: flex; margin: 4px 0 16px; }
@media (min-width: 600px) { .tabs { max-width: 420px; } }

/* Группа-список iOS: белая карточка, строки с тонким разделителем и стрелкой ›. */
.list { list-style: none; margin: 0; padding: 0; background: var(--card); border-radius: var(--r); overflow: hidden; }
.list li + li .card::before { content: ""; position: absolute; top: 0; left: 112px; right: 0; border-top: .5px solid var(--sep); }
.card { position: relative; display: grid; grid-template-columns: 84px minmax(0, 1fr) 12px; gap: 12px; align-items: center; padding: 12px 14px 12px 16px; height: 100%; }
.card::after { content: ""; width: 8px; height: 8px; border: solid var(--fg3); border-width: 2px 2px 0 0; transform: rotate(45deg); justify-self: end; }
.card:hover { background: var(--fill); }
.card .img { display: block; width: 84px; height: 84px; border-radius: 10px; overflow: hidden; background: var(--fill); }
.card .img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.card h2, .card h3 { margin: 0; font-size: 17px; font-weight: 600; line-height: 1.25; letter-spacing: -.01em; }
.card h2 a, .card h3 a { color: var(--fg); }
.card h2 a::after, .card h3 a::after { content: ""; position: absolute; inset: 0; }
.card h2 a:hover, .card h3 a:hover { text-decoration: none; }
.card .kicker { margin: 0 0 2px; font-size: 13px; }
.card .spec { margin: 2px 0 0; font-size: 15px; color: var(--fg2); }
.card .price { margin: 3px 0 0; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.sold, .badge { display: inline-block; padding: 1px 8px; border-radius: 6px; background: rgba(255, 59, 48, .14); color: var(--red); font-size: 13px; font-weight: 600; }
@media (min-width: 760px) {
  .list { background: none; border-radius: 0; overflow: visible; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .list li { background: var(--card); border-radius: var(--r); overflow: hidden; }
  .list li + li .card::before { display: none; }
  .card { grid-template-columns: 112px minmax(0, 1fr) 12px; }
  .card .img { width: 112px; height: 112px; }
}

/* Без фото: мягкая заливка цветом iOS по району и номер объекта. */
.ph { display: grid; place-content: center; text-align: center; width: 100%; height: 100%; background: var(--c1); color: var(--c2); }
.ph b { font-size: 26px; font-weight: 700; line-height: 1; letter-spacing: -.02em; }
.ph i { font-style: normal; font-size: 11px; font-weight: 600; margin-top: 4px; opacity: .85; }
.ph.big { aspect-ratio: 2 / 1; border-radius: var(--r); }
.ph.big b { font-size: 56px; }
.ph.big i { font-size: 15px; }
.c0 { --c1: rgba(0, 122, 255, .14); --c2: #007aff; } .c1 { --c1: rgba(52, 199, 89, .16); --c2: #248a3d; }
.c2 { --c1: rgba(255, 149, 0, .16); --c2: #c93400; } .c3 { --c1: rgba(175, 82, 222, .14); --c2: #8944ab; }
.c4 { --c1: rgba(118, 118, 128, .14); --c2: #636366; } .c5 { --c1: rgba(48, 176, 199, .16); --c2: #0071a4; }
@media (prefers-color-scheme: dark) {
  .c0 { --c2: #409cff; } .c1 { --c2: #30d158; } .c2 { --c2: #ffb340; } .c3 { --c2: #da8fff; } .c4 { --c2: #aeaeb2; } .c5 { --c2: #70d7ff; }
}

/* Номера страниц. */
.pager { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 20px 0 4px; font-variant-numeric: tabular-nums; }
.pager a, .pager span { min-width: 44px; height: 44px; display: inline-grid; place-items: center; padding: 0 10px; border-radius: var(--r);
  background: var(--card); color: var(--fg); font-weight: 600; }
.pager a:hover { text-decoration: none; background: var(--fill); }
.pager [aria-current] { background: var(--blue); color: #fff; }
.pager .gap { background: none; min-width: 16px; padding: 0; color: var(--fg2); }

/* Плитки районов: 2 в ряд на телефоне, 3 — шире, 4 — на компьютере. */
.chips { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.chips a { display: flex; flex-direction: column; justify-content: center; gap: 1px; height: 100%; min-height: 56px; padding: 8px 12px;
  border-radius: var(--r); background: var(--card); color: var(--fg); font-size: 15px; font-weight: 600; line-height: 1.25; }
.chips a:hover { text-decoration: none; background: var(--fill); }
.chips small { color: var(--fg2); font-size: 13px; font-weight: 400; font-variant-numeric: tabular-nums; }
@media (min-width: 600px) { .chips { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 900px) { .chips.wide { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* Объект: фото, «Коротко» — группа строк «название — значение», описание. */
.gallery { margin: 0 0 16px; }
.gallery .main { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r); background: var(--fill); }
.gallery ul { list-style: none; padding: 0; margin: 8px 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.gallery li img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; background: var(--fill); }
.gallery .more summary { list-style: none; cursor: pointer; margin: 8px 0 0; min-height: 44px; display: grid; place-items: center;
  border-radius: var(--r); background: var(--fill); color: var(--blue); font-size: 15px; font-weight: 600; }
.gallery .more summary::-webkit-details-marker { display: none; }
.gallery .more[open] summary { display: none; }
@media (min-width: 600px) { .gallery ul { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.nophoto { margin: 8px 4px 0; font-size: 13px; color: var(--fg2); }
.obj-price { margin: 0 0 16px; font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.obj-price .sold { font-size: 15px; vertical-align: middle; }
.obj-grid { display: grid; gap: 0 28px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) {
  .obj-grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); grid-template-areas: "gal side" "desc side"; align-items: start; }
  .obj-grid .gal { grid-area: gal; } .obj-grid .desc { grid-area: desc; } .obj-grid .sum { grid-area: side; position: sticky; top: 84px; }
}
.sum h2 { margin: 8px 0 8px; }
.sum dl { margin: 0; background: var(--card); border-radius: var(--r); overflow: hidden; }
.sum dl div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; min-height: 44px; padding: 11px 16px; position: relative; }
.sum dl div + div::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: .5px solid var(--sep); }
.sum dt { flex: none; max-width: 50%; }
.sum dd { margin: 0; min-width: 0; text-align: right; color: var(--fg2); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.sum .prices dd { color: var(--fg); font-weight: 600; }
.sum .note { margin: 8px 16px 12px; font-size: 13px; color: var(--fg2); }
.sum .tg { width: 100%; }
.sum .code { margin: 8px 0 0; font-size: 13px; color: var(--fg2); text-align: center; }

/* Текст статей и описаний — на белой карточке. */
.text { background: var(--card); border-radius: var(--r); padding: 4px 16px 16px; max-width: 760px; }
.text > :first-child { margin-top: 12px; }
.text h2 { font-size: 20px; margin: 20px 0 8px; }
.text h3 { margin: 16px 0 6px; }
.text p, .text li { overflow-wrap: anywhere; }
.text p { margin: 0 0 12px; }
.text img { display: block; margin: 8px 0; border-radius: var(--r); }
.text table { border-collapse: collapse; width: 100%; font-size: 15px; display: block; overflow-x: auto; }
.text td, .text th { border-bottom: .5px solid var(--sep); padding: 8px 8px 8px 0; vertical-align: top; text-align: left; }
.text .chips a { background: var(--fill); }
.desc { margin-top: 24px; }
@media (min-width: 900px) { .desc { margin-top: 0; } }

/* Блог: статьи строками группы. */
.posts { list-style: none; padding: 0; margin: 0 -16px; }
.posts li { position: relative; padding: 12px 40px 12px 16px; }
.posts li + li::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: .5px solid var(--sep); }
.posts li::after { content: ""; position: absolute; right: 18px; top: 50%; width: 8px; height: 8px; margin-top: -4px; border: solid var(--fg3); border-width: 2px 2px 0 0; transform: rotate(45deg); }
.posts h2 { font-size: 17px; font-weight: 600; margin: 0 0 2px; letter-spacing: -.01em; }
.posts h2 a { color: var(--fg); }
.posts h2 a::after { content: ""; position: absolute; inset: 0; }
.posts li:hover { background: var(--fill); }
.posts p { margin: 0; color: var(--fg2); font-size: 15px; }

/* Просьба написать: текст и синяя кнопка в белой группе. */
.cta { margin: 24px 0 8px; padding: 16px; border-radius: var(--r); background: var(--card); display: grid; gap: 12px; justify-items: stretch; max-width: 760px; }
.cta p { margin: 0; color: var(--fg2); font-size: 15px; }
@media (min-width: 600px) { .cta { justify-items: start; } }

.foot { border-top: .5px solid var(--sep); margin-top: 24px; padding: 4px 0 24px; font-size: 15px; color: var(--fg2); }
.foot h2 { color: var(--fg); margin: 16px 0 10px; }
.foot p { margin: 14px 0 0; font-size: 13px; }
.empty { padding: 16px; border-radius: var(--r); background: var(--card); color: var(--fg2); }
@media (max-width: 359px) {
  .card { grid-template-columns: 68px minmax(0, 1fr) 10px; gap: 10px; padding-left: 12px; padding-right: 10px; }
  .card .img { width: 68px; height: 68px; }
  .list li + li .card::before { left: 90px; }
  .card h2, .card h3 { font-size: 16px; }
  .card .spec, .card .price { font-size: 14px; }
  .ph b { font-size: 22px; }
}
