/* Leaplove — mobile-first stylesheet shared by every public and business page.
   Colors, type and spacing come from the app-forge theme (app-forge/base.css + app-forge/theme.css,
   theme "leaplove"); this file only maps them to Leaplove's own names. No hard-coded colors here. */

:root {
  --brand: var(--ui-accent);
  --brand-dark: var(--ui-accent-hover);
  --brand-soft: color-mix(in srgb, var(--ui-accent) 12%, var(--ui-surface));
  --pink: var(--ui-highlight);
  --pink-soft: var(--ui-highlight-bg);
  --sun: var(--ui-warning);
  --sun-soft: var(--ui-warning-bg);
  --ink: var(--ui-fg);
  --ink-2: var(--ui-muted);
  --ink-3: var(--ui-faint);
  --line: var(--ui-line);
  --line-soft: color-mix(in srgb, var(--ui-line) 60%, var(--ui-surface));
  --bg: var(--ui-canvas);
  --surface: var(--ui-surface);
  --subtle: var(--ui-subtle);
  --hover: var(--ui-hover);
  --danger: var(--ui-danger);
  --danger-soft: var(--ui-danger-bg);
  --ok: var(--ui-success);
  --ok-soft: var(--ui-success-bg);
  --info: var(--ui-info);
  --on-accent: var(--ui-on-accent);
  --scrim: color-mix(in srgb, var(--ui-fg) 50%, transparent);
  --shade: color-mix(in srgb, var(--ui-fg) 12%, transparent);
  --radius: var(--ui-radius-lg, 0.875rem);
  --radius-sm: var(--ui-radius-md, 0.625rem);
  --shadow: 0 0.0625rem 0.125rem color-mix(in srgb, var(--ui-fg) 6%, transparent), 0 0.25rem 1rem color-mix(in srgb, var(--ui-fg) 6%, transparent);
  --shadow-lg: 0 0.625rem 2.5rem color-mix(in srgb, var(--ui-fg) 18%, transparent);
  --tap: max(var(--ui-layout-touch-target, 2.75rem), 2.875rem);
  --header-h: 3.5rem;
  --nav-h: 4rem;
  --safe-b: env(safe-area-inset-bottom, 0px);
  font-family: var(--ui-font-body);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: calc(var(--nav-h) + var(--safe-b));
  -webkit-tap-highlight-color: transparent;
}
body.no-nav { padding-bottom: var(--safe-b); }
img { max-width: 100%; display: block; }
a { color: var(--brand-dark); }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
small, .muted { color: var(--ink-3); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--ui-focus) 45%, transparent); outline-offset: 2px; }

