/* Parto public site.
   A storybook map: warm paper map, navy ink UI floating on glass, the logo's cyan→blue→violet light used sparingly,
   and a dark cinema when a story plays. */
@font-face { font-family: "Vazirmatn"; src: url("../fonts/Vazirmatn-wght.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --ink: #10153A; --ink-2: #2A3060; --muted: #61658A; --paper: #F7F2E9;
  --glass: rgba(255, 252, 246, .86); --glass-strong: rgba(255, 252, 246, .96); --line: rgba(16, 21, 58, .10);
  --c1: #16D3F2; --c2: #2E50EC; --c3: #B12EF0;
  --brand: linear-gradient(120deg, var(--c1), var(--c2) 55%, var(--c3));
  --heart: #FF3D6E; --ok: #13A06B;
  --shadow: 0 10px 30px rgba(16, 21, 58, .16); --shadow-s: 0 4px 14px rgba(16, 21, 58, .14);
  --cinema: #070A1F; --cinema-2: #121637; --on-cinema: #EEF0FF; --on-cinema-2: #A9AED6;
  --r: 16px; --font: "Vazirmatn", Tahoma, "Segoe UI", sans-serif;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --ink: #EEF0FF; --ink-2: #C9CCF0; --muted: #A2A7CF; --paper: #0B0F25;
  --glass: rgba(20, 26, 62, .84); --glass-strong: rgba(20, 26, 62, .97); --line: rgba(255, 255, 255, .10);
  --shadow: 0 10px 30px rgba(0, 0, 0, .45); --shadow-s: 0 4px 14px rgba(0, 0, 0, .4);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body { font-family: var(--font); background: var(--paper); color: var(--ink); font-size: 14px; line-height: 1.75; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--c2); outline-offset: 2px; }
svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------- map ---------------- */
.map { position: fixed; inset: 0; }
.maplibregl-ctrl-attrib { font-family: var(--font); font-size: 10px; }
.maplibregl-ctrl-bottom-left { bottom: calc(var(--strip-h, 0px) + var(--safe-b)); transition: bottom .3s; }

/* ---------------- top bar ---------------- */
.topbar {
  position: fixed; z-index: 20; top: calc(12px + var(--safe-t)); right: max(12px, var(--safe-r)); left: max(12px, var(--safe-l));
  display: flex; gap: 8px; align-items: center; pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.brand, .search, .tb-btn {
  height: 48px; background: var(--glass); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3);
  border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-s);
}
.brand { display: flex; align-items: center; gap: 8px; padding: 0 6px 0 14px; text-decoration: none; flex: none; }
.brand .badge { display: grid; place-items: center; flex: none; }
.brand .badge img { width: 40px; height: auto; display: block; }
.brand-word img { width: 58px; height: auto; display: block; }
.w-dark { display: none !important; }
:root[data-theme="dark"] .w-light { display: none !important; } :root[data-theme="dark"] .w-dark { display: block !important; }
.search { flex: 1; min-width: 0; max-width: 460px; display: flex; align-items: center; gap: 8px; padding: 0 14px; }
.search svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.search input { border: 0; background: none; outline: none; width: 100%; min-width: 0; font-size: 15px; }
.search input::placeholder { color: var(--muted); }
.tb-btn { display: inline-flex; align-items: center; gap: 6px; padding: 0 14px; font-weight: 700; flex: none; position: relative; }
.tb-btn svg { width: 18px; height: 18px; }
.tb-btn.round { width: 48px; justify-content: center; padding: 0; font-size: 18px; font-weight: 800; }
.tb-btn em { font-style: normal; position: absolute; top: -6px; left: -6px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--brand); color: #fff; font-size: 11px; display: grid; place-items: center; }

/* ---------------- chips ---------------- */
.chips {
  position: fixed; z-index: 19; top: calc(68px + var(--safe-t)); right: 0; left: 0; display: flex; gap: 6px; overflow-x: auto;
  padding: 2px max(12px, var(--safe-r)) 8px max(12px, var(--safe-l)); scrollbar-width: none; pointer-events: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  pointer-events: auto; flex: none; display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 999px;
  background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid var(--line);
  font-weight: 600; font-size: 13px; box-shadow: var(--shadow-s); white-space: nowrap;
}
.chip i { width: 10px; height: 10px; border-radius: 50%; background: var(--cc, var(--muted)); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: transparent; }
.chip small { opacity: .6; font-weight: 500; }

/* ---------------- map controls ---------------- */
.mapctl { position: fixed; z-index: 18; left: max(12px, var(--safe-l)); bottom: calc(var(--strip-h, 60px) + 40px + var(--safe-b)); display: grid; gap: 6px; transition: bottom .3s; }
.mapctl button { width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px); box-shadow: var(--shadow-s); font-size: 20px; display: grid; place-items: center; }
.mapctl svg { width: 18px; height: 18px; }

