[hidden] { display: none !important; }
:root {
  --bg: #0b0f0c; --panel: #141a16; --line: #26302a; --text: #f2f5f1; --muted: #9aa69e;
  --accent: #b6ff3b; --accent-ink: #0b0f0c; --warn: #ffb547; --danger: #ff5a5a;
  --soft: #1d2620; --field: #0f1411; --glass: rgba(20,26,22,.92); --bar: rgba(11,15,12,.96); --gate-bg: rgba(11,15,12,.97);
  --toggle-off: #2a352e; --tab-idle: #8a968e; --accent-text: var(--accent); --shadow: rgba(0,0,0,.5); --info: #6cc4ff;
  --safe-top: var(--safe-area-inset-top, env(safe-area-inset-top, 0px)); --safe-bottom: var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px));
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overflow: hidden; }
#map { position: fixed; inset: 0; background: var(--bg); }
.leaflet-container { background: var(--bg); }

.topbar { position: fixed; top: calc(10px + var(--safe-top)); left: 12px; right: 12px; display: flex; gap: 10px; align-items: center; z-index: 1000; }
.brand { font-weight: 900; letter-spacing: .08em; color: var(--accent-ink); background: var(--accent);
  padding: 10px 12px; border-radius: 14px; box-shadow: 0 4px 18px rgba(0,0,0,.4); }
.brand.big { font-size: 28px; display: inline-block; margin-bottom: 12px; }
.search { position: relative; flex: 1; }
.search input { width: 100%; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--glass); color: var(--text); font-size: 16px; outline: none; backdrop-filter: blur(8px); }
.search input:focus { border-color: var(--accent); }
.results { position: absolute; top: 48px; left: 0; right: 0; margin: 0; padding: 4px; list-style: none;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; max-height: 50vh; overflow: auto; }
.results li { padding: 10px 12px; border-radius: 10px; cursor: pointer; }
.results li:hover, .results li:focus { background: var(--soft); outline: none; }
.results small { color: var(--muted); display: block; }

.chips { position: fixed; top: calc(62px + var(--safe-top)); left: 12px; right: 12px; display: flex; gap: 8px; z-index: 999; overflow-x: auto; }
.chip { flex: none; border: 1px solid var(--line); background: var(--glass); color: var(--muted);
  padding: 7px 12px; border-radius: 999px; font-weight: 600; font-size: 13px; }
.chip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.fab { position: fixed; right: 14px; bottom: calc(24px + var(--safe-bottom)); z-index: 1000; width: 52px; height: 52px;
  border-radius: 50%; border: 0; background: var(--panel); color: var(--accent); box-shadow: 0 6px 18px rgba(0,0,0,.5);
  display: grid; place-items: center; }
.status { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(30px + var(--safe-bottom)); z-index: 1000;
  background: var(--panel); border: 1px solid var(--line); padding: 7px 12px; border-radius: 999px; font-size: 13px; color: var(--muted); }
.status:empty { display: none; }

/* Animated target marker */
.target { position: relative; width: 28px; height: 28px; }
.target .core { position: absolute; inset: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.target .ring { position: absolute; inset: 3px; border-radius: 50%; border: 2px solid var(--accent); }
.target .pulse { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--accent); animation: pulse 1.8s ease-out infinite; }
.target.promo .core { background: #fff; box-shadow: 0 0 12px #fff, 0 0 4px var(--accent); }
.target.unverified .core, .target.unverified .ring, .target.unverified .pulse { border-color: var(--warn); }
.target.unverified .core { background: var(--warn); box-shadow: 0 0 10px var(--warn); }
.target.selected .ring { border-width: 3px; inset: 1px; }
@keyframes pulse { 0% { transform: scale(.6); opacity: 1; } 100% { transform: scale(1.9); opacity: 0; } }
.you { width: 18px; height: 18px; border-radius: 50%; background: #3fa9ff; border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(63,169,255,.25); }

.beto-cluster { display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: var(--accent-ink);
  font-weight: 800; font-size: 13px; box-shadow: 0 0 0 6px rgba(182,255,59,.25), 0 0 16px rgba(182,255,59,.5); }

/* Business sheet */
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1100; background: var(--panel); border-top: 1px solid var(--line);
  border-radius: 22px 22px 0 0; padding: 10px 16px calc(18px + var(--safe-bottom)); max-height: 78vh; overflow: auto;
  transform: translateY(105%); transition: transform .28s cubic-bezier(.2,.8,.2,1); box-shadow: 0 -10px 30px rgba(0,0,0,.5); }
.sheet.open { transform: translateY(0); }
.grab { width: 40px; height: 4px; background: var(--line); border-radius: 4px; margin: 0 auto 10px; }
.close { position: absolute; top: 10px; right: 12px; background: none; border: 0; color: var(--muted); font-size: 28px; line-height: 1; }
.sheet-head { display: flex; gap: 12px; align-items: center; padding-right: 30px; }
.logo { width: 54px; height: 54px; border-radius: 14px; background: var(--soft) center/cover; flex: none; display: grid; place-items: center;
  font-weight: 900; color: var(--accent); font-size: 22px; }
.sheet h2 { margin: 0 0 4px; font-size: 19px; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--soft); color: var(--muted); }
.badge.ok { background: rgba(182,255,59,.15); color: var(--accent); }
.badge.warn { background: rgba(255,181,71,.15); color: var(--warn); }
.addr { margin: 12px 0 4px; }
.hours { margin: 0 0 12px; color: var(--muted); }
.hours .open { color: var(--accent); font-weight: 700; }
.hours .closed { color: var(--danger); font-weight: 700; }
.actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.act { display: grid; place-items: center; text-align: center; padding: 11px 4px; border-radius: 12px; background: var(--soft); color: var(--text);
  border: 1px solid var(--line); text-decoration: none; font-weight: 600; font-size: 13px; cursor: pointer; }