/* ---------- App bar ---------- */
.appbar {
  position: sticky; top: 0; z-index: 40;
  height: var(--header-h);
  display: flex; align-items: center; gap: 8px;
  padding: 0 12px;
  padding-top: env(safe-area-inset-top, 0px);
  height: calc(var(--header-h) + env(safe-area-inset-top, 0px));
  background: color-mix(in srgb, var(--ui-surface) 94%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.appbar .brand { display: flex; align-items: center; gap: 6px; text-decoration: none; color: var(--ink); min-width: 0; }
.appbar .brand img { height: 1.875rem; width: auto; }
.appbar .brand picture { display: flex; }
.appbar .brand .wordmark { height: 2.25rem; }
.appbar .title { font-weight: 700; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar .spacer { flex: 1; }
.appbar .top-links { display: none; gap: 4px; }
.appbar .top-links a { text-decoration: none; color: var(--ink-2); font-weight: 600; padding: 8px 12px; border-radius: 999px; }
.appbar .top-links a[aria-current="page"], .appbar .top-links a:hover { background: var(--brand-soft); color: var(--brand-dark); }

.icon-btn {
  width: var(--tap); height: var(--tap); flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: transparent; color: var(--ink); border-radius: 50%;
  cursor: pointer; text-decoration: none;
}
.icon-btn:hover { background: var(--line-soft); }
.icon { width: 22px; height: 22px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon.sm { width: 18px; height: 18px; }
.icon.lg { width: 28px; height: 28px; }

/* ---------- Bottom nav (phones) ---------- */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--nav-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: color-mix(in srgb, var(--ui-surface) 97%, transparent);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.bottom-nav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  text-decoration: none; color: var(--ink-3); font-size: .72rem; font-weight: 600;
}
.bottom-nav a[aria-current="page"] { color: var(--brand); }
.bottom-nav a .icon { width: 24px; height: 24px; }

/* ---------- Layout ---------- */
.page { width: 100%; max-width: 720px; margin: 0 auto; padding: 16px; }
.page.wide { max-width: 1040px; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.grid-2 { display: grid; gap: 12px; grid-template-columns: 1fr; }
.section-title { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin: 24px 0 10px; }

.card {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px; border: 1px solid color-mix(in srgb, var(--ui-fg) 4%, transparent);
}
.card.flat { box-shadow: none; border: 1px solid var(--line); }
.card + .card { margin-top: 12px; }

/* ---------- Forms ---------- */
label, .label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; color: var(--ink-2); }
.field { margin-bottom: 14px; }
.field .hint { font-size: .82rem; color: var(--ink-3); margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=url], input[type=number], input[type=search], select, textarea {
  width: 100%; min-height: var(--tap);
  padding: 10px 14px;
  font: inherit; font-size: 16px; /* 16px stops iOS zooming into fields */
  color: var(--ink); background: var(--surface);
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2386919b' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ui-accent) 15%, transparent); }
input[readonly] { background: var(--subtle); color: var(--ink-2); }
.check { display: flex; align-items: center; gap: 10px; min-height: var(--tap); font-weight: 500; color: var(--ink); margin: 0; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--brand); margin: 0; }

.input-group { display: flex; gap: 8px; }
.input-group > input, .input-group > select { flex: 1 1 auto; min-width: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 10px 18px;
  border: 1.5px solid transparent; border-radius: 999px;
  font: inherit; font-weight: 700; font-size: 1rem; line-height: 1.1;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  background: var(--brand); color: var(--on-accent);
  transition: background .15s, transform .05s, box-shadow .15s;
}
.btn:hover { background: var(--brand-dark); }
.btn:active { transform: scale(.98); }
.btn[disabled], .btn.is-loading { opacity: .6; pointer-events: none; }
.btn.block { width: 100%; }
.btn.secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn.secondary:hover { background: var(--hover); }
.btn.ghost { background: transparent; color: var(--brand-dark); }
.btn.ghost:hover { background: var(--brand-soft); }
.btn.danger { background: var(--danger); }
.btn.danger-ghost { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, var(--surface)); }
.btn.pink { background: var(--pink); }
.btn.sm { min-height: 36px; padding: 6px 12px; font-size: .9rem; }
.btn.icon-only { width: var(--tap); padding: 0; flex: 0 0 auto; }
.btn .icon { width: 20px; height: 20px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row > .btn { flex: 1 1 0; }

.spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 3px solid color-mix(in srgb, var(--ui-accent) 20%, transparent); border-top-color: var(--brand);
  animation: spin .8s linear infinite; display: inline-block;
}
.btn .spinner { width: 18px; height: 18px; border-color: color-mix(in srgb, var(--on-accent) 40%, transparent); border-top-color: var(--on-accent); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Segmented tabs ---------- */
.tabs {
  display: flex; gap: 4px; padding: 4px; background: var(--hover); border-radius: 999px;
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  flex: 1 0 auto; min-height: 40px; padding: 8px 14px; border: 0; border-radius: 999px;
  background: transparent; font: inherit; font-weight: 600; font-size: .92rem; color: var(--ink-2);
  cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px var(--shade); }
.tabs .icon { width: 18px; height: 18px; }
@media (max-width: 440px) { .tabs .icon { display: none; } .tabs button { padding: 8px 6px; font-size: .9rem; } }

/* ---------- Chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto;
  min-height: 36px; padding: 6px 14px; border-radius: 999px;
  background: var(--surface); border: 1.5px solid var(--line); color: var(--ink-2);
  font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; text-decoration: none;
}
.chip[aria-pressed="true"], .chip.on { background: var(--brand); border-color: var(--brand); color: var(--on-accent); }
/* Category browse: chips grouped by industry, pick several (search page Category tab, home page). */
.cat-group + .cat-group { margin-top: 16px; }
.cat-group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.cat-group-head h3, .cat-group-head h2 { margin: 0; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.link-btn { background: none; border: 0; padding: 6px 0; min-height: 36px; font: inherit; font-size: .9rem; font-weight: 600; color: var(--brand-dark); cursor: pointer; text-decoration: none; }
.link-btn:hover { text-decoration: underline; }
.cat-actions {
  position: sticky; bottom: calc(var(--nav-h) + var(--safe-b) + 8px); z-index: 5;
  display: flex; align-items: center; gap: 8px; margin-top: 16px; padding: 8px 8px 8px 14px;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow);
}
.cat-actions[hidden] { display: none; }
.cat-actions .cat-count { flex: 1 1 auto; font-weight: 600; color: var(--ink-2); }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--sun-soft); color: var(--sun); }
.tag.teal { background: var(--brand-soft); color: var(--brand-dark); }
.tag.pink { background: var(--pink-soft); color: var(--pink); }
.tag.grey { background: var(--ui-neutral-bg); color: var(--ink-2); }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.bad { background: var(--danger-soft); color: var(--danger); }

/* ---------- Location bar ---------- */
.locbar {
  display: flex; align-items: center; gap: 8px; width: 100%;
  min-height: var(--tap); padding: 6px 6px 6px 12px;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  font: inherit; color: var(--ink); text-align: left; cursor: pointer;
}
.locbar .icon { color: var(--pink); }
.locbar .loc-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.locbar .loc-text small { font-weight: 500; }
.locbar .loc-change { color: var(--brand-dark); font-weight: 700; font-size: .9rem; padding: 0 8px; }

/* ---------- Messages ---------- */
.alert { padding: 12px 14px; border-radius: var(--radius-sm); font-size: .95rem; margin-bottom: 14px; display: flex; gap: 10px; align-items: flex-start; }
.alert.error { background: var(--danger-soft); color: var(--danger); }
.alert.success { background: var(--ok-soft); color: var(--ok); }
.alert.info { background: var(--brand-soft); color: var(--brand-dark); }
.alert.warn { background: var(--sun-soft); color: var(--sun); }

.toast-wrap { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + var(--safe-b) + 12px); z-index: 100; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
body.no-nav .toast-wrap { bottom: calc(var(--safe-b) + 16px); }
.toast { pointer-events: auto; max-width: 480px; width: 100%; background: var(--ink); color: var(--on-accent); padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); font-weight: 500; animation: toast-in .2s ease-out; }
.toast.error { background: var(--danger); }
.toast.success { background: var(--ok); }
@keyframes toast-in { from { transform: translateY(10px); opacity: 0; } }

