/* SipSquad — clean, fast, bold badges. Mobile first; tap targets ≥ 64px on the
   logging path; nothing on the logging path animates longer than 600ms. */

/* Light, clean, pure: white page, one blue, hairlines instead of shadows.
   Light is the default; dark only when chosen (or "Match system"). */
:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f4f8fc;
  --line: #e6edf5;
  --text: #1b2a3d;
  --muted: #718096;
  --primary: #0a84d6;
  --primary-2: #0a84d6;
  --primary-ink: #ffffff;
  --accent: #f59e0b;
  --good: #0f9d6c;
  --warn: #9a6200;
  --danger: #d93636;
  --ring1: #7dd3fc;
  --ring2: #0a84d6;
  --ring-bg: #edf3f9;
  --over: #34d399;
  --shadow: none;
  --radius: 22px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --tabs-h: 68px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0b1220; --surface: #111a2c; --surface-2: #172238; --line: #22304a; --text: #e6edf7; --muted: #94a3b8;
    --primary: #38bdf8; --primary-2: #38bdf8; --primary-ink: #04121f; --ring1: #7dd3fc; --ring2: #38bdf8; --ring-bg: #1a2840;
    --warn: #fbbf24; --danger: #f87171; --good: #34d399;
    color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    --bg: #0b1220; --surface: #111a2c; --surface-2: #172238; --line: #22304a; --text: #e6edf7; --muted: #94a3b8;
    --primary: #38bdf8; --primary-2: #38bdf8; --primary-ink: #04121f; --ring1: #7dd3fc; --ring2: #38bdf8; --ring-bg: #1a2840;
    --warn: #fbbf24; --danger: #f87171; --good: #34d399;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
