/* ============================================================
   DRINKING BUDDIES — dark nightlife UI
   Palette: near-black plum, electric chartreuse, hot magenta.
   Safety states escalate lime → amber → red.
   ============================================================ */
:root {
  --bg: #0d0a14;
  --bg-2: #151020;
  --card: #1a1426;
  --card-edge: #2b2140;
  --ink: #f4f0ff;
  --muted: #9a8fb8;
  --lime: #d8ff3e;
  --magenta: #ff3ec8;
  --cyan: #3ee6ff;
  --amber: #ffb03e;
  --red: #ff4d5e;
  --safe: #4dffa1;
  --font-display: 'Unbounded', sans-serif;
  --font-body: 'Schibsted Grotesk', sans-serif;
  --r: 18px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { color-scheme: dark; }
body {
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(255, 62, 200, 0.13), transparent 60%),
    radial-gradient(700px 500px at -10% 20%, rgba(62, 230, 255, 0.07), transparent 55%),
    var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.45;
  min-height: 100dvh;
}

/* film grain */
.grain {
  position: fixed; inset: 0; z-index: 999; pointer-events: none; opacity: 0.5; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.06'/%3E%3C/svg%3E");
}

.hidden { display: none !important; }
h2 { font-family: var(--font-display); font-size: 0.8rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin: 28px 0 12px; }
.muted { color: var(--muted); }
.fine { font-size: 0.72rem; color: var(--muted); opacity: 0.85; margin-top: 12px; }
/* Short centred disclaimers were dropping their last word onto a line of its own
   ("...can't guarantee / accuracy."). Balancing splits them into even lines instead. */
.fine.center { text-wrap: balance; }
.center { text-align: center; }

/* ============================== onboarding ============================== */
.onboard { min-height: 100dvh; display: grid; place-items: center; padding: calc(32px + env(safe-area-inset-top)) 20px 48px; }
.onboard-inner { width: 100%; max-width: 420px; }
.wordmark { display: flex; flex-direction: column; align-items: center; font-family: var(--font-display); font-weight: 900; line-height: 0.95; margin-bottom: 18px; }
/* "DRINKING" in Unbounded 900 renders ~6.44x the font size in width, so it only
   fits inside (100vw - 40px of .onboard padding) up to ~13.6vw. 16vw overflowed
   by ~50px at every phone width, and the cap is set so the longest line still
   clears the 420px .onboard-inner on desktop. */
.wm-line { font-size: clamp(2.25rem, 13vw, 4rem); letter-spacing: -0.02em; animation: rise 0.7s cubic-bezier(0.2, 0.9, 0.2, 1) both; }
.wm-1 { color: var(--lime); text-shadow: 0 0 34px rgba(216, 255, 62, 0.35); }
.wm-2 { color: var(--ink); animation-delay: 0.1s; padding-left: 0.6em; }
.wm-3 { color: var(--magenta); text-shadow: 0 0 34px rgba(255, 62, 200, 0.35); animation-delay: 0.15s; }
.wm-indent { padding-left: 0; }
@keyframes rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
.tagline { color: var(--muted); margin-bottom: 26px; text-align: center; animation: rise 0.7s 0.32s cubic-bezier(0.2, 0.9, 0.2, 1) both; }
.hero-mug { display: block; width: clamp(120px, 34vw, 160px); margin: 0 auto 4px; animation: rise 0.7s cubic-bezier(0.2, 0.9, 0.2, 1) both; }
.logo { display: inline-flex; align-items: center; gap: 7px; }
.logo-mug { width: 34px; height: 30px; }

/* ============================== cards & forms ============================== */
.card {
  background: var(--card);
  border: 1px solid var(--card-edge);
  border-radius: var(--r);
  padding: 20px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}