.act.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.act.disabled { opacity: .35; pointer-events: none; }
.promos { margin-top: 14px; display: grid; gap: 8px; }
.promo { border: 1px dashed var(--accent); border-radius: 14px; padding: 10px 12px; }
.promo b { color: var(--accent); }
.promo code { background: var(--soft); padding: 2px 6px; border-radius: 6px; }
.promo small { color: var(--muted); display: block; margin-top: 4px; }
.lic { color: var(--muted); font-size: 12px; margin-top: 14px; }

.gate { position: fixed; inset: 0; z-index: 2000; background: var(--gate-bg); display: grid; place-items: center; padding: 16px; }
.gate-card { max-width: 340px; text-align: center; display: grid; gap: 10px; }
.gate[hidden] { display: none; }

@media (min-width: 720px) {
  .sheet { left: auto; right: 16px; bottom: 16px; width: 400px; border-radius: 22px; border: 1px solid var(--line); }
  .topbar { right: auto; width: 460px; }
}
@media (prefers-reduced-motion: reduce) {
  .target .pulse { animation: none; opacity: 0; }
  .sheet { transition: none; }
}

/* ===== Phase 2 ===== */
:root { --tabbar-h: 62px; }
.fab { bottom: calc(var(--tabbar-h) + 16px + var(--safe-bottom)); }
.status { bottom: calc(var(--tabbar-h) + 22px + var(--safe-bottom)); }
.sheet { bottom: calc(var(--tabbar-h) + var(--safe-bottom)); max-height: calc(78vh - var(--tabbar-h)); }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1200; display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--tabbar-h) + var(--safe-bottom)); padding-bottom: var(--safe-bottom);
  background: var(--bar); border-top: 1px solid var(--line); backdrop-filter: blur(10px); }
.tab { background: none; border: 0; color: var(--muted); font: 600 11px/1 system-ui, sans-serif; display: grid; place-items: center; align-content: center; gap: 5px; cursor: pointer; }
.tab .ico { font-size: 19px; line-height: 1; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background-size: cover; background-position: center; }
.tab.on { color: var(--accent); }

.panel { position: fixed; inset: 0 0 calc(var(--tabbar-h) + var(--safe-bottom)) 0; z-index: 1150; background: var(--bg); overflow-y: auto;
  padding: calc(14px + var(--safe-top)) 16px 24px; }
.panel[hidden] { display: none; }
.panel > * { max-width: 640px; margin-left: auto; margin-right: auto; }
.panel-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.panel-head h1 { margin: 0; font-size: 26px; }
.sub, .muted { color: var(--muted); }
.chips.inline { position: static; margin: 0 auto 12px; padding: 0; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.list { display: grid; gap: 10px; }
.empty { color: var(--muted); text-align: center; padding: 40px 16px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.card.center { text-align: center; display: grid; gap: 10px; }
.card h3 { margin: 0; font-size: 15px; }
.stack { display: grid; gap: 12px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.deal { display: grid; grid-template-columns: 48px 1fr; gap: 12px; align-items: start; }
.deal .logo { width: 48px; height: 48px; border-radius: 12px; font-size: 18px; }
.deal h4 { margin: 0 0 2px; font-size: 16px; }
.deal .biz { color: var(--muted); font-size: 13px; }
.deal .meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; }
.deal .btns { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.deal.expired { opacity: .5; }
.kind { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); }

.mini { border: 1px solid var(--line); background: var(--soft); color: var(--text); padding: 7px 11px; border-radius: 10px; font-weight: 600; font-size: 13px; cursor: pointer; }
.mini.on { border-color: var(--accent); color: var(--accent); }
.promo .mini { margin-top: 8px; }
.code-reveal { font-family: ui-monospace, monospace; letter-spacing: .08em; }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--soft); border-radius: 12px; padding: 4px; margin-bottom: 12px; }
.seg button { border: 0; background: none; color: var(--muted); padding: 9px; border-radius: 9px; font-weight: 700; cursor: pointer; }
.seg button.on { background: var(--accent); color: var(--accent-ink); }

