/* BIC Chat Calling Agent — dashboard. "BIC One" design: calm, confident, phone first. Light + dark. */

/* ───────────── tokens ───────────── */
:root {
  --bg: #F6F6F9;
  --bg-tint: #EEEEF8;
  --surface: #FFFFFF;
  --surface-2: #F4F4F8;
  --surface-3: #E9E9F1;
  --border: #E7E7EF;
  --border-strong: #D6D6E2;
  --hairline: rgba(20, 20, 43, .07);
  --text: #15152E;
  --text-2: #33344F;
  --muted: #5F6179;
  --faint: #8A8CA3;
  --accent: #3B37E6;
  --accent-hover: #2E2AD0;
  --accent-ink: #FFFFFF;
  --accent-text: #3632D6;
  --accent-soft: #EEEDFE;
  --accent-soft-2: #E0DEFD;
  --teal: #0FB5A6;
  --teal-text: #08877C;
  --teal-soft: #E1F6F3;
  --warn: #D98A06;
  --warn-text: #8A4B00;
  --warn-soft: #FFF6E0;
  --warn-border: #F4DA9A;
  --danger: #D12F3D;
  --danger-text: #B42332;
  --danger-soft: #FDEEF0;
  --danger-border: #F4C4CA;
  --ok: #12A16B;
  --ok-text: #0A7A51;
  --ok-soft: #E3F6EE;
  --bubble-user: #3B37E6;
  --bubble-user-ink: #FFFFFF;
  --bubble-ai: #FFFFFF;
  --chat-bg: #F3F3F8;
  --code-bg: #0E0F1F;
  --code-top: #17182D;
  --code-ink: #E7E7F3;
  --code-dim: #7F82A6;
  --hero-1: #2A26C4;
  --hero-2: #3B37E6;
  --hero-3: #0FB5A6;
  --shadow-xs: 0 1px 2px rgba(21, 21, 46, .05);
  --shadow-sm: 0 1px 2px rgba(21, 21, 46, .04), 0 2px 6px rgba(21, 21, 46, .04);
  --shadow: 0 1px 2px rgba(21, 21, 46, .04), 0 6px 16px rgba(21, 21, 46, .05), 0 18px 40px rgba(21, 21, 46, .04);
  --shadow-lg: 0 10px 30px rgba(21, 21, 46, .12), 0 30px 80px rgba(21, 21, 46, .18);
  --shadow-accent: 0 6px 18px rgba(59, 55, 230, .28);
  --r-xs: 8px;
  --r-sm: 12px;
  --r-card: 16px;
  --r-lg: 20px;
  --r-pill: 999px;
  --font-head: 'Plus Jakarta Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, 'JetBrains Mono', Menlo, Consolas, monospace;
  --gutter: 16px;
  --topbar-h: 60px;
  --tabbar-h: 64px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0A0B14;
    --bg-tint: #10112A;
    --surface: #12131F;
    --surface-2: #191A29;
    --surface-3: #222337;
    --border: #232436;
    --border-strong: #33354D;
    --hairline: rgba(255, 255, 255, .06);
    --text: #EDEDF6;
    --text-2: #D3D4E6;
    --muted: #A2A4BE;
    --faint: #73758F;
    --accent: #5551F5;
    --accent-hover: #6763FF;
    --accent-ink: #FFFFFF;
    --accent-text: #ABA9FF;
    --accent-soft: #1D1C45;
    --accent-soft-2: #28275E;
    --teal: #2AD3C2;
    --teal-text: #5FE6D6;
    --teal-soft: #0F2E2D;
    --warn: #F2B544;
    --warn-text: #F6CB7A;
    --warn-soft: #2A2110;
    --warn-border: #4E3D17;
    --danger: #F2737E;
    --danger-text: #F59AA2;
    --danger-soft: #311519;
    --danger-border: #5C2730;
    --ok: #3DD69A;
    --ok-text: #6EE3B4;
    --ok-soft: #0F2B21;
    --bubble-user: #4C48EE;
    --bubble-ai: #1B1C2C;
    --chat-bg: #0E0F1A;
    --code-bg: #080913;
    --code-top: #111223;
    --hero-1: #1F1C9E;
    --hero-2: #3430C9;
    --hero-3: #0C8E83;
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35), 0 2px 8px rgba(0, 0, 0, .2);
    --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 8px 24px rgba(0, 0, 0, .28);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, .6);
    --shadow-accent: 0 6px 20px rgba(85, 81, 245, .35);
    color-scheme: dark;
  }
}

