:root {
  --bg: #121212;
  --surface: #1c1c1c;
  --surface-elevated: #242424;
  --border: #2a2a2a;
  --text: #f5f0e8;
  --text-muted: #a39e94;
  --accent: #3d6b52;
  --accent-hover: #4a7d62;
  --accent-soft: rgba(61, 107, 82, 0.18);
  --gold: #c4a574;
  --gold-ember: #d4b07a;
  --gold-rgb: 196, 165, 116;
  --gold-soft: rgba(var(--gold-rgb), 0.12);
  --gold-mid: rgba(var(--gold-rgb), 0.22);
  --gold-line: rgba(var(--gold-rgb), 0.5);
  --gold-strong: rgba(var(--gold-rgb), 0.7);
  --on-accent: #fff;
  --danger-border: #7a2e2e;
  --danger-text: #e8a0a0;
  --danger-soft: rgba(122, 46, 46, 0.25);
  --error-border: #b54a4a;
  --error-text: #e8b4b4;
  --warning-bg: #3a2a10;
  --warning-text: #f1dcb0;
  --track: #333;
  --switch-off: #3a3a3a;
  --switch-knob: #d9d3c9;
  --switch-knob-on: #1c1c1c;
  --chip-count-bg: rgba(255, 255, 255, 0.06);
  --chip-count-bg-on: rgba(255, 255, 255, 0.12);
  --ios-share: #4a9eff;
  --sheet-shadow: 0 -8px 40px rgba(0, 0, 0, 0.55);
  --theme-color: #121212;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  color-scheme: dark;
  /* Netlify's free-plan "Powered by Netlify" badge is a fixed iframe
     (#nl-badge-frame) at bottom:0 right:0, z-index 2147483645. After it
     measures, the pill is ~40px tall with 18px inset from the bottom and
     right (PAD.b/r). We cannot hide it with CSS. Clear ~72px so the tab
     bar sits just above it with a small gap, and fill the band behind
     the badge with the same page background. */
  --badge-clearance: 72px;
  --nav-height: 76px;
  --footer-offset: calc(var(--nav-height) + var(--badge-clearance) + env(safe-area-inset-bottom, 0px));
}
/* Light theme: warm parchment / charcoal. Applied when <html data-theme="light">
   is set by the boot script in <head> (localStorage or prefers-color-scheme). */
html[data-theme="light"] {
  --bg: #f4efe6;
  --surface: #fffbf4;
  --surface-elevated: #ffffff;
  --border: #e2d8c8;
  --text: #2a241c;
  --text-muted: #5c554c;
  --accent: #2f5844;
  --accent-hover: #254836;
  --accent-soft: rgba(47, 88, 68, 0.14);
  --gold: #7a5428;
  --gold-ember: #9a6a32;
  --gold-rgb: 122, 84, 40;
  --gold-soft: rgba(var(--gold-rgb), 0.12);
  --gold-mid: rgba(var(--gold-rgb), 0.22);
  --gold-line: rgba(var(--gold-rgb), 0.5);
  --gold-strong: rgba(var(--gold-rgb), 0.7);
  --on-accent: #fff;
  --danger-border: #a33d3d;
  --danger-text: #8b2e2e;
  --danger-soft: rgba(139, 46, 46, 0.10);
  --error-border: #a33d3d;
  --error-text: #8b2e2e;
  --warning-bg: #f8e9c8;
  --warning-text: #5c4316;
  --track: #e2d8c8;
  --switch-off: #c9c0b4;
  --switch-knob: #fffbf4;
  --switch-knob-on: #fffbf4;
  --chip-count-bg: rgba(42, 36, 28, 0.08);
  --chip-count-bg-on: rgba(42, 36, 28, 0.12);
  --ios-share: #0b68d1;
  --sheet-shadow: 0 -8px 40px rgba(42, 36, 28, 0.18);
  --theme-color: #f4efe6;
  --shadow: 0 4px 24px rgba(42, 36, 28, 0.12);
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100%;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}
/* Lock the document on the app shell so iOS doesn't nest a body scroll
   under the pane. Static pages (.doc) are not affected. */
body:has(> .app) {
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
}
.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
header.app-header {
  padding: 18px 20px 12px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.logo {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text);
}
.logo span { color: var(--accent); }
.tagline {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 2px;
  line-height: 1.45;
  padding: 0 8px;
}
.screen {
  flex: 1 1 0%;
  min-height: 0; /* allow the pane to shrink so it scrolls inside the shell */
  padding: 20px 20px calc(var(--footer-offset) + 12px);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  display: none;
}
.screen.active { display: block; }
h1 { font-size: 26px; font-weight: 600; margin-bottom: 8px; line-height: 1.2; }
h2 { font-size: 18px; font-weight: 600; margin-bottom: 12px; }
.subtitle { color: var(--text-muted); font-size: 15px; margin-bottom: 24px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  transition: border-color 0.15s;
}
.card.selectable {
  cursor: pointer;
}
.card.selectable:hover, .card.selectable.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.card-title { font-weight: 600; font-size: 16px; margin-bottom: 2px; }
.card-desc { font-size: 13px; color: var(--text-muted); }
.btn {
  width: 100%;
  background: var(--accent);
  color: var(--on-accent);
  border: none;
  border-radius: 12px;
  padding: 16px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  margin-top: 12px;
  transition: background 0.15s;
}
.btn:hover { background: var(--accent-hover); }
.btn.secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn.large { padding: 18px; font-size: 17px; }
input, select, textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  color: var(--text);
  font-size: 16px;
  margin-bottom: 14px;
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
}
label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 6px; font-weight: 500; }
.rating {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  margin-bottom: 18px;
}
.rating button {
  flex: 1;
  height: 48px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
}
.rating button.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.strength {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}
.strength button {
  flex: 1;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
}
.strength button.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.tag {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}
.tag.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.entry {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.entry-info { flex: 1; }
.entry-brand { font-weight: 600; font-size: 15px; }
.entry-name { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.entry-meta { font-size: 12px; color: var(--text-muted); margin-top: 6px; display: flex; gap: 10px; align-items: center; }
.stars { color: var(--gold); letter-spacing: 1px; }
.nav {
  display: flex;
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--badge-clearance) + env(safe-area-inset-bottom, 0px));
  z-index: 40;
  border-top: 1px solid var(--border);
  background: var(--bg);
  /* Horizontal padding keeps the five tabs in the same 480px column as .app. */
  padding: 8px max(0px, calc((100vw - 480px) / 2));
}
/* Full-width band under the tab bar so the Netlify badge sits on the same
   page-background footer instead of floating over page content. pointer-events
   stay off; the badge iframe is already at a max z-index. */
