:root{--ink:#f4f2ff;--night:#0d0a1f;--panel:rgba(20,16,44,.92);--proj:#a77bff;--mural:#ffd23f;--light:#3fe0ff;--uniq:#ff4fa3;--fac:#8f8aa8;--sz:44px}
*{box-sizing:border-box}
html,body{height:100%;margin:0;background:var(--night);color:var(--ink);font-family:"Bricolage Grotesque",system-ui,sans-serif}
#map{position:fixed;inset:0;background:#0d0a1f}
.leaflet-container{font-family:inherit}
.leaflet-control-attribution{background:rgba(13,10,31,.7)!important;color:#aaa!important}
.leaflet-control-attribution a{color:#ccc!important}
/* bar */
#bar{position:fixed;left:0;right:0;top:0;z-index:1000;padding:calc(env(safe-area-inset-top,0px) + 10px) 12px 10px;display:flex;gap:8px;align-items:center;overflow-x:auto;scrollbar-width:none;background:linear-gradient(var(--night) 40%,transparent)}
#bar::-webkit-scrollbar{display:none}
#bar h1{font-size:20px;font-weight:800;margin:0 6px 0 2px;white-space:nowrap;letter-spacing:-.02em}
.chip{flex:none;border:2px solid var(--c);background:transparent;color:var(--ink);font:600 13px/1 inherit;font-family:inherit;padding:8px 11px;border-radius:999px;cursor:pointer;display:flex;align-items:center;gap:6px}
.chip i{width:9px;height:9px;border-radius:50%;background:var(--c)}
.chip[aria-pressed=false]{opacity:.38;border-style:dashed}
.chip:focus-visible,button:focus-visible{outline:3px solid #fff;outline-offset:2px}
/* markers */
.pin{width:var(--sz);height:var(--sz);border-radius:9px;border:3px solid var(--c);background:#221b44 center/cover no-repeat;box-shadow:0 0 14px var(--c);position:relative;transition:transform .12s}

.tether{position:absolute;left:calc(var(--sz)/2);top:calc(var(--sz)/2);height:2px;margin-top:-1px;background:var(--c);opacity:.75;transform-origin:0 50%;pointer-events:none;z-index:-1;transition:width .25s ease,transform .25s ease,opacity .25s}
.tether i{position:absolute;right:-4px;top:-3px;width:8px;height:8px;border-radius:50%;background:var(--c);box-shadow:0 0 6px var(--c)}
.pin:hover{transform:scale(1.08);z-index:9}
.pinwrap,.facwrap{transition:margin .25s ease,opacity .2s}
#map.focus .pinwrap:not(.sel),#map.focus .facwrap{opacity:0}
.pinwrap:not(.sel) .tether{opacity:0!important}
.sel .tether{height:3px;margin-top:-1.5px;opacity:1}
.sel .tether i{right:-7px;top:-5.5px;width:14px;height:14px;border:2px solid #fff;box-shadow:0 0 12px var(--c);animation:beacon 1.2s ease-in-out infinite}
.spot{display:none;position:absolute;left:calc(var(--sz)/2 - var(--dx));top:calc(var(--sz)/2 - var(--dy));width:14px;height:14px;margin:-7px 0 0 -7px;border-radius:50%;background:var(--c);border:2px solid #fff;box-shadow:0 0 12px var(--c);z-index:10;pointer-events:none;animation:beacon 1.2s ease-in-out infinite}
.sel.inside .spot{display:block}
.inside .tether{opacity:0!important}
@keyframes beacon{50%{transform:scale(1.35)}}
.sel .pin span{display:block}
/* selected pin: pulsing glow and a centered "i Tap" hint that a second tap opens the card */
.sel .pin{animation:pulse 1.4s ease-in-out infinite}
@keyframes pulse{50%{box-shadow:0 0 6px 6px var(--c),0 0 28px var(--c)}}
.pin .hint{display:none;position:absolute;inset:0;z-index:2;flex-direction:column;align-items:center;justify-content:center;gap:2px;padding-top:.3em;line-height:1;border-radius:6px;background:rgba(13,10,31,.2);color:#fff;font-style:normal;font-weight:700;font-size:clamp(9px,calc(var(--sz)*.16),14px);text-shadow:0 1px 3px #000;pointer-events:none}
.sel .pin .hint{display:flex}
.hint i{display:grid;place-items:center;width:clamp(14px,calc(var(--sz)*.32),30px);height:clamp(14px,calc(var(--sz)*.32),30px);border-radius:50%;border:2px solid #fff;font-family:Georgia,serif;font-style:italic;font-size:clamp(9px,calc(var(--sz)*.2),18px);background:rgba(13,10,31,.5)}
/* #map raises specificity over Leaflet's ".leaflet-marker-pane img{width:auto}", which otherwise stretches non-square photos */
#map .pin img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:center;border-radius:6px;z-index:1}
.pin b{position:absolute;inset:0;display:grid;place-items:center;font-size:calc(var(--sz)*.32);font-weight:800;color:var(--c)}
.pin span{display:none;position:absolute;top:100%;left:50%;transform:translateX(-50%);margin-top:3px;white-space:nowrap;max-width:140px;overflow:hidden;text-overflow:ellipsis;font-size:11px;font-weight:600;background:rgba(13,10,31,.85);padding:2px 6px;border-radius:4px}
.labels .pin span{display:block}
/* focused: other pins are hidden, so a long title wraps onto more lines instead of being cut off */
#map.focus .sel .pin span{white-space:normal;width:max-content;max-width:180px;text-align:center;line-height:1.25}
/* focused: the picture is slightly see-through so the map shows underneath (border, hint and title stay solid) */
#map.focus .sel .pin{background-color:transparent}
#map.focus .sel .pin img{opacity:.55}
.fac{width:20px;height:20px;border-radius:50%;background:#2a2547;border:2px solid var(--fac);display:grid;place-items:center;font:800 9px/1 inherit;font-family:inherit;color:#ddd}
.fac svg{width:14px;height:14px;fill:#fff}
.leaflet-div-icon{background:none;border:none}
/* sheet */
#sheet{position:fixed;left:0;right:0;bottom:0;z-index:1100;background:var(--panel);backdrop-filter:blur(10px);border-top:3px solid var(--c,#fff);padding:0 16px calc(env(safe-area-inset-bottom,0px) + 16px);transform:translateY(105%);transition:transform .2s ease;max-width:560px;margin:0 auto;border-radius:16px 16px 0 0}
#sheet.open{transform:none}
#sheet{max-height:78vh;overflow-y:auto}
/* header strip: category on the left, close on the right; stays pinned while the card scrolls */
#sheet .top{position:sticky;top:0;z-index:5;display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 -16px 10px;padding:10px 10px 10px 16px;background:#16122f;border-bottom:1px solid #ffffff14}
#sheet .kind{display:flex;align-items:center;gap:7px;font-size:12px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--c)}
#sheet .kind i{width:9px;height:9px;border-radius:50%;background:var(--c);box-shadow:0 0 8px var(--c)}
#sheet button.shut{flex:none;width:36px;height:36px;padding:0;border-radius:50%;background:#3a3363;color:var(--ink);font:400 24px/1 inherit;font-family:inherit;display:grid;place-items:center}
.gal{display:flex;gap:8px;overflow-x:auto;scroll-snap-type:x mandatory;border-radius:8px}
.gal img{flex:0 0 100%;width:100%;height:46vh;object-fit:contain;background:#000;border-radius:8px;scroll-snap-align:center}
.gal.multi img{flex-basis:88%}
.arts{display:flex;flex-wrap:wrap;gap:6px;margin:6px 0 2px}
#sheet a.art{background:transparent;color:var(--ink);border:1px solid var(--c);padding:5px 10px 5px 8px;font-size:13px;display:flex;align-items:center;gap:7px;line-height:1.2}
#sheet a.art span{display:flex;flex-direction:column}
#sheet a.art .lico{flex:none;width:16px;height:16px;fill:none;stroke:var(--c);stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
#sheet a.art .lico [fill]{fill:var(--c)}
#sheet a.art small{display:block;color:#a9a3cc;font-weight:400;font-size:11px}
#sheet .sched{max-width:60ch;margin:8px 0}
#sheet .sched h3{font-size:14px;font-weight:800;color:var(--c);margin:14px 0 4px}
#sheet .sched dl{display:grid;grid-template-columns:max-content 1fr;gap:3px 12px;margin:0;font-size:14px;line-height:1.35}
#sheet .sched dt{grid-column:1;color:var(--ink);opacity:.7;white-space:nowrap}
#sheet .sched dd{grid-column:2;margin:0;font-weight:600}
#sheet .sched dd.desc{font-weight:400;font-size:13px;opacity:.85;margin-bottom:6px}
#sheet .notes{list-style:none;padding:0;margin:12px 0 4px;font-size:13px;line-height:1.4;opacity:.85;max-width:60ch}
#sheet .notes li{margin:3px 0}
/* plain text links (overrides the button look "#sheet a" gives the action row) */
#sheet .sum a,#sheet .sched a,#sheet .notes a{all:unset;color:var(--c);text-decoration:underline;text-underline-offset:2px;cursor:pointer;word-break:break-word}
#sheet p.sum{white-space:pre-line;color:var(--ink);font-size:15px;line-height:1.45;margin:8px 0 4px;max-width:60ch}
#sheet p.cat{font-size:12px;color:#a9a3cc}
#sheet .row{flex-wrap:wrap}
#sheet a.sec{background:#3a3363;color:var(--ink)}
#sheet h2{margin:12px 0 2px;font-size:22px;line-height:1.15;letter-spacing:-.01em}
#sheet p{margin:2px 0;color:#c9c4e6;font-size:14px}
#sheet .row{display:flex;gap:8px;margin-top:12px;padding-bottom:14px;border-bottom:1px solid #ffffff14}
#sheet a,#sheet button{font:600 14px inherit;font-family:inherit;color:var(--night);background:var(--c,#fff);border:0;border-radius:8px;padding:10px 14px;text-decoration:none;cursor:pointer}
#sheet button.x{background:#3a3363;color:var(--ink)}
#tools{position:fixed;right:12px;bottom:calc(env(safe-area-inset-bottom,0px) + 24px);z-index:1000;display:flex;flex-direction:column;gap:8px}
#tools svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2.6;stroke-linecap:round;display:block;margin:auto}
#tools button{width:44px;height:44px;border-radius:50%;border:0;background:var(--panel);color:var(--ink);font:800 18px inherit;font-family:inherit;cursor:pointer;box-shadow:0 2px 10px #0008}
.pics{display:flex;flex-direction:column;align-items:center;gap:4px;background:var(--panel);border-radius:22px;padding:10px 0}
.pics span{font-size:11px;font-weight:600;color:#c9c4e6}
.pics button{width:34px!important;height:34px!important;flex:none;box-shadow:none!important;font-size:13px!important;background:#3a3363!important}
#loc.on{background:#2f8bff;color:#fff}
#loc.finding{animation:locpulse 1s ease-in-out infinite alternate}
@keyframes locpulse{from{box-shadow:0 0 0 0 #2f8bffaa}to{box-shadow:0 0 0 10px #2f8bff00}}
.me{width:16px;height:16px;border-radius:50%;background:#fff;border:4px solid #2f8bff;box-shadow:0 0 0 6px #2f8bff44}
#map.dimtiles .leaflet-tile-pane{filter:invert(1) hue-rotate(180deg) brightness(.85) saturate(.4)}
a.chip{text-decoration:none}
.editbtn{--c:#fff;order:99;margin-left:auto;display:none!important}
.canedit .editbtn{display:flex!important}
/* press and hold Blunk to sign in: no text selection or phone callout */
#bar h1{user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
#editor{position:fixed;inset:0;z-index:2000;background:var(--night);overflow-y:auto;padding:calc(env(safe-area-inset-top,0px) + 12px) 14px calc(env(safe-area-inset-bottom,0px) + 30px)}
#editor[hidden]{display:none}
#editor header{display:flex;align-items:center;gap:14px;max-width:760px;margin:0 auto}
#editor header h2{margin:0;font-size:24px;letter-spacing:-.02em}
#editor .back{color:var(--ink);text-decoration:none;font-weight:600;border:2px solid #4a4280;border-radius:999px;padding:7px 12px}
.edtools{display:flex;gap:8px;flex-wrap:wrap;max-width:760px;margin:14px auto 6px}
.edtools input{flex:1 1 220px;font:inherit;font-size:16px;padding:10px 12px;border-radius:8px;border:2px solid #4a4280;background:#1a1536;color:var(--ink)}
.edtools button,.acts button{font:600 13px inherit;font-family:inherit;color:var(--ink);background:#2a2350;border:2px solid #4a4280;border-radius:8px;padding:8px 10px;cursor:pointer}
.acts button[aria-pressed=true]{border-color:var(--c);background:color-mix(in srgb,var(--c) 25%,#2a2350)}
.note{max-width:760px;margin:4px auto 12px;color:#a9a3cc;font-size:13px}
#edlist{max-width:760px;margin:0 auto;display:flex;flex-direction:column;gap:10px}
.er{display:flex;gap:12px;padding:10px;border-radius:12px;background:#17122f;border-left:4px solid var(--c)}
.er.focus{outline:2px solid var(--c)}
.opts{display:flex;gap:10px;overflow-x:auto;padding:10px 8px 4px 2px}
.tile{position:relative;flex:none;display:flex;flex-direction:column;gap:4px}
.mv{display:flex;gap:4px}
.mv button{flex:1;padding:2px 0!important;font-size:16px!important;line-height:1.2}
.mv button:disabled{opacity:.25;cursor:default}
.pinbadge{position:absolute;left:3px;bottom:3px;z-index:2;font:700 10px/1 inherit;font-family:inherit;font-style:normal;background:var(--c);color:var(--night);padding:3px 5px;border-radius:4px}
.rm{position:absolute;top:-6px;right:-6px;width:24px;height:24px;border-radius:50%;background:#e5484d;color:#fff;border:2px solid var(--night);font:800 15px/1 inherit;font-family:inherit;padding:0;z-index:2;cursor:pointer;display:grid;place-items:center}
.opt{flex:none;width:72px;height:72px;padding:0!important;border-radius:9px!important;overflow:hidden;position:relative;display:grid;place-items:center;font-weight:800;color:var(--c)!important}
.opt img{width:100%;height:100%;object-fit:cover;display:block}
.opt[aria-pressed=true]{border:3px solid var(--c)!important;box-shadow:0 0 10px var(--c)}
.er .info{flex:1}
.er .th{flex:none;width:84px;height:84px;border-radius:9px;background:#221b44 center/cover no-repeat;display:grid;place-items:center;font-weight:800;font-size:22px;color:var(--c)}
.er .info{min-width:0;width:100%;display:flex;flex-direction:column;gap:3px}
.er strong{font-size:16px;line-height:1.2}
.er small{color:#a9a3cc;font-size:12px}
.er em{color:var(--c);font-style:normal}
.acts{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}
.empty{color:#a9a3cc}
@media (prefers-reduced-motion:reduce){.pin,#sheet{transition:none}.sel .tether i,.spot{animation:none}}
/* map search: panel at the top of the screen, results scroll under the search box */
#search{position:fixed;top:0;left:0;right:0;z-index:1200;max-width:560px;margin:0 auto;display:flex;flex-direction:column;max-height:75vh;max-height:75dvh;background:var(--panel);backdrop-filter:blur(10px);border-bottom:3px solid #fff;border-radius:0 0 14px 14px;box-shadow:0 8px 30px #000a;padding-top:env(safe-area-inset-top,0px)}
#search[hidden]{display:none}
#search .top{display:flex;align-items:center;gap:10px;padding:10px 10px 10px 12px;border-bottom:1px solid #ffffff14}
#fq{flex:1;min-width:0;font:400 16px inherit;font-family:inherit;color:var(--ink);background:#221b44;border:1px solid #4a4280;border-radius:999px;padding:10px 14px}
#search button.shut{flex:none;width:36px;height:36px;padding:0;border:0;border-radius:50%;background:#3a3363;color:var(--ink);font:400 24px/1 inherit;font-family:inherit;display:grid;place-items:center;cursor:pointer}
#fres{overflow-y:auto;padding:8px;display:flex;flex-direction:column;gap:6px;overscroll-behavior:contain}
#fres .empty{color:#a9a3cc;padding:12px;margin:0}
.fr{all:unset;box-sizing:border-box;display:flex;gap:12px;align-items:center;padding:8px;border-radius:10px;background:#17122f;border-left:4px solid var(--c);cursor:pointer}
.fr:focus-visible{outline:2px solid #fff}
.fr .th{flex:none;width:52px;height:52px;border-radius:8px;overflow:hidden;background:#221b44;display:grid;place-items:center;font-weight:800;font-size:16px;color:var(--c)}
#fres .th img{width:100%;height:100%;object-fit:cover;display:block}
.fr .info{min-width:0;display:flex;flex-direction:column;gap:2px}
.fr strong{font-size:15px;line-height:1.2;color:var(--ink)}
.fr small{color:#a9a3cc;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.fr em{color:var(--c);font-style:normal;font-size:12px}
/* editor: credit links per pin (artist, current link, Change link) */
.links{display:flex;flex-direction:column;gap:4px;margin-top:8px;font-size:13px}
.lk{display:flex;flex-wrap:wrap;align-items:center;gap:4px 10px}
.lk .who{font-weight:600}
.lk a{color:var(--c);word-break:break-all}
.lk em{color:var(--c);font-style:normal;font-size:12px}
.lk button{margin-left:auto;font:600 12px inherit;font-family:inherit;color:var(--ink);background:#2a2350;border:2px solid #4a4280;border-radius:8px;padding:5px 9px;cursor:pointer}