/* ───────────── base ───────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 80px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 15px/1.55 var(--font-body);
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
body.no-scroll { overflow: hidden; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--font-head); color: var(--text); margin: 0; letter-spacing: -.02em; }
h1 { font-size: 26px; line-height: 1.2; font-weight: 800; }
h2 { font-size: 16.5px; line-height: 1.35; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0; }
a { color: var(--accent-text); }
code { font-family: var(--font-mono); font-size: .88em; background: var(--surface-2); border: 1px solid var(--border); padding: 1px 6px; border-radius: 6px; }
small { font-size: 12.5px; }
strong { font-weight: 600; }
button, input, select, textarea { font: inherit; color: inherit; }
svg { flex: none; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--surface); padding: 8px 16px; border-radius: 8px; box-shadow: var(--shadow); }
.skip:focus { left: 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.fine { color: var(--faint); font-size: 12.5px; margin-top: 12px; line-height: 1.5; }
.fine.pad { padding: 0 16px 16px; }
.center { text-align: center; }
.break { word-break: break-all; overflow-wrap: anywhere; }
.pos { color: var(--teal-text); }
.neg { color: var(--danger-text); }
.num, .kpi-value, .hero-stat strong, .chip-stat strong, .bill-lines dd, .player-time { font-variant-numeric: tabular-nums; }
.noscript { padding: 24px; text-align: center; }
time { cursor: help; }

/* ───────────── brand ───────────── */
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
  position: relative; flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  font: 800 12.5px/1 var(--font-head); letter-spacing: .02em; color: #fff;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(15, 181, 166, .9) 0%, rgba(15, 181, 166, 0) 55%),
    linear-gradient(145deg, #4A46F2 0%, #3B37E6 45%, #2622B8 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), inset 0 -1px 0 rgba(0, 0, 0, .15), 0 6px 16px rgba(59, 55, 230, .32);
}
.brand-mark::after {
  content: ''; position: absolute; right: -2px; top: -2px; width: 10px; height: 10px; border-radius: 50%;
  background: #2DD4BF; box-shadow: 0 0 0 2.5px var(--surface);
}
.brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.brand-text strong { font: 700 15px/1.25 var(--font-head); letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text small { color: var(--faint); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-lg .brand-mark { width: 52px; height: 52px; border-radius: 16px; font-size: 15px; }
.brand-lg .brand-mark::after { width: 12px; height: 12px; }
.brand-lg .brand-text strong { font-size: 18px; }

/* ───────────── avatars ───────────── */
.avatar {
  flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  font: 700 14px/1 var(--font-head); color: #fff;
  background: linear-gradient(145deg, #5B57F5, #3B37E6);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
}
.avatar svg { width: 17px; height: 17px; }
.avatar-sm { width: 34px; height: 34px; font-size: 13px; }
.avatar-lg { width: 42px; height: 42px; font-size: 16px; }
.avatar-xl { width: 52px; height: 52px; font-size: 20px; border-radius: 16px; }
.avatar-anon { background: var(--surface-3); color: var(--muted); box-shadow: none; }
.avatar-teal { background: linear-gradient(145deg, #2DD4BF, #0FB5A6); }

/* ───────────── buttons ───────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 18px; border-radius: var(--r-sm); border: 1px solid transparent;
  font-weight: 600; font-size: 14.5px; letter-spacing: -.005em; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s, border-color .15s, box-shadow .15s, color .15s, transform .08s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active:not(:disabled) { transform: translateY(1px) scale(.99); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), var(--shadow-accent); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); box-shadow: var(--shadow-xs); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-2); border-color: var(--border-strong); }
.btn-ghost { background: transparent; color: var(--accent-text); }
.btn-ghost:hover:not(:disabled) { background: var(--accent-soft); }
.btn-dashed { background: transparent; color: var(--accent-text); border: 1.5px dashed color-mix(in srgb, var(--accent) 40%, var(--border-strong)); width: 100%; }
.btn-dashed:hover { background: var(--accent-soft); }
.btn-light { background: #fff; color: #2A26C4; box-shadow: 0 6px 16px rgba(10, 8, 80, .25); }
.btn-light:hover:not(:disabled) { background: #F2F2FF; }
.btn-glass { background: rgba(255, 255, 255, .12); color: #fff; border-color: rgba(255, 255, 255, .24); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.btn-glass:hover { background: rgba(255, 255, 255, .2); }
.btn-sm { min-height: 38px; padding: 0 13px; font-size: 13.5px; border-radius: 10px; gap: 6px; }
.btn-sm svg { width: 16px; height: 16px; }
.btn-lg { min-height: 52px; font-size: 15.5px; }
.btn-block { width: 100%; }
.icon-btn {
  flex: none; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted); cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn-soft { background: var(--surface-2); border-color: transparent; }
.icon-btn-danger:hover { background: var(--danger-soft); color: var(--danger-text); border-color: var(--danger-border); }
.link { color: var(--accent-text); font-weight: 600; text-decoration: none; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.link-arrow { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; min-height: 36px; }
.link-arrow svg { width: 16px; height: 16px; transition: transform .15s; }
.link-arrow:hover { text-decoration: none; }
.link-arrow:hover svg { transform: translateX(2px); }
.link-btn { display: inline-flex; align-items: center; gap: 4px; background: none; border: 0; padding: 8px 0; min-height: 40px; color: var(--accent-text); font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; }
.link-btn svg { width: 16px; height: 16px; }
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ───────────── login ───────────── */
.login {
  position: relative; min-height: 100vh; min-height: 100dvh; display: grid; place-items: center;
  padding: max(24px, env(safe-area-inset-top)) var(--gutter) max(24px, env(safe-area-inset-bottom)); overflow: hidden;
  background: var(--bg);
}
.login-glow {
  position: absolute; inset: -20%; pointer-events: none;
  background:
    radial-gradient(40% 35% at 20% 15%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%),
    radial-gradient(35% 30% at 85% 85%, color-mix(in srgb, var(--teal) 18%, transparent), transparent 70%);
}
.login-card {
  position: relative; width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 24px; box-shadow: var(--shadow-lg); padding: 32px 24px;
}
.login-title { margin-top: 28px; font-size: 24px; }
.login-sub { color: var(--muted); margin-top: 6px; font-size: 14.5px; }
.login-card form { margin-top: 24px; display: grid; gap: 12px; }
.field-label { font-weight: 600; font-size: 13.5px; color: var(--text-2); }
.pw-wrap { position: relative; }
.pw-wrap input { width: 100%; padding-right: 76px; font-family: var(--font-mono); }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); min-height: 38px; padding: 0 12px; border: 0; background: transparent; color: var(--accent-text); font-weight: 600; font-size: 14px; border-radius: 8px; cursor: pointer; }
.pw-toggle:hover { background: var(--accent-soft); }
.login-msg { background: var(--danger-soft); color: var(--danger-text); border: 1px solid var(--danger-border); padding: 10px 12px; border-radius: 10px; font-size: 14px; }
.login-fine { display: flex; gap: 8px; align-items: flex-start; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.login-fine svg { margin-top: 2px; }
@media (min-width: 640px) { .login-card { padding: 40px 36px; } }

/* ───────────── shell ───────────── */
.shell { min-height: 100vh; }
.sidebar { display: none; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: var(--topbar-h); padding: 10px var(--gutter); padding-top: max(10px, env(safe-area-inset-top));
  padding-left: max(var(--gutter), env(safe-area-inset-left)); padding-right: max(var(--gutter), env(safe-area-inset-right));
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px);
  border-bottom: 1px solid var(--hairline);
}
.topbar .brand-mark { width: 36px; height: 36px; border-radius: 11px; font-size: 11.5px; }
.topbar .brand-mark::after { box-shadow: 0 0 0 2.5px var(--bg); }
.main {
  min-width: 0; max-width: 1240px; margin: 0 auto; outline: none;
  padding: 20px var(--gutter) calc(var(--tabbar-h) + 32px + env(safe-area-inset-bottom));
  padding-left: max(var(--gutter), env(safe-area-inset-left)); padding-right: max(var(--gutter), env(safe-area-inset-right));
}

/* bottom tab bar (phone) */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
  padding: 6px max(6px, env(safe-area-inset-left)) calc(6px + env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-right));
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.6) blur(18px); -webkit-backdrop-filter: saturate(1.6) blur(18px);
  border-top: 1px solid var(--hairline); box-shadow: 0 -6px 24px rgba(21, 21, 46, .05);
}
.tabbar a, .tab-more {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 52px; padding: 4px 2px;
  color: var(--faint); text-decoration: none; font-size: 11px; font-weight: 600; letter-spacing: .01em;
  -webkit-tap-highlight-color: transparent; min-width: 0; border: 0; background: none; cursor: pointer; border-radius: 12px;
}
.tab-ic { display: grid; place-items: center; width: 52px; height: 30px; border-radius: 999px; transition: background .2s var(--ease), color .2s; }
.tab-ic svg { width: 22px; height: 22px; }
.tab-tx { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabbar a[aria-current="page"], .tab-more.is-active, .tab-more[aria-expanded="true"] { color: var(--accent-text); }
.tabbar a[aria-current="page"] .tab-ic, .tab-more.is-active .tab-ic, .tab-more[aria-expanded="true"] .tab-ic { background: var(--accent-soft); }
.tabbar a:focus-visible, .tab-more:focus-visible { outline-offset: -2px; }

/* "More" bottom sheet */
.sheet { position: fixed; inset: 0; z-index: 40; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(8, 8, 24, .42); animation: fade .2s ease; }
.sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0; background: var(--surface); border-radius: 24px 24px 0 0;
  padding: 10px 16px calc(var(--tabbar-h) + 24px + env(safe-area-inset-bottom)); box-shadow: var(--shadow-lg);
  animation: rise .26s var(--ease);
}
.sheet-grip { display: block; width: 40px; height: 5px; border-radius: 99px; background: var(--surface-3); margin: 0 auto 12px; }
.sheet-title { font: 700 13px/1 var(--font-head); color: var(--faint); text-transform: uppercase; letter-spacing: .08em; padding: 4px 8px 10px; }
.sheet-nav { display: grid; gap: 4px; }
.sheet-nav a { display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 0 12px; border-radius: 14px; color: var(--text); text-decoration: none; font-weight: 600; }
.sheet-nav a > svg:last-child { margin-left: auto; width: 18px; height: 18px; color: var(--faint); }
.sheet-nav a:hover, .sheet-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-text); }
.sheet-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--surface-2); color: var(--accent-text); }
.sheet-ic svg { width: 20px; height: 20px; }

