/* Карманный Гид — веб-версия. Цвета с иконки: синий купола, золото, кремовый карман. */
@font-face { font-family: Playfair; src: url(fonts/PlayfairDisplay-Regular.ttf) format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: Playfair; src: url(fonts/PlayfairDisplay-Bold.ttf) format('truetype'); font-weight: 700; font-display: swap; }

:root {
  --ink: #16222E; --slate: #2E4A66; --slate-deep: #1E3348; --brass: #E0A33E; --brass-deep: #C8862A;
  --cream: #F2E9D8; --parch: #FEFBF4; --dust: #6B7785;
  --bg: var(--cream); --card: var(--parch); --text: #1B2228; --muted: #6B7785; --line: rgba(22, 34, 46, .1);
  --accent: var(--slate); --chip: rgba(46, 74, 102, .08); --chip-on: var(--slate); --chip-on-text: #fff;
  --shadow: 0 1px 2px rgba(22, 34, 46, .06), 0 4px 14px rgba(22, 34, 46, .07);
  --radius: 16px; --wrap: 860px;
  --display: Playfair, Georgia, 'Times New Roman', serif;
  --sans: -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101920; --card: #18242F; --text: #E8E2D6; --muted: #93A0AD; --line: rgba(255, 255, 255, .09);
    --accent: #9DBBD8; --chip: rgba(255, 255, 255, .07); --chip-on: #9DBBD8; --chip-on-text: #101920;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3); color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.45 var(--sans); -webkit-tap-highlight-color: transparent; }
a { color: var(--accent); }
button { font: inherit; color: inherit; cursor: pointer; }
img { display: block; }
svg.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.display { font-family: var(--display); font-weight: 700; letter-spacing: -.01em; line-height: 1.12; }
.wrap { max-width: var(--wrap); margin: 0 auto; }
.boot { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 14px; color: var(--slate); font-family: var(--display); font-size: 22px; }
.boot img { width: 84px; height: 84px; border-radius: 22px; box-shadow: var(--shadow); }

/* ─── Шапки ─── */
.bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 6px; min-height: 56px; padding: 6px 8px;
  padding-top: max(6px, env(safe-area-inset-top)); background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.bar.lined { border-bottom-color: var(--line); }
.bar .title { flex: 1; min-width: 0; font-family: var(--display); font-weight: 700; font-size: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 4px; }
.ib { width: 42px; height: 42px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--text); flex: none; }
.ib:hover { background: var(--chip); }
.ib.on { color: var(--brass-deep); }
.home-head { padding: 18px 20px 6px; display: flex; align-items: flex-end; gap: 8px; }
.home-head h1 { flex: 1; margin: 0; font-size: 31px; }
.home-head { align-items: center; }
.home-sub { padding: 0 20px 4px; color: var(--muted); font-size: 13.5px; min-height: 20px; }
.quota { display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 11px; border-radius: 16px; border: 0; background: var(--chip); font-size: 13px; color: var(--text); white-space: nowrap; }
.quota.prem { background: color-mix(in srgb, var(--brass) 22%, transparent); color: var(--brass-deep); font-weight: 600; }

/* ─── Поиск ─── */
.search { position: sticky; top: 0; z-index: 19; padding: 8px 16px 10px; padding-top: max(8px, env(safe-area-inset-top)); background: var(--bg); }
.search label { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 8px 0 16px; border-radius: 24px; background: color-mix(in srgb, var(--card) 80%, transparent); box-shadow: inset 0 0 0 1px var(--line); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 16px; color: var(--text); }
.search svg { color: var(--muted); }

