/* =============================================================
   Base: tokens, type, navigation, buttons, forms, dialogs, toasts.

   Look: quiet noir. Near-black, warm off-white, one red accent
   used sparingly. Instrument Serif for display, Inter for the
   interface. Frosted glass panels with hairline borders and soft
   layered shadows. Motion is transform / opacity only, on one
   ease-out curve, 200 to 500 ms.
   ============================================================= */

:root {
  --bg: #0b0a09;
  --surface: #141210;
  --surface-2: #1b1917;
  --surface-3: #262321;
  --glass: rgba(24, 22, 20, .78);
  --glass-solid: rgba(26, 24, 22, .96);
  --hairline: rgba(255, 246, 234, .09);
  --hairline-2: rgba(255, 246, 234, .17);
  --fill: rgba(255, 246, 234, .07);
  --fill-2: rgba(255, 246, 234, .13);
  --text: #f4efe7;
  --text-2: rgba(244, 239, 231, .64);
  --text-3: rgba(244, 239, 231, .4);
  --accent: #c8323a;
  --accent-hi: #ee6468;
  --ok: #5fc586;
  --serif: "Instrument Serif", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --blur: saturate(180%) blur(24px);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .28), 0 10px 28px -10px rgba(0, 0, 0, .55);
  --shadow-2: 0 2px 6px rgba(0, 0, 0, .3), 0 28px 64px -18px rgba(0, 0, 0, .75);
  --nav-h: 52px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.5 var(--sans);
  letter-spacing: -.006em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