/* ---------------- map pins are drawn on the GPU (see site.js); only the 'me' dot is HTML ---------------- */
.map canvas { outline: none; }
.me { width: 18px; height: 18px; border-radius: 50%; background: #2E7BFF; border: 3px solid #fff; box-shadow: 0 0 0 8px rgba(46,123,255,.22); }

/* ---------------- story strip ---------------- */
.strip {
  position: fixed; z-index: 18; bottom: 0; right: 0; left: 0; padding-bottom: calc(10px + var(--safe-b));
  background: linear-gradient(to top, var(--glass-strong) 62%, transparent); transition: transform .3s cubic-bezier(.2, .8, .2, 1);
}
.strip-head { display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 14px max(16px, var(--safe-r)) 8px max(16px, var(--safe-l)); width: 100%; text-align: right; }
.strip-head span { font-weight: 900; font-size: 15px; }
.strip-head small { color: var(--muted); font-size: 12px; }
.strip-head i { margin-inline-start: auto; width: 34px; height: 34px; border-radius: 10px; background: var(--glass); border: 1px solid var(--line); position: relative; }
.strip-head i::before { content: ""; position: absolute; inset: 0; margin: auto; width: 9px; height: 9px; border-left: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: translateY(-2px) rotate(-45deg); transition: transform .3s; }
.strip.collapsed .strip-head i::before { transform: translateY(2px) rotate(135deg); }
.strip.collapsed .cards { display: none; }
.cards { display: flex; gap: 12px; overflow-x: auto; padding: 4px max(16px, var(--safe-r)) 6px max(16px, var(--safe-l)); scroll-snap-type: x mandatory; scrollbar-width: none; }
.cards::-webkit-scrollbar { display: none; }
.card {
  flex: none; width: 214px; scroll-snap-align: start; border: 1px solid var(--line); border-radius: 14px; background: var(--glass-strong);
  padding: 0; overflow: hidden; text-align: right; box-shadow: var(--shadow-s); transition: transform .2s;
}
.card:hover { transform: translateY(-3px); }
.card .thumb { aspect-ratio: 16 / 9; position: relative; background: var(--cc); overflow: hidden; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .thumb .dur { position: absolute; left: 6px; bottom: 6px; background: rgba(7,10,31,.72); color: #fff; font-size: 11px; border-radius: 6px; padding: 0 6px; }
.card .thumb .seenmark { position: absolute; right: 6px; top: 6px; background: rgba(7,10,31,.72); color: #fff; font-size: 10.5px; border-radius: 6px; padding: 0 6px; }
.card .thumb .catline { position: absolute; inset: auto 0 0 0; height: 3px; background: var(--cc); }
.card .body { padding: 8px 10px 10px; display: grid; gap: 1px; }
.card b { font-size: 13.5px; font-weight: 800; line-height: 1.55; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .sub { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; gap: 6px; }
.card .sub .h { margin-inline-start: auto; color: var(--heart); font-weight: 700; flex: none; }
.empty { padding: 16px; color: var(--muted); display: grid; gap: 8px; justify-items: start; }
.empty b { color: var(--ink); font-size: 15px; }
.empty button { border: 1px solid var(--line); background: var(--glass); border-radius: 10px; padding: 6px 14px; font-weight: 700; }

/* ---------------- sheets ---------------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 40; background: rgba(7, 10, 31, .45); display: grid; place-items: center; padding: 20px; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.sheet { width: min(520px, 100%); max-height: 100%; overflow: auto; background: var(--glass-strong); backdrop-filter: blur(18px);
  border-radius: 22px; padding: 18px 20px 20px; box-shadow: var(--shadow); animation: up .3s cubic-bezier(.2, .8, .2, 1); }
@keyframes up { from { transform: translateY(24px); opacity: 0; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.sheet h2 { margin: 0; font-size: 19px; font-weight: 900; }
.fsec { padding: 12px 0; border-top: 1px solid var(--line); }
.fsec:first-of-type { border-top: 0; }
.fsec h3 { margin: 0 0 8px; font-size: 13px; font-weight: 800; color: var(--muted); }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg button { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 600; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: transparent; }
.seg button:disabled { opacity: .35; cursor: default; }
.seg.small button { padding: 4px 11px; font-size: 12px; }
.seg + .seg { margin-top: 8px; }
.seg .dotc { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--cc); margin-inline-end: 6px; }
.near { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.toggle { width: 52px; height: 30px; border-radius: 15px; border: 0; background: var(--line); position: relative; flex: none; transition: background .2s; }
.toggle i { position: absolute; top: 3px; right: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-s); transition: right .2s; }
.toggle[aria-checked="true"] { background: var(--c2); }
.toggle[aria-checked="true"] i { right: 25px; }
.hint { margin: 8px 0 0; font-size: 12px; color: var(--muted); }
.sheet-foot { display: flex; gap: 8px; justify-content: space-between; padding-top: 14px; border-top: 1px solid var(--line); }
.primary { border: 0; background: var(--brand); color: #fff; font-weight: 800; border-radius: 12px; padding: 10px 22px; box-shadow: 0 8px 20px rgba(46,80,236,.35); }
.ghost { border: 1px solid var(--line); background: transparent; font-weight: 700; border-radius: 12px; padding: 10px 16px; }
.x { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: transparent; position: relative; flex: none; }
.x::before, .x::after { content: ""; position: absolute; inset: 0; margin: auto; width: 16px; height: 2px; background: currentColor; border-radius: 2px; transform: rotate(45deg); }
.x::after { transform: rotate(-45deg); }
.about p { line-height: 2.1; }
.about .contact { background: var(--line); border-radius: 12px; padding: 10px 14px; }
.about .credit { font-size: 12px; color: var(--muted); }

.toast { position: fixed; z-index: 60; left: 50%; top: calc(126px + var(--safe-t)); transform: translateX(-50%); background: var(--ink); color: var(--paper);
  padding: 10px 18px; border-radius: 14px; font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow); max-width: calc(100% - 32px); text-align: center; animation: up .25s; }

/* ---------------- intro ---------------- */
.intro {
  position: fixed; inset: 0; z-index: 100; display: grid; place-content: center; justify-items: center; gap: 14px; text-align: center; padding: 24px;
  background: radial-gradient(120% 90% at 50% 40%, #FFFFFF 0%, #F6F7FF 55%, #ECEEFB 100%); color: #10153A; transition: opacity .7s, transform .9s cubic-bezier(.6, 0, .2, 1);
}
.intro.leaving { opacity: 0; transform: scale(1.08); pointer-events: none; }
.intro-glow { position: absolute; width: 520px; height: 520px; max-width: 120vw; left: 50%; top: 38%; transform: translate(-50%, -50%); border-radius: 50%;
  background: radial-gradient(circle, rgba(22,211,242,.10), rgba(46,80,236,.06) 45%, rgba(177,46,240,.04) 62%, transparent 72%); animation: breathe 4s ease-in-out infinite; }
@keyframes breathe { 50% { transform: translate(-50%, -50%) scale(1.12); opacity: .75; } }
.intro-logo { position: relative; width: min(260px, 64vw); animation: logoIn 1.2s cubic-bezier(.2, .9, .2, 1) both; }
.intro-logo .mark { width: 100%; height: auto; display: block; }
.intro-logo .sweep { position: absolute; inset: 0; -webkit-mask: url("../img/logo-mark.png?v=4") center / contain no-repeat; mask: url("../img/logo-mark.png?v=4") center / contain no-repeat;
  background: linear-gradient(110deg, transparent 40%, rgba(255,255,255,.55) 50%, transparent 60%) 150% 0 / 260% 100% no-repeat; animation: sweep 1.4s .9s ease-in-out both; }
@keyframes logoIn { from { transform: translateY(18px) scale(.7); opacity: 0; } }
@keyframes sweep { from { background-position: 150% 0; } to { background-position: -50% 0; } }
.intro-word { width: min(190px, 48vw); margin-top: -4px; height: auto; position: relative; animation: rise .8s .45s cubic-bezier(.2, .9, .2, 1) both; }
.intro-slogan { margin: 2px 0 6px; font-size: clamp(16px, 4.4vw, 21px); font-weight: 700; color: #1C2470; position: relative; text-wrap: balance; }
.intro-slogan span { display: inline-block; animation: rise .6s cubic-bezier(.2, .9, .2, 1) both; }
@keyframes rise { from { transform: translateY(14px); opacity: 0; } }
.intro-go { position: relative; border: 0; border-radius: 16px; padding: 14px 44px; font-size: 17px; font-weight: 900; color: #fff; background: var(--brand);
  box-shadow: 0 0 0 0 rgba(46,80,236,.35), 0 12px 28px rgba(46,80,236,.3); animation: rise .6s .25s both, halo 2.6s 1.4s ease-out infinite; }
.intro-go:hover { transform: translateY(-2px); }
@keyframes halo { 0% { box-shadow: 0 0 0 0 rgba(46,80,236,.35), 0 12px 28px rgba(46,80,236,.3); } 100% { box-shadow: 0 0 0 18px rgba(46,80,236,0), 0 12px 28px rgba(46,80,236,.3); } }
.intro-count { margin: 0; font-size: 12.5px; color: #6A71A8; position: relative; min-height: 1.5em; animation: rise .6s .9s both; }
.intro.quick .intro-logo, .intro.quick .intro-word, .intro.quick .intro-slogan span, .intro.quick .intro-count { animation-duration: .45s; animation-delay: 0s; }

/* ---------------- story player ---------------- */
.story { position: fixed; inset: 0; z-index: 50; color: var(--on-cinema); }
.story .portal { position: absolute; inset: 0; background: var(--cinema); clip-path: circle(0 at var(--px, 50%) var(--py, 50%)); transition: clip-path .7s cubic-bezier(.65, 0, .25, 1); }
.story.open .portal { clip-path: circle(150vmax at var(--px, 50%) var(--py, 50%)); }
.story-bg { position: absolute; inset: -40px; background: center / cover no-repeat; filter: blur(40px) saturate(1.3); opacity: 0; transition: opacity .8s .35s; }
.story.open .story-bg { opacity: .32; }
.story-inner { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr; overflow: auto; opacity: 0; transform: translateY(18px) scale(.98);
  transition: opacity .45s .38s, transform .55s .38s cubic-bezier(.2, .8, .2, 1);
  padding: calc(16px + var(--safe-t)) max(16px, var(--safe-r)) calc(20px + var(--safe-b)) max(16px, var(--safe-l)); }
.story.open .story-inner { opacity: 1; transform: none; }
.story.closing .story-inner { transition-delay: 0s; transition-duration: .25s; }
.story.closing .portal { transition-delay: .12s; }
.story.with-info .story-inner { grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; }
.story .x.light { position: fixed; z-index: 3; top: calc(14px + var(--safe-t)); left: max(14px, var(--safe-l)); color: #fff; border-color: rgba(255,255,255,.2); background: rgba(255,255,255,.06); backdrop-filter: blur(8px); }
.stage { width: min(1040px, 100%); margin: auto; display: grid; gap: 16px; align-content: center; min-height: 100%; padding-top: 44px; }
.story.with-info .stage { margin: 0; justify-self: end; }
.player { position: relative; border-radius: 18px; overflow: hidden; background: #000; aspect-ratio: 16 / 9; box-shadow: 0 30px 80px rgba(0,0,0,.55); user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.player video { width: 100%; height: 100%; display: block; object-fit: contain; background: #000; pointer-events: none; }
.bigplay { position: absolute; inset: 0; margin: auto; width: 84px; height: 84px; border-radius: 50%; border: 0; background: rgba(255,255,255,.95); color: var(--cinema);
  display: grid; place-items: center; box-shadow: 0 10px 40px rgba(0,0,0,.4); transition: transform .2s, opacity .2s; }
.bigplay svg { width: 30px; height: 30px; fill: currentColor; stroke: none; margin-left: 4px; }
.bigplay:hover { transform: scale(1.06); }
.player.playing .bigplay { opacity: 0; pointer-events: none; transform: scale(.8); }
.loading { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.loading i { width: 44px; height: 44px; border-radius: 50%; border: 4px solid rgba(255,255,255,.2); border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.ctrls { position: absolute; inset: auto 0 0 0; display: flex; align-items: center; gap: 10px; padding: 26px 14px 10px; direction: ltr;
  background: linear-gradient(to top, rgba(0,0,0,.7), transparent); transition: opacity .25s; }
.player.playing.idle .ctrls { opacity: 0; }
.ctrls button { width: 36px; height: 36px; border: 0; background: none; color: #fff; display: grid; place-items: center; border-radius: 10px; flex: none; }
.ctrls button:hover { background: rgba(255,255,255,.12); }
.ctrls svg { width: 20px; height: 20px; }
#cPlay svg { fill: #fff; stroke: none; }
#cPlay .i-pause, .player.playing #cPlay .i-play { display: none; }
.player.playing #cPlay .i-pause { display: block; }
#cMute .cross, .player.muted #cMute .wave { display: none; }
.player.muted #cMute .cross { display: block; }
.time { font-size: 12px; color: #fff; font-variant-numeric: tabular-nums; min-width: 34px; text-align: center; }
#cSeek { flex: 1; min-width: 0; -webkit-appearance: none; appearance: none; height: 5px; border-radius: 3px; cursor: pointer;
  background: linear-gradient(to right, #fff var(--p, 0%), rgba(255,255,255,.28) var(--p, 0%)); }
#cSeek::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 0; }
#cSeek::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 0; }
.endcard { position: absolute; inset: 0; display: grid; place-content: center; gap: 14px; justify-items: center; text-align: center; padding: 20px;
  background: rgba(7,10,31,.82); backdrop-filter: blur(6px); animation: fade .3s; }
.endcard h4 { margin: 0; font-size: 13px; font-weight: 600; color: var(--on-cinema-2); }
.next { display: grid; grid-template-columns: 120px 1fr; gap: 12px; align-items: center; text-align: right; border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06); border-radius: 14px; padding: 8px; color: #fff; max-width: 420px; width: 100%; }
.next img { width: 120px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 9px; display: block; background: var(--cc); }
.next b { display: block; font-size: 15px; }
.next small { color: var(--on-cinema-2); }
.endcard .row { display: flex; gap: 8px; }
.endcard .row button { border: 1px solid rgba(255,255,255,.2); background: transparent; color: #fff; border-radius: 12px; padding: 8px 16px; font-weight: 700; }
.endcard .row .go { background: #fff; color: var(--cinema); border: 0; }
.meta { display: grid; gap: 4px; }
.meta-top { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.cat { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: #fff; background: color-mix(in srgb, var(--cc) 30%, transparent);
  border: 1px solid color-mix(in srgb, var(--cc) 60%, transparent); padding: 1px 10px; border-radius: 999px; }
.cat::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--cc); }
.when { color: var(--on-cinema-2); }
.meta h2 { margin: 2px 0 0; font-size: clamp(22px, 3.2vw, 32px); font-weight: 900; line-height: 1.4; text-wrap: balance; }
.where { margin: 0; color: var(--on-cinema-2); font-size: 14px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.act { display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 16px; border-radius: 14px; border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.07); color: #fff; font-weight: 700; text-decoration: none; position: relative; transition: background .2s, transform .15s; }
.act:hover { background: rgba(255,255,255,.14); }
.act:active { transform: scale(.96); }
.act svg { width: 20px; height: 20px; }
.act.icon { width: 46px; padding: 0; justify-content: center; }
.act.more { background: #fff; color: var(--cinema); border-color: transparent; }
.act.more[aria-expanded="true"] { background: rgba(255,255,255,.14); color: #fff; }
.like b { font-variant-numeric: tabular-nums; min-width: 1ch; }
.like[aria-pressed="true"] { color: var(--heart); border-color: color-mix(in srgb, var(--heart) 55%, transparent); background: color-mix(in srgb, var(--heart) 14%, transparent); }
.like[aria-pressed="true"] svg { fill: var(--heart); }
.like.pop svg { animation: pop .45s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes pop { 40% { transform: scale(1.45); } }
.burst { position: absolute; left: 22px; top: 50%; width: 1px; height: 1px; pointer-events: none; }
.burst i { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: var(--heart); animation: burst .6s ease-out forwards; }
@keyframes burst { from { transform: translate(0, 0) scale(1); opacity: 1; } to { transform: translate(var(--dx), var(--dy)) scale(.2); opacity: 0; } }
.info { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); border-radius: 18px; padding: 18px; align-self: start; margin-top: 44px;
  display: grid; gap: 14px; animation: slidein .45s cubic-bezier(.2, .8, .2, 1); }
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } }
.info h3 { margin: 0 0 4px; font-size: 12.5px; font-weight: 800; color: var(--on-cinema-2); }
.info p { margin: 0; line-height: 2.05; white-space: pre-line; }
.info blockquote { margin: 0; padding: 12px 14px; border-radius: 12px; font-weight: 700; line-height: 1.9;
  background: linear-gradient(120deg, rgba(22,211,242,.14), rgba(177,46,240,.14)); border-right: 3px solid var(--c1); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin: 0; padding: 12px 0 0; border-top: 1px solid rgba(255,255,255,.1); font-size: 13.5px; }
.facts dt { color: var(--on-cinema-2); }
.facts dd { margin: 0; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.coords { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--on-cinema-2); flex-wrap: wrap; }
.coords code { direction: ltr; font-family: ui-monospace, Menlo, Consolas, monospace; color: #fff; background: rgba(255,255,255,.08); padding: 2px 8px; border-radius: 6px; user-select: all; }
.coords button { border: 1px solid rgba(255,255,255,.18); background: none; color: #fff; border-radius: 8px; padding: 2px 12px; font-size: 12px; }
.info .small { font-size: 12px; color: var(--on-cinema-2); }

@media (max-width: 900px) {
  .story.with-info .story-inner { grid-template-columns: 1fr; gap: 14px; }
  .story.with-info .stage { justify-self: stretch; margin: auto; }
  .info { margin-top: 0; animation-name: up; }
  .stage { min-height: auto; }
}
@media (max-width: 640px) {
  .brand-word { display: none; }
  .brand { padding: 0 10px; }
  .tb-btn span { display: none; }
  .tb-btn { padding: 0 13px; }
  .tb-btn.round { width: 44px; }
  .card { width: 176px; }
  .stage { padding-top: 52px; align-content: start; }
  .player { border-radius: 14px; }
  .act { height: 44px; padding: 0 13px; }
  .act.more { order: -1; flex-basis: 100%; justify-content: center; }
  .bigplay { width: 68px; height: 68px; }
  .sheet-wrap { padding: 0; place-items: end stretch; }
  .sheet { border-radius: 22px 22px 0 0; padding-bottom: calc(20px + var(--safe-b)); }
  .toast { top: calc(120px + var(--safe-t)); }
}
@media (prefers-reduced-motion: reduce) {
  .intro-new { transition: none; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
.noscript { position: fixed; inset: auto 16px 16px; z-index: 200; background: #fff; color: #10153A; padding: 12px; border-radius: 12px; }

/* ---------------- one-way messages ---------------- */
.sheet-wrap.top { z-index: 56; }
.msg-sheet form { display: grid; gap: 10px; }
.msg-ctx { margin: 0; font-size: 13px; background: color-mix(in srgb, var(--c2) 12%, transparent); color: var(--ink); border-radius: 12px; padding: 8px 12px; }
.msg-ctx b { font-weight: 800; }
.msg-lead { margin: 0; line-height: 1.9; }
.fld { display: grid; gap: 5px; position: relative; min-width: 0; }
.fld > span { font-size: 12.5px; font-weight: 700; }
.fld > span i { font-style: normal; font-weight: 400; color: var(--muted); }
.fld textarea, .fld input { width: 100%; font: inherit; color: var(--ink); background: var(--paper); border: 1.5px solid var(--line); border-radius: 14px; padding: 10px 12px; outline: none; transition: border-color .15s, box-shadow .15s; }
.fld textarea { resize: vertical; min-height: 116px; line-height: 1.9; }
.fld textarea:focus, .fld input:focus { border-color: var(--c2); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c2) 18%, transparent); }
.fld input[dir="ltr"] { text-align: left; }
.fld input[dir="ltr"]::placeholder { text-align: left; }
.fld .count { position: absolute; left: 10px; bottom: 7px; font-size: 11px; color: var(--muted); pointer-events: none; }
.fld.bad textarea, .fld.bad input { border-color: #E8553E; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ferr { margin: -4px 0 0; color: #E8553E; font-size: 12.5px; font-weight: 600; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.msg-sheet .sheet-foot { margin-top: 4px; }
#mSend[disabled] { opacity: .6; }
.msg-done { display: grid; gap: 10px; padding-top: 6px; }
.bubble { max-width: 85%; padding: 10px 14px; border-radius: 18px; line-height: 1.9; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; animation: pop .35s cubic-bezier(.2, .9, .3, 1.3) both; }
.bubble.mine { justify-self: start; background: var(--brand); color: #fff; border-bottom-right-radius: 6px; max-height: 160px; overflow: auto; }
.bubble.bot { justify-self: end; background: var(--line); color: var(--ink); border-bottom-left-radius: 6px; animation-delay: .25s; }
.bubble.bot b { display: block; font-size: 12px; color: var(--muted); font-weight: 700; margin-bottom: 2px; }
.bubble.typing { display: inline-flex; gap: 4px; padding: 14px 16px; }
.bubble.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1s infinite; }
.bubble.typing i:nth-child(2) { animation-delay: .15s; } .bubble.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.92); } }
.talk { display: flex; align-items: center; gap: 12px; width: 100%; text-align: right; border: 0; border-radius: 16px; padding: 12px 14px; margin: 4px 0 10px;
  background: var(--brand); color: #fff; box-shadow: 0 10px 24px rgba(46,80,236,.3); }
.talk svg { width: 26px; height: 26px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.talk span { display: grid; } .talk small { opacity: .85; font-size: 12px; }
.tb-btn.round svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.act#storyMsgBtn svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 480px) { .two { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .bubble, .bubble.typing i { animation: none; } }
@media (max-width: 400px) {
  .topbar { gap: 6px; }
  .brand { padding: 0 5px; }
  .tb-btn, .tb-btn.round { width: 42px; padding: 0; justify-content: center; }
  .search { padding: 0 10px; gap: 6px; }
  .search input { font-size: 14px; }
}

.closed-flag { position: fixed; z-index: 150; left: 50%; bottom: calc(10px + var(--safe-b)); transform: translateX(-50%); background: #FFF1DA; color: #8A5200;
  border: 1px solid #F6C77A; font-weight: 800; font-size: 12.5px; padding: 6px 14px; border-radius: 999px; text-decoration: none; box-shadow: var(--shadow-s); white-space: nowrap; }

/* ---------------- subtitles ---------------- */
.subtext { position: absolute; left: 50%; bottom: 62px; transform: translateX(-50%); width: max-content; max-width: 88%; z-index: 2; pointer-events: none;
  background: rgba(7, 10, 31, .72); color: #fff; font-size: clamp(14px, 2.2vw, 20px); font-weight: 600; line-height: 1.8; padding: 4px 14px; border-radius: 10px;
  white-space: pre-line; text-align: center; text-shadow: 0 1px 2px rgba(0,0,0,.6); transition: bottom .25s; unicode-bidi: plaintext; }
.player.playing.idle .subtext { bottom: 22px; }
.player:fullscreen .subtext { font-size: clamp(20px, 2.6vw, 34px); }
#cSub { position: relative; width: auto; min-width: 36px; padding: 0 6px; gap: 3px; display: inline-flex; align-items: center; }
#cSub em { font-style: normal; font-size: 11px; font-weight: 800; }
#cSub.on svg { color: #6FE3FF; }
#cSub.on::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: 3px; height: 2px; border-radius: 2px; background: #6FE3FF; }
.submenu { position: absolute; z-index: 4; bottom: 56px; right: 12px; min-width: 150px; background: rgba(18, 22, 55, .96); backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.12); border-radius: 14px; padding: 6px; display: grid; gap: 2px; box-shadow: 0 16px 40px rgba(0,0,0,.45); }
.submenu button { border: 0; background: none; color: #fff; text-align: right; padding: 8px 12px; border-radius: 9px; font-weight: 600; font-size: 14px; display: flex; justify-content: space-between; gap: 10px; }
.submenu button:hover, .submenu button:focus-visible { background: rgba(255,255,255,.1); }
.submenu button[aria-checked="true"]::after { content: "✓"; color: #6FE3FF; font-weight: 900; }

/* ---------------- nearby inside a story ---------------- */
.near-row { margin-top: 14px; }
.near-row h3 { margin: 0 0 8px; font-size: 13px; font-weight: 700; color: var(--on-cinema-2); }
.near-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.near-item { display: flex; align-items: center; gap: 10px; text-align: right; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.06);
  color: var(--on-cinema); border-radius: 14px; padding: 6px; min-width: 0; transition: background .15s, transform .15s; }
.near-item:hover { background: rgba(255,255,255,.12); transform: translateY(-1px); }
.near-item img { width: 64px; height: 42px; object-fit: cover; border-radius: 9px; flex: none; background: color-mix(in srgb, var(--cc) 40%, #000); border-bottom: 2px solid var(--cc); }
.near-item span { display: grid; min-width: 0; }
.near-item b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.near-item small { font-size: 11.5px; color: var(--on-cinema-2); }
@media (max-width: 760px) { .near-list { grid-template-columns: 1fr; } }

/* ---------------- share sheet ---------------- */
.share-sheet { display: grid; gap: 12px; }
.share-sheet .hint { margin: 0; }
#shStory { font-weight: 700; color: var(--ink); font-size: 14px; }
.share-link { display: flex; gap: 8px; }
.share-link input { flex: 1; min-width: 0; font: 13px/1 ui-monospace, monospace; color: var(--ink); background: var(--paper); border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.share-at { display: flex; gap: 8px; align-items: center; font-size: 13.5px; cursor: pointer; }
.share-at input { width: 18px; height: 18px; accent-color: #2E50EC; }
.share-apps { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.share-apps .app { display: flex; align-items: center; justify-content: center; gap: 8px; height: 46px; border-radius: 14px; font-weight: 800; text-decoration: none; border: 0; color: #fff; font-size: 14px; }
.share-apps .app i { font-style: normal; font-size: 17px; }
.share-apps .tg { background: #229ED9; } .share-apps .wa { background: #1DA851; } .share-apps .more { background: var(--ink-2); }

/* ---------------- time slider ---------------- */
.mapctl button.on { background: var(--ink); color: var(--paper); }
.timeline { position: fixed; z-index: 18; left: 50%; transform: translateX(-50%); bottom: calc(var(--strip-h, 60px) + 18px + var(--safe-b)); width: min(620px, calc(100% - 132px));
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--glass-strong); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); transition: bottom .3s; animation: up .3s; }
.tl-play { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--brand); color: #fff; display: grid; place-items: center; flex: none; box-shadow: 0 6px 16px rgba(46,80,236,.35); }
.tl-play svg { width: 18px; height: 18px; fill: #fff; stroke: none; }
.tl-play .i-pause, .timeline.playing .tl-play .i-play { display: none; }
.timeline.playing .tl-play .i-pause { display: block; }
.tl-main { flex: 1; min-width: 0; display: grid; gap: 4px; }
.tl-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.tl-head b { font-size: 14px; font-weight: 800; }
.tl-head .seg button { padding: 3px 10px; font-size: 11.5px; }
#tlRange { width: 100%; height: 22px; margin: 0; background: none; -webkit-appearance: none; appearance: none; cursor: pointer; }
#tlRange::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(to left, #2E50EC var(--p, 100%), var(--line) var(--p, 100%)); }
#tlRange::-moz-range-track { height: 6px; border-radius: 3px; background: var(--line); }
#tlRange::-moz-range-progress { height: 6px; border-radius: 3px; background: #2E50EC; }
#tlRange::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -7px; border-radius: 50%; background: #fff; border: 4px solid #2E50EC; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
#tlRange::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 4px solid #2E50EC; }
.tl-ticks { position: relative; height: 16px; margin: 0 10px; font-size: 11px; color: var(--muted); }
.tl-ticks span { position: absolute; right: calc(var(--i) * 100%); transform: translateX(50%); white-space: nowrap; }
.timeline .x { width: 34px; height: 34px; }
@media (max-width: 640px) { .timeline { width: auto; left: 64px; right: 10px; transform: none; padding: 8px 10px; gap: 8px; } .tl-play { width: 38px; height: 38px; } }

/* ---------------- latest story on the welcome screen ---------------- */
/* latest story: starts collapsed; when it opens, the logo glides up and the button glides down */
.intro { --g: 14px; }
.intro-new { position: relative; display: grid; gap: 6px; justify-items: center; align-content: start; height: 0; margin-top: calc(-1 * var(--g)); overflow: hidden;
  transition: height .9s cubic-bezier(.45, 0, .2, 1), margin-top .9s cubic-bezier(.45, 0, .2, 1); }
.intro-new.open { margin-top: 0; }
.intro-new > * { opacity: 0; transform: translateY(8px) scale(.98); transition: opacity .6s ease .45s, transform .7s cubic-bezier(.2, .9, .2, 1) .45s; }
.intro-new.open > * { opacity: 1; transform: none; }
.new-card { display: flex; align-items: center; gap: 12px; text-align: right; border: 1px solid #E3E6F6; background: #fff; border-radius: 18px; padding: 8px 8px 8px 14px;
  box-shadow: 0 10px 28px rgba(16,21,58,.10); width: min(380px, 86vw); color: #10153A; margin-top: 2px; }
.new-card img { width: 84px; height: 56px; object-fit: cover; border-radius: 12px; flex: none; background: color-mix(in srgb, var(--cc) 30%, #eee); }
.new-card span { display: grid; min-width: 0; flex: 1; }
.new-card em { font-style: normal; font-size: 11px; font-weight: 800; color: #2E50EC; }
.new-card b { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.new-card small { font-size: 12px; color: #6A71A8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.new-card i { font-style: normal; flex: none; font-size: 11px; font-weight: 800; color: #fff; background: var(--cc); border-radius: 999px; padding: 3px 10px; }
.new-more { color: #4A519A; font-size: 12.5px; font-weight: 700; padding-bottom: 4px; }
@media (max-height: 720px) { .intro-logo { width: min(190px, 50vw); } .intro { gap: 10px; --g: 10px; } }

/* ---------------- install ---------------- */
.install { position: fixed; z-index: 45; left: 50%; transform: translateX(-50%); bottom: calc(14px + var(--safe-b)); width: min(480px, calc(100% - 20px));
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--glass-strong); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); animation: up .35s; }
.install img { border-radius: 11px; flex: none; }
.install span { display: grid; flex: 1; min-width: 0; }
.install b { font-size: 14px; } .install small { font-size: 12px; color: var(--muted); }
.install .primary { padding: 9px 16px; flex: none; }
.install .x { width: 34px; height: 34px; }
.talk.ghosty { background: transparent; color: var(--ink); border: 1.5px solid var(--line); box-shadow: none; margin-top: 0; }
.talk.ghosty img { border-radius: 8px; flex: none; }
@media (max-width: 640px) {
  .ctrls { flex-wrap: wrap; row-gap: 2px; gap: 4px; padding: 30px 8px 6px; }
  .ctrls #cSeek { order: -1; flex: 1 0 100%; margin: 0 6px; }
  .ctrls .time { font-size: 11.5px; }
  .ctrls #cDur { margin-inline-end: auto; }
  .ctrls button { width: 34px; height: 34px; }
  .subtext { bottom: 76px; font-size: 14px; max-width: 92%; }
  .submenu { bottom: 48px; right: 8px; }
}

.share-link .qr-ico { width: 44px; flex: none; display: grid; place-items: center; border-radius: 12px; border: 1.5px solid var(--line); color: var(--ink); }
.share-link .qr-ico svg { width: 22px; height: 22px; }
a.act.icon { text-decoration: none; }
@media (max-width: 640px) {
  .actions { gap: 6px; }
  .act:not(.more):not(.icon) { flex: 1 1 0; min-width: 0; justify-content: center; padding: 0 8px; font-size: 13px; white-space: nowrap; }
  .act.like { flex: 0 0 auto; padding: 0 12px; }
  .act.icon { width: 42px; flex: none; }
}
@media (max-width: 420px) { #routeBtn svg, #storyMsgBtn svg { display: none; } }

/* theme switch (sun / moon / auto) */
.theme-ico .i-sun, .theme-ico .i-moon, .theme-ico .i-auto { display: none; }
:root[data-theme-mode="light"] .theme-ico .i-sun, :root[data-theme-mode="dark"] .theme-ico .i-moon, :root[data-theme-mode="auto"] .theme-ico .i-auto { display: block; }
.mapctl #themeBtn2 { display: none; }
@media (max-width: 480px) { .topbar #themeBtn { display: none; } .mapctl #themeBtn2 { display: grid; } }
html.theme-fade, html.theme-fade * { transition: background-color .45s ease, color .45s ease, border-color .45s ease !important; }
