/* Fonts are self-hosted so the app looks the same offline. Both are SIL Open Font License. */
@font-face { font-family: "Bricolage Grotesque"; src: url(/vendor/fonts/bricolage-grotesque.woff2) format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Figtree"; src: url(/vendor/fonts/figtree.woff2) format("woff2"); font-weight: 300 900; font-display: swap; }

:root {
  color-scheme: light;
  --f-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --f-body: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --bounce: cubic-bezier(.3, 1.8, .5, 1);
  --pop: #ff5a36;
  --bg: #faf6f1;
  --surface: #fffdfa;
  --ink: #2a1d14;
  --ink-2: #6b5a4c;
  --muted: #8f7f71;
  --line: #eadfd3;
  --accent: #8a4b22;
  --accent-ink: #fffaf4;
  --accent-soft: #f3e4d3;
  --bar: #d6c6b6;
  --nodata: #e6e3df;
  --map-lo: #e8cba6;
  --map-hi: #4f260e;
  --danger: #b3261e;
  --radius: 16px;
  --shadow: 0 1px 2px rgb(60 30 10 / .06), 0 4px 16px rgb(60 30 10 / .06);
  --tabbar-h: 64px;
  --chip: #fff0e0;
  --chip-ink: #c4520f;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #14101c;
    --surface: #211a2e;
    --ink: #f6efff;
    --ink-2: #a99cc0;
    --muted: #8a7ea3;
    --line: #33294a;
    --accent: #ffb547;
    --accent-ink: #1a1206;
    --accent-soft: #3a2c3e;
    --bar: #4a3e63;
    --nodata: #2a2238;
    --map-lo: #3d3352;
    --map-hi: #ffb547;
    --danger: #ff8a8a;
    --shadow: none;
    --pop: #ff4d8d;
    --chip: #33263f;
    --chip-ink: #ffb547;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #14101c; --surface: #211a2e; --ink: #f6efff; --ink-2: #a99cc0; --muted: #8a7ea3; --line: #33294a;
  --accent: #ffb547; --accent-ink: #1a1206; --accent-soft: #3a2c3e; --bar: #4a3e63; --nodata: #2a2238;
  --map-lo: #3d3352; --map-hi: #ffb547; --danger: #ff8a8a; --shadow: none; --pop: #ff4d8d;
  --chip: #33263f; --chip-ink: #ffb547;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.45 var(--f-body);
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; line-height: 1.15; font-family: var(--f-display); letter-spacing: -.02em; text-wrap: balance; }
h2 { font-size: 1.75rem; font-weight: 800; margin: 8px 0 16px; }
h3 { font-weight: 700; }
.count, .ticker-num, .tile .v, .brand, .avatar, .btn, .seg button { font-family: var(--f-display); }
h3 { font-size: 1rem; }
.sub { margin: 2px 0 12px; color: var(--ink-2); font-size: .875rem; }
.note { margin: 12px 0 0; color: var(--ink-2); font-size: .875rem; }
button, input, select { font: inherit; color: inherit; }

/* ---------- Auth ---------- */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: calc(env(safe-area-inset-top) + 24px) 16px 24px; }
#picker { padding-bottom: 0; align-items: start; }
.auth-card { width: 100%; max-width: 400px; }
.brand-big { text-align: center; margin-bottom: 24px; }
.brand-big h1 { font-size: 2rem; margin: 12px 0 8px; letter-spacing: -.02em; }
.brand-accent { color: var(--accent); }
.brand-big p { color: var(--ink-2); margin: 0; }
form label { display: block; font-size: .875rem; font-weight: 600; color: var(--ink-2); margin-bottom: 12px; }
form input, form select {
  display: block; width: 100%; margin-top: 4px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink);
  font-weight: 400; font-size: 1rem;
}
form input:focus, form select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.error { color: var(--danger); font-size: .875rem; min-height: 1.2em; margin: 4px 0 12px; }