label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
input:not([type=checkbox]):not([type=file]) { width: 100%; padding: 11px 12px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--field); color: var(--text); font-size: 16px; outline: none; }
input:focus { border-color: var(--accent); }
label.check { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 14px; }
.toggle { display: flex; justify-content: space-between; align-items: center; color: var(--text); font-size: 14px; }
.toggle input { appearance: none; width: 44px; height: 26px; border-radius: 999px; background: var(--toggle-off); position: relative; cursor: pointer; flex: none; transition: background .15s; }
.toggle input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; }
.toggle input:checked { background: var(--accent); }
.toggle input:checked::after { transform: translateX(18px); background: var(--accent-ink); }
#nGroup.off { opacity: .4; pointer-events: none; }

.avatar-row { display: flex; gap: 14px; align-items: center; }
.avatar { width: 72px; height: 72px; border-radius: 50%; background: var(--soft) center/cover; border: 2px solid var(--accent); cursor: pointer;
  display: grid; place-items: center; color: var(--accent); font-size: 28px; font-weight: 900; flex: none; }
.linkish { background: none; border: 0; color: var(--accent); font-weight: 700; padding: 6px 0; cursor: pointer; font-size: 14px; }
.act.danger { color: var(--danger); border-color: rgba(255,90,90,.4); }
.act[disabled] { opacity: .5; pointer-events: none; }

.auth-card { position: relative; width: min(380px, 100%); text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 22px 18px; }
.auth-card .brand { justify-self: start; }
.auth-card h2 { margin: 0; }
.auth-card .close { top: 12px; }
.msg { margin: 0; min-height: 1em; font-size: 14px; color: var(--warn); }
.msg.ok { color: var(--accent); }
label[hidden] { display: none; }
#auth { z-index: 2100; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar-h) + 22px + var(--safe-bottom)); z-index: 2200;
  background: var(--accent); color: var(--accent-ink); font-weight: 700; padding: 9px 14px; border-radius: 999px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: opacity .2s; }
.toast.show { opacity: 1; }

@media (min-width: 720px) {
  .sheet { bottom: calc(var(--tabbar-h) + 16px); }
}
.small-link { display: block; margin-top: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.report { margin-top: 10px; }
.report select, .report textarea { width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--field); color: var(--text); font: inherit; }

/* ===== Deal graphics + pop-up ===== */
.promo-img { display: block; width: calc(100% + 24px); margin: -10px -12px 8px; aspect-ratio: 3 / 1; object-fit: cover; border-radius: 13px 13px 0 0; }
.deal.has-img { padding-top: 0; overflow: hidden; }
.deal-img { grid-column: 1 / -1; width: calc(100% + 28px); margin: 0 -14px 4px; aspect-ratio: 3 / 1; object-fit: cover; display: block; }