body[data-page="map"] { overflow: hidden; }
body.menu-open { overflow: hidden; }
button, input, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 400; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
::selection { background: rgba(200, 50, 58, .5); color: #fff; }
:focus-visible { outline: 2px solid rgba(244, 239, 231, .8); outline-offset: 2px; }
* { scrollbar-width: thin; scrollbar-color: rgba(255, 246, 234, .18) transparent; }

.ico { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.kicker { font: 500 13px/1.3 var(--sans); color: var(--text-3); }
.kicker.ink { color: var(--text-3); }
.spacer { flex: 1; }
.hint { color: var(--text-3); }

/* entrance: anything with data-enter rises in, staggered by --i */
[data-enter] { animation: enter .6s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 70ms + 40ms); }
@keyframes enter { from { opacity: 0; transform: translate3d(0, 14px, 0); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------ pages ------------------------------ */
.page { display: none; }
.page.active { display: block; }
.veil { position: fixed; inset: 0; z-index: 40; background: var(--bg); opacity: 0; pointer-events: none; transition: opacity .19s ease; }
.veil.on { opacity: 1; }

/* ---------------------- title card and welcome ----------------------
   One full-screen card. First visit: it asks for a name (one box, Enter).
   Return visits: a short title card, once per browser session. */
.splash { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: var(--bg); transition: opacity .6s var(--ease); }
.splash.lift { opacity: 0; pointer-events: none; }
.splash-inner { width: min(820px, 100%); padding: 0 24px 6vh; text-align: center; transition: transform .7s var(--ease); }
.splash.lift .splash-inner { transform: scale(1.04); }
.splash-tag { font: 500 14px/1.4 var(--sans); color: var(--text-3); opacity: 0; }
.splash-rule { display: none; }
.splash-name { margin-top: 14px; font: 400 clamp(44px, 7.4vw, 88px)/1.04 var(--serif); letter-spacing: -.022em; }
.splash-name.long { font-size: clamp(36px, 5.6vw, 68px); }
.splash-name .w { display: inline-block; overflow: hidden; padding: .06em .04em .2em; margin: -.06em -.04em -.2em; vertical-align: top; white-space: nowrap; }
.splash-name i { display: inline-block; font-style: normal; opacity: 0; transform: translate3d(0, 60%, 0); }
.splash.play .splash-tag { animation: tag-in .6s .1s var(--ease) forwards; }
.splash.play .splash-name i { animation: word-up .7s var(--ease) forwards; animation-delay: calc(var(--i) * 60ms + 120ms); }
.splash.greet .splash-name i { animation-delay: calc(var(--i) * 60ms); }
@keyframes tag-in { to { opacity: 1; } }
@keyframes word-up { to { opacity: 1; transform: none; } }
.welcome { margin: 40px auto 0; width: min(400px, 100%); animation: enter .6s .5s var(--ease) backwards; transition: opacity .3s var(--ease), transform .4s var(--ease); }
.welcome.gone { opacity: 0; transform: translate3d(0, 8px, 0); pointer-events: none; }
.welcome-field { position: relative; display: flex; align-items: center; height: 56px; padding: 0 8px 0 24px; border: 1px solid var(--hairline-2); border-radius: 999px; background: var(--fill); transition: border-color .25s var(--ease), background-color .25s var(--ease); }
.welcome-field:focus-within { border-color: rgba(244, 239, 231, .5); background: var(--fill-2); }
.welcome-field input { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; outline: none; background: none; color: var(--text); font: 400 17px var(--sans); caret-color: var(--accent-hi); }
.welcome-field input::placeholder { color: var(--text-3); }
.welcome-field button { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--text); color: var(--bg); font-size: 17px; transition: transform .25s var(--ease), background-color .2s; }
.welcome-field button:hover { background: #fff; transform: scale(1.05); }
.welcome-field button:active { transform: scale(.94); }
.welcome-field button .ico { stroke-width: 2; }
.welcome-hint { margin-top: 16px; text-wrap: balance; font-size: 13px; line-height: 1.5; color: var(--text-3); transition: color .2s; }
.welcome.shake .welcome-field { animation: shake .4s var(--ease); border-color: var(--accent-hi); }
.welcome.shake .welcome-hint { color: var(--accent-hi); }
@keyframes shake { 20% { transform: translate3d(-7px, 0, 0); } 45% { transform: translate3d(6px, 0, 0); } 70% { transform: translate3d(-3px, 0, 0); } }

/* ---------------------------- navigation ----------------------------
   A full-width frosted bar. The active page is a sliding segment. */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50; height: var(--nav-h);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; padding: 0 20px;
  border-bottom: 1px solid var(--hairline);
  background: rgba(11, 10, 9, .74);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  transition: transform .5s var(--ease), opacity .5s var(--ease), background-color .3s var(--ease);
}
.nav.condensed { background: rgba(11, 10, 9, .86); }
body.booting .nav { opacity: 0; transform: translate3d(0, -12px, 0); }

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; justify-self: start; }
.brand-text { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.brand-text b { font: 400 21px/1 var(--serif); letter-spacing: -.01em; white-space: nowrap; }
.brand-text small { font-size: 13px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-mark { display: grid; place-items: center; flex: none; }
.brand-logo { height: 28px; width: auto; display: block; }
.brand-mono { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--fill-2); font: 600 11px var(--sans); }

.nav-links { position: relative; display: flex; align-items: center; height: 36px; padding: 3px; border-radius: 999px; background: var(--fill); }
.nav-links a { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; gap: 7px; width: 148px; height: 30px; border-radius: 999px; font-weight: 500; font-size: 13.5px; color: var(--text-2); transition: color .25s var(--ease); }
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-ico, .nav-hover { display: none; }
.nav-count { font-style: normal; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--text-3); }
.nav-count:empty { display: none; }
.nav-ind { position: absolute; left: 0; top: 3px; height: 30px; border-radius: 999px; background: rgba(255, 246, 234, .15); box-shadow: 0 1px 3px rgba(0, 0, 0, .35); opacity: 0; pointer-events: none; transition: transform .45s var(--ease), opacity .3s var(--ease); }

.nav-right { display: flex; align-items: center; gap: 8px; justify-self: end; }
.live { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border: 0; border-radius: 999px; background: none; font-size: 13px; font-weight: 500; color: var(--text-2); transition: background-color .2s var(--ease), color .2s var(--ease); }
.live:hover, .live[aria-expanded="true"] { background: var(--fill); color: var(--text); }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); flex: none; }
.live[data-state="live"] .live-dot, .live-dot[data-state="live"] { background: var(--ok); }
.live[data-state="connecting"] .live-dot, .live-dot[data-state="connecting"] { animation: dot-blink 1.2s ease-in-out infinite; }
.live[data-state="reconnecting"] .live-dot, .live-dot[data-state="reconnecting"] { background: var(--accent-hi); animation: dot-blink 1.2s ease-in-out infinite; }
@keyframes dot-blink { 50% { opacity: .25; } }
.live-faces { display: flex; }
.live-faces:empty { display: none; }
.live-faces .face { margin-left: -6px; width: 22px; height: 22px; font-size: 9px; box-shadow: 0 0 0 1.5px var(--bg); }
.live-faces .face:first-child { margin-left: 0; }
.face { display: inline-grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-3); color: var(--text); font: 600 9.5px/1 var(--sans); letter-spacing: .01em; }
.face.more { color: var(--text-2); }
.live-pop { position: absolute; top: calc(100% + 8px); right: 12px; width: 300px; padding: 16px; border: 1px solid var(--hairline-2); border-radius: 16px; background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: var(--shadow-2); animation: pop-in .3s var(--ease) backwards; transform-origin: 90% 0; }
.live-pop ul { list-style: none; margin: 12px 0; padding: 0; display: grid; gap: 8px; max-height: 220px; overflow: auto; }
.live-pop li { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.live-pop li em { margin-left: auto; font-size: 12px; font-style: normal; color: var(--text-3); }
.live-pop p { font-size: 13px; line-height: 1.5; color: var(--text-2); border-top: 1px solid var(--hairline); padding-top: 12px; }
@keyframes pop-in { from { opacity: 0; transform: translate3d(0, -6px, 0) scale(.97); } }
.nav-progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: var(--accent-hi); transform: scaleX(0); transform-origin: 0 50%; transition: transform .12s linear; }

