/* ============================================================
   Zentr — Mobile prototype design system (v2, reference-matched)
   Type: Plus Jakarta Sans (latin) + IBM Plex Sans Thai (thai)
   Layout: centered app column (max 460px), logo/back top bar,
   fixed bottom tab bar, big eyebrow + heading in content.
   ============================================================ */

/* ---- Tokens: light ---- */
:root {
  --bg: #eef4ff;               /* airy blue-white */
  --surface: #ffffff;
  --surface-2: #f0f5ff;
  --surface-3: #e2ecfd;
  --fg: #0f1b33;
  --fg-2: #35425c;
  --muted: #6a7691;
  --border: #e4ecfb;
  --border-strong: #d3e0f6;

  --primary: #2563eb;          /* clean blue */
  --primary-600: #1d4fd0;
  --primary-ink: #ffffff;
  --primary-weak: #e2ecfe;
  --accent: #3b82f6;           /* sky */

  --success: #1b9e5f;
  --success-weak: #e6f6ee;
  --warning: #bd7a12;
  --warning-weak: #fbf1dd;
  --danger: #d6453f;
  --danger-weak: #fbe8e7;
  --info: #2563eb;
  --info-weak: #e2ecfe;

  --shadow-sm: 0 1px 2px rgba(20,24,40,.05), 0 1px 3px rgba(20,24,40,.045);
  --shadow-md: 0 6px 20px rgba(20,24,40,.08), 0 2px 6px rgba(20,24,40,.05);
  --shadow-lg: 0 16px 44px rgba(20,24,40,.16);

  --font-sans: "Plus Jakarta Sans", "IBM Plex Sans Thai", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-thai: "IBM Plex Sans Thai", "Plus Jakarta Sans", system-ui, sans-serif;

  --app-w: 460px;
  --radius: 20px;
  --radius-lg: 24px;
  --radius-sm: 13px;
  --radius-pill: 999px;
  --gutter: 18px;
  --appbar-h: 58px;
  --tabbar-h: 64px;

  color-scheme: light;
}

/* ---- Tokens: dark (system) ---- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a1120;
    --surface: #121a2b;
    --surface-2: #1a2436;
    --surface-3: #233049;
    --fg: #e9eefb;
    --fg-2: #c2cce0;
    --muted: #8e9bb6;
    --border: #202c43;
    --border-strong: #2d3b56;

    --primary: #5b96ff;
    --primary-600: #4a87f5;
    --primary-ink: #0a1120;
    --primary-weak: #182544;
    --accent: #7db0ff;

    --success: #43c585;
    --success-weak: #14271e;
    --warning: #dd9f45;
    --warning-weak: #2a2113;
    --danger: #ef6b66;
    --danger-weak: #2d1817;
    --info: #5b96ff;
    --info-weak: #182544;

    --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
    --shadow-md: 0 6px 20px rgba(0,0,0,.5);
    --shadow-lg: 0 16px 44px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}
/* ---- Tokens: dark (explicit) ---- */
:root[data-theme="dark"] {
  --bg: #0a1120; --surface: #121a2b; --surface-2: #1a2436; --surface-3: #233049;
  --fg: #e9eefb; --fg-2: #c2cce0; --muted: #8e9bb6; --border: #202c43; --border-strong: #2d3b56;
  --primary: #5b96ff; --primary-600: #4a87f5; --primary-ink: #0a1120; --primary-weak: #182544; --accent: #7db0ff;
  --success: #43c585; --success-weak: #14271e; --warning: #dd9f45; --warning-weak: #2a2113;
  --danger: #ef6b66; --danger-weak: #2d1817; --info: #5b96ff; --info-weak: #182544;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4); --shadow-md: 0 6px 20px rgba(0,0,0,.5); --shadow-lg: 0 16px 44px rgba(0,0,0,.6);
  color-scheme: dark;
}

