:root {
  --bg: #060a18;
  --panel: rgba(14, 20, 40, 0.78);
  --panel-solid: #0e1428;
  --line: rgba(255, 255, 255, 0.09);
  --text: #eef1fb;
  --muted: #9aa3c0;
  --accent: #8b7cff;
  --accent-2: #5ee7ff;
  --remote: #34d3c0;
  --office: #ffb454;
  --danger: #ff6b81;
  --radius: 18px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }  /* иначе display у .login/.side перебивает атрибут hidden */
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(ellipse at 50% 40%, #121a3a 0%, var(--bg) 60%) fixed;
  color: var(--text);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent-2); }

/* звёзды за глобусом */
.stars, .stars::after {
  position: fixed; inset: 0; pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 12% 18%, #fff8 50%, transparent 51%),
    radial-gradient(1px 1px at 72% 12%, #fff6 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 38% 72%, #fff7 50%, transparent 51%),
    radial-gradient(1px 1px at 88% 64%, #fff5 50%, transparent 51%),
    radial-gradient(1px 1px at 22% 88%, #fff6 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 58% 34%, #fff5 50%, transparent 51%),
    radial-gradient(1px 1px at 92% 92%, #fff6 50%, transparent 51%),
    radial-gradient(1px 1px at 6% 52%, #fff5 50%, transparent 51%);
  background-size: 420px 420px;
}
.stars::after { content: ''; background-size: 290px 290px; animation: twinkle 6s ease-in-out infinite alternate; }
@keyframes twinkle { from { opacity: .25; } to { opacity: .8; } }

#map { position: fixed; inset: 0; }
.maplibregl-ctrl-attrib { background: rgba(0, 0, 0, .35) !important; color: var(--muted); }
.maplibregl-ctrl-attrib a { color: var(--muted); }
.maplibregl-ctrl-group { background: var(--panel) !important; border: 1px solid var(--line); backdrop-filter: blur(12px); }
.maplibregl-ctrl-group button + button { border-top-color: var(--line) !important; }
.maplibregl-ctrl-icon { filter: invert(1); }

.glass {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  box-shadow: var(--shadow);
}

/* ---------- маркеры ---------- */
.pin-root { --size: 46px; --c: var(--remote); }
.pin-root.pin-office { --c: var(--office); }
.pin-root.active, .pin-root:hover { z-index: 5; }
.pin {
  display: block; position: relative; width: var(--size); height: var(--size); padding: 0;
  border: none; background: none; border-radius: 50%;
  animation: pin-in .7s cubic-bezier(.2, 1.4, .4, 1) var(--delay, 0ms) both;
  transition: transform .25s cubic-bezier(.2, 1.4, .4, 1), filter .25s;
}
.pin-root:hover .pin, .pin-root.active .pin { transform: scale(1.22); }
.pin-root.dim .pin { filter: grayscale(1) brightness(.5); transform: scale(.8); }
.pin-root.flying .pin { transform: scale(1.15); }
.pin-root.flying .pin-ava, .pin-root.flying .ava-empty { box-shadow: 0 0 0 3px rgba(6, 10, 24, .7), 0 0 30px var(--c), 0 0 60px color-mix(in srgb, var(--c) 60%, transparent); }
.pin-ava, .pin .ava-empty {
  position: relative; display: grid; place-items: center;
  width: 100%; height: 100%; border-radius: 50%; object-fit: cover;
  border: 3px solid var(--c);
  box-shadow: 0 0 0 3px rgba(6, 10, 24, .7), 0 6px 18px rgba(0, 0, 0, .5), 0 0 22px color-mix(in srgb, var(--c) 55%, transparent);
  font-weight: 800; font-size: 15px; color: #fff; user-select: none;
}
.pin-halo {
  position: absolute; inset: -4px; border-radius: 50%;
  border: 2px solid var(--c); opacity: 0;
  animation: halo 2.8s ease-out infinite; animation-delay: calc(var(--delay, 0ms) + 700ms);
}
.pin-root.active .pin-halo { animation-duration: 1.4s; }
.pin-name {
  position: absolute; left: 50%; top: calc(100% + 6px); transform: translateX(-50%);
  padding: 2px 8px; border-radius: 99px; white-space: nowrap;
  background: rgba(6, 10, 24, .82); border: 1px solid var(--line);
  font-size: 11px; font-weight: 700; letter-spacing: .02em;
  opacity: 0; transition: opacity .2s; pointer-events: none;
}
.pin-root:hover .pin-name, .pin-root.active .pin-name, .zoomed .pin-name { opacity: 1; }
.far .pin-root { --size: 30px; }
.far .pin-ava, .far .pin .ava-empty { border-width: 2px; font-size: 10px; }
.pin-bday {
  position: absolute; top: -8px; right: -8px; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; font-size: 14px; background: var(--panel-solid); border: 2px solid var(--office);
  animation: wiggle 1.6s ease-in-out infinite;
}
.far .pin-bday { width: 18px; height: 18px; font-size: 10px; top: -6px; right: -6px; }
@keyframes wiggle { 0%, 100% { transform: rotate(-12deg); } 50% { transform: rotate(12deg) scale(1.1); } }
.bday { display: flex; align-items: center; gap: 12px; margin: -8px 0 18px; padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); }
.bday-icon { font-size: 22px; }
.bday small { display: block; color: var(--muted); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.bday.today { border-color: var(--office); background: linear-gradient(135deg, rgba(255, 180, 84, .18), rgba(139, 124, 255, .14)); }
.bday.today .bday-icon { animation: wiggle 1.6s ease-in-out infinite; }
@keyframes pin-in { from { transform: scale(0) translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes halo { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(2.1); opacity: 0; } }

/* ---------- общие элементы ---------- */
.btn {
  white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: 12px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, .06); font-weight: 700; font-size: 14px;
  transition: background .2s, transform .15s, border-color .2s;
}
.btn:hover { background: rgba(255, 255, 255, .12); }
.btn:active { transform: scale(.97); }
.btn-primary { background: linear-gradient(135deg, var(--accent), #6a5cff); border-color: transparent; color: #fff; }
.btn-primary:hover { background: linear-gradient(135deg, #9d90ff, #7b6dff); }
.btn-danger { color: var(--danger); }
.btn:disabled { opacity: .5; pointer-events: none; }

.seg { display: inline-flex; padding: 4px; gap: 4px; border-radius: 14px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); }
.seg button {
  border: none; background: none; padding: 8px 12px; border-radius: 10px;
  font-size: 13px; font-weight: 700; color: var(--muted); white-space: nowrap;
  display: inline-flex; align-items: center; gap: 7px; transition: background .2s, color .2s;
}
.seg button.on { background: rgba(255, 255, 255, .12); color: var(--text); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--accent)); box-shadow: 0 0 10px var(--c, var(--accent)); }

.input {
  width: 100%; padding: 11px 14px; border-radius: 12px;
  background: rgba(255, 255, 255, .05); border: 1px solid var(--line); outline: none;
  transition: border-color .2s, background .2s;
}
.input:focus { border-color: var(--accent); background: rgba(255, 255, 255, .08); }
.input::placeholder { color: #6f7898; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px;
  background: rgba(139, 124, 255, .14); border: 1px solid rgba(139, 124, 255, .35);
  font-size: 13px; font-weight: 600;
}

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 30px); opacity: 0; z-index: 100;
  padding: 12px 18px; border-radius: 12px; font-weight: 700; font-size: 14px;
  background: var(--panel-solid); border: 1px solid var(--line); box-shadow: var(--shadow);
  transition: all .35s cubic-bezier(.2, 1.2, .4, 1);
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast-err { border-color: var(--danger); color: var(--danger); }

/* ---------- карточка человека ---------- */
.card {
  position: fixed; z-index: 20; top: 20px; right: 20px; bottom: 20px; width: min(380px, calc(100vw - 40px));
  display: flex; flex-direction: column; overflow: hidden;
  transform: translateX(calc(100% + 40px)); opacity: 0;
  transition: transform .55s cubic-bezier(.2, 1, .3, 1), opacity .4s;
}
.card.open { transform: none; opacity: 1; }
.card-cover {
  position: relative; flex: 0 0 auto; height: 230px; background-size: cover; background-position: center;
}
.card-cover::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, var(--panel-solid)); }
.card-close, .card-nav button {
  position: absolute; z-index: 2; width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(6, 10, 24, .6); backdrop-filter: blur(8px);
  display: grid; place-items: center; font-size: 18px; line-height: 1;
}
.card-close { top: 14px; right: 14px; }
.card-body { position: relative; flex: 1; overflow-y: auto; padding: 0 24px 24px; margin-top: -54px; z-index: 1; }
.card-body > * { animation: rise .6s cubic-bezier(.2, 1, .3, 1) both; }
.card-body > :nth-child(2) { animation-delay: .06s; }
.card-body > :nth-child(3) { animation-delay: .12s; }
.card-body > :nth-child(4) { animation-delay: .18s; }
.card-body > :nth-child(5) { animation-delay: .24s; }
.card-body > :nth-child(6) { animation-delay: .3s; }
@keyframes rise { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
.card-ava { width: 104px; height: 104px; border-radius: 50%; object-fit: cover; border: 4px solid var(--c); box-shadow: 0 0 0 5px var(--panel-solid), 0 0 40px color-mix(in srgb, var(--c) 50%, transparent); display: grid; place-items: center; font-size: 34px; font-weight: 800; }
.card h2 { margin: 16px 0 2px; font-size: 26px; line-height: 1.15; letter-spacing: -.01em; }
.card .pos { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; color: var(--muted); font-weight: 600; }
.fmt { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 800; color: var(--text); background: color-mix(in srgb, var(--c) 16%, transparent); border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); }
.places { display: grid; gap: 8px; margin: 18px 0; }
.place { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); text-align: left; transition: background .2s, border-color .2s; }
.place:hover { background: rgba(255, 255, 255, .08); }
.place.cur { border-color: rgba(139, 124, 255, .55); background: rgba(139, 124, 255, .1); }
.place-icon { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; background: color-mix(in srgb, var(--c) 18%, transparent); }
.place small { display: block; color: var(--muted); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.place b { font-size: 16px; }
.hobbies-title { margin: 22px 0 10px; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; }
.hobbies { display: flex; flex-wrap: wrap; gap: 8px; }
.hobbies .chip { animation: pop .45s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.tg-btn { margin-top: 22px; width: 100%; background: linear-gradient(135deg, #2aabee, #229ed9); color: #fff; border: none; text-decoration: none; }
.card-nav { position: relative; display: flex; justify-content: space-between; padding: 0 24px 20px; }
.card-nav button { position: static; }
.card-nav span { align-self: center; color: var(--muted); font-size: 13px; font-weight: 700; }

@media (max-width: 700px) {
  .card { top: auto; left: 10px; right: 10px; bottom: 10px; width: auto; max-height: 78vh; transform: translateY(calc(100% + 30px)); }
  .card-cover { height: 170px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- события ---------- */
.ev-root { --size: 54px; --c: #ff7ab6; }
.ev-root.active, .ev-root:hover { z-index: 6; }
.ev {
  display: block; position: relative; width: var(--size); height: var(--size); padding: 0; border: none; background: none;
  animation: pin-in .7s cubic-bezier(.2, 1.4, .4, 1) var(--delay, 0ms) both;
  transition: transform .25s cubic-bezier(.2, 1.4, .4, 1);
}
.ev-root:hover .ev, .ev-root.active .ev { transform: scale(1.18); }
.ev .pin-halo { border-color: var(--c); border-radius: 18px; }
.ev-img {
  display: grid; place-items: center; width: 100%; height: 100%; object-fit: cover; border-radius: 18px;
  border: 3px solid #fff; transform: rotate(-4deg);
  box-shadow: 0 0 0 3px rgba(6, 10, 24, .6), 0 8px 22px rgba(0, 0, 0, .55), 0 0 26px color-mix(in srgb, var(--c) 60%, transparent);
}
.ev-empty { background: linear-gradient(135deg, #ff7ab6, #8b7cff); font-size: 24px; }
.ev-type {
  position: absolute; right: -9px; bottom: -7px; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; font-size: 15px; background: var(--panel-solid); border: 2px solid var(--c);
}
.ev-label {
  position: absolute; left: 50%; top: calc(100% + 9px); transform: translateX(-50%); max-width: 200px;
  padding: 3px 9px; border-radius: 99px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: rgba(6, 10, 24, .85); border: 1px solid var(--line); font-size: 11px; font-weight: 700;
  opacity: 0; transition: opacity .2s; pointer-events: none;
}
.ev-root:hover .ev-label, .ev-root.active .ev-label, .zoomed .ev-label { opacity: 1; }
.far .ev-root { --size: 40px; }

/* галерея в карточке события */
.gal { position: relative; flex: 0 0 auto; height: 250px; background: #0b1020; overflow: hidden; }
.gal-img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; animation: fade .45s ease both; }
@keyframes fade { from { opacity: 0; transform: scale(1.04); } to { opacity: 1; transform: none; } }
.gal::after { content: ''; position: absolute; inset: auto 0 0 0; height: 90px; background: linear-gradient(transparent, var(--panel-solid)); pointer-events: none; }
.gal-nav { position: absolute; z-index: 2; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(6, 10, 24, .6); backdrop-filter: blur(8px); font-size: 20px; line-height: 1; }
.gal-prev { left: 12px; } .gal-next { right: 12px; }
.gal-count { position: absolute; z-index: 2; top: 16px; left: 16px; padding: 4px 10px; border-radius: 99px; font-size: 12px; font-weight: 800; background: rgba(6, 10, 24, .6); }
.thumbs { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 6px; margin: 14px 0 4px; scrollbar-width: thin; }
.thumbs img { flex: 0 0 auto; width: 58px; height: 44px; object-fit: cover; border-radius: 8px; opacity: .55; cursor: pointer; border: 2px solid transparent; transition: opacity .2s, border-color .2s; }
.thumbs img.on { opacity: 1; border-color: var(--accent); }
.ev-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; color: var(--muted); font-weight: 700; font-size: 14px; }
.ev-chip { display: inline-flex; gap: 6px; align-items: center; padding: 4px 10px; border-radius: 99px; font-size: 12px; font-weight: 800; color: var(--text);
  background: rgba(255, 122, 182, .15); border: 1px solid rgba(255, 122, 182, .4); }
.route-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 16px 0 0; padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); font-weight: 700; font-size: 14px; }
.route-line i { color: var(--muted); font-style: normal; }
.ev-desc { margin: 16px 0 0; line-height: 1.55; color: #d6dbef; white-space: pre-line; }
.people-row { display: flex; flex-wrap: wrap; gap: 8px; }
.person-chip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 99px; border: 1px solid var(--line); background: rgba(255, 255, 255, .05); font-size: 13px; font-weight: 700;
  animation: pop .45s cubic-bezier(.2, 1.4, .4, 1) both; transition: background .2s; }
.person-chip:hover { background: rgba(255, 255, 255, .12); }
.person-chip .ava, .person-chip .ava-empty { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; display: grid; place-items: center; font-size: 10px; font-weight: 800; border: 2px solid var(--c); }
.ev-list { display: grid; gap: 6px; }
.ev-link { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, .04); text-align: left; font-size: 13px; transition: background .2s; }
.ev-link:hover { background: rgba(255, 255, 255, .1); }
.ev-link img, .ev-link .ev-empty { width: 40px; height: 32px; border-radius: 8px; object-fit: cover; flex: 0 0 auto; display: grid; place-items: center; font-size: 16px; }
.ev-link small { display: block; color: var(--muted); }

/* лента лет */
/* справа от кнопки тура и не под карточкой (она до 500px шириной справа) */
.timeline { position: fixed; z-index: 10; left: 230px; bottom: 24px; transform: translateY(140%); max-width: min(760px, calc(100vw - 230px - 540px));
  display: flex; gap: 4px; padding: 5px; overflow-x: auto; scrollbar-width: none; transition: transform .5s cubic-bezier(.2, 1.2, .4, 1); }
.timeline.show { transform: none; }
.timeline button { flex: 0 0 auto; border: none; background: none; padding: 8px 12px; border-radius: 10px; font-weight: 800; font-size: 13px; color: var(--muted); transition: background .2s, color .2s; }
.timeline button.on { background: linear-gradient(135deg, #ff7ab6, var(--accent)); color: #fff; }
.timeline button small { font-weight: 700; opacity: .7; margin-left: 3px; }

/* просмотр фото */
.lightbox { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; background: rgba(3, 5, 14, .92); backdrop-filter: blur(6px); opacity: 0; transition: opacity .3s; }
.lightbox.show { opacity: 1; }
.lb-img { max-width: 92vw; max-height: 86vh; border-radius: 14px; box-shadow: var(--shadow); }
.lb-img.in { animation: fade .35s ease both; }
.lb-count { position: absolute; top: 22px; left: 50%; transform: translateX(-50%); font-weight: 800; color: var(--muted); }
.lb-close, .lb-prev, .lb-next { position: absolute; width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line); background: rgba(255, 255, 255, .08); font-size: 26px; line-height: 1; }
.lb-close { top: 18px; right: 18px; font-size: 18px; }
.lb-prev { left: 18px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 18px; top: 50%; transform: translateY(-50%); }

@media (max-width: 700px) {
  .timeline { left: 10px; right: 10px; max-width: none; transform: translateY(140%); bottom: 70px; }
  .timeline.show { transform: none; }
  .gal { height: 190px; }
}

/* карточка события: шире, крупные превью, видео */
.card.wide { width: min(500px, calc(100vw - 40px)); }
.card.wide .gal { height: 290px; }
.gal-empty { display: grid; place-items: center; font-size: 64px; background: linear-gradient(135deg, #3a1d4d, #0e1428); }
video.gal-img { background: #000; }
.mgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mtile { position: relative; aspect-ratio: 1; padding: 0; border: none; border-radius: 14px; overflow: hidden; background: #111a33; cursor: zoom-in;
  animation: pop .45s cubic-bezier(.2, 1.4, .4, 1) both; }
.mtile img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.mtile:hover img { transform: scale(1.07); }
.mplay { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center; padding-left: 3px; font-size: 15px; background: rgba(6, 10, 24, .6); border: 2px solid rgba(255, 255, 255, .85); backdrop-filter: blur(4px); }
.mdur { position: absolute; right: 6px; bottom: 6px; padding: 2px 7px; border-radius: 7px; font-size: 11px; font-weight: 800; background: rgba(6, 10, 24, .75); }
.lb-stage { display: grid; place-items: center; width: 100%; height: 100%; }
video.lb-img { background: #000; max-width: 92vw; max-height: 84vh; }
@media (max-width: 700px) { .card.wide { width: auto; } .card.wide .gal { height: 210px; } .mgrid { grid-template-columns: repeat(3, 1fr); gap: 5px; } }

/* сообщения поверх карты: загрузка и «нет WebGL» */
.mapmsg { position: fixed; inset: 0; z-index: 4; display: grid; place-items: center; padding: 16px; pointer-events: none; }
.mapmsg .glass { padding: 16px 22px; font-weight: 700; display: flex; align-items: center; gap: 12px; }
.mapmsg.error { z-index: 60; pointer-events: auto; }
.mapmsg.error .glass { display: block; max-width: 520px; line-height: 1.5; }
.mapmsg.error p { margin: 8px 0 0; color: var(--muted); font-weight: 600; font-size: 14px; }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .2); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ================= Globetrip ================= */

/* шапка */
.top { position: fixed; z-index: 10; top: 20px; left: 20px; right: 20px; display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; pointer-events: none; }
.top > * { pointer-events: auto; }
.left { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.brand { display: flex; align-items: center; gap: 14px; padding: 14px 20px 14px 14px; animation: drop .8s cubic-bezier(.2, 1, .3, 1) both; }
.badge { flex: 0 0 auto; width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; font-size: 28px;
  background: linear-gradient(135deg, var(--accent-2), var(--accent)); box-shadow: 0 8px 30px rgba(94, 231, 255, .35); }
.brand h1 { margin: 0; font-size: 20px; letter-spacing: -.01em; }
.stats { margin-top: 3px; color: var(--muted); font-size: 13px; font-weight: 600; }
.stats b { color: var(--text); font-variant-numeric: tabular-nums; }
.seg.glass { border-radius: 14px; animation: drop .8s .05s cubic-bezier(.2, 1, .3, 1) both; }
.tools { display: flex; flex-direction: column; gap: 10px; align-items: flex-end; animation: drop .8s .1s cubic-bezier(.2, 1, .3, 1) both; }
.tools-row { display: flex; gap: 10px; align-items: center; }
.app-btn { white-space: nowrap; text-decoration: none; }
.app-old { display: grid; gap: 6px; text-align: left; }
.app-ver { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: baseline; padding: 9px 12px; border-radius: 12px;
  border: 1px solid var(--line); color: inherit; text-decoration: none; font-size: 13px; }
.app-ver:hover { background: rgba(255, 255, 255, .06); }
.app-ver span, .app-ver small { color: var(--muted); }
.me-btn { display: flex; align-items: center; gap: 8px; padding: 5px 14px 5px 5px; border-radius: 99px; font-weight: 800; font-size: 14px; }
.me-btn .ava-empty, .menu-head .ava-empty, .author .ava-empty { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff; flex: 0 0 auto; }
.search { position: relative; width: 300px; }
.search .input { background: var(--panel); backdrop-filter: blur(16px); padding-left: 38px; }
.search::before { content: '⌕'; position: absolute; left: 14px; top: 50%; transform: translateY(-52%); color: var(--muted); font-size: 18px; }
.results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; padding: 6px; display: none; max-height: 340px; overflow-y: auto; }
.results.show { display: block; }
.res { display: flex; gap: 10px; align-items: center; width: 100%; padding: 8px; border: none; background: none; border-radius: 10px; text-align: left; }
.res:hover, .res:focus { background: rgba(255, 255, 255, .07); outline: none; }
.res .ava, .res .ava-empty { width: 40px; height: 34px; border-radius: 9px; object-fit: cover; display: grid; place-items: center; flex: 0 0 auto; background: #2a1638; }
.res small { display: block; color: var(--muted); font-size: 12px; }
.top.shared .tools { display: none; }
.empty { position: fixed; inset: 0; display: none; place-items: center; z-index: 5; pointer-events: none; }
.empty.show { display: grid; }
.empty > div { padding: 26px 30px; text-align: center; max-width: 380px; pointer-events: auto; animation: rise .8s cubic-bezier(.2, 1, .3, 1) both; }
.empty p { margin: 6px 0 0; color: var(--muted); }
@keyframes drop { from { transform: translateY(-20px); opacity: 0; } to { transform: none; opacity: 1; } }
.timeline { left: 20px; max-width: min(760px, calc(100vw - 600px)); }

/* меню участника */
.menu { position: fixed; z-index: 40; top: 76px; right: 20px; width: 270px; padding: 8px; display: none; animation: rise .3s cubic-bezier(.2, 1, .3, 1) both; }
.menu.show { display: block; }
.menu-head { display: flex; align-items: center; gap: 10px; padding: 8px 8px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu-head small { display: block; color: var(--muted); font-size: 12px; }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px; border: none; background: none; border-radius: 10px; text-align: left; font-weight: 700; font-size: 14px; }
.menu button:hover { background: rgba(255, 255, 255, .07); }
.menu button span { width: 22px; text-align: center; }

/* карточка путешествия */
.card { width: min(500px, calc(100vw - 40px)); }
.card .gal { height: 290px; }
.gal-empty { background: linear-gradient(135deg, #123049, #2a1638); }
.sec-title { margin: 22px 0 10px; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; }
.ev-chip.vis { background: rgba(94, 231, 255, .12); border-color: rgba(94, 231, 255, .35); }
.author { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-weight: 700; }
.author a { margin-left: auto; font-size: 13px; text-decoration: none; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.mgeo { position: absolute; right: 5px; top: 5px; font-size: 12px; filter: drop-shadow(0 1px 2px #000); }
.note { display: flex; align-items: center; gap: 10px; margin-top: 16px; padding: 10px 14px; border-radius: 12px; background: rgba(94, 231, 255, .08); border: 1px solid rgba(94, 231, 255, .25); font-size: 13px; font-weight: 700; }
.ev-root.mine { --c: #5ee7ff; }
.ev-type.ava-empty { font-size: 10px; font-weight: 800; color: #fff; border-color: var(--panel-solid); }
.lb-loading { position: absolute; bottom: 28px; left: 50%; width: 22px; height: 22px; margin-left: -11px; border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, .2); border-top-color: var(--accent-2); animation: spin .8s linear infinite; }

/* окно входа и диалоги */
.auth { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(3, 5, 14, .35); }
.auth-box { width: min(440px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; padding: 30px; display: grid; gap: 14px; text-align: center; animation: rise .7s cubic-bezier(.2, 1, .3, 1) both; }
.auth-box h1, .auth-box h2 { margin: 0; font-size: 24px; }
.auth-box h2 { font-size: 20px; }
.auth-box p { margin: 0; color: var(--muted); line-height: 1.5; }
.auth-logo { font-size: 54px; line-height: 1; animation: floaty 4s ease-in-out infinite; }
@keyframes floaty { 50% { transform: translateY(-6px) rotate(8deg); } }
.auth-form { display: grid; gap: 10px; }
.auth-box .hint { font-size: 13px; }
.auth-box .wait { display: flex; gap: 10px; align-items: center; justify-content: center; }
.or { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; }
.tg-btn { width: 100%; margin-top: 0; background: linear-gradient(135deg, #2aabee, #229ed9); color: #fff; border: none; text-decoration: none; }
.linkbox { display: flex; gap: 8px; }
.linkbox .input { flex: 1; min-width: 0; }
.inv-list { display: grid; gap: 6px; text-align: left; max-height: 260px; overflow-y: auto; }
.inv { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); }
.inv > div { flex: 1; min-width: 0; }
.inv small { display: block; color: var(--muted); font-size: 12px; }
.inv.used { opacity: .6; }
.mini { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 9px; border: 1px solid var(--line); background: rgba(255, 255, 255, .05); font-size: 13px; }
.mini:disabled { opacity: .3; }

/* редактор */
.side { position: fixed; z-index: 30; top: 16px; left: 16px; bottom: 16px; width: 460px; display: flex; flex-direction: column; overflow: hidden; animation: rise .5s cubic-bezier(.2, 1, .3, 1) both; }
.pane { flex: 1; overflow-y: auto; padding: 16px 18px 20px; }
body.editing .top, body.editing .timeline { opacity: 0; pointer-events: none; }
body.editing #map { cursor: crosshair; }
.bar { display: flex; gap: 12px; align-items: center; }
.form { display: grid; gap: 18px; }
.form label > span, .lbl { display: block; margin-bottom: 7px; font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.geo { position: relative; }
.geo-res { position: absolute; z-index: 5; top: calc(100% + 6px); left: 0; right: 0; padding: 6px; display: none; background: var(--panel-solid); }
.geo-res.show { display: block; }
.geo-res button { display: block; width: 100%; padding: 9px 10px; border: none; background: none; border-radius: 10px; text-align: left; font-size: 13px; }
.geo-res button:hover { background: rgba(255, 255, 255, .07); }
.geo-res small { color: var(--muted); }
.hint { margin-top: 6px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
textarea.input { min-height: 110px; resize: vertical; line-height: 1.5; }
.pts { display: grid; gap: 6px; margin-top: 8px; }
.pt { display: flex; align-items: center; gap: 6px; animation: rise .35s cubic-bezier(.2, 1, .3, 1) both; }
.pt .num { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; background: #ff7ab6; color: #1a0b18; }
.pt .input { padding: 8px 10px; }
.geo-btn { margin-top: 10px; width: 100%; }
.evpt { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 800; color: #1a0b18; background: #ff7ab6; border: 3px solid #fff; box-shadow: 0 4px 14px rgba(0, 0, 0, .5); cursor: grab; }
.sources { display: grid; gap: 6px; margin-top: 8px; }
.src { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); animation: rise .35s cubic-bezier(.2, 1, .3, 1) both; }
.src-icon { font-size: 18px; }
.src-main { flex: 1; min-width: 0; }
.src-main a { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 700; color: var(--text); text-decoration: none; }
.src-main small { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.src-main .spin { width: 12px; height: 12px; border-width: 2px; }
.src-ready small { color: var(--remote); }
.src-error { border-color: rgba(255, 107, 129, .5); }
.src-error small { color: var(--danger); }
.photos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 10px; }
.photos:empty { display: none; }
.ph { position: relative; aspect-ratio: 1; border-radius: 10px; background: #111a33 center / cover; overflow: hidden; animation: pop .35s cubic-bezier(.2, 1.4, .4, 1) both; }
.ph.cover { outline: 2px solid #ff7ab6; outline-offset: 1px; }
.ph.off { opacity: .3; filter: grayscale(1); }
.ph .tag { position: absolute; left: 4px; bottom: 4px; padding: 1px 6px; border-radius: 6px; font-size: 10px; font-weight: 800; background: #ff7ab6; color: #1a0b18; }
.ph button { position: absolute; top: 4px; width: 22px; height: 22px; border-radius: 50%; border: none; background: rgba(6, 10, 24, .75); font-size: 11px; line-height: 1; }
.ph .x { right: 4px; } .ph .star { left: 4px; }
.ph.off .x { opacity: 1; }
.geo-dot { position: absolute; right: 4px; bottom: 3px; font-size: 11px; filter: drop-shadow(0 1px 2px #000); }
.vis-opts { display: grid; gap: 6px; }
.vis-opts button { padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, .04); text-align: left; transition: all .2s; }
.vis-opts button small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.vis-opts button.on { border-color: var(--accent-2); background: rgba(94, 231, 255, .1); }
.actions { display: flex; gap: 10px; position: sticky; bottom: -20px; padding: 14px 0 6px; background: linear-gradient(transparent, var(--panel-solid) 40%); }
.actions .btn-primary { flex: 1; }

@media (max-width: 700px) {
  .top { top: 10px; left: 10px; right: 10px; flex-direction: column; align-items: stretch; }
  .brand { padding: 10px 14px 10px 10px; }
  .badge { width: 42px; height: 42px; font-size: 22px; border-radius: 13px; }
  .brand h1 { font-size: 17px; }
  .left, .tools { align-items: stretch; }
  .tools-row { justify-content: space-between; }
  .tools-row .btn-primary { flex: 1; }
  .search { width: 100%; }
  .seg { display: flex; } .seg button { flex: 1; justify-content: center; }
  .menu { top: auto; bottom: 10px; left: 10px; right: 10px; width: auto; }
  .timeline { left: 10px; right: 10px; bottom: 14px; max-width: none; }
  .card .gal { height: 210px; }
  .side { top: auto; left: 6px; right: 6px; bottom: 6px; width: auto; height: 64vh; }
  .photos { grid-template-columns: repeat(4, 1fr); }
}