.btn {
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 12px 20px; font-weight: 600; cursor: pointer;
}
.btn.primary {
  background: var(--accent); color: var(--accent-ink); border-color: var(--accent); width: 100%;
  font-size: 1.05rem; font-weight: 800; box-shadow: 0 4px 0 color-mix(in srgb, var(--accent) 55%, #000);
  transition: transform .15s var(--bounce), box-shadow .15s;
}
.btn.primary:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 color-mix(in srgb, var(--accent) 55%, #000); }
.btn.danger { color: var(--danger); }
.btn:disabled { opacity: .6; cursor: default; }
.link-btn { background: none; border: 0; color: var(--ink-2); text-decoration: underline; cursor: pointer; padding: 8px; font-size: .875rem; }
.link-btn:disabled { opacity: .4; text-decoration: none; cursor: default; }

.seg { display: flex; background: var(--accent-soft); border-radius: 999px; padding: 4px; margin-bottom: 20px; }
.seg button {
  flex: 1; border: 0; background: none; padding: 10px; border-radius: 999px; font-weight: 600;
  color: var(--ink-2); cursor: pointer;
}
.seg button[aria-selected="true"], .seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.seg.small { margin: 0; flex: none; }
.seg.small button { padding: 6px 12px; font-size: .875rem; }

/* ---------- Drink picker ---------- */
.picker-card { max-width: 480px; }
.picker-card h1 { font-size: clamp(2rem, 9vw, 2.6rem); font-weight: 800; line-height: 1.05; margin-top: 8px; }
.picker-card .eyebrow { color: var(--pop); }
.wiggle { display: inline-block; color: var(--pop); animation: wiggle 2.6s ease-in-out infinite; transform-origin: 50% 80%; }
@keyframes wiggle { 0%, 80%, 100% { transform: none; } 85% { transform: rotate(-5deg) scale(1.05); } 92% { transform: rotate(4deg); } }
.persona-live { margin: 0 0 8px; text-align: center; font: 700 .9375rem/1.3 var(--f-display); min-height: 1.3em; }
.persona-live b { color: var(--pop); }
.persona-live.swap { animation: pop .35s var(--bounce); }
.pick-group h3 { font-size: .8125rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); margin: 16px 0 8px; }
.pick-group:first-child h3 { margin-top: 0; }
.pick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; grid-auto-flow: row dense; }
.picker-bar {
  position: sticky; bottom: 0; margin: 16px -16px 0; padding: 12px 16px calc(env(safe-area-inset-bottom) + 12px);
  background: linear-gradient(transparent, var(--bg) 16px);
}
.picker-bar .error { margin: 0 0 8px; min-height: 0; text-align: center; }
.picker-done { text-align: center; position: relative; }
.picker-done .eyebrow { color: var(--pop); margin-bottom: 12px; }
.confetti { position: fixed; inset: 0; width: 100vw; height: 100dvh; pointer-events: none; z-index: 40; }
.persona-card {
  padding: 22px 18px 18px; margin-bottom: 16px; border-radius: 22px; background: var(--surface);
  border: 1.5px solid var(--ink); box-shadow: 5px 5px 0 var(--ink); animation: pop .55s var(--bounce) both .1s;
}
.persona-emoji { font-size: 4rem; line-height: 1; animation: pop .6s var(--bounce) both .3s; }
.persona-kicker { margin: 8px 0 2px; font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.persona-card h1 { font-size: clamp(1.9rem, 8vw, 2.4rem); font-weight: 800; color: var(--pop); margin: 0 0 6px; }
.persona-card p:last-child { margin: 0; color: var(--ink-2); }
.done-facts { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 8px; text-align: left; }
.done-facts li {
  display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 14px; background: var(--accent-soft);
  font-size: .9375rem; animation: rise .4s ease-out both;
}
.done-facts li .ic { font-size: 1.3rem; }
.done-facts b { font-family: var(--f-display); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.fine { font-size: .8125rem; color: var(--muted); margin: 8px 0 0; }
.done-burst { font-size: 3.5rem; animation: pop .5s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes pop { from { transform: scale(.3) rotate(-20deg); opacity: 0; } }
.done-list { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.done-list li {
  padding: 6px 12px; border-radius: 999px; background: var(--accent-soft); font-weight: 600; font-size: .9375rem;
  animation: pop .4s cubic-bezier(.3, 1.6, .5, 1) both;
}
.pick {
  transition: transform .2s var(--bounce), box-shadow .2s, background .15s;
  display: flex; align-items: center; gap: 8px; padding: 10px 12px; min-width: 0; text-align: left; cursor: pointer;
  border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface); font-weight: 600;
}
.pick .emoji { font-size: 1.35rem; line-height: 1; }
.pick .label { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pick .name { font-size: .875rem; overflow-wrap: break-word; }
.pick .sub { font: 500 .6875rem/1.25 var(--f-body); color: var(--muted); overflow-wrap: break-word; }
.pick .check { flex: none; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; font-size: .75rem; color: transparent; }
.pick[aria-pressed="true"] { border-color: var(--ink); background: var(--accent-soft); box-shadow: 3px 3px 0 var(--ink); transform: rotate(-1deg); }
.pick:active { transform: scale(.94); }
.pick[aria-pressed="true"] .emoji { animation: pop .35s var(--bounce); }
.pick[aria-pressed="true"] .check { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.pick:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.picker-alt { text-align: center; margin: 4px 0 0; }
.tracking { font-size: .875rem; color: var(--ink-2); margin: 0 0 8px; }
.tracking #auth-drinks { font-size: 1.1rem; letter-spacing: .1em; }
.tracking .link-btn, .profile-drinks .link-btn { padding: 4px; }

/* ---------- Shell ---------- */
.topbar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.icon-btn { border: 0; background: none; padding: 0; cursor: pointer; }
.avatar {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink); font-weight: 700;
}
.views { max-width: 720px; margin: 0 auto; padding: 8px 16px calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 24px); }
.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 5; display: flex; justify-content: space-around;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface); border-top: 1px solid var(--line);
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--muted); text-decoration: none; font-size: .75rem; font-weight: 600;
}
.tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a[aria-current="page"] { color: var(--accent); }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin-bottom: 16px; box-shadow: var(--shadow);
}