/* ---- Reset / base ---- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px; line-height: 1.5;
  color: var(--fg); background: var(--bg);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
:lang(th), [lang="th"] { font-family: var(--font-thai); }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 7px; }
.num { font-variant-numeric: tabular-nums; }

/* ============================================================ App frame */
.app {
  position: relative; width: 100%; max-width: var(--app-w); min-height: 100%;
  margin: 0 auto; background: var(--bg);
  box-shadow: 0 0 0 1px var(--border); display: flex; flex-direction: column;
}
@media (min-width: 600px) {
  body { padding: 18px 0; }
  .app { min-height: calc(100vh - 36px); border-radius: 28px; overflow: hidden; box-shadow: var(--shadow-lg); }
}

/* ---- Top bar ---- */
.appbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; height: var(--appbar-h);
  display: flex; align-items: center; gap: 8px; padding: 0 14px;
  padding-left: max(14px, env(safe-area-inset-left, 0px));
  padding-right: max(14px, env(safe-area-inset-right, 0px));
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: saturate(1.5) blur(14px);
  border-bottom: 1px solid var(--border);
}
.appbar__title { font-size: 17px; font-weight: 750; letter-spacing: -.01em; flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar__sub { display: block; font-size: 11.5px; font-weight: 500; color: var(--muted); }

/* wordmark */
.wordmark { display: inline-flex; align-items: center; gap: 9px; flex: 1; min-width: 0; }
.wordmark__mark { width: 34px; height: 34px; flex: none; border-radius: 11px;
  background: linear-gradient(145deg, #5aa0ff, #2563eb); display: grid; place-items: center;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--primary) 40%, transparent); }
.wordmark__mark svg { width: 20px; height: 20px; color: #fff; }
.wordmark__text { font-family: var(--font-sans); font-weight: 800; font-size: 20px; letter-spacing: -.03em; color: var(--fg); }

/* proto badge */
.proto { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; flex: none;
  border-radius: var(--radius-pill); background: var(--surface-2); border: 1px solid var(--border);
  font-size: 11.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }

.iconbtn { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border: 0;
  background: transparent; border-radius: 12px; color: var(--fg); }
.iconbtn:hover { background: var(--surface-2); }
.iconbtn svg { width: 22px; height: 22px; }
.iconbtn--badge { position: relative; }
.iconbtn--badge::after { content: ""; position: absolute; top: 8px; right: 9px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--danger); border: 2px solid var(--surface); }

.avatar-btn { width: 38px; height: 38px; flex: none; border-radius: 50%; border: 1px solid var(--border-strong);
  background: var(--surface-2); display: grid; place-items: center; font-weight: 700; font-size: 13px; color: var(--fg-2); }

/* ---- Content ---- */
.content { flex: 1; padding: 18px var(--gutter);
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 26px);
  display: flex; flex-direction: column; gap: 18px; }
.content--chat { padding: 0; gap: 0; padding-bottom: 0; }

/* ---- Page head (eyebrow + h1) ---- */
.eyebrow { font-family: var(--font-sans); font-size: 12px; font-weight: 800; letter-spacing: .14em;
  text-transform: uppercase; color: var(--primary); }
.pagehead { display: flex; flex-direction: column; gap: 6px; }
.pagehead h1 { font-size: 29px; font-weight: 800; letter-spacing: -.02em; line-height: 1.12; text-wrap: balance; }
.pagehead__sub { font-size: 13.5px; color: var(--muted); font-weight: 500; }

/* ---- Bottom tab bar ---- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; margin: 0 auto; max-width: var(--app-w);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: saturate(1.5) blur(16px); border-top: 1px solid var(--border); }
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border: 0; background: transparent; color: var(--muted); font-size: 10.5px; font-weight: 600; position: relative; }
.tab svg { width: 23px; height: 23px; }
.tab[aria-current="page"] { color: var(--primary); }

/* ---- FAB ---- */
.fab { position: fixed; z-index: 35; right: max(18px, env(safe-area-inset-right, 0px));
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 16px);
  width: 54px; height: 54px; border-radius: 18px; display: grid; place-items: center; border: 0;
  background: var(--primary); color: var(--primary-ink);
  box-shadow: var(--shadow-md), 0 8px 20px color-mix(in srgb, var(--primary) 45%, transparent); }
@media (min-width: 600px) { .fab { right: calc(50% - var(--app-w)/2 + 18px); } }
.fab svg { width: 26px; height: 26px; }

/* ============================================================ Components */
.sec { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.sec__title { font-size: 15px; font-weight: 750; letter-spacing: -.01em; }
.sec__link { font-size: 13px; font-weight: 600; color: var(--primary); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card--pad { padding: 18px; }
.card--flat { box-shadow: none; }

/* ---- Primary CTA ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 50px; padding: 0 18px;
  border-radius: 14px; border: 1px solid transparent; font-size: 15.5px; font-weight: 700; letter-spacing: -.01em; }
.btn svg { width: 19px; height: 19px; }
.btn--primary { background: var(--primary); color: var(--primary-ink); box-shadow: 0 6px 18px color-mix(in srgb, var(--primary) 34%, transparent); }
.btn--primary:hover { background: var(--primary-600); }
.btn--ghost { background: var(--surface); color: var(--fg); border-color: var(--border-strong); }
.btn--soft { background: var(--primary-weak); color: var(--primary); }
.btn--danger { background: var(--danger-weak); color: var(--danger); }
.btn--block { width: 100%; }
.btn--sm { height: 38px; padding: 0 14px; font-size: 13.5px; border-radius: 11px; }
.btn--lg { height: 56px; font-size: 16px; }

/* ---- Stat card (single card, 2x2) ---- */
.statcard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.statgrid { display: grid; grid-template-columns: 1fr 1fr; }
.statcell { padding: 18px 18px 16px; display: flex; flex-direction: column; gap: 5px; }
.statcell:nth-child(1), .statcell:nth-child(2) { border-bottom: 1px solid var(--border); }
.statcell:nth-child(odd) { border-right: 1px solid var(--border); }
.statcell__label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.statcell__val { font-size: 32px; font-weight: 800; letter-spacing: -.03em; line-height: 1.05; }
.statcell__foot { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); font-weight: 500; }
.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.dot--primary { background: var(--primary); } .dot--success { background: var(--success); }
.dot--warning { background: var(--warning); } .dot--muted { background: var(--muted); }

/* ---- Week/day selector ---- */
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.day { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 9px 0 10px; border-radius: 15px;
  background: transparent; border: 0; }
.day__dow { font-size: 11px; font-weight: 600; color: var(--muted); }
.day__n { font-size: 17px; font-weight: 750; font-variant-numeric: tabular-nums; }
.day__dot { width: 5px; height: 5px; border-radius: 50%; background: var(--border-strong); }
.day--on { background: var(--primary); color: var(--primary-ink); }
.day--on .day__dow { color: color-mix(in srgb, var(--primary-ink) 80%, transparent); }
.day--on .day__dot { background: var(--primary-ink); }

/* ---- Segmented / filter chips (soft active) ---- */
.segmented { display: flex; gap: 8px; overflow-x: auto; padding: 1px; scrollbar-width: none; }
.segmented::-webkit-scrollbar { display: none; }
.seg { flex: none; height: 36px; padding: 0 15px; border-radius: var(--radius-pill); border: 1px solid transparent;
  background: transparent; color: var(--muted); font-size: 13.5px; font-weight: 650; display: inline-flex; align-items: center; gap: 7px; }
.seg[aria-pressed="true"] { background: var(--primary-weak); color: var(--primary); }
.seg__count { display: inline-flex; min-width: 19px; height: 19px; padding: 0 5px; align-items: center; justify-content: center;
  border-radius: 999px; background: var(--warning-weak); color: var(--warning); font-size: 11px; font-weight: 700; }

/* ---- Search ---- */
.search { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 15px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 15px; color: var(--muted); box-shadow: var(--shadow-sm); }
.search svg { width: 19px; height: 19px; flex: none; }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--fg); font: inherit; font-size: 14.5px; outline: none; }

