:root {
  --accent: #007AFF; --accent-2: #4DA3FF; --accent-soft: rgba(0, 122, 255, 0.12); --glow: 0, 122, 255;
  --fg: #1C1C1E; --fg-2: #6B6B72; --line: rgba(60, 60, 67, 0.14);
  --glass: rgba(255, 255, 255, 0.78); --glass-strong: rgba(255, 255, 255, 0.92);
  --shadow: 0 6px 24px rgba(20, 30, 60, 0.14), 0 1px 3px rgba(0, 0, 0, 0.08);
  --danger: #FF3B30; --ok: #34C759;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px);
  --fogsw: #6E7079; --clearsw: #F5F2EC;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased; color: var(--fg);
}
html.dark {
  --fg: #F2F2F7; --fg-2: #A1A1AA; --line: rgba(235, 235, 245, 0.14);
  --glass: rgba(36, 37, 44, 0.74); --glass-strong: rgba(40, 41, 48, 0.94);
  --shadow: 0 6px 26px rgba(0, 0, 0, 0.45), 0 1px 3px rgba(0, 0, 0, 0.3);
  --accent: #0A84FF; --accent-2: #5AB0FF; --accent-soft: rgba(10, 132, 255, 0.2); --glow: 10, 132, 255;
  --fogsw: #2A2C33; --clearsw: #4C5366;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #F5F2EC; overscroll-behavior: none; }
html.dark body { background: #2F3238; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
input { font: inherit; color: inherit; }
svg { display: block; }
#map { position: fixed; inset: 0; }
.fog-canvas { position: absolute; top: 0; left: 0; pointer-events: none; }
.fog-blend { mix-blend-mode: color; }
.glass { background: var(--glass); -webkit-backdrop-filter: blur(22px) saturate(180%); backdrop-filter: blur(22px) saturate(180%); box-shadow: var(--shadow); }

/* ---------- HUD ---------- */
#hud {
  position: fixed; z-index: 5; top: calc(var(--sat) + 10px); left: calc(var(--sal) + 10px);
  border-radius: 20px; padding: 12px 14px 10px; cursor: pointer; user-select: none; -webkit-user-select: none;
  width: min(330px, calc(100vw - 86px)); max-height: calc(100vh - var(--sat) - var(--sab) - 110px); overflow-y: auto;
}
#hud:empty { display: none; }
.hud-head { display: flex; align-items: flex-start; gap: 8px; }
.hud-txt { min-width: 0; flex: 1; line-height: 1.2; }
.hud-name { font-size: 11px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 2px; }
.hud-main { font-size: 14px; color: var(--fg-2); white-space: nowrap; }
.hud-main b { font-size: 26px; color: var(--fg); font-weight: 750; letter-spacing: -.02em; margin-right: 2px; }
.hud-steps { display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--fg-2); margin-top: 3px; }
.hud-steps svg { width: 14px; height: 14px; fill: var(--accent); }
.hud-steps b { color: var(--fg); font-weight: 650; }
.hud-sub { font-size: 12px; color: var(--fg-2); margin-top: 4px; }
.chev { width: 18px; height: 18px; color: var(--fg-2); flex: none; transition: transform .2s; margin-top: 6px; }
.hud-btn { flex: none; width: 30px; height: 30px; margin: -2px -6px 0 0; display: grid; place-items: center; border-radius: 50%; }
.hud-btn .chev { margin: 0; transform: rotate(180deg); }
.hud-btn:active { background: var(--accent-soft); }
#hud.mini { width: auto; max-width: calc(100vw - 86px); padding: 10px 12px 9px 14px; }
#hud.mini .hud-btn .chev { transform: none; }
#hud.mini .hud-main b { font-size: 22px; }
.hud-more-btn { display: block; width: 100%; margin-top: 4px; padding: 7px 0 2px; font-size: 13px; font-weight: 600; color: var(--accent); text-align: center; }
#hud.open > .hud-more-btn { display: none; }
.owner-in { color: var(--accent); }
.hide-places .photo-pin, .hide-places .food-pin { display: none !important; }
.recap-pill { position: fixed; z-index: 5; left: calc(var(--sal) + 14px); bottom: calc(var(--sab) + 26px); display: flex; align-items: center; gap: 11px;
  padding: 10px 16px 10px 10px; border-radius: 999px; text-align: left; box-shadow: 0 8px 26px rgba(0,0,0,.18), 0 1px 3px rgba(0,0,0,.1); max-width: calc(100vw - 110px); }