.form { display: flex; flex-direction: column; gap: 16px; }
.form label { display: flex; flex-direction: column; gap: 7px; font-size: 0.82rem; font-weight: 700; letter-spacing: 0.04em; color: var(--muted); text-transform: uppercase; }
.hint { text-transform: none; font-weight: 400; letter-spacing: 0; opacity: 0.8; }
input {
  background: var(--bg-2);
  border: 1px solid var(--card-edge);
  border-radius: 12px;
  color: var(--ink);
  font: 500 1rem var(--font-body);
  padding: 13px 14px;
  width: 100%;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus { border-color: var(--lime); box-shadow: 0 0 0 3px rgba(216, 255, 62, 0.15); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row2.tight { gap: 8px; }
.unitwrap { position: relative; }
.unitwrap input { padding-right: 42px; }
.unitwrap span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 0.78rem; color: var(--muted); font-weight: 700; }
/* The 42px above is sized for "lbs". In the 66px ft/in boxes it left ~8px of
   content width, clipping two-digit inches ("10", "11"). These labels are half
   as wide, so they need proportionally less room reserved. */
.unitwrap.tight input { padding-left: 10px; padding-right: 26px; }
.unitwrap.tight span { right: 8px; }
.code-input { text-transform: uppercase; letter-spacing: 0.35em; font-family: var(--font-display); font-weight: 600; text-align: center; }
/* The wide tracking and display face above are for the six typed characters. The
   placeholder is a whole sentence and overflowed the box at that spacing, so it
   opts back into the body font at normal tracking. */
.code-input::placeholder {
  font-family: var(--font-body); font-weight: 500; letter-spacing: 0.02em;
  font-size: 0.88rem; text-transform: none;
}

.seg { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--bg-2); border: 1px solid var(--card-edge); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button {
  border: 0; background: transparent; color: var(--muted); font: 700 0.85rem var(--font-body);
  padding: 10px 4px; border-radius: 9px; cursor: pointer; transition: 0.15s; text-transform: none;
  min-height: 44px; /* was 37px tall -- under the 44px touch-target minimum */
}
.seg button.on { background: var(--lime); color: #131506; box-shadow: 0 0 18px rgba(216, 255, 62, 0.3); }

/* buttons */
.btn-primary, .btn-secondary, .btn-ghost, .btn-safe, .btn-loc, .ride-btn {
  font-family: var(--font-display); font-weight: 600; letter-spacing: 0.03em;
  border-radius: 14px; border: 0; cursor: pointer; padding: 15px 18px; font-size: 0.9rem;
  transition: transform 0.12s, filter 0.15s;
}
.btn-primary:active, .btn-secondary:active, .btn-safe:active { transform: scale(0.97); }
.btn-primary { background: var(--lime); color: #131506; box-shadow: 0 6px 30px rgba(216, 255, 62, 0.35); }
.btn-secondary { background: var(--magenta); color: #fff; box-shadow: 0 6px 30px rgba(255, 62, 200, 0.3); }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--card-edge); }
.btn-ghost:hover { color: var(--ink); border-color: var(--muted); }
.btn-ghost.small { padding: 9px 14px; font-size: 0.72rem; }
.full { width: 100%; }

/* ============================== app chrome ============================== */
#app { max-width: 520px; margin: 0 auto; padding: 0 18px calc(96px + env(safe-area-inset-bottom)); }
/* viewport-fit=cover + black-translucent status bar means the installed PWA
   draws under the notch, so the top inset has to be added to the padding. */
.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: calc(18px + env(safe-area-inset-top)) 2px 6px; }
.logo { flex-shrink: 0; font-family: var(--font-display); font-weight: 900; font-size: 1.25rem; letter-spacing: 0.02em; }
.logo-dot { color: var(--magenta); }
.logo-word { font-size: 0.92rem; white-space: nowrap; }
/* Same neon lime/magenta split as the onboarding wordmark (.wm-1/.wm-3), scaled
   down for the compact header line instead of two stacked display-size words. */
.logo-word-a { color: var(--lime); text-shadow: 0 0 12px rgba(216, 255, 62, 0.4); }
.logo-word-b { color: var(--magenta); text-shadow: 0 0 12px rgba(255, 62, 200, 0.4); }

/* Party switcher: only rendered once you're in 2+ parties at once. Small colored
   initial-circles, same visual language as member avatars elsewhere in the app. */
.party-switcher { display: flex; gap: 6px; margin-left: auto; }
.switcher-icon {
  width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent;
  display: grid; place-items: center; cursor: pointer; padding: 0; overflow: hidden;
  font: 800 0.78rem var(--font-display); color: #fff;
  background: hsl(var(--h) 70% 45%);
  opacity: 0.55; transition: opacity 0.15s, transform 0.15s, border-color 0.15s;
}
.switcher-icon img { width: 100%; height: 100%; object-fit: cover; }
.switcher-icon:active { transform: scale(0.92); }
.switcher-icon.on { opacity: 1; border-color: var(--lime); box-shadow: 0 0 10px rgba(216, 255, 62, 0.45); }

.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  display: grid; grid-template-columns: repeat(4, 1fr);
  max-width: 520px; margin: 0 auto;
  background: rgba(18, 13, 28, 0.92); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--card-edge);
  padding: 8px 10px calc(10px + env(safe-area-inset-bottom));
}
.tabbar button {
  background: none; border: 0; color: var(--muted); cursor: pointer;
  font: 600 0.62rem var(--font-display); letter-spacing: 0.08em; text-transform: uppercase;
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; border-radius: 12px;
  transition: color 0.15s;
}
.tabbar button .ti { font-size: 1.25rem; filter: grayscale(1) opacity(0.6); transition: filter 0.15s, transform 0.15s; }
.tabbar button.on { color: var(--lime); }
.tabbar button.on .ti { filter: none; transform: translateY(-2px); }

/* ============================== tonight / gauge ============================== */
.gauge-wrap { display: flex; flex-direction: column; align-items: center; padding-top: 14px; position: relative; }
.gauge { width: min(320px, 82vw); overflow: visible; }
.g-track { fill: none; stroke: var(--card-edge); stroke-width: 13; stroke-linecap: round; }
.g-fill {
  fill: none; stroke: var(--lime); stroke-width: 13; stroke-linecap: round;
  stroke-dasharray: 251.3; stroke-dashoffset: 251.3;
  filter: drop-shadow(0 0 10px currentColor);
  transition: stroke-dashoffset 0.9s cubic-bezier(0.2, 0.9, 0.2, 1), stroke 0.4s;
}
.g-limit { stroke: rgba(244, 240, 255, 0.45); stroke-width: 2.5; stroke-dasharray: 3 3; }
.g-num {
  font-family: var(--font-display); font-weight: 800; font-size: 27px; letter-spacing: -0.01em;
  fill: var(--lime); text-anchor: middle; transition: fill 0.4s;
}
.g-sublabel { font: 600 6.5px var(--font-display); letter-spacing: 0.25em; fill: var(--muted); text-anchor: middle; }
.status-pill {
  margin-top: -6px; font: 700 0.72rem var(--font-display); letter-spacing: 0.2em;
  padding: 7px 18px; border-radius: 999px; border: 1px solid currentColor; color: var(--lime);
}
.status-pill.sober { color: var(--lime); }
.status-pill.buzzed { color: var(--cyan); }
.status-pill.elevated { color: var(--amber); }
.status-pill.over, .status-pill.danger { color: var(--red); animation: throb 1.6s ease-in-out infinite; }
@keyframes throb { 50% { box-shadow: 0 0 22px rgba(255, 77, 94, 0.5); } }
.gauge-meta { margin-top: 14px; font-size: 0.85rem; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.gauge-meta b { color: var(--ink); }
.sep { opacity: 0.4; }

/* over-limit banner */
.limit-banner {
  margin-top: 16px; border-radius: var(--r); padding: 18px;
  background: linear-gradient(135deg, rgba(255, 77, 94, 0.16), rgba(255, 62, 200, 0.1));
  border: 1px solid rgba(255, 77, 94, 0.55);
  animation: rise 0.4s ease both;
}
.lb-title { font-family: var(--font-display); font-weight: 800; font-size: 0.95rem; color: var(--red); }
.lb-body { font-size: 0.85rem; color: var(--ink); margin-top: 5px; }
.lb-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 13px; }
.ride-btn { background: var(--bg-2); border: 1px solid var(--card-edge); color: var(--ink); text-align: center; text-decoration: none; font-size: 0.78rem; padding: 12px; }
.ride-btn:hover { border-color: var(--red); }

/* quick log */
.quick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; margin-bottom: 16px; }
.qd .qcount { font-size: 0.6rem; color: var(--cyan); display: block; margin-top: 2px; font-weight: 700; }
.qd {
  background: var(--card); border: 1px solid var(--card-edge); border-radius: 16px;
  padding: 13px 8px 11px; cursor: pointer; text-align: center; color: var(--ink);
  transition: transform 0.12s, border-color 0.15s; font-family: var(--font-body);
}
.qd:hover { border-color: var(--lime); }
.qd:active { transform: scale(0.94); }
.qd .qe { font-size: 1.55rem; display: block; }
.qd .qn { font-size: 0.74rem; font-weight: 700; display: block; margin-top: 5px; line-height: 1.2; }
.qd .qa { font-size: 0.64rem; color: var(--muted); display: block; margin-top: 2px; }