.burger { display: none; position: relative; width: 36px; height: 36px; border: 0; border-radius: 50%; background: none; }
.burger i { position: absolute; left: 9px; right: 9px; height: 1.5px; background: var(--text); border-radius: 2px; transition: transform .35s var(--ease); }
.burger i:nth-child(1) { top: 14px; } .burger i:nth-child(2) { display: none; } .burger i:nth-child(3) { top: 21px; }
.burger.open i:nth-child(1) { transform: translate3d(0, 3.5px, 0) rotate(45deg); }
.burger.open i:nth-child(3) { transform: translate3d(0, -3.5px, 0) rotate(-45deg); }

/* full-screen menu for phones */
.menu { position: fixed; inset: 0; z-index: 45; visibility: hidden; opacity: 0; background: rgba(11, 10, 9, .86); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); transition: opacity .35s var(--ease), visibility 0s .35s; }
.menu.open { opacity: 1; visibility: visible; transition: opacity .35s var(--ease), visibility 0s; }
.menu-inner { display: flex; flex-direction: column; height: 100%; padding: calc(var(--nav-h) + 40px) 24px calc(32px + env(safe-area-inset-bottom)); }
.menu-kicker { margin-bottom: 8px; font-size: 13px; font-weight: 500; color: var(--text-3); }
.menu-link { display: flex; align-items: baseline; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--hairline); color: var(--text-2); opacity: 0; transform: translate3d(0, 14px, 0); transition: opacity .45s var(--ease), transform .5s var(--ease), color .2s; }
.menu-link small { display: none; }
.menu-link span { font: 400 44px/1.1 var(--serif); letter-spacing: -.02em; }
.menu-link em { margin-left: auto; font-size: 15px; font-style: normal; font-variant-numeric: tabular-nums; color: var(--text-3); }
.menu-link.active { color: var(--text); }
.menu-foot { margin-top: auto; display: grid; gap: 12px; opacity: 0; transition: opacity .45s var(--ease) .2s; }
.menu-status { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-2); }
.menu-me { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-2); }
.menu-me:empty { display: none; }
.menu.open .menu-link { opacity: 1; transform: none; }
.menu.open .menu-link:nth-of-type(1) { transition-delay: .08s; }
.menu.open .menu-link:nth-of-type(2) { transition-delay: .14s; }
.menu.open .menu-foot { opacity: 1; }