/* sidebar (desktop) */
.nav-label { margin: 28px 12px 8px; font: 700 11px/1 var(--font-head); text-transform: uppercase; letter-spacing: .1em; color: var(--faint); }
.nav-side { display: grid; gap: 2px; }
.nav-side a {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 12px;
  color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14.5px; transition: background .15s, color .15s;
}
.nav-side a svg { width: 20px; height: 20px; }
.nav-side a:hover { background: var(--surface-2); color: var(--text); }
.nav-side a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-text); }
.nav-side a[aria-current="page"]::before { content: ''; position: absolute; left: -16px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.side-foot { margin-top: auto; padding-top: 16px; display: grid; gap: 8px; }
.me-card { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); min-width: 0; }
.me-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.me-text strong { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-text small { color: var(--faint); font-size: 12px; }
.btn-logout { justify-content: flex-start; color: var(--muted); min-height: 42px; }
.btn-logout:hover:not(:disabled) { color: var(--danger-text); background: var(--danger-soft); }

@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); }
  .sidebar {
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; height: 100dvh; padding: 24px 16px 20px;
    background: var(--surface); border-right: 1px solid var(--border); overflow-y: auto;
  }
  .sidebar > .brand { padding: 0 6px; }
  .topbar, .tabbar, .sheet { display: none !important; }
  .main { padding: 32px 40px 64px; width: 100%; }
  h1 { font-size: 30px; }
}
@media (min-width: 1280px) { .main { padding-left: 56px; padding-right: 56px; } }

/* ───────────── page head ───────────── */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 16px; margin-bottom: 20px; }
.page-titles { min-width: 0; }
.page-sub { color: var(--muted); margin-top: 4px; font-size: 14.5px; }
.page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.back { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; margin-bottom: 4px; color: var(--muted); font-weight: 600; font-size: 14px; text-decoration: none; }
.back svg { width: 18px; height: 18px; }
.back:hover { color: var(--accent-text); }
.biz-head { align-items: center; }
.biz-name { display: flex; align-items: center; gap: 12px; min-width: 0; }
.biz-name > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.biz-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.biz-name small { color: var(--faint); }
.biz-name.lg h1 { overflow-wrap: anywhere; font-size: 24px; }
@media (min-width: 900px) { .biz-name.lg h1 { font-size: 28px; } }
.dot { flex: none; width: 12px; height: 12px; border-radius: 50%; box-shadow: 0 0 0 3px var(--surface-2); }