/* tonight log list */
.log-list, .member-list, .feed { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.log-list li {
  display: flex; align-items: center; gap: 12px; background: var(--card);
  border: 1px solid var(--card-edge); border-radius: 14px; padding: 11px 14px;
}
.log-list .le { font-size: 1.3rem; }
.log-list .ln { font-weight: 700; font-size: 0.9rem; flex: 1; }
.log-list .ln small { display: block; color: var(--muted); font-weight: 400; font-size: 0.72rem; }
.log-list .lt { color: var(--muted); font-size: 0.75rem; }
.log-list .lx { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 1rem; padding: 4px 6px; }
.log-list .lx:hover { color: var(--red); }
.empty { color: var(--muted); font-size: 0.85rem; background: none !important; border: 0 !important; padding: 6px 2px !important; }

/* ============================== party ============================== */
.party-hero { padding: 26px 0 20px; }
.party-h1 {
  font-family: var(--font-display); font-weight: 900; font-size: clamp(2.2rem, 10vw, 3rem);
  line-height: 1.02; letter-spacing: -0.02em;
  background: linear-gradient(100deg, var(--lime), var(--cyan) 55%, var(--magenta));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  margin-bottom: 12px;
}
.or { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 0.75rem; margin: 18px 0; text-transform: uppercase; letter-spacing: 0.2em; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--card-edge); }

