/* Bar Book — design tokens + shared component classes.
   Values are the approved Claude Design canvas (HANDOFF section 4,
   handoff/design-inventory.md sections A and C). 13px stays 13px.

   EVERY PAGE MUST INCLUDE, in <head>, before this file:
     <link rel="preconnect" href="https://fonts.googleapis.com">
     <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
     <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap">
     <link rel="stylesheet" href="/theme.css?v=N">
   and load Alpine as:  <script defer src="/vendor/alpine.js?v=N"></script>
   (server-rendered pages get both from lib/html.js page() — never hand-roll them there)
   plus <script src="/js/bb.js?v=N"></script> (and /js/fingerprint.js where needed).
   Each N is the stamp the pages carry today (lib/html.js ASSET_V for theme.css
   and bb.js); a bump changes it on every page at once.
   bb.js must load BEFORE Alpine so BB.* is defined when components init. */

:root{
  --bb-font:"Poppins",system-ui,-apple-system,"Segoe UI",sans-serif;
  --bb-bg:#040D1D;
  --bb-bg-gradient:radial-gradient(115% 55% at 14% 6%,#0C2648 0%,rgba(12,38,72,0) 62%),radial-gradient(100% 50% at 88% 80%,#0A2140 0%,rgba(10,33,64,0) 60%),linear-gradient(168deg,#07172E 0%,#040D1D 54%,#061529 100%);
  --bb-surface:#10283F; --bb-surface-2:#16314E; --bb-surface-skeleton:#122C48;
  --bb-border:#1D3A5C; --bb-border-soft:#183353; --bb-border-strong:#28496E; --bb-border-skeleton:#173254;
  --bb-text:#FFFFFF; --bb-text-soft:#D9DBE3; --bb-text-muted:#9BB0CB; --bb-text-faint:#6C86A6; --bb-text-ghost:#4E6685;
  --bb-accent:#EC9224; --bb-accent-strong:#D07E17; --bb-accent-soft:#16314E; --bb-accent-tint:#3A3222; --bb-on-accent:#0E2440; --bb-on-accent-icon:#040D1D;
  --bb-gold:#D9A441; --bb-gold-tint:#3A3020;
  --bb-success:#38C793; --bb-success-2:#4CC38A; --bb-success-tint:#1F3E33;
  --bb-danger:#E5484D; --bb-danger-text:#FF8B8F; --bb-danger-strong:#FF5A5F; --bb-danger-tint:#3A2A2E;
  --bb-bubble-in:#1B3A5B; --bb-bubble-out:#16314E; --bb-unread-row:#102A45; --bb-type-pill:#1B3A5B;
  --bb-overlay:rgba(2,10,22,0.72); --bb-overlay-sheet:rgba(2,8,17,0.6); --bb-tabbar-bg:rgba(4,15,31,0.9);
  --bb-img-stripe:repeating-linear-gradient(45deg,#1B3A5B 0 10px,#153050 10px 20px);
  --bb-radius-card:16px; --bb-radius-row:14px; --bb-radius-input:12px; --bb-radius-image:12px; --bb-radius-tile:8px; --bb-radius-pill:999px;
  --bb-shadow-sheet:0 -8px 24px rgba(0,0,0,0.35); --bb-shadow-float:0 8px 24px rgba(0,0,0,0.4); --bb-shadow-action:0 12px 32px rgba(0,0,0,0.5);
  --bb-header-h:56px; --bb-tabbar-h:64px; --bb-fab:56px; --bb-content-max:640px;
  --bb-motion-fast:120ms; --bb-motion-base:200ms; --bb-motion-slow:320ms; --bb-ease:cubic-bezier(0.2,0,0,1);
  --bb-focus:0 0 0 2px #040D1D,0 0 0 4px #EC9224;
}

@media (prefers-reduced-motion: reduce){
  :root{ --bb-motion-fast:0ms; --bb-motion-base:0ms; --bb-motion-slow:0ms; }
  *,*::before,*::after{ animation-duration:.001ms !important; animation-iteration-count:1 !important; transition-duration:.001ms !important; scroll-behavior:auto !important; }
}

/* ---------- base ---------- */
*,*::before,*::after{ box-sizing:border-box; }
html{ -webkit-text-size-adjust:100%; }
body{
  margin:0; font-family:var(--bb-font); font-weight:400; color:var(--bb-text);
  /* --bb-bg-gradient is a 3-layer comma list: it cannot ride in the `background`
     shorthand next to a color (the whole declaration is dropped). Longhands only. */
  background-color:var(--bb-bg);
  background-image:var(--bb-bg-gradient);
  background-attachment:fixed;
  background-repeat:no-repeat;
  -webkit-font-smoothing:antialiased; text-wrap:pretty;
}
/* :where() keeps base link styles at zero specificity so component classes (.bb-btn, cards, rows) always win on hover */
:where(a){ color:var(--bb-accent); text-decoration:none; }
:where(a:hover){ color:var(--bb-accent-strong); }
button,input,select,textarea{ font-family:inherit; }
:focus-visible{ outline:none; box-shadow:var(--bb-focus); border-radius:4px; }
[x-cloak]{ display:none !important; }
.bb-tnum{ font-variant-numeric:tabular-nums; }
.bb-sr{ position:absolute!important; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0; }
[hidden]{ display:none !important; }

/* ---------- app shell ---------- */
.bb-app{
  max-width:var(--bb-content-max); margin:0 auto; min-height:100vh;
  display:flex; flex-direction:column; position:relative;
}
.bb-app > .bb-main{ flex:1; padding-bottom:calc(var(--bb-tabbar-h) + env(safe-area-inset-bottom) + 12px); }
.bb-gutter{ padding-left:16px; padding-right:16px; }

/* ---------- top bar ---------- */
.bb-topbar{
  height:var(--bb-header-h); display:flex; align-items:center; justify-content:space-between;
  gap:12px; padding:0 16px; border-bottom:1px solid var(--bb-border); flex-shrink:0;
  position:sticky; top:0; z-index:30; background:rgba(4,13,29,0.86); backdrop-filter:blur(8px);
}
.bb-topbar.is-flat{ border-bottom:0; background:transparent; backdrop-filter:none; }
.bb-topbar__left,.bb-topbar__right{ display:flex; align-items:center; gap:16px; flex-shrink:0; }
/* 22px glyph in a 44px target. The -11px side margins cancel the extra width,
   so the glyph sits exactly where it did: the 16px gutter and the 16px gap
   between two icons are both unchanged, only the tappable box grew. */
.bb-topbar__icon{ background:none; border:0; padding:0; cursor:pointer; color:var(--bb-text);
  display:inline-flex; align-items:center; justify-content:center; position:relative;
  width:44px; height:44px; margin:0 -11px; flex-shrink:0; }
.bb-topbar__icon.is-close{ color:var(--bb-text-faint); }
.bb-topbar__title{ font-size:20px; font-weight:600; color:var(--bb-text); }
.bb-topbar__title.is-composer{ font-size:16px; }
.bb-topbar__title.is-flow{ font-size:15px; }
.bb-topbar__wordmark{ font-size:15px; font-weight:700; color:var(--bb-text); }
/* The official logo (public/assets/brand/logo.svg, 112x32) in a top bar. */
.bb-topbar__logo{ height:28px; width:auto; display:block; }
.bb-topbar__action{ background:none; border:0; padding:0; cursor:pointer; font-size:13px; font-weight:500; color:var(--bb-accent);
  display:inline-flex; align-items:center; min-height:44px; }

/* Section "See all" links: 12/500 as drawn, but 44px tall to tap.
   The vertical padding is absorbed by the header row, which is taller than
   the link, so the section title's baseline does not move. */
.bb-seeall{ font-size:12px; font-weight:500; color:var(--bb-accent); text-decoration:none;
  display:inline-flex; align-items:center; min-height:44px; padding:0 2px; margin:-12px -2px; }
.bb-topbar__spacer{ width:22px; }
/* Offsets are measured from the 44px box, so 11px of it is the new padding —
   the dot and the count pill still ride the glyph's top-right corner. */
.bb-dot{ position:absolute; top:11px; right:11px; width:8px; height:8px; border-radius:var(--bb-radius-pill); background:var(--bb-accent); }
.bb-count{ position:absolute; top:7px; right:5px; min-width:15px; height:15px; padding:0 3px; border-radius:var(--bb-radius-pill);
  background:var(--bb-accent); color:var(--bb-on-accent); font-size:9px; font-weight:600;
  display:flex; align-items:center; justify-content:center; font-variant-numeric:tabular-nums; }

/* ---------- tab bar + FAB ---------- */
.bb-tabbar{
  position:fixed; bottom:0; left:0; right:0; z-index:40;
  max-width:var(--bb-content-max); margin:0 auto;
  height:calc(var(--bb-tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom:env(safe-area-inset-bottom);
  border-top:1px solid var(--bb-border); background:var(--bb-tabbar-bg); backdrop-filter:blur(10px);
  display:flex; align-items:center; justify-content:space-around;
}
.bb-tabbar__item{ width:56px; display:flex; flex-direction:column; align-items:center; gap:2px; color:var(--bb-text-muted); }
.bb-tabbar__item.is-active{ color:var(--bb-accent); }
.bb-tabbar__label{ font-size:11px; font-weight:500; }
.bb-fab{
  width:var(--bb-fab); height:var(--bb-fab); border-radius:var(--bb-radius-pill); border:0; cursor:pointer;
  background:var(--bb-accent); color:var(--bb-on-accent-icon);
  display:flex; align-items:center; justify-content:center; margin-top:-28px; box-shadow:var(--bb-shadow-sheet);
}

/* ---------- buttons ---------- */
.bb-btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px; width:100%;
  height:48px; padding:0 20px; border-radius:var(--bb-radius-pill); border:1px solid transparent;
  font-size:16px; font-weight:600; cursor:pointer; background:none; color:var(--bb-text);
  transition:background var(--bb-motion-fast) var(--bb-ease),border-color var(--bb-motion-fast) var(--bb-ease),opacity var(--bb-motion-fast) var(--bb-ease);
}
.bb-btn:disabled{ opacity:.4; cursor:default; }
.bb-btn--primary{ background:var(--bb-accent); color:var(--bb-on-accent); font-size:15px; }
.bb-btn--primary:hover:not(:disabled){ background:var(--bb-accent-strong); color:var(--bb-on-accent); }
.bb-btn--secondary{ border-color:var(--bb-border); color:var(--bb-text); font-size:15px; font-weight:500; }
.bb-btn--secondary:hover:not(:disabled){ border-color:var(--bb-text-muted); color:var(--bb-text); }
.bb-btn--secondary-accent{ border-color:var(--bb-accent); color:var(--bb-accent); font-size:16px; font-weight:600; }
.bb-btn--secondary-accent:hover:not(:disabled){ border-color:var(--bb-accent-strong); color:var(--bb-accent-strong); }
.bb-btn--ghost{ border-color:transparent; color:var(--bb-accent); font-size:15px; font-weight:500; }
.bb-btn--ghost:hover:not(:disabled){ color:var(--bb-accent-strong); }
.bb-btn--danger-text{ border-color:transparent; color:var(--bb-danger-text); font-size:15px; font-weight:500; }
.bb-btn--danger-text:hover:not(:disabled){ color:var(--bb-danger-text); }
.bb-btn--44{ height:44px; font-size:15px; font-weight:600; }
.bb-btn--40{ height:40px; font-size:14px; font-weight:600; }
.bb-btn--mini{ width:auto; height:auto; padding:7px 15px; font-size:14px; font-weight:600; }
.bb-btn--auto{ width:auto; }

/* ---------- chips ---------- */
.bb-chip{
  display:inline-flex; align-items:center; gap:6px; padding:7px 14px; border-radius:var(--bb-radius-pill);
  border:1px solid var(--bb-border); background:transparent; color:var(--bb-text-muted);
  font-size:13px; font-weight:500; cursor:pointer;
  transition:border-color var(--bb-motion-fast) var(--bb-ease),color var(--bb-motion-fast) var(--bb-ease),background var(--bb-motion-fast) var(--bb-ease);
}
.bb-chip.is-on{ background:var(--bb-surface-2); border-color:var(--bb-accent); color:var(--bb-accent); }
.bb-chip.is-warm{ background:var(--bb-accent-tint); border-color:var(--bb-accent); color:var(--bb-accent); }
.bb-chip--sm{ padding:5px 12px; font-size:12px; }

/* ---------- segmented control ---------- */
.bb-seg{ display:flex; padding:3px; gap:3px; background:var(--bb-surface); border:1px solid var(--bb-border); border-radius:var(--bb-radius-pill); }
.bb-seg__btn{ flex:1; padding:9px 0; border:0; border-radius:var(--bb-radius-pill); background:transparent; cursor:pointer;
  color:var(--bb-text-muted); font-size:14px; font-weight:500; }
.bb-seg__btn.is-on{ background:var(--bb-accent); color:var(--bb-on-accent); font-weight:600; }

/* ---------- underline tabs ---------- */
.bb-tabs{ display:flex; gap:24px; border-bottom:1px solid var(--bb-border); }
.bb-tabs__btn{ background:none; border:0; padding:0 0 10px; cursor:pointer; font-size:14px; font-weight:500;
  color:var(--bb-text-muted); border-bottom:2px solid transparent; margin-bottom:-1px; }
.bb-tabs__btn.is-on{ color:var(--bb-accent); font-weight:600; border-bottom-color:var(--bb-accent); }
.bb-tabs--light .bb-tabs__btn.is-on{ color:var(--bb-text); }

/* ---------- cards and rows ---------- */
.bb-card{ background:var(--bb-surface); border:1px solid var(--bb-border); border-radius:var(--bb-radius-card); padding:16px; }
.bb-card--plain{ background:transparent; }
.bb-card--accent{ border-color:var(--bb-accent); }
.bb-card--tint{ background:var(--bb-accent-tint); border-color:var(--bb-accent); }
.bb-row{ display:flex; align-items:center; gap:12px; padding:12px 16px; border-radius:var(--bb-radius-row); }
.bb-row--card{ background:var(--bb-surface); border:1px solid var(--bb-border); padding:12px; border-radius:var(--bb-radius-card); }
.bb-row--divided{ border-radius:0; border-bottom:1px solid var(--bb-border-soft); }
.bb-row__body{ flex:1; min-width:0; display:flex; flex-direction:column; gap:1px; }
.bb-row__title{ font-size:14px; font-weight:600; color:var(--bb-text); }
.bb-row__meta{ font-size:11px; color:var(--bb-text-muted); }
.bb-eyebrow{ font-size:11px; font-weight:600; letter-spacing:.08em; text-transform:uppercase; color:var(--bb-accent); }
.bb-eyebrow--muted{ color:var(--bb-text-muted); letter-spacing:.06em; }
.bb-section-title{ font-size:18px; font-weight:600; color:var(--bb-text); }

/* ---------- inputs ---------- */
.bb-field{ display:flex; flex-direction:column; gap:6px; }
.bb-label{ font-size:12px; font-weight:500; color:var(--bb-text-muted); }
.bb-input, .bb-select{
  height:48px; width:100%; padding:0 14px; font-size:14px; color:var(--bb-text);
  background:var(--bb-surface); border:1px solid var(--bb-border); border-radius:var(--bb-radius-input);
}
.bb-select{ font-size:15px; appearance:none;
  background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239BB0CB' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 12px center; padding-right:34px; }
.bb-select--dob{ height:52px; }
.bb-input::placeholder,.bb-textarea::placeholder{ color:var(--bb-text-muted); }
.bb-input:focus,.bb-select:focus,.bb-textarea:focus{ outline:none; border-color:var(--bb-accent); box-shadow:none; }
.bb-input.is-ok,.bb-select.is-ok{ border-color:var(--bb-success-2); }
.bb-input.is-bad{ border-color:var(--bb-danger); }
.bb-help{ font-size:11px; color:var(--bb-text-muted); }
.bb-help.is-ok{ color:var(--bb-success-2); }
.bb-help.is-bad{ color:var(--bb-danger-text); }
.bb-textarea{ width:100%; min-height:84px; padding:14px; font-size:14px; line-height:20px; color:var(--bb-text);
  background:var(--bb-surface); border:1px solid var(--bb-border); border-radius:var(--bb-radius-input); resize:vertical; }

/* toggle 44x26, knob 20 */
.bb-toggle{ width:44px; height:26px; flex-shrink:0; border-radius:var(--bb-radius-pill); border:0; cursor:pointer;
  background:var(--bb-border); position:relative; transition:background var(--bb-motion-base) var(--bb-ease); }
.bb-toggle.is-on{ background:var(--bb-accent); }
.bb-toggle::after{ content:""; position:absolute; top:3px; left:3px; width:20px; height:20px; border-radius:var(--bb-radius-pill);
  background:var(--bb-on-accent); transition:transform var(--bb-motion-base) var(--bb-ease); }
.bb-toggle.is-on::after{ transform:translateX(18px); }

.bb-check{ width:22px; height:22px; flex-shrink:0; border-radius:6px; border:1.5px solid var(--bb-text-faint);
  background:transparent; cursor:pointer; display:inline-flex; align-items:center; justify-content:center; color:transparent; }
.bb-check.is-on{ border-color:var(--bb-accent); color:var(--bb-accent); }
.bb-check:disabled{ border-color:var(--bb-border); background:var(--bb-border-soft); cursor:default; }
.bb-radio{ width:20px; height:20px; flex-shrink:0; border-radius:var(--bb-radius-pill); border:1.5px solid var(--bb-text-faint);
  background:transparent; cursor:pointer; display:inline-flex; align-items:center; justify-content:center; }
.bb-radio.is-on{ border-color:var(--bb-accent); }
.bb-radio.is-on::after{ content:""; width:10px; height:10px; border-radius:var(--bb-radius-pill); background:var(--bb-accent); }

/* ---------- bottom sheet ---------- */
.bb-sheet{ position:fixed; inset:0; z-index:60; display:flex; flex-direction:column; justify-content:flex-end; }
.bb-sheet__scrim{ position:absolute; inset:0; background:var(--bb-overlay); }
.bb-sheet__panel{
  position:relative; max-width:var(--bb-content-max); width:100%; margin:0 auto;
  background:var(--bb-surface); border-top:1px solid var(--bb-border); border-radius:16px 16px 0 0;
  box-shadow:var(--bb-shadow-sheet); padding:8px 0 20px; padding-bottom:calc(20px + env(safe-area-inset-bottom));
  max-height:88vh; overflow-y:auto;
}
.bb-sheet__panel--interstitial{ background:var(--bb-on-accent); border-radius:24px 24px 20px 20px; padding:24px 20px 24px;
  padding-bottom:calc(24px + env(safe-area-inset-bottom)); display:flex; flex-direction:column; gap:18px; }
.bb-sheet__handle{ width:36px; height:4px; border-radius:var(--bb-radius-pill); background:var(--bb-text-ghost); margin:6px auto 18px; }
.bb-sheet__head{ padding:0 20px; display:flex; flex-direction:column; gap:4px; }
.bb-sheet__title{ font-size:20px; font-weight:600; color:var(--bb-text); }
.bb-sheet__sub{ font-size:13px; color:var(--bb-text-muted); }
.bb-sheet__row{ display:flex; align-items:center; gap:12px; width:100%; padding:14px 20px; border:0; border-top:1px solid var(--bb-border);
  background:transparent; color:var(--bb-text); font-size:15px; text-align:left; cursor:pointer; }
.bb-sheet__cta{ padding:16px 20px 0; display:flex; flex-direction:column; gap:10px; }
/* Alpine x-transition classes: x-transition:enter="bb-t-in" ... */
.bb-t-in{ transition:opacity var(--bb-motion-base) var(--bb-ease),transform var(--bb-motion-base) var(--bb-ease); }
.bb-t-out{ transition:opacity var(--bb-motion-fast) var(--bb-ease),transform var(--bb-motion-fast) var(--bb-ease); }
.bb-t-from{ opacity:0; transform:translateY(16px); }
.bb-t-to{ opacity:1; transform:translateY(0); }
.bb-fade-from{ opacity:0; }
.bb-fade-to{ opacity:1; }

/* ---------- action sheet ---------- */
.bb-action-sheet{ position:fixed; inset:0; z-index:60; display:flex; flex-direction:column; justify-content:flex-end;
  padding:0 8px calc(10px + env(safe-area-inset-bottom)); }
.bb-action-sheet__scrim{ position:absolute; inset:0; background:var(--bb-overlay-sheet); }
.bb-action-sheet__card{ position:relative; max-width:var(--bb-content-max); width:100%; margin:0 auto 8px;
  background:var(--bb-surface); border:1px solid var(--bb-border-strong); border-radius:var(--bb-radius-row);
  box-shadow:var(--bb-shadow-action); overflow:hidden; }
.bb-action-sheet__head{ padding:14px 16px; font-size:13px; color:var(--bb-text-muted); text-align:center; }
.bb-action-sheet__opt{ display:block; width:100%; padding:16px; border:0; border-top:1px solid var(--bb-border-strong);
  background:transparent; color:var(--bb-text); font-size:17px; font-weight:500; text-align:center; cursor:pointer; }
.bb-action-sheet__opt.is-danger{ color:var(--bb-danger-text); }
.bb-action-sheet__opt.is-cancel{ border-top:0; font-weight:600; color:var(--bb-accent); }

/* ---------- progress ---------- */
.bb-progress{ height:4px; background:var(--bb-border); overflow:hidden; }
.bb-progress__fill{ height:100%; background:var(--bb-accent); transition:width var(--bb-motion-slow) var(--bb-ease); }
.bb-progress--pill{ height:6px; border-radius:var(--bb-radius-pill); }
.bb-progress--pill .bb-progress__fill{ border-radius:var(--bb-radius-pill); }

/* ---------- skeleton (slow shimmer) ---------- */
.bb-skeleton{ background:var(--bb-surface); border-radius:8px; position:relative; overflow:hidden; }
.bb-skeleton--card{ background:var(--bb-surface-skeleton); border:1px solid var(--bb-border-skeleton); border-radius:var(--bb-radius-row); }
.bb-skeleton::after{ content:""; position:absolute; inset:0; transform:translateX(-100%);
  background:linear-gradient(90deg,rgba(255,255,255,0) 0%,rgba(255,255,255,0.05) 50%,rgba(255,255,255,0) 100%);
  animation:bb-shimmer 1.8s var(--bb-ease) infinite; }
@keyframes bb-shimmer{ to{ transform:translateX(100%); } }
@media (prefers-reduced-motion: reduce){ .bb-skeleton::after{ animation:none; } }

/* ---------- empty state ---------- */
.bb-empty{ display:flex; flex-direction:column; align-items:center; text-align:center; gap:16px; padding:32px; }
.bb-empty__icon{ width:56px; height:56px; border-radius:var(--bb-radius-pill); background:var(--bb-surface);
  border:1px solid var(--bb-border); display:flex; align-items:center; justify-content:center; color:var(--bb-text-muted); }
.bb-empty__title{ font-size:24px; line-height:30px; font-weight:600; color:var(--bb-text); }
.bb-empty__body{ font-size:15px; line-height:22px; color:var(--bb-text-muted); }

/* ---------- toast ---------- */
.bb-toast-host{ position:fixed; left:0; right:0; bottom:calc(var(--bb-tabbar-h) + env(safe-area-inset-bottom) + 12px);
  z-index:80; display:flex; flex-direction:column; align-items:center; gap:8px; pointer-events:none; padding:0 16px; }
.bb-toast{ display:flex; align-items:center; gap:10px; max-width:var(--bb-content-max);
  padding:12px 16px; border-radius:var(--bb-radius-row); background:var(--bb-surface-2); border:1px solid var(--bb-border);
  color:var(--bb-text); font-size:14px; box-shadow:var(--bb-shadow-float);
  animation:bb-toast-in var(--bb-motion-base) var(--bb-ease); }
.bb-toast.is-success{ border-color:var(--bb-success); }
.bb-toast.is-error{ border-color:var(--bb-danger); color:var(--bb-danger-text); }
@keyframes bb-toast-in{ from{ opacity:0; transform:translateY(8px); } to{ opacity:1; transform:none; } }

/* ---------- avatars ---------- */
.bb-avatar{ border-radius:var(--bb-radius-pill); background:var(--bb-surface-2); color:var(--bb-accent);
  display:inline-flex; align-items:center; justify-content:center; font-weight:600; flex-shrink:0;
  object-fit:cover; overflow:hidden; }
.bb-avatar--32{ width:32px; height:32px; font-size:13px; }
.bb-avatar--40{ width:40px; height:40px; font-size:14px; }
.bb-avatar--48{ width:48px; height:48px; font-size:15px; }
.bb-avatar--64{ width:64px; height:64px; font-size:20px; }
.bb-avatar--72{ width:72px; height:72px; font-size:22px; }
.bb-avatar--88{ width:88px; height:88px; font-size:26px; border:3px solid var(--bb-on-accent); }
.bb-logo-tile{ border-radius:var(--bb-radius-tile); background:var(--bb-surface-2); color:var(--bb-accent);
  display:inline-flex; align-items:center; justify-content:center; font-size:15px; font-weight:600; flex-shrink:0;
  width:48px; height:48px; object-fit:cover; overflow:hidden; }

/* ---------- stars ---------- */
.bb-stars{ display:inline-flex; align-items:center; gap:2px; color:var(--bb-accent); }
.bb-stars__num{ margin-left:4px; font-size:12px; color:var(--bb-text); font-variant-numeric:tabular-nums; }
.bb-stars__count{ font-size:12px; color:var(--bb-text-muted); font-variant-numeric:tabular-nums; }

/* ---------- match pill ---------- */
/* Every "N% match" in the app. The band's color (lib/match-bands.js, and
   BB.matchPill in bb.js) arrives as --match-color on the element and colors
   the text and border over a 14% tint of itself. No dot. line-height and
   nowrap keep the pill the same 26px chip wherever it sits. Browsers without
   color-mix() drop the tint and keep the colored text and border. */
.bb-match{ display:inline-flex; align-items:center; font-size:12px; font-weight:600; line-height:16px; padding:4px 12px;
  border-radius:var(--bb-radius-pill); color:var(--match-color); border:1px solid var(--match-color);
  background:color-mix(in srgb, var(--match-color) 14%, transparent); white-space:nowrap; }

/* ---------- image placeholder ---------- */
.bb-img-ph{ background:var(--bb-img-stripe); border-radius:var(--bb-radius-image); position:relative; overflow:hidden;
  display:flex; align-items:center; justify-content:center; }
.bb-img-ph--sm{ background:repeating-linear-gradient(45deg,#1B3A5B 0 8px,#153050 8px 16px); }
.bb-img-ph__cap{ font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:10px; color:var(--bb-text-faint); }
/* A real product image inside the same frame the placeholder uses. Bottle shots
   are often transparent PNG/WebP, so they sit on a flat surface and are contained,
   never cropped. */
.bb-art--img{ background:var(--bb-surface-2); position:relative; overflow:hidden; border-radius:var(--bb-radius-image); }
.bb-art__img{ position:absolute; inset:0; width:100%; height:100%; object-fit:contain; display:block; }

/* =====================================================================
   Business Portal + Admin Console (TheBarBook-Portals canvas, 1a-1l).
   Navy rail, light workspace. Portal pages put class="bp-body" on <body>
   and also load JetBrains Mono:
   https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap
   ===================================================================== */
:root{
  --bp-bg:#F4F3EF; --bp-surface:#FFFFFF; --bp-head:#FAF9F6; --bp-sel:#F7F6F2; --bp-seg:#E9E7E1; --bp-preview:#E9E7E1;
  --bp-border:#E3E1DA; --bp-border-soft:#F0EEE8; --bp-input:#D6D9E1; --bp-dashed:#C9C6BD; --bp-radio:#B3B8C6;
  --bp-ink:#14202E; --bp-dim:#5A6474; --bp-ph:#8A93A6;
  --bp-navy:#0E2440; --bp-rail:#07172E; --bp-rail-card:#10283F; --bp-rail-border:#1D3A5C; --bp-rail-text:#9BB0CB;
  --bp-rail-faint:#6C86A6; --bp-rail-active:#13304F; --bp-sky:#72D0FF; --bp-sky-bg:#2A4657;
  --bp-accent:#EC9224; --bp-amber-text:#A35F0C; --bp-link:#0B6A99; --bp-chart-b:#3AA9DF;
  --bp-info:#0B5A82; --bp-info-bg:#EEF8FD; --bp-ok:#15803D; --bp-ok-bg:#F0FDF4; --bp-warn:#B45309; --bp-warn-bg:#FFFBEB;
  --bp-danger:#B91C1C; --bp-danger-bd:#F1C4C4; --bp-neutral:#404040; --bp-neutral-bg:#F0EFEC;
  --bp-disc:#8A4F08; --bp-disc-bg:#FDF1E1; --bp-warm:#FFF8EE; --bp-warm-row:#FFFBF5; --bp-avatar:#E7EEF6;
  --bp-stripe:repeating-linear-gradient(45deg,#EFEDE7 0 5px,#E6E3DC 5px 10px);
  --bp-stripe-lg:repeating-linear-gradient(45deg,#F2F0EB 0 10px,#EAE7E0 10px 20px);
  --bp-mono:"JetBrains Mono",ui-monospace,SFMono-Regular,Menlo,monospace;
  --bp-shadow-sheet:0 8px 30px rgba(20,32,46,0.14);
}
body.bp-body{ background:var(--bp-bg); background-image:none; color:var(--bp-ink); }
.bp-body :where(a){ color:var(--bp-link); }
.bp-body :focus-visible{ box-shadow:0 0 0 2px #FFFFFF,0 0 0 4px var(--bp-accent); }
.bp-shell{ display:flex; min-height:100vh; }
.bp-main{ flex:1; min-width:0; display:flex; flex-direction:column; }

/* rail */
.bp-rail{ width:248px; flex-shrink:0; background:var(--bp-rail); border-right:1px solid var(--bp-rail-border);
  display:flex; flex-direction:column; padding:20px 12px 16px; gap:18px; position:sticky; top:0; height:100vh; overflow-y:auto; }
.bp-rail__top{ display:flex; align-items:center; justify-content:space-between; padding:0 6px; }
.bp-rail__logo{ height:32px; width:auto; display:block; }
.bp-rail__tag{ font-size:10px; font-weight:600; letter-spacing:.1em; color:var(--bp-navy); background:var(--bp-sky); border-radius:999px; padding:3px 8px; }
.bp-biz{ position:relative; }
.bp-biz__btn{ width:100%; display:flex; align-items:center; gap:10px; background:var(--bp-rail-card); border:1px solid var(--bp-rail-border);
  border-radius:10px; padding:10px; cursor:pointer; text-align:left; color:inherit; }
.bp-biz__logo{ width:36px; height:36px; border-radius:8px; background:repeating-linear-gradient(45deg,#1B3A5B 0 6px,#153050 6px 12px); flex-shrink:0; object-fit:cover; }
.bp-biz__name{ font-size:13px; font-weight:600; color:#FFFFFF; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; display:block; }
.bp-biz__meta{ font-size:11px; color:var(--bp-rail-text); display:block; }
.bp-biz__menu{ position:absolute; left:0; right:0; top:calc(100% + 6px); z-index:20; background:var(--bp-rail-card);
  border:1px solid var(--bp-rail-border); border-radius:10px; padding:4px; box-shadow:0 8px 24px rgba(0,0,0,.4); }
.bp-biz__opt{ display:block; width:100%; text-align:left; padding:9px 10px; border:0; border-radius:7px; background:transparent;
  color:var(--bp-rail-text); font-size:13px; cursor:pointer; }
.bp-biz__opt:hover,.bp-biz__opt.is-on{ background:var(--bp-rail-active); color:#FFFFFF; }
/* The nav list scrolls on its own so the account links and profile card stay
   pinned at the bottom. It used to shrink below its content (flex:1 with
   min-height:0 and no overflow), so on a short window its items drew past
   its box and under the footer. min-height keeps a usable list on very
   short windows; below that the whole rail scrolls instead. The 2px padding
   keeps focus rings from being clipped by the scroll box. */
.bp-nav{ display:flex; flex-direction:column; gap:14px; flex:1 1 auto; min-height:120px; overflow-y:auto;
  overscroll-behavior:contain; position:relative; padding:2px; margin:-2px;
  scrollbar-width:thin; scrollbar-color:var(--bp-rail-border) transparent; }
.bp-nav::-webkit-scrollbar{ width:6px; }
.bp-nav::-webkit-scrollbar-thumb{ background:var(--bp-rail-border); border-radius:3px; }
.bp-nav::-webkit-scrollbar-track{ background:transparent; }
.bp-rail__top,.bp-biz,.bp-nav__bottom,.bp-me{ flex-shrink:0; }
.bp-nav__group{ display:flex; flex-direction:column; gap:2px; }
.bp-nav__label{ font-size:10px; font-weight:600; letter-spacing:.1em; color:var(--bp-rail-faint); padding:0 12px 4px; }
.bp-nav__item{ height:38px; display:flex; align-items:center; gap:12px; padding:0 12px; border-radius:8px; color:var(--bp-rail-text);
  font-size:13px; font-weight:500; text-decoration:none; border:0; background:transparent; width:100%; cursor:pointer; text-align:left; }
.bp-rail.is-admin .bp-nav__item{ height:32px; }
.bp-nav__item svg{ color:var(--bp-rail-faint); flex-shrink:0; }
.bp-nav__item:hover{ color:#FFFFFF; }
.bp-nav__item.is-on{ background:var(--bp-rail-active); color:#FFFFFF; }
.bp-nav__item.is-on svg{ color:var(--bp-accent); }
.bp-nav__item.is-off{ cursor:default; opacity:.55; }
.bp-nav__item.is-off:hover{ color:var(--bp-rail-text); }
.bp-nav__text{ flex:1; }
.bp-nav__count{ font-size:11px; font-weight:600; color:var(--bp-navy); background:var(--bp-accent); border-radius:999px; padding:1px 7px; font-variant-numeric:tabular-nums; }
.bp-nav__soon{ font-size:9px; font-weight:600; letter-spacing:.08em; color:var(--bp-rail-faint); border:1px solid var(--bp-rail-border); border-radius:999px; padding:1px 6px; }
.bp-nav__bottom{ display:flex; flex-direction:column; gap:2px; border-top:1px solid var(--bp-rail-border); padding-top:12px; }
.bp-nav__bottom .bp-nav__item{ height:34px; }
.bp-me{ display:flex; align-items:center; gap:10px; padding:0 6px; }
.bp-me__av{ width:32px; height:32px; border-radius:999px; background:var(--bp-sky-bg); color:var(--bp-sky); font-size:12px; font-weight:600;
  display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.bp-me__name{ font-size:13px; font-weight:500; color:#FFFFFF; display:block; }
.bp-me__role{ font-size:11px; color:var(--bp-rail-text); display:block; }
@media (max-width:1100px){
  .bp-rail{ width:72px; padding:20px 10px 16px; }
  .bp-rail__logo,.bp-rail__tag,.bp-biz__name,.bp-biz__meta,.bp-biz__chev,.bp-nav__label,.bp-nav__text,.bp-nav__soon,.bp-nav__count,.bp-me__txt{ display:none; }
  .bp-nav__item{ justify-content:center; padding:0; }
  .bp-biz__btn{ justify-content:center; padding:8px; }
}

/* page header */
.bp-head{ height:68px; flex-shrink:0; display:flex; align-items:center; justify-content:space-between; gap:16px; padding:0 32px;
  border-bottom:1px solid var(--bp-border); background:var(--bp-surface); position:sticky; top:0; z-index:10; }
.bp-head__crumb{ font-size:12px; color:var(--bp-dim); display:block; }
.bp-head__title{ font-size:20px; font-weight:600; color:var(--bp-ink); display:flex; align-items:center; gap:10px; }
.bp-head__actions{ display:flex; gap:10px; align-items:center; }
.bp-content{ flex:1; padding:28px 32px; display:flex; flex-direction:column; gap:20px; min-width:0; }
.bp-content--tight{ padding:22px 32px; gap:14px; }
.bp-split{ flex:1; display:flex; min-height:0; }
.bp-panel{ width:420px; flex-shrink:0; background:var(--bp-surface); border-left:1px solid var(--bp-border); padding:24px;
  display:flex; flex-direction:column; gap:18px; }

/* buttons */
.bp-btn{ height:38px; padding:0 16px; border-radius:8px; background:var(--bp-surface); border:1px solid var(--bp-input); color:var(--bp-ink);
  font-size:13px; font-weight:600; display:inline-flex; align-items:center; justify-content:center; gap:8px; cursor:pointer; text-decoration:none; white-space:nowrap; font-family:inherit; }
.bp-btn:hover:not(:disabled){ border-color:var(--bp-radio); color:var(--bp-ink); }
.bp-btn:disabled{ opacity:.45; cursor:default; }
.bp-btn--primary{ background:var(--bp-navy); border-color:var(--bp-navy); color:#FFFFFF; }
.bp-btn--primary:hover:not(:disabled){ background:#16345A; border-color:#16345A; color:#FFFFFF; }
.bp-btn--accent{ background:var(--bp-accent); border-color:var(--bp-accent); color:var(--bp-navy); }
.bp-btn--danger{ border-color:var(--bp-danger-bd); color:var(--bp-danger); }
.bp-btn--danger:hover:not(:disabled){ border-color:var(--bp-danger); color:var(--bp-danger); }
.bp-btn--sm{ height:32px; padding:0 12px; font-size:12px; border-radius:7px; }
.bp-btn--lg{ height:44px; font-size:14px; border-radius:10px; }
.bp-btn--block{ width:100%; }
.bp-link{ background:none; border:0; padding:0; font-size:13px; font-weight:600; color:var(--bp-link); cursor:pointer; display:inline-flex; align-items:center; gap:5px; font-family:inherit; text-decoration:none; }
.bp-link--danger{ color:var(--bp-danger); }

/* cards, tables */
.bp-card{ background:var(--bp-surface); border:1px solid var(--bp-border); border-radius:12px; }
.bp-card--pad{ padding:22px 24px; display:flex; flex-direction:column; gap:16px; }
.bp-card__title{ font-size:16px; font-weight:600; color:var(--bp-ink); }
.bp-card__sub{ font-size:12px; color:var(--bp-dim); }
.bp-kpi{ padding:18px 20px; display:flex; flex-direction:column; gap:6px; }
.bp-kpi__l{ font-size:13px; font-weight:500; color:var(--bp-dim); }
.bp-kpi__v{ font-size:30px; font-weight:600; line-height:38px; font-variant-numeric:tabular-nums; }
.bp-kpi__m{ font-size:12px; color:var(--bp-dim); }
.bp-table{ overflow:hidden; }
.bp-tr{ display:grid; gap:16px; padding:12px 20px; border-bottom:1px solid var(--bp-border-soft); align-items:center; }
.bp-tr:last-child{ border-bottom:0; }
.bp-tr--head{ padding:11px 20px; background:var(--bp-head); border-bottom:1px solid var(--bp-border); font-size:11px; font-weight:600; letter-spacing:.06em; color:var(--bp-dim); }
.bp-tr--click{ cursor:pointer; }
.bp-tr--click:hover,.bp-tr.is-sel{ background:var(--bp-sel); }
.bp-cell{ font-size:13px; color:var(--bp-ink); min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.bp-cell--dim{ color:var(--bp-dim); }
.bp-num{ font-variant-numeric:tabular-nums; }
.bp-mono{ font-family:var(--bp-mono); font-size:12px; }
.bp-thumb{ width:34px; height:34px; border-radius:7px; background:var(--bp-stripe); flex-shrink:0; object-fit:contain; }
.bp-thumb--48{ width:48px; height:48px; border-radius:8px; }
.bp-av{ width:32px; height:32px; border-radius:999px; background:var(--bp-avatar); color:var(--bp-navy); font-size:11px; font-weight:600;
  display:inline-flex; align-items:center; justify-content:center; flex-shrink:0; object-fit:cover; }
.bp-av--36{ width:36px; height:36px; font-size:12px; }
.bp-av--44{ width:44px; height:44px; font-size:14px; }
.bp-ph{ background:var(--bp-stripe-lg); display:flex; align-items:center; justify-content:center; font-family:var(--bp-mono); font-size:12px; color:var(--bp-dim); }
.bp-empty{ padding:40px 24px; text-align:center; display:flex; flex-direction:column; gap:8px; align-items:center; }
.bp-empty__t{ font-size:15px; font-weight:600; }
.bp-empty__b{ font-size:13px; color:var(--bp-dim); max-width:420px; text-wrap:pretty; }
.bp-skel{ background:var(--bp-border-soft); border-radius:6px; height:14px; }

/* pills */
.bp-pill{ justify-self:start; font-size:12px; font-weight:600; border-radius:999px; padding:3px 10px; white-space:nowrap; display:inline-block; }
.bp-pill--ok{ color:var(--bp-ok); background:var(--bp-ok-bg); }
.bp-pill--warn{ color:var(--bp-warn); background:var(--bp-warn-bg); }
.bp-pill--neutral{ color:var(--bp-neutral); background:var(--bp-neutral-bg); }
.bp-pill--info{ color:var(--bp-info); background:var(--bp-info-bg); }
.bp-pill--disc{ color:var(--bp-disc); background:var(--bp-disc-bg); font-size:10px; padding:2px 7px; }
.bp-pill--sm{ font-size:11px; padding:3px 10px; }
.bp-callout{ background:var(--bp-info-bg); color:var(--bp-info); border-radius:10px; padding:12px 16px; font-size:13px; line-height:19px; display:flex; gap:12px; align-items:flex-start; text-wrap:pretty; }

/* inputs */
.bp-field{ display:flex; flex-direction:column; gap:5px; }
.bp-label{ font-size:12px; font-weight:500; color:var(--bp-ink); }
.bp-input,.bp-select,.bp-textarea{ height:40px; width:100%; border:1px solid var(--bp-input); border-radius:8px; padding:0 12px; font-size:13px;
  color:var(--bp-ink); background:var(--bp-surface); font-family:inherit; }
.bp-input::placeholder,.bp-textarea::placeholder{ color:var(--bp-ph); }
.bp-input:focus,.bp-select:focus,.bp-textarea:focus{ outline:none; border-color:var(--bp-navy); box-shadow:none; }
.bp-textarea{ height:auto; min-height:64px; padding:10px 12px; line-height:19px; resize:vertical; }
.bp-select{ appearance:none; padding-right:32px; cursor:pointer;
  background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235A6474' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 10px center; }
.bp-input--sm{ height:30px; padding:0 8px; font-size:12px; border-radius:6px; border-color:var(--bp-border); }
.bp-search{ height:40px; background:var(--bp-surface); border:1px solid var(--bp-input); border-radius:8px; display:flex; align-items:center; gap:8px; padding:0 12px; }
.bp-search input{ border:0; outline:none; flex:1; min-width:0; font-size:13px; color:var(--bp-ink); background:transparent; font-family:inherit; }
.bp-search input::placeholder{ color:var(--bp-dim); }
.bp-search svg{ color:var(--bp-dim); flex-shrink:0; }
.bp-search--lg{ height:44px; border-radius:10px; border:1.5px solid var(--bp-navy); }
.bp-toolbar{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.bp-toolbar .bp-select{ width:auto; min-width:150px; }
.bp-check{ width:16px; height:16px; border-radius:4px; border:1.5px solid var(--bp-radio); background:var(--bp-surface); display:inline-flex;
  align-items:center; justify-content:center; flex-shrink:0; cursor:pointer; padding:0; color:transparent; }
.bp-check.is-on{ background:var(--bp-navy); border-color:var(--bp-navy); color:#FFFFFF; }
.bp-radio{ width:16px; height:16px; border-radius:999px; border:1.5px solid var(--bp-radio); flex-shrink:0; }
.bp-radio.is-on{ border:5px solid var(--bp-navy); }
.bp-toggle{ width:36px; height:20px; border-radius:999px; background:var(--bp-input); position:relative; border:0; cursor:pointer; flex-shrink:0; padding:0; }
.bp-toggle::after{ content:""; position:absolute; top:2px; left:2px; width:16px; height:16px; border-radius:999px; background:#FFFFFF; transition:left var(--bb-motion-fast) var(--bb-ease); }
.bp-toggle.is-on{ background:var(--bp-navy); }
.bp-toggle.is-on::after{ left:18px; }
.bp-seg{ display:inline-flex; background:var(--bp-seg); border-radius:10px; padding:4px; gap:4px; }
.bp-seg__btn{ font-size:13px; font-weight:500; color:var(--bp-dim); padding:8px 16px; border:0; background:transparent; border-radius:7px; cursor:pointer; font-family:inherit; }
.bp-seg__btn.is-on{ font-weight:600; color:var(--bp-ink); background:var(--bp-surface); box-shadow:0 1px 2px rgba(20,32,46,.08); }
.bp-seg--sm{ border-radius:8px; padding:3px; gap:2px; background:var(--bp-neutral-bg); }
.bp-seg--sm .bp-seg__btn{ flex:1; font-size:12px; padding:6px 0; border-radius:6px; }
.bp-tabs{ display:flex; gap:24px; align-self:stretch; }
.bp-tab{ display:flex; align-items:center; gap:6px; font-size:13px; font-weight:500; color:var(--bp-dim); border:0; border-bottom:2px solid transparent;
  background:none; cursor:pointer; padding:0; font-family:inherit; }
.bp-tab.is-on{ font-weight:600; color:var(--bp-ink); border-bottom-color:var(--bp-accent); }
.bp-tab__n{ font-size:11px; color:var(--bp-dim); font-weight:500; font-variant-numeric:tabular-nums; }
.bp-chip{ display:inline-flex; align-items:center; gap:8px; font-size:13px; font-weight:500; color:var(--bp-ink); background:var(--bp-surface);
  border:1px solid var(--bp-input); border-radius:999px; padding:7px 14px; cursor:pointer; font-family:inherit; }
.bp-chip.is-on{ background:var(--bp-warm); border-color:var(--bp-accent); }
.bp-chip__box{ width:14px; height:14px; border-radius:4px; border:1.5px solid var(--bp-input); background:var(--bp-surface); }
.bp-chip.is-on .bp-chip__box{ border-color:var(--bp-accent); background:var(--bp-accent); }
.bp-dot{ width:8px; height:8px; border-radius:999px; flex-shrink:0; }
.bp-pager{ display:flex; justify-content:space-between; align-items:center; padding:12px 20px; }
.bp-pager__btn{ min-width:30px; height:30px; border-radius:7px; background:var(--bp-surface); border:1px solid var(--bp-border); color:var(--bp-ink);
  font-size:12px; font-weight:600; cursor:pointer; padding:0 8px; font-family:inherit; }
.bp-pager__btn.is-on{ background:var(--bp-navy); border-color:var(--bp-navy); color:#FFFFFF; }
.bp-pager__btn:disabled{ opacity:.4; cursor:default; }
.bp-noaccess{ max-width:440px; margin:15vh auto; text-align:center; display:flex; flex-direction:column; gap:12px; align-items:center; padding:24px; }
.bp-modal{ position:fixed; inset:0; z-index:70; display:flex; align-items:center; justify-content:center; background:rgba(7,23,46,.45); padding:24px; }
.bp-modal__card{ background:var(--bp-surface); border-radius:14px; padding:24px; width:100%; max-width:440px; display:flex; flex-direction:column; gap:14px; box-shadow:var(--bp-shadow-sheet); }
.bp-body .bb-toast-host{ bottom:24px; }