/* ---------- Today ---------- */
.counter-wrap { text-align: center; padding: 8px 0 16px; }
.eyebrow { margin: 0; color: var(--ink-2); font-size: .875rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.counter { display: flex; flex-direction: column; align-items: center; margin: 4px 0 16px; }
.count { font-size: clamp(5rem, 28vw, 8rem); font-weight: 800; line-height: 1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.count.bump { animation: bump .35s ease; }
@keyframes bump { 40% { transform: scale(1.12); } }
.count-label { color: var(--ink-2); font-weight: 600; }

/* One tap button per tracked drink. A single drink gets one big round button. */
.drink-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; max-width: 420px; margin: 0 auto; }
@media (min-width: 420px) { .drink-grid.many { grid-template-columns: repeat(3, 1fr); } }
.drink-btn {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 116px; padding: 12px 8px; border: 0; border-radius: 22px; cursor: pointer;
  background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 6px 18px rgb(138 75 34 / .28), inset 0 -5px 0 rgb(0 0 0 / .12);
  transition: transform .1s ease; touch-action: manipulation; user-select: none;
}
.drink-btn:active { transform: scale(.95); }
.drink-btn:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.drink-btn .emoji { font-size: 2.4rem; line-height: 1.1; }
.drink-btn .name { font-weight: 700; font-size: .9375rem; }
.drink-btn .n {
  position: absolute; top: 8px; right: 10px; min-width: 1.6em; padding: 0 6px; border-radius: 999px;
  background: var(--accent-ink); color: var(--accent); font-weight: 800; font-size: .875rem; font-variant-numeric: tabular-nums;
}
.drink-btn .n.bump { animation: bump .35s ease; }
.drink-grid.solo { display: flex; justify-content: center; }
.drink-grid.solo .drink-btn { width: 200px; height: 200px; border-radius: 50%; box-shadow: 0 10px 30px rgb(138 75 34 / .35), inset 0 -6px 0 rgb(0 0 0 / .12); }
.drink-grid.solo .drink-btn .emoji { font-size: 4.5rem; }
.drink-grid.solo .drink-btn .n { top: 22px; right: 30px; }
.pop-art {
  position: absolute; left: 50%; top: 20%; display: flex; flex-direction: column; align-items: center;
  pointer-events: none; animation: pop-art 1s ease-out forwards;
}
.pop-art .pop-emoji { font-size: 2.6rem; line-height: 1; filter: drop-shadow(0 4px 6px rgb(0 0 0 / .2)); }
.pop-art .pop-plus { font-weight: 800; font-size: 1.1rem; color: var(--accent); }
@keyframes pop-art {
  0% { transform: translate(-50%, 0) scale(.4); opacity: 0; }
  20% { transform: translate(calc(-50% + var(--dx) * .3), -40px) scale(1.25); opacity: 1; }
  100% { transform: translate(calc(-50% + var(--dx)), -120px) scale(.9); opacity: 0; }
}
.today-actions { margin-top: 12px; }
.quip { color: var(--ink-2); min-height: 1.4em; margin: 4px 0 0; }
.pending { color: var(--muted); font-size: .875rem; }

.ticker { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; text-align: center; }
.ticker-num { display: block; font-size: 1.75rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.ticker-label { color: var(--ink-2); font-size: .8125rem; }

/* ---------- "Had one earlier?" sheet ---------- */
dialog.sheet { margin: auto auto 0; width: min(520px, 100vw); max-width: 100vw; border-radius: 24px 24px 0 0; padding: 22px 16px calc(env(safe-area-inset-bottom) + 16px); }
dialog.sheet[open] { animation: sheet-up .3s var(--bounce); }
@keyframes sheet-up { from { transform: translateY(40%); opacity: 0; } }
.sheet h2 { font-size: 1.5rem; font-weight: 800; }
.chips.wrap { flex-wrap: wrap; overflow: visible; margin: 0 0 12px; padding: 0; }
.sheet-label { margin: 4px 0 8px; font-weight: 700; font-size: .875rem; color: var(--ink-2); }
.earlier-exact { display: flex; gap: 10px; align-items: center; margin-bottom: 4px; }
.earlier-exact input[type="time"] {
  flex: 1; min-width: 0; margin: 0; padding: 8px 12px; border: 1.5px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink); font: 700 1rem var(--f-display);
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Guests ---------- */
.guest-banner {
  display: flex; align-items: center; gap: 12px; margin: 12px auto 0; max-width: 420px; padding: 12px 14px; text-align: left;
  border-radius: 16px; background: var(--surface); border: 1.5px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); animation: pop .4s var(--bounce);
}
.guest-banner p { margin: 0; flex: 1; font-size: .875rem; color: var(--ink-2); }
.guest-banner b { color: var(--ink); }
.btn.small-pop { flex: none; padding: 8px 14px; font-weight: 800; background: var(--pop); border-color: var(--pop); color: #fff; }
.guest-cta { text-align: center; padding: 24px 18px; border: 1.5px solid var(--ink); box-shadow: 5px 5px 0 var(--ink); }
.guest-cta-emoji { font-size: 3rem; animation: pop .5s var(--bounce); }
.guest-cta h3 { font-size: 1.4rem; margin: 6px 0; }
.guest-cta p { color: var(--ink-2); margin: 0 0 12px; }
.guest-cta ul { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 8px; text-align: left; }
.guest-cta li { padding: 10px 12px; border-radius: 12px; background: var(--accent-soft); font-weight: 600; }

/* ---------- Stats ---------- */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 16px; }
@media (min-width: 560px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.tile .v { font-size: 1.75rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.tile .k { color: var(--ink-2); font-size: .8125rem; font-weight: 600; }
.tile .d { color: var(--muted); font-size: .75rem; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 16px; padding: 0 16px 2px; scrollbar-width: none; }
.chips button {
  flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 6px 12px; font-size: .875rem; font-weight: 600; color: var(--ink-2); cursor: pointer;
}
.chips button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.filters select {
  flex: 1 1 140px; min-width: 0; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); font-size: .875rem;
}

.chart { width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text, .map text { fill: var(--muted); font-size: 11px; }
.chart .grid line { stroke: var(--line); }
.chart .axis path, .chart .axis line { stroke: none; }
.chart .bar { fill: var(--bar); }
.chart .bar.hi { fill: var(--accent); }
.chart .bar.dim { opacity: .45; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; }
.chart .area { fill: var(--accent); opacity: .1; }
.chart .label { fill: var(--ink-2); font-size: 12px; }
.chart .label.hi { fill: var(--ink); font-weight: 700; }
.chart .value { fill: var(--ink-2); font-size: 12px; font-variant-numeric: tabular-nums; }
.chart .hit { fill: transparent; cursor: default; }
.chart .cross { stroke: var(--muted); stroke-dasharray: 3 3; }
.chart .dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }

.map { width: 100%; aspect-ratio: 2 / 1.05; touch-action: pan-y; }
.map svg { width: 100%; height: 100%; display: block; }
.map .country { fill: var(--nodata); stroke: var(--surface); stroke-width: .5; }
.map .country:hover, .map .country.active { stroke: var(--ink); stroke-width: 1.2; }
.map .country.mine { stroke: var(--ink); stroke-width: 1.4; stroke-dasharray: 2 1.5; }
.legend { display: flex; align-items: center; gap: 8px; font-size: .75rem; color: var(--ink-2); margin-top: 8px; }
.legend .ramp { flex: 1; max-width: 220px; height: 10px; border-radius: 5px; background: linear-gradient(90deg, var(--map-lo), var(--map-hi)); }
.legend .nd { display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--nodata); margin-left: 8px; vertical-align: -1px; }

.rank { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.rank th { text-align: left; color: var(--muted); font-size: .75rem; font-weight: 600; padding: 4px 0 8px; }
.rank td { padding: 8px 0; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.rank td:first-child { width: 2em; color: var(--muted); }
.rank .num { text-align: right; }
.rank tr.mine td { font-weight: 700; }

.compare-row { display: grid; grid-template-columns: minmax(6em, 40%) 1fr 2.5em; gap: 8px; align-items: center; margin: 8px 0; font-size: .875rem; }
.compare-row .lbl { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compare-row .track { height: 14px; }
.compare-row .fill { height: 100%; border-radius: 0 4px 4px 0; background: var(--bar); min-width: 2px; }
.compare-row.you .fill { background: var(--accent); }
.compare-row.you .lbl { color: var(--ink); font-weight: 700; }
.compare-row .val { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; }

/* ---------- Overlays ---------- */
.tooltip {
  position: fixed; z-index: 20; pointer-events: none; background: var(--ink); color: var(--bg);
  padding: 8px 10px; border-radius: 8px; font-size: .8125rem; line-height: 1.35; max-width: 220px;
  box-shadow: 0 4px 16px rgb(0 0 0 / .2);
}
.tooltip b { display: block; }
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 16px); transform: translateX(-50%);
  z-index: 30; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: .875rem;
  max-width: calc(100vw - 32px);
}
dialog {
  border: 0; border-radius: var(--radius); padding: 20px; width: min(420px, calc(100vw - 32px));
  background: var(--surface); color: var(--ink);
}
dialog::backdrop { background: rgb(0 0 0 / .4); }
dialog h2 { margin: 0 0 4px; font-size: 1.25rem; }
dialog .row { display: flex; gap: 8px; justify-content: flex-end; }
dialog .row .btn.primary { width: auto; }
.profile-drinks { display: flex; align-items: center; gap: 8px; font-size: .875rem; margin: 4px 0 8px; }
.profile-drinks .k { font-weight: 600; color: var(--ink-2); }
.profile-drinks #profile-drinks { font-size: 1.1rem; letter-spacing: .1em; }
dialog hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- World: live map ---------- */
.world-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.world-head h2 { margin: 0; }
.world-mode { margin: 0; flex: none; }
.world-mode button { padding: 6px 14px; font-size: .875rem; display: inline-flex; align-items: center; gap: 6px; }
.live-dot, .live-badge i { width: 8px; height: 8px; border-radius: 50%; background: var(--pop); display: inline-block; }
.world-mode button[aria-pressed="true"] .live-dot, .live-badge i { animation: live-blink 1.4s infinite; }
@keyframes live-blink { 50% { opacity: .25; } }

.live-counts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; text-align: center; }
#live-count.bump { animation: bump .35s ease; }
.live-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.live-badge { display: inline-flex; align-items: center; gap: 6px; font-size: .75rem; font-weight: 800; letter-spacing: .1em; color: var(--pop); }
.live-window { font-size: .75rem; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.live-map .night { fill: #000; opacity: .16; pointer-events: none; }
.live-map .country.open { fill: var(--surface); stroke: var(--muted); stroke-dasharray: 1.5 1.5; stroke-opacity: .5; }
.live-map .pops { pointer-events: none; }
.live-map .pop .ring { fill: none; stroke-width: 1.6; }
.live-map .pop .dot { stroke: var(--surface); stroke-width: .8; }
.live-map .pop.me .dot { stroke: var(--pop); stroke-width: 2; }
.live-map .pop .emoji { font-size: 13px; text-anchor: middle; fill: var(--ink); }
.live-filters { margin: 10px 0 12px; padding: 0; flex-wrap: wrap; overflow: visible; }

.live-bean { display: flex; align-items: center; gap: 10px; background: var(--accent-soft); border-radius: 16px; padding: 8px 12px; min-height: 64px; }
.live-bean-art { flex: none; width: 44px; display: grid; place-items: center; }
.live-bean p { margin: 0; font-size: .9375rem; font-weight: 600; line-height: 1.35; }
.live-bean p.talk { animation: live-talk .35s ease; }
@keyframes live-talk { from { transform: translateY(4px); opacity: .3; } }

.live-feed { list-style: none; padding: 0; margin: 12px 0 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.live-feed li { min-width: 0; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; font-size: .875rem; animation: live-in .35s ease; }
.live-feed li.me { border-color: var(--pop); }
.live-feed .w { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-feed .t { color: var(--muted); font-size: .75rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
@keyframes live-in { from { transform: translateY(-6px); opacity: 0; } }
.live-foot { display: grid; gap: 4px; margin-top: 12px; justify-items: start; }

.flag-card p { margin: 0; }
.flag-bar { height: 10px; border-radius: 999px; background: var(--accent-soft); overflow: hidden; margin: 10px 0; }
.flag-bar i { display: block; height: 100%; width: 2%; background: var(--pop); border-radius: 999px; transition: width .6s ease; }

form label.check-row { display: flex; align-items: center; gap: 10px; font-weight: 600; }
form label.check-row input { width: auto; margin: 0; }

@media (prefers-reduced-motion: reduce) {
  .live-dot, .live-badge i, .live-feed li, .live-bean p.talk, #live-count.bump { animation: none !important; }
}

.live-measure-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.live-measure-row .seg button { white-space: nowrap; }
.live-legend { font-size: .75rem; color: var(--ink-2); }
.rank-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 4px; }
.rank-list li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto auto; gap: 10px; align-items: baseline; padding: 6px 8px; border-radius: 10px; font-size: .9375rem; font-variant-numeric: tabular-nums; }
.rank-list li.mine { background: var(--accent-soft); font-weight: 700; }
.rank-list .r { color: var(--muted); font-weight: 700; }
.rank-list .c { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-list .p { color: var(--muted); font-size: .75rem; }
.rank-list li.gap, .rank-list li.empty { display: block; color: var(--ink-2); padding: 2px 8px; }