/* ------------------------------ buttons ------------------------------ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 16px; border: 0; border-radius: 999px; background: none; font-weight: 500; font-size: 14px; white-space: nowrap; transition: transform .2s var(--ease), background-color .2s var(--ease), color .2s var(--ease), opacity .2s; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .4; pointer-events: none; }
.btn .ico { font-size: 15px; }
.btn.primary { background: var(--text); color: var(--bg); font-weight: 600; }
.btn.primary:hover { background: #fff; }
.btn.ghost, .btn.on-paper { background: var(--fill); color: var(--text); }
.btn.ghost:hover, .btn.on-paper:hover { background: var(--fill-2); }
.btn.ghost.on { background: var(--text); color: var(--bg); }
.btn.ghost.danger { color: var(--accent-hi); }
.btn.ghost.danger:hover { background: rgba(200, 50, 58, .2); }
.btn.danger:not(.ghost) { background: var(--accent); color: #fff; font-weight: 600; }
.btn.danger:not(.ghost):hover { background: #d63a43; }
.btn.small { height: 30px; padding: 0 12px; font-size: 13px; gap: 6px; }
.btn.small .ico { font-size: 14px; }
.btn.big { height: 44px; padding: 0 22px; font-size: 15px; }
.btn.wide { width: 100%; }
.btn.glass { background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: inset 0 0 0 1px var(--hairline-2), var(--shadow-1); }
.btn.glass:hover { background: rgba(44, 41, 38, .78); }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; flex: none; border: 0; border-radius: 50%; background: var(--fill); color: var(--text); font-size: 15px; transition: transform .2s var(--ease), background-color .2s var(--ease); }
.icon-btn:hover { background: var(--fill-2); }
.icon-btn:active { transform: scale(.92); }
.icon-btn.danger { color: var(--accent-hi); }
.icon-btn.danger:hover { background: rgba(200, 50, 58, .2); }

/* chips, category badges, tags */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 2px 16px; scrollbar-width: none; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chips.center { justify-content: center; }
.chip { display: inline-flex; align-items: center; gap: 7px; flex: none; height: 32px; padding: 0 13px 0 6px; border: 0; border-radius: 999px; background: var(--fill); color: var(--text-2); font-size: 13px; font-weight: 500; transition: color .2s var(--ease), background-color .2s var(--ease), transform .2s var(--ease); }
.chip[data-cat="All"] { padding-left: 14px; }
.chip:hover { background: var(--fill-2); color: var(--text); }
.chip:active { transform: scale(.96); }
.chip em { font-style: normal; font-size: 12px; font-variant-numeric: tabular-nums; opacity: .55; }
.chip.active { background: var(--text); color: var(--bg); }
.chip .enamel { width: 20px; height: 20px; }
.chip .enamel .ico { width: 11px; height: 11px; stroke-width: 2.2; }
.enamel { display: inline-grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--c, #8b8d98); color: var(--ink, #fff); }
.enamel .ico { width: 13px; height: 13px; stroke-width: 2; }
.enamel.tiny { width: 18px; height: 18px; }
.enamel.tiny .ico { width: 10px; height: 10px; stroke-width: 2.4; }
.tag { display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 11px 0 4px; border-radius: 999px; background: var(--fill); font-size: 13px; font-weight: 500; color: var(--text-2); }
.tag.brass { padding-left: 9px; }
.tag .ico { width: 13px; height: 13px; }

/* forms */
.label { display: block; margin: 20px 0 8px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.label em { margin-left: 6px; font-style: normal; color: var(--text-3); }
.field { width: 100%; height: 44px; padding: 0 14px; border: 1px solid transparent; border-radius: 12px; background: var(--fill); color: var(--text); font-size: 15px; outline: none; transition: border-color .2s var(--ease), background-color .2s var(--ease); }
textarea.field { height: auto; padding: 12px 14px; line-height: 1.5; resize: vertical; min-height: 96px; }
.field::placeholder, .search input::placeholder { color: var(--text-3); }
.field:hover { background: var(--fill-2); }
.field:focus { border-color: rgba(244, 239, 231, .45); background: var(--fill-2); }
.search { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border: 1px solid transparent; border-radius: 999px; background: var(--fill); color: var(--text-3); transition: border-color .2s var(--ease), background-color .2s var(--ease); }
.search:focus-within { border-color: rgba(244, 239, 231, .4); background: var(--fill-2); color: var(--text-2); }
.search span { display: grid; }
.search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; color: var(--text); font-size: 14px; }
.search input::-webkit-search-cancel-button { filter: invert(.8); }
.form-error { margin-top: 12px; font-size: 13px; color: var(--accent-hi); }
.form-error:empty { display: none; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; font-weight: 500; color: var(--text-2); user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch i { position: relative; width: 38px; height: 22px; border-radius: 999px; background: var(--fill-2); transition: background-color .25s var(--ease); }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .4); transition: transform .3s var(--ease); }
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { transform: translateX(16px); }
.switch input:focus-visible + i { outline: 2px solid rgba(244, 239, 231, .8); outline-offset: 2px; }

