/* Бангкок — где движ. Палитра взята из города: розовое такси (ночь), зелёная линия BTS (город),
   золото храмов (культура), бирюза (драйв), тыквенный оранжевый (Хэллоуин). */

:root {
  --night: #FF3D8B;
  --city: #8FD14F;
  --culture: #F5C542;
  --drive: #3FD0E0;
  --food: #B06CFF;
  --hall: #FF7A1A;

  --bg: #F4F5F8;
  --panel: #FFFFFF;
  --panel-2: #F3F3F8;
  --ink: #17142B;
  --muted: #5D5878;
  --line: #E3E1EE;
  --glass: rgba(255, 255, 255, 0.88);
  --night-ink: #D0145F;
  --city-ink: #3B7F12;
  --culture-ink: #946B00;
  --drive-ink: #087F8C;
  --food-ink: #6D28D9;
  --hall-ink: #C44D00;
  --ok: #2E8B57;
  --warn: #B7791F;
  --shadow: 0 12px 32px rgba(23, 20, 43, 0.14), 0 2px 6px rgba(23, 20, 43, 0.08);

  --r: 16px;
  --panel-w: 420px;
  --peek: 168px;
  --font-body: "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Unbounded", "Golos Text", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #110E1F;
    --panel: #17132A;
    --panel-2: #1E1936;
    --ink: #F2EFFF;
    --muted: #A49FC6;
    --line: #2C2650;
    --glass: rgba(23, 19, 42, 0.86);
    --night-ink: #FF6BA6;
    --city-ink: #A9E36F;
    --culture-ink: #F7D06A;
    --drive-ink: #6BE0EC;
    --food-ink: #CDA8FF;
    --hall-ink: #FF9A4D;
    --ok: #5BD08F;
    --warn: #F2B84B;
    --shadow: 0 14px 40px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #110E1F;
  --panel: #17132A;
  --panel-2: #1E1936;
  --ink: #F2EFFF;
  --muted: #A49FC6;
  --line: #2C2650;
  --glass: rgba(23, 19, 42, 0.86);
  --night-ink: #FF6BA6;
  --city-ink: #A9E36F;
  --culture-ink: #F7D06A;
  --drive-ink: #6BE0EC;
  --food-ink: #CDA8FF;
  --hall-ink: #FF9A4D;
  --ok: #5BD08F;
  --warn: #F2B84B;
  --shadow: 0 14px 40px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body { overflow: hidden; }

button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--drive);
  outline-offset: 2px;
  border-radius: 8px;
}
/* заголовок карточки получает фокус программно (для экранного диктора) — рамка ему не нужна */
[tabindex="-1"]:focus { outline: none; }

svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- Карта ---------- */

#map { position: fixed; inset: 0; background: var(--bg); }

.maplibregl-ctrl-attrib { font-size: 11px; }
.maplibregl-ctrl-bottom-left, .maplibregl-ctrl-bottom-right { bottom: calc(var(--peek) + 6px); }
.maplibregl-ctrl-group { border-radius: 12px !important; }

/* ---------- Верхняя строка ---------- */

.bar {
  position: fixed;
  z-index: 7;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: calc(env(safe-area-inset-top) + 10px) max(12px, env(safe-area-inset-right)) 6px max(12px, env(safe-area-inset-left));
  pointer-events: none;
}
.bar > * { pointer-events: auto; }

.brand {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 7px 14px 8px;
  border-radius: 14px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  text-decoration: none;
  min-width: 0;
}
.brand-th {
  font-family: "Kanit", var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--muted);
  line-height: 1.1;
}
.brand-ru {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
  line-height: 1.15;
  white-space: nowrap;
}
/* одним цветом, без радуги (Стас, 11.10.2026) */
.brand-ru em { font-style: normal; color: var(--night); }

.bar-actions { display: flex; gap: 6px; flex: none; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  color: var(--ink);
  padding: 0;
}
.icon-btn.small { width: 34px; height: 34px; border-radius: 10px; box-shadow: none; background: transparent; border: 0; }
.icon-btn.small svg { width: 18px; height: 18px; }
.icon-btn[aria-pressed="true"] { color: var(--night-ink); }
/* кнопка входа после входа: аватар Telegram или инициал внутри той же кнопки, точка — связь с хабом */
#btn-login { position: relative; }
#btn-login img, #btn-login .ava-letter { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
#btn-login .ava-letter { display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 16px; color: var(--night-ink); }
#btn-login.signed-in { overflow: visible; padding: 0; }