/* ─── Секции и карточки ─── */
.cap { display: flex; align-items: center; gap: 8px; padding: 18px 20px 10px; font-size: 12px; letter-spacing: .08em; font-weight: 600; color: var(--accent); text-transform: uppercase; }
.cap span { flex: 1; }
.cap em { font-style: normal; color: var(--muted); letter-spacing: 0; font-weight: 400; font-size: 13px; text-transform: none; }
.cap button { border: 0; background: none; color: var(--muted); font-size: 13px; letter-spacing: 0; text-transform: none; font-weight: 400; padding: 2px 6px; }
.near { margin: 6px 16px 4px; display: flex; align-items: center; gap: 14px; width: calc(100% - 32px); padding: 16px 14px 16px 18px; border: 0; border-radius: 20px; background: var(--ink); color: #F7ECD6; text-align: left; }
.near i { width: 48px; height: 48px; border-radius: 50%; background: var(--brass); color: #2A1D04; display: grid; place-items: center; flex: none; }
.near b { display: block; font-family: var(--display); font-size: 20px; }
.near small { display: block; color: rgba(255, 255, 255, .65); font-size: 13.5px; margin-top: 2px; }
.near > div { flex: 1; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); gap: 12px; padding: 0 16px; }
.tile { position: relative; aspect-ratio: 1.15; border-radius: var(--radius); overflow: hidden; background: var(--ink); border: 0; padding: 0; text-align: left; box-shadow: var(--shadow); }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.tile:hover img { transform: scale(1.04); }
.tile .lab { position: absolute; inset: auto 0 0 0; padding: 30px 12px 10px; background: linear-gradient(transparent, rgba(10, 16, 22, .82)); color: #fff; }
.tile .lab b { display: block; font-family: var(--display); font-size: 18px; line-height: 1.15; }
.tile .lab small { font-size: 12.5px; opacity: .8; }
.strip { display: flex; gap: 10px; overflow-x: auto; padding: 0 16px 6px; scroll-padding: 0 16px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.strip::-webkit-scrollbar { display: none; }
.rec { flex: none; width: 128px; scroll-snap-align: start; border: 0; padding: 0; background: none; text-align: left; }
.rec .ph { width: 128px; height: 74px; border-radius: 12px; overflow: hidden; background: var(--slate); display: grid; place-items: center; color: #fff; }
.rec .ph img { width: 100%; height: 100%; object-fit: cover; }
.rec b { display: block; font-size: 13.5px; font-weight: 600; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec small { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list { display: flex; flex-direction: column; gap: 8px; padding: 0 12px; }
.row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 0; border-radius: 14px; background: var(--card); box-shadow: var(--shadow); text-align: left; color: var(--text); text-decoration: none; }
.row .th { width: 56px; height: 56px; border-radius: 10px; overflow: hidden; flex: none; background: var(--chip); display: grid; place-items: center; color: var(--muted); }
.row .th img { width: 100%; height: 100%; object-fit: cover; }
.row .tx { flex: 1; min-width: 0; }
.row .tx b { display: block; font-weight: 600; font-size: 15.5px; line-height: 1.3; }
.row .tx small { display: block; color: var(--muted); font-size: 13.5px; line-height: 1.35; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row .go { color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.tag { font-size: 11.5px; padding: 2px 8px; border-radius: 9px; background: var(--chip); color: var(--muted); }
.tag.gold { background: color-mix(in srgb, var(--brass) 20%, transparent); color: var(--brass-deep); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 10px 12px 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 34px; padding: 0 14px; border-radius: 17px; border: 1px solid var(--line); background: var(--card); font-size: 14px; color: var(--text); white-space: nowrap; }
.chip.on { background: var(--chip-on); border-color: transparent; color: var(--chip-on-text); }
.tabs { display: flex; gap: 4px; margin: 0 12px; padding: 4px; border-radius: 14px; background: var(--chip); }
.tabs button { flex: 1; height: 40px; border: 0; border-radius: 11px; background: transparent; font-weight: 600; font-size: 14.5px; color: var(--muted); display: flex; align-items: center; justify-content: center; gap: 6px; }
.tabs button.on { background: var(--card); color: var(--accent); box-shadow: var(--shadow); }
.more { display: block; margin: 14px auto 0; height: 42px; padding: 0 20px; border-radius: 21px; border: 1px solid var(--line); background: var(--card); color: var(--accent); font-weight: 600; }
.empty { padding: 50px 24px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--text); font-size: 17px; margin-bottom: 6px; }
.spin { width: 30px; height: 30px; margin: 60px auto; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .9s linear infinite; }
.spin.sm { width: 18px; height: 18px; margin: 0; border-width: 2px; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 20px; border-radius: 23px; border: 0; background: var(--slate); color: #fff; font-weight: 600; font-size: 15px; text-decoration: none; }
.btn.gold { background: var(--brass); color: #2A1D04; }
.btn.ghost { background: var(--chip); color: var(--accent); }
.btn.wide { width: 100%; }
.foot { padding: 26px 20px 40px; text-align: center; }
.foot a, .foot button { color: var(--muted); font-size: 14px; background: none; border: 0; }

/* ─── Город ─── */
.hero { position: relative; height: 270px; background: var(--ink); overflow: hidden; }
.hero img { width: 100%; height: 100%; object-fit: cover; opacity: .92; }
.hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(rgba(10, 16, 22, .45), transparent 30%, transparent 45%, rgba(10, 16, 22, .85)); }
.hero .htop { position: absolute; z-index: 2; top: 0; left: 0; right: 0; display: flex; gap: 4px; padding: 8px; padding-top: max(8px, env(safe-area-inset-top)); }
.hero .htop .ib { color: #fff; background: rgba(0, 0, 0, .25); }
.hero .htop .sp { flex: 1; }
.hero .hcap { position: absolute; z-index: 2; left: 20px; right: 20px; bottom: 16px; color: #fff; }
.hero .hcap h1 { margin: 0; font-size: 34px; }
.hero .hcap a, .hero .hcap span { color: rgba(255, 255, 255, .85); font-size: 14px; text-decoration: none; }
.hero.flat { height: 170px; background: linear-gradient(135deg, var(--slate), var(--ink)); }
.route { background: var(--card); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.route > button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px; border: 0; background: none; text-align: left; color: var(--text); }
.route > button b { display: block; font-size: 15.5px; }
.route > button small { display: block; color: var(--muted); font-size: 13.5px; margin-top: 3px; }
.route .stops { padding: 0 14px 14px; }
.stop { display: flex; gap: 12px; padding: 8px 0; border: 0; background: none; width: 100%; text-align: left; color: var(--text); }
.stop .n { width: 26px; height: 26px; border-radius: 50%; background: var(--chip); display: grid; place-items: center; font-size: 12px; flex: none; color: var(--accent); font-weight: 600; }
.stop b { font-weight: 500; font-size: 14.5px; display: block; }
.stop small { color: var(--muted); font-size: 12.5px; }

/* ─── Место ─── */
.gal { position: relative; background: var(--ink); height: min(62vw, 420px); min-height: 230px; }
.gal .rail { display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.gal .rail::-webkit-scrollbar { display: none; }
.gal .rail img { flex: none; width: 100%; height: 100%; object-fit: cover; scroll-snap-align: center; cursor: zoom-in; }
.gal .dots { position: absolute; z-index: 2; bottom: 12px; left: 0; right: 0; display: flex; justify-content: center; gap: 5px; }
.gal .dots i { width: 6px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .5); transition: width .2s; }
.gal .dots i.on { width: 16px; background: #fff; }
.gal .htop { position: absolute; z-index: 3; top: 0; left: 0; right: 0; display: flex; gap: 4px; padding: 8px; padding-top: max(8px, env(safe-area-inset-top)); }
.gal .htop .ib { color: #fff; background: rgba(0, 0, 0, .3); }
.gal .htop .sp { flex: 1; }
.gal.none { height: 150px; background: linear-gradient(135deg, var(--slate), var(--ink)); }
.art { padding: 18px 20px 120px; }
.art h1 { margin: 0 0 8px; font-size: 30px; }
.crumbs { font-size: 14px; margin-bottom: 10px; color: var(--muted); }
.crumbs a { text-decoration: none; }
.lead { color: var(--muted); font-size: 15.5px; line-height: 1.45; margin: 0 0 16px; }
.story { font-size: 17px; line-height: 1.62; }
.story p { margin: 0 0 14px; }
.tip { display: flex; gap: 12px; margin: 22px 0; padding: 16px; border-radius: 14px; background: var(--chip); line-height: 1.5; }
.label { margin: 28px 0 10px; font-size: 12px; letter-spacing: .08em; font-weight: 600; color: var(--accent); text-transform: uppercase; }
.quote { margin: 0 0 16px; padding: 4px 0 4px 14px; border-left: 3px solid var(--brass); }
.quote p { margin: 0 0 6px; font-style: italic; font-size: 16px; line-height: 1.55; }
.quote a, .quote span { font-size: 13px; color: var(--muted); }
.graves { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
.grave { flex: none; width: 116px; border: 0; padding: 0; background: none; text-align: left; color: var(--text); }
.grave .ph { width: 116px; height: 140px; border-radius: 12px; overflow: hidden; background: var(--chip); }
.grave .ph img { width: 100%; height: 100%; object-fit: cover; }
.grave b { display: block; font-size: 13px; font-weight: 600; margin-top: 6px; line-height: 1.25; }
.grave small { font-size: 12px; color: var(--muted); }
.src { margin-top: 30px; font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.src a { color: var(--muted); }
.pending { text-align: center; padding: 30px 10px; color: var(--muted); }
.fab { position: fixed; z-index: 30; left: 50%; transform: translateX(-50%); bottom: max(18px, env(safe-area-inset-bottom)); display: inline-flex; align-items: center; gap: 9px; height: 52px; padding: 0 22px; border-radius: 26px; border: 0;
  background: var(--brass); color: #2A1D04; font-weight: 700; font-size: 15.5px; box-shadow: 0 6px 20px rgba(160, 105, 20, .35); white-space: nowrap; }
.fab:active { transform: translateX(-50%) scale(.97); }

/* ─── Экскурсия ─── */
.tour-stage { padding: 0 16px 140px; }
.tour-ph { margin: 0 -16px; height: min(56vw, 380px); background: var(--ink); position: relative; }
.tour-ph img { width: 100%; height: 100%; object-fit: cover; }
.tour-prog { display: flex; gap: 3px; padding: 12px 0 6px; }
.tour-prog i { flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
.tour-prog i.on { background: var(--brass); }
.tour-nav { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; padding: 12px 16px; padding-bottom: max(12px, env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(10px); border-top: 1px solid var(--line); }
.tour-nav .wrap { display: flex; gap: 10px; align-items: center; }
.tour-nav .btn { flex: 1; }
.tour-nav .ib { background: var(--chip); }

/* ─── Шторка Гида ─── */
.sheet { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; justify-content: flex-end; background: rgba(10, 16, 22, .45); animation: fade .2s; }
.sheet .panel { position: relative; display: flex; flex-direction: column; width: 100%; max-width: var(--wrap); height: min(88vh, 900px); margin: 0 auto; background: var(--bg); border-radius: 22px 22px 0 0; overflow: hidden; animation: up .25s cubic-bezier(.2, .8, .2, 1); }
.sheet .panel.auto { height: auto; max-height: 88vh; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.sh-head { display: flex; align-items: center; gap: 6px; padding: 10px 8px 8px 16px; border-bottom: 1px solid var(--line); }
.sh-head .t { flex: 1; min-width: 0; }
.sh-head .t b { display: block; font-family: var(--display); font-size: 21px; }
.sh-head .t small { display: block; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msgs { flex: 1; overflow-y: auto; padding: 16px 14px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 86%; padding: 10px 14px; border-radius: 18px; line-height: 1.5; font-size: 15.5px; white-space: pre-wrap; word-wrap: break-word; }
.msg.me { align-self: flex-end; background: var(--slate); color: #fff; border-bottom-right-radius: 6px; }
.msg.gd { align-self: flex-start; background: var(--card); box-shadow: var(--shadow); border-bottom-left-radius: 6px; }
.msg.sys { align-self: stretch; max-width: none; background: color-mix(in srgb, var(--brass) 14%, transparent); font-size: 14.5px; text-align: center; }
.hint { color: var(--muted); font-size: 14.5px; line-height: 1.5; padding: 4px 4px 8px; }
.sugs { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.sug { border: 1px solid var(--line); background: var(--card); border-radius: 18px; padding: 8px 14px; font-size: 14.5px; color: var(--accent); text-align: left; }
.compose { display: flex; align-items: flex-end; gap: 8px; padding: 10px 10px; padding-bottom: max(10px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--bg); }
.compose textarea { flex: 1; min-height: 46px; max-height: 140px; resize: none; border: 0; outline: 0; border-radius: 23px; padding: 12px 16px; font: inherit; font-size: 16px; background: var(--card); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.compose .send { width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--brass); color: #2A1D04; display: grid; place-items: center; flex: none; }
.compose .send:disabled { opacity: .45; }
.left-note { padding: 0 16px 6px; font-size: 12.5px; color: var(--muted); text-align: center; }
.upsell { margin: 6px 0; padding: 14px; border-radius: 14px; background: var(--ink); color: #F7ECD6; text-align: center; }
.upsell p { margin: 0 0 10px; font-size: 14.5px; opacity: .85; }

/* ─── Галерея на весь экран, человек некрополя ─── */
.full { position: fixed; inset: 0; z-index: 60; background: #000; display: flex; flex-direction: column; }
.full .rail { flex: 1; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; }
.full .rail figure { flex: none; width: 100%; height: 100%; margin: 0; scroll-snap-align: center; display: flex; flex-direction: column; }
.full .rail img { flex: 1; min-height: 0; width: 100%; object-fit: contain; }
.full figcaption { color: rgba(255, 255, 255, .7); font-size: 12px; padding: 8px 14px 18px; text-align: center; }
.full figcaption a { color: inherit; }
.full .x { position: absolute; z-index: 2; top: max(10px, env(safe-area-inset-top)); right: 10px; color: #fff; background: rgba(255, 255, 255, .15); }
.person { padding: 16px 18px 28px; overflow-y: auto; }
.person .pics { display: flex; gap: 10px; margin-bottom: 14px; }
.person .pics img { height: 190px; max-width: 48%; object-fit: cover; border-radius: 12px; }
.person h2 { margin: 0 0 4px; font-size: 24px; }
.person p { line-height: 1.58; }

/* ─── Тост ─── */
.toast { position: fixed; z-index: 80; left: 50%; bottom: max(84px, calc(env(safe-area-inset-bottom) + 84px)); transform: translateX(-50%); max-width: calc(100% - 32px); padding: 11px 18px; border-radius: 22px; background: var(--ink); color: #fff; font-size: 14.5px; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); text-align: center; }

/* ─── Знакомство ─── */
.intro { min-height: 100vh; display: flex; flex-direction: column; background: var(--ink); color: #F7ECD6; }
.intro .pic { flex: 1; min-height: 40vh; background: center / cover no-repeat; position: relative; }
.intro .pic::after { content: ''; position: absolute; inset: 0; background: linear-gradient(transparent 50%, var(--ink)); }
.intro .body { padding: 0 24px 26px; padding-bottom: max(26px, env(safe-area-inset-bottom)); max-width: 600px; margin: 0 auto; width: 100%; }
.intro h1 { font-size: 34px; margin: 0 0 12px; }
.intro p { font-size: 16.5px; line-height: 1.55; opacity: .85; margin: 0 0 12px; }
.intro .fine { font-size: 12.5px; opacity: .55; }
.intro .bub { margin: 10px 0 16px; display: flex; flex-direction: column; gap: 8px; }
.intro .bub .msg { font-size: 15px; }
.intro .bub .msg.gd { background: rgba(255, 255, 255, .1); color: #F7ECD6; box-shadow: none; }
.intro .pager { display: flex; align-items: center; gap: 12px; margin-top: 18px; }
.intro .pager .dots { flex: 1; display: flex; gap: 6px; }
.intro .pager .dots i { width: 7px; height: 7px; border-radius: 4px; background: rgba(255, 255, 255, .3); }
.intro .pager .dots i.on { width: 20px; background: var(--brass); }
.intro .skip { background: none; border: 0; color: rgba(255, 255, 255, .6); }

@media (min-width: 720px) {
  .hero { height: 340px; border-radius: 0 0 24px 24px; }
  .art { padding-left: 28px; padding-right: 28px; }
  .story { font-size: 17.5px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