/* ───────────── hero ───────────── */
.hero {
  position: relative; overflow: hidden; isolation: isolate; color: #fff;
  border-radius: 24px; padding: 22px 18px 18px; margin-bottom: 16px;
  background:
    radial-gradient(60% 80% at 100% 0%, color-mix(in srgb, var(--hero-3) 75%, transparent) 0%, transparent 60%),
    radial-gradient(50% 70% at 0% 100%, rgba(140, 120, 255, .35) 0%, transparent 60%),
    linear-gradient(135deg, var(--hero-1) 0%, var(--hero-2) 55%, #4B3FE0 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .12) inset, 0 18px 40px -12px rgba(59, 55, 230, .45);
}
.hero::before {
  content: ''; position: absolute; inset: 0; z-index: -1; opacity: .5;
  background-image: radial-gradient(rgba(255, 255, 255, .22) 1px, transparent 1.2px);
  background-size: 18px 18px;
  -webkit-mask-image: linear-gradient(200deg, #000 0%, transparent 55%); mask-image: linear-gradient(200deg, #000 0%, transparent 55%);
}
.hero::after {
  content: ''; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; z-index: -1;
  border: 1px solid rgba(255, 255, 255, .14); box-shadow: 0 0 0 36px rgba(255, 255, 255, .03), 0 0 0 72px rgba(255, 255, 255, .025);
}
.hero h1 { color: #fff; font-size: 24px; margin-top: 4px; }
@media (max-width: 479px) { .hero-btn { width: 38px; padding: 0; justify-content: center; } .hero-btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } }
.hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.hero-eyebrow { font-size: 13px; font-weight: 600; color: rgba(255, 255, 255, .78); }
.hero-btn {
  flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 12px; border-radius: 12px;
  color: #fff; text-decoration: none; font-weight: 600; font-size: 13.5px;
  background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .22);
}
.hero-btn svg { width: 17px; height: 17px; }
.hero-btn:hover { background: rgba(255, 255, 255, .2); }
.hero-badge {
  flex: none; display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .22);
}
.hero-badge i { width: 8px; height: 8px; border-radius: 50%; background: #5FF0DF; box-shadow: 0 0 0 3px rgba(95, 240, 223, .25); }
.hero-badge.is-warn i { background: #FFC864; box-shadow: 0 0 0 3px rgba(255, 200, 100, .25); }
.hero-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 20px; }
.hero-stat {
  min-width: 0; padding: 12px 14px; border-radius: 16px;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.hero-stat p { font-size: 12.5px; font-weight: 600; color: rgba(255, 255, 255, .8); }
.hero-stat strong { display: block; font: 800 20px/1.2 var(--font-head); letter-spacing: -.02em; margin-top: 4px; overflow-wrap: anywhere; }
.hero-stat small { display: block; color: rgba(255, 255, 255, .7); font-size: 12px; margin-top: 2px; }
.hero-stat-main { grid-column: 1 / -1; background: rgba(255, 255, 255, .16); }
.hero-stat-main strong { font-size: 30px; }
.hero-stat-teal strong { color: #7AF5E6; }
.hero-stat-teal.is-neg strong { color: #FFB4BC; }
.hero-skel { min-height: 82px; animation: pulse 1.4s ease-in-out infinite; }
.hero-skel:first-child { grid-column: 1 / -1; min-height: 96px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.hero-actions .btn { flex: 1 1 auto; min-height: 44px; }
.hero-actions .btn-light { flex-basis: 100%; }
.hero-actions .btn-glass { flex: 1 1 0; min-width: 0; padding: 0 10px; font-size: 14px; }
@media (min-width: 640px) {
  .hero { padding: 28px 28px 24px; }
  .hero h1 { font-size: 30px; }
  .hero-stats { grid-template-columns: 1.3fr 1fr 1fr; gap: 12px; }
  .hero-stat-main, .hero-skel:first-child { grid-column: auto; }
  .hero-actions .btn, .hero-actions .btn-light { flex: none; }
}
@media (min-width: 1100px) { .hero { padding: 32px 36px 28px; } .hero h1 { font-size: 34px; } .hero-stat strong { font-size: 24px; } .hero-stat-main strong { font-size: 34px; } .hero-stat { padding: 16px 18px; } }

/* ───────────── cards ───────────── */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card);
  box-shadow: var(--shadow-sm); padding: 16px; margin-bottom: 16px; min-width: 0;
}
.card > h2 { margin-bottom: 12px; }
.card-flush { padding: 0; overflow: clip; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-title { display: flex; align-items: flex-start; gap: 12px; min-width: 0; flex: 1 1 220px; }
.card-sub { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.card-icon { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: var(--accent-soft); color: var(--accent-text); }
.card-icon svg { width: 19px; height: 19px; }
.card-icon-lg { width: 44px; height: 44px; border-radius: 14px; }
.card-flush .card-head { padding: 16px 16px 0; }
.card > .card-head + div > .table-wrap, .card > div > .table-wrap { margin: 0 -16px -16px; }
.card:has(.table-wrap) { overflow: clip; }
.card.card-flush > div > .table-wrap { margin: 0; }
@media (min-width: 640px) {
  .card { padding: 22px 24px; border-radius: var(--r-lg); }
  .card > .card-head + div > .table-wrap, .card > div > .table-wrap { margin: 0 -24px -22px; }
  .card.card-flush { padding: 0; }
}

/* ───────────── KPI tiles ───────────── */
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.kpi {
  position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card);
  padding: 14px; box-shadow: var(--shadow-sm); min-width: 0; overflow: hidden;
}
.kpi-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.kpi-label { color: var(--muted); font-size: 12.5px; font-weight: 600; line-height: 1.35; padding-top: 2px; }
.kpi-icon { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: var(--surface-2); color: var(--muted); }
.kpi-icon svg { width: 16px; height: 16px; }
.kpi-value { font: 800 22px/1.15 var(--font-head); letter-spacing: -.02em; margin-top: 8px; overflow-wrap: anywhere; }
.kpi-hint { color: var(--faint); font-size: 12px; margin-top: 4px; line-height: 1.4; }
.kpi-accent { background: linear-gradient(160deg, var(--accent-soft) 0%, var(--surface) 75%); border-color: color-mix(in srgb, var(--accent) 22%, var(--border)); }
.kpi-accent .kpi-value { color: var(--accent-text); }
.kpi-accent .kpi-icon { background: var(--accent); color: #fff; }
.kpi-teal { background: linear-gradient(160deg, var(--teal-soft) 0%, var(--surface) 75%); border-color: color-mix(in srgb, var(--teal) 30%, var(--border)); }
.kpi-teal .kpi-value { color: var(--teal-text); }
.kpi-teal .kpi-icon { background: var(--teal); color: #fff; }
.kpi-danger .kpi-value { color: var(--danger-text); }
.kpi-danger .kpi-icon { background: var(--danger-soft); color: var(--danger-text); }
.kpi-skel span { display: block; height: 10px; width: 55%; border-radius: 6px; background: var(--surface-3); animation: pulse 1.4s ease-in-out infinite; }
.kpi-skel span + span { height: 22px; width: 75%; margin-top: 14px; }
.kpi-skel span + span + span { height: 9px; width: 45%; margin-top: 10px; }
@media (min-width: 640px) {
  .kpis { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
  .kpi { padding: 18px; }
  .kpi-value { font-size: 26px; }
}
@media (max-width: 639px) { .kpis-5 .kpi:last-child { grid-column: 1 / -1; } }
@media (min-width: 1100px) { .kpis-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

/* ───────────── loading / empty / error ───────────── */
@keyframes pulse { 50% { opacity: .45; } }
@keyframes shimmer { from { background-position: -320px 0; } to { background-position: 320px 0; } }
.skel { padding: 4px 0; }
.skel-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--hairline); }
.skel-row:last-child { border-bottom: 0; }
.skel-dot { flex: none; width: 34px; height: 34px; border-radius: 50%; }
.skel-lines { flex: 1; display: grid; gap: 8px; min-width: 0; }
.skel-line { display: block; height: 11px; border-radius: 6px; }
.skel-line-sm { height: 9px; }
.skel-end { flex: none; width: 56px; }
.skel-dot, .skel-line {
  background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 40%, var(--surface-2) 80%) var(--surface-2);
  background-size: 640px 100%; animation: shimmer 1.4s linear infinite;
}
.state { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; padding: 40px 20px; color: var(--muted); }
.empty-art { color: var(--text); margin-bottom: 8px; }
.state-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--surface-2); color: var(--faint); margin-bottom: 4px; }
.state-error .state-icon { background: var(--danger-soft); color: var(--danger-text); }
.state-title { font: 700 16px/1.3 var(--font-head); color: var(--text); }
.state-text { max-width: 380px; font-size: 14px; line-height: 1.5; }
.state .btn { margin-top: 10px; }

/* ───────────── banners ───────────── */
.banners:empty { display: none; }
.banner { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; margin-bottom: 12px; font-size: 14px; border: 1px solid; }
.banner-icon { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: color-mix(in srgb, currentColor 12%, transparent); }
.banner-icon svg, .banner > svg { width: 17px; height: 17px; }
.banner > div { padding-top: 3px; min-width: 0; }
.banner p + p { margin-top: 4px; }
.banner-warn { background: var(--warn-soft); color: var(--warn-text); border-color: var(--warn-border); }
.banner-error { background: var(--danger-soft); color: var(--danger-text); border-color: var(--danger-border); }
.banner .link { color: inherit; text-decoration: underline; text-underline-offset: 3px; }

/* ───────────── pills ───────────── */
.pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: var(--r-pill);
  font-size: 12px; font-weight: 600; white-space: nowrap; line-height: 1.5; letter-spacing: .005em;
}
.pill svg { width: 13px; height: 13px; stroke-width: 2.1; }
.pill-xs { font-size: 10.5px; padding: 1px 7px; vertical-align: 1px; text-transform: uppercase; letter-spacing: .04em; }
.pill-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-ok { background: var(--ok-soft); color: var(--ok-text); }
.pill-warn { background: var(--warn-soft); color: var(--warn-text); }
.pill-accent { background: var(--accent-soft); color: var(--accent-text); }
.pill-teal { background: var(--teal-soft); color: var(--teal-text); }
.pill-muted { background: var(--surface-2); color: var(--muted); box-shadow: inset 0 0 0 1px var(--border); }
.rec { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-left: 4px; vertical-align: middle; color: var(--danger); }
.rec svg { width: 15px; height: 15px; }

/* ───────────── filters ───────────── */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 13px; padding: 3px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { min-height: 38px; padding: 0 14px; border: 0; background: transparent; border-radius: 10px; font-weight: 600; font-size: 13.5px; color: var(--muted); cursor: pointer; white-space: nowrap; transition: background .15s, color .15s; }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.search { position: relative; flex: 1 1 220px; min-width: 0; display: block; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--faint); pointer-events: none; }
.search input, .search input[type=search] { width: 100%; padding-left: 42px; }
.select { flex: 1 1 200px; min-width: 0; display: block; }
.select select { width: 100%; }
.btn-csv { flex: none; }
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin-bottom: 12px; }
.summary:empty { display: none; }
.chip-stat { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); font-size: 12.5px; color: var(--muted); font-weight: 500; box-shadow: var(--shadow-xs); }
.chip-stat strong { color: var(--text); font: 700 17px/1.2 var(--font-head); letter-spacing: -.01em; }
.chip-stat:last-child strong { color: var(--accent-text); }
@media (max-width: 639px) {
  .summary { display: flex; overflow-x: auto; scrollbar-width: none; margin-left: calc(-1 * var(--gutter)); margin-right: calc(-1 * var(--gutter)); padding: 2px var(--gutter) 4px; }
  .summary::-webkit-scrollbar { display: none; }
  .chip-stat { flex: none; min-width: 112px; }
  .filters > .seg { width: 100%; }
  .seg button { flex: 1 1 auto; }
}