.dealpop { position: fixed; inset: 0; z-index: 1900; display: grid; place-items: center; padding: 16px; }
.dp-scrim { position: absolute; inset: 0; background: rgba(0,0,0,.6); }
.dp-card { position: relative; width: min(400px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: var(--panel);
  border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 20px 60px rgba(0,0,0,.6); animation: dpIn .22s ease-out; }
@keyframes dpIn { from { transform: translateY(16px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.dp-close { position: absolute; top: 10px; right: 10px; z-index: 2; width: 34px; height: 34px; border-radius: 50%; border: 0;
  background: rgba(0,0,0,.55); color: #fff; font-size: 22px; line-height: 1; cursor: pointer; }
.dp-banner { aspect-ratio: 3 / 1; background: var(--soft); overflow: hidden; border-radius: 22px 22px 0 0; }
.dp-banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dp-banner.empty { aspect-ratio: 4 / 1; background: radial-gradient(circle at 20% 30%, rgba(182,255,59,.35), transparent 60%), linear-gradient(135deg, #1d2620, #0b0f0c); }
.dp-logo { width: 68px; height: 68px; border-radius: 18px; margin: -34px 0 0 18px; position: relative; background: var(--field) center/cover;
  border: 3px solid var(--panel); box-shadow: 0 4px 14px rgba(0,0,0,.5); display: grid; place-items: center; font-weight: 900; font-size: 26px; color: var(--accent); }
.dp-body { padding: 10px 18px 18px; display: grid; gap: 8px; }
.dp-kind { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.dp-body h2 { margin: 0; font-size: 22px; line-height: 1.2; }
.dp-store { color: var(--muted); font-size: 14px; }
.dp-details { margin: 0; }
.dp-code .act { width: 100%; }
.dp-code code { display: block; text-align: center; font-size: 22px; padding: 10px; border: 2px dashed var(--accent); border-radius: 12px; color: var(--accent); background: var(--field); }
.dp-terms { margin: 0; color: var(--muted); font-size: 12px; }
.dp-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dp-actions .save-promo.on { border-color: var(--accent); color: var(--accent); }
.dp-nav { display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--muted); font-size: 13px; }
@media (prefers-reduced-motion: reduce) { .dp-card { animation: none; } }
.legal-links { margin-top: 18px; text-align: center; font-size: 13px; color: var(--muted); line-height: 1.8; }
.legal-links a { color: var(--muted); }
.legal-links div { margin-top: 6px; font-size: 12px; }
.gate-legal { font-size: 12px; color: var(--muted); }
.gate-legal a { color: var(--muted); }

/* ===== Branding from Admin → App appearance ===== */
.brand { display: flex; align-items: center; gap: 8px; }
.brand.has-logo { padding-top: 6px; padding-bottom: 6px; }
.brand img { display: block; width: auto; max-width: 160px; object-fit: contain; }
.brand.no-pill { background: none; box-shadow: none; padding-left: 0; color: var(--accent); }
.target .core, .target .ring, .target .pulse { transition: none; }

/* ===== Logo + loading screen ===== */
.logo-big { display: block; width: min(240px, 70vw); height: auto; margin: 0 auto 14px; filter: drop-shadow(0 6px 18px rgba(0,0,0,.6)); }
.auth-card .logo-big { width: 150px; margin: 0 0 6px; }
.brand.has-logo.no-pill img { filter: drop-shadow(0 2px 6px rgba(0,0,0,.75)); }

#loader { position: fixed; inset: 0; z-index: 5000; display: grid; place-items: center; background: #0b0f0c; overflow: hidden;
  transition: opacity .55s ease, transform .55s ease; }
#loader.ld-done { opacity: 0; transform: scale(1.04); pointer-events: none; }
.ld-glow { position: absolute; width: 140vmax; height: 140vmax; left: 50%; top: 50%; transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(40,170,70,.28) 0, rgba(40,170,70,.08) 22%, transparent 45%); animation: ldBreathe 3.2s ease-in-out infinite; }
.ld-stage { position: relative; display: grid; justify-items: center; gap: 18px; width: min(320px, 78vw); }
.ld-logo { position: relative; width: 100%; --mask: url("img/beto-logo.webp"); animation: ldIn .9s cubic-bezier(.2,.9,.2,1.15) both, ldFloat 3.4s ease-in-out .9s infinite; }
.ld-logo img { display: block; width: 100%; height: auto; filter: drop-shadow(0 10px 30px rgba(0,0,0,.7)); }
/* light sweep clipped to the logo's shape */
.ld-shine { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.75) 48%, rgba(255,250,210,.25) 55%, transparent 65%) no-repeat;
  background-size: 250% 100%; animation: ldShine 2.4s ease-in-out .7s infinite;
  -webkit-mask: var(--mask) center / 100% 100% no-repeat; mask: var(--mask) center / 100% 100% no-repeat; mix-blend-mode: screen; }
/* "you are here" pulses from the pin inside the O */
/* centered on the dot inside the map pin of the logo (84.83% across, 61.05% down) */
.ld-rings { position: absolute; left: 84.83%; top: 61.05%; width: 0; height: 0; }
.ld-rings::before { content: ''; position: absolute; left: 0; top: 0; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 10px 2px color-mix(in srgb, var(--accent) 85%, transparent); animation: ldDot 2.1s ease-in-out 1s infinite; }
@keyframes ldDot { 0%, 100% { transform: scale(1); opacity: .95; } 50% { transform: scale(1.35); opacity: 1; } }
.ld-rings span { position: absolute; left: 0; top: 0; width: 60px; height: 60px; margin: -30px 0 0 -30px; border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--accent) 85%, transparent); box-shadow: 0 0 14px color-mix(in srgb, var(--accent) 60%, transparent); opacity: 0; animation: ldPulse 2.1s ease-out 1s infinite; }
.ld-rings span:nth-child(2) { animation-delay: 1.7s; }
.ld-rings span:nth-child(3) { animation-delay: 2.4s; }
.ld-msg { margin: 0; color: #c9d3c6; font-size: min(14px, 3.05vw); letter-spacing: .02em; font-weight: 600; white-space: nowrap; min-height: 1.4em; text-align: center; animation: ldFade .6s ease .5s both; }
.ld-bar { width: 62%; height: 3px; border-radius: 3px; background: rgba(255,255,255,.08); overflow: hidden; animation: ldFade .6s ease .6s both; }
.ld-bar i { display: block; height: 100%; width: 35%; border-radius: 3px; background: linear-gradient(90deg, #1f9d43, #e8c25a, #1f9d43); animation: ldSlide 1.3s ease-in-out infinite; }
@keyframes ldIn { from { opacity: 0; transform: translateY(14px) scale(.86); } to { opacity: 1; transform: none; } }
@keyframes ldFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes ldShine { 0% { background-position: 130% 0; } 60%, 100% { background-position: -130% 0; } }
@keyframes ldPulse { 0% { transform: scale(.22); opacity: .95; } 100% { transform: scale(3.2); opacity: 0; } }
@keyframes ldBreathe { 0%, 100% { opacity: .75; } 50% { opacity: 1; } }
@keyframes ldFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ldSlide { 0% { transform: translateX(-110%); } 100% { transform: translateX(300%); } }
@media (prefers-reduced-motion: reduce) {
  .ld-logo, .ld-shine, .ld-rings span, .ld-glow, .ld-bar i { animation: none !important; }
  .ld-rings span { display: none; } .ld-rings::before { animation: none; }
}

/* ===== Side tabs (Admin → Side tabs) ===== */
.st-stack { position: fixed; z-index: 1050; top: calc(118px + var(--safe-top)); bottom: calc(var(--tabbar-h) + 96px + var(--safe-bottom));
  display: flex; flex-direction: column; justify-content: center; gap: 10px; pointer-events: none; }
.st-stack.left { left: 0; } .st-stack.right { right: 0; }
.st-tab { pointer-events: auto; border: 0; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 7px; font: 800 12px/1 system-ui, sans-serif; letter-spacing: .06em; text-transform: uppercase;
  box-shadow: 0 6px 18px rgba(0,0,0,.45); max-height: 170px; overflow: hidden; animation: stNudge 6s ease-in-out 4s infinite; }
.st-tab span { writing-mode: vertical-rl; white-space: nowrap; }
.st-stack.left .st-tab { border-radius: 0 12px 12px 0; --nudge: 4px; }
.st-stack.left .st-tab span { transform: rotate(180deg); }
.st-stack.right .st-tab { border-radius: 12px 0 0 12px; --nudge: -4px; }
.st-tab img { width: 22px; height: 22px; object-fit: contain; border-radius: 6px; }
@keyframes stNudge { 0%, 90%, 100% { transform: none; } 94% { transform: translateX(var(--nudge)); } 97% { transform: none; } }

.st-scrim { position: fixed; inset: 0; z-index: 1600; background: rgba(0,0,0,.5); opacity: 0; transition: opacity .3s; }
.st-scrim.open { opacity: 1; }
.st-panel { position: fixed; z-index: 1650; top: 0; bottom: calc(var(--tabbar-h) + var(--safe-bottom)); width: min(380px, 90vw);
  background: var(--st-bg, #141a16); color: var(--st-fg, #f2f5f1); overflow: hidden; box-shadow: 0 0 40px rgba(0,0,0,.6);
  transition: transform .32s cubic-bezier(.2,.8,.2,1); }
.st-panel.left { left: 0; transform: translateX(-105%); border-radius: 0 22px 22px 0; }
.st-panel.right { right: 0; transform: translateX(105%); border-radius: 22px 0 0 22px; }
.st-panel.open { transform: translateX(0); }
.st-bg { position: absolute; inset: 0; background: center / cover no-repeat; }
.st-bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.1), rgba(0,0,0,.55)); }
.st-bg:not([style*="url"])::after { display: none; }
.st-inner { position: relative; height: 100%; overflow-y: auto; padding: calc(14px + var(--safe-top)) 18px 22px; display: grid; gap: 12px; align-content: start; }
.st-top { display: flex; justify-content: space-between; align-items: center; }
.st-spon { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; opacity: .75; }
.st-close { width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(0,0,0,.4); color: #fff; font-size: 24px; line-height: 1; cursor: pointer; margin-left: auto; }
.st-gallery { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; border-radius: 16px; scrollbar-width: none; }
.st-gallery::-webkit-scrollbar { display: none; }
.st-gallery img { flex: 0 0 100%; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; scroll-snap-align: start; display: block; }
.st-dots { display: flex; justify-content: center; gap: 6px; margin-top: -4px; }
.st-dots:empty { display: none; }
.st-dots i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .3; }
.st-dots i.on { opacity: 1; }
.st-panel h2 { margin: 0; font-size: 24px; line-height: 1.2; }
.st-body { margin: 0; white-space: pre-line; opacity: .92; }
.st-code .act { width: 100%; background: var(--st-accent); color: var(--st-accent-ink); border-color: var(--st-accent); }
.st-code code { display: block; text-align: center; font-size: 22px; letter-spacing: .08em; padding: 10px; border-radius: 12px; border: 2px dashed var(--st-accent); color: var(--st-accent); background: rgba(0,0,0,.35); }
.st-code:empty, .st-cta:empty { display: none; }
.st-terms { margin: 0; font-size: 12px; opacity: .7; }
.st-cta .act { width: 100%; background: rgba(255,255,255,.12); color: inherit; border-color: rgba(255,255,255,.25); }
@media (prefers-reduced-motion: reduce) { .st-tab { animation: none; } .st-panel, .st-scrim { transition: none; } }

/* ===== Bottom nav: selected item is always BETO green ===== */
:root { --nav-on: var(--accent); }   /* same color as the map's location dots */
.tab { color: var(--tab-idle); transition: color .15s; }
.tab .ico { width: 26px; height: 26px; font-size: 15px; font-weight: 800; }
.tab .ico svg { width: 24px; height: 24px; display: block; }
.tab.on { color: var(--nav-on); }
.tab.on .ico svg { filter: drop-shadow(0 0 6px color-mix(in srgb, var(--nav-on) 60%, transparent)); }
.tab.on .ico svg path, .tab.on .ico svg circle:not([fill="currentColor"]) { fill: color-mix(in srgb, var(--nav-on) 20%, transparent); }
.tab.on #tabAvatar[style*="url"] { box-shadow: 0 0 0 2px var(--nav-on); }
.tab.on #tabAvatar:not([style*="url"]):not(:has(svg)) { background: var(--nav-on); color: var(--accent-ink); }
.brand.black-pill { background: #000; color: #fff; box-shadow: 0 4px 18px rgba(0,0,0,.5); }
.web { margin: -6px 0 12px; font-size: 14px; }
.web a { color: var(--accent); text-decoration: none; font-weight: 600; }
.web a::before { content: '🌐 '; }
.hours small { font-size: 12px; }

/* Reminders */
.rem-card .dp-body h3 { margin: 4px 0 2px; font-size: 19px; }
.rem-presets { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 10px; }
.rem-label { display: grid; gap: 6px; font-size: 13px; color: var(--muted, #9aa59c); margin-top: 8px; }
.rem-label input { width: 100%; box-sizing: border-box; }
.rem-msg { color: var(--danger, #ff5a5a); font-size: 13px; min-height: 1em; margin: 8px 0 0; }
.rem-ico { display: grid; place-items: center; font-size: 22px; }

/* Show/hide password */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 68px !important; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: transparent; border: 0;
  color: var(--accent); font: 600 13px/1 inherit; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.pw-toggle:focus-visible { outline: 2px solid var(--accent); }

/* ===== Light mode (Profile → Appearance). Dark is the default. ===== */
:root[data-theme="light"] {
  --bg: #f4f6f3; --panel: #ffffff; --line: #d9e0da; --text: #111712; --muted: #5c6a60;
  --soft: #edf1ec; --field: #ffffff; --glass: rgba(255,255,255,.94); --bar: rgba(255,255,255,.97); --gate-bg: rgba(244,246,243,.98);
  --toggle-off: #c9d2cb; --tab-idle: #6b786f; --accent-text: #3d7a00; --shadow: rgba(20,30,20,.18);
  --warn: #b26a00; --danger: #c62828; --info: #1769aa;
  color-scheme: light;
}
:root[data-theme="dark"] { color-scheme: dark; }
:root[data-theme="light"] .leaflet-container { background: #e9ece8; }
/* green text on white needs a darker green to stay readable */
:root[data-theme="light"] :is(.promo b, .kind, .dp-kind, .linkish, .web a, .hours .open, .badge.ok, .msg.ok, .mini.on, .dp-actions .save-promo.on,
  .pw-toggle, .logo, .avatar, .dp-logo, .dp-code code, .brand.no-pill, .match.ok b) { color: var(--accent-text); }
:root[data-theme="light"] { --nav-on: var(--accent-text); }
:root[data-theme="light"] .mini.on, :root[data-theme="light"] .promo, :root[data-theme="light"] .dp-code code { border-color: var(--accent-text); }
:root[data-theme="light"] .badge.ok { background: rgba(61,122,0,.12); }
:root[data-theme="light"] .badge.warn { background: rgba(178,106,0,.12); }
:root[data-theme="light"] .avatar { border-color: var(--accent-text); }
:root[data-theme="light"] .sheet, :root[data-theme="light"] .fab, :root[data-theme="light"] .dp-card { box-shadow: 0 -6px 24px var(--shadow); }
:root[data-theme="light"] .fab { color: var(--accent-text); box-shadow: 0 4px 14px var(--shadow); }
:root[data-theme="light"] .dp-scrim, :root[data-theme="light"] .st-scrim { background: rgba(20,30,20,.35); }
:root[data-theme="light"] .dp-banner.empty { background: radial-gradient(circle at 20% 30%, rgba(120,200,40,.35), transparent 60%), linear-gradient(135deg, #e6efe0, #f7faf5); }
:root[data-theme="light"] .target .core { box-shadow: 0 0 0 1.5px rgba(0,0,0,.45), 0 0 8px var(--mk, var(--accent)); }
:root[data-theme="light"] .target .ring, :root[data-theme="light"] .target .pulse { filter: drop-shadow(0 0 1px rgba(0,0,0,.6)); }
:root[data-theme="light"] .beto-cluster { box-shadow: 0 0 0 1.5px rgba(0,0,0,.35), 0 0 0 6px rgba(120,200,40,.3); }
:root[data-theme="light"] .brand.has-logo.no-pill img { filter: drop-shadow(0 1px 3px rgba(0,0,0,.35)); }
:root[data-theme="light"] .tab.on .ico svg { filter: none; }
:root[data-theme="light"] .toast { color: #0b0f0c; }
:root[data-theme="light"] input:not([type=checkbox]):not([type=file]), :root[data-theme="light"] select, :root[data-theme="light"] textarea { color: var(--text); }
:root[data-theme="light"] .leaflet-control-attribution { background: rgba(255,255,255,.8); }

/* ===== Custom map markers (Admin → Map pins & markers) ===== */
.target { --mk: var(--accent); }
.target .core { inset: 32%; } .target .ring { inset: 11%; }
.target .core { background: var(--mk); box-shadow: 0 0 10px var(--mk); display: grid; place-items: center; }
.target .ring, .target .pulse { border-color: var(--mk); }
.target.unverified { --mk: var(--warn); }
.target .core i { font-style: normal; font-size: 11px; line-height: 1; color: #0b0f0c; font-weight: 900; }
.target.has-glyph .core { inset: 22%; }
.target.mk-solid .pulse { display: none; }
.target.mk-solid .ring { display: none; }
.target.mk-solid .core { inset: 14%; border: 2px solid rgba(255,255,255,.85); }
.target.mk-ring .pulse { display: none; }
.target.featured .core { box-shadow: 0 0 0 2px #fff, 0 0 16px var(--mk); }
.target.featured .pulse { animation-duration: 1.2s; }

/* ===== Settings, business & advertising ===== */
.theme-seg { margin: 0; }
.theme-seg button { font-size: 14px; }
.small { font-size: 12px; }
.back-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--soft); color: var(--text); font-size: 24px; line-height: 1; cursor: pointer; padding: 0 0 3px; }
.adv-link { margin-left: auto; font-size: 13px; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.act.small { padding: 8px 12px; font-size: 13px; }
.biz-line { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--soft); border-left: 4px solid var(--line); }
.biz-line span { color: var(--muted); font-size: 13px; }
.biz-line.ok, .biz-status.ok { border-left-color: var(--accent); }
.biz-line.wait, .biz-status.wait { border-left-color: var(--info); }
.biz-line.warn, .biz-status.warn { border-left-color: var(--warn); }
.biz-line.bad, .biz-status.bad { border-left-color: var(--danger); }
.biz-status { border-left: 5px solid var(--line); display: grid; gap: 6px; }
.biz-status h2 { margin: 0; font-size: 20px; }
.biz-status p { margin: 0; }
.biz-line-big { font-weight: 700; font-size: 15px; }
.biz-form select, .biz-form textarea, .ai-card select, .ai-card textarea { width: 100%; padding: 11px 12px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--field); color: var(--text); font: inherit; font-size: 16px; outline: none; }
.biz-form textarea, .ai-card textarea { resize: vertical; min-height: 70px; }
.biz-form select:focus, .biz-form textarea:focus, .ai-card select:focus, .ai-card textarea:focus { border-color: var(--accent); }
.inline-btn { display: flex; gap: 8px; } .inline-btn input { flex: 1; }
.linkish.inline { display: inline; padding: 0; font-size: inherit; }
.match { padding: 10px 12px; border-radius: 12px; font-size: 14px; line-height: 1.45; }
.match.ok { background: rgba(182,255,59,.12); border: 1px solid rgba(182,255,59,.35); }
.match.no { background: rgba(255,181,71,.1); border: 1px solid rgba(255,181,71,.35); }
.warn-text { color: var(--warn); }
.agreement { font-size: 13px; background: var(--soft); border-radius: 12px; padding: 4px 12px; }
.agreement ul { padding-left: 18px; margin: 6px 0; }
.note { font-size: 13px; padding: 8px 10px; border-radius: 10px; background: var(--soft); margin: 8px 0 0; }
.note.wait { border-left: 3px solid var(--info); } .note.bad { border-left: 3px solid var(--danger); }
.deal.mine { grid-template-columns: 1fr; }
.deal.mine .deal-img { grid-column: 1; }
.deal-full .offer { font-weight: 800; color: var(--accent-text); }
.badge.info { background: rgba(108,196,255,.15); color: var(--info); }
.badge.wait { background: rgba(108,196,255,.15); color: var(--info); }
.badge.bad { background: rgba(255,90,90,.15); color: var(--danger); }
.banner-prev { aspect-ratio: 3 / 1; border-radius: 12px; border: 1px dashed var(--line); background: var(--soft); overflow: hidden; display: grid; place-items: center;
  color: var(--muted); font-size: 13px; text-align: center; }
.banner-prev img { width: 100%; height: 100%; object-fit: cover; display: block; }
.banner-prev span { padding: 12px; }
label.mini { display: inline-block; }
.lbl { font-size: 13px; color: var(--muted); }
.ai-card { max-height: calc(100vh - 32px); overflow-y: auto; }
.ai-card h2 { margin: 0; }
#adInquiry { z-index: 2150; }
.stack.center { text-align: center; }

/* Banners: sit above the tab bar / below the filter chips, never over navigation */
.ad-banner { position: fixed; left: 0; right: 0; z-index: 1060; display: flex; pointer-events: none; }
.ad-banner.bottom { bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 6px); }
.ad-banner.bottom.on-map { bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 80px); }
.ad-banner.top { top: calc(108px + var(--safe-top)); }
.ad-banner.top:not(.on-map) { top: calc(8px + var(--safe-top)); }
.ad-banner.al-left { justify-content: flex-start; } .ad-banner.al-center { justify-content: center; } .ad-banner.al-right { justify-content: flex-end; }
.ad-box { pointer-events: auto; position: relative; margin: 0 var(--ad-m); max-width: 640px; display: flex; align-items: center; gap: 12px; overflow: hidden;
  background: var(--ad-bg); color: var(--ad-fg); border-radius: var(--ad-r); box-shadow: 0 8px 24px rgba(0,0,0,.35); padding: 10px 40px 10px 12px; }
.ad-box > img { width: 34%; max-width: 180px; height: 100%; border-radius: calc(var(--ad-r) * .6); flex: none; display: block; margin: -2px 0; }
.ad-box.image-only { padding: 0; }
.ad-box.image-only > img { width: 100%; max-width: none; height: 100%; border-radius: 0; margin: 0; }
.ad-text { display: grid; gap: 2px; min-width: 0; flex: 1; }
.ad-text b { font-size: 15px; line-height: 1.2; }
.ad-text span { font-size: 13px; opacity: .85; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ad-cta { flex: none; border: 0; border-radius: 10px; padding: 9px 12px; background: var(--ad-accent); color: #0b0f0c; font: 700 13px/1 system-ui, sans-serif;
  text-decoration: none; cursor: pointer; white-space: nowrap; }
.ad-box.image-only .ad-cta { position: absolute; right: 44px; bottom: 8px; }
.ad-label { position: absolute; left: 10px; bottom: 4px; font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; opacity: .7; }
.ad-box:not(.image-only) .ad-label { position: absolute; top: 4px; bottom: auto; right: 40px; left: auto; }
.ad-box.image-only .ad-label { background: rgba(0,0,0,.55); color: #fff; padding: 2px 6px; border-radius: 6px; opacity: 1; left: 8px; top: 6px; bottom: auto; }
.ad-label.inline { position: static; display: inline-block; }
.ad-x { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(0,0,0,.45); color: #fff;
  font-size: 18px; line-height: 1; cursor: pointer; }
body.has-ad-bottom .panel { padding-bottom: calc(var(--ad-h, 96px) + 40px); }
body.has-ad-top .panel { padding-top: calc(var(--ad-h, 96px) + 24px + var(--safe-top)); }

.ad-pop { position: fixed; inset: 0; z-index: 1950; display: grid; place-items: center; padding: 16px; }
.ad-scrim { position: absolute; inset: 0; background: rgba(0,0,0,.6); }
.ad-pop-card { position: relative; max-height: calc(100vh - 40px); overflow-y: auto; background: var(--ad-bg); color: var(--ad-fg); border-radius: var(--ad-r);
  box-shadow: 0 20px 60px rgba(0,0,0,.55); animation: dpIn .22s ease-out; }
.ad-pop-x { position: absolute; top: 10px; right: 10px; z-index: 2; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff;
  font-size: 22px; line-height: 1; cursor: pointer; }
.ad-pop-img img { width: 100%; height: 100%; display: block; }
.ad-pop-body { padding: 14px 18px 18px; display: grid; gap: 8px; }
.ad-pop-body.tight { padding: 10px 14px 14px; }
.ad-pop-body h2 { margin: 0; font-size: 22px; line-height: 1.2; }
.ad-pop-body p { margin: 0; opacity: .9; }
.ad-pop-body .ad-cta { justify-self: stretch; text-align: center; padding: 12px; font-size: 15px; }
@media (prefers-reduced-motion: reduce) { .ad-pop-card { animation: none; } }
.panel > .card, .panel > #bizCard { margin-bottom: 12px; }

/* The BETO logo is white: show it dark on light backgrounds (uploaded custom logos are left as-is) */
:root[data-theme="light"] .topbar .brand.has-logo img[src*="beto-logo"], :root[data-theme="light"] .brand img[src*="beto-logo"], :root[data-theme="light"] img.logo-big[src*="beto-logo"] { filter: brightness(0) drop-shadow(0 1px 2px rgba(255,255,255,.6)); }

/* ===== Login screen + full-screen popups: always centered, scroll when the screen is short (landscape) ===== */
.gate { display: flex; flex-direction: column; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: calc(16px + var(--safe-top)) 16px calc(16px + var(--safe-bottom)); }
.gate > .gate-card { margin: auto; flex: none; }
.auth-card { text-align: center; justify-items: stretch; width: min(400px, 100%); max-width: 400px; padding: 26px 22px 22px; }
.auth-card .logo-big { width: 160px; margin: 2px auto 4px; }
.auth-card h2 { text-align: center; }
#authReason { margin: -4px 0 0; text-align: center; }
.auth-card .seg { margin: 4px 0; }
.auth-card label { text-align: left; }
.auth-card label.check { text-align: left; align-items: flex-start; line-height: 1.35; }
.auth-card label.check input { margin-top: 2px; flex: none; }
.auth-card .act { width: 100%; padding: 13px 4px; font-size: 15px; }
.auth-card .linkish { justify-self: center; }
.auth-card .msg { text-align: center; }
.auth-card .msg:empty { display: none; }
.captcha { display: grid; justify-items: center; gap: 4px; min-height: 0; }
.captcha .cap-box:empty { display: none; }
.captcha .cap-note { font-size: 12px; text-align: center; }
.cap-err { color: var(--warn); }
@media (orientation: landscape) and (max-height: 520px) {
  .auth-card { gap: 8px; padding: 18px 18px 16px; }
  .auth-card .logo-big { width: 120px; }
}
.del-card { margin-top: 6px; }
.del-card h3 { color: var(--danger); }

/* Loading screen: logo, message and bar share one centered column (the message used to push the column wider than the screen center) */
.ld-stage { grid-template-columns: minmax(0, 1fr); width: min(340px, 84vw); }
.ld-logo { justify-self: stretch; }
.ld-msg { white-space: nowrap; max-width: 100%; font-size: min(14px, 3.2vw); }   /* one line, always narrower than the column */

/* Loading message: always centered directly under the logo (centered even if a phone's font makes it wider) */
.ld-msg { justify-self: center; width: max-content; max-width: none; text-align: center; }