.nav::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: calc(var(--badge-clearance) + env(safe-area-inset-bottom, 0px));
  background: var(--bg);
  pointer-events: none;
}
.nav button {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  padding: 10px 4px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.nav button.active { color: var(--accent); }
.nav button svg { width: 22px; height: 22px; }
.empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}
.insight-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 10px;
}
.progress {
  height: 6px;
  background: var(--track);
  border-radius: 3px;
  margin-top: 8px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
}
.rec-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}
.rec-reason { font-size: 13px; color: var(--text-muted); margin: 8px 0; }
.badge {
  display: inline-block;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-top: 8px;
}
.logo-mark {
  width: 92px;
  height: 74px;
  margin: 0 auto 8px;
}
.logo-mark svg {
  width: 100%;
  height: 100%;
  display: block;
}
.logo-mark svg .logo-cigar { stroke: var(--gold); }
.logo-mark svg .logo-ember { fill: var(--gold-ember); stroke: var(--gold); }
.logo-mark svg stop { stop-color: var(--accent); }


/* Appearance: Light / Dark / System */
.theme-seg { margin: 10px 0 0; }
.theme-seg button { font-weight: 600; }

/* ---------- Additions (v2) ---------- */
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.danger { background: transparent; border: 1px solid var(--danger-border); color: var(--danger-text); }
.btn.small { width: auto; padding: 8px 14px; font-size: 13px; margin-top: 0; border-radius: 10px; }
.btn.link { background: none; border: none; color: var(--gold); padding: 8px; font-weight: 500; font-size: 14px; }
.row { display: flex; gap: 8px; }
.row > * { flex: 1; }
.hint { font-size: 12px; color: var(--text-muted); margin: -8px 0 14px; line-height: 1.5; }
.notice { font-size: 13px; color: var(--text-muted); background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--gold); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 14px; line-height: 1.5; }
.notice.error { border-left-color: var(--error-border); color: var(--error-text); }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: var(--text); line-height: 1.45; margin-bottom: 14px; cursor: pointer; font-weight: 400; }
.check input { width: 20px; height: 20px; flex: 0 0 20px; margin: 2px 0 0; accent-color: var(--accent); }
.check small { display: block; color: var(--text-muted); font-size: 12px; margin-top: 2px; }
.tabs { display: flex; gap: 6px; margin-bottom: 18px; background: var(--surface); padding: 4px; border-radius: 12px; border: 1px solid var(--border); }
.tabs button { flex: 1; background: none; border: none; color: var(--text-muted); padding: 10px; border-radius: 9px; font-size: 14px; cursor: pointer; }
.tabs button.active { background: var(--accent); color: var(--on-accent); }
.entry-actions { display: flex; gap: 8px; margin-top: 12px; }
.entry-actions button { background: none; border: 1px solid var(--border); color: var(--text-muted); border-radius: 8px; padding: 6px 12px; font-size: 12px; cursor: pointer; }
.entry-actions button:hover { color: var(--text); border-color: var(--accent); }
.entry-actions button.del:hover { border-color: var(--error-border); color: var(--danger-text); }
.sync-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); margin-left: 6px; vertical-align: middle; }
details.more { margin-bottom: 14px; }
details.more summary { cursor: pointer; color: var(--text-muted); font-size: 13px; margin-bottom: 12px; list-style: none; }
details.more summary::before { content: "+ "; color: var(--accent); }
details.more[open] summary::before { content: "– "; }
.toast { position: fixed; left: 50%; bottom: calc(var(--footer-offset) + 12px); transform: translateX(-50%); background: var(--surface-elevated); color: var(--text); border: 1px solid var(--border); padding: 12px 18px; border-radius: 12px; font-size: 14px; box-shadow: var(--shadow); z-index: 50; opacity: 0; pointer-events: none; transition: opacity .2s; max-width: 90vw; text-align: center; }
.toast.show { opacity: 1; }
.status-pill { display: inline-block; font-size: 11px; padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); margin-top: 6px; }
.footer-links { text-align: center; font-size: 12px; margin: 24px 0 8px; color: var(--text-muted); }
.footer-links a { color: var(--text-muted); margin: 0 8px; }
.strength-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-muted); margin-top: 10px; }
.toggle-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.toggle-row input { width: 22px; height: 22px; margin: 0; accent-color: var(--accent); flex: 0 0 22px; }
.strength button.selected:hover { background: var(--accent-hover); }
/* Add to Home Screen sheet
   Extra bottom padding clears a ~60px floating "Powered by Netlify" badge
   (bottom-right, injected by Netlify — our CSS cannot hide it) plus the iOS
   home-indicator safe area, so "Not now" and the last step stay tappable.
   To remove the badge for every visitor: Netlify → project →
   Project configuration → General → Powered by Netlify badge → off → Save.
   If that control is locked, the Free plan may require Personal or Pro. */
.install-sheet { position: fixed; left: 50%; bottom: calc(var(--badge-clearance) + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 110%); width: 100%; max-width: 480px; background: var(--surface-elevated); border: 1px solid var(--border); border-bottom: none; border-radius: 20px 20px 0 0; padding: 20px; box-shadow: var(--shadow); z-index: 60; transition: transform .3s ease, visibility 0s linear .3s; visibility: hidden; }
.install-sheet.show { transform: translate(-50%, 0); visibility: visible; transition: transform .3s ease; }
.install-head { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; padding-right: 36px; }
.install-head img { border-radius: 10px; flex: 0 0 44px; }
.install-close { position: absolute; top: 4px; right: 6px; background: none; border: none; color: var(--text-muted); font-size: 26px; cursor: pointer; line-height: 1; padding: 10px 12px; min-width: 44px; min-height: 44px; }
.install-steps { padding-left: 20px; font-size: 14px; line-height: 1.9; color: var(--text); }
.install-steps b { color: var(--gold); font-weight: 600; }
/* Footer actions sit in the bottom-left so the Netlify badge (bottom-right)
   cannot cover "Not now" or "Install app". Keep the extra safe-area padding. */