/* flex-wrap so the actions row drops below the avatar+title on narrow screens
   instead of squeezing it -- without this, .party-head-actions (3 buttons) took
   its full intrinsic width and forced .party-head-id down to ~50px, and the
   title text overflowed outside that box instead of wrapping inside it. */
.party-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; padding: 22px 0 4px; gap: 10px; }
.party-head-id { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1 1 auto; }
.party-head-actions { flex-shrink: 0; }
.party-avatar-btn {
  flex-shrink: 0; border: 0; background: none; padding: 0; cursor: default; position: relative; border-radius: 50%;
}
/* Only the host can actually change it -- .can-edit is toggled on by JS, everyone
   else just sees the photo (or the fallback) as a plain, non-interactive image. */
.party-avatar-btn.can-edit { cursor: pointer; }
.party-avatar-btn.can-edit::after {
  content: '📷'; position: absolute; bottom: -2px; right: -2px; font-size: 0.7rem;
  background: var(--bg-2); border: 1px solid var(--card-edge); border-radius: 50%; padding: 2px 3px; line-height: 1;
}
.party-head-actions { display: flex; gap: 8px; flex-shrink: 0; }
.party-title { font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; letter-spacing: -0.01em; }
.code-badge {
  margin-top: 8px; background: rgba(216, 255, 62, 0.08); border: 1px dashed rgba(216, 255, 62, 0.5);
  color: var(--lime); font: 600 0.85rem var(--font-display); letter-spacing: 0.3em;
  padding: 7px 14px; border-radius: 10px; cursor: pointer;
}
.safety-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0; }
.btn-safe { background: var(--safe); color: #062b18; box-shadow: 0 6px 26px rgba(77, 255, 161, 0.3); font-size: 0.8rem; }
.btn-safe.done { background: var(--bg-2); color: var(--safe); border: 1px solid var(--safe); box-shadow: none; }
.btn-loc { background: var(--bg-2); color: var(--ink); border: 1px solid var(--card-edge); font-size: 0.8rem; }
.btn-loc[data-on="1"] { border-color: var(--cyan); color: var(--cyan); box-shadow: 0 0 18px rgba(62, 230, 255, 0.2); }

.map { height: 250px; border-radius: var(--r); border: 1px solid var(--card-edge); overflow: hidden; margin-bottom: 6px; background: var(--bg-2); z-index: 1; }
.map .leaflet-container { background: #0b0812; }

.member-list li {
  display: flex; align-items: center; gap: 12px; background: var(--card);
  border: 1px solid var(--card-edge); border-radius: 16px; padding: 13px 14px;
}
.member-list li.alert { border-color: rgba(255, 77, 94, 0.6); }
.avatar {
  width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: 1rem;
  background: linear-gradient(135deg, var(--magenta), var(--cyan)); color: #fff;
}
.m-main { flex: 1; min-width: 0; }
.m-name { font-weight: 700; font-size: 0.95rem; display: flex; align-items: center; gap: 6px; }
.m-tag { font-size: 0.58rem; font-family: var(--font-display); letter-spacing: 0.1em; color: var(--muted); border: 1px solid var(--card-edge); padding: 2px 6px; border-radius: 6px; }
.m-sub { font-size: 0.74rem; color: var(--muted); margin-top: 2px; }
.m-right { text-align: right; flex-shrink: 0; }
.m-bac { font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; }
.m-status { font-size: 0.6rem; font-family: var(--font-display); letter-spacing: 0.12em; text-transform: uppercase; }
.c-sober { color: var(--lime); } .c-buzzed { color: var(--cyan); } .c-elevated { color: var(--amber); }
.c-over, .c-danger { color: var(--red); }
.m-safe-badge { font-size: 0.66rem; color: var(--safe); font-weight: 700; }

/* Trusted-partner watching list: same visual language as the party crew list,
   just standalone at the top of Tonight since it isn't tied to any party. */
.watching-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.watching-card {
  display: flex; align-items: center; gap: 12px; background: var(--card);
  border: 1px solid var(--card-edge); border-radius: 16px; padding: 13px 14px;
}
.watching-card.alert { border-color: rgba(255, 77, 94, 0.6); }

/* Trusted partner: Profile settings */
.partner-current {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
}
.partner-current .avatar { width: 34px; height: 34px; font-size: 0.85rem; }
.partner-current-name { flex: 1; font-weight: 700; font-size: 0.9rem; }

/* the feed is a bounded chat viewport: oldest at top, pinned to newest */
.feed {
  max-height: 360px; overflow-y: auto; overscroll-behavior: contain;
  padding-right: 4px; margin-bottom: 12px;
}

/* @mention typeahead chips */
.mention-bar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; animation: rise 0.15s ease both; }
.mention-bar button {
  background: var(--card); border: 1px solid rgba(62, 230, 255, 0.4); color: var(--cyan);
  font: 700 0.78rem var(--font-body); padding: 7px 12px; border-radius: 999px; cursor: pointer;
}
.mention-bar button small { color: var(--muted); font-weight: 400; }
.mention-bar button:active { background: var(--cyan); color: #06232b; }

/* chat input (docked under the feed) */
.chat-row { display: flex; gap: 8px; margin-bottom: 12px; }
#chat-text::placeholder { font-size: 0.85rem; }
.chat-row input { flex: 1; }
.chat-send { padding: 0 18px; font-size: 1rem; }

/* chat bubbles inside the feed */
.f-chat { display: grid !important; grid-template-columns: 1fr auto; gap: 2px 10px; border-bottom: 1px solid rgba(43, 33, 64, 0.6); padding: 8px 2px; }
.chat-author { font: 700 0.68rem var(--font-display); letter-spacing: 0.06em; color: var(--cyan); grid-column: 1; }
.f-chat.mine .chat-author { color: var(--lime); }
.f-chat .ft { grid-column: 2; grid-row: 1; }
.chat-bubble {
  grid-column: 1 / -1; color: var(--ink); font-size: 0.88rem; line-height: 1.4;
  background: var(--card); border: 1px solid var(--card-edge); border-radius: 4px 14px 14px 14px;
  padding: 8px 12px; width: fit-content; max-width: 100%; word-break: break-word;
}
.f-chat.mine .chat-bubble { border-color: rgba(216, 255, 62, 0.35); border-radius: 14px 4px 14px 14px; justify-self: end; }
.f-chat.mine .chat-author { justify-self: end; }
.mention { color: var(--cyan); font-weight: 700; }
.mention-me { color: var(--magenta); text-shadow: 0 0 10px rgba(255, 62, 200, 0.4); }

.feed li { font-size: 0.82rem; color: var(--muted); padding: 8px 2px; border-bottom: 1px solid rgba(43, 33, 64, 0.6); display: flex; justify-content: space-between; gap: 10px; }
.feed li.f-alert { color: var(--red); }
.feed li.f-safe { color: var(--safe); }
.feed .ft { flex-shrink: 0; opacity: 0.6; font-size: 0.7rem; }

/* ============================== drinks ============================== */
.page-h1 { font-family: var(--font-display); font-weight: 900; font-size: 1.8rem; padding: 22px 0 6px; letter-spacing: -0.01em; }
.dir-chips { margin: 12px 0 4px; }
.dir-chips button { text-transform: none; }
#dir-more-wrap { margin: 4px 0 8px; }
.dir-cat { margin-top: 18px; }
.dir-cat h3 { font: 600 0.7rem var(--font-display); letter-spacing: 0.18em; text-transform: uppercase; color: var(--magenta); margin-bottom: 8px; }
.dir-row {
  width: 100%; display: flex; align-items: center; gap: 12px; background: var(--card);
  border: 1px solid var(--card-edge); border-radius: 14px; padding: 11px 14px; margin-bottom: 7px;
  cursor: pointer; color: var(--ink); text-align: left; font-family: var(--font-body); transition: border-color 0.15s;
}
.dir-row:hover { border-color: var(--magenta); }
.dir-row .de { font-size: 1.35rem; }
.dir-row .dn { flex: 1; font-weight: 700; font-size: 0.9rem; }
.abv-chip {
  font: 700 0.68rem var(--font-display); color: var(--amber);
  border: 1px solid rgba(255, 176, 62, 0.45); background: rgba(255, 176, 62, 0.08);
  padding: 4px 9px; border-radius: 999px; flex-shrink: 0;
}
.vol-chip { font-size: 0.7rem; color: var(--muted); flex-shrink: 0; }

/* ============================== profile ============================== */
.profile-stats { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; margin-bottom: 16px; }
.pstat-n { font-family: var(--font-display); font-weight: 800; font-size: 1.4rem; display: block; color: var(--lime); }
.pstat-l { font-size: 0.62rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
#btn-signout { margin-top: 16px; }

/* ============================== sheets (mixer / scanner) ============================== */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 80; background: rgba(5, 3, 10, 0.72);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet {
  width: 100%; max-width: 520px; max-height: 88dvh; overflow-y: auto;
  background: var(--bg-2); border: 1px solid var(--card-edge); border-bottom: 0;
  border-radius: 24px 24px 0 0; padding: 12px 20px calc(24px + env(safe-area-inset-bottom));
  animation: sheetup 0.3s cubic-bezier(0.2, 0.9, 0.2, 1) both;
}
@keyframes sheetup { from { transform: translateY(60px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-handle { width: 42px; height: 4px; border-radius: 2px; background: var(--card-edge); margin: 4px auto 14px; }
.sheet-title { margin: 0 0 14px; color: var(--ink); font-size: 0.95rem; }
.sheet-close { margin-top: 10px; }

/* product search */
.search-row { display: flex; gap: 8px; margin-top: 16px; }
.search-row input { flex: 1; }

/* map attribution: tucked behind a tiny ⓘ toggle (OSM license requires it exist) */
.map .leaflet-control-attribution {
  background: rgba(13, 10, 20, 0.85); color: var(--muted); font-size: 9px;
  border-radius: 8px 0 0 0; padding: 2px 32px 2px 6px; display: none;
}
.map.attrib-open .leaflet-control-attribution { display: block; }
.map .leaflet-control-attribution a { color: var(--muted); }
.attrib-toggle {
  position: absolute; right: 6px; bottom: 6px; z-index: 500;
  width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--card-edge);
  background: rgba(13, 10, 20, 0.8); color: var(--muted); font: 700 11px var(--font-body); cursor: pointer;
}
.recenter-toggle {
  position: absolute; right: 6px; top: 46px; z-index: 500;
  width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--card-edge);
  background: rgba(13, 10, 20, 0.85); color: var(--cyan); font-size: 18px; line-height: 1; cursor: pointer;
}

/* ============================== recovery countdown ============================== */
.recovery {
  margin-top: 12px; text-align: center; display: flex; flex-direction: column; gap: 2px;
  animation: rise 0.4s ease both;
}
.rc-label { font: 600 0.58rem var(--font-display); letter-spacing: 0.22em; color: var(--muted); }
.rc-time { font: 800 1.3rem var(--font-display); color: var(--amber); }
.rc-fine { font-size: 0.66rem; color: var(--muted); opacity: 0.85; max-width: 300px; margin: 0 auto; text-wrap: balance; }

/* ============================== size sheet ============================== */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button {
  background: var(--card); border: 1px solid var(--card-edge); color: var(--muted);
  font: 700 0.8rem var(--font-body); padding: 9px 14px; border-radius: 999px; cursor: pointer; transition: 0.15s;
}
.chips button.on { background: var(--lime); border-color: var(--lime); color: #131506; box-shadow: 0 0 16px rgba(216, 255, 62, 0.25); }
.sheet-label { display: block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 16px 0 8px; }
.stepper { display: inline-flex; align-items: center; gap: 4px; background: var(--card); border: 1px solid var(--card-edge); border-radius: 12px; padding: 4px; }
.stepper button {
  width: 44px; height: 40px; border: 0; border-radius: 9px; background: var(--bg-2); color: var(--ink);
  font: 700 1.2rem var(--font-body); cursor: pointer;
}
.stepper button:active { background: var(--lime); color: #131506; }
.stepper span { min-width: 74px; text-align: center; font: 800 1rem var(--font-display); }
.sz-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 16px 0; }
.sz-readout { text-align: right; display: flex; flex-direction: column; gap: 2px; }
.sz-alt { color: var(--muted); font-size: 0.8rem; }
.sz-std { font: 700 0.8rem var(--font-body); color: var(--cyan); }
#sz-log { margin-bottom: 4px; }

/* directory row icons: favorite star + remove-own-drink */
.dir-row { cursor: pointer; }
.dir-row .dn small { display: block; color: var(--muted); font-weight: 400; font-size: 0.7rem; }
.row-ic {
  background: none; border: 0; cursor: pointer; font-size: 1rem; padding: 6px 4px;
  color: var(--muted); flex-shrink: 0; line-height: 1;
}
.fav-ic.on { filter: drop-shadow(0 0 6px rgba(216, 255, 62, 0.5)); }
.del-ic:hover { color: var(--red); }

/* ============================== avatars ============================== */
.avatar-card { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; position: relative; }
.avatar.big { width: 64px; height: 64px; font-size: 1.5rem; }
.avatar-img { object-fit: cover; padding: 0; border: 0; }
img.avatar { display: grid; }
.avatar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.seg-2 { grid-template-columns: repeat(2, 1fr); }

/* ============================== install banner ============================== */
.install-banner {
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(120deg, rgba(216, 255, 62, 0.1), rgba(255, 62, 200, 0.08));
  border: 1px solid rgba(216, 255, 62, 0.35);
  border-radius: var(--r); padding: 12px 14px; margin: 4px 0 10px;
  animation: rise 0.4s ease both;
}
.ib-text { flex: 1; font-size: 0.78rem; color: var(--muted); line-height: 1.35; }
.ib-text b { color: var(--ink); font-size: 0.85rem; }
.ib-btn { padding: 10px 18px; font-size: 0.75rem; }
.ib-x { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 0.9rem; padding: 6px; }
.ib-x:hover { color: var(--ink); }

.ios-steps { list-style: none; display: flex; flex-direction: column; gap: 14px; margin: 6px 0 14px; }
.ios-steps li { display: flex; align-items: center; gap: 12px; font-size: 0.9rem; color: var(--ink); }
.step-n {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--lime); color: #131506; font: 800 0.85rem var(--font-display);
}
.share-glyph { color: var(--cyan); vertical-align: -3px; margin: 0 2px; }
.share-ic { vertical-align: -4px; margin-right: 6px; }

/* ============================== toast ============================== */
.toast {
  position: fixed; bottom: calc(104px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--bg); font-weight: 700; font-size: 0.85rem;
  padding: 12px 20px; border-radius: 999px; z-index: 100; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  animation: rise 0.25s ease both; max-width: 88vw; text-align: center;
}