/* ------------------------------ dialogs ------------------------------ */
.modal-wrap { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; }
.modal-scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); animation: fade-in .3s var(--ease) backwards; }
.modal { position: relative; width: min(500px, 100%); max-height: calc(100dvh - 40px); overflow: auto; padding: 28px; border: 1px solid var(--hairline-2); border-radius: 22px; background: rgba(28, 26, 24, .82); -webkit-backdrop-filter: saturate(180%) blur(32px); backdrop-filter: saturate(180%) blur(32px); box-shadow: var(--shadow-2); animation: modal-in .4s var(--ease) backwards; }
.modal-wrap.closing { pointer-events: none; }
.modal-wrap.closing .modal { animation: modal-out .19s ease forwards; }
.modal-wrap.closing .modal-scrim { animation: fade-out .19s ease forwards; }
@keyframes modal-in { from { opacity: 0; transform: translate3d(0, 10px, 0) scale(.97); } }
@keyframes modal-out { to { opacity: 0; transform: scale(.98); } }
.modal-title { font: 400 30px/1.1 var(--serif); letter-spacing: -.012em; margin: 6px 0 12px; overflow-wrap: anywhere; }
.modal-text { color: var(--text-2); font-size: 15px; line-height: 1.55; }
.modal-text b { color: var(--text); font-weight: 600; }
.modal-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.modal-confirm { width: min(400px, 100%); text-align: center; }
.modal-confirm .modal-actions { justify-content: center; }
.modal-confirm .modal-actions .btn { flex: 1 1 0; height: 40px; }
.confirm-icon { display: grid; place-items: center; width: 48px; height: 48px; margin: 0 auto 16px; border-radius: 50%; background: var(--fill); color: var(--text); font-size: 20px; }
.confirm-icon.danger { color: var(--accent-hi); background: rgba(200, 50, 58, .16); }
.modal-pin { width: min(540px, 100%); }
.modal-lightbox { width: auto; max-width: 94vw; padding: 0; border: 0; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none; overflow: visible; }
.modal-lightbox img { display: block; max-width: 94vw; max-height: 86dvh; border-radius: 14px; box-shadow: var(--shadow-2); }
.lightbox-close { position: absolute; top: 12px; right: 12px; z-index: 2; background: rgba(11, 10, 9, .6); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.picker-or { display: flex; align-items: center; gap: 12px; margin: 20px 0 12px; font-size: 13px; color: var(--text-3); }
.picker-or::before, .picker-or::after { content: ""; flex: 1; height: 1px; background: var(--hairline); }
.photo-field { display: flex; align-items: center; gap: 12px; }
.photo-drop { display: grid; place-items: center; align-content: center; gap: 4px; width: 168px; height: 104px; flex: none; overflow: hidden; border: 1px dashed var(--hairline-2); border-radius: 12px; background: var(--fill); color: var(--text-2); font-size: 13px; text-align: center; cursor: pointer; transition: border-color .2s var(--ease), background-color .2s var(--ease), opacity .2s; }
.photo-drop > .ico { font-size: 18px; color: var(--text-3); }
.photo-drop small { display: block; font-size: 12px; color: var(--text-3); }
.photo-drop img { width: 100%; height: 100%; object-fit: cover; }
.photo-drop.dragover, .photo-drop:hover { border-color: rgba(244, 239, 231, .45); background: var(--fill-2); }
.photo-drop.busy { opacity: .45; }
.photo-actions { display: grid; gap: 6px; }
.pf-where { display: inline-flex; align-items: center; gap: 6px; margin-right: auto; font-size: 13px; color: var(--text-3); }
.pf-alert, .ed-alert { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; margin-bottom: 8px; border-radius: 14px; background: rgba(200, 50, 58, .16); color: var(--text); font-size: 14px; line-height: 1.5; animation: enter .4s var(--ease) backwards; }
.pf-alert > .ico, .ed-alert > .ico { margin-top: 2px; color: var(--accent-hi); font-size: 17px; }
.pf-alert p, .ed-alert p { flex: 1; }

/* ------------------------------- toasts ------------------------------- */
.toasts { position: fixed; left: 50%; bottom: 24px; z-index: 90; display: flex; flex-direction: column; gap: 8px; width: min(420px, calc(100vw - 24px)); transform: translateX(-50%); pointer-events: none; }
body:has(.modal-wrap) .toasts { top: 12px; bottom: auto; flex-direction: column-reverse; }   /* never over a dialog's buttons */
.toast { position: relative; display: flex; align-items: center; gap: 10px; padding: 10px 8px 10px 12px; border: 1px solid var(--hairline-2); border-radius: 16px; background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: var(--shadow-1); font-size: 14px; line-height: 1.4; pointer-events: auto; animation: toast-in .45s var(--ease) backwards; }
.toast-icon { display: grid; flex: none; color: var(--text-2); font-size: 16px; }
.toast.warn .toast-icon { color: var(--accent-hi); }
.toast-text { flex: 1; min-width: 0; color: var(--text-2); }
.toast-text b { color: var(--text); font-weight: 600; }
.toast-action { flex: none; height: 28px; padding: 0 12px; border: 0; border-radius: 999px; background: var(--fill-2); color: var(--text); font-size: 13px; font-weight: 500; transition: background-color .2s var(--ease); }
.toast-action:hover { background: rgba(255, 246, 234, .22); }
.toast-x { display: grid; place-items: center; flex: none; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--text-3); font-size: 13px; transition: color .2s, background-color .2s; }
.toast-x:hover { color: var(--text); background: var(--fill); }
.toast-timer { display: none; }
.toast.leaving { animation: toast-out .26s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translate3d(0, 12px, 0) scale(.97); } }
@keyframes toast-out { to { opacity: 0; transform: scale(.97); } }