.install-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; margin-top: 10px; max-width: 60%; }
.install-actions .btn { width: auto; min-width: 132px; margin-top: 0; }
#install-later { width: auto; min-width: 44px; min-height: 44px; margin-top: 0; padding: 12px 16px; text-align: left; }
.ios-share { width: 20px; height: 20px; vertical-align: -4px; color: var(--ios-share); margin: 0 2px; }
.plus-box { display: inline-block; border: 1.5px solid var(--text-muted); border-radius: 4px; width: 18px; height: 18px; line-height: 15px; text-align: center; font-size: 14px; }
/* Legal pages */
.doc { max-width: 720px; margin: 0 auto; padding: 24px 20px calc(var(--badge-clearance) + env(safe-area-inset-bottom, 0px) + 16px); line-height: 1.65; font-size: 15px; }
.doc h1 { margin-top: 8px; }
.doc h2 { margin-top: 28px; font-size: 18px; }
.doc p, .doc li { color: var(--text); margin-bottom: 10px; }
.doc ul { padding-left: 22px; }
.doc a { color: var(--gold); }
.doc table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 10px 0 16px; }
.doc th, .doc td { border: 1px solid var(--border); padding: 8px; text-align: left; vertical-align: top; color: var(--text); }
.draft-banner { background: var(--warning-bg); border: 1px solid var(--gold); color: var(--warning-text); padding: 12px 14px; border-radius: 10px; font-size: 13px; margin-bottom: 18px; }
.ph { background: rgba(var(--gold-rgb),.18); padding: 0 4px; border-radius: 4px; }

/* ---------- Discover, Smoke Spots, Deals, Events ---------- */
.discover-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}
.discover-tabs button {
  flex: 1 1 calc(50% - 6px);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 10px;
  padding: 10px 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.discover-tabs button.active {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}
.discover-panel h2 { margin-top: 8px; }
.chip-row { display: flex; gap: 8px; margin: 8px 0 4px; }
.chip {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
}
.chip.selected { background: var(--accent-soft); border-color: var(--accent); color: var(--text); }
.spots-controls .row { align-items: stretch; margin-bottom: 8px; }
.spots-controls .row .btn { width: auto; margin-top: 0; flex: 0 0 auto; padding: 14px 16px; }
.spots-controls .row input { margin-bottom: 0; }
.spots-controls .btn { margin-top: 0; margin-bottom: 12px; }
.spot-card .spot-head, .fav-cigar-list li {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.spot-addr { font-size: 13px; color: var(--text-muted); margin-top: 8px; line-height: 1.4; }
.spot-dist { color: var(--gold); }
.spot-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.spot-actions .maps-btn, .spot-actions .btn.small {
  width: auto;
  margin-top: 0;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  display: inline-block;
  text-align: center;
}
.spot-actions .maps-btn:hover { border-color: var(--accent); color: var(--text); }
.fav-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 6px;
  min-width: 36px;
  min-height: 36px;
  flex: 0 0 auto;
}
.fav-btn.on { color: var(--gold); }
#btn-fav-cigar {
  width: auto;
  margin: -4px 0 16px;
  padding: 8px 12px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
}
#btn-fav-cigar.on { border-color: var(--gold); color: var(--gold); }
.empty.tight { padding: 16px 8px; font-size: 14px; }
.attribution { font-size: 11px; color: var(--text-muted); margin: 18px 0 0; line-height: 1.45; }
.fav-cigar-list { list-style: none; margin: 0 0 16px; }
.fav-cigar-list li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 8px;
  font-size: 15px;
  align-items: center;
}
.spots-favs { margin-bottom: 22px; }
.rec-card { position: relative; }
.rec-card .fav-btn { position: absolute; top: 8px; right: 8px; }
.rec-card.has-fav { padding-right: 44px; }

/* ---------- v2.6.0: search, organization, Box-Worthy ---------- */
.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; }
mark { background: rgba(var(--gold-rgb),.32); color: var(--text); border-radius: 3px; padding: 0 1px; }
header.app-header { position: relative; }
.hdr-search {
  position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; background: var(--surface);
  border: 1px solid var(--border); color: var(--gold); cursor: pointer;
}
.hdr-search[hidden] { display: none; }
.hdr-search svg { width: 20px; height: 20px; }
.hdr-search:focus-visible, .chip:focus-visible, .grp-h:focus-visible, .jrow:focus-visible, .gs-item:focus-visible, .view-toggle button:focus-visible, .bw-toggle:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* Shared search field */
.search-field { position: relative; display: flex; align-items: center; }
.search-field > svg { position: absolute; left: 14px; width: 18px; height: 18px; color: var(--text-muted); pointer-events: none; }
.search-field input[type="search"] {
  margin: 0; padding: 12px 44px 12px 42px; min-height: 46px; font-size: 16px; /* 16px stops iOS zoom-on-focus */
  -webkit-appearance: none; appearance: none; border-radius: 12px;
}
.search-field input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.sf-clear { position: absolute; right: 2px; width: 44px; height: 44px; background: none; border: none; color: var(--text-muted); font-size: 22px; cursor: pointer; line-height: 1; }
.sf-clear[hidden] { display: none; }