/* ───────────── form controls ───────────── */
input[type=text], input[type=search], input[type=password], input[type=url], input[type=email], input[type=tel], input[type=number], input[type=month], input:not([type]), select, textarea {
  min-height: 46px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-size: 16px; /* stops iOS zoom */ width: 100%; max-width: 100%; transition: border-color .15s, box-shadow .15s, background .15s;
  box-shadow: var(--shadow-xs);
}
textarea { min-height: 72px; resize: vertical; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--accent) 30%, var(--border-strong)); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
select { appearance: none; -webkit-appearance: none; padding-right: 40px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 20px, calc(100% - 15px) 20px; background-size: 5px 5px; background-repeat: no-repeat; }
input[type=search]::-webkit-search-decoration { -webkit-appearance: none; }
.field { display: grid; align-content: start; gap: 6px; margin: 0 0 16px; min-width: 0; border: 0; padding: 0; }
.field > span, .field > legend { font-weight: 600; font-size: 13.5px; color: var(--text-2); padding: 0; }
.field > legend { margin-bottom: 8px; }
.field small { color: var(--faint); font-size: 12.5px; line-height: 1.45; }
.field-inline { display: flex; align-items: center; gap: 10px; margin: 0; }
.field-inline input { width: auto; }
.month-pick { padding: 4px 4px 4px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-xs); }
.month-pick > svg { width: 18px; height: 18px; color: var(--accent-text); }
.month-pick input { border: 0; box-shadow: none; min-height: 40px; background: var(--surface-2); }
.static { min-height: 46px; display: flex; align-items: center; color: var(--muted); padding: 0 14px; border-radius: 12px; background: var(--surface-2); border: 1px dashed var(--border-strong); }
.grid-1 { display: grid; gap: 0; }
.grid-2, .grid-3 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 16px; }
@media (min-width: 720px) { .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: 1.3fr .8fr 1.5fr; } }
.color-row { display: flex; align-items: center; gap: 12px; min-height: 46px; }
.color-row input[type=color] { width: 56px; height: 46px; padding: 4px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer; }
.color-row code { font-size: 13px; text-transform: uppercase; }
.logo-preview { max-height: 56px; max-width: 160px; object-fit: contain; border-radius: 10px; border: 1px solid var(--border); padding: 4px; background: #fff; margin-top: 4px; }
.radio-row { display: flex; flex-wrap: wrap; gap: 8px; }
.radio-col { display: grid; gap: 8px; }
.radio, .check {
  display: inline-flex; align-items: center; gap: 10px; min-height: 46px; padding: 8px 16px; border: 1px solid var(--border-strong);
  border-radius: 12px; cursor: pointer; background: var(--surface); font-size: 14.5px; transition: border-color .15s, background .15s, box-shadow .15s;
}
.radio:hover, .check:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--border-strong)); }
.radio:has(input:checked), .check:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent) inset; }
.radio input, .check input { width: 19px; height: 19px; accent-color: var(--accent); margin: 0; flex: none; }
.radio-col .radio { align-items: flex-start; padding: 12px 16px; }
.radio-col .radio input { margin-top: 2px; }
.switch { display: flex; align-items: center; gap: 12px; min-height: 48px; cursor: pointer; font-weight: 500; font-size: 14.5px; padding: 10px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-ui { flex: none; position: relative; width: 48px; height: 28px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--border-strong); transition: background .2s var(--ease), border-color .2s; }
.switch-ui::after { content: ''; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s var(--ease); }
.switch input:checked + .switch-ui { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .switch-ui::after { transform: translateX(20px); }
.switch input:focus-visible + .switch-ui { outline: 2.5px solid var(--accent); outline-offset: 2px; }
.rep { display: grid; gap: 10px; margin-bottom: 12px; }
.rep:empty { margin: 0; }
.rep-row { display: flex; gap: 10px; align-items: flex-start; padding: 14px 12px 0 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); }
.rep-row > div { flex: 1; min-width: 0; }
.rep-row .field { margin-bottom: 12px; }
.rep-row .icon-btn { margin-top: 26px; width: 38px; height: 38px; }
.rep-row input, .rep-row textarea { background: var(--surface); }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.form-error { color: var(--danger-text); background: var(--danger-soft); border: 1px solid var(--danger-border); padding: 10px 12px; border-radius: 10px; font-size: 14px; width: 100%; }
.add-biz { border-color: color-mix(in srgb, var(--accent) 30%, var(--border)); box-shadow: var(--shadow); }