.layers-pop {
  position: absolute;
  top: calc(env(safe-area-inset-top) + 60px);
  right: 12px;
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  font-weight: 500;
  z-index: 8;
}
.layers-pop label { display: flex; gap: 10px; align-items: center; white-space: nowrap; }
.layers-pop input { width: 18px; height: 18px; accent-color: var(--night); }

/* ---------- Фильтры ---------- */

/* Полоса фильтров целиком ловит касания: раньше зазор между рядами и поля над чипами пропускали палец к карте,
   и горизонтальная прокрутка чипов заодно двигала карту (Стас, 17.10.2026). pan-x — только листать ряды. */
.filters {
  position: fixed;
  z-index: 4;
  top: calc(env(safe-area-inset-top) + 66px);
  left: 0;
  right: 0;
  display: grid;
  gap: 6px;
  pointer-events: auto;
  touch-action: pan-x;
}
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px max(12px, env(safe-area-inset-right)) 4px max(12px, env(safe-area-inset-left));
  scrollbar-width: none;
  pointer-events: auto;
  touch-action: pan-x;
  overscroll-behavior-x: contain;
}
.chips::-webkit-scrollbar { display: none; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px 0 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  flex: none;
}
.chip .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--c, var(--muted));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--c, var(--muted)) 25%, transparent);
}
.chip svg { width: 16px; height: 16px; }
.chip[aria-pressed="true"] {
  background: var(--c, var(--ink));
  border-color: transparent;
  color: #140F22;
}
.chip[aria-pressed="true"] .dot { background: #140F22; box-shadow: none; }
.chip.all[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.chip[aria-pressed="true"] .gem-i { color: inherit; }
.chips.sub .chip { height: 32px; font-size: 13px; padding: 0 12px 0 10px; }
/* панель «Фильтры» (18.10.2026): группы чипов с переносом строк, числа — сколько останется */
.chip.more { padding: 0 10px; }
#view-filters .chips.wrap { flex-wrap: wrap; overflow: visible; padding: 0; gap: 6px; touch-action: auto; }
#view-filters .chips.wrap .chip { box-shadow: none; }
#view-filters .chips.wrap.sub { margin-top: 6px; }
#view-filters .fp-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
#view-filters .fp-top h3 { margin: 0; font-family: var(--font-display); font-size: 18px; font-weight: 800; }
#view-filters .fp-acts { display: flex; gap: 6px; }
#view-filters .fp-group { margin: 12px 0; }
#view-filters .fp-group h4 { margin: 0 0 6px; font-size: 12.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
#view-filters .chip .n { opacity: 0.7; font-weight: 600; }
.chip .n { font-family: var(--font-mono); font-size: 11px; font-weight: 500; opacity: 0.7; }

/* ---------- Нижняя шторка (телефон) / левая панель (компьютер) ---------- */

.sheet {
  position: fixed;
  z-index: 6;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(100dvh - env(safe-area-inset-top) - 64px);
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border-radius: 22px 22px 0 0;
  transform: translateY(calc(100% - var(--peek)));
  transition: transform 0.34s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: transform;
}
/* тень над шторкой — плавным градиентом вместо box-shadow: на iPhone в режиме приложения тень слоя с
   transform обрезалась по краю и заканчивалась резко (Стас, 11.10.2026) */
.sheet::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: 48px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0));
  pointer-events: none;
}
.sheet.dragging { transition: none; }

.sheet-grip {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 24px;
  flex: none;
  touch-action: none;
  cursor: grab;
}
.sheet-grip span { width: 42px; height: 5px; border-radius: 3px; background: var(--line); }

.sheet-head { flex: none; padding: 0 12px; touch-action: none; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); }
.tab {
  position: relative;
  flex: 1;
  padding: 8px 2px 12px;
  border: 0;
  background: none;
  font-weight: 600;
  font-size: 14px;
  color: var(--muted);
  white-space: nowrap;
}
.tab b { font-family: var(--font-mono); font-weight: 500; font-size: 11px; opacity: 0.8; }
.tab[aria-selected="true"] { color: var(--ink); }
.tab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: -1px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--ink);
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 2px;
  padding: 0 4px 0 12px;
  height: 44px;
  border-radius: 12px;
  background: var(--panel-2);
  border: 1px solid var(--line);
}
.search > svg { color: var(--muted); }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font-size: 16px; }
.search input::-webkit-search-cancel-button { display: none; }