/* Sticky toolbar (Journal, Smoke Spots). .screen is the scroll container, so sticky works inside it */
.jt {
  /* top = -(.screen padding-top) so it pins flush to the pane edge with nothing peeking above */
  position: sticky; top: -20px; z-index: 5;
  margin: 0 -20px 12px; padding: 10px 20px 6px;
  background: var(--bg); border-bottom: 1px solid var(--border);
}
.jt[hidden] { display: none; }
.spots-tb { margin-top: 6px; }
.jt-row { display: flex; gap: 8px; margin-top: 8px; align-items: stretch; }
.jt-select {
  flex: 1 1 0; min-width: 0; margin: 0; min-height: 44px; padding: 10px 30px 10px 12px; font-size: 15px;
  -webkit-appearance: none; appearance: none; border-radius: 10px;
  background-image: linear-gradient(45deg, transparent 50%, var(--gold) 50%), linear-gradient(135deg, var(--gold) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat;
  text-overflow: ellipsis;
}
.jt-select.active { border-color: var(--accent); background-color: var(--accent-soft); }
.view-toggle { display: flex; flex: 0 0 auto; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.view-toggle button { width: 44px; min-height: 44px; background: var(--surface); border: none; color: var(--text-muted); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.view-toggle button + button { border-left: 1px solid var(--border); }
.view-toggle button.on { background: var(--accent); color: var(--on-accent); }
.view-toggle svg { width: 18px; height: 18px; }
.chip-scroll {
  display: flex; gap: 8px; overflow-x: auto; margin: 8px -20px 0; padding: 2px 20px 4px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
}
.chip-scroll::-webkit-scrollbar { display: none; }
.chip-scroll .chip, .flavor-panel .chip { flex: 0 0 auto; min-height: 40px; white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; }
.chip .cnt { font-size: 11px; color: var(--text-muted); background: var(--chip-count-bg); border-radius: 999px; padding: 1px 7px; }
.chip.selected .cnt { color: var(--text); background: var(--chip-count-bg-on); }
.chip .caret { font-size: 10px; color: var(--text-muted); }
.chip-gold { color: var(--gold); border-color: rgba(var(--gold-rgb),.45); }
.chip-gold.selected { background: rgba(var(--gold-rgb),.18); border-color: var(--gold); color: var(--gold); }
.chip .bw-ico { width: 15px; height: 15px; }
/* Bigger effective tap area for 40px chips */
.chip-scroll .chip { position: relative; }
.chip-scroll .chip::after { content: ""; position: absolute; inset: -2px 0; }
.flavor-panel { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 0 2px; max-height: 34vh; overflow-y: auto; }
.flavor-panel[hidden] { display: none; }
.jt-status { display: flex; justify-content: space-between; align-items: center; min-height: 36px; font-size: 13px; color: var(--text-muted); }
.jt-clear { width: auto; margin: 0; padding: 8px 4px 8px 12px; min-height: 36px; font-size: 13px; }
.jt-clear[hidden] { display: none; }

/* Groups */
.grp { margin-bottom: 6px; }
.grp-h {
  width: 100%; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 4px;
  background: var(--bg); border: none; border-bottom: 1px solid var(--border); color: var(--text);
  font-size: 13px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; cursor: pointer; text-align: left;
}
.jlist .grp-h { position: sticky; top: calc(var(--jt-h, 0px) - 21px); z-index: 3; margin-bottom: 10px; }
.grp-caret { width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 6px solid var(--gold); transition: transform .15s; }
.grp-h[aria-expanded="false"] .grp-caret { transform: rotate(-90deg); }
.grp-label { flex: 1; }
.grp-count { font-size: 12px; font-weight: 600; color: var(--gold); background: rgba(var(--gold-rgb),.12); border-radius: 999px; padding: 2px 9px; letter-spacing: 0; }
.grp-body[hidden] { display: none; }
.spots-favs .grp-h { margin-bottom: 10px; }

/* Compact list */
.view-list .grp-body { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 10px; }
.view-list .grp-h { margin-bottom: 8px; }
.jrow {
  width: 100%; display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 12px;
  background: none; border: none; border-bottom: 1px solid var(--border); color: var(--text); text-align: left; cursor: pointer; font: inherit;
}
.jrow:last-child { border-bottom: none; }
.jrow:active { background: var(--accent-soft); }
.jr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.jr-brand { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jr-name { font-size: 13px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jr-snip { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; font-style: italic; }
.jr-rating { flex: 0 0 auto; min-width: 30px; text-align: center; font-weight: 700; font-size: 14px; color: var(--gold); background: rgba(var(--gold-rgb),.1); border-radius: 8px; padding: 4px 6px; }
.jr-date { flex: 0 0 auto; width: 58px; text-align: right; font-size: 12px; color: var(--text-muted); }
.jr-bw { flex: 0 0 auto; color: var(--gold); display: flex; }
.jr-bw .bw-ico { width: 16px; height: 16px; }
.jl-sentinel { height: 1px; }
.jl-end { text-align: center; margin: 12px 0 0; }
#journal-load-more { margin-top: 4px; }

/* Box-Worthy */
.bw-ico { width: 14px; height: 14px; flex: 0 0 auto; vertical-align: -2px; }
.bw-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--gold); border: 1px solid rgba(var(--gold-rgb),.5); background: rgba(var(--gold-rgb),.1); border-radius: 999px; padding: 2px 8px 2px 6px; margin-left: 6px; vertical-align: 2px; letter-spacing: .2px; }
.bw-badge.sm { margin-left: 0; font-size: 10px; padding: 1px 7px 1px 5px; }
.bw-badge .bw-ico { width: 12px; height: 12px; }
.bw-toggle {
  width: 100%; display: flex; align-items: center; gap: 12px; min-height: 56px; margin: -4px 0 18px; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; color: var(--text); cursor: pointer; text-align: left; font: inherit;
  transition: border-color .15s, background .15s;
}
.bw-toggle > .bw-ico { width: 26px; height: 26px; color: var(--text-muted); }
.bw-text { flex: 1; display: flex; flex-direction: column; }
.bw-label { font-weight: 600; font-size: 15px; }
.bw-text small { font-size: 12px; color: var(--text-muted); margin-top: 2px; line-height: 1.35; }
.bw-switch { flex: 0 0 auto; width: 46px; height: 28px; border-radius: 999px; background: var(--switch-off); position: relative; transition: background .15s; }
.bw-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--switch-knob); transition: transform .15s; }
.bw-toggle.on { border-color: var(--gold); background: rgba(var(--gold-rgb),.12); }
.bw-toggle.on > .bw-ico, .bw-toggle.on .bw-label { color: var(--gold); }
.bw-toggle.on .bw-switch { background: var(--gold); }
.bw-toggle.on .bw-switch::after { transform: translateX(18px); background: var(--switch-knob-on); }
.entry-actions { flex-wrap: wrap; }
.entry-actions button { min-height: 36px; }
.entry-actions button.buy { color: var(--gold); border-color: rgba(var(--gold-rgb),.5); margin-left: auto; }
.entry-actions button.buy:hover { border-color: var(--gold); color: var(--gold); }

/* Buy-a-box sheet: non-blocking (no backdrop), sits above the tab bar like the install sheet */
.buy-sheet {
  position: fixed; left: 50%; bottom: calc(var(--badge-clearance) + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 110%);
  width: 100%; max-width: 480px; max-height: min(74vh, calc(100dvh - var(--badge-clearance) - 40px));
  display: flex; flex-direction: column;
  background: var(--surface-elevated); border: 1px solid var(--border); border-bottom: none; border-top: 2px solid var(--gold);
  border-radius: 20px 20px 0 0; padding: 18px 20px 0; box-shadow: var(--sheet-shadow); z-index: 58;
  transition: transform .3s ease, visibility 0s linear .3s; visibility: hidden;
}
.buy-sheet.show { transform: translate(-50%, 0); visibility: visible; transition: transform .3s ease; }
.buy-head { display: flex; gap: 12px; align-items: center; padding-right: 40px; margin-bottom: 8px; }
.buy-ico { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 12px; background: rgba(var(--gold-rgb),.14); color: var(--gold); display: flex; align-items: center; justify-content: center; }
.buy-ico .bw-ico { width: 26px; height: 26px; }
.buy-kicker { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--gold); font-weight: 600; }
.buy-scroll { overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding-bottom: 18px; }
.buy-h { font-size: 13px; letter-spacing: .8px; text-transform: uppercase; color: var(--text-muted); margin: 14px 0 8px; }
.buy-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 10px 14px; margin-bottom: 8px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); text-decoration: none; }
.buy-row:hover { border-color: var(--gold); }
.buy-row b { display: block; font-size: 15px; }
.buy-row small { display: block; font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.buy-cta, .buy-price { flex: 0 0 auto; color: var(--gold); font-weight: 600; font-size: 14px; }
.buy-spot { padding: 12px 0; border-bottom: 1px solid var(--border); }
.buy-spot:last-of-type { border-bottom: none; }
.buy-spot .spot-actions { margin-top: 8px; }
.buy-sheet .btn.link { width: auto; min-height: 44px; }
.buy-hint { margin: 0 0 10px; }
.buy-place-row { margin-top: 8px; }
.buy-place-row input { margin-bottom: 0; }
.buy-place-row .btn { width: auto; flex: 0 0 auto; margin-top: 0; padding: 14px 18px; }
.buy-sheet .attribution { margin-top: 6px; }

/* Global search overlay */
.gsearch {
  position: fixed; inset: 0; z-index: 48; background: var(--bg);
  display: flex; flex-direction: column; max-width: 480px; margin: 0 auto;
  padding-top: env(safe-area-inset-top, 0px);
}
.gsearch[hidden] { display: none; }
body.gs-open { overflow: hidden; }
.gs-head { display: flex; gap: 8px; align-items: center; padding: 12px 16px 8px; border-bottom: 1px solid var(--border); }
.gs-head .search-field { flex: 1; }
.gs-cancel { width: auto; margin: 0; padding: 10px 6px; min-height: 44px; }
.gs-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 4px 16px calc(24px + env(safe-area-inset-bottom, 0px)); }
.gs-chips { margin: 8px -16px 4px; padding: 2px 16px 4px; }
.gs-total { font-size: 12px; color: var(--text-muted); margin: 6px 0 2px; }
.gs-group { margin-top: 12px; }
.gs-gh { display: flex; justify-content: space-between; align-items: center; min-height: 32px; font-size: 12px; font-weight: 600; letter-spacing: .8px; text-transform: uppercase; color: var(--text-muted); border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.gs-gh .btn.link { width: auto; margin: 0; padding: 6px 0 6px 12px; font-size: 13px; text-transform: none; letter-spacing: 0; }
.gs-item { width: 100%; display: flex; flex-direction: column; gap: 3px; min-height: 52px; justify-content: center; padding: 8px 4px; background: none; border: none; border-bottom: 1px solid var(--border); color: var(--text); text-align: left; cursor: pointer; font: inherit; }
.gs-item:active { background: var(--accent-soft); }
.gs-recent { flex-direction: row; align-items: center; gap: 12px; min-height: 46px; }
.gs-ico { color: var(--text-muted); width: 18px; text-align: center; }
.gs-title { font-size: 15px; font-weight: 600; }
.gs-sub { font-weight: 400; color: var(--text); }
.gs-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; color: var(--text-muted); align-items: center; }
.gs-logged, .gs-saved { color: var(--accent-hover); }
.gs-cta { color: var(--gold); }
.gs-more { width: auto; margin: 4px 0 0; padding: 10px 0; min-height: 44px; }
.gs-tip { margin: 16px 0 0; }