.empty { text-align: center; padding: 36px 16px; color: var(--ink-3); }
.empty .icon { width: 44px; height: 44px; color: var(--ui-line-strong); margin: 0 auto 10px; }
.empty h3 { color: var(--ink-2); }
.loading-block { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 32px; color: var(--ink-3); }
.skeleton { background: linear-gradient(90deg, var(--hover) 25%, var(--subtle) 37%, var(--hover) 63%); background-size: 400% 100%; animation: shimmer 1.2s ease infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------- Bottom sheet / modal ---------- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 80; background: var(--scrim);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade .15s ease-out;
}
.sheet {
  width: 100%; max-width: 640px; max-height: 92vh; max-height: 92dvh;
  background: var(--surface); border-radius: 20px 20px 0 0;
  display: flex; flex-direction: column; overflow: hidden;
  animation: sheet-up .22s cubic-bezier(.2, .9, .3, 1);
  padding-bottom: var(--safe-b);
}
.sheet-head { display: flex; align-items: center; gap: 8px; padding: 10px 8px 6px 16px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { margin: 0; font-size: 1.1rem; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-body { padding: 16px; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.sheet-foot { padding: 12px 16px; border-top: 1px solid var(--line); background: var(--surface); }
.sheet-grip { width: 40px; height: 4px; border-radius: 4px; background: var(--ui-line-strong); margin: 8px auto 0; }
@keyframes sheet-up { from { transform: translateY(40px); opacity: .4; } }
@keyframes fade { from { opacity: 0; } }
body.sheet-open { overflow: hidden; }

/* ---------- Scanner ---------- */
.scanner { position: relative; background: black; border-radius: var(--radius); overflow: hidden; aspect-ratio: 3 / 4; max-height: 60vh; width: 100%; }
.scanner video { width: 100%; height: 100%; object-fit: cover; }
.scanner .frame { position: absolute; left: 10%; right: 10%; top: 35%; height: 30%; border: 3px solid rgba(255,255,255,.9); border-radius: 12px; box-shadow: 0 0 0 9999px rgba(0,0,0,.35); }
.scanner .frame::after { content: ""; position: absolute; left: 6px; right: 6px; top: 50%; height: 2px; background: var(--pink); box-shadow: 0 0 8px var(--pink); animation: scanline 1.6s ease-in-out infinite alternate; }
@keyframes scanline { from { transform: translateY(-30px); } to { transform: translateY(30px); } }
.scanner .scan-hint { position: absolute; left: 0; right: 0; bottom: 14px; text-align: center; color: var(--on-accent); font-weight: 600; text-shadow: 0 1px 4px rgba(0,0,0,.6); }

/* ---------- Home ---------- */
.hero {
  background:
    radial-gradient(120% 80% at 100% 0%, color-mix(in srgb, var(--ui-highlight) 14%, transparent), transparent 60%),
    radial-gradient(100% 80% at 0% 100%, color-mix(in srgb, var(--ui-accent) 18%, transparent), transparent 60%),
    var(--surface);
  padding: 22px 16px 20px; border-bottom: 1px solid var(--line);
}
.hero-inner { max-width: 720px; margin: 0 auto; }
.hero h1 { font-size: 1.7rem; margin-bottom: 6px; }
.hero h1 em { font-style: normal; color: var(--pink); }
.hero p.lead { color: var(--ink-2); margin-bottom: 16px; }
.search-box { display: grid; gap: 10px; }
.search-input { position: relative; }
.search-input .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.search-input input { padding-left: 44px; min-height: 52px; font-size: 17px; border-radius: 14px; }
.quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.quick {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
  min-height: 92px; padding: 12px 6px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line);
  text-decoration: none; color: var(--ink); font-weight: 700; font-size: .88rem; box-shadow: var(--shadow); cursor: pointer; font-family: inherit;
}
.quick .bubble { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; }
.quick .bubble.teal { background: var(--brand-soft); color: var(--brand-dark); }
.quick .bubble.pink { background: var(--pink-soft); color: var(--pink); }
.quick .bubble.sun { background: var(--sun-soft); color: var(--sun); }
.why { display: grid; gap: 10px; }
.why-item { display: flex; gap: 12px; align-items: flex-start; }
.why-item .num { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 1.2rem; background: var(--brand-soft); }
.why-item h3 { margin: 0 0 2px; font-size: 1rem; }
.why-item p { margin: 0; color: var(--ink-2); font-size: .93rem; }
.photo-card { border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 9; background: var(--subtle); }
.photo-card img { width: 100%; height: 100%; object-fit: cover; }
.cta-card { background: linear-gradient(135deg, var(--brand), var(--brand-dark)); color: var(--on-accent); border: 0; }
.cta-card p { color: color-mix(in srgb, var(--on-accent) 88%, transparent); }
.cta-card .btn { background: var(--surface); color: var(--brand-dark); }
.cta-card .btn.ghost { background: transparent; color: var(--on-accent); border-color: color-mix(in srgb, var(--on-accent) 50%, transparent); }
.site-footer { text-align: center; color: var(--ink-3); font-size: .85rem; padding: 28px 16px 12px; }
.site-footer p { margin-left: auto; margin-right: auto; }
.site-footer a { color: var(--ink-2); }

/* ---------- Results ---------- */
.results-head { display: flex; align-items: center; gap: 10px; margin: 18px 0 10px; }
.results-head h2 { margin: 0; font-size: 1.05rem; flex: 1; }
.view-toggle { display: inline-flex; background: var(--hover); border-radius: 999px; padding: 3px; }
.view-toggle button { border: 0; background: transparent; padding: 6px 12px; border-radius: 999px; font: inherit; font-weight: 600; font-size: .85rem; color: var(--ink-2); display: inline-flex; align-items: center; gap: 4px; cursor: pointer; min-height: 34px; }
.view-toggle button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px var(--shade); }

.product-card { padding: 0; overflow: hidden; }
.product-card .p-head { display: flex; gap: 12px; padding: 14px 14px 10px; }
.thumb { width: 64px; height: 64px; flex: 0 0 auto; border-radius: 12px; background: var(--subtle); display: grid; place-items: center; overflow: hidden; color: var(--ui-control); }
.thumb img { width: 100%; height: 100%; object-fit: contain; background: var(--surface); }
.thumb.sm { width: 44px; height: 44px; border-radius: 10px; }
.p-title { font-weight: 700; line-height: 1.3; margin: 0 0 4px; font-size: 1rem; }
.p-meta { font-size: .85rem; color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.store-list { border-top: 1px solid var(--line); }
.store-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line-soft); cursor: pointer; }
.store-row:first-child { border-top: 0; }
.store-row:hover { background: var(--subtle); }
.store-row .s-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.store-row .s-sub { font-size: .82rem; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.price { font-weight: 800; color: var(--brand-dark); white-space: nowrap; font-size: 1.05rem; }
.price.none { color: var(--ink-3); font-weight: 600; font-size: .85rem; }
.more-stores { width: 100%; border: 0; border-top: 1px solid var(--line-soft); background: var(--subtle); padding: 10px; font: inherit; font-weight: 600; color: var(--brand-dark); cursor: pointer; min-height: 44px; }

.biz-card { cursor: pointer; }
.biz-card .b-head { display: flex; gap: 12px; align-items: flex-start; }
.logo-box { width: 56px; height: 56px; flex: 0 0 auto; border-radius: 14px; background: var(--brand-soft); color: var(--brand-dark); display: grid; place-items: center; overflow: hidden; font-weight: 800; font-size: 1.3rem; }
.logo-box img { width: 100%; height: 100%; object-fit: contain; background: var(--surface); }
.logo-box.xs { width: 40px; height: 40px; border-radius: 10px; font-size: .95rem; }
.logo-box.lg { width: 72px; height: 72px; border-radius: 18px; font-size: 1.6rem; }
.b-name { font-weight: 700; font-size: 1.05rem; margin: 0 0 2px; line-height: 1.3; }
.b-type { font-size: .85rem; color: var(--ink-3); margin: 0; }
.b-facts { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: .85rem; color: var(--ink-2); margin-top: 8px; }
.b-facts span { display: inline-flex; align-items: center; gap: 4px; }
.b-facts .icon { width: 16px; height: 16px; color: var(--ink-3); }
.b-desc { color: var(--ink-2); font-size: .92rem; margin: 8px 0 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.b-actions { display: flex; gap: 8px; margin-top: 12px; }
.b-actions .btn { flex: 1 1 0; min-height: 40px; font-size: .9rem; padding: 6px 10px; }
.open-now { color: var(--ok); font-weight: 700; }

.detail-list { display: grid; gap: 2px; margin: 0; }
.detail-list a, .detail-list div.item { display: flex; align-items: center; gap: 12px; padding: 12px 4px; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--line-soft); min-height: 48px; }
.detail-list .icon { color: var(--brand); }
.hours-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.hours-table td { padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.hours-table td:last-child { text-align: right; color: var(--ink-2); }
.hours-table tr.today td { font-weight: 700; color: var(--ink); }

.inv-item { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.inv-item:last-child { border-bottom: 0; }
.inv-item .grow .p-title { margin: 0; font-size: .97rem; }

#map { width: 100%; height: calc(100vh - 230px); height: calc(100dvh - 230px); min-height: 360px; border-radius: var(--radius); overflow: hidden; background: var(--subtle); }
.map-pin { width: 34px; height: 34px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--pink); border: 3px solid var(--surface); box-shadow: 0 2px 8px rgba(0,0,0,.35); cursor: pointer; }
.map-pin.me { background: var(--brand); border-radius: 50%; transform: none; width: 20px; height: 20px; }
.mapboxgl-popup-content { border-radius: 12px !important; padding: 12px 14px !important; font-family: inherit; }

/* ---------- Dashboard ---------- */
.dash-head { display: flex; align-items: center; gap: 12px; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px; text-align: center; }
.stat b { display: block; font-size: 1.3rem; }
.stat span { font-size: .75rem; color: var(--ink-3); font-weight: 600; }
.switch { position: relative; width: 48px; height: 28px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 100%; height: 100%; position: absolute; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch .track { position: absolute; inset: 0; background: var(--ui-control); border-radius: 999px; transition: background .15s; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; background: var(--surface); border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(20px); }
.switch input:focus-visible + .track { outline: 3px solid color-mix(in srgb, var(--ui-focus) 45%, transparent); outline-offset: 2px; }
details.more { border: 1px dashed var(--line); border-radius: var(--radius-sm); padding: 0 14px; margin-bottom: 14px; }
details.more summary { cursor: pointer; font-weight: 700; color: var(--brand-dark); min-height: var(--tap); display: flex; align-items: center; list-style: none; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::after { content: "+"; margin-left: auto; font-size: 1.3rem; }
details.more[open] summary::after { content: "–"; }
.hours-grid { display: grid; grid-template-columns: 88px 1fr; gap: 8px 10px; align-items: center; }
.hours-grid label { margin: 0; }
.typeahead { position: relative; }
.typeahead-list { position: absolute; z-index: 20; left: 0; right: 0; top: 100%; margin-top: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); max-height: 260px; overflow-y: auto; }
.typeahead-list button { display: block; width: 100%; text-align: left; border: 0; background: var(--surface); padding: 10px 14px; font: inherit; cursor: pointer; border-bottom: 1px solid var(--line-soft); }
.typeahead-list button:hover, .typeahead-list button:focus { background: var(--brand-soft); }
.typeahead-list b { color: var(--brand-dark); margin-right: 6px; }
.choice-card { display: flex; gap: 14px; align-items: center; text-align: left; width: 100%; border: 1.5px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: 16px; font: inherit; color: var(--ink); cursor: pointer; }
.choice-card:hover, .choice-card[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); }
.choice-card .bubble { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; flex: 0 0 auto; }
.result-pick { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); margin-bottom: 8px; }

.auth-wrap { max-width: 440px; margin: 0 auto; padding: 24px 16px; }
.auth-logo { display: flex; justify-content: center; margin: 4px 0 16px; }
.auth-logo img { height: 3.25rem; width: auto; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 52px; }
.pw-wrap .icon-btn { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }

/* ---------- Larger screens ---------- */
@media (min-width: 640px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .hero { padding: 40px 24px 32px; }
  .hero h1 { font-size: 2.2rem; }
  .search-box { grid-template-columns: 1fr 260px auto; align-items: center; }
  .sheet-backdrop { align-items: center; padding: 24px; }
  .sheet { border-radius: 20px; max-height: 88vh; }
  .sheet-grip { display: none; }
  .page { padding: 24px; }
}
@media (min-width: 900px) {
  body { padding-bottom: 0; }
  .bottom-nav { display: none; }
  .cat-actions { bottom: 12px; }
  .toast-wrap { bottom: 24px; }
  .appbar { padding: 0 24px; }
  .appbar .top-links { display: flex; }
  .results-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
  .results-grid > .card + .card { margin-top: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
section[id] { scroll-margin-top: 72px; }

/* ---------- Small helpers (the CSP blocks inline style="" attributes) ---------- */
.m-0 { margin: 0; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-0h { margin-top: var(--ui-gap-label, 0.25rem); }
.mt-1 { margin-top: var(--ui-gap-inline, 0.5rem); }
.mt-2 { margin-top: 0.75rem; }
.mt-3 { margin-top: var(--ui-gap-field, 1rem); }
.mb-1 { margin-bottom: var(--ui-gap-inline, 0.5rem); }
.mb-2 { margin-bottom: 0.75rem; }
.mb-3 { margin-bottom: var(--ui-gap-field, 1rem); }
.m-3 { margin: var(--ui-gap-field, 1rem); }
.my-note { margin: 0.5rem 0 1rem; }
.center-note { text-align: center; margin: 0.75rem 0; }
.d-block { display: block; }
.align-start { align-items: flex-start; }
.w-state { width: 5.625rem; flex: 0 0 auto; }
.upper { text-transform: uppercase; }
.text-sm { font-size: 0.88rem; }
.text-muted2 { color: var(--ink-2); }
.text-brand { color: var(--brand-dark); }
.title-sm { font-size: 1.3rem; }
.title-md { font-size: 1.2rem; }
.btn-tall { min-height: 3.5rem; font-size: 1.05rem; }
.row-12 { display: flex; gap: 0.75rem; }
.b-head-lg { display: flex; gap: 0.875rem; align-items: center; margin-bottom: 0.75rem; }
.unbutton { all: unset; cursor: pointer; min-width: 0; flex: 1; }
.unbutton:focus-visible { outline: 3px solid color-mix(in srgb, var(--ui-focus) 45%, transparent); outline-offset: 2px; }
.bubble-sun { background: var(--sun-soft); color: var(--sun); }
.bubble-teal { background: var(--brand-soft); color: var(--brand-dark); }
.skeleton.sk-chip-sm { display: inline-block; width: 5.625rem; height: 2.25rem; }
.skeleton.sk-chip-md { display: inline-block; width: 6.875rem; height: 2.25rem; }
.skeleton.sk-chip-lg { display: inline-block; width: 7.5rem; height: 2.25rem; }
.skeleton.sk-chip-xl { display: inline-block; width: 8.75rem; height: 2.25rem; }
.is-gone { display: none !important; }
.fade-out { opacity: 0; transition: opacity .3s; }

/* ---------- Voice input ---------- */
.voice-wrap { position: relative; }
.voice-wrap textarea { padding-right: 3.25rem; }
.voice-wrap .voice-btn { position: absolute; right: 0.125rem; top: 0.125rem; color: var(--ink-2); }
.voice-btn.is-listening { color: var(--danger); background: var(--danger-soft); }
.voice-btn.is-listening::after { content: ""; position: absolute; inset: 0.375rem; border-radius: 50%; border: 2px solid var(--danger); animation: pulse 1.2s ease-out infinite; }
@keyframes pulse { from { transform: scale(.8); opacity: 1; } to { transform: scale(1.25); opacity: 0; } }

/* ---------- Admin: find businesses on a map ---------- */
.am-layout { display: grid; gap: 0.75rem; }
.am-goto { display: flex; gap: var(--ui-gap-inline, 0.5rem); align-items: center; }
.am-goto .search-input input { min-height: var(--tap); font-size: 16px; border-radius: var(--radius-sm); }
.am-map-wrap { position: relative; }
#admin-map { width: 100%; height: 55vh; height: 55dvh; min-height: 18rem; border-radius: var(--radius); overflow: hidden; background: var(--subtle); }
.am-search-btn { position: absolute; left: 50%; top: 0.75rem; transform: translateX(-50%); z-index: 2; box-shadow: var(--shadow-lg); }
.am-search-btn.is-stale, .am-search-btn.is-stale:hover { background: var(--pink); }
.am-search-btn[aria-busy="true"] { cursor: progress; }
.am-bar { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; align-items: center; }
.am-status { margin: 0; font-weight: 600; color: var(--ink-2); }
.am-filter { min-height: var(--tap); font-size: 0.92rem; }
.am-results { display: grid; gap: 0.625rem; }
.am-results .card + .card { margin-top: 0; }
.am-card { display: flex; gap: 0.75rem; align-items: center; padding: 0.75rem 0.875rem; }
.am-card.is-selected { border-color: var(--brand); box-shadow: 0 0 0 2px color-mix(in srgb, var(--ui-accent) 25%, transparent); }
.am-card-main { display: grid; gap: 0.125rem; min-width: 0; }
.am-card-main .b-name { overflow-wrap: anywhere; }
.am-card-main .am-line { overflow-wrap: anywhere; }
.am-line { display: flex; align-items: flex-start; gap: 0.375rem; font-size: 0.85rem; color: var(--ink-2); }
.am-line .icon { width: 1rem; height: 1rem; color: var(--ink-3); flex: 0 0 auto; }
.am-card-action { flex: 0 0 auto; }
.am-card-action .btn.sm { min-height: var(--tap); }
.am-credit { margin: 0.5rem 0 0; }
.map-pin.listed { background: var(--brand); }
@media (min-width: 64rem) {
  .am-layout { grid-template-columns: minmax(0, 1.6fr) minmax(20rem, 1fr); grid-template-areas: "help help" "goto goto" "bar bar" "map results" "credit credit"; align-items: start; }
  .am-layout > #help-tip { grid-area: help; }
  .am-layout > .am-goto { grid-area: goto; }
  .am-layout > .am-bar { grid-area: bar; }
  .am-map-wrap { grid-area: map; position: sticky; top: 4.5rem; }
  .am-results { grid-area: results; max-height: calc(100vh - 15rem); overflow-y: auto; padding-right: 0.25rem; }
  .am-credit { grid-area: credit; }
  #admin-map { height: calc(100vh - 15rem); }
}

/* ---------- Product import (dashboard) ---------- */
.hint { font-size: .82rem; color: var(--ink-3); }
.imp-how { margin: 0 0 0.875rem; padding-left: 1.1rem; font-size: 0.9rem; color: var(--ink-2); }
.imp-how li + li { margin-top: 0.375rem; }
.imp-preview { overflow-x: auto; margin-bottom: 0.75rem; }
.imp-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.imp-table th, .imp-table td { text-align: left; padding: 0.375rem 0.5rem; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.imp-table th { color: var(--ink-3); font-weight: 600; white-space: nowrap; }
.imp-table td:first-child { overflow-wrap: anywhere; }
.imp-map { margin-bottom: 0.625rem; }
.imp-progress { font-weight: 600; margin: 0 0 0.5rem; }
.imp-bar { width: 100%; height: 0.75rem; accent-color: var(--brand); }

/* ---------- Town organizer page ---------- */
.inv-list { display: grid; gap: 0.5rem; margin-top: 0.5rem; }
.inv-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.625rem 0.75rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); min-height: var(--tap); }
.inv-row input[type=checkbox] { flex: 0 0 auto; width: 1.25rem; height: 1.25rem; accent-color: var(--brand); }
.inv-row .grow { min-width: 0; overflow-wrap: anywhere; }
.inv-code { flex: 0 0 auto; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.82rem; color: var(--ink-3); }
#print-area { display: none; }

/* Claim invites: four cards to a letter page, black on white whatever the screen theme. */
@media print {
  .organizer-page > *:not(#print-area) { display: none !important; }
  .organizer-page { background: white; padding: 0; margin: 0; }
  #print-area { display: grid; grid-template-columns: 1fr 1fr; color: black; }
  .invite { box-sizing: border-box; height: 5in; padding: 0.35in; border: 1px dashed gray; break-inside: avoid; display: flex; flex-direction: column; font-size: 10.5pt; line-height: 1.35; overflow: hidden; }
  .invite p { margin: 0 0 0.1in; }
  .invite h2 { margin: 0 0 0.04in; font-size: 17pt; line-height: 1.15; overflow-wrap: anywhere; }
  .invite-logo { height: 0.55in; width: auto; align-self: flex-start; margin-bottom: 0.12in; }
  .invite-lead { font-size: 11pt; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
  .invite-addr { color: dimgray; }
  .invite-claim { margin-top: auto; display: flex; gap: 0.2in; align-items: center; }
  .invite-qr { flex: 0 0 1.35in; }
  .invite-qr svg { display: block; width: 1.35in; height: 1.35in; }
  .invite-code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13pt; letter-spacing: 0.06em; }
  @page { size: letter; margin: 0.5in; }
}

/* ---------- Town pages (town.php) ---------- */
.town-crumb { font-size: 0.85rem; color: var(--ink-3); margin: 0 0 6px; }
.town-crumb a { color: var(--brand-dark); }
.town-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.town-share-row { margin: 0; text-align: center; }
#map.town-map { height: 60vh; height: 60dvh; min-height: 320px; max-height: 640px; }
.towns-title { font-size: 1.5rem; margin: 0; }
@media (min-width: 640px) {
  .town-hero .search-box { grid-template-columns: 1fr auto; }
  .town-cats.scroll { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
}

/* Comments form: honeypot field, kept off screen so people never see or fill it. */
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Claim requests on organizer.html (1.3.18) */
.claim-actions { display: flex; flex-direction: column; gap: var(--ui-gap-inline); flex: 0 0 auto; }
.claim-actions .btn.sm { min-height: var(--tap); }
.verify-note { margin-bottom: var(--ui-gap-block); }

/* Business photo (1.3.20): top right of the business card, beside the name, facts and tags. */
.biz-card .b-top { display: flex; gap: 12px; align-items: flex-start; }
.biz-card .b-main { flex: 1 1 auto; min-width: 0; }
.b-photo { flex: 0 0 auto; width: 96px; height: 96px; border-radius: 12px; overflow: hidden; background: var(--subtle); }
.b-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 400px) { .b-photo { width: 112px; height: 112px; } }
@media (min-width: 720px) { .b-photo { width: 128px; height: 128px; } }

/* Photo and logo upload on the business dashboard. */
.img-uploads { display: grid; gap: 14px; margin-bottom: 14px; }
.img-upload { display: flex; gap: 12px; align-items: flex-start; }
.img-preview { flex: 0 0 auto; width: 88px; height: 88px; border-radius: 12px; overflow: hidden; background: var(--subtle); color: var(--ink-3); display: grid; place-items: center; font-weight: 700; font-size: 1.4rem; }
.img-preview.logo { background: var(--brand-soft); color: var(--brand-dark); }
.img-preview img { display: block; width: 100%; height: 100%; object-fit: cover; }
.img-preview.logo img { object-fit: contain; background: var(--surface); }
.img-label { font-weight: 600; }
.img-upload .btn.sm { min-height: var(--tap); }
