/* Places. Wide screens: a side column beside the map. Phones (under 860px): the map fills the screen,
   search floats on top and the list is a sheet that slides up from the bottom. */
:root {
  --bg: #10141c; --card: #181e2a; --card2: #1f2635; --line: #2a3243; --text: #eef1f6; --dim: #9aa3b5;
  --acc: #ff6a4d; --acc-ink: #1a0d09; --blue: #2f8cff; --danger: #ff5d5d; --side: 404px; --sheet: 0px;
  --st: env(safe-area-inset-top, 0px); --sb: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif; overflow: hidden; overscroll-behavior: none; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
h1, h2, h3, p, ul { margin: 0; padding: 0; }
ul { list-style: none; }
a { color: var(--blue); text-decoration: none; }
.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

#map { position: fixed; inset: 0 0 0 var(--side); background: #dfe6ea; }
.side { position: fixed; inset: 0 auto 0 0; width: var(--side); display: flex; flex-direction: column; background: var(--bg); border-right: 1px solid var(--line); z-index: 4; }
.top { padding: 14px 14px 10px; border-bottom: 1px solid var(--line); }
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.brand { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0; font-weight: 700; font-size: 18px; letter-spacing: -.01em; }
.brand img { width: 28px; height: 28px; border-radius: 8px; }
.brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search { order: 3; width: 100%; display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 0 10px; height: 44px; color: var(--dim); }
.search:focus-within { border-color: var(--blue); }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--text); font-size: 16px; height: 100%; -webkit-appearance: none; appearance: none; }
.search input::-webkit-search-cancel-button { display: none; }
.search.solo { order: 0; }
.clr { color: var(--dim); display: grid; place-items: center; width: 30px; height: 30px; }
.icon-btn { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; color: var(--text); background: var(--card); border: 1px solid var(--line); flex: none; }
.icon-btn.sm { width: 36px; height: 36px; background: none; border: 0; color: var(--dim); }
.icon-btn:hover { background: var(--card2); }

.chips { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.seg { display: inline-flex; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 3px; flex: none; }
.seg button { padding: 6px 12px; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--dim); white-space: nowrap; }
.seg button.on { background: var(--text); color: #10141c; }
.seg.two { display: flex; border-radius: 12px; }
.seg.two button { flex: 1; border-radius: 9px; padding: 9px 10px; font-size: 14.5px; }
.seg.ro button:not(.on) { opacity: .45; }
.chip { display: inline-flex; align-items: center; gap: 6px; flex: none; height: 36px; padding: 0 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: 13.5px; font-weight: 600; white-space: nowrap; color: var(--text); }
.chip .ico { width: 16px; height: 16px; }
.chip.on { border-color: var(--text); }
.chip.has { border-color: var(--acc); color: var(--acc); }
.dot { width: 11px; height: 11px; border-radius: 50%; flex: none; display: inline-block; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .55); }

.panel { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.grab { display: none; }
.panel-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 12px 14px calc(22px + var(--sb)); overscroll-behavior: contain; }