.sheet-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px 14px calc(env(safe-area-inset-bottom) + 28px);
  scrollbar-width: thin;
}

/* ---------- Общие куски ---------- */

.lead { color: var(--muted); font-size: 14px; margin: 2px 0 14px; }
.lead b { color: var(--ink); font-weight: 600; }
.linkish { padding: 0; border: 0; background: none; font: inherit; font-weight: 600; color: var(--hall-ink); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.linkish svg { width: 15px; height: 15px; vertical-align: -2px; margin-right: 4px; }
/* значок жемчужины везде золотой — как кольцо жемчужин на карте */
.gem-i { color: var(--culture-ink); }
/* текст только для экранного диктора */
.vh { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.empty {
  padding: 22px 6px;
  color: var(--muted);
  text-align: center;
}
.empty button { margin-top: 10px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 15px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
}
.btn svg { width: 17px; height: 17px; }
.btn.primary { background: var(--c, var(--night)); border-color: transparent; color: #140F22; }
.btn.small { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 9px 0 7px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: color-mix(in srgb, var(--c, var(--muted)) 16%, transparent);
  color: var(--ci, var(--ink));
  white-space: nowrap;
}
.pill svg { width: 14px; height: 14px; }

.station {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 6px;
  font-size: 13px;
}
.station code {
  white-space: nowrap;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--lc, #666);
  color: #fff;
}

.ic {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--c, var(--muted));
  color: #140F22;
  flex: none;
}
.ic svg { width: 17px; height: 17px; stroke-width: 2.2; }

/* ---------- Районы ---------- */

.zone {
  padding: 14px 14px 12px;
  margin-bottom: 12px;
  border-radius: var(--r);
  background: var(--panel-2);
  border: 1px solid var(--line);
}
.zone h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--zi, var(--ink));
}
.zone .en { font-size: 12px; color: var(--muted); margin-top: 2px; }
.mix { display: flex; height: 6px; border-radius: 3px; overflow: hidden; margin: 10px 0 8px; background: var(--line); }
.mix span { background: var(--c); }
.mix-legend { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; color: var(--muted); }
.mix-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c); margin-right: 5px; }
.zone p { margin: 10px 0 0; font-size: 14px; }
.zone .meta { margin-top: 10px; display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.zone .meta b { color: var(--ink); font-weight: 600; }
.zone .row-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
/* «Не пропустить»: названия — ссылки в цвет текста, чтобы карточки районов не пестрели */
.zone .must .linkish { color: var(--ink); text-decoration-color: color-mix(in srgb, var(--ink) 35%, transparent); text-align: left; }
/* запятая не отрывается от названия (кнопка — атомарный элемент, перед запятой после неё браузер переносит строку) */
.zone .must .nw { white-space: nowrap; }
.zone .must .nw .linkish { white-space: normal; }

/* ---------- Списки мест ---------- */

.item {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 10px 2px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  text-align: left;
}
.item:last-child { border-bottom: 0; }
.item .t { font-weight: 600; font-size: 15px; line-height: 1.25; overflow-wrap: anywhere; }
.item .s { font-size: 13px; color: var(--muted); margin-top: 2px; }
.item .r { font-family: var(--font-mono); font-size: 12px; color: var(--muted); text-align: right; white-space: nowrap; }
.item .fav { color: var(--culture-ink); }
/* описание места в списке (Стас, 18.10.2026: «небольшое описание на одну-две строки… кнопочка раскрытия и
   сворачивания, чтобы просматривать места, не открывая карточку»): две строки под названием, «ещё» раскрывает
   полный текст, часы, лучшее время и советы */
.iw { border-bottom: 1px solid var(--line); }
.iw:last-child { border-bottom: 0; }
.iw .item { border-bottom: 0; }
.item .d { margin-top: 3px; font-size: 13px; line-height: 1.35; color: var(--ink); opacity: 0.85; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.iw.open .item .d { display: block; -webkit-line-clamp: unset; }
.iw .im { display: flex; flex-direction: column; align-items: flex-start; padding: 0 2px 8px 48px; margin-top: -4px; }
.iw .ix { display: none; gap: 3px; font-size: 13px; line-height: 1.35; color: var(--muted); margin-bottom: 4px; overflow-wrap: anywhere; }
.iw.open .ix { display: grid; }
.iw .more { padding: 2px 0; border: 0; background: none; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--night-ink); cursor: pointer; }
/* значки жемчужины и награды после названия держатся вместе и не переносятся по одному */
.mks { white-space: nowrap; }
.mk { display: inline-flex; vertical-align: -2px; }
.mk svg { width: 14px; height: 14px; }
.mk.minor { color: var(--muted); }

.group-h {
  position: sticky;
  top: -12px;
  z-index: 1;
  margin: 14px -14px 2px;
  padding: 8px 14px 6px;
  background: var(--panel);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.group-h:first-child { margin-top: 0; }

/* ---------- Афиша ---------- */

.when { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -14px 10px; padding: 0 14px 2px; }
.when::-webkit-scrollbar { display: none; }
.when .chip { height: 32px; font-size: 13px; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--panel-2); }
.when .chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

.ev {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 0;
  width: 100%;
  margin: 8px 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-2);
  text-align: left;
  overflow: hidden;
}
.ev .stub {
  position: relative;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 10px 4px;
  background: color-mix(in srgb, var(--c) 18%, var(--panel-2));
  border-right: 2px dashed color-mix(in srgb, var(--c) 45%, transparent);
}
.ev .stub .d { font-family: var(--font-display); font-weight: 800; font-size: 20px; line-height: 1; }
.ev .stub .m { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-top: 3px; }
.ev .stub .w { font-size: 11px; color: var(--muted); }
.ev .body { padding: 10px 12px; min-width: 0; }
.ev .t { font-weight: 600; font-size: 15px; line-height: 1.25; }
.ev .s { font-size: 13px; color: var(--muted); margin-top: 3px; }
.ev .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--warn);
}
.badge.ok { color: var(--ok); }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* ---------- Советы ---------- */