/* Flash a target found from global search */
@keyframes sn-flash { 0% { box-shadow: 0 0 0 0 rgba(var(--gold-rgb),.0); } 20% { box-shadow: 0 0 0 3px rgba(var(--gold-rgb),.9); } 100% { box-shadow: 0 0 0 0 rgba(var(--gold-rgb),0); } }
.flash { animation: sn-flash 2.2s ease-out; border-color: var(--gold) !important; }
.subtitle.tight { margin-bottom: 12px; }
@media (prefers-reduced-motion: reduce) { .flash { animation: none; } .buy-sheet, .grp-caret, .bw-switch::after { transition: none; } }
.attribution a { color: var(--gold); }
.buy-spot .spot-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.buy-spot .fav-btn { min-width: 44px; min-height: 44px; }
.buy-row > span:first-child { min-width: 0; flex: 1; }
.buy-row small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- v2.7.0: Deals for you ---------- */
.deal-feed { margin-bottom: 8px; }
.deal-card {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  min-height: 56px; padding: 12px 14px; margin-bottom: 8px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
  color: var(--text); text-decoration: none;
}
.deal-card:hover { border-color: var(--gold); }
.deal-card > span:first-child { min-width: 0; flex: 1; }
.deal-card b { display: block; font-size: 15px; }
.deal-card small { display: block; font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.deal-card .buy-price { flex: 0 0 auto; color: var(--gold); font-weight: 600; font-size: 14px; text-align: right; }
.deal-card.is-deal { border-color: rgba(var(--gold-rgb),.7); background: rgba(var(--gold-rgb),.08); }
.deal-sale {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 6px;
  font-size: 11px; font-weight: 600; letter-spacing: .2px; color: var(--gold);
  border: 1px solid rgba(var(--gold-rgb),.5); background: rgba(var(--gold-rgb),.1);
  border-radius: 999px; padding: 2px 8px;
}
.deal-watch {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 12px 8px; margin-bottom: 12px;
}
.deal-watch-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.deal-watch-head .card-title { margin: 0; font-size: 16px; }
.deal-watch-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; align-items: center; }
.deal-watch .buy-row { margin-bottom: 8px; }
.deal-watch .btn.buy-open { width: auto; margin: 4px 0 8px; min-height: 44px; padding: 10px 14px; background: transparent; border: 1px solid var(--border); color: var(--gold); }
.deal-watch .btn.buy-open:hover { border-color: var(--gold); }
.deal-section-h { font-size: 13px; letter-spacing: .8px; text-transform: uppercase; color: var(--text-muted); margin: 18px 0 8px; }
.buy-row.deal { border-color: rgba(var(--gold-rgb),.7); }

