:root {
  --black: #000;
  --kuda: #ff6a00;          /* оранжевый «КУДА?» с аватарки канала */
  --kuda-dim: #b84d00;
  --white: #fff;
  --granite: #17191c;       /* шторка: тёмный гранит набережных */
  --granite-2: #23262a;
  --fog: #9aa1a8;           /* петербургское небо: второстепенный текст */
  --line: #2f3338;
  --open: #5fd39a;
  --display: 'Sofia Sans Extra Condensed', 'Arial Narrow', sans-serif;
  --body: 'Manrope', system-ui, -apple-system, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--black); color: var(--white); font: 15px/1.5 var(--body); }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--kuda); outline-offset: 2px; }
a { color: inherit; }
#map { position: fixed; inset: 0; }
.maplibregl-ctrl-attrib { background: rgba(0,0,0,.55) !important; color: #888; font-size: 10px; }
.maplibregl-ctrl-attrib a { color: #aaa !important; }
.maplibregl-ctrl-bottom-right { bottom: calc(150px + var(--safe-b)); }

/* верх: знак канала и счёт «был в N из 150» */
.top { position: fixed; top: calc(10px + var(--safe-t)); left: 12px; right: 12px; display: flex; justify-content: space-between; align-items: center; pointer-events: none; z-index: 5; }
.top > * { pointer-events: auto; }
.mark { display: flex; align-items: baseline; gap: 5px; background: var(--black); padding: 6px 10px 5px; border-radius: 10px; transform: rotate(-3deg); }
.mark em { font-style: normal; font-size: 12px; color: var(--fog); margin-left: 4px; font-weight: 600; }
.mark b { font: 900 22px/1 var(--display); color: var(--kuda); letter-spacing: .01em; }
.mark span { font: 800 13px/1 var(--body); }
.score { display: flex; align-items: baseline; gap: 5px; background: var(--black); padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); }
.score-n { font: 900 22px/1 var(--display); color: var(--kuda); }
.score-of, .score-l { font-size: 12px; color: var(--fog); }
.score.bump { animation: bump .5s ease; }
@keyframes bump { 40% { transform: scale(1.18); } }

/* кнопка «где я»: справа под счётом; занята — крутится кольцо, найдено — заливка */
.locate { position: fixed; right: 12px; top: calc(62px + var(--safe-t)); z-index: 5; width: 46px; height: 46px; border-radius: 50%; background: var(--black);
  border: 1px solid var(--line); display: grid; place-items: center; box-shadow: 0 4px 14px rgba(0,0,0,.5); }
.locate svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 2; stroke-linejoin: round; transform: rotate(45deg) translate(-1px, 1px); }
.locate[data-st="on"] svg { fill: #3d8bff; stroke: #3d8bff; }
.locate[data-st="busy"]::after { content: ''; position: absolute; inset: 3px; border-radius: 50%; border: 2px solid transparent; border-top-color: var(--kuda); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* кнопки-уточнения внутри шторки */
.chips-in { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.chip { flex: none; padding: 8px 13px; border-radius: 999px; background: var(--granite-2); border: 1px solid var(--line); font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.chip[aria-pressed="true"] { background: var(--kuda); border-color: var(--kuda); color: var(--black); }

/* шторка */
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; background: var(--granite); border-radius: 20px 20px 0 0; box-shadow: 0 -8px 30px rgba(0,0,0,.5);
  /* у каждого состояния своя высота (не сдвиг): список виден и прокручивается до конца в любом положении */
  height: calc(142px + var(--safe-b)); transition: height .3s cubic-bezier(.2,.8,.2,1); display: flex; flex-direction: column; }
.sheet[data-state="half"] { height: 60%; }
.sheet[data-state="full"] { height: calc(100% - 64px - var(--safe-t)); }
.sheet.dragging { transition: none; }
.grab { padding: 12px 0 10px; display: flex; justify-content: center; touch-action: none; cursor: grab; }
.grab i { width: 44px; height: 5px; border-radius: 3px; background: #5a5f66; }
/* снизу запас: в браузере MAX и Safari панель с кнопками лежит поверх страницы */
.sheet-body { overflow-y: auto; padding: 0 16px calc(96px + var(--safe-b)); flex: 1; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.sheet[data-state="peek"] .sheet-body { overflow: hidden; }

/* главный экран: быстрые действия, вопрос и карты */
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 2px 0 18px; }
.qbtn { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 16px; background: var(--granite-2); text-align: left; min-height: 68px; }
.qbtn b { display: block; font-size: 14px; line-height: 1.25; }
.qbtn small { display: block; color: var(--fog); font-size: 12px; line-height: 1.3; margin-top: 2px; }
.qi { font-size: 22px; flex: none; width: 44px; text-align: center; }
.rthumb { flex: none; width: 64px; height: 64px; border-radius: 12px; background: #10161d; }
.rthumb path { fill: none; stroke: var(--kuda); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.rthumb circle { fill: #fff; }
.qbtn .rthumb { width: 44px; height: 44px; border-radius: 10px; }
.rlink { display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 12px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--kuda-dim); text-align: left; }
.rlink .rthumb { width: 40px; height: 40px; border-radius: 9px; }
.rlink b { display: block; font-size: 14px; }
.rlink small { display: block; color: var(--fog); font-size: 12.5px; }
.lnk { color: var(--kuda); font-weight: 700; font-size: inherit; padding: 0; }
.search { width: 100%; margin: 16px 0 4px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--granite-2); color: var(--white); font: 500 15px var(--body); }
.search:focus { outline: 2px solid var(--kuda); outline-offset: 1px; }
.metro .chip { font-weight: 500; }
.retry { margin-top: 14px; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.badges span { padding: 5px 10px; border-radius: 999px; background: var(--granite-2); font-size: 13px; font-weight: 600; }
.stops { list-style: none; counter-reset: st; margin: 6px 0 0; padding: 0; }
.stops li { counter-increment: st; position: relative; padding: 10px 0 12px 42px; border-left: 2px solid var(--kuda-dim); margin-left: 13px; padding-left: 28px; cursor: pointer; transition: background .3s; border-radius: 0 10px 10px 0; }
.stops li:last-child { border-left-color: transparent; }
.stops li::before { content: counter(st); position: absolute; left: -14px; top: 8px; width: 26px; height: 26px; border-radius: 50%; background: var(--kuda); color: var(--black); font: 800 13px/26px var(--body); text-align: center; }
.stops li b { display: block; font-size: 15px; line-height: 1.3; }
.stops li span { display: block; font-size: 14px; line-height: 1.45; margin-top: 3px; color: #d6dade; }
.stops li small { display: block; color: var(--fog); font-size: 12.5px; margin-top: 3px; }
.stops li.hl { background: rgba(255,106,0,.12); }
.food { margin: 10px 0 0; font-size: 14px; line-height: 1.45; }
.food small { color: var(--fog); }

/* главный экран: вопрос и карты */
.h { margin: 6px 0 2px; font: 800 20px/1.25 var(--body); letter-spacing: -.01em; }
.h2 { margin-top: 26px; }
.sub { margin: 4px 0 0; color: var(--fog); font-size: 14px; line-height: 1.45; }
.sub-q { margin-top: 12px; color: var(--white); font-weight: 600; }
.mine { display: grid; width: 100%; margin-top: 14px; padding: 16px; min-height: 96px; border-radius: 18px; text-align: left; align-content: end;
  background: linear-gradient(90deg, rgba(0,0,0,.85), rgba(0,0,0,.25)), var(--img, none) center/cover, var(--kuda); border: 2px solid var(--kuda); }
.mine-t { font: 900 34px/0.95 var(--display); color: var(--kuda); }
.mine-s { font-size: 14px; font-weight: 700; margin-top: 4px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.tile { position: relative; display: grid; align-content: end; min-height: 128px; padding: 12px; border-radius: 16px; text-align: left; overflow: hidden;
  background: linear-gradient(180deg, rgba(0,0,0,.05) 20%, rgba(0,0,0,.88) 100%), var(--img, none) center/cover, var(--granite-2); }
.tile-n { position: absolute; top: 10px; left: 12px; font: 900 30px/1 var(--display); color: var(--kuda); text-shadow: 0 1px 6px rgba(0,0,0,.6); }
.tile-t { font: 800 16px/1.2 var(--body); }
.tile-s { font-size: 12px; color: var(--kuda); font-weight: 700; margin-top: 2px; }
.tile-now { grid-column: 1 / -1; min-height: 120px; outline: 2px solid var(--kuda); outline-offset: -2px; }
.all { display: block; width: 100%; margin: 14px 0 6px; padding: 14px; border-radius: 14px; border: 1px solid var(--line); font-weight: 700; font-size: 14px; }

/* витрина магнита: замки и экран «откройте в боте» */
.unlock { display: block; margin: 0 0 14px; padding: 14px 16px; border-radius: 16px; background: var(--kuda); color: var(--black); text-decoration: none; }
.unlock b { display: block; font: 900 26px/1 var(--display); }
.unlock span { display: block; font-size: 13px; font-weight: 600; margin-top: 4px; line-height: 1.35; }
.tile.locked { filter: saturate(.35) brightness(.8); }
.tile-lock, .tile-open { position: absolute; top: 10px; right: 10px; font-size: 13px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: rgba(0,0,0,.65); }
.tile-open { color: var(--kuda); }
.row-locked .rthumb { opacity: .45; }
.lock { padding-top: 6px; }
.lock-k { margin: 0; color: var(--kuda); font-weight: 700; font-size: 13.5px; }
.lock-t { margin: 6px 0 12px; font: 900 44px/0.95 var(--display); }
.lock-list { margin: 0 0 18px; padding: 0; list-style: none; display: grid; gap: 8px; font-size: 15px; }
.lock-list li { padding-left: 18px; position: relative; }
.lock-list li::before { content: ''; position: absolute; left: 0; top: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--kuda); }
.lock-list b { color: var(--kuda); font-weight: 800; }
.lock .lnk { margin-top: 14px; }

/* экран одной карты */
.back { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--fog); padding: 2px 0 8px; font-weight: 700; }
.th { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.th-t { margin: 0; font: 900 40px/0.95 var(--display); color: var(--kuda); }
.th-n { color: var(--fog); font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.grp { display: flex; justify-content: space-between; align-items: baseline; margin: 22px 0 2px; font: 800 15px/1.3 var(--body); }
.grp span { color: var(--fog); font-weight: 600; font-size: 13px; }

/* сводка в свёрнутой шторке */
.now { display: flex; align-items: center; gap: 12px; padding: 4px 0 12px; }
.now-n { font: 900 46px/0.9 var(--display); color: var(--kuda); min-width: 2ch; }
.now-t { font-size: 14px; line-height: 1.35; }
.now-t small { display: block; color: var(--fog); font-size: 12.5px; }
.now-near { margin-left: auto; flex: none; padding: 9px 12px; border-radius: 12px; background: var(--granite-2); font-size: 13px; font-weight: 700; }

/* список */
.list { list-style: none; margin: 0; padding: 0; }
.row { display: grid; grid-template-columns: 64px 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); cursor: pointer; }
.row-img { width: 64px; height: 64px; border-radius: 12px; background: var(--granite-2) center/cover; position: relative; }
.row-img.ph { display: grid; place-items: center; font: 900 26px/1 var(--display); color: var(--kuda); }
.row-been .row-img::after { content: '✓'; position: absolute; right: -4px; bottom: -4px; width: 22px; height: 22px; border-radius: 50%; background: var(--open); color: var(--black); font-weight: 800; font-size: 13px; display: grid; place-items: center; border: 2px solid var(--granite); }
.row-t { font-size: 11.5px; color: var(--kuda); font-weight: 700; margin-bottom: 1px; }
.row-h { font-weight: 700; font-size: 14.5px; line-height: 1.3; }
.row-m { color: var(--fog); font-size: 12.5px; margin-top: 3px; display: flex; flex-wrap: wrap; gap: 0 10px; }
.row-m .r { color: var(--white); font-weight: 700; }
.row-m .o { color: var(--open); }
.row-m .f { color: var(--kuda); }
.row-m .d { color: var(--white); font-weight: 700; }
.rrow { grid-template-columns: 64px 1fr; }
.empty { color: var(--fog); padding: 20px 0; }
.empty button { color: var(--kuda); font-weight: 700; text-decoration: underline; }

/* карточка места */
.card-photo { margin: 0 -16px; aspect-ratio: 16/10; background: var(--granite-2) center/cover; position: relative; }
.card-photo small { position: absolute; right: 8px; bottom: 6px; font-size: 10px; color: rgba(255,255,255,.75); text-shadow: 0 1px 2px #000; }
.card-photo.ph { aspect-ratio: auto; height: 8px; background: none; }
.card-cat { margin-top: 14px; font-size: 12.5px; font-weight: 700; color: var(--kuda); }
.card-hook { margin: 4px 0 6px; font: 800 22px/1.2 var(--body); letter-spacing: -.01em; }
.card-title { font-size: 13.5px; color: var(--fog); }
.card-pitch { margin: 12px 0 0; font-size: 15px; line-height: 1.55; }
.facts { margin: 14px 0 0; display: grid; gap: 6px; font-size: 13.5px; }
.facts div { display: grid; grid-template-columns: 22px 1fr; }
.facts .o { color: var(--open); font-weight: 700; }
.facts .c { color: #ff8b7a; font-weight: 700; }

.proof { margin-top: 16px; padding: 14px; border-radius: 16px; background: var(--granite-2); }
.proof-top { display: flex; align-items: baseline; gap: 10px; }
.proof-r { font: 900 40px/0.9 var(--display); color: var(--kuda); }
.proof-c { font-size: 13px; color: var(--fog); }
.proof-c a { color: var(--fog); }
.praise-h { margin: 12px 0 0; font-size: 12.5px; color: var(--fog); font-weight: 600; }
.praise { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.praise span { padding: 5px 10px; border-radius: 999px; background: var(--granite); font-size: 13px; font-weight: 600; }
.quote { margin: 12px 0 0; padding-left: 12px; border-left: 3px solid var(--kuda); font-size: 14px; line-height: 1.5; }
.quote small { display: block; color: var(--fog); font-size: 12px; margin-top: 4px; }

.free { margin-top: 16px; padding: 14px; border-radius: 16px; border: 1px solid var(--kuda-dim); }
.free h3 { margin: 0 0 8px; font: 900 24px/1 var(--display); color: var(--kuda); font-weight: 900; }
.free ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.free li { position: relative; padding-left: 18px; font-size: 14px; line-height: 1.45; }
.free li::before { content: ''; position: absolute; left: 2px; top: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--kuda); }
.free li b { display: block; font-weight: 700; }

.tip { margin-top: 16px; font-size: 14px; line-height: 1.5; }
.tip b { color: var(--kuda); }

.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 18px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 14px; border-radius: 14px; font-weight: 700; font-size: 14.5px; text-decoration: none; background: var(--granite-2); }
.btn-main { background: var(--kuda); color: var(--black); }
.btn-wide { grid-column: 1 / -1; }
.btn[aria-pressed="true"] { background: var(--white); color: var(--black); }
.btn-been[aria-pressed="true"] { background: var(--open); }
.src { margin-top: 14px; font-size: 11.5px; color: #6f767d; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.src a { color: var(--fog); }

/* прогресс */
.prog-n { font: 900 96px/0.85 var(--display); color: var(--kuda); margin-top: 8px; }
.prog-n small { font-size: 36px; color: var(--white); }
.prog-t { font-size: 17px; font-weight: 700; margin: 10px 0 4px; }
.prog-s { color: var(--fog); font-size: 14px; margin: 0; }
.bars { margin: 18px 0; display: grid; gap: 10px; }
.bar { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; font-size: 13.5px; font-weight: 600; }
.bar i { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--granite-2); overflow: hidden; }
.bar i b { display: block; height: 100%; background: var(--kuda); border-radius: 3px; }

.shot { margin: 4px 0 16px; }
.shot img { width: 100%; border-radius: 14px; display: block; }
.shot p { color: var(--fog); font-size: 13px; margin: 8px 0 0; }
#shareBtn { margin-top: 16px; width: 100%; }

/* первый экран */
.hero { position: fixed; inset: 0; z-index: 20; background: var(--black); display: grid; place-items: center; padding: 24px 22px calc(28px + var(--safe-b)); transition: opacity .6s ease, transform .6s ease; }
.hero[hidden] { display: none; }
.hero.gone { opacity: 0; transform: scale(1.06); pointer-events: none; }
.hero-in { max-width: 420px; width: 100%; }
.hero-logo { margin: 0; transform: rotate(-4deg); transform-origin: left bottom; }
.hero-logo span { display: block; font: 900 clamp(96px, 34vw, 150px)/.82 var(--display); color: var(--kuda); letter-spacing: -.01em; }
.hero-logo small { display: block; font: 800 34px/1 var(--body); margin: 6px 0 0 6px; }
.hero-count { margin: 34px 0 0; font-size: 22px; line-height: 1.25; font-weight: 700; }
.hero-count b { font: 900 1.6em/1 var(--display); color: var(--kuda); }
.hero-sub { color: var(--fog); margin: 12px 0 26px; font-size: 15px; line-height: 1.5; }
.hero .btn-main { width: 100%; padding: 16px; font-size: 16px; }

.toast { position: fixed; left: 50%; bottom: calc(160px + var(--safe-b)); transform: translate(-50%, 20px); background: var(--white); color: var(--black); padding: 10px 16px; border-radius: 12px; font-weight: 700; font-size: 14px; opacity: 0; transition: .25s; z-index: 30; pointer-events: none; white-space: nowrap; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 760px) {
  .sheet, .sheet[data-state] { left: 16px; right: auto; width: 400px; bottom: 16px; top: calc(110px + var(--safe-t)); height: auto; border-radius: 20px; transition: none; }
  .sheet-body { padding-bottom: 24px; }
  .grab { display: none; }
  .sheet-body { padding-top: 14px; }
  .sheet[data-state="peek"] .sheet-body { overflow-y: auto; }
  .maplibregl-ctrl-bottom-right { bottom: 0; }
  .locate { top: calc(62px + var(--safe-t)); }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---------- путеводители (13.10) ---------- */
.quick .qwide { grid-column: 1 / -1; }
.qi { font-size: 22px; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 10px; background: var(--black); flex: none; }
.row-off { opacity: .7; }
.gcover { height: 180px; margin: 4px 0 14px; border-radius: 16px; background: var(--granite-2) center/cover; }
.gseason { margin: 0 0 10px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--kuda-dim); color: var(--kuda); font-size: 13px; font-weight: 600; }
.gsteps { list-style: none; margin: 6px 0 0; padding: 0; }
.gstep { padding: 14px 0 6px; border-top: 1px solid var(--line); }
.gstep:first-child { border-top: 0; }
.gstep-h { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.gstep-n { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--kuda); color: var(--black); font: 800 14px/28px var(--body); text-align: center; }
.gstep-h b { display: block; font-size: 16px; line-height: 1.3; }
.gstep-h small { display: block; color: var(--fog); font-size: 12.5px; margin-top: 2px; }
.gph { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 12px -4px 4px; padding: 0 4px 4px; -webkit-overflow-scrolling: touch; }
.gph figure { flex: 0 0 86%; margin: 0; scroll-snap-align: start; }
.gph figure:only-child { flex-basis: 100%; }
.gph img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 14px; background: var(--granite-2); }
.gph figcaption { color: var(--fog); font-size: 11px; line-height: 1.3; margin-top: 4px; }
.gtext { margin: 10px 0 0; font-size: 15px; line-height: 1.55; color: #e4e7ea; }
.gfacts { margin: 8px 0 0; color: var(--fog); font-size: 13px; }
.glock { margin-top: 18px; padding: 18px 16px; border-radius: 18px; background: var(--black); border: 1px solid var(--kuda-dim); }
.glock .lock-t { font-size: 34px; }
.glock .btn + .btn { margin-top: 8px; }
.glock .btn, .lock button.btn { display: flex; width: 100%; }