[hidden], .hidden { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
input, select { font: inherit; color: inherit; }
a { color: var(--primary); }
h1, h2 { margin: 0; line-height: 1.2; }
h2 { font-size: 19px; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; }
.gap { gap: 10px; }
.ic { flex: none; display: block; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }

/* ── Layout ───────────────────────────────────────────────────────────────── */
#app { min-height: 100vh; min-height: 100dvh; }
.views { max-width: 560px; margin: 0 auto; padding: calc(var(--safe-t) + 10px) 16px calc(var(--tabs-h) + var(--safe-b) + 20px); }
.view { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.view-title { font-size: 30px; font-weight: 700; letter-spacing: -.01em; padding: 8px 2px 2px; }
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 4px max(8px, env(safe-area-inset-left)) calc(var(--safe-b) + 4px); background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); border-top: 1px solid var(--line);
}
.tabs button { min-height: 60px; border: 0; background: none; display: grid; justify-items: center; align-content: center; gap: 2px; color: var(--muted); font-size: 11.5px; font-weight: 600; border-radius: 16px; }
.tabs button[aria-current="page"] { color: var(--primary); }
.tabs button[aria-current="page"] svg { transform: translateY(-1px); }
.offline-pill { position: fixed; top: calc(var(--safe-t) + 8px); left: 50%; transform: translate(-50%, -80px); background: #334155; color: #fff; font-size: 13px; font-weight: 600; padding: 6px 14px; border-radius: 99px; z-index: 30; transition: transform .3s; }
body.offline .offline-pill { transform: translate(-50%, 0); }
.offline-first { text-align: center; padding: 30vh 20px; display: grid; gap: 14px; justify-items: center; }

/* ── Cards, buttons, fields ───────────────────────────────────────────────── */
.card { background: var(--surface); border-radius: var(--radius); padding: 18px; border: 1px solid var(--line); display: grid; gap: 12px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px;
  border-radius: 16px; border: 0; background: var(--surface-2); color: var(--text); font-weight: 700; text-decoration: none;
  transition: transform .12s, filter .12s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; }
.btn.primary { background: var(--primary); color: var(--primary-ink); }
.btn.big { min-height: 58px; font-size: 17px; width: 100%; }
.btn.wide { width: 100%; }
.btn.sm { min-height: 40px; padding: 0 14px; font-size: 14px; border-radius: 12px; }
.btn.ghost { background: transparent; border: 1.5px solid var(--line); }
.btn.danger { background: var(--danger); color: #fff; }
.danger-text { color: var(--danger) !important; }
.link { background: none; border: 0; color: var(--primary); font-weight: 600; padding: 10px; min-height: 44px; }
.link.sm { min-height: 0; padding: 0 4px; font-size: 14px; }
.icon-btn { width: 44px; height: 44px; border-radius: 14px; border: 0; background: var(--surface-2); display: grid; place-items: center; }
.field { width: 100%; min-height: 52px; padding: 0 14px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); }
.field:focus { border-color: var(--primary); outline: none; }
.field.num { max-width: 120px; text-align: right; }
.field.sm { min-height: 40px; max-width: 86px; }
.field-row { display: flex; align-items: center; gap: 10px; }
.field-row > span:first-child { flex: 1; font-weight: 600; }
.unit { color: var(--muted); min-width: 26px; }
.label { font-weight: 700; font-size: 14px; color: var(--muted); margin-top: 2px; }
.seg { display: flex; background: var(--surface-2); border-radius: 14px; padding: 4px; gap: 4px; }
.seg.wrap { flex-wrap: wrap; }
.seg button { flex: 1; min-height: 44px; border: 0; border-radius: 11px; background: none; font-weight: 600; font-size: 14.5px; color: var(--muted); padding: 0 8px; white-space: nowrap; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chips button { min-height: 42px; padding: 0 14px; border-radius: 99px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 600; font-size: 14px; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.chips button.on { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, var(--surface)); color: var(--primary); }
.toggle { display: flex; align-items: center; gap: 12px; min-height: 56px; cursor: pointer; }
.toggle > span { flex: 1; display: grid; }
.toggle > span .muted { font-size: 13.5px; }
.toggle input { appearance: none; width: 52px; height: 32px; border-radius: 99px; background: var(--line); position: relative; transition: background .2s; flex: none; cursor: pointer; }
.toggle input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .2s; }
.toggle input:checked { background: var(--primary); }
.toggle input:checked::after { transform: translateX(20px); }
.row-btn { display: flex; align-items: center; gap: 12px; min-height: 64px; width: 100%; text-align: left; border: 0; background: none; padding: 0; }
.row-btn .grow { display: grid; }
.row-btn .muted { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: 0; }
.kv.big b { font-size: 24px; }
.msg { color: var(--danger); font-weight: 600; min-height: 1.3em; font-size: 14px; }
.warn { color: var(--warn); }
.times label { flex: 1; display: grid; gap: 6px; font-weight: 600; font-size: 14px; color: var(--muted); }
.times.big .field { font-size: 22px; min-height: 64px; text-align: center; }
.sched { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; align-items: end; }
.sched label { display: grid; gap: 4px; font-size: 13px; font-weight: 700; color: var(--muted); }
.sched .field { max-width: none; }
.avatar { display: inline-grid; place-items: center; border-radius: 50%; background: color-mix(in srgb, var(--av) 22%, var(--surface)); border: 2px solid color-mix(in srgb, var(--av) 55%, transparent); line-height: 1; flex: none; }
.avatars-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; }
.avatars-pick button { height: 52px; border-radius: 14px; border: 2px solid transparent; background: var(--surface-2); font-size: 26px; }
.avatars-pick button.on { border-color: var(--primary); }
.colors { display: flex; gap: 10px; flex-wrap: wrap; }
.colors button { width: 44px; height: 44px; border-radius: 50%; border: 3px solid transparent; }
.colors button.on { border-color: var(--text); }
.icons { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.icons button { aspect-ratio: 1; border-radius: 14px; border: 2px solid transparent; background: var(--surface-2); display: grid; place-items: center; }
.icons button.on { border-color: var(--primary); color: var(--primary); }
.linkbox { background: var(--surface-2); border-radius: 14px; padding: 14px; font-weight: 700; word-break: break-all; text-align: center; }
.code { font-family: ui-monospace, Menlo, monospace; letter-spacing: .05em; }

/* ── Home ─────────────────────────────────────────────────────────────────── */
.home { gap: 8px; }
.home-top { display: flex; gap: 8px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; border-radius: 99px; border: 0; background: var(--surface-2); font-weight: 600; font-size: 15px; white-space: nowrap; }
.chip.squadchip { flex: 1; min-width: 0; justify-content: center; overflow: hidden; }
.chip.squadchip span:last-child { overflow: hidden; text-overflow: ellipsis; }
.chip.me { padding-left: 6px; }
.chip .sq-e { font-size: 18px; }
.flame { color: var(--muted); }
.streak.lit .flame { color: var(--accent); fill: color-mix(in srgb, var(--accent) 30%, transparent); }
/* ~30% bigger than before; text below is sized from the ring's own width (cqw). */
.ring-wrap { position: relative; width: min(78vw, 36vh, 360px); min-width: 200px; aspect-ratio: 1; margin: 6px auto 0; container-type: inline-size; }
.ring { width: 100%; height: 100%; display: block; }
.ring circle { fill: none; stroke-width: 22; stroke-linecap: round; }
.ring-bg { stroke: var(--ring-bg); }
.ring-fg { stroke: url(#ringg); transition: stroke-dashoffset .5s cubic-bezier(.2, .8, .2, 1); }
.ring-over { stroke: var(--over); transition: stroke-dashoffset .5s cubic-bezier(.2, .8, .2, 1); opacity: .9; }
/* Everything stays inside the inner circle (inner edge ≈ 75% of the width). */
.ring-center { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; text-align: center; gap: 1.5cqw; }
.ring-num { white-space: nowrap; max-width: 66cqw; }
.ring-num b { font-size: 20cqw; line-height: 1; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.ring-num span { font-size: 6.4cqw; font-weight: 500; color: var(--muted); }
/* "200 / 125 oz" and "1,250 / 2,000 ml" step down so they stay inside the ring. */
.ring-num[data-len="m"] b { font-size: 16cqw; }
.ring-num[data-len="m"] span { font-size: 5.6cqw; }
.ring-num[data-len="l"] b { font-size: 12.5cqw; }
.ring-num[data-len="l"] span { font-size: 4.8cqw; }
.ring-sub { font-weight: 600; color: var(--muted); font-size: 5.4cqw; max-width: 58cqw; text-wrap: balance; }
.ring-wrap.done .ring-sub { color: var(--good); }
/* Where you should be by now: a lighter version of the ring color. */
.ring path.ring-pace { fill: none; stroke: color-mix(in srgb, var(--ring2) 60%, var(--ring-bg)); stroke-width: 2.2; stroke-dasharray: 5 4; stroke-linecap: round; stroke-linejoin: round; }
.ring-wrap .confetti { position: absolute; inset: 0; }
.banner { display: flex; align-items: center; gap: 12px; background: var(--surface-2); border-radius: 18px; padding: 12px 8px 12px 14px; }
.banner > div { flex: 1; display: grid; }
.banner span { font-size: 13.5px; color: var(--muted); }
.banner .bn-emoji { font-size: 24px; }
.banner .ic { color: var(--primary); }
.bn-x { width: 40px; height: 40px; border: 0; background: none; color: var(--muted); display: grid; place-items: center; border-radius: 12px; }
.grid-head { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 13.5px; font-weight: 600; padding: 4px 2px 0; }
.grid-head .link { padding: 6px 4px; min-height: 36px; }
.drinks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (min-width: 480px) { .drinks { grid-template-columns: repeat(4, 1fr); } }
.drink {
  position: relative; min-height: 92px; border: 0; border-radius: 20px; background: var(--surface-2);
  display: grid; justify-items: center; align-content: center; gap: 2px; padding: 10px 6px; user-select: none; -webkit-user-select: none;
  -webkit-touch-callout: none; transition: transform .15s;
}
/* One hue for every drink icon: calm, and the drink name does the telling. */
.drink .d-ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--surface); color: var(--primary); margin-bottom: 4px; }
.d-ic.big { width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center; background: color-mix(in srgb, var(--dc) 16%, transparent); color: var(--dc); }
.d-ic.sm { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--dc) 16%, transparent); color: var(--dc); flex: none; }
.d-name { font-weight: 600; font-size: 14.5px; line-height: 1.15; text-align: center; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; max-width: 100%; }
.d-amt { font-size: 13px; color: var(--muted); font-weight: 600; }
.drink.pressing { transform: scale(.94); }
.drink.tapped { animation: tap .4s ease-out; }
@keyframes tap { 0% { transform: scale(.92); } 60% { transform: scale(1.04); } 100% { transform: scale(1); } }
.drink.add { background: transparent; border: 1.5px dashed var(--line); color: var(--muted); }
.drinks.arranging .drink { animation: wiggle .3s ease-in-out infinite alternate; touch-action: none; }
.drinks.arranging .drink:nth-child(2n) { animation-delay: .15s; }
.drinks.arranging .drink.dragging { animation: none; transform: scale(1.08); box-shadow: 0 12px 30px rgba(15, 23, 42, .25); z-index: 2; }
.grip { position: absolute; top: 6px; right: 6px; color: var(--muted); }
@keyframes wiggle { from { transform: rotate(-1.2deg); } to { transform: rotate(1.2deg); } }
.opt-head { display: flex; align-items: center; gap: 14px; }

