[hidden] { display: none !important; }
:root {
  --bg: #05070d;
  --glass: rgba(10, 16, 28, 0.72);
  --glass-strong: rgba(10, 16, 28, 0.9);
  --line: rgba(255, 255, 255, 0.12);
  --text: #eef2f8;
  --muted: #9aa7bb;
  --accent: #4FC3F7;
  --radius: 14px;
  --font: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --display: "Unbounded", "Manrope", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; color: var(--text); font-family: var(--font); }
body { background: radial-gradient(ellipse at 65% 45%, #0e1d3a 0%, #070b16 45%, #03040a 100%); }
button { font: inherit; color: inherit; cursor: pointer; }

#stars { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
#map { position: fixed; inset: 0; z-index: 1; background: transparent; }
.maplibregl-ctrl-attrib { background: rgba(0,0,0,.45) !important; color: #aaa; font-size: 10px; }
.maplibregl-ctrl-attrib a { color: #ccc; }

/* ---------- intro ---------- */
#intro {
  position: fixed; inset: 0; z-index: 30; display: flex; align-items: center;
  padding: 0 0 0 7vw;
  background: linear-gradient(90deg, rgba(3,4,10,.88) 0%, rgba(3,4,10,.55) 38%, rgba(3,4,10,0) 62%);
  transition: opacity 1.2s ease;
}
#intro.gone { opacity: 0; pointer-events: none; }
#intro-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -1; opacity: 0; transition: opacity 1.5s; }
#intro-video.ready { opacity: .8; }
.intro-inner { max-width: 600px; }
.intro-inner > * { opacity: 0; transform: translateY(14px); animation: rise .9s cubic-bezier(.2,.8,.2,1) forwards; }
.intro-inner > :nth-child(2) { animation-delay: .15s; }
.intro-inner > :nth-child(3) { animation-delay: .3s; }
.intro-inner > :nth-child(4) { animation-delay: .45s; }
.intro-inner > :nth-child(5) { animation-delay: .6s; }
@keyframes rise { to { opacity: 1; transform: none; } }
.eyebrow { display: flex; align-items: center; gap: 10px; letter-spacing: .22em; text-transform: uppercase; font-size: 12px; color: var(--accent); margin: 0 0 18px; font-weight: 600; }
#intro h1 {
  font-family: var(--display); font-weight: 700; font-size: clamp(28px, 3.2vw, 48px); line-height: 1.1;
  margin: 0 0 18px; letter-spacing: -.01em;
  background: linear-gradient(180deg, #fff 30%, #a9c9ef); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.intro-sub { color: #c8d2e0; font-size: clamp(15px, 1.5vw, 18px); line-height: 1.5; margin: 0 0 28px; }
.intro-stats { display: flex; gap: 28px; margin: 0 0 34px; }
.intro-stats b { display: block; font-family: var(--display); font-size: 30px; font-weight: 600; }
.intro-stats span { font-size: 12px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.btn-primary {
  background: var(--text); color: #05070d; border: 0; border-radius: 999px;
  padding: 15px 28px; font-weight: 700; font-size: 16px;
  box-shadow: 0 0 40px rgba(79,195,247,.35); transition: transform .2s, box-shadow .2s;
}
.btn-primary span { display: inline-block; transition: transform .2s; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 0 60px rgba(79,195,247,.6); }
.btn-primary:hover span { transform: translateX(4px); }
.btn-primary.small { padding: 10px 18px; font-size: 14px; }

img.logo { height: 28px; width: 28px; object-fit: contain; background: #fff; border-radius: 50%; padding: 3px; flex: none; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand img.logo { height: 30px; width: 30px; }

/* ---------- top bar ---------- */
#topbar {
  position: fixed; top: 16px; left: 16px; right: 16px; z-index: 10;
  display: flex; justify-content: space-between; align-items: center; gap: 12px; pointer-events: none;
}
.brand { font-family: var(--display); font-weight: 600; font-size: 17px; text-shadow: 0 2px 12px rgba(0,0,0,.8); }
.stats { font-size: 13px; color: var(--muted); background: var(--glass); border: 1px solid var(--line); padding: 6px 12px; border-radius: 999px; backdrop-filter: blur(10px); }

/* ---------- sidebar ---------- */
#sidebar {
  position: fixed; top: 60px; left: 16px; bottom: 16px; width: 300px; z-index: 10;
  display: flex; flex-direction: column; gap: 12px;
  background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius);
  backdrop-filter: blur(14px); padding: 14px;
}
.filters { display: flex; flex-direction: column; gap: 10px; }
.seg { display: flex; background: rgba(255,255,255,.06); border-radius: 10px; padding: 3px; }
.seg button { flex: 1; background: none; border: 0; padding: 7px 0; border-radius: 8px; font-size: 13px; color: var(--muted); }
.seg button.on { background: rgba(255,255,255,.14); color: var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px;
  border: 1px solid var(--line); background: none; border-radius: 999px; padding: 5px 10px; color: var(--text);
}
.chip i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.chip.off { opacity: .35; }
#trip-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
#trip-list li { display: flex; gap: 12px; align-items: center; padding: 9px 8px; border-radius: 10px; cursor: pointer; }
#trip-list li:hover, #trip-list li.active { background: rgba(255,255,255,.08); }
#trip-list .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--c); margin: 0 7px; }
#trip-list .dot.planned { background: none; border: 2px solid var(--c); }
#trip-list .dot.photo { width: 34px; height: 34px; margin: 0; background-size: cover; background-position: center; border: 2px solid var(--c); }
#trip-list .dot.photo.planned { border-style: dashed; }
#trip-list .t { font-size: 14px; font-weight: 700; }
#trip-list .s { font-size: 12px; color: var(--muted); }
.side-actions { display: flex; gap: 8px; }
.btn-ghost { flex: 1; background: rgba(255,255,255,.06); border: 1px solid var(--line); border-radius: 10px; padding: 9px 0; font-size: 13px; }
.btn-ghost:hover { background: rgba(255,255,255,.12); }
.btn-ghost.on { background: var(--text); color: #05070d; }

/* ---------- markers ---------- */
.pin { position: absolute; width: 18px; height: 18px; cursor: pointer; }
.pin .core { position: absolute; inset: 3px; border-radius: 50%; background: var(--c); box-shadow: 0 0 12px var(--c), 0 0 0 2px rgba(0,0,0,.4); transition: transform .25s; }
.pin.planned .core { background: rgba(5,7,13,.6); border: 2px solid var(--c); }
.pin::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--c); animation: pulse 2.4s ease-out infinite; }
.pin.planned::after { border-style: dashed; }
/* фото-пин: круглая миниатюра с цветным кольцом */
.pin.photo { width: 46px; height: 46px; }
.pin.photo .core { inset: 0; background-size: cover; background-position: center; border: 3px solid var(--c); box-shadow: 0 0 18px var(--c), 0 4px 14px rgba(0,0,0,.6); }
.pin.photo.planned .core { border-style: dashed; }
.pin.photo .lbl { left: 54px; }
.pin .lbl {
  position: absolute; left: 24px; top: 50%; transform: translateY(-50%); white-space: nowrap;
  font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 6px;
  background: var(--glass-strong); border: 1px solid var(--line); opacity: 0; transition: opacity .2s; pointer-events: none;
}
.pin:hover .lbl, .pin.active .lbl { opacity: 1; }
.pin:hover .core, .pin.active .core { transform: scale(1.3); }
@keyframes pulse { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(2.4); opacity: 0; } }
.pin-home { position: absolute; width: 28px; height: 28px; pointer-events: none; }
.pin-home .star img { width: 80%; height: 80%; object-fit: contain; }
.pin-home .star { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; color: #05070d; background: #fff; box-shadow: 0 0 18px rgba(255,255,255,.8); }
.pin-home .lbl { position: absolute; left: 50%; top: 32px; transform: translateX(-50%); white-space: nowrap; font-size: 11px; font-weight: 700; text-shadow: 0 1px 6px #000; }

/* ---------- detail panel ---------- */
#panel {
  position: fixed; top: 16px; right: 16px; bottom: 16px; width: 400px; z-index: 12;
  background: var(--glass-strong); border: 1px solid var(--line); border-radius: var(--radius);
  backdrop-filter: blur(16px); overflow-y: auto;
  transform: translateX(calc(100% + 32px)); transition: transform .6s cubic-bezier(.2,.8,.2,1);
}
#panel.open { transform: none; }
.close { position: absolute; top: 10px; right: 10px; z-index: 2; width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(0,0,0,.5); font-size: 22px; line-height: 1; }
.hero { height: 200px; background-size: cover; background-position: center; background-color: #0d1a33; position: relative; border-radius: var(--radius) var(--radius) 0 0; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, transparent 40%, rgba(10,16,28,.97)); border-radius: inherit; }
.pbody { padding: 0 20px 24px; margin-top: -44px; position: relative; }
.pbody h2 { font-family: var(--display); font-weight: 700; font-size: 26px; line-height: 1.15; margin: 0 0 6px; }
.region { color: var(--muted); margin: 0 0 14px; font-size: 14px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.tag { font-size: 12px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); }
.tag.example { border-color: #FFD54F; color: #FFD54F; }
.summary { font-size: 16px; font-weight: 700; margin: 0 0 10px; }
.desc { color: #c8d2e0; line-height: 1.6; margin: 0 0 18px; }
.pbody h3 { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 22px 0 10px; }
.facts { margin: 0; padding: 0; list-style: none; }
.facts li { padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; }
.pbody video { width: 100%; border-radius: 10px; display: block; }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; cursor: zoom-in; }
.empty { color: var(--muted); font-size: 13px; border: 1px dashed var(--line); border-radius: 10px; padding: 16px; text-align: center; }

/* ---------- editor ---------- */
#editor { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 20; }
#toast {
  position: fixed; top: 64px; left: 50%; transform: translateX(-50%); z-index: 25; max-width: min(640px, calc(100vw - 32px));
  background: var(--glass-strong); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; font-size: 13px; line-height: 1.5;
}
#toast code { display: block; margin-top: 6px; color: var(--accent); word-break: break-all; }

#lightbox { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.92); display: grid; place-items: center; }
#lightbox img { max-width: 94vw; max-height: 90vh; border-radius: 8px; }

/* ---------- mobile ---------- */
@media (max-width: 760px) {
  #intro { align-items: flex-end; padding: 0 16px calc(40px + env(safe-area-inset-bottom));
    background: linear-gradient(0deg, rgba(3,4,10,.92) 0%, rgba(3,4,10,.6) 45%, rgba(3,4,10,0) 70%); }
  .intro-stats { gap: 20px; margin-bottom: 26px; }
  .intro-stats b { font-size: 24px; }
  #topbar { top: 12px; }
  .stats { display: none; }
  .brand { font-size: 13px; max-width: calc(100vw - 32px); }
  #sidebar { top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 42vh; border-radius: var(--radius) var(--radius) 0 0; padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  #panel { top: auto; left: 0; right: 0; bottom: 0; width: auto; height: 62vh; border-radius: var(--radius) var(--radius) 0 0; transform: translateY(105%); }
  #panel.open { transform: none; }
  .hero { height: 150px; }
  #editor { bottom: calc(62vh + 12px); }
}