.count { display: flex; align-items: center; gap: 12px; color: var(--dim); font-size: 13.5px; padding: 2px 2px 8px; flex-wrap: wrap; }
.count strong { color: var(--text); font-size: 15px; margin-right: -8px; }
.grow { flex: 1; }
.link { color: var(--blue); font-size: 13.5px; font-weight: 600; }
.empty { color: var(--dim); padding: 22px 6px; text-align: center; }
.rows li + li { border-top: 1px solid var(--line); }
.row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 10px 4px; border-radius: 10px; }
.row:hover { background: var(--card); }
.kind { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--card2); border: 2.5px solid transparent; color: #fff; }
.kind.want { background: transparent; color: var(--text); border-color: var(--dim); }
.kind.big { width: 46px; height: 46px; border-radius: 14px; }
.kind.big .ico { width: 24px; height: 24px; }
.rt { min-width: 0; flex: 1; display: block; }
.rt b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rt small { display: block; color: var(--dim); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 12px; background: var(--acc); color: var(--acc-ink); font-weight: 700; font-size: 15px; border: 1px solid transparent; text-align: center; }
.btn.ghost { background: var(--card); color: var(--text); border-color: var(--line); font-weight: 600; }
.btn.danger { background: none; color: var(--danger); border-color: rgba(255, 93, 93, .4); font-weight: 600; }
.btn.danger.armed, .btn.armed { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.danger-t { color: var(--danger); }
.btn.wide { display: flex; width: 100%; }
.btn:disabled { opacity: .6; }
.btn.nav { background: var(--blue); color: #fff; flex: 1; padding: 0 10px; }

.vhead { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; min-height: 40px; }
.vhead h2 { font-size: 18px; font-weight: 700; }
.place > * + *, .form > * + * { margin-top: 14px; }
.ptitle { display: flex; gap: 12px; align-items: flex-start; }
.ptitle h1 { font-size: 21px; line-height: 1.2; font-weight: 700; letter-spacing: -.01em; overflow-wrap: anywhere; }
.sub { color: var(--dim); font-size: 13.5px; margin-top: 3px; }
.stars { display: flex; gap: 4px; }
.stars button { color: var(--line); padding: 4px; }
.stars button .ico { width: 26px; height: 26px; }
.stars button.on { color: #ffb224; }
.stars button.on .ico { fill: #ffb224; }
.navs { display: flex; gap: 10px; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: 12.5px; font-weight: 600; }
.note { white-space: pre-wrap; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; overflow-wrap: anywhere; }
.photos { display: flex; gap: 8px; overflow-x: auto; }
.photos img { height: 150px; border-radius: 12px; display: block; }
.photos.edit { flex-wrap: wrap; overflow: visible; }
.photos.edit img { height: 84px; width: 84px; object-fit: cover; }
.ph { position: relative; }
.ph button { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border-radius: 50%; background: rgba(0, 0, 0, .7); color: #fff; display: grid; place-items: center; }
.ph button.armed { background: var(--danger); }
.ph button .ico { width: 15px; height: 15px; }
.addph { width: 84px; height: 84px; border-radius: 12px; border: 1.5px dashed var(--line); display: grid; place-items: center; align-content: center; gap: 4px; color: var(--dim); font-size: 11.5px; cursor: pointer; text-align: center; }
.facts li { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; overflow-wrap: anywhere; }
.facts li .ico { color: var(--dim); margin-top: 1px; width: 18px; height: 18px; }
.facts li span, .facts li a { flex: 1; min-width: 0; }
.facts .dim { color: var(--dim); font-size: 13px; }
.by { color: var(--dim); font-size: 12.5px; text-align: center; margin-top: 16px; }

.form label { display: block; font-size: 13px; font-weight: 600; color: var(--dim); }
.form input:not([type=checkbox]):not([type=search]), .form select, .form textarea, .gatecard input, .inline input, .url {
  display: block; width: 100%; margin-top: 5px; background: var(--card); border: 1px solid var(--line); border-radius: 11px; padding: 11px 12px; color: var(--text); font-size: 16px; outline: 0; -webkit-appearance: none; appearance: none; }
.form textarea { resize: vertical; min-height: 84px; line-height: 1.4; }
.form input:focus, .form select:focus, .form textarea:focus, .gatecard input:focus, .inline input:focus { border-color: var(--blue); }
.form .search input { margin: 0; border: 0; padding: 0; background: none; }
.lbl { font-size: 13px; font-weight: 600; color: var(--dim); }
.lbl + * { margin-top: 6px !important; }
.hint { color: var(--dim); font-size: 13px; }
.hint.lead { margin-bottom: 12px; }
.pinhint { display: flex; gap: 8px; align-items: flex-start; color: var(--text); background: rgba(47, 140, 255, .12); border: 1px solid rgba(47, 140, 255, .35); border-radius: 11px; padding: 9px 10px; }
.pinhint .ico { color: var(--blue); width: 18px; height: 18px; margin-top: 1px; }
.or { color: var(--dim); font-size: 13px; text-align: center; }
.found .row { border-top: 1px solid var(--line); }
.found:empty { display: none; }
.kinds { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.kinds button { height: 42px; border-radius: 11px; background: var(--card); border: 1px solid var(--line); display: grid; place-items: center; color: var(--dim); }
.kinds button.on { background: var(--text); color: #10141c; border-color: var(--text); }
.tagpick { display: flex; flex-wrap: wrap; gap: 6px; max-height: 190px; overflow-y: auto; }
.tagpick .chip { height: 34px; font-weight: 500; color: var(--dim); }
.tagpick .chip.on { color: var(--text); background: var(--card2); font-weight: 700; }
.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline input { flex: 1; min-width: 120px; margin-top: 0; }
.check { display: flex !important; gap: 10px; align-items: flex-start; font-weight: 500 !important; color: var(--text) !important; font-size: 14px !important; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--acc); flex: none; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.card + .card, #sharelist, #triplist .card + .card { margin-top: 12px; }
.card h3 { font-size: 16px; }
.card > * + * { margin-top: 10px; }
.card.off { opacity: .6; }
.card.guest { margin-bottom: 10px; border-color: var(--acc); }
.url { font-size: 13px !important; color: var(--dim) !important; margin-top: 0; }

.taglist li { display: flex; align-items: center; gap: 4px; border-top: 1px solid var(--line); }
.tagrow { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 11px 4px; text-align: left; }
.tagrow span:not(.tick) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tagrow em { font-style: normal; color: var(--dim); font-size: 13px; }
.tick { width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--line); display: grid; place-items: center; color: transparent; flex: none; }
.tick .ico { width: 15px; height: 15px; stroke-width: 3; }
.tagrow.on .tick { background: var(--acc); border-color: var(--acc); color: var(--acc-ink); }
.tagrow.on span:not(.tick) { font-weight: 700; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatches button { width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--bg); box-shadow: 0 0 0 1.5px var(--line); }
.swatches button.on { box-shadow: 0 0 0 2.5px var(--text); }
.menu li + li { border-top: 1px solid var(--line); }
.mrow { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 14px 4px; }
.mrow > span { flex: 1; min-width: 0; }
.mrow b { display: block; font-weight: 600; }
.mrow small { display: block; color: var(--dim); font-size: 13px; }
.mrow .chev { color: var(--dim); width: 16px; height: 16px; }
.guide { list-style: disc; padding-left: 20px; color: #d5dae4; }
.guide li + li { margin-top: 6px; }
.form h3 { font-size: 15px; margin-top: 20px; }

.fabs { position: fixed; right: 16px; bottom: 44px; display: flex; flex-direction: column; gap: 10px; z-index: 3; transition: opacity .2s; }
.fab { width: 50px; height: 50px; border-radius: 50%; background: var(--bg); color: var(--text); display: grid; place-items: center; box-shadow: 0 3px 14px rgba(0, 0, 0, .35); border: 1px solid var(--line); }
.fab.main { background: var(--acc); color: var(--acc-ink); border-color: var(--acc); width: 56px; height: 56px; margin-left: -3px; }
.fab.main .ico { width: 26px; height: 26px; stroke-width: 2.4; }
.fabs.away { opacity: 0; pointer-events: none; }

.me { width: 18px; height: 18px; border-radius: 50%; background: var(--blue); border: 3px solid #fff; box-shadow: 0 0 0 2px rgba(47, 140, 255, .35), 0 2px 6px rgba(0, 0, 0, .35); }
.me::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; box-shadow: 0 0 0 0 rgba(47, 140, 255, .5); animation: pulse 2.2s ease-out infinite; }
@keyframes pulse { to { box-shadow: 0 0 0 18px rgba(47, 140, 255, 0); } }
.dragpin { color: #fff; cursor: grab; filter: drop-shadow(0 3px 5px rgba(0, 0, 0, .45)); }
.dragpin .ico { width: 46px; height: 46px; fill: var(--acc); stroke: #fff; stroke-width: 1.5; display: block; }
.maplibregl-ctrl-attrib { font-size: 10px; }

.toast { position: fixed; left: calc(var(--side) + (100vw - var(--side)) / 2); top: 18px; transform: translate(-50%, -12px); background: #0b0e14; color: #fff; padding: 11px 16px; border-radius: 12px; font-size: 14px; font-weight: 600; box-shadow: 0 6px 24px rgba(0, 0, 0, .4); border: 1px solid var(--line); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 30; max-width: min(92vw, 440px); text-align: center; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

.gate { position: fixed; inset: 0; z-index: 20; background: var(--bg); overflow-y: auto; padding: calc(9vh + var(--st)) 18px 40px; }
.gatecard { max-width: 380px; margin: 0 auto; }
.gatecard > * + * { margin-top: 14px; }
.gatecard img { width: 64px; height: 64px; border-radius: 16px; display: block; }
.gatecard h1 { font-size: 28px; letter-spacing: -.02em; }
.gatecard label { display: block; font-size: 13px; font-weight: 600; color: var(--dim); }

@media (max-width: 859px) {
  :root { --side: 0px; }
  #map { inset: 0; }
  .side { display: contents; }
  .top { position: fixed; top: calc(var(--st) + 8px); left: 8px; right: 8px; z-index: 6; padding: 0; border: 0; pointer-events: none; }
  .top > * { pointer-events: auto; }
  .bar { flex-wrap: nowrap; gap: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 16px; padding: 6px; box-shadow: 0 4px 18px rgba(0, 0, 0, .3); }
  .brand { flex: none; }
  .brand span { display: none; }
  .brand img { width: 34px; height: 34px; border-radius: 10px; margin-left: 2px; }
  .search { order: 0; flex: 1; width: auto; height: 42px; border: 0; background: var(--card); }
  .icon-btn { border: 0; }
  .chips { margin-top: 8px; padding: 0 2px 6px; }
  .chips .chip, .chips .seg { background: var(--bg); box-shadow: 0 2px 10px rgba(0, 0, 0, .28); }
  .panel { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; background: var(--bg); border-radius: 20px 20px 0 0; box-shadow: 0 -6px 26px rgba(0, 0, 0, .35); border-top: 1px solid var(--line); transition: height .24s cubic-bezier(.3, .8, .3, 1); height: 46dvh; }
  .panel.dragging { transition: none; }
  .panel.s-peek { height: calc(88px + var(--sb)); }
  .panel.s-half { height: 46dvh; }
  .panel.s-full { height: calc(100dvh - var(--st) - 132px); }
  .grab { display: grid; place-items: center; width: 100%; height: 26px; flex: none; touch-action: none; cursor: grab; }
  .grab i { width: 42px; height: 5px; border-radius: 3px; background: var(--line); display: block; }
  .panel-body { padding-top: 2px; }
  .fabs { right: 12px; bottom: calc(var(--sheet) + 14px); }
  .maplibregl-ctrl-bottom-right { bottom: var(--sheet); }
  .maplibregl-ctrl-bottom-right .maplibregl-ctrl { margin: 0 70px 6px 0; }
  .toast { left: 50%; top: calc(var(--st) + 122px); }
}

.maptitle { font-size: 18px; font-weight: 700; padding: 0 2px 4px; }
@media (min-width: 860px) { .maptitle { display: none; } }

@media (min-width: 860px) { .chips { flex-wrap: wrap; overflow: visible; } }

.inline.two > * { flex: 1; }
.near { position: fixed; z-index: 25; left: calc(var(--side) + 16px); right: 16px; top: 16px; max-width: 460px; margin: 0 auto; display: flex; align-items: center; gap: 6px; background: #0b0e14; border: 1px solid var(--acc); border-radius: 16px; padding: 8px 8px 8px 12px; box-shadow: 0 8px 30px rgba(0, 0, 0, .45); }
.near-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; text-align: left; }
.near-main .ico { color: var(--acc); width: 24px; height: 24px; }
.near-main b { display: block; font-size: 15px; }
.near-main small { display: block; color: var(--dim); font-size: 13px; }
@media (max-width: 859px) { .near { left: 8px; right: 8px; top: calc(var(--st) + 118px); } }

/* 1.2: review pass ------------------------------------------------------------------------------- */
button, .chip, .seg, .brand, .count, .vhead, .kind, .fab { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
button:focus-visible, a:focus-visible, select:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.btn.sm { min-height: 40px; padding: 0 12px; font-size: 14px; border-radius: 11px; }
.btn.sm .ico { width: 17px; height: 17px; }
.vhead .btn.sm + .btn.sm { margin-left: -2px; }
.sort { -webkit-appearance: none; appearance: none; background: var(--card); border: 1px solid var(--line); color: var(--text); border-radius: 999px; padding: 4px 26px 4px 11px; font-size: 13px; font-weight: 600;
  background-image: linear-gradient(45deg, transparent 50%, var(--dim) 50%), linear-gradient(135deg, var(--dim) 50%, transparent 50%); background-position: calc(100% - 14px) 12px, calc(100% - 9px) 12px; background-size: 5px 5px; background-repeat: no-repeat; }
.count strong { margin-right: -7px; }
.foot { position: sticky; bottom: calc(-22px - var(--sb)); display: flex; gap: 10px; background: var(--bg); border-top: 1px solid var(--line); margin: 16px -14px calc(-22px - var(--sb)) !important; padding: 10px 14px calc(12px + var(--sb)); z-index: 2; }
.foot .btn { flex: 1; }
.foot .btn.ghost { flex: 0 0 auto; }
button.pinhint { width: 100%; text-align: left; font: inherit; font-size: 13px; cursor: pointer; }
.search.solo.sm { height: 38px; }
.search.solo.sm input { font-size: 15px; }
.photos button { flex: none; border-radius: 12px; overflow: hidden; }
.viewer { position: fixed; inset: 0; z-index: 40; background: rgba(5, 7, 11, .94); display: grid; place-items: center; padding: calc(var(--st) + 12px) 12px calc(var(--sb) + 12px); }
.viewer img { max-width: 100%; max-height: 100%; border-radius: 10px; object-fit: contain; }
.viewer .icon-btn { position: absolute; top: calc(var(--st) + 12px); right: 12px; }
.toast { display: flex; align-items: center; gap: 12px; }
.toast.act { pointer-events: auto; }
.toast button { color: var(--acc); font-weight: 800; padding: 4px 6px; flex: none; }
.gatecard.loading { text-align: center; }
.gatecard.loading img { margin: 0 auto; }
.maplibregl-ctrl-group { border-radius: 12px !important; overflow: hidden; }
.maplibregl-ctrl-top-right { top: 6px; right: 6px; }
@media (max-width: 859px) {
  .grab { height: 30px; }
  .sheet-full .maplibregl-ctrl-bottom-right { display: none; }
  .chips { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 26px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 26px), transparent); padding-right: 22px; }
  .chips .seg button { padding: 6px 10px; }
  .panel.s-peek .panel-body { overflow: hidden; }
}

.toast { width: max-content; }