.alert {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--hall) 14%, var(--panel));
  border: 1px solid color-mix(in srgb, var(--hall) 35%, transparent);
  font-size: 14px;
}
.alert svg { color: var(--hall-ink); margin-top: 1px; }
.alert b { font-weight: 700; }

.rule { padding: 10px 0 12px; border-bottom: 1px solid var(--line); }
.rule:last-child { border-bottom: 0; }
.rule h4 { margin: 0 0 4px; font-size: 15px; font-weight: 600; }
.rule p { margin: 0; font-size: 14px; }
.src { font-size: 12px; color: var(--muted); margin-top: 6px; }
.src a { color: var(--muted); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 2px; }

/* ---------- Карточка места ---------- */

/* строка «Назад» закреплена сверху и не уезжает при прокрутке карточки (Стас, 11.10.2026) */
.d-top {
  position: sticky;
  top: -12px;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: -4px -14px 10px;
  padding: 6px 14px 4px;
  background: var(--panel);
}
.d-top .acts { display: flex; gap: 4px; }
.back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 34px;
  padding: 0 10px 0 4px;
  border: 0;
  border-radius: 10px;
  background: none;
  font-weight: 600;
  font-size: 14px;
  color: var(--muted);
}
.back svg { transform: rotate(90deg); width: 18px; height: 18px; }
.star[aria-pressed="true"] svg { fill: var(--culture); stroke: var(--culture-ink); }

/* «На экране / Все»: закреплённый список мест (Стас, 11.10.2026) */
.pin-btn { vertical-align: middle; margin-left: 4px; }
.pin-btn[aria-pressed="true"] { background: color-mix(in srgb, var(--night) 16%, var(--panel)); color: var(--night-ink); }
.pin-btn svg { width: 16px; height: 16px; }

/* фото места сверху карточки (tools/photos.py): пропорции заданы width/height, чтобы текст не прыгал */
.d-photo { margin: 0 0 12px; }
.d-photo img { display: block; width: 100%; height: auto; max-height: 260px; object-fit: cover; border-radius: 14px; background: var(--panel-2); }
.d-photo figcaption { margin-top: 4px; font-size: 11.5px; color: var(--muted); text-align: right; }
.d-pills { display: flex; flex-wrap: wrap; gap: 6px; }