/* -------------------------- category manager -------------------------- */
.link-btn { display: inline-flex; align-items: center; gap: 6px; flex: none; height: 32px; padding: 0 12px; border: 0; border-radius: 999px; background: none; box-shadow: inset 0 0 0 1px var(--hairline-2); color: var(--text-2); font-size: 13px; font-weight: 500; transition: color .2s var(--ease), background-color .2s var(--ease), transform .2s var(--ease); }
.link-btn:hover { color: var(--text); background: var(--fill); }
.link-btn:active { transform: scale(.96); }
.link-btn .ico { font-size: 14px; }
.modal-cats { width: min(560px, 100%); }
.cat-list { display: grid; gap: 2px; margin: 16px -8px 0; }
.cat-row { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 14px; background: none; transition: background-color .2s var(--ease), transform .25s var(--ease), box-shadow .2s; }
.cat-list.enter .cat-row { animation: enter .45s var(--ease) backwards; animation-delay: calc(var(--i) * 30ms + 40ms); }
.cat-row:hover { background: var(--fill); }
.cat-row.dragging { z-index: 2; background: var(--surface-3); box-shadow: var(--shadow-1); transform: scale(1.015); }
.cat-row .enamel { width: 30px; height: 30px; }
.cat-row .enamel .ico { width: 16px; height: 16px; stroke-width: 1.8; }
.cat-grip { display: grid; place-items: center; width: 24px; height: 32px; flex: none; padding: 0; border: 0; background: none; color: var(--text-3); font-size: 16px; cursor: grab; touch-action: none; transition: color .2s; }
.cat-grip:hover { color: var(--text); }
.cat-row.dragging .cat-grip { cursor: grabbing; }
.cat-main { flex: 1; min-width: 0; padding: 0; border: 0; background: none; text-align: left; }
.cat-main b { display: block; font-size: 15px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-main small { display: block; margin-top: 1px; font-size: 13px; color: var(--text-3); }
.cat-ed-head { display: flex; align-items: center; gap: 14px; }
.cat-ed-head .modal-title { margin: 2px 0 0; }
.cat-preview { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; min-height: 84px; margin-top: 20px; padding: 16px 20px; border-radius: 16px; background: rgba(0, 0, 0, .28); }
.cat-demo-pin { display: grid; place-items: center; width: 44px; }
.cat-demo-pin .pin-svg { width: 40px; height: 44px; }
.file-tab.demo { position: static; background: var(--fill); }
.swatches { display: grid; grid-template-columns: repeat(8, 1fr); gap: 10px; justify-items: center; }
.swatch { position: relative; width: 100%; max-width: 34px; aspect-ratio: 1; padding: 0; border: 0; border-radius: 50%; background: var(--c); transition: transform .25s var(--ease); }
.swatch:hover { transform: scale(1.1); }
.swatch.active { outline: 2px solid var(--text); outline-offset: 3px; }
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 2px; height: 238px; margin-top: 10px; padding: 8px; overflow-y: auto; border-radius: 16px; background: rgba(0, 0, 0, .28); overscroll-behavior: contain; align-content: start; }
.icon-group { grid-column: 1 / -1; padding: 12px 6px 4px; font-size: 12px; font-weight: 600; color: var(--text-3); }
.icon-group:first-child { padding-top: 2px; }
.icon-cell { display: grid; place-items: center; aspect-ratio: 1; padding: 0; border: 0; border-radius: 10px; background: none; color: var(--text-2); font-size: 19px; transition: background-color .15s, color .15s; }
.icon-cell:hover { background: var(--fill-2); color: var(--text); }
.icon-cell.active { background: var(--c); color: var(--ink); }
.icon-none { grid-column: 1 / -1; padding: 32px 12px; text-align: center; color: var(--text-3); font-size: 14px; }
.modal-catdel .label { margin-top: 20px; }
.page-loader.small { padding: 64px 0; }