/* ---------- v2.14.0: Partner promos ---------- */
.partner-promos { margin: 0 0 16px; }
.partner-promos > h2 { margin: 0 0 4px; font-size: 22px; }
.promo-sample-banner {
  margin: 0 0 10px; padding: 8px 10px; border-radius: 10px;
  border: 1px dashed var(--gold); background: rgba(var(--gold-rgb),.1);
  color: var(--gold); font-size: 12px; font-weight: 600; letter-spacing: .2px;
  text-transform: uppercase; text-align: center;
}
.promo-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 14px; margin-bottom: 8px;
}
.promo-partner {
  font-size: 11px; letter-spacing: .7px; text-transform: uppercase;
  color: var(--text-muted); font-weight: 600;
}
.promo-card .promo-title {
  display: block; font-size: 15px; font-weight: 700; margin: 4px 0 2px;
  color: var(--text); line-height: 1.3;
}
.promo-meta { font-size: 12px; color: var(--text-muted); margin: 0 0 10px; }
.promo-actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
}
.promo-code-wrap {
  display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1 1 160px;
}
.promo-code {
  display: inline-block; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px; font-weight: 700; letter-spacing: .4px;
  padding: 6px 10px; border-radius: 8px; border: 1px dashed var(--border);
  background: rgba(var(--gold-rgb),.08); color: var(--text);
  user-select: all; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
.promo-copy {
  width: auto; margin: 0; min-height: 44px; padding: 8px 12px;
  flex: 0 0 auto;
}
.promo-shop {
  width: auto; margin: 0; min-height: 44px; padding: 8px 16px;
  flex: 0 0 auto; text-decoration: none; display: inline-flex;
  align-items: center; justify-content: center;
}
.promo-disclose {
  margin: 8px 0 4px; font-size: 12px; color: var(--text-muted); line-height: 1.45;
}
.promo-disclose a { color: var(--gold); }
.partner-promos .notice { margin: 8px 0 12px; }

/* v2.7.0 Events finder */
.events-controls { margin: 8px 0 16px; }
.events-controls .row { align-items: stretch; margin-bottom: 8px; }
.events-controls .row .btn { width: auto; margin-top: 0; flex: 0 0 auto; padding: 14px 16px; }
.events-controls .row input { margin-bottom: 0; }
.events-controls .btn { margin-top: 0; margin-bottom: 12px; }
.events-controls .chip-row { margin: 4px 0 8px; }
.event-card .spot-actions { margin-top: 10px; }

/* v2.8.0 on-demand events collector */
.events-checking {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 4px;
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: .01em;
}
.events-checking-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 0 rgba(var(--gold-rgb),.6);
  animation: events-checking-pulse 1.4s ease-out infinite;
  flex: 0 0 auto;
}
@keyframes events-checking-pulse {
  0% { transform: scale(.9); box-shadow: 0 0 0 0 rgba(var(--gold-rgb),.55); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(var(--gold-rgb),0); }
  100% { transform: scale(.9); box-shadow: 0 0 0 0 rgba(var(--gold-rgb),0); }
}

/* ---- Scan My Band + journal photos (v2.10.0) ---- */
.home-scan-hint { margin: 8px 0 0; text-align: center; }
#btn-scan-band { margin-top: 10px; }
.btn-scan-log { width: auto; margin: 0 0 16px; padding: 10px 16px; font-size: 14px; }

.scan-sheet {
  position: fixed; inset: 0; z-index: 80;
  background: var(--bg); color: var(--text);
  display: flex; flex-direction: column;
  padding: 12px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  overflow: auto; -webkit-overflow-scrolling: touch;
}
.scan-sheet[hidden], .photo-viewer[hidden] { display: none !important; }
body.scan-open, body.photo-viewer-open { overflow: hidden; }
body.scan-open .nav, body.photo-viewer-open .nav { visibility: hidden; pointer-events: none; }
body.photo-viewer-open .app,
body.photo-viewer-open .toast { visibility: hidden; pointer-events: none; }
.scan-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.scan-top h2 { margin: 0; font-size: 20px; }
.icon-close {
  width: 40px; height: 40px; border: none; border-radius: 50%;
  background: var(--surface); color: var(--text); font-size: 26px; line-height: 1;
  cursor: pointer; flex: 0 0 auto;
}
.scan-view {
  position: relative; width: 100%; aspect-ratio: 3 / 4; max-height: 52vh;
  background: #0a0a0a; border-radius: 16px; overflow: hidden;
  border: 1px solid var(--border);
}
.scan-view video, .scan-view img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.scan-view video { z-index: 1; }
.scan-view img { z-index: 2; }
.scan-start {
  position: absolute; inset: 0; z-index: 4;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 24px 22px; text-align: center;
  background: rgba(10,10,10,.88);
}
.scan-start[hidden] { display: none !important; }
.scan-start .btn { width: auto; min-width: 160px; }
.scan-perm-note {
  margin: 0; max-width: 280px; font-size: 13px; line-height: 1.45;
  color: rgba(255,255,255,.82);
}
.scan-view.is-waiting .scan-guide-wrap { visibility: hidden; }
.scan-guide-wrap { z-index: 3; }
.scan-guide-wrap { position: absolute; inset: 0; pointer-events: none; }
.scan-guide {
  position: absolute; left: 8%; right: 8%; top: 50%;
  height: 22%; transform: translateY(-50%);
  border: 2px solid #fff; border-radius: 12px;
  box-shadow: 0 0 0 9999px rgba(0,0,0,.4);
}
.scan-guide-label {
  position: absolute; left: 0; right: 0; top: calc(50% + 14%);
  text-align: center; color: #fff; font-size: 13px; margin: 8px 0 0;
  text-shadow: 0 1px 4px rgba(0,0,0,.8);
}
.scan-status { margin: 10px 0 0; font-size: 14px; color: var(--text-muted); text-align: center; }
.scan-status.warn { color: var(--gold); }
.scan-status[hidden] { display: none; }
.scan-actions {
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; gap: 12px; margin: 14px 0;
}
.scan-actions .btn { width: auto; justify-self: start; margin: 0; }
.scan-actions-spacer { }
.scan-shutter {
  width: 68px; height: 68px; flex: 0 0 68px; border-radius: 50%;
  border: 4px solid var(--gold); background: #fff; cursor: pointer;
  box-shadow: 0 0 0 4px rgba(var(--gold-rgb), .25);
}
.scan-shutter:active { transform: scale(.96); }
.scan-results { margin-top: 8px; }
.scan-q { font-weight: 600; margin: 0 0 6px; }
.scan-matches { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 12px; }
.scan-match { text-align: left; cursor: pointer; }
.scan-conf { margin-top: 6px; font-size: 12px; color: var(--gold); font-weight: 600; }
.scan-privacy { margin-top: 12px; }