/* награды и «Жемчужина» — под названием места (так их читает и экранный диктор: фокус ставится на название) */
.d-awards { list-style: none; display: grid; gap: 4px; margin: 10px 0 0; padding: 0; font-size: 13px; font-weight: 600; line-height: 1.35; }
.d-awards li { display: grid; grid-template-columns: 15px minmax(0, 1fr); gap: 7px; overflow-wrap: anywhere; }
.d-awards svg { width: 15px; height: 15px; margin-top: 1px; }
.d-awards .minor { color: var(--muted); font-weight: 500; }
.d-gem {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 9px;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--culture) 14%, var(--panel-2));
  border: 1px solid color-mix(in srgb, var(--culture) 40%, transparent);
  font-size: 14px;
}
.d-gem svg { width: 18px; height: 18px; margin-top: 1px; }
.d-gem b { font-family: var(--font-display); font-size: 15px; font-weight: 700; }
.d-name {
  overflow-wrap: anywhere;
  margin: 10px 0 2px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.015em;
  line-height: 1.15;
}
.d-local { font-size: 13px; color: var(--muted); }
.d-desc { margin: 12px 0 0; font-size: 15px; }
.d-when {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--c) 13%, var(--panel-2));
  font-size: 14px;
}
.d-when b { font-family: var(--font-display); font-size: 15px; font-weight: 700; }

.facts { display: grid; gap: 10px; margin: 14px 0 0; }
.facts div { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; font-size: 14px; }
.facts dd { overflow-wrap: anywhere; }
.facts dt { color: var(--muted); font-size: 13px; padding-top: 1px; }
.facts dd { margin: 0; }
.facts dd .station { margin-bottom: 4px; }

.links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.status { margin-top: 16px; font-size: 13px; color: var(--muted); }
details.sources { margin-top: 10px; font-size: 13px; color: var(--muted); }
details.sources summary { cursor: pointer; font-weight: 600; }
details.sources p { margin: 8px 0 0; }
details.sources ul { margin: 8px 0 0; padding-left: 18px; }
details.sources li { margin: 3px 0; word-break: break-all; }

/* ---------- Подписи районов на карте (неоновые вывески) ---------- */

.zlabel {
  --zc: var(--night);
  display: grid;
  justify-items: center;
  gap: 1px;
  padding: 4px 6px;
  border: 0;
  background: none;
  cursor: pointer;
  text-align: center;
  transition: opacity 0.25s ease;
}
.zlabel .zn {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--zfs, 12px);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.05;
  white-space: nowrap;
  color: var(--zi);
  text-shadow: 0 0 1px var(--bg), 0 1px 0 var(--bg), 0 0 10px var(--bg), 0 0 18px var(--bg);
}
.zlabel .zs {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  text-shadow: 0 0 2px var(--bg), 0 0 8px var(--bg), 0 0 14px var(--bg);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .zlabel .zn {
    color: #fff;
    text-shadow: 0 0 2px var(--zc), 0 0 8px var(--zc), 0 0 18px var(--zc), 0 0 34px color-mix(in srgb, var(--zc) 60%, transparent);
  }
}
:root[data-theme="dark"] .zlabel .zn {
  color: #fff;
  text-shadow: 0 0 2px var(--zc), 0 0 8px var(--zc), 0 0 18px var(--zc), 0 0 34px color-mix(in srgb, var(--zc) 60%, transparent);
}
/* скрываем через visibility: анимация «включения» держит opacity и перебила бы его */
.map-zones-off .zlabel, .zlabel.zl-hidden { visibility: hidden; pointer-events: none; }
.map-zones-small .zlabel .zs { display: none; }

/* вывески «включаются» при первом показе, как неон на закате */
@keyframes neon-on {
  0% { opacity: 0; }
  12% { opacity: 0.9; }
  18% { opacity: 0.15; }
  30% { opacity: 1; }
  38% { opacity: 0.55; }
  100% { opacity: 1; }
}
.zlabel.ignite { animation: neon-on 0.9s steps(1, end) both; animation-delay: var(--delay, 0s); }

/* ---------- Кнопки поверх карты ---------- */

.fab {
  position: fixed;
  z-index: 5;
  right: max(12px, env(safe-area-inset-right));
  bottom: calc(var(--peek) + 46px);
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  transition: transform 0.34s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.2s;
}
.fab.active { color: var(--drive-ink); }
.sheet-high .fab { opacity: 0; pointer-events: none; }
/* шторка опущена до язычка: всё, что стояло над ней (кнопки карты, кнопка и мини-режим чата), опускается следом */
body.sheet-min { --peek: 32px; }