/* --------------------------- empty and loading --------------------------- */
.empty { max-width: 420px; margin: 0 auto; padding: 72px 20px; text-align: center; }
.empty-art { display: grid; place-items: center; margin: 0 auto 16px; color: var(--text-3); font-size: 30px; }
.empty-art.big { font-size: 40px; margin-bottom: 20px; }
.empty-art .ico { stroke-width: 1.25; }
.empty-art .pin-svg { width: 36px; height: 40px; }
.empty h3 { font: 400 32px/1.1 var(--serif); letter-spacing: -.012em; margin-bottom: 10px; }
.empty p { color: var(--text-2); line-height: 1.55; margin-bottom: 24px; }
.empty.small { padding: 32px 8px; }
.empty.small .empty-art { font-size: 24px; margin-bottom: 12px; }
.empty.small h3 { font-size: 24px; margin-bottom: 6px; }
.empty.small p { font-size: 14px; margin-bottom: 0; }
.loader-ring { position: relative; display: block; width: 28px; height: 28px; border: 1.5px solid var(--hairline-2); border-radius: 50%; }
.loader-ring i { position: absolute; inset: -1.5px; border: 1.5px solid transparent; border-top-color: var(--text); border-radius: 50%; animation: spin .8s linear infinite; }
.page-loader, .map-loading { display: grid; place-items: center; align-content: center; gap: 14px; font-size: 13px; color: var(--text-3); }
.page-loader { padding: 140px 0; }

/* ------------------------------- phones ------------------------------- */
@media (max-width: 820px) {
  .nav { grid-template-columns: 1fr auto; padding: 0 8px 0 16px; }
  .nav-links, .live-faces, .brand-text small { display: none; }
  .burger { display: block; }
  .brand-text b { font-size: 20px; }
  .live-pop { right: 8px; left: 8px; width: auto; }
  .toasts { top: calc(var(--nav-h) + 8px); bottom: auto; flex-direction: column-reverse; }
  @keyframes toast-in { from { opacity: 0; transform: translate3d(0, -12px, 0) scale(.97); } }
  .modal-wrap { align-items: end; padding: 0; }
  .modal { width: 100%; max-height: 92dvh; border-width: 1px 0 0; border-radius: 24px 24px 0 0; padding: 24px 20px calc(24px + env(safe-area-inset-bottom)); background: var(--glass-solid); -webkit-backdrop-filter: none; backdrop-filter: none; animation: sheet-in .45s var(--ease) backwards; }
  .modal-wrap.closing .modal { animation: sheet-out .19s ease forwards; }
  .modal-lightbox { align-self: center; margin: auto; background: none; animation: modal-in .4s var(--ease) backwards; }
  @keyframes sheet-in { from { transform: translate3d(0, 100%, 0); } }
  @keyframes sheet-out { to { transform: translate3d(0, 100%, 0); } }
  .photo-drop { width: 132px; }
}
@media (max-width: 380px) { .live-text { display: none; } }

/* ---------------------------- reduced motion ---------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; transition-delay: 0s !important; scroll-behavior: auto !important; }
}