.recap-pill:active { transform: scale(.97); }
.recap-pill .rp-ic { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg, #3A9BFF, #007AFF); box-shadow: 0 3px 10px rgba(0,122,255,.4); }
.recap-pill .rp-ic svg { width: 22px; height: 22px; }
.recap-pill .rp-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.recap-pill b { font-size: 16px; font-weight: 700; } .recap-pill em { font-style: normal; font-size: 12.5px; color: var(--fg-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recap-pill .rp-go { font-size: 24px; line-height: 1; color: var(--fg-2); margin-left: 2px; }
body.placing .recap-pill, body.viewing .recap-pill { display: none; }
/* day recap */
.rc-head { display: flex; align-items: center; gap: 8px; margin: -4px 0 12px; }
.rc-title { flex: 1; text-align: center; } .rc-title h2 { margin: 0; font-size: 22px; } .rc-title span { font-size: 13px; color: var(--fg-2); }
.rc-nav { width: 38px; height: 38px; border-radius: 50%; font-size: 26px; line-height: 1; color: var(--accent); background: var(--accent-soft, rgba(0,122,255,.1)); }
.rc-nav:disabled { opacity: .25; }
.rc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.rc-stats div { padding: 10px 10px 9px; border-radius: 14px; background: var(--card-2, rgba(120,120,128,.1)); display: flex; flex-direction: column; }
.rc-stats b { font-size: 20px; font-weight: 750; letter-spacing: -.02em; } .rc-stats span { font-size: 12px; color: var(--fg-2); }
.rc-stats .new b { color: var(--accent); } .rc-stats .hk { color: #FF2D55; font-style: normal; }
.rc-snap { position: relative; height: 300px; border-radius: 18px; overflow: hidden; background: #888; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
.rc-snap #rcMap { position: absolute; inset: 0; }
.rc-snap canvas { position: absolute; top: 0; left: 0; pointer-events: none; }
.rc-key { position: absolute; left: 10px; bottom: 10px; display: flex; gap: 6px; }
.rc-key span { display: flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--glass-strong, rgba(255,255,255,.9)); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.rc-key i { width: 12px; height: 8px; border-radius: 4px; } .k-new { background: #fff; box-shadow: 0 0 0 1.5px #0A84FF, 0 0 6px rgba(10,132,255,.8); } .k-old { background: #9fa3ad; }
.rc-empty { padding: 26px; text-align: center; color: var(--fg-2); border-radius: 16px; background: var(--card-2, rgba(120,120,128,.1)); }
.rc-h { margin: 18px 0 8px; font-size: 16px; }
.rc-meals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 8px; }
.rc-meal { display: flex; flex-direction: column; gap: 3px; min-width: 0; text-align: left; padding: 0; background: none; }
.rc-img { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 1; border-radius: 14px; overflow: hidden;
  background: linear-gradient(145deg, #FFB45E, #F2862B); box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.rc-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rc-img > i { font-style: normal; font-size: 34px; }
.rc-star { position: absolute; top: 5px; left: 5px; padding: 2px 6px; border-radius: 999px; font-style: normal; font-size: 11px; font-weight: 700; color: #fff; background: rgba(0,0,0,.5); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.rc-emo { position: absolute; right: 5px; bottom: 5px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; font-style: normal; font-size: 13px; background: linear-gradient(145deg, #FFB45E, #F2862B); border: 1.5px solid #fff; }
.rc-meal b { font-size: 13px; font-weight: 650; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 3px; }
.rc-meal small { font-size: 11.5px; color: var(--fg-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.rc-act { display: flex; align-items: center; gap: 6px; padding: 7px 12px 7px 8px; border-radius: 999px; font-size: 13.5px; font-weight: 600; background: var(--card-2, rgba(120,120,128,.1)); }
.rc-act i { font-style: normal; font-size: 16px; }
.photo-pin .meal-tag.act i { background: linear-gradient(145deg, #5AC8FA, #007AFF); }
.photo-pin .meal-tag.act b { color: #0A5FC2; } html.dark .photo-pin .meal-tag.act b { color: #6CB8FF; }
.fp-dot.stay { background: linear-gradient(145deg, #8E7CFF, #5E5CE6) !important; }
.hide-places .stay-pin { display: none !important; }
.rc-photos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.rc-photos button { aspect-ratio: 1; border-radius: 10px; overflow: hidden; } .rc-photos img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rc-extra { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; } .rc-extra span { font-size: 13px; padding: 6px 10px; border-radius: 999px; background: var(--card-2, rgba(120,120,128,.1)); }
#controls button.active { color: var(--accent); }
/* first-visit walkthrough */
#tour { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
#tour.dim::before { content: ''; position: absolute; inset: 0; }
.tour-hole { position: absolute; border-radius: 18px; box-shadow: 0 0 0 9999px rgba(10,12,20,.5); transition: box-shadow .3s; pointer-events: none; outline: 2px solid rgba(255,255,255,.9); }
.tour-card { position: absolute; left: 12px; right: 12px; bottom: calc(18px + env(safe-area-inset-bottom)); max-width: 440px; margin: 0 auto; pointer-events: auto;
  padding: 16px 18px 14px; border-radius: 22px; background: var(--glass-strong, rgba(255,255,255,.96)); color: var(--fg);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); box-shadow: 0 12px 40px rgba(0,0,0,.28); transition: opacity .2s, transform .3s; }
.tour-card.top { bottom: auto; top: calc(14px + env(safe-area-inset-top)); }
.tour-card.busy { opacity: .55; }
.tour-card h3 { margin: 6px 0 6px; font-size: 19px; font-weight: 750; letter-spacing: -.01em; }
.tour-card p { margin: 0 0 14px; font-size: 15px; line-height: 1.42; color: var(--fg-2, #555); }
.tour-card p b { color: var(--fg); }
.tour-dots { display: flex; gap: 5px; } .tour-dots i { width: 6px; height: 6px; border-radius: 3px; background: rgba(120,120,128,.35); transition: width .2s; }
.tour-dots i.on { width: 18px; background: var(--accent); }
.tour-btns { display: flex; justify-content: space-between; gap: 10px; } .tour-btns .btn { flex: 1; }
.shots button { position: relative; }
.shots button img { transition: opacity .15s; }
.shots button i { position: absolute; right: 4px; bottom: 4px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-style: normal; color: #fff; background: rgba(0,0,0,.35); border: 1.5px solid #fff; }
.shots button.on i { background: #FF3B30; }
.shots button:not(.on) img { opacity: .45; }
.check-pay { display: flex; align-items: center; gap: 10px; width: 100%; margin: 10px 0 0; padding: 9px 10px; border-radius: 14px; text-align: left;
  background: rgba(255,149,0,.12); border: 1px solid rgba(255,149,0,.28); }
.check-pay .log-txt b { font-size: 14px; } .check-pay .log-txt em { font-size: 12px; }
.log-ic.pay { background: linear-gradient(145deg, #FFB340, #FF9500); }
.pend-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.pend { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--card-2, rgba(120,120,128,.1)); }
.pend-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pend-txt b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pend-txt span { font-size: 12.5px; color: var(--fg-2); }
.pend-btns { display: flex; gap: 6px; flex: none; }
.btn.sm { padding: 7px 11px; font-size: 13px; min-height: 0; }
.ilog { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.ilog-row { display: flex; align-items: baseline; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--line, rgba(120,120,128,.15)); }
.ilog-row b { flex: 1; font-weight: 500; } .ilog-row time { color: var(--fg-2); font-size: 12px; }
.ilog-row.bad b { color: #FF3B30; }
.hud-steps .hk { margin-left: 5px; color: #FF2D55; font-size: 12px; vertical-align: 1px; }
.log { margin-top: 10px; border-top: .5px solid var(--line); padding-top: 8px; }
.log-title { font-size: 11px; font-weight: 700; color: var(--fg-2); text-transform: uppercase; letter-spacing: .06em; margin: 0 0 4px; }
.log-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 2px; text-align: left; border-radius: 10px; }
.log-row:active { background: var(--accent-soft); }
.log-ic { width: 36px; height: 36px; border-radius: 10px; flex: none; display: grid; place-items: center; font-size: 19px; }
.log-ic.food { background: linear-gradient(145deg, #FFB45E, #F2862B); box-shadow: 0 2px 6px rgba(242,134,43,.35); }
.log-ic.ride { background: rgba(120,130,150,.18); }
.log-ic.area { background: var(--accent-soft); }
.log-thumbs { position: relative; width: 36px; height: 36px; flex: none; }
.log-thumbs img { position: absolute; width: 34px; height: 34px; border-radius: 9px; object-fit: cover; border: 1.5px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.22); background: #ddd; }
.log-thumbs.n1 img { left: 1px; top: 1px; }
.log-thumbs.n2 img:nth-child(1), .log-thumbs.n3 img:nth-child(1) { left: 0; top: 0; transform: rotate(-7deg); }
.log-thumbs.n2 img:nth-child(2) { left: 4px; top: 3px; transform: rotate(5deg); }
.log-thumbs.n3 img:nth-child(2) { left: 3px; top: 2px; transform: rotate(2deg); }
.log-thumbs.n3 img:nth-child(3) { left: 6px; top: 4px; transform: rotate(8deg); }
.log-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.log-txt b { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.log-txt em { font-style: normal; font-size: 12px; color: var(--fg-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.log-row time { font-size: 12px; color: var(--fg-2); flex: none; }
.hud-more { display: none; padding-top: 10px; margin-top: 6px; border-top: .5px solid var(--line); }
#hud.open .hud-more { display: block; animation: drop .18s ease-out; }
@keyframes drop { from { opacity: 0; transform: translateY(-4px); } }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 12px; }
.grid div { display: flex; flex-direction: column; }
.grid b { font-size: 16px; font-weight: 700; }
.grid span { font-size: 11px; color: var(--fg-2); line-height: 1.2; }
.areas-list { margin-top: 12px; }
.area-row { display: grid; grid-template-columns: 1fr 70px 46px; align-items: center; gap: 8px; width: 100%; padding: 5px 2px; text-align: left; font-size: 13px; }
.area-row span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.area-row i { height: 5px; border-radius: 3px; background: var(--accent-soft); overflow: hidden; }
.area-row u { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.area-row b { font-size: 12px; text-align: right; color: var(--fg-2); font-weight: 600; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 12px; font-size: 11px; color: var(--fg-2); }
.legend span { display: flex; align-items: center; gap: 5px; }
.sw { width: 14px; height: 14px; border-radius: 4px; display: inline-block; box-shadow: inset 0 0 0 1px var(--line); }
.fogsw { background: var(--fogsw); }
.clearsw { background: var(--clearsw); }
.dotsw { border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px #fff; width: 10px; height: 10px; margin: 2px; }
.photosw { background: linear-gradient(135deg, #7DE3F7, #4DA3FF); box-shadow: 0 0 0 1.5px #fff; border-radius: 3px; }
.areasw { background: none; border: 2px solid var(--accent); border-radius: 3px; box-shadow: none; }
.hud-foot { margin-top: 10px; font-size: 11px; color: var(--fg-2); border-top: .5px solid var(--line); padding-top: 8px; }
.live { display: inline-flex; align-items: center; gap: 5px; }
.live i { width: 7px; height: 7px; border-radius: 50%; background: var(--fg-2); }
.live.on i { background: var(--ok); box-shadow: 0 0 0 3px rgba(52, 199, 89, .25); }

/* ---------- area labels ---------- */
.area-label { display: none; flex-direction: column; align-items: center; padding: 5px 10px; border-radius: 12px; background: rgba(255,255,255,.88); box-shadow: 0 2px 10px rgba(0,0,0,.18); line-height: 1.2; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
html.dark .area-label { background: rgba(30,32,38,.85); }
.area-label b { font-size: 12px; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }
.area-label span { font-size: 11px; color: var(--fg-2); }
.show-area-labels .area-label { display: flex; }

/* ---------- controls ---------- */
.ctrl-stack { position: fixed; z-index: 5; top: calc(var(--sat) + 10px); right: calc(var(--sar) + 10px); display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.ctrl-group { display: flex; flex-direction: column; border-radius: 12px; overflow: hidden; }
.ctrl-group button, .ctrl-single { width: 44px; height: 44px; display: grid; place-items: center; color: var(--accent); }
.ctrl-group button + button { border-top: .5px solid var(--line); }
.ctrl-group svg, .ctrl-single svg { width: 21px; height: 21px; fill: currentColor; transition: transform .2s; }
svg[fill=none] { fill: none !important; }
.ctrl-group button:active, .ctrl-single:active, .fab:active { opacity: .6; }
.ctrl-single { border-radius: 50%; color: var(--fg); }
.ctrl-single svg { width: 26px; height: 26px; }
#btnLocate.active { color: var(--accent); }
.fab {
  position: fixed; z-index: 5; right: calc(var(--sar) + 14px); bottom: calc(var(--sab) + 26px);
  width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  background: linear-gradient(145deg, var(--accent-2), var(--accent)); box-shadow: 0 8px 22px rgba(var(--glow), .45), 0 2px 4px rgba(0,0,0,.12);
}
.fab svg { width: 26px; height: 26px; fill: #fff; }
.fab-2 { width: 46px; height: 46px; right: calc(var(--sar) + 19px); bottom: calc(var(--sab) + 94px); background: linear-gradient(145deg, #FFA54A, #F2862B); box-shadow: 0 6px 18px rgba(242, 134, 43, .45), 0 2px 4px rgba(0,0,0,.12); }
.fab-2 svg { width: 22px; height: 22px; }
.food-pin { display: flex; align-items: center; gap: 5px; background: none; padding: 0; max-width: 190px; }
.food-pin > * { animation: pop .25s ease-out; }
.fp-dot { width: 32px; height: 32px; flex: none; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(145deg, #FFA54A, #F2862B); border: 2.5px solid #fff; box-shadow: 0 3px 10px rgba(0,0,0,.3); }
.fp-dot { font-size: 17px; line-height: 1; }
.fp-dot svg { width: 17px; height: 17px; fill: #fff; }
.fp-label { display: none; font-size: 12.5px; font-weight: 700; color: #C9620F; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
  text-shadow: 0 0 2px #fff, 0 0 3px #fff, 0 0 5px #fff, 0 0 8px rgba(255,255,255,.9); }
html.dark .fp-label { color: #FFB060; text-shadow: 0 0 2px #15161c, 0 0 4px #15161c, 0 0 7px rgba(21,22,28,.9); }
.show-labels .fp-label { display: block; }
.food-pin.recent .fp-dot { box-shadow: 0 0 0 3px var(--accent), 0 3px 10px rgba(0,0,0,.3); }
.ridesw { width: 18px; height: 0; border-radius: 0; box-shadow: none; border-top: 2.5px dotted rgba(60,75,100,.6); }
.foodsw { border-radius: 50%; background: #F2862B; box-shadow: 0 0 0 2px #fff; width: 11px; height: 11px; margin: 1.5px; }
.meal-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.price { font-size: 17px; color: #E0721B; }
.nearby { display: flex; flex-direction: column; gap: 6px; margin-bottom: 4px; }
.nearby button { display: flex; align-items: center; gap: 10px; text-align: left; padding: 10px 12px; border-radius: 12px; background: var(--accent-soft); }
.nearby span { width: 28px; height: 28px; border-radius: 50%; background: #F2862B; display: grid; place-items: center; flex: none; }
.nearby span svg { width: 15px; height: 15px; fill: #fff; }
.nearby b { flex: 1; font-size: 15px; font-weight: 600; }
.nearby em { font-style: normal; font-size: 12px; color: var(--fg-2); }

/* MapLibre chrome */
.maplibregl-ctrl-bottom-left { left: var(--sal); bottom: var(--sab); }
.maplibregl-ctrl-attrib.maplibregl-compact { background: var(--glass); color: var(--fg-2); }
.maplibregl-ctrl-attrib a { color: var(--fg-2); }
html.dark .maplibregl-ctrl-attrib-button { filter: invert(1); }

/* ---------- location dot ---------- */
.me { position: relative; width: 24px; height: 24px; pointer-events: none; }
.me .dot { position: absolute; inset: 3px; border-radius: 50%; background: var(--accent); border: 3px solid #fff; box-shadow: 0 1px 6px rgba(0,0,0,.3); }
.me .pulse { position: absolute; inset: 0; border-radius: 50%; background: var(--accent); opacity: .35; animation: pulse 2s ease-out infinite; }
.me .acc { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); border-radius: 50%; background: var(--accent-soft); border: 1px solid rgba(var(--glow), .25); width: 0; height: 0; opacity: 0; transition: width .3s, height .3s; }
.me.stale .dot, .me.stale .pulse { background: #8E8E93; animation: none; }
.me.stale .pulse { opacity: 0; }
.live-tag { position: absolute; left: 50%; top: calc(100% + 5px); transform: translateX(-50%); white-space: nowrap;
  display: flex; align-items: center; gap: 5px; padding: 3px 9px 3px 8px; border-radius: 999px;
  font: 600 12px/1.2 -apple-system, system-ui, sans-serif; color: var(--fg); background: var(--glass-strong);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: 0 2px 8px rgba(0,0,0,.18); }
.live-tag i { width: 7px; height: 7px; border-radius: 50%; background: #34C759; box-shadow: 0 0 0 2px rgba(52,199,89,.25); }
.me.stale .live-tag { color: var(--fg-2); }
@keyframes pulse { 0% { transform: scale(1); opacity: .45; } 100% { transform: scale(2.6); opacity: 0; } }

/* ---------- photo pins: floating holographic cards ---------- */
.photo-pin { position: relative; width: var(--pin, 60px); height: calc(var(--pin, 60px) * 1.32); padding: 0; background: none; perspective: 420px; }
.photo-pin .holo, .photo-pin .count, .photo-pin .meal-tag { animation: pop .3s ease-out; }
.photo-pin .holo {
  position: absolute; left: 0; top: 0; width: var(--pin, 60px); height: var(--pin, 60px); border-radius: calc(var(--pin, 60px) * .2);
  padding: 3px; overflow: hidden; transform: rotateX(8deg); transform-origin: 50% 100%;
  background: conic-gradient(from 210deg, #4DA3FF, #7DE3F7, #FFFFFF, #A7C7FF, #4DA3FF);
  box-shadow: 0 0 0 1px rgba(255,255,255,.55) inset, 0 10px 22px rgba(10,30,70,.4), 0 0 18px rgba(var(--glow),.55);
}
.photo-pin img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: calc(var(--pin, 60px) * .2 - 3px); background: #ddd; }
.photo-pin .sheen { position: absolute; inset: 3px; border-radius: inherit; pointer-events: none; mix-blend-mode: screen;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.55) 45%, rgba(180,220,255,.25) 52%, transparent 65%) 0 0 / 250% 100%;
  animation: sheen 4.5s ease-in-out infinite; }
.photo-pin .beam { position: absolute; left: 50%; bottom: 3px; width: 2px; height: calc(var(--pin, 60px) * .32 - 3px); transform: translateX(-50%);
  background: linear-gradient(to top, rgba(var(--glow),.9), rgba(var(--glow),0)); }
.photo-pin .base { position: absolute; left: 50%; bottom: -3px; width: 14px; height: 6px; border-radius: 50%; transform: translateX(-50%);
  background: radial-gradient(rgba(var(--glow),.95), rgba(var(--glow),0) 70%); box-shadow: 0 0 10px 3px rgba(var(--glow),.55); }
.photo-pin .count { position: absolute; top: -8px; right: -8px; z-index: 2; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; border: 2px solid #fff; }
.photo-pin.recent .holo { box-shadow: 0 0 0 1px rgba(255,255,255,.7) inset, 0 10px 22px rgba(10,30,70,.4), 0 0 26px rgba(var(--glow),.95); }
.photo-pin .meal-tag { position: absolute; left: calc(var(--pin, 60px) - 12px); top: calc(var(--pin, 60px) * .5 - 14px); z-index: 2; display: flex; align-items: center; gap: 5px; max-width: 170px; }
.photo-pin .meal-tag i { width: 28px; height: 28px; flex: none; display: grid; place-items: center; font-style: normal; font-size: 15px; border-radius: 50%; background: linear-gradient(145deg, #FFA54A, #F2862B); border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.photo-pin .meal-tag svg { width: 28px; height: 28px; flex: none; padding: 5px; border-radius: 50%; fill: #fff; background: linear-gradient(145deg, #FFA54A, #F2862B); border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.photo-pin .meal-tag b { display: none; font-size: 12.5px; font-weight: 700; color: #C9620F; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 0 2px #fff, 0 0 3px #fff, 0 0 5px #fff, 0 0 8px rgba(255,255,255,.9); }
html.dark .photo-pin .meal-tag b { color: #FFB060; text-shadow: 0 0 2px #15161c, 0 0 4px #15161c, 0 0 7px rgba(21,22,28,.9); }
.show-labels .photo-pin .meal-tag b { display: block; }
@keyframes float { 0%, 100% { transform: rotateX(10deg) translateY(0); } 50% { transform: rotateX(10deg) translateY(-3px); } }
@keyframes sheen { 0% { background-position: 120% 0; } 60%, 100% { background-position: -40% 0; } }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .photo-pin .holo, .photo-pin .sheen { animation: none; } }
/* zoomed out: compact pins (still glowing so people notice), no name tags, smaller badges */
.pins-sm .photo-pin .count { top: -6px; right: -7px; min-width: 17px; height: 17px; font-size: 10px; padding: 0 4px; border-width: 1.5px; }
.pins-sm .photo-pin .meal-tag { left: calc(var(--pin) - 9px); top: -6px; }
.pins-sm .photo-pin .meal-tag i { width: 19px; height: 19px; font-size: 10px; border-width: 1.5px; }
.pins-sm .photo-pin .meal-tag b { display: none !important; }
.pins-sm .photo-pin .base { width: 9px; height: 4px; }
.meal-photos { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; }
.meal-photos button { flex: none; width: 72px; height: 72px; border-radius: 12px; overflow: hidden; box-shadow: 0 0 0 2px var(--accent); }
.meal-photos img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- viewer ---------- */
#viewer { position: fixed; inset: 0; z-index: 20; background: #000; color: #fff; display: flex; flex-direction: column; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.v-top { display: flex; align-items: center; justify-content: space-between; padding: calc(var(--sat) + 8px) 12px 8px; }
.v-count { font-size: 14px; font-weight: 600; opacity: .8; }
.round { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.14); }
.round svg { width: 20px; height: 20px; }
.v-img { flex: 1; position: relative; min-height: 0; }
.v-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.v-img img:first-child { filter: blur(14px); transform: scale(.98); opacity: .6; }
.v-img img.full { opacity: 0; transition: opacity .25s; }
.v-img img.full.ready { opacity: 1; }
.v-info { width: 100%; max-width: 680px; margin: 0 auto; padding: 14px 18px calc(var(--sab) + 18px); color: #fff; }
.v-when { font-weight: 650; font-size: 16px; }
.v-src { font-size: 13px; color: rgba(255,255,255,.62); margin-top: 3px; }
#viewer .v-cap { width: 100%; margin-top: 12px; border: 0; border-radius: 12px; padding: 0 12px; height: 40px; background: rgba(255,255,255,.1); color: #fff; outline: none; font-size: 15px; }
#viewer .v-cap::placeholder { color: rgba(255,255,255,.45); }
.v-capro { margin-top: 10px; font-size: 15px; color: rgba(255,255,255,.9); }
.v-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
#viewer .v-actions .btn { background: rgba(255,255,255,.12); color: #fff; height: 36px; font-weight: 600; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.v-actions svg { width: 15px; height: 15px; fill: currentColor; }
.nav { position: absolute; top: 50%; width: 40px; height: 56px; font-size: 34px; color: #fff; opacity: .7; }
.nav.prev { left: 4px; } .nav.next { right: 4px; }
@media (hover: none) { .nav { display: none; } }

/* ---------- buttons / fields ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: 11px; font-weight: 600; font-size: 14px; text-decoration: none; color: var(--accent); background: var(--accent-soft); white-space: nowrap; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.ghost { background: var(--accent-soft); color: var(--accent); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger-t { color: var(--danger); background: rgba(255, 59, 48, .1); }
.btn.wide { width: 100%; height: 46px; font-size: 16px; }
.btn svg { width: 16px; height: 16px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row input { flex: 1; min-width: 0; }
input:not([type=file]) { height: 40px; border-radius: 11px; border: 0; padding: 0 12px; background: var(--accent-soft); outline: none; font-size: 16px; }
.field { font-size: 12.5px; padding: 10px 12px; border-radius: 11px; background: var(--accent-soft); word-break: break-all; margin-bottom: 8px; user-select: all; -webkit-user-select: all; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.muted { color: var(--fg-2); }
.small { font-size: 12px; }

/* ---------- sheet ---------- */
#sheet { position: fixed; inset: 0; z-index: 15; background: rgba(0,0,0,0); transition: background .25s; display: flex; align-items: flex-end; justify-content: center; }
#sheet.open { background: rgba(0,0,0,.25); }
.sheet-card { position: relative; width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto; -webkit-overflow-scrolling: touch; border-radius: 22px 22px 0 0; padding: 8px 18px calc(var(--sab) + 22px); transform: translateY(100%); transition: transform .28s cubic-bezier(.2,.8,.2,1); background: var(--glass-strong); }
#sheet.open .sheet-card { transform: none; }
.grab { width: 38px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 10px; }
.sheet-x { position: absolute; top: 12px; right: 12px; background: var(--accent-soft); color: var(--fg-2); width: 30px; height: 30px; }
.sheet-x svg { width: 15px; height: 15px; }
.sheet-card h2 { margin: 6px 0 14px; font-size: 24px; letter-spacing: -.02em; }
.sheet-card h3 { margin: 0 0 4px; font-size: 15px; }
.sheet-card p { margin: 0 0 10px; font-size: 13px; line-height: 1.4; }
.sheet-card section { padding: 14px 0; border-top: .5px solid var(--line); }
.sheet-card section:first-of-type { border-top: 0; padding-top: 0; }
.lbl { display: block; font-size: 12px; color: var(--fg-2); margin-bottom: 6px; }
.seg { display: flex; background: var(--accent-soft); border-radius: 10px; padding: 3px; }
.seg button { flex: 1; height: 32px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--fg-2); }
.seg button.on { background: var(--glass-strong); color: var(--fg); box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.unplaced { display: flex; gap: 8px; overflow-x: auto; padding: 6px 0; }
.unplaced button { flex: none; width: 64px; height: 64px; border-radius: 12px; overflow: hidden; }
.unplaced img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- dialog / toast / login ---------- */
.dialog-wrap { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.3); display: grid; place-items: center; animation: fade .15s; padding: 24px; }
.dialog { border-radius: 18px; padding: 18px; width: 100%; max-width: 320px; background: var(--glass-strong); }
.dialog h3 { margin: 0 0 6px; font-size: 17px; }
.dialog p { margin: 0 0 16px; font-size: 14px; color: var(--fg-2); line-height: 1.4; }
.dialog-btns { display: flex; gap: 8px; } .dialog-btns .btn { flex: 1; }
#toast { position: fixed; z-index: 50; left: 50%; bottom: calc(var(--sab) + 96px); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: rgba(28, 28, 32, .9); color: #fff; padding: 10px 16px; border-radius: 14px; font-size: 14px; font-weight: 500; transition: .25s; max-width: calc(100vw - 40px); text-align: center; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#login { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 30% 20%, rgba(0,122,255,.22), transparent 60%), linear-gradient(160deg, #EEF3FA, #DDE5F0); }
html.dark #login { background: radial-gradient(circle at 30% 20%, rgba(10,132,255,.25), transparent 60%), linear-gradient(160deg, #1B1D22, #131417); }
.login-card { width: 100%; max-width: 340px; border-radius: 24px; padding: 28px 22px 20px; text-align: center; }
.login-card h1 { margin: 10px 0 6px; font-size: 26px; letter-spacing: -.02em; }
.login-card p { font-size: 14px; line-height: 1.4; margin: 0 0 18px; }
.login-card input { width: 100%; margin-bottom: 10px; text-align: center; }
.login-card a { display: inline-block; margin-top: 14px; }
.login-icon { width: 72px; height: 72px; border-radius: 17px; box-shadow: var(--shadow); }

/* placing mode */
.place-pin, .place-bar { display: none; }
body.placing .place-pin { display: block; position: fixed; z-index: 6; left: 50%; top: 50%; width: 40px; height: 40px; transform: translate(-50%, -100%); color: var(--accent); filter: drop-shadow(0 3px 6px rgba(0,0,0,.3)); pointer-events: none; }
.place-pin svg { width: 40px; height: 40px; fill: currentColor; }
body.placing .place-bar { display: flex; flex-direction: column; gap: 10px; position: fixed; z-index: 6; left: 12px; right: 12px; bottom: calc(var(--sab) + 16px); border-radius: 18px; padding: 14px; font-size: 14px; text-align: center; }
body.placing .place-bar .row { justify-content: center; }
body.placing .fab, body.placing #hud, body.placing .food-pin { display: none; }

/* most recent pins get an accent ring */
.btn svg { fill: currentColor; }

.meal-kind { font-size: 14px; font-weight: 600; margin: 4px 0 2px; }
.kind-pick { margin-top: 10px; }
.kind-pick summary { font-size: 13px; color: var(--accent); font-weight: 600; cursor: pointer; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { padding: 6px 10px; border-radius: 16px; font-size: 13px; background: var(--accent-soft); }
.chip.on { background: var(--accent); color: #fff; }

/* markers must stay absolutely positioned or MapLibre's anchor math is off (pins drift from their spot) */
.maplibregl-marker { position: absolute !important; }

/* ---------- place card (meal) ---------- */
.place-card { padding: 0 0 14px; }
.place-card + .place-card { border-top: .5px solid var(--line); padding-top: 14px; }
.pc-hero { display: flex; gap: 6px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -18px 12px; padding: 0 18px; }
.pc-img { position: relative; flex: none; width: 78%; max-width: 330px; aspect-ratio: 4 / 3; border-radius: 16px; overflow: hidden; scroll-snap-align: start; background: var(--accent-soft); padding: 0; }
.pc-hero .pc-img:only-child { width: 100%; max-width: none; }
.pc-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pc-tag { position: absolute; left: 8px; bottom: 8px; font-size: 11px; font-weight: 600; color: #fff; background: rgba(0,0,0,.5); padding: 3px 8px; border-radius: 10px; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); max-width: 85%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-tag.mine { background: var(--accent); }
.pc-body h3 { margin: 0 0 4px; font-size: 17px; }
.pc-kind { font-size: 14px; font-weight: 600; }
.pc-rating { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 14px; }
.pc-rating b { font-weight: 700; }
.pc-rating .stars { color: #F5A623; letter-spacing: 1px; }
.pc-rating em { font-style: normal; color: var(--fg-2); font-size: 13px; }
.pc-addr { font-size: 13px; color: var(--fg-2); margin-top: 3px; }
.pc-actions { margin-top: 12px; }
.pc-credit { margin-top: 10px; font-size: 11px; color: var(--fg-2); }
.v-img:has(img.full.ready) img:first-child { opacity: 0; }
.stay-pin .fp-label { color: #4B49C9; } html.dark .stay-pin .fp-label { color: #A9A7FF; }

/* star rating with partial fill */
.srow { position: relative; display: inline-block; color: rgba(120,120,128,.35); letter-spacing: 1px; line-height: 1; white-space: nowrap; }
.srow-on { position: absolute; left: 0; top: 0; overflow: hidden; color: #F5A623; white-space: nowrap; }
.rp-pl .rp-rate { font-size: 15px; } .rp-pl .srow { font-size: 16px; }

/* stops found from GPS */
.fp-dot.visit { background: linear-gradient(145deg, #5AC8FA, #007AFF) !important; }
.visit-pin .fp-label { color: #0A5FC2; } html.dark .visit-pin .fp-label { color: #6CB8FF; }
.hide-places .visit-pin { display: none !important; }
.log-ic.visit { background: linear-gradient(145deg, #5AC8FA, #007AFF); }
.rc-act small { margin-left: 4px; font-size: 11.5px; font-weight: 600; color: var(--fg-2); }
/* calm map: overlapping pins merge into the most important one */
.merged-away { display: none !important; }
.mrg { position: absolute; left: -7px; top: -7px; z-index: 3; min-width: 22px; height: 20px; padding: 0 5px; border-radius: 10px; display: grid; place-items: center;
  font-style: normal; font-size: 11px; font-weight: 800; color: #fff; background: rgba(28,28,32,.82); border: 1.5px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.3); pointer-events: none; }
.food-pin { position: relative; }

/* ---------- day story recap ---------- */
.sheet-card.story-sheet { background: var(--bg-solid, #F7F7F9); max-height: 94vh; height: 94vh; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
html.dark .sheet-card.story-sheet { background: #17181D; }
.story { margin: 6px 0 4px; text-align: center; }
.sg { padding: 0 2px; }
.sg + .sg, .sg-go + .sg, .sg + .sg-go { margin-top: 6px; }
.sg + .sg::before, .sg-go::before, .sg-go::after { content: ''; display: block; width: 1px; height: 26px; margin: 0 auto 12px; background: rgba(120,120,128,.35); }
.sg-go::after { margin: 12px auto 0; }
.sg time { display: block; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--fg-2); font-variant-numeric: tabular-nums; }
.sg h3 { margin: 4px 0 0; font-size: 21px; font-weight: 700; letter-spacing: -.02em; line-height: 1.22; text-wrap: balance; }
.sg-h { display: block; width: 100%; padding: 0; background: none; color: inherit; }
.sg-sub { margin: 3px 0 0; font-size: 14px; color: var(--fg-2); }
.sg-start, .sg-end { padding: 8px 0 2px; }
.sg-start h3, .sg-end h3 { font-size: 26px; font-weight: 750; letter-spacing: -.025em; }
.sg-photo h3 { font-size: 16px; font-weight: 600; color: var(--fg-2); }
/* on the way: plain sentences, readable but quieter than the moments */
.sg-go p { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.35; }
.sg-go p + p { margin-top: 8px; }
.sg-go p span { display: block; font-size: 13px; font-weight: 500; color: var(--fg-2); }
.sg-go p.big { font-size: 18px; font-weight: 700; letter-spacing: -.015em; }
.sg-go p.new { font-weight: 500; color: var(--fg-2); }
.sg-go p.new b { color: var(--fg); font-weight: 700; }
/* photos: whole, full width, one after another */
.sg-pics { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.sg-pics > * { position: relative; display: block; width: 100%; padding: 0; border-radius: 14px; overflow: hidden; background: rgba(120,120,128,.14); }
.sg-pics img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity .3s; }
.sg-pics img[src] { opacity: 1; }
.sg-pics .g i { position: absolute; right: 8px; bottom: 8px; font-style: normal; font-size: 10.5px; font-weight: 600; color: #fff; padding: 2px 7px; border-radius: 6px; background: rgba(0,0,0,.4); }
.st-h { margin: 26px 0 10px; text-align: center; font-size: 18px; font-weight: 800; letter-spacing: -.01em; }
.rc-stats.six { grid-template-columns: repeat(3, 1fr); }
.story-sheet .rc-stats div { align-items: center; text-align: center; }
.story-sheet .rc-snap { margin-top: 12px; }