.toast {
  position: fixed;
  z-index: 9;
  left: 50%;
  bottom: calc(var(--peek) + 18px);
  transform: translate(-50%, 20px);
  max-width: min(92vw, 420px);
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--bg);
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* точка «я здесь»: крупная, с пульсирующим кольцом; размер в пикселях — при отдалении карты не тает */
.me {
  position: relative;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #2F8CFF;
  border: 3px solid #fff;
  box-shadow: 0 0 0 4px rgba(47, 140, 255, 0.35), 0 2px 10px rgba(0, 0, 0, 0.35);
}
.me::after {
  content: "";
  position: absolute;
  inset: -16px;
  border-radius: 50%;
  border: 3px solid rgba(47, 140, 255, 0.75);
  animation: me-pulse 2s ease-out infinite;
}
@keyframes me-pulse {
  0% { transform: scale(0.45); opacity: 1; }
  100% { transform: scale(1.5); opacity: 0; }
}
/* точка за краем видимой карты: стрелка у края с расстоянием, нажатие возвращает к точке */
/* лодки: карточки причала и линии (Стас, 17.10.2026) */
.pill.boat-pill, .pill.boat-pier { border: 1px solid var(--line); background: var(--panel-2); color: inherit; font: inherit; font-size: 13px; cursor: pointer; }
.pill.boat-pill .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); display: inline-block; margin-right: 6px; }
.pill.boat-pill svg { width: 14px; height: 14px; margin-right: 5px; color: var(--c); }
.pill.boat-pier { margin: 2px 4px 2px 0; padding: 3px 9px; border-radius: 999px; }
.pill.boat-pier.here { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pier-code { font-family: var(--font-mono); font-size: 0.6em; font-weight: 600; color: var(--muted); vertical-align: middle; padding: 2px 6px; border: 1px solid var(--line); border-radius: 6px; }
.boat-h { font-family: var(--font-display); font-size: 16px; margin: 16px 0 8px; }
.boat-route { margin: 0 0 12px; padding: 10px 12px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); }
.boat-route-h { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-bottom: 6px; }
.boat-route-h .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--c); flex: none; }
.boat-dir { font-size: 14px; line-height: 1.7; margin: 4px 0; }
.boat-dir b { color: var(--muted); font-weight: 600; margin-right: 4px; }
.boat-fare { display: flex; gap: 6px; align-items: flex-start; font-size: 13.5px; color: var(--muted); margin-top: 6px; }
.boat-fare svg { width: 15px; height: 15px; flex: none; margin-top: 2px; }
.boat-table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 4px 0 8px; }
.boat-table td { padding: 6px 8px 6px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.boat-table td:first-child { white-space: nowrap; width: 1%; padding-right: 12px; }
.boat-table small { color: var(--muted); }
/* заметка к месту и подборки избранного (Стас, 17.10.2026) */
.d-note { margin: 10px 0 12px; }
.d-note label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.d-note label svg { width: 14px; height: 14px; }
.d-note textarea { width: 100%; box-sizing: border-box; font: inherit; font-size: 16px; /* 16 — иначе iPhone приближает страницу при фокусе */ line-height: 1.35; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); color: inherit; resize: vertical; min-height: 44px; }
.d-note small { display: block; margin-top: 3px; font-size: 12px; color: var(--muted); }
.item .s.note { display: flex; gap: 5px; align-items: center; color: var(--ink); font-style: italic; }
.item .s.note svg { width: 12px; height: 12px; flex: none; opacity: 0.7; }
.d-cols { display: grid; gap: 4px; margin: 8px 0 12px; padding: 10px 12px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); }
.d-cols .lead { margin: 0 0 6px; }
.d-col { display: flex; align-items: center; gap: 10px; font-size: 15px; min-height: 36px; cursor: pointer; }
.d-col input { width: 20px; height: 20px; accent-color: var(--culture); }
.d-col span { flex: 1; }
.d-col small { color: var(--muted); font-family: var(--font-mono); }
.d-cols .btn { justify-self: start; margin-top: 4px; }
.chip.col.add { border-style: dashed; }
.icon-btn.small.cols[aria-pressed="true"] { color: var(--culture-ink); }
/* последнее известное место (с прошлого входа), пока не нажали «где я» */
.me.stale { opacity: 0.55; }
.me.stale::after { display: none; }
.me-arrow {
  position: absolute;
  z-index: 4;
  left: 0;
  top: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 11px 0 8px;
  border-radius: 999px;
  border: 2px solid #fff;
  background: #2F8CFF;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}
.me-arrow svg { width: 18px; height: 18px; stroke-width: 2.6; }

/* ---------- Компьютер: панель слева, карта справа ---------- */

@media (min-width: 960px) {
  body {
    display: grid;
    grid-template-columns: var(--panel-w) 1fr;
    grid-template-rows: auto auto 1fr;
    height: 100dvh;
  }
  #map { position: relative; inset: auto; grid-column: 2; grid-row: 1 / span 3; }
  .bar {
    position: relative;
    grid-column: 1;
    grid-row: 1;
    padding: 20px 18px 10px;
    background: var(--panel);
    border-right: 1px solid var(--line);
  }
  .brand { padding: 0; background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  /* 18 px: три видимые кнопки шапки (слои, тема, вход) помещаются в панель 420 px */
  .brand-ru { font-size: 18px; }
  .brand-th { font-size: 12px; }
  .bar .icon-btn { box-shadow: none; background: var(--panel-2); }
  #btn-search { display: none; }
  .layers-pop { top: 66px; right: 18px; }
  .filters {
    position: relative;
    grid-column: 1;
    grid-row: 2;
    top: auto;
    padding: 4px 0 10px;
    background: var(--panel);
    border-right: 1px solid var(--line);
    pointer-events: auto;
  }
  .chips { flex-wrap: wrap; overflow: visible; padding: 2px 18px; }
  .chip { box-shadow: none; background: var(--panel-2); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .sheet {
    position: relative;
    grid-column: 1;
    grid-row: 3;
    height: auto;
    min-height: 0;
    border-radius: 0;
    transform: none !important;
    box-shadow: none;
    border-right: 1px solid var(--line);
  }
  .sheet-grip { display: none; }
  .sheet-head { padding: 0 18px; }
  .sheet-body { padding: 14px 18px 28px; }
  .group-h { margin-left: -18px; margin-right: -18px; padding-left: 18px; padding-right: 18px; }
  .d-top { top: -14px; margin-left: -18px; margin-right: -18px; padding-left: 18px; padding-right: 18px; }
  .sheet::before { display: none; }
  .when { margin: 0 -18px 10px; padding: 0 18px 2px; }
  .maplibregl-ctrl-bottom-left, .maplibregl-ctrl-bottom-right { bottom: 0; }
  .fab { bottom: 44px; right: 16px; }
  .sheet-high .fab { opacity: 1; pointer-events: auto; }
  .toast { left: calc(var(--panel-w) + (100vw - var(--panel-w)) / 2); bottom: 30px; }
}

/* жемчужины и награды — значок и число, полное название в aria-label и title (с подписями чипы на
   телефоне вытесняли типы движа с экрана, а на компьютере занимали четыре ряда вместо двух) */
.chip.special .lbl { display: none; }
.chip.special { padding: 0 13px 0 12px; }
/* в ряду категорий переключатель жемчужин с подписью — виден сразу после выбора типа движа */
.chips.sub .chip.sub-gem .lbl { display: inline; }
.chips.sub .chip.hour { height: 30px; padding: 0 9px; font-family: var(--font-mono); font-size: 12.5px; }
.chips.sub .chip.sub-gem { padding: 0 12px 0 10px; }

@media (max-width: 959px) {
  .brand { padding: 6px 12px 7px; }
  .brand-ru { font-size: 14px; letter-spacing: -0.02em; }
  .brand-th { font-size: 10px; }
  .icon-btn { width: 40px; height: 40px; border-radius: 12px; }
}
/* четыре кнопки шапки (поиск, слои, тема, вход) на телефонах уже 414 px не помещаются рядом
   с названием в одну строку: «где движ» уходит на вторую строку, тайская строка прячется
   (иначе шапка выросла бы и наехала на чипы фильтров, у них top: 66 px) */
@media (max-width: 413px) {
  .brand-dash, .brand-th { display: none; }
  .brand-ru em { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
