/* CyprusSteps map, "daylight" look (DESIGN spec design/redesign/map/SPEC.md).
   One white UI layer floats over a quiet basemap. Pins are white circles that
   carry the category colour only in their glyph; the selected pin turns ink.
   Copper (--accent) is kept for the one action that moves you: «Маршрут».
   Every colour reads a site token; the literal after the comma is the spec
   value, used until the site defines the token. */

:root {
  --pin: var(--map-pin, #FFFFFF);
  --pin-ink: var(--map-pin-ink, #1F2430);
  --pin-ring: var(--map-pin-ring, transparent);
  --pin-off: var(--map-pin-off, #EEF0F2);
  --pin-sel: var(--map-pin-sel, #1F2430);
  --pin-sel-ink: var(--map-pin-sel-ink, #FFFFFF);
  --pin-approx-bg: var(--map-pin-approx-bg, color-mix(in srgb, var(--pin) 88%, transparent));
  --saved: var(--map-saved, #D6336C);
  --fill: var(--quiet-bg, #F4F5F6);
  --line: var(--border, #E4E6E9);
  --ink2: var(--muted, #5E6571);
  --ink3: var(--faint, #8D939E);
  --now: var(--done, #1F6B45);
  --sh-pin: 0 0 0 1px var(--pin-ring), 0 1px 2px rgba(31, 36, 48, .18), 0 2px 6px rgba(31, 36, 48, .14);
  --sh-float: 0 2px 6px rgba(31, 36, 48, .10), 0 8px 24px rgba(31, 36, 48, .14);
  --sh-card: 0 4px 10px rgba(31, 36, 48, .10), 0 14px 40px rgba(31, 36, 48, .18);
  --hd-h: 64px;
}
[data-theme="dark"] {
  --pin: var(--map-pin, #2E333D);
  --pin-ink: var(--map-pin-ink, #ECEEF1);
  --pin-ring: var(--map-pin-ring, #464C59);
  --pin-off: var(--map-pin-off, #1E2128);
  --pin-sel: var(--map-pin-sel, #F3F4F6);
  --pin-sel-ink: var(--map-pin-sel-ink, #15181E);
  --pin-approx-bg: var(--map-pin-approx-bg, color-mix(in srgb, var(--pin) 88%, transparent));
  --saved: var(--map-saved, #F06595);
  --fill: var(--quiet-bg, #1A1D24);
  --line: var(--border, #2E333D);
  --ink2: var(--muted, #9BA2AE);
  --ink3: var(--faint, #6F7683);
  --now: var(--done, #6CC495);
  --sh-pin: 0 0 0 1px var(--pin-ring), 0 1px 2px rgba(0, 0, 0, .5), 0 2px 8px rgba(0, 0, 0, .35);
  --sh-float: 0 2px 6px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
  --sh-card: 0 4px 10px rgba(0, 0, 0, .4), 0 14px 40px rgba(0, 0, 0, .45);
}
/* Glyph colour per category group; dark lifts each to keep 4.5:1 on the dark pin. */
.c-kids { --c: var(--cat-kids, #C2410C); } .c-nature { --c: var(--cat-nature, #0B7285); }
.c-sport { --c: var(--cat-sport, #2B7A3B); } .c-food { --c: var(--cat-food, #A85800); }
.c-culture { --c: var(--cat-culture, #5F3DC4); } .c-shop { --c: var(--cat-shop, #B4235A); }
.c-osm { --c: var(--cat-osm, #5E6571); }
[data-theme="dark"] .c-kids { --c: var(--cat-kids, #FF9466); } [data-theme="dark"] .c-nature { --c: var(--cat-nature, #4FC3D6); }
[data-theme="dark"] .c-sport { --c: var(--cat-sport, #6BCB7D); } [data-theme="dark"] .c-food { --c: var(--cat-food, #F2B35A); }
[data-theme="dark"] .c-culture { --c: var(--cat-culture, #B4A0FF); } [data-theme="dark"] .c-shop { --c: var(--cat-shop, #F78BB3); }
[data-theme="dark"] .c-osm { --c: var(--cat-osm, #B4BAC4); }

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; overflow: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
a { color: inherit; text-decoration: none; }
h1, h2, p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; border-radius: 8px; }
svg.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.i.s { width: 16px; height: 16px; }
svg.g { width: 18px; height: 18px; fill: currentColor; flex: none; } /* category glyph (Pinhead, filled) */
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--raised); padding: 10px 14px; border-radius: 10px; box-shadow: var(--sh-float); }
.skip:focus { top: 10px; }

/* header */
.hd { position: relative; z-index: 20; display: flex; align-items: center; gap: 12px; height: var(--hd-h); padding: 0 16px; background: var(--bg); border-bottom: 1px solid var(--line); }
.logo { font-weight: 500; font-size: 18px; letter-spacing: -.01em; }
.logo b { font-weight: 700; }
.sum { flex: 1; min-width: 0; max-width: 420px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 46px; padding: 4px 18px; border: 1px solid var(--line); border-radius: 23px; box-shadow: 0 2px 8px rgba(31, 36, 48, .07); }
.sum:hover { background: var(--fill); }
.sum-a { font-size: 14px; font-weight: 600; }
.sum-b { font-size: 12.5px; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 22px; flex: none; }
.icon-btn:hover { background: var(--fill); }

/* stage: map + list */
.stage { position: relative; height: calc(100% - var(--hd-h)); }
.map-wrap { position: absolute; inset: 0; }
.map { position: absolute; inset: 0; }

/* list sheet: phone = bottom sheet over the map; desktop = left column */
.sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 10; height: 38%; background: var(--bg); border-radius: 20px 20px 0 0; box-shadow: 0 -4px 20px rgba(31, 36, 48, .12); display: flex; flex-direction: column; transition: transform .28s cubic-bezier(.2, .8, .2, 1); }
.sheet.down { transform: translateY(calc(100% - 64px)); }
.sheet.away { transform: translateY(100%); }
.sheet.away ~ .map-wrap .ctl { bottom: calc(var(--card-h, 0px) + 12px); }
.sheet.away ~ .map-wrap .maplibregl-ctrl-bottom-left { bottom: var(--card-h, 0px); }
.grab { width: 36px; height: 4px; border-radius: 2px; background: var(--line2); margin: 8px auto 0; flex: none; }
.sheet-hd { padding: 8px 20px 10px; flex: none; text-align: center; cursor: pointer; }
.count { font-size: 15px; font-weight: 600; outline: none; }
.count-sub { font-size: 12.5px; color: var(--ink2); }
.sample { display: inline-block; margin-right: 6px; padding: 0 7px; border-radius: 6px; background: var(--warn-bg); color: var(--warn); font-size: 11.5px; font-weight: 600; }
.list { list-style: none; margin: 0; padding: 0 12px 12px; overflow: auto; flex: 1; outline: none; }
.list .empty { padding: 16px 8px; color: var(--ink2); font-size: 14px; }
.data-note { flex: none; padding: 8px 20px 12px; font-size: 12px; color: var(--ink2); border-top: 1px solid var(--line); }
.data-note a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

.row { display: flex; gap: 12px; align-items: center; width: 100%; padding: 10px 8px; border-radius: 14px; }
.row:hover, .row.hot { background: var(--fill); }
.row.sel { background: var(--fill); box-shadow: inset 0 0 0 1px var(--line2); }
.thumb { width: 64px; height: 64px; border-radius: 12px; flex: none; overflow: hidden; background: var(--fill); display: grid; place-items: center; color: var(--c); }
.thumb svg.g { width: 26px; height: 26px; }
.thumb.date { display: flex; flex-direction: column; justify-content: center; color: var(--text); line-height: 1.1; }
.thumb.date b { font-size: 20px; font-weight: 700; }
.thumb.date span { font-size: 12px; color: var(--ink2); }
.r-b { min-width: 0; flex: 1; }
.r-t { font-weight: 600; font-size: 15px; line-height: 1.3; display: block; }
a.r-t { color: inherit; text-decoration: none; } a.r-t:hover { text-decoration: underline; }
.r-m { font-size: 13px; color: var(--ink2); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-s { font-size: 13px; display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.st-open { color: var(--now); } .st-closed { color: var(--ink2); } .st-unknown { color: var(--warn); }
.nopin { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--ink2); margin-top: 2px; }

/* pins: HTML markers, real buttons (tab-reachable, named) */
.pin { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 5px; height: 32px; min-width: 32px; padding: 0 7px; border-radius: 16px; background: var(--pin); color: var(--pin-ink); font-size: 12.5px; font-weight: 700; white-space: nowrap; box-shadow: var(--sh-pin); transition: transform .14s ease-out, background-color .14s; }
.pin::before { content: ""; position: absolute; inset: -6px; border-radius: 22px; } /* 44px tap target */
.pin svg.g { color: var(--c); }
.pin:hover, .pin.hot { transform: scale(1.08); z-index: 3; }
.pin.ev { padding: 0 10px 0 7px; }
.pin.ev svg.i { width: 18px; height: 18px; color: var(--c); stroke-width: 2; }
.pin.ev .more { color: var(--ink2); font-weight: 600; }
/* Approximate point (locality centre, «место уточняется»): see-through pill,
   dotted ring in the category colour, a leading "≈". Background from the
   DESIGN token --map-pin-approx-bg (88%: road lines must not show through
   the date). The ring stays var(--c): --c is per element, so no root token. */
.pin.ev.approx { outline: 1.5px dotted var(--c); outline-offset: 2px; }
.pin.ev.approx:not(.sel) { background: var(--pin-approx-bg); box-shadow: none; }
.pin.ev.approx.sel .ax { color: inherit; }
.pin.ev.approx .ax { margin-right: -2px; color: var(--ink2); font-weight: 700; }
.ct.approx { display: flex; align-items: center; gap: 5px; color: var(--ink2); }
.pin.off { background: var(--pin-off); box-shadow: 0 0 0 1px var(--line2); }
.pin.off svg.g { color: var(--ink2); }
.pin.unk { outline: 1.5px dashed var(--ink2); outline-offset: 1px; }
.pin.osm { height: 24px; min-width: 24px; padding: 0 5px; border-radius: 12px; }
.pin.osm svg.g { width: 14px; height: 14px; }
.pin.osm::before { inset: -10px; }
.pin .sv { position: absolute; top: -5px; right: -5px; width: 16px; height: 16px; border-radius: 8px; background: var(--pin); display: grid; place-items: center; box-shadow: 0 0 0 1px var(--line); }
.pin .sv svg.i { width: 11px; height: 11px; color: var(--saved); fill: var(--saved); stroke-width: 1.5; }
.pin.sel { background: var(--pin-sel); color: var(--pin-sel-ink); transform: scale(1.12); z-index: 4; outline: none; }
.pin.sel svg.g, .pin.sel svg.i, .pin.sel .more { color: var(--pin-sel-ink); }
.pin:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; border-radius: 18px; }

.clu { display: grid; place-items: center; border-radius: 50%; background: var(--pin); color: var(--pin-ink); font-weight: 700; font-size: 13px; box-shadow: var(--sh-pin), 0 0 0 4px color-mix(in srgb, var(--pin) 55%, transparent); transition: transform .14s ease-out; }
.clu:hover { transform: scale(1.06); }
.clu.s { width: 34px; height: 34px; } .clu.m { width: 40px; height: 40px; font-size: 14px; } .clu.l { width: 46px; height: 46px; font-size: 15px; }

/* my location: a static dot, no pulse (the position is taken once) */
.me { width: 18px; height: 18px; border-radius: 50%; background: var(--text); box-shadow: 0 0 0 3px var(--bg), 0 1px 6px rgba(31, 36, 48, .4); }

/* controls */
.ctl { position: absolute; right: 12px; z-index: 6; display: flex; flex-direction: column; gap: 10px; bottom: calc(38% + 12px); transition: bottom .28s cubic-bezier(.2, .8, .2, 1); }
.sheet.down ~ .map-wrap .ctl { bottom: 76px; }
.ctl-zoom { display: none; flex-direction: column; background: var(--raised); border-radius: 12px; box-shadow: var(--sh-float); overflow: hidden; }
.ctl-zoom button { width: 44px; height: 44px; display: grid; place-items: center; }
.ctl-zoom button + button { border-top: 1px solid var(--line); }
.ctl-zoom button:hover, .ctl-one:hover { background: var(--fill); }
.ctl-one { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 22px; background: var(--raised); box-shadow: var(--sh-float); }
.ctl-one[aria-pressed="true"] { color: var(--bg); background: var(--text); }
.map-msg { position: absolute; left: 50%; top: 40%; transform: translateX(-50%); max-width: 320px; padding: 12px 16px; border-radius: 12px; background: var(--raised); box-shadow: var(--sh-float); font-size: 14px; }

/* attribution: always visible, compact, legible */
.maplibregl-ctrl-bottom-left .maplibregl-ctrl-attrib, .maplibregl-ctrl-attrib.maplibregl-compact { background: color-mix(in srgb, var(--bg) 82%, transparent); border-radius: 8px; margin: 0 0 8px 8px; padding: 2px 8px; font: 500 11px/1.6 var(--font); color: var(--ink2); }
.maplibregl-ctrl-attrib a { color: var(--ink2); }
.maplibregl-ctrl-attrib-button { display: none; }
.maplibregl-ctrl-bottom-left { bottom: 38%; transition: bottom .28s; }
.sheet.down ~ .map-wrap .maplibregl-ctrl-bottom-left { bottom: 64px; }

/* place card */
.card-slot { position: absolute; left: 0; right: 0; bottom: 0; z-index: 12; pointer-events: none; }
.card { pointer-events: auto; position: relative; margin: 0 10px 12px; background: var(--raised); border-radius: 18px; box-shadow: var(--sh-card); display: grid; grid-template-columns: 96px 1fr; gap: 0 14px; padding: 12px; animation: up .22s cubic-bezier(.2, .8, .2, 1); }
@keyframes up { from { transform: translateY(16px); opacity: 0; } }
.card .ph { grid-row: 1 / span 2; width: 96px; height: 96px; border-radius: 12px; overflow: hidden; background: var(--fill); display: grid; place-items: center; color: var(--c); }
.card .ph svg.g { width: 36px; height: 36px; }
.card .ph.date { display: flex; flex-direction: column; justify-content: center; color: var(--text); line-height: 1.1; }
.card .ph.date b { font-size: 28px; font-weight: 700; } .card .ph.date span { font-size: 13px; color: var(--ink2); }
.card .cb { min-width: 0; padding-right: 72px; }
.card h2 { margin: 2px 0 0; font-size: 17px; font-weight: 700; line-height: 1.25; letter-spacing: -.01em; }
.card .cm { font-size: 13px; color: var(--ink2); }
.card .cs { font-size: 13px; margin-top: 2px; display: flex; gap: 6px; align-items: center; }
.card .ct { font-size: 13px; color: var(--ink2); }
.card .acts { grid-column: 2; display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 20px; font-size: 14px; font-weight: 600; }
.btn-a { background: var(--accent); color: var(--btn-ink); }
.btn-a:hover { background: var(--accent-press); }
.btn-b { box-shadow: inset 0 0 0 1px var(--line2); }
.btn-b:hover { background: var(--fill); }
.btn-b:disabled { opacity: .45; cursor: default; background: none; }
.btn-ink { background: var(--text); color: var(--bg); }
.card .tools { position: absolute; top: 6px; right: 6px; display: flex; }
.card .tools button { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 20px; color: var(--ink2); }
.card .tools button:hover { background: var(--fill); color: var(--text); }
.card .tools button[aria-pressed="true"] svg.i { color: var(--saved); fill: var(--saved); }
.card .src { grid-column: 2; font-size: 12px; color: var(--ink2); margin-top: 8px; }
.card .src a { text-decoration: underline; text-underline-offset: 2px; }
.card .evs { grid-column: 1 / -1; list-style: none; margin: 10px 0 0; padding: 8px 0 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.card .evs li { display: flex; gap: 10px; padding: 5px 0; }
.card .evs b { font-weight: 600; min-width: 92px; }

/* filters: a dialog over the page (bottom sheet on phones) */
.scrim { position: fixed; inset: 0; z-index: 30; background: var(--scrim, rgba(31, 36, 48, .45)); }
.filters { position: fixed; z-index: 31; left: 0; right: 0; bottom: 0; max-height: min(85vh, 680px); display: flex; flex-direction: column; background: var(--raised); border-radius: 20px 20px 0 0; box-shadow: var(--sh-card); }
.f-hd { display: flex; align-items: center; justify-content: space-between; padding: 14px 12px 6px 20px; }
.f-hd h2 { font-size: 17px; font-weight: 700; }
.f-x { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 20px; color: var(--ink2); }
.f-x:hover { background: var(--fill); color: var(--text); }
.f-body { overflow: auto; padding: 0 20px 8px; }
.fgroup { margin-top: 14px; }
.fgroup h3, .fgroup summary { margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--ink2); }
.fgroup summary { cursor: pointer; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 36px; padding: 0 14px; border-radius: 18px; font-size: 14px; font-weight: 500; box-shadow: inset 0 0 0 1px var(--line2); background: var(--raised); }
.chip:hover { background: var(--fill); }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); box-shadow: none; }
.hint { margin-top: 8px; font-size: 13px; color: var(--ink2); }
.hint:empty { display: none; }
.link { text-decoration: underline; text-underline-offset: 2px; color: var(--text); }
.looks { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink2); }
.looks a { padding: 4px 10px; border-radius: 14px; color: var(--text); }
.looks a:hover { background: var(--fill); }
.looks a[aria-current="true"] { background: var(--fill); box-shadow: inset 0 0 0 1px var(--line2); font-weight: 600; }
.f-ft { display: flex; gap: 8px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.f-ft .btn-ink { flex: 1; }

@media (min-width: 900px) {
  .hd { padding: 0 24px; }
  .sheet { top: 0; bottom: 0; right: auto; width: 420px; height: auto; border-radius: 0; box-shadow: none; border-right: 1px solid var(--line); transform: none !important; }
  .grab { display: none; }
  .sheet-hd { text-align: left; padding: 20px 24px 8px; cursor: default; }
  .count { font-size: 20px; letter-spacing: -.01em; }
  .count-sub { font-size: 13.5px; }
  .list { padding: 4px 16px 16px; }
  .data-note { padding: 10px 24px 14px; }
  .map-wrap { left: 420px; }
  .ctl { top: 12px; bottom: auto !important; }
  .ctl-zoom { display: flex; }
  .maplibregl-ctrl-bottom-left { bottom: 0 !important; }
  .card-slot { left: 50%; right: auto; bottom: 28px; width: 400px; transform: translateX(-50%); }
  .card { margin: 0; }
  .filters { left: 50%; right: auto; top: 50%; bottom: auto; width: 560px; transform: translate(-50%, -50%); border-radius: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .sheet, .ctl, .pin, .clu, .card { transition: none; animation: none; }
}