/* plan minutes (business overview) */
.plan-left { font-size: 15px; margin: 4px 0 10px; }
.plan-left strong { font-size: 28px; letter-spacing: -0.02em; margin-right: 4px; }
.plan-bar { height: 8px; border-radius: 99px; background: color-mix(in srgb, var(--accent) 14%, transparent); overflow: hidden; margin-bottom: 10px; }
.plan-bar span { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width .4s ease; }
.plan-card.is-low .plan-bar span { background: #E5484D; }

/* setup form */
.setup { position: relative; }
.form-card { scroll-margin-top: calc(var(--topbar-h) + 72px + env(safe-area-inset-top)); }
.jump {
  position: sticky; top: calc(var(--topbar-h) + env(safe-area-inset-top)); z-index: 12;
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
  margin: -8px calc(-1 * var(--gutter)) 12px; padding: 8px var(--gutter);
  background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.jump::-webkit-scrollbar { display: none; }
.jump button {
  flex: none; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
  color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; box-shadow: var(--shadow-xs);
}
.jump button:hover { color: var(--accent-text); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
@media (min-width: 900px) {
  .jump { top: 0; margin: -12px 0 12px; padding: 12px 0; }
  .form-card { scroll-margin-top: 72px; }
}
.identity { display: grid; gap: 16px; }
@media (min-width: 1000px) { .identity { grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; align-items: start; } }

/* live widget preview */
.wprev { --wc: #3B37E6; position: relative; padding: 14px 14px 64px; border-radius: 18px; background:
  radial-gradient(80% 60% at 100% 0%, color-mix(in srgb, var(--wc) 14%, transparent), transparent 70%), var(--surface-2);
  border: 1px solid var(--border); }
.wprev-label { font: 700 11px/1 var(--font-head); text-transform: uppercase; letter-spacing: .1em; color: var(--faint); margin-bottom: 10px; }
.wprev-window { border-radius: 16px; overflow: hidden; background: var(--surface); box-shadow: var(--shadow); border: 1px solid var(--border); }
.wprev-head { display: flex; align-items: center; gap: 10px; padding: 12px; background: var(--wc); color: #fff; }
.wprev-head strong { display: block; font: 700 14px/1.2 var(--font-head); }
.wprev-head small { display: flex; align-items: center; gap: 5px; font-size: 11.5px; opacity: .85; }
.wprev-head small i { width: 6px; height: 6px; border-radius: 50%; background: #6CF5C6; }
.wprev-av { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .22); font: 700 14px/1 var(--font-head); }
.wprev-body { display: grid; gap: 8px; padding: 12px; font-size: 13px; line-height: 1.45; }
.wprev-bot { justify-self: start; max-width: 88%; padding: 8px 12px; border-radius: 14px 14px 14px 4px; background: var(--surface-2); color: var(--text); overflow-wrap: anywhere; }
.wprev-user { justify-self: end; max-width: 80%; padding: 8px 12px; border-radius: 14px 14px 4px 14px; background: var(--wc); color: #fff; }
.wprev-fab { position: absolute; right: 16px; bottom: 12px; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--wc); color: #fff; box-shadow: 0 8px 20px color-mix(in srgb, var(--wc) 45%, transparent); }
.wprev-fab svg { width: 22px; height: 22px; }

/* save bar */
.savebar {
  position: sticky; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 12px); z-index: 10;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px;
  padding: 12px; margin: 0 0 16px; border-radius: 18px; background: color-mix(in srgb, var(--surface) 90%, transparent);
  border: 1px solid var(--border); box-shadow: var(--shadow-lg); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4);
}
.savebar .btn { flex: 1 1 140px; }
.save-state { flex: 1 1 100%; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--faint); padding: 0 4px; }
@media (max-width: 899px) {
  .savebar { padding: 8px; gap: 6px 8px; border-radius: 16px; }
  .save-state { font-size: 12px; line-height: 1.2; padding: 2px 6px 0; }
  .savebar .btn { min-height: 44px; }
  .savebar .btn-secondary { flex: 0 1 auto; padding: 0 12px; font-size: 13.5px; }
  .savebar .btn-primary { flex: 1 1 120px; }
}
.save-state::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.save-state.dirty { color: var(--warn-text); font-weight: 600; }
.save-state.dirty::before { background: var(--warn); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 25%, transparent); }
@media (min-width: 900px) { .savebar { bottom: 16px; padding: 12px 12px 12px 16px; } .savebar .btn { flex: none; } .save-state { flex: 1 1 auto; } }

/* ───────────── tables (desktop) ───────────── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; max-width: 100%; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; font-variant-numeric: tabular-nums; }
.table th, .table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--hairline); white-space: nowrap; vertical-align: middle; }
.table thead th {
  position: sticky; top: 0; z-index: 2; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); font-weight: 700;
  background: color-mix(in srgb, var(--surface-2) 92%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.table th:first-child, .table td:first-child { padding-left: 20px; }
.table th:last-child, .table td:last-child { padding-right: 20px; }
.table tfoot th { position: sticky; bottom: 0; background: var(--surface-2); font-weight: 700; border-top: 1px solid var(--border); border-bottom: 0; font-family: var(--font-head); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; }
.table td.preview { white-space: normal; min-width: 180px; max-width: 320px; color: var(--muted); }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.4; }
@media (min-width: 900px) and (max-width: 1499px) { .t-calls .c-turns { display: none; } .t-calls td.preview { min-width: 160px; max-width: 260px; } }
.table td.note { max-width: 260px; white-space: normal; min-width: 160px; color: var(--muted); }
.c-strong { font-weight: 700; }
@media (min-width: 900px) {
  .t-bill th, .t-bill td { padding-left: 10px; padding-right: 10px; }
  .t-bill thead th { letter-spacing: .03em; }
  .t-bill .c-head { white-space: normal; min-width: 180px; }
  .t-leads th, .t-leads td { padding-left: 12px; padding-right: 12px; }
  .t-leads td.note { min-width: 100px; max-width: 220px; }
}
.row-link { cursor: pointer; transition: background .12s; }
.row-link:hover td, .row-link:focus-visible td { background: color-mix(in srgb, var(--accent-soft) 55%, transparent); }
.row-link:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.who-text strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.who-text small { color: var(--faint); font-size: 12.5px; }
.c-when { color: var(--muted); }
.c-biz { color: var(--text-2); font-weight: 500; }
@media (min-width: 900px) { .table td.c-biz { white-space: normal; min-width: 140px; max-width: 220px; } }
.contact-link { display: inline-flex; align-items: center; gap: 6px; }
.contact-link svg { width: 15px; height: 15px; }
@media (min-width: 900px) {
  .card-flush .table-wrap { max-height: min(72vh, 780px); overflow: auto; }
}

/* ───────────── tables → stacked cards (phone / tablet) ───────────── */
@media (max-width: 899px) {
  .table-wrap { overflow: visible; max-width: none; }
  .table, .table tbody, .table tfoot { display: block; }
  .table thead { display: none; }
  .table tr { display: block; }
  .table td, .table th { padding: 0; border: 0; white-space: normal; }
  .table th:first-child, .table td:first-child, .table th:last-child, .table td:last-child { padding: 0; }
  .table tbody tr { padding: 14px 16px; border-bottom: 1px solid var(--hairline); }
  .table tbody tr:last-child { border-bottom: 0; }
  .table td.preview, .table td.note { max-width: none; min-width: 0; }
  .row-link:hover td, .row-link:focus-visible td { background: transparent; }
  .row-link:hover, .row-link:active { background: color-mix(in srgb, var(--accent-soft) 50%, transparent); }

  /* conversations */
  .t-calls tbody tr { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; position: relative; }
  .t-calls .c-who { order: 1; flex: 1 1 60%; min-width: 0; }
  .t-calls .c-billed { order: 2; flex: none; align-self: flex-start; padding-top: 2px; font: 700 15px/1.2 var(--font-head); color: var(--text); }
  .t-calls .c-biz { order: 3; flex: 1 1 100%; padding-left: 44px; font-size: 12.5px; color: var(--text-2); font-weight: 600; margin-top: -4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .t-calls .c-when { order: 4; flex: 1 1 100%; padding-left: 44px; font-size: 12px; color: var(--faint); margin-top: -6px; }
  .t-calls .c-prev > .muted { display: none; }
  .t-calls .c-prev { order: 5; flex: 1 1 100%; padding-left: 44px; font-size: 14px; color: var(--text-2); }
  .t-calls .c-type { order: 6; padding-left: 44px; display: inline-flex; align-items: center; }
  .t-calls .c-len { order: 7; font-size: 12.5px; color: var(--muted); text-align: left; }
  .t-calls .c-turns { display: none; }
  .t-calls .c-cost { order: 8; font-size: 12.5px; color: var(--faint); text-align: left; }
  .t-calls .c-len::before, .t-calls .c-cost::before { content: '· '; color: var(--faint); }
  .t-calls .c-cost::before { content: '· cost '; }
  .t-calls .who-text strong { white-space: nowrap; }

  /* leads */
  .t-leads tbody tr { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
  .t-leads .c-who { order: 1; flex: 1 1 50%; min-width: 0; }
  .t-leads .c-when { order: 2; flex: none; font-size: 12px; color: var(--faint); align-self: flex-start; padding-top: 2px; }
  .t-leads .c-biz { order: 3; flex: 1 1 100%; font-size: 12.5px; color: var(--text-2); font-weight: 600; padding-left: 44px; margin-top: -8px; }
  .t-leads .c-src { order: 4; flex: none; margin-left: 44px; }
  .t-leads .c-phone, .t-leads .c-email { order: 5; flex: 0 1 auto; min-width: 0; max-width: 100%; }
  .t-leads .c-phone .contact-link, .t-leads .c-email .contact-link {
    min-height: 34px; padding: 0 12px; border-radius: 999px; background: var(--accent-soft); font-size: 13.5px; max-width: 100%;
  }
  .t-leads .contact-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .t-leads .c-phone > .muted, .t-leads .c-email > .muted, .t-leads .c-note > .muted, .t-leads .c-open > .muted { display: none; }
  .t-leads .c-note { order: 6; flex: 1 1 100%; padding-left: 44px; font-size: 13.5px; }
  .t-leads tbody td.c-open { order: 7; flex: 1 1 100%; padding-left: 44px; }
  .t-leads .c-open .link-btn { min-height: 32px; padding: 0; }

  /* label / value cards (businesses, billing) */
  .t-stack tbody tr, .t-stack tfoot tr { display: grid; gap: 12px 12px; }
  .t-stack td[data-label], .t-stack th[data-label] { display: flex; flex-direction: column; gap: 2px; text-align: left; font-size: 14.5px; font-weight: 600; min-width: 0; }
  .t-stack td[data-label]::before, .t-stack th[data-label]::before { content: attr(data-label); font: 500 12px/1.3 var(--font-body); color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .t-stack .c-head { grid-column: 1 / -1; font-size: 15px; }
  .t-stack .c-empty { display: none; }
  .t-stack tfoot { border-top: 1px solid var(--border); }
  .t-stack tfoot tr { padding: 14px 16px 16px; background: color-mix(in srgb, var(--accent-soft) 60%, var(--surface)); }
  .t-stack tfoot th { position: static; background: transparent; border: 0; padding: 0; font-family: var(--font-body); }
  .t-stack tfoot .c-head { font: 700 13px/1.3 var(--font-head); color: var(--accent-text); text-transform: uppercase; letter-spacing: .06em; }
  .t-biz tbody tr, .t-biz tfoot tr { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .t-biz .c-head { grid-column: 1 / 4; }
  .t-biz .c-status { grid-column: 4 / 5; grid-row: 1; justify-self: end; align-self: center; }
  .t-biz td[data-label], .t-biz th[data-label] { grid-column: span 2; }
  .t-biz tfoot .c-head { grid-column: 1 / -1; }
  .t-bill tbody tr, .t-bill tfoot tr { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ───────────── business detail tabs ───────────── */
.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--gutter)) 16px; padding: 4px var(--gutter); }
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  flex: none; display: flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 999px;
  color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px; border: 1px solid transparent; transition: background .15s, color .15s;
}
.tabs a:hover { color: var(--text); background: var(--surface-2); }
.tabs a[aria-current="page"] { color: var(--accent-ink); background: var(--accent); box-shadow: var(--shadow-accent); }
@media (min-width: 900px) {
  .tabs { margin-left: 0; margin-right: 0; padding: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; width: fit-content; max-width: 100%; box-shadow: var(--shadow-xs); }
  .tabs a { border-radius: 12px; }
}

/* ───────────── install / code ───────────── */
.install { list-style: none; margin: 0; padding: 0; }
.install-step { position: relative; }
.install-step > .card-head { padding-left: 46px; min-height: 34px; }
.step-no {
  position: absolute; left: 16px; top: 16px; width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center;
  font: 800 15px/1 var(--font-head); color: #fff; background: linear-gradient(145deg, #4A46F2, #2E2AD0); box-shadow: var(--shadow-accent);
}
@media (min-width: 640px) {
  .install-step { padding-left: 76px; }
  .install-step > .card-head { padding-left: 0; }
  .step-no { left: 24px; top: 22px; width: 36px; height: 36px; }
  .install-step:not(:last-child)::after { content: ''; position: absolute; left: 41px; top: 66px; bottom: -16px; width: 2px; background: linear-gradient(var(--accent-soft-2), transparent); }
}
.code-box { position: relative; background: var(--code-bg); border-radius: 16px; overflow: hidden; border: 1px solid rgba(255, 255, 255, .06); box-shadow: 0 10px 30px -10px rgba(10, 10, 40, .4); color-scheme: dark; }
.code-top { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; background: var(--code-top); border-bottom: 1px solid rgba(255, 255, 255, .06); }
.code-dots { display: inline-flex; gap: 6px; }
.code-dots i { width: 10px; height: 10px; border-radius: 50%; background: #FF5F57; }
.code-dots i:nth-child(2) { background: #FEBC2E; }
.code-dots i:nth-child(3) { background: #28C840; }
.code-label { flex: 1; min-width: 0; font: 600 12px/1 var(--font-mono); color: var(--code-dim); text-transform: lowercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.code-box pre { margin: 0; padding: 16px; overflow-x: auto; font: 13px/1.7 var(--font-mono); white-space: pre; color: var(--code-ink); tab-size: 2; }
.code-wrap pre { white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 639px) { .code-box pre { font-size: 12px; padding: 14px; } }
.code-box pre code { background: none; border: 0; padding: 0; font-size: inherit; color: inherit; }
.tok-c { color: var(--code-dim); font-style: italic; }
.btn-copy {
  min-height: 38px; padding: 0 14px; border-radius: 10px; font-size: 13.5px; gap: 6px;
  background: var(--accent); color: #fff; box-shadow: 0 4px 14px rgba(59, 55, 230, .4);
}
.btn-copy svg { width: 16px; height: 16px; }
.btn-copy:hover { background: #5652F2; }
.btn-copy.is-copied, .btn.is-copied { background: var(--teal); color: #fff; border-color: transparent; box-shadow: 0 4px 14px rgba(15, 181, 166, .4); }
.steps { border: 1px solid var(--border); border-radius: 14px; margin-bottom: 8px; background: var(--surface); overflow: hidden; }
.steps[open] { background: var(--surface-2); }
.steps summary { min-height: 52px; display: flex; align-items: center; gap: 10px; padding: 0 16px; font-weight: 600; cursor: pointer; list-style: none; }
.steps summary > svg { width: 18px; height: 18px; color: var(--accent-text); }
.steps summary::-webkit-details-marker { display: none; }
.steps summary::after { content: ''; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--faint); border-bottom: 2px solid var(--faint); transform: rotate(45deg); transition: transform .2s; }
.steps[open] summary::after { transform: rotate(-135deg); }
.steps ol { margin: 0; padding: 0 16px 16px 40px; display: grid; gap: 8px; color: var(--text-2); font-size: 14px; }
.steps li::marker { color: var(--accent-text); font-weight: 700; }
.keys { margin-bottom: 8px; }
.secret { margin-top: 16px; }
.secret-label { font-weight: 600; font-size: 13.5px; margin-bottom: 6px; color: var(--text-2); }
.secret-row { display: flex; gap: 8px; align-items: stretch; }
.secret-val { flex: 1; min-width: 0; display: flex; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); word-break: break-all; font-size: 13px; user-select: all; -webkit-user-select: all; }
.secret-row .btn { flex: none; }

/* ───────────── facts ───────────── */
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; margin: 0; }
.facts > div { min-width: 0; }
.facts dt { font-size: 11px; color: var(--faint); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.facts dd { margin: 3px 0 0; font-weight: 500; overflow-wrap: anywhere; font-size: 14px; }
.facts .span-2 { grid-column: 1 / -1; }
.facts + .form-actions { margin-top: 16px; }

/* ───────────── billing / invoice ───────────── */
.bill-card { max-width: 560px; }
.invoice { position: relative; overflow: hidden; padding-top: 22px; }
.invoice::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: linear-gradient(90deg, #3B37E6, #0FB5A6); }
.inv-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 16px; border-bottom: 1px dashed var(--border-strong); }
.inv-head .brand-mark { width: 36px; height: 36px; border-radius: 11px; font-size: 11.5px; }
.inv-stamp { font: 700 11px/1 var(--font-head); text-transform: uppercase; letter-spacing: .12em; color: var(--accent-text); padding: 7px 10px; border-radius: 8px; border: 1.5px solid color-mix(in srgb, var(--accent) 40%, transparent); transform: rotate(-3deg); }
.inv-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; padding: 16px 0 4px; }
.inv-meta h2 { font-size: 22px; margin-top: 2px; }
.inv-to { text-align: right; }
.inv-to p:last-child { margin-top: 4px; }
.inv-none { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); color: var(--muted); font-size: 14px; }
.inv-none svg { width: 18px; height: 18px; }
.eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); font-weight: 700; }
.bill-lines { margin: 8px 0 0; }
.bill-lines > div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--hairline); }
.bill-lines dt { color: var(--muted); }
.bill-lines dd { margin: 0; font-weight: 600; }
.bill-total { border-bottom: 0 !important; margin: 8px -12px 0; padding: 14px 12px !important; border-radius: 14px; background: var(--accent-soft); }
.bill-total dt, .bill-total dd { font: 800 18px/1.3 var(--font-head); color: var(--accent-text); letter-spacing: -.01em; }
.bill-margin { border-bottom: 0 !important; }
.bill-margin dd { font-weight: 700; }

/* ───────────── sources ───────────── */
.source-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.source { display: flex; flex-direction: column; gap: 12px; margin: 0; }
.source-top { display: flex; gap: 12px; align-items: center; }
.source-top h2 { flex: 1; min-width: 0; }
.source .btn { margin-top: auto; align-self: flex-start; }

/* ───────────── drawer ───────────── */
.drawer { position: fixed; inset: 0; z-index: 50; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(8, 8, 24, .45); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); animation: fade .2s ease; }
.drawer-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(580px, 100%); display: flex; flex-direction: column;
  background: var(--chat-bg); box-shadow: var(--shadow-lg); animation: slide .28s var(--ease);
}
.drawer-head {
  display: flex; align-items: center; gap: 12px; padding: 12px var(--gutter); padding-top: max(12px, env(safe-area-inset-top));
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.drawer-titles { flex: 1; min-width: 0; }
.drawer-head h2 { font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-sub { font-size: 12.5px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 16px var(--gutter) calc(24px + env(safe-area-inset-bottom)); }
@media (min-width: 640px) { .drawer-panel { border-radius: 20px 0 0 20px; } .drawer-head { border-radius: 20px 0 0 0; padding: 16px 20px; } .drawer-body { padding: 20px 24px 32px; } }
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(40px); opacity: .4; } }
@keyframes rise { from { transform: translateY(40px); opacity: .5; } }
.call-head { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 16px; margin-bottom: 20px; box-shadow: var(--shadow-sm); }
.call-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.call-who { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--hairline); }
.contact-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 12px; max-width: 100%;
  background: var(--accent-soft); color: var(--accent-text); font-weight: 600; font-size: 14px; text-decoration: none;
}
.contact-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-btn svg { width: 17px; height: 17px; }
a.contact-btn:hover { background: var(--accent-soft-2); }