.log-photos { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 4px 0 4px; }
.log-photo-thumb, .log-photo-add {
  width: 84px; height: 84px; border-radius: 12px; overflow: hidden;
  position: relative; flex: 0 0 84px; border: 1px solid var(--border);
  background: var(--surface);
}
.log-photo-add {
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; color: var(--gold); cursor: pointer; border-style: dashed;
  background: transparent;
}
.log-photo-add[hidden] { display: none; }
.log-photo-open { display: block; width: 100%; height: 100%; padding: 0; border: none; background: none; cursor: pointer; }
.log-photo-open img { width: 100%; height: 100%; object-fit: cover; display: block; }
.log-photo-remove {
  position: absolute; top: 4px; right: 4px; width: 24px; height: 24px;
  border: none; border-radius: 50%; background: rgba(0,0,0,.7); color: #fff;
  font-size: 16px; line-height: 1; cursor: pointer;
}
.log-thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.log-thumbs[hidden], .jr-photos[hidden] { display: none; }
.log-thumb {
  width: 64px; height: 64px; padding: 0; border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden; background: var(--surface); cursor: pointer;
}
.log-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.jrow-wrap { display: flex; align-items: stretch; border-bottom: 1px solid var(--border); }
.jrow-wrap .jrow { border-bottom: none; flex: 1; min-width: 0; }
.jrow-wrap:last-child { border-bottom: none; }
.jr-photos { display: flex; align-items: center; gap: 4px; padding: 0 8px 0 0; }
.jr-photos .log-thumb { width: 36px; height: 36px; border-radius: 6px; }

.photo-viewer {
  position: fixed; inset: 0; z-index: 200;
  background: #0b0b0b; color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 56px 16px calc(24px + env(safe-area-inset-bottom, 0px));
}
.photo-viewer .icon-close { position: absolute; top: 12px; right: 12px; background: rgba(255,255,255,.12); color: #fff; z-index: 2; }
.photo-viewer img { max-width: 100%; max-height: calc(100dvh - 160px); object-fit: contain; border-radius: 8px; }
.photo-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border: none; border-radius: 50%;
  background: rgba(255,255,255,.12); color: #fff; font-size: 28px; cursor: pointer;
}
.photo-nav.prev { left: 8px; }
.photo-nav.next { right: 8px; }
.photo-nav[hidden] { display: none; }
.photo-viewer-cap { margin: 10px 0 0; font-size: 13px; color: rgba(255,255,255,.8); }
#photo-viewer-remove { width: auto; margin-top: 12px; }
#photo-viewer-remove[hidden] { display: none; }

[data-theme="light"] .scan-guide { border-color: #fff; }
[data-theme="light"] .scan-shutter { background: #fffbf4; }

/* ---------- v2.13.1: Start camera overlay, no auto getUserMedia ---------- */
/* ---------- v2.12.0: header avatar, profile identity, center Scan button ---------- */
:root { --brand-gold: #c4a574; --brand-sage: #3d6b52; --brand-sage-deep: #2f5844; }
/* Header: search + avatar sit together in the top-right corner. */
.hdr-search { top: 12px; right: 62px; width: 42px; height: 42px; }
.hdr-avatar {
  position: absolute; top: 12px; right: 12px; width: 42px; height: 42px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; padding: 0; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); color: var(--gold); cursor: pointer;
  font: inherit; -webkit-tap-highlight-color: transparent;
  transition: border-color .15s, box-shadow .15s;
}
.hdr-avatar[hidden] { display: none; }
.hdr-avatar svg { width: 20px; height: 20px; }
.hdr-avatar img, .pf-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hdr-avatar.has-photo { border: 2px solid var(--brand-gold); }
.hdr-avatar.active { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--gold); border-color: var(--gold); }
.hdr-avatar:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.av-initial {
  display: flex; align-items: center; justify-content: center; width: 100%; height: 100%;
  font-weight: 700; font-size: 17px; letter-spacing: .3px; color: #fff;
  background: linear-gradient(145deg, var(--brand-sage), var(--brand-sage-deep));
}
@media (max-width: 374px) {
  header.app-header { padding-left: 16px; padding-right: 16px; }
  .hdr-search { right: 56px; width: 40px; height: 40px; top: 10px; }
  .hdr-avatar { right: 10px; width: 40px; height: 40px; top: 10px; }
}

/* Profile: name + photo card */
.identity-card { padding: 18px 16px 14px; }
.identity-card.busy { opacity: .7; pointer-events: none; }
.identity-row { display: flex; align-items: center; gap: 16px; }
.pf-avatar {
  flex: 0 0 84px; width: 84px; height: 84px; border-radius: 50%; padding: 0; overflow: hidden; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-elevated); color: var(--gold);
  border: 2px solid var(--brand-gold); box-shadow: 0 0 0 4px rgba(196, 165, 116, .16);
}
.pf-avatar svg { width: 38px; height: 38px; }
.pf-avatar .av-initial { font-size: 34px; }
.pf-avatar:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.identity-actions { min-width: 0; flex: 1; }
.identity-btns { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 8px; }
.identity-btns .btn.small { margin: 0; }
.identity-btns .btn.link { padding: 8px 4px; font-size: 13px; }
.identity-btns [hidden] { display: none; }
.pf-name-form { margin-top: 14px; }
.pf-name-form label { display: flex; justify-content: space-between; align-items: baseline; }
.pf-name-count { font-weight: 400; font-size: 12px; color: var(--text-muted); }
.pf-name-count.over { color: var(--error-text); }
.pf-name-row { display: flex; gap: 8px; align-items: stretch; }
.pf-name-row input { flex: 1; min-width: 0; }
.pf-name-row .btn.small { flex: 0 0 auto; padding: 0 18px; margin: 0; }
#pf-identity-hint { margin-top: 10px; }