/* ── Sheets, toasts, pops ─────────────────────────────────────────────────── */
/* --vv-top/--vv-h follow the visible area, so an open keyboard pushes the sheet up (ui.js). */
.sheet-wrap { position: fixed; left: 0; right: 0; top: var(--vv-top, 0px); height: var(--vv-h, 100%); z-index: 50; display: grid; align-items: end; justify-items: center; }
.sheet-bg { position: absolute; inset: 0; background: rgba(2, 6, 23, .45); opacity: 0; transition: opacity .2s; }
.sheet {
  position: relative; width: 100%; max-width: 560px; max-height: calc(var(--vv-h, 100vh) * .92); overflow-y: auto; background: var(--surface); border-radius: 26px 26px 0 0;
  padding: 10px 18px calc(var(--safe-b) + 20px); transform: translateY(100%); transition: transform .25s cubic-bezier(.2, .8, .2, 1); overscroll-behavior: contain;
}
.sheet-wrap.in .sheet-bg { opacity: 1; }
.sheet-wrap.in .sheet { transform: none; }
body.kb-open .sheet { padding-bottom: 16px; }
.sheet-grab { width: 44px; height: 5px; border-radius: 9px; background: var(--line); margin: 0 auto 12px; cursor: grab; padding: 6px 0; background-clip: content-box; }
.sheet-x { position: absolute; top: 10px; right: 10px; width: 44px; height: 44px; border: 0; background: var(--surface-2); border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.sheet-body { display: grid; gap: 14px; padding-top: 4px; }
.sheet-body h2 { font-size: 22px; padding-right: 48px; }
body.sheet-open { overflow: hidden; }
@media (min-width: 640px) { .sheet-wrap { align-items: center; } .sheet { border-radius: 26px; } }
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabs-h) + var(--safe-b) + 14px); transform: translate(-50%, 20px); opacity: 0; z-index: 60;
  width: min(92vw, 480px); display: flex; align-items: center; gap: 10px; padding: 12px 8px 12px 16px; border-radius: 16px;
  background: #0f172a; color: #fff; font-weight: 600; box-shadow: 0 10px 30px rgba(2, 6, 23, .3); transition: transform .2s, opacity .2s; overflow: hidden;
}
:root[data-theme="dark"] .toast:not(.warn) { background: #e2e8f0; color: #0f172a; }
.toast.in { transform: translate(-50%, 0); opacity: 1; }
.toast span { flex: 1; }
.toast.warn { background: #fff8eb; color: #7a4d00; border: 1px solid #f5dfb0; box-shadow: 0 8px 24px rgba(15, 23, 42, .08); }
.toast.warn .toast-btn { background: rgba(122, 77, 0, .1); }
.toast-btn { border: 0; background: rgba(255, 255, 255, .16); color: inherit; font-weight: 800; min-height: 44px; padding: 0 16px; border-radius: 12px; }
:root[data-theme="dark"] .toast:not(.warn) .toast-btn { background: rgba(15, 23, 42, .1); }
.toast-bar { position: absolute; left: 0; bottom: 0; height: 3px; background: currentColor; opacity: .35; animation: bar linear forwards; width: 100%; transform-origin: left; }
@keyframes bar { to { transform: scaleX(0); } }
.pop { position: fixed; inset: 0; z-index: 70; display: grid; justify-items: center; align-items: start; padding-top: calc(var(--safe-t) + 64px); pointer-events: none; }
.pop-card {
  pointer-events: none; position: relative; width: min(84vw, 320px); background: var(--surface); border-radius: 28px; padding: 22px 20px 18px; text-align: center;
  border: 1px solid var(--line); box-shadow: 0 24px 60px rgba(15, 23, 42, .16); display: grid; justify-items: center; gap: 4px; transform: scale(.7); opacity: 0; transition: transform .35s cubic-bezier(.2, 1.4, .4, 1), opacity .2s;
}
.pop.in .pop-card { transform: none; opacity: 1; }
.pop-eyebrow { text-transform: uppercase; letter-spacing: .1em; font-size: 12px; font-weight: 800; color: var(--primary); margin-top: 6px; }
.pop-title { font-size: 24px; font-weight: 800; }
.pop-sub { color: var(--muted); font-weight: 500; }
.pop-share { pointer-events: auto; margin-top: 10px; min-height: 44px; padding: 0 18px; border-radius: 12px; border: 0; background: var(--surface-2); font-weight: 700; display: inline-flex; gap: 6px; align-items: center; }
.confetti { position: absolute; left: 50%; top: 45%; width: 0; height: 0; pointer-events: none; }
.confetti i { position: absolute; width: 9px; height: 13px; border-radius: 2px; animation: conf .6s cubic-bezier(.1, .7, .3, 1) forwards; opacity: 0; }
@keyframes conf { 0% { transform: translate(0, 0) rotate(0); opacity: 1; } 100% { transform: translate(var(--x), var(--y)) rotate(var(--r)); opacity: 0; } }
.lvl-art { width: 150px; height: 150px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 35% 30%, #e6f6ff, #7dd3fc 58%, #0a84d6); }
.lvl-art span { font-size: 64px; font-weight: 900; color: #fff; text-shadow: 0 3px 0 rgba(0, 0, 0, .15); }
.lvl-art.sm { width: 64px; height: 64px; flex: none; }
.lvl-art.sm span { font-size: 28px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ── Stats ───────────────────────────────────────────────────────────────── */
.entries { list-style: none; margin: 0; padding: 0; display: grid; }
.entry { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 64px; border: 0; background: none; text-align: left; border-bottom: 1px solid var(--line); padding: 0; }
.entries li:last-child .entry { border-bottom: 0; }
.e-main { flex: 1; display: grid; }
.e-main .muted { font-size: 13px; }
.e-amt { font-weight: 700; }
.empty { padding: 8px 0; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.bar { fill: var(--ring-bg); }
.bar.part { fill: color-mix(in srgb, var(--primary) 45%, var(--ring-bg)); }
.bar.hit { fill: var(--primary); }
.bar.frz { fill: #93c5fd; }
.goal-line { stroke: var(--muted); stroke-opacity: .45; stroke-width: 1.5; stroke-dasharray: 4 4; }
.axis { fill: var(--muted); font-size: 10.5px; font-weight: 600; }
.hm-wrap { overflow-x: auto; }
.heat { width: 100%; min-width: 280px; height: auto; display: block; }
.hm { fill: var(--ring-bg); }
.hm.l1 { fill: color-mix(in srgb, var(--primary) 25%, var(--ring-bg)); }
.hm.l2 { fill: color-mix(in srgb, var(--primary) 50%, var(--ring-bg)); }
.hm.l3 { fill: color-mix(in srgb, var(--primary) 75%, var(--ring-bg)); }
.hm.l4 { fill: var(--primary); }
.hm.frz { fill: #a5f3fc; stroke: #0891b2; stroke-width: 1; }
.hm.today { stroke: var(--text); stroke-width: 1.5; }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i.hm { display: inline-block; width: 11px; height: 11px; border-radius: 3px; background: var(--ring-bg); }
.legend i.hm.l2 { background: color-mix(in srgb, var(--primary) 50%, var(--ring-bg)); }
.legend i.hm.l4 { background: var(--primary); }
.legend i.hm.frz { background: #a5f3fc; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.stack { display: flex; height: 14px; border-radius: 99px; overflow: hidden; gap: 2px; }
.stats3, .sq-stats { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; gap: 8px; }
.stats3 b, .sq-stats b { font-size: 24px; font-weight: 800; display: block; }
.stats3 span, .sq-stats span { font-size: 12.5px; color: var(--muted); font-weight: 600; }

/* ── Badges ──────────────────────────────────────────────────────────────── */
.level, .friends { display: flex; align-items: center; gap: 14px; }
.level .grow, .friends .grow { display: grid; gap: 4px; }
.bar-track { height: 10px; background: var(--ring-bg); border-radius: 99px; overflow: hidden; }
.bar-track i { display: block; height: 100%; background: var(--primary); border-radius: 99px; }
.badge-sec { display: grid; gap: 10px; padding: 4px 2px; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); gap: 10px; }
.bcell { border: 0; background: var(--surface-2); border-radius: 20px; padding: 12px 6px 10px; display: grid; justify-items: center; gap: 4px; min-height: 150px; align-content: start; }
.bcell .b-name { font-weight: 700; font-size: 13px; line-height: 1.2; text-align: center; }
.bcell .b-req { font-size: 11.5px; font-weight: 600; text-align: center; }
.b-prog { width: 70%; height: 6px; border-radius: 9px; background: var(--ring-bg); overflow: hidden; }
.b-prog i { display: block; height: 100%; background: var(--primary); }
.badge-art.locked { filter: saturate(.2); }
.b-detail { display: grid; justify-items: center; text-align: center; gap: 10px; padding-bottom: 6px; }
.b-detail h2 { padding: 0; font-size: 26px; }
.tier { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 4px 10px; border-radius: 99px; background: var(--surface-2); }
.t-bronze { color: #b45309; } .t-silver { color: #64748b; } .t-gold { color: #ca8a04; } .t-diamond { color: #0891b2; }

/* ── Squad ───────────────────────────────────────────────────────────────── */
.hero { text-align: center; justify-items: center; padding: 26px 20px; }
.hero-art { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--primary); }
.hero p { max-width: 34ch; }
.sq-head { display: flex; align-items: center; gap: 12px; }
.sq-big { font-size: 40px; width: 60px; height: 60px; display: grid; place-items: center; background: var(--surface-2); border-radius: 18px; flex: none; }
.members { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.member { display: flex; align-items: center; gap: 12px; min-height: 66px; }
.member .grow { display: grid; }
.member .muted { font-size: 13px; }
.member.me b { color: var(--primary); }
.ring-av { position: relative; display: grid; place-items: center; flex: none; }
.ring-av svg { position: absolute; inset: 0; }
.ring-av .ring-bg { stroke: var(--ring-bg); }
.ring-av .ring-fg { stroke: var(--primary); transition: stroke-dashoffset .5s; }
.ring-av .ring-fg.done { stroke: var(--good); }
.nudge { white-space: nowrap; }
.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.fi { display: flex; gap: 12px; align-items: flex-start; }
.fi .grow { display: grid; gap: 2px; }
.reacts { display: flex; gap: 6px; margin-top: 4px; }
.react { min-height: 36px; min-width: 48px; padding: 0 10px; border-radius: 99px; border: 1.5px solid var(--line); background: var(--surface); display: inline-flex; gap: 4px; align-items: center; justify-content: center; font-size: 15px; }
.react span { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.react.on { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, var(--surface)); }
.goal-out { display: flex; align-items: baseline; gap: 10px; background: var(--surface-2); border-radius: 16px; padding: 14px 16px; }
.goal-out b { font-size: 26px; font-weight: 700; flex: 1; }
.goal-out.big b { font-size: 34px; }
.wait { display: flex; align-items: center; gap: 10px; font-weight: 600; padding: 14px; border-radius: 14px; background: var(--surface-2); }
.dot-pulse { width: 12px; height: 12px; border-radius: 50%; background: var(--primary); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: .3; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.1); } }

/* ── Onboarding ──────────────────────────────────────────────────────────── */
.onboard { position: fixed; inset: 0; z-index: 40; overflow-y: auto; background: var(--bg); padding: calc(var(--safe-t) + 20px) 16px calc(var(--safe-b) + 28px); }
.onboard.welcome { background: radial-gradient(120% 55% at 50% 0%, color-mix(in srgb, var(--primary) 9%, var(--bg)), var(--bg) 70%); }
.ob-card { max-width: 460px; margin: 0 auto; display: grid; gap: 14px; }
.ob-card h1 { font-size: 30px; font-weight: 700; letter-spacing: -.01em; }
.ob-card > p { color: var(--muted); }
.ob-lead { font-size: 18px; }
.ob-logo { width: 72px; height: 72px; border-radius: 20px; }
.ob-points { list-style: none; padding: 0; margin: 4px 0; display: grid; gap: 10px; }
.ob-points li { display: flex; gap: 12px; align-items: center; font-weight: 500; background: var(--surface-2); border-radius: 16px; padding: 12px 14px; }
.ob-points .ic { color: var(--primary); }
.ob-fine { text-align: center; font-size: 13.5px; }
.ob-invite { display: flex; gap: 12px; align-items: center; background: var(--surface-2); border-radius: 18px; padding: 12px 14px; }
.ob-invite > div { display: grid; }
.ob-invite span { color: var(--muted); font-size: 14px; }
.ob-emoji { font-size: 34px; }
.ob-steps { margin: 0; padding-left: 22px; display: grid; gap: 12px; font-weight: 500; }
.ob-steps li::marker { font-weight: 800; color: var(--primary); }
.ob-steps.ob-shots li span { display: block; margin-bottom: 8px; }
.ob-shot { width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--line); display: block; }
.ob-tip { font-size: 14px; color: var(--muted); background: var(--surface); border-radius: 14px; padding: 12px; }
.ob-tip .ic, .ob-steps .ic { display: inline-block; vertical-align: -3px; }
.ob-progress { display: flex; gap: 6px; }
.ob-progress i { flex: 1; height: 5px; border-radius: 9px; background: var(--line); }
.ob-progress i.on { background: var(--primary); }
.ob-bell { font-size: 52px; }

/* ── Notifications, ranks, bottles ───────────────────────────────────────── */
.chip.bell { position: relative; width: 44px; padding: 0; justify-content: center; flex: none; }
.chip.bell i { position: absolute; top: -2px; right: -2px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px; background: var(--danger); color: #fff; font-size: 11.5px; font-weight: 800; font-style: normal; display: grid; place-items: center; border: 2px solid var(--bg); }
.rk-mini { font-size: 18px; line-height: 1; }
.chip.me { padding-left: 10px; }
.inbox { display: grid; gap: 4px; }
.ib-item { display: flex; gap: 12px; align-items: flex-start; width: 100%; text-align: left; border: 0; background: none; padding: 12px 8px; border-radius: 14px; min-height: 64px; }
.ib-item .grow { display: grid; gap: 1px; }
.ib-item .muted { font-size: 14px; }
.ib-item.unread { background: color-mix(in srgb, var(--primary) 9%, transparent); }
.ib-item.unread b::after { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); margin-left: 8px; vertical-align: 2px; }
.ib-emoji { font-size: 24px; width: 44px; height: 44px; border-radius: 14px; background: var(--surface-2); display: grid; place-items: center; flex: none; color: var(--primary); }
.ib-empty { text-align: center; padding: 24px 8px; display: grid; gap: 6px; justify-items: center; }
.ib-empty > span { font-size: 44px; }
.card.level.tappable { cursor: pointer; }
.link-text { color: var(--primary); font-weight: 700; font-size: 14px; }
.ladder { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rk { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 18px; background: var(--surface-2); }
.rk .grow { display: grid; gap: 3px; }
.rk.locked { opacity: .62; }
.rk.locked .rk-emoji { filter: grayscale(.8); }
.rk.current { background: color-mix(in srgb, var(--primary) 14%, var(--surface)); box-shadow: inset 0 0 0 2px var(--primary); opacity: 1; }
.rk-emoji { font-size: 32px; width: 48px; height: 48px; display: grid; place-items: center; flex: none; }
.rk-emoji.big { font-size: 44px; width: 60px; height: 60px; }
.rk-check { width: 30px; height: 30px; border-radius: 50%; background: var(--good); color: #fff; display: grid; place-items: center; font-weight: 900; flex: none; }
.vol-hero { display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: 18px; background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 18%, var(--surface)), var(--surface)); }
.vol-hero > div { display: grid; }
.vol-hero b { font-size: 26px; font-weight: 800; }
.vol-hero.together { margin-bottom: 4px; }
#rk-vol { display: grid; gap: 10px; }
.vol-art { width: 150px; height: 150px; border-radius: 50%; display: grid; place-items: center; font-size: 84px; background: radial-gradient(circle at 35% 30%, #e0f2fe, #7dd3fc 60%, #0284c7); }
.bottle-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
.bottle-pick button { min-height: 96px; border-radius: 18px; border: 2px solid var(--line); background: var(--surface); display: grid; justify-items: center; align-content: center; gap: 2px; padding: 8px 4px; color: var(--muted); }
.bottle-pick button b { color: var(--text); font-size: 13.5px; line-height: 1.15; text-align: center; }
.bottle-pick button span { font-size: 12.5px; font-weight: 600; }
.bottle-pick button.on { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, var(--surface)); color: var(--primary); }

/* ── Username, leaderboard ─────────────────────────────────────────────────── */
.uname { display: flex; align-items: center; gap: 4px; border: 1.5px solid var(--line); border-radius: 16px; padding: 0 14px; min-height: 60px; background: var(--surface); }
.uname:focus-within { border-color: var(--primary); }
.uname span { font-size: 22px; font-weight: 600; color: var(--muted); }
.uname input { flex: 1; border: 0; outline: none; background: none; font-size: 22px; font-weight: 600; min-width: 0; }
.un-msg { min-height: 1.4em; font-weight: 600; font-size: 14.5px; color: var(--muted); }
.un-msg.good { color: var(--good); }
.un-msg.bad { color: var(--danger); }
.muted-link { color: var(--muted) !important; font-weight: 500 !important; }
.lb { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.lb-row { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 4px 8px; border-radius: 14px; }
.lb-row.me { background: color-mix(in srgb, var(--primary) 10%, transparent); }
.lb-row .grow { display: grid; }
.lb-rank { width: 28px; text-align: center; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.lb-rank.top1 { color: #c99400; } .lb-rank.top2 { color: #8a97a8; } .lb-rank.top3 { color: #b4693a; }
.lb-val { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lb-gap { text-align: center; color: var(--muted); }

.rk-n { font-size: 12.5px; font-weight: 600; color: var(--muted); letter-spacing: .01em; }
.lvl-art.sm.emoji span { font-size: 32px; text-shadow: none; }
.vol-hero b { font-size: 22px; line-height: 1.2; }

/* ── Find squads, join requests ─────────────────────────────────────────── */
#sq-mode button { padding: 0 6px; }
.fs-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.fs { display: flex; align-items: center; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.fs:last-child { border-bottom: 0; }
.fs .grow { display: grid; gap: 2px; }
.sq-big.sm { width: 48px; height: 48px; font-size: 26px; border-radius: 14px; }
.fs-avs { display: flex; gap: 2px; margin-top: 2px; }
.fs-avs .avatar { border-width: 1.5px; }
.fs .btn.sm { white-space: nowrap; }
.requests { display: grid; gap: 8px; padding: 12px; border-radius: 16px; background: color-mix(in srgb, var(--primary) 8%, var(--surface)); }
.requests .label { margin: 0; }
.req { display: flex; align-items: center; gap: 10px; }
.req .grow { display: grid; }

.quick-row { margin: -4px 0 0; color: var(--muted); font-size: 15px; }
.quick-row .link { font-size: 15px; }
