[hidden] { display: none !important; }
:root {
  --bg: #0b0f0c; --panel: #141a16; --line: #26302a; --text: #f2f5f1; --muted: #9aa69e;
  --accent: #b6ff3b; --accent-ink: #0b0f0c; --warn: #ffb547; --danger: #ff5a5a;
  --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: rgba(20,26,22,.92); 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: #1d2620; 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: rgba(20,26,22,.92); 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: #1d2620 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: #1d2620; 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(5, 1fr); gap: 8px; }
.act { display: grid; place-items: center; text-align: center; padding: 11px 4px; border-radius: 12px; background: #1d2620; 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: #1d2620; 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: rgba(11,15,12,.97); 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: rgba(11,15,12,.96); 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: #1d2620; 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: #1d2620; 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: #0f1411; 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: #2a352e; 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: #1d2620 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: #0f1411; 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: #1d2620; 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: #0f1411 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: #0f1411; }
.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 */
.ld-rings { position: absolute; left: 84.6%; top: 64%; width: 0; height: 0; }
.ld-rings span { position: absolute; left: 0; top: 0; width: 60px; height: 60px; margin: -30px 0 0 -30px; border-radius: 50%;
  border: 2px solid rgba(46,230,90,.85); box-shadow: 0 0 14px rgba(46,230,90,.6); 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: 15px; letter-spacing: .02em; 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(.4); opacity: .9; } 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; }
}