/* Bottom nav: raised, centered Scan My Band button */
.nav { align-items: flex-end; }
.nav button[data-screen] { min-width: 0; }
.nav .nav-scan {
  flex: 0 0 76px; position: relative; padding: 0 0 10px; gap: 4px;
  color: var(--gold); font-weight: 600; -webkit-tap-highlight-color: transparent;
}
.nav-scan-disc {
  width: 60px; height: 60px; margin-top: -30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; color: #fff;
  background: radial-gradient(circle at 35% 28%, #4f8467 0%, var(--brand-sage) 55%, var(--brand-sage-deep) 100%);
  border: 2px solid var(--brand-gold);
  box-shadow: 0 0 0 5px var(--bg), 0 6px 16px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .18);
  transition: transform .12s ease, box-shadow .15s ease;
}
.nav .nav-scan svg { width: 28px; height: 28px; }
.nav-scan-label { font-size: 11px; line-height: 1; }
.nav .nav-scan:active .nav-scan-disc { transform: scale(.94); }
.nav .nav-scan:focus-visible { outline: none; }
.nav .nav-scan:focus-visible .nav-scan-disc { box-shadow: 0 0 0 5px var(--bg), 0 0 0 7px var(--gold); }
html[data-theme="light"] .nav-scan-disc {
  box-shadow: 0 0 0 5px var(--bg), 0 6px 14px rgba(42, 36, 28, .22), inset 0 1px 0 rgba(255, 255, 255, .22);
}
html[data-theme="light"] .nav .nav-scan { color: var(--gold); }
@media (max-width: 374px) {
  .nav .nav-scan { flex-basis: 68px; }
  .nav-scan-disc { width: 56px; height: 56px; margin-top: -28px; }
  .nav button[data-screen] { font-size: 10.5px; padding-left: 2px; padding-right: 2px; }
}
/* Leave room so the raised button never covers the last line of a pane. */
.screen { padding-bottom: calc(var(--footer-offset) + 36px); }
.pf-name-row input { margin: 0; }
.pf-name-row .btn.small { align-self: stretch; min-height: 48px; }
.doc h3 { margin-top: 20px; font-size: 16px; }
/* v2.12.0 polish: lift the Scan circle so its 5px background ring never
   touches the label; ~5px visible gap between the gold rim and "Scan". */
.nav .nav-scan { gap: 10px; }
.nav-scan-disc { margin-top: -38px; }
.nav-scan-label { display: block; position: relative; z-index: 1; }
@media (max-width: 374px) {
  .nav .nav-scan { gap: 10px; }
  .nav-scan-disc { margin-top: -36px; }
}

/* ---------- v2.13.0: sign-in, password reset, set password ---------- */
.pw-field { position: relative; }
.pw-field input { padding-right: 68px; }
.pw-toggle {
  position: absolute; right: 6px; top: 7px; height: 36px; min-width: 52px; padding: 0 10px;
  background: none; border: none; border-radius: 8px; color: var(--gold); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.pw-toggle:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.label-row label { margin-bottom: 0; }
.forgot-link { padding: 4px 0; font-size: 13px; width: auto; margin: 0; }
.or-divider { display: flex; align-items: center; gap: 12px; margin: 14px 0 2px; color: var(--text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.or-divider::before, .or-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
#btn-signup-link, #btn-signin-link { margin-top: 10px; }
.auth-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.auth-actions .btn.small { margin: 0; }
#password-card[hidden] { display: none; }
#password-card label { margin-top: 12px; }
#btn-reset-skip { display: block; margin: 8px auto 0; }
.auth-form[hidden] { display: none !important; }
.auth-title { margin-top: 6px; }
#account-tabs { margin-bottom: 20px; }

/* ---- Gift Wishlist (v2.15.0) ---- */
.wl-open-btn { margin-top: 10px; }
.wl-journal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wl-journal-head h1 { margin-bottom: 8px; }
.wl-journal-head .btn.small { margin-top: 0; white-space: nowrap; }
.wl-sheet {
  position: fixed; inset: 0; z-index: 80;
  background: var(--bg); color: var(--text);
  display: flex; flex-direction: column;
  padding: 12px 16px 0;
}
.wl-sheet[hidden], .wl-share[hidden] { display: none !important; }
body.wl-open { overflow: hidden; }
body.wl-open .nav { visibility: hidden; pointer-events: none; }
.wl-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.wl-top h2 { margin: 0; font-size: 20px; }
.wl-body { flex: 1 1 auto; overflow: auto; -webkit-overflow-scrolling: touch; padding-bottom: 16px; }
.wl-intro { margin: 0 0 14px; }
.wl-occasions .tag { min-height: 40px; }
.wl-head-row { display: flex; align-items: baseline; justify-content: space-between; margin: 6px 0 8px; }
.wl-h { font-size: 16px; font-weight: 600; }
.wl-count { font-size: 13px; color: var(--text-muted); }
.wl-item {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px; margin: 0 0 8px; cursor: pointer; color: var(--text); font-size: 15px;
}
.wl-item.on { border-color: var(--accent); background: var(--accent-soft); }
.wl-item input { width: 22px; height: 22px; margin: 2px 0 0; flex: 0 0 auto; accent-color: var(--accent); }
.wl-item-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wl-bw { color: var(--gold); font-weight: 600; }
.wl-more { width: auto; margin: 4px 0 8px; }
.wl-opts { margin-top: 12px; }
.wl-check { display: flex; gap: 10px; align-items: center; font-size: 14px; color: var(--text); margin: 10px 0; font-weight: 400; }
.wl-check input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }
.wl-foot { padding: 10px 0 calc(14px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--border); background: var(--bg); }
.wl-foot .btn { margin-top: 0; }
.wl-share {
  position: fixed; inset: 0; z-index: 81; background: rgba(0,0,0,.55);
  display: flex; align-items: flex-end; justify-content: center;
}
.wl-share-panel {
  width: 100%; max-width: 480px; max-height: 92dvh; overflow: auto;
  background: var(--surface-elevated); border: 1px solid var(--border); border-bottom: none;
  border-radius: 20px 20px 0 0; box-shadow: var(--sheet-shadow);
  padding: 16px 18px calc(18px + env(safe-area-inset-bottom, 0px));
}
.wl-card { display: block; width: 46%; max-width: 200px; margin: 0 auto 12px; border-radius: 10px; border: 1px solid var(--border); aspect-ratio: 4 / 5; background: #0f0e0c; object-fit: cover; }
.wl-channels { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.wl-channels .btn { margin-top: 0; padding: 13px 10px; font-size: 15px; text-align: center; text-decoration: none; display: flex; align-items: center; justify-content: center; }
.wl-channels #wl-native { grid-column: 1 / -1; }
.wl-channels [hidden] { display: none !important; }
.wl-img-hint { margin: 10px 0 4px; }
.wl-preview { white-space: pre-wrap; font: 13px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; margin-top: 8px; }
#wl-note, #wl-from { font-family: inherit; }

/* v2.15.0 affiliate link label (FTC disclosure next to tracked links) */
.aff-tag { display: inline-block; font-size: 11px; font-weight: 600; line-height: 1.5; padding: 0 6px; margin: 2px 0 0; border-radius: 999px; border: 1px solid var(--accent); color: var(--accent); letter-spacing: .02em; }
.wl-buy-hint { margin: -4px 0 8px 30px; }