/* chat transcript */
.timeline { display: flex; flex-direction: column; gap: 14px; }
.msg { display: flex; gap: 8px; max-width: 88%; }
.msg-col { display: flex; flex-direction: column; min-width: 0; }
.msg-user { align-self: flex-end; justify-content: flex-end; }
.msg-user .msg-col { align-items: flex-end; }
.msg-ai { align-self: flex-start; align-items: flex-end; }
.msg-ai .msg-col { align-items: flex-start; }
.avatar-agent { width: 30px; height: 30px; font-size: 12.5px; margin-bottom: 22px; }
.bubble p { white-space: pre-wrap; }
.bubble { padding: 10px 14px; border-radius: 20px; white-space: normal; overflow-wrap: anywhere; font-size: 14.5px; line-height: 1.5; }
.msg-user .bubble { background: var(--bubble-user); color: var(--bubble-user-ink); border-bottom-right-radius: 6px; box-shadow: 0 4px 14px -4px color-mix(in srgb, var(--bubble-user) 60%, transparent); }
.msg-ai .bubble { background: var(--bubble-ai); color: var(--text); border: 1px solid var(--border); border-bottom-left-radius: 6px; box-shadow: var(--shadow-xs); }
.msg-user .bubble .muted { color: rgba(255, 255, 255, .8); }
.msg-meta { font-size: 11.5px; color: var(--faint); margin-top: 5px; padding: 0 6px; }
.msg-system { align-self: center; max-width: 94%; }
.sys-chip {
  display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center; text-align: center;
  font-size: 12.5px; font-weight: 600; padding: 5px 12px; border-radius: 999px;
  background: var(--surface); color: var(--muted); border: 1px solid var(--border); box-shadow: var(--shadow-xs);
}
.sys-chip svg { width: 14px; height: 14px; }
.sys-chip small { font-weight: 500; color: var(--faint); font-size: 11.5px; }
.sys-lead .sys-chip { background: var(--teal-soft); color: var(--teal-text); border-color: color-mix(in srgb, var(--teal) 30%, transparent); }
.sys-start .sys-chip svg { color: var(--accent-text); }
.audios { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; white-space: normal; }
.play {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px 0 5px; border-radius: 999px;
  border: 0; background: var(--accent-soft); color: var(--accent-text); font-weight: 600; font-size: 13.5px; cursor: pointer;
}
.play-ic { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; box-shadow: 0 3px 10px -2px color-mix(in srgb, var(--accent) 60%, transparent); }
.play-ic svg { width: 14px; height: 14px; margin-left: 2px; }
.play-sec { color: var(--muted); font-weight: 500; }
.play:hover .play-ic { transform: scale(1.06); }
.play.is-loading .play-ic { animation: pulse 1s ease-in-out infinite; }
.msg-user .play { background: rgba(255, 255, 255, .16); color: #fff; }
.msg-user .play-ic { background: #fff; color: var(--bubble-user); }
.msg-user .play-sec { color: rgba(255, 255, 255, .8); }
.play:disabled { cursor: progress; }
.player {
  --p: 0%;
  display: flex; align-items: center; gap: 10px; width: 260px; max-width: 100%; min-height: 44px; padding: 5px 12px 5px 5px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-text);
}
.player-btn { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; cursor: pointer; }
.player-btn svg { width: 14px; height: 14px; }
.player:not(.is-playing) .player-btn svg { margin-left: 2px; }
.player-bar {
  flex: 1; min-width: 0; height: 4px; margin: 0; padding: 0; border: 0; box-shadow: none; min-height: 0; border-radius: 99px; cursor: pointer;
  -webkit-appearance: none; appearance: none;
  background: linear-gradient(var(--accent), var(--accent)) 0 / var(--p) 100% no-repeat, color-mix(in srgb, var(--accent) 22%, transparent);
}
.player-bar:focus { box-shadow: none; }
.player-bar::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .25); }
.player-bar::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 2px solid #fff; }
.player-time { flex: none; font-size: 12px; font-weight: 600; min-width: 64px; text-align: right; }
.player .audio { display: none; }
.msg-user .player { background: rgba(255, 255, 255, .16); color: #fff; }
.msg-user .player-btn { background: #fff; color: var(--bubble-user); }
.msg-user .player-bar { background: linear-gradient(#fff, #fff) 0 / var(--p) 100% no-repeat, rgba(255, 255, 255, .3); }
.msg-user .player-bar::-webkit-slider-thumb { background: #fff; border-color: var(--bubble-user); }
.audio { display: block; width: 260px; max-width: 100%; height: 40px; margin-top: 8px; }

/* ───────────── modal ───────────── */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(8, 8, 24, .55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: fade .2s ease; }
.modal-card {
  position: relative; width: 100%; max-width: 600px; max-height: calc(100dvh - 32px); overflow-y: auto; background: var(--surface);
  border-radius: 22px; box-shadow: var(--shadow-lg); padding: 22px 18px; border: 1px solid var(--border); animation: rise .26s var(--ease);
}
.modal-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.modal-card h2 { font-size: 20px; padding-right: 8px; }
.modal-card .form-actions { margin-top: 24px; justify-content: flex-end; }
@media (min-width: 640px) { .modal-card { padding: 28px; } }

/* ───────────── toasts ───────────── */
.toasts { position: fixed; left: 16px; right: 16px; bottom: calc(var(--tabbar-h) + 20px + env(safe-area-inset-bottom)); z-index: 80; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 10px; max-width: 480px; padding: 12px 16px 12px 12px; border-radius: 16px;
  box-shadow: var(--shadow-lg); font-weight: 600; font-size: 14px; transition: opacity .3s, transform .3s; animation: rise .25s var(--ease);
}
.toast-icon { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; }
.toast-icon svg { width: 16px; height: 16px; }
.toast-ok { background: #15152E; color: #fff; }
.toast-ok .toast-icon { background: var(--teal); color: #fff; }
.toast-error { background: var(--danger); color: #fff; }
.toast-error .toast-icon { background: rgba(255, 255, 255, .2); }
.toast.out { opacity: 0; transform: translateY(8px); }
@media (prefers-color-scheme: dark) { .toast-ok { background: #ECECF6; color: #15152E; } }
@media (min-width: 900px) { .toasts { left: auto; right: 24px; bottom: 24px; align-items: flex-end; } }

/* ───────────── motion ───────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ───────────── main message (tagline) ───────────── */
.label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.counter { font-variant-numeric: tabular-nums; color: var(--faint); font-weight: 500; }
.counter.is-max { color: var(--warn-text); font-weight: 700; }
.field-tagline input { font-weight: 600; }
.wprev-tag { padding: 10px 12px 0; font: 700 13.5px/1.35 var(--font-head); color: var(--text); overflow-wrap: anywhere; }

/* ───────────── agent page card (install) ───────────── */
.agent-page { background:
  radial-gradient(70% 120% at 100% 0%, color-mix(in srgb, var(--teal) 12%, transparent), transparent 60%),
  linear-gradient(160deg, var(--accent-soft), var(--surface) 70%);
  border-color: color-mix(in srgb, var(--accent) 22%, var(--border)); }
.link-box { display: flex; align-items: center; min-height: 48px; padding: 10px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border-strong); font: 600 14px/1.4 var(--font-mono); color: var(--accent-text); }
.link-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.link-actions .btn { flex: 1 1 auto; }
.btn-wa { background: #25D366; color: #fff; box-shadow: 0 6px 16px rgba(37, 211, 102, .3); }
.btn-wa:hover { background: #1EBE5B; }
@media (min-width: 640px) { .link-actions .btn { flex: none; } }
.opt-label { display: flex; align-items: center; gap: 8px; margin: 4px 0 8px; font-weight: 600; font-size: 14px; color: var(--text-2); }
.code-box + .opt-label { margin-top: 18px; }