/* ---- Booking row (time on left) ---- */
.bkcard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.bkrow { display: flex; gap: 14px; padding: 16px 16px; width: 100%; text-align: left; background: transparent; border: 0; align-items: flex-start; }
.bkrow + .bkrow { border-top: 1px solid var(--border); }
.bkrow:hover { background: var(--surface-2); }
.bkrow__time { flex: none; width: 52px; }
.bkrow__t1 { font-size: 16px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.bkrow__t2 { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; margin-top: 1px; }
.bkrow__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.bkrow__name { font-size: 15.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bkrow__svc { font-size: 13px; color: var(--muted); }
.bkrow__tags { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.bkrow__code { font-size: 12px; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.bkrow__chev { color: var(--border-strong); flex: none; align-self: center; }
.bkrow__chev svg { width: 19px; height: 19px; }

/* ---- generic list / item ---- */
.list { display: flex; flex-direction: column; }
.list > * + * { border-top: 1px solid var(--border); }
.item { display: flex; align-items: center; gap: 13px; padding: 14px 16px; width: 100%; text-align: left; background: transparent; border: 0; }
.item:hover { background: var(--surface-2); }
.item__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.item__title { font-size: 15px; font-weight: 680; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item__sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item__end { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex: none; }
.item__amt { font-size: 15px; font-weight: 750; }
.item__time { font-size: 12px; color: var(--muted); }
.item__chev { color: var(--border-strong); flex: none; }
.item__chev svg { width: 19px; height: 19px; }

/* ---- avatar ---- */
.avatar { width: 44px; height: 44px; border-radius: 14px; flex: none; display: grid; place-items: center; font-size: 15px; font-weight: 700; color: #fff; overflow: hidden; }
.avatar--sm { width: 36px; height: 36px; border-radius: 11px; font-size: 13px; }
.avatar--lg { width: 76px; height: 76px; border-radius: 24px; font-size: 27px; }
.a1 { background: linear-gradient(135deg, #5aa0ff, #2563eb); }
.a2 { background: linear-gradient(135deg, #0ea5e9, #2563eb); }
.a3 { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.a4 { background: linear-gradient(135deg, #10b981, #0d9488); }
.a5 { background: linear-gradient(135deg, #a855f7, #6366f1); }
.a6 { background: linear-gradient(135deg, #ec4899, #db2777); }

/* ---- chips ---- */
.chip { display: inline-flex; align-items: center; gap: 5px; height: 25px; padding: 0 10px; border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 650; white-space: nowrap; }
.chip__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip--success { background: var(--success-weak); color: var(--success); }
.chip--warning { background: var(--warning-weak); color: var(--warning); }
.chip--danger  { background: var(--danger-weak);  color: var(--danger); }
.chip--info    { background: var(--info-weak);    color: var(--info); }
.chip--muted   { background: var(--surface-3);    color: var(--muted); }
.chip--primary { background: var(--primary-weak); color: var(--primary); }

/* quick actions */
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.quick__item { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 4px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; text-align: center; box-shadow: var(--shadow-sm); }
.quick__ico { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; }
.quick__ico svg { width: 21px; height: 21px; }
.quick__label { font-size: 11.5px; font-weight: 600; color: var(--fg-2); }

.tint-primary { background: var(--primary-weak); color: var(--primary); }
.tint-success { background: var(--success-weak); color: var(--success); }
.tint-warning { background: var(--warning-weak); color: var(--warning); }
.tint-danger  { background: var(--danger-weak);  color: var(--danger); }
.tint-info    { background: var(--info-weak);    color: var(--info); }
.tint-muted   { background: var(--surface-3);    color: var(--muted); }

/* settings rows */
.set { display: flex; align-items: center; gap: 13px; padding: 15px 16px; width: 100%; background: transparent; border: 0; text-align: left; }
.set + .set { border-top: 1px solid var(--border); }
.set__ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.set__ico svg { width: 19px; height: 19px; }
.set__main { flex: 1; min-width: 0; }
.set__title { font-size: 15px; font-weight: 650; }
.set__sub { font-size: 12.5px; color: var(--muted); }

/* fields */
.field { display: flex; flex-direction: column; gap: 8px; }
.field__label { font-size: 13.5px; font-weight: 650; color: var(--fg-2); }
.field__label .req { color: var(--danger); }
.input, .select, .textarea { width: 100%; min-height: 50px; padding: 13px 15px; background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: 14px; color: var(--fg); font: inherit; font-size: 15px; outline: none; }
.input::placeholder, .textarea::placeholder { color: var(--muted); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.textarea { min-height: 96px; resize: vertical; }
.field__hint { font-size: 12px; color: var(--muted); }

/* switch */
.switch { width: 48px; height: 29px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--border-strong);
  position: relative; flex: none; transition: background .16s; }
.switch[aria-checked="true"] { background: var(--primary); border-color: var(--primary); }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 23px; height: 23px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .16s; }
.switch[aria-checked="true"]::after { transform: translateX(19px); }

/* rows */
.row { display: flex; align-items: center; gap: 12px; }
.row--between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 14px; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.strong { font-weight: 700; }
.center { text-align: center; }
.divider { height: 1px; background: var(--border); border: 0; margin: 0; }

/* kv */
.kv { display: flex; flex-direction: column; }
.kv__row { display: flex; justify-content: space-between; gap: 14px; padding: 13px 16px; font-size: 14.5px; }
.kv__row + .kv__row { border-top: 1px solid var(--border); }
.kv__k { color: var(--muted); }
.kv__v { font-weight: 650; text-align: right; }

/* underline tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs__t { flex: none; padding: 13px 8px; font-size: 14px; font-weight: 680; color: var(--muted); border-bottom: 2.5px solid transparent; margin-bottom: -1px; }
.tabs__t[aria-selected="true"] { color: var(--primary); border-color: var(--primary); }

.badge { display: inline-flex; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--primary); color: #fff; font-size: 11px; font-weight: 700; align-items: center; justify-content: center; }

.meter { height: 9px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 99px; background: var(--primary); }

.hero-profile { display: flex; flex-direction: column; align-items: center; gap: 11px; padding: 16px 16px 4px; }
.hero-profile__name { font-size: 21px; font-weight: 800; letter-spacing: -.01em; }
.hero-profile__meta { font-size: 13.5px; color: var(--muted); }

/* note / banner */
.note { display: flex; gap: 12px; padding: 14px 15px; border-radius: 15px; font-size: 13.5px; align-items: flex-start; }
.note svg { width: 19px; height: 19px; flex: none; margin-top: 1px; }
.note--info { background: var(--info-weak); color: var(--primary); }
.note--warning { background: var(--warning-weak); color: var(--warning); }

/* mini bars */
.bars { display: flex; align-items: flex-end; gap: 8px; height: 120px; padding-top: 8px; }
.bars__col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.bars__bar { width: 100%; max-width: 22px; border-radius: 7px 7px 4px 4px; background: var(--primary-weak); }
.bars__bar--on { background: linear-gradient(180deg, #5aa0ff, var(--primary)); }
.bars__lbl { font-size: 10.5px; color: var(--muted); font-weight: 600; }

/* chat */
.chatscroll { flex: 1; overflow-y: auto; padding: 16px var(--gutter) 12px; display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: 80%; padding: 10px 14px; border-radius: 17px; font-size: 14.5px; line-height: 1.42; }
.bubble--in { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 5px; }
.bubble--out { align-self: flex-end; background: var(--primary); color: var(--primary-ink); border-bottom-right-radius: 5px; }
.bubble--bot { align-self: flex-start; background: var(--primary-weak); color: var(--fg); border-bottom-left-radius: 5px; }
.bubble__meta { font-size: 10.5px; color: var(--muted); margin-top: 3px; padding: 0 6px; }
.daystamp { align-self: center; font-size: 11px; color: var(--muted); background: var(--surface-2); padding: 4px 12px; border-radius: 999px; }
.composer { display: flex; align-items: center; gap: 9px; padding: 11px var(--gutter);
  padding-bottom: calc(11px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--border); background: var(--surface); }
.composer .input { min-height: 44px; border-radius: 999px; }
.composer__send { width: 44px; height: 44px; flex: none; border-radius: 50%; border: 0; background: var(--primary); color: var(--primary-ink); display: grid; place-items: center; }
.composer__send svg { width: 20px; height: 20px; }

/* chat channel badge */
.ch { position: relative; }
.ch__badge { position: absolute; left: 32px; bottom: 9px; width: 15px; height: 15px; border-radius: 50%; border: 2px solid var(--surface); }
.ch__badge--line { background: #06C755; } .ch__badge--fb { background: #1877F2; }
.ch__badge--wa { background: #25D366; } .ch__badge--bot { background: var(--accent); }

/* ---- Modal / sheet ---- */
.overlay { position: fixed; inset: 0; z-index: 60; background: color-mix(in srgb, #0a0d18 55%, transparent);
  display: grid; place-items: center; padding: 20px; backdrop-filter: blur(2px); }
.overlay[hidden] { display: none; }
.modal { width: 100%; max-width: 420px; max-height: 88vh; overflow-y: auto; background: var(--surface);
  border-radius: 26px; box-shadow: var(--shadow-lg); padding: 22px; display: flex; flex-direction: column; gap: 16px; position: relative; }
.modal__close { position: absolute; top: 18px; right: 18px; width: 44px; height: 44px; border-radius: 50%;
  border: 1.5px solid var(--primary); background: var(--surface); color: var(--fg); display: grid; place-items: center; }
.modal__close svg { width: 20px; height: 20px; }
.modal__head { display: flex; flex-direction: column; gap: 8px; padding-right: 52px; }
.modal__title { font-size: 23px; font-weight: 800; letter-spacing: -.02em; }
.modal__sub { font-size: 13.5px; color: var(--muted); }
.modal__foot { font-size: 12.5px; color: var(--muted); line-height: 1.45; }

/* empty */
.empty { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 40px 20px; color: var(--muted); }
.empty svg { width: 46px; height: 46px; opacity: .5; }

/* ---- Hero header (blue gradient, real-app feel) ---- */
.hero {
  margin: -18px calc(-1 * var(--gutter)) 2px;
  margin-left: calc(-1 * max(var(--gutter), env(safe-area-inset-left, 0px)));
  margin-right: calc(-1 * max(var(--gutter), env(safe-area-inset-right, 0px)));
  padding: 22px var(--gutter) 48px;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
  background: linear-gradient(155deg, #5aa0ff 0%, #2f6bf0 48%, #1f54db 100%);
  color: #fff; border-radius: 0 0 28px 28px;
  display: flex; flex-direction: column; gap: 14px;
  box-shadow: 0 14px 30px -14px color-mix(in srgb, var(--primary) 70%, transparent);
}
.hero .eyebrow { color: rgba(255,255,255,.82); }
.hero h1 { color: #fff; font-size: 27px; font-weight: 800; letter-spacing: -.02em; line-height: 1.14; text-wrap: balance; }
.hero__sub { color: rgba(255,255,255,.88); font-size: 13.5px; font-weight: 500; }
.hero__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hero__avatar { width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.5);
  display: grid; place-items: center; font-weight: 700; font-size: 14px; color: #fff; background: rgba(255,255,255,.14); }
.hero__bell { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; border: 0;
  background: rgba(255,255,255,.16); color: #fff; position: relative; }
.hero__bell svg { width: 21px; height: 21px; }
.hero__bell::after { content: ""; position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; border-radius: 50%;
  background: #ffd23f; border: 2px solid #2f6bf0; }
.hero__brand { display: inline-flex; align-items: center; gap: 9px; }
.hero__logo { width: 34px; height: 34px; border-radius: 11px; background: rgba(255,255,255,.16); display: grid; place-items: center; }
.hero__logo svg { width: 20px; height: 20px; }
.hero__name { font-size: 19px; font-weight: 800; letter-spacing: -.03em; color: #fff; }

.btn--white { background: #fff; color: var(--primary); box-shadow: 0 6px 16px rgba(10,24,60,.18); }
.btn--white:hover { background: #f3f7ff; }
.pull-up { margin-top: -36px; position: relative; z-index: 1; }

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