/* ============================================================
   30X OS — Main Stylesheet  v3
   30X
   Pure Black + Lime Accent · Mobile-First · No Frameworks
   ============================================================ */

/* ── Design Tokens ─────────────────────────────────────────── */
:root {
  /* ── Palette ── */
  --c-bg:              #0a0a0a;
  --c-surface:         #111111;
  --c-surface-2:       #181818;
  --c-surface-3:       #222222;
  --c-border:          rgba(255,255,255,.08);
  --c-border-strong:   rgba(255,255,255,.14);

  /* ── Text ── */
  --c-text:            #ffffff;
  --c-text-muted:      #888888;
  --c-text-dim:        #444444;

  /* ── CTA ── */
  --c-cta-bg:          #ffffff;
  --c-cta-text:        #000000;

  /* ── Status ── */
  --c-success:         #4ade80;
  --c-danger:          #f87171;
  --c-info:            #60a5fa;
  --c-warn:            #facc15;

  /* ── 30X brand accent ── */
  --c-accent:          #e9ff7b;
  --c-accent-text:     #0a0a0a;

  /* ── Liquid glass ── */
  --glass-fill:         rgba(255,255,255,.045);
  --glass-fill-strong:  rgba(255,255,255,.075);
  --glass-border:       rgba(255,255,255,.09);
  --glass-highlight:    rgba(255,255,255,.16);
  --glass-blur:         22px;
  --glass-shadow:       0 8px 32px rgba(0,0,0,.45);

  /* ── Brand accent (VCard only — overridden inline per card) ── */
  --brand-primary:     #111111;
  --brand-accent:      #ffffff;

  /* ── Typography ── */
  --font-sans:         'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:         'JetBrains Mono', 'Fira Code', ui-monospace, monospace;

  /* ── Spacing ── */
  --sp-1:  .25rem;   /* 4px  */
  --sp-2:  .5rem;    /* 8px  */
  --sp-3:  .75rem;   /* 12px */
  --sp-4:  1rem;     /* 16px */
  --sp-5:  1.25rem;  /* 20px */
  --sp-6:  1.5rem;   /* 24px */
  --sp-8:  2rem;     /* 32px */
  --sp-10: 2.5rem;   /* 40px */
  --sp-12: 3rem;     /* 48px */
  --sp-16: 4rem;     /* 64px */

  /* ── Radii ── */
  --r-xs:   6px;
  --r-sm:   10px;
  --r-md:   16px;
  --r-lg:   24px;
  --r-xl:   32px;
  --r-pill: 9999px;

  /* ── Shadows ── */
  --shadow-card: 0 8px 40px rgba(0,0,0,.7);
  --shadow-btn:  0 2px 12px rgba(0,0,0,.6);

  /* ── Motion ── */
  --ease:   cubic-bezier(.4,0,.2,1);
  --dur:    160ms;

  /* ── Layout ── */
  --sidebar-w: 240px;
}

/* ── Reset ─────────────────────────────────────────────────── */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { max-width: 100%; overflow-x: hidden; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--c-bg);
  color: var(--c-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  line-height: 1.5;
  position: relative;
}
a { color: inherit; text-decoration: none; }
a:hover { opacity: .8; }
img, svg { display: block; max-width: 100%; }
button, input, textarea, select { font-family: inherit; }
button { cursor: pointer; }

/* ── Ambient background glow — gives the glass surfaces something to
   refract. Fixed so it doesn't move with scroll or with page content. ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(560px circle at 12% -8%,  color-mix(in srgb, var(--c-accent) 16%, transparent), transparent 60%),
    radial-gradient(520px circle at 108% 18%, rgba(129,140,248,.14), transparent 60%),
    radial-gradient(640px circle at 50% 115%, rgba(255,255,255,.05), transparent 60%);
}
.dash-layout, .auth-wrapper, .lead-gate, .vcard { position: relative; z-index: 1; }

/* ── Glass utility ── */
.glass-panel {
  background: var(--glass-fill);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(140%);
  backdrop-filter: blur(var(--glass-blur)) saturate(140%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-highlight);
}

/* ── Logo Component ─────────────────────────────────────────── */
.brand-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-align: center;
}
.brand-logo__wordmark {
  font-family: var(--font-sans);
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: -.03em;
  color: var(--c-text);
  line-height: 1;
  text-transform: uppercase;
}
.brand-logo__wordmark .brand-logo__x { color: var(--c-accent); }
.brand-logo__tagline {
  font-size: .6rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--c-text-dim);
  font-weight: 400;
}

/* Sidebar compact variant */
.sidebar .brand-logo           { flex-direction: row; align-items: center; gap: var(--sp-3); }
.sidebar .brand-logo__wordmark { font-size: 1.5rem; }
.sidebar .brand-logo__tagline  { display: none; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: .75rem 1.5rem;
  border-radius: var(--r-pill);
  font-size: .9375rem;
  font-weight: 600;
  border: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    transform var(--dur) var(--ease),
    opacity   var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.96); }

.btn--primary {
  background: var(--c-cta-bg);
  color: var(--c-cta-text);
  box-shadow: var(--shadow-btn);
}
.btn--primary:hover { opacity: .88; transform: translateY(-1px); }

.btn--accent {
  background: var(--c-accent);
  color: var(--c-accent-text);
  box-shadow: var(--shadow-btn);
}
.btn--accent:hover { opacity: .88; transform: translateY(-1px); }

.btn--ghost {
  background: transparent;
  color: var(--c-text-muted);
  border: 1px solid var(--c-border-strong);
}
.btn--ghost:hover { border-color: rgba(255,255,255,.3); color: var(--c-text); }

.btn--danger {
  background: var(--c-danger);
  color: #fff;
}

.btn--full { width: 100%; }
.btn--lg   { padding: 1rem 1.75rem; font-size: 1rem; }
.btn--sm   { padding: .45rem 1rem; font-size: .8125rem; }

/* ── Forms ──────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: var(--sp-2); }

.form-label {
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--c-text-muted);
}
.form-label--opt { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--c-text-dim); }

.form-input {
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  color: var(--c-text);
  padding: .75rem 1rem;
  font-size: .9375rem;
  width: 100%;
  outline: none;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  -webkit-appearance: none;
}
.form-input:focus {
  border-color: rgba(255,255,255,.3);
  box-shadow: 0 0 0 3px rgba(255,255,255,.06);
}
.form-input::placeholder { color: var(--c-text-dim); }

.form-textarea { resize: vertical; min-height: 72px; }

.form-checkbox {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-size: .875rem;
  color: var(--c-text-muted);
  cursor: pointer;
  user-select: none;
}
.form-checkbox input { width: 16px; height: 16px; accent-color: var(--c-text); }

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-5);
}
.form-grid--color { grid-template-columns: 1fr 1fr; }

/* Password wrapper */
.input-pw-wrap { position: relative; }
.input-pw-wrap .form-input { padding-right: 3rem; }
.btn-toggle-pw {
  position: absolute; right: .875rem; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--c-text-dim); padding: 0; display: flex; align-items: center;
}
.btn-toggle-pw:hover { color: var(--c-text-muted); }

/* Color pickers */
.color-picker-wrap { display: flex; align-items: center; gap: var(--sp-3); }
.color-native { width: 36px; height: 36px; border: none; border-radius: var(--r-sm); background: none; padding: 0; cursor: pointer; }
.color-hex { flex: 1; font-family: var(--font-mono); font-size: .875rem; }

/* Toggle switch */
.toggle-row {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4);
  padding: var(--sp-4) 0; border-bottom: 1px solid var(--c-border);
}
.toggle-row:last-child { border-bottom: none; }
.toggle-row__info { display: flex; flex-direction: column; gap: 3px; }
.toggle-row__title { font-size: .9375rem; font-weight: 500; }
.toggle-row__desc { font-size: .8rem; color: var(--c-text-muted); }

.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0;
  background: var(--c-surface-3);
  border-radius: var(--r-pill);
  cursor: pointer;
  border: 1px solid var(--c-border);
  transition: background var(--dur) var(--ease);
}
.toggle-slider::before {
  content: ''; position: absolute;
  width: 16px; height: 16px; left: 3px; bottom: 3px;
  background: var(--c-text-muted); border-radius: 50%;
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease);
}
.toggle-switch input:checked + .toggle-slider { background: var(--c-text); border-color: var(--c-text); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); background: var(--c-bg); }

/* ── Toast ──────────────────────────────────────────────────── */
.toast-container {
  position: fixed; top: var(--sp-5); right: var(--sp-5); z-index: 9999;
  display: flex; flex-direction: column; gap: var(--sp-3); max-width: 340px; width: calc(100vw - 2rem);
}
.toast {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-5);
  border-radius: var(--r-md);
  background: var(--c-surface-2);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(140%); backdrop-filter: blur(var(--glass-blur)) saturate(140%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-highlight);
  font-size: .875rem;
  animation: toastIn .2s var(--ease);
}
.toast--success { border-color: rgba(74,222,128,.3); }
.toast--danger  { border-color: rgba(248,113,113,.3); }
.toast--info    { border-color: rgba(96,165,250,.3); }
.toast__icon { font-size: 1rem; }
.toast--success .toast__icon { color: var(--c-success); }
.toast--danger  .toast__icon { color: var(--c-danger); }
.toast--info    .toast__icon { color: var(--c-info); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(16px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── Auth / Public Pages ─────────────────────────────────────── */
.auth-page {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--sp-6) var(--sp-4);
}

.auth-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-6);
  width: 100%;
  min-height: 100svh;
  padding: var(--sp-8) var(--sp-4) var(--sp-8);
  justify-content: center;
}

.auth-card {
  background: var(--glass-fill);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(140%);
  backdrop-filter: blur(var(--glass-blur)) saturate(140%);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-xl);
  padding: var(--sp-10) var(--sp-6);
  width: 100%;
  max-width: 420px;
  box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-highlight);
}
.auth-card--claim { text-align: center; }

.auth-card__header { text-align: center; margin-bottom: var(--sp-8); }

.auth-card__title {
  font-size: 1.625rem;
  font-weight: 700;
  letter-spacing: -.02em;
  margin-top: var(--sp-6);
  line-height: 1.2;
}
.auth-card__sub {
  font-size: .9rem;
  color: var(--c-text-muted);
  margin-top: var(--sp-2);
  line-height: 1.6;
}

.auth-form { display: flex; flex-direction: column; gap: var(--sp-5); }

.auth-card__footer-link {
  text-align: center;
  font-size: .875rem;
  color: var(--c-text-muted);
  margin-top: var(--sp-6);
}
.auth-card__footer-link a {
  color: var(--c-text);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-footer {
  font-size: .75rem;
  color: var(--c-text-dim);
  text-align: center;
}
.auth-footer strong { color: var(--c-text-muted); font-weight: 600; }

/* ── Claim page extras ── */
.claim-uuid-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-1);
  background: var(--c-bg);
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-pill);
  padding: var(--sp-3) var(--sp-6);
  margin: var(--sp-6) 0;
}
.claim-uuid-badge__label { font-size: .65rem; text-transform: uppercase; letter-spacing: .12em; color: var(--c-text-dim); }
.claim-uuid-badge__code  { font-family: var(--font-mono); font-size: .9rem; color: var(--c-text-muted); font-weight: 600; }

/* ── Dashboard Layout ────────────────────────────────────────── */
.dash-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100svh;
  transition: grid-template-columns .28s cubic-bezier(.4,0,.2,1);
}
.dash-layout.sidebar-collapsed { grid-template-columns: 64px 1fr; }

/* ── Sidebar ── */
.sidebar {
  background: var(--glass-fill);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(140%);
  backdrop-filter: blur(var(--glass-blur)) saturate(140%);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  padding: var(--sp-6) 0;
  position: sticky;
  top: 0;
  height: 100svh;
  overflow-y: auto;
}

.sidebar__brand {
  padding: 0 var(--sp-5) var(--sp-6);
  border-bottom: 1px solid var(--glass-border);
  margin-bottom: var(--sp-4);
}

.sidebar__nav { display: flex; flex-direction: column; gap: 2px; padding: 0 var(--sp-3); flex: 1; }

.sidebar__link {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: .625rem var(--sp-3);
  border-radius: var(--r-sm);
  font-size: .875rem; font-weight: 500;
  color: var(--c-text-muted);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.sidebar__link:hover { background: var(--glass-fill-strong); color: var(--c-text); opacity: 1; }
.sidebar__link--active { background: var(--glass-fill-strong); color: var(--c-text); font-weight: 600; box-shadow: inset 0 1px 0 var(--glass-highlight); }

.sidebar__preview-link {
  display: flex; align-items: center; gap: var(--sp-2);
  margin: var(--sp-4) var(--sp-3);
  padding: .625rem var(--sp-3);
  border-radius: var(--r-sm);
  border: 1px solid var(--glass-border);
  font-size: .8125rem; color: var(--c-text-muted);
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.sidebar__preview-link:hover { border-color: var(--glass-highlight); color: var(--c-text); opacity: 1; }

.sidebar__footer {
  text-align: center; font-size: .65rem; color: var(--c-text-dim);
  padding: var(--sp-4) var(--sp-4) 0; letter-spacing: .04em;
  margin-top: auto; border-top: 1px solid var(--glass-border); padding-top: var(--sp-4);
}
.sidebar__footer strong { color: var(--c-text-muted); }

/* ── Dashboard Main ── */
.dash-main { padding: var(--sp-8); overflow-y: auto; overflow-x: hidden; min-width: 0; max-width: 100%; box-sizing: border-box; }

.dash-header {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: var(--sp-4);
  margin-bottom: var(--sp-8);
}
.dash-header__title { font-size: 1.5rem; font-weight: 700; letter-spacing: -.02em; }
.dash-header__sub { color: var(--c-text-muted); font-size: .9375rem; margin-top: 4px; }

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-4);
  margin-bottom: var(--sp-8);
}
.stat-card {
  background: var(--glass-fill);
  -webkit-backdrop-filter: blur(var(--glass-blur)); backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: .6rem .85rem;
  display: flex; align-items: center; gap: .6rem;
  transition: border-color var(--dur) var(--ease);
  box-shadow: inset 0 1px 0 var(--glass-highlight);
}
.stat-card:hover { border-color: var(--glass-highlight); }
.stat-card__icon {
  width: 26px; height: 26px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  background: var(--glass-fill-strong);
  color: var(--c-text-muted);
}
.stat-card__body { display: flex; flex-direction: column; gap: 0; }
.stat-card__value { font-size: 1.1rem; font-weight: 600; line-height: 1.1; }
.stat-card__value--sm { font-size: 1rem; }
.stat-card__value--badge {
  font-size: .7rem; font-weight: 700; padding: 3px 10px;
  border-radius: var(--r-pill); width: fit-content; letter-spacing: .05em; text-transform: uppercase;
}
.stat-card__value--badge.active   { background: rgba(74,222,128,.12); color: var(--c-success); }
.stat-card__value--badge.inactive { background: rgba(248,113,113,.12); color: var(--c-danger); }
.stat-card__label { font-size: .69rem; color: var(--c-text-dim); font-weight: 500; text-transform: uppercase; letter-spacing: .03em; }
.kpi-delta { display: inline-flex; align-items: center; gap: .15rem; font-size: .65rem; font-weight: 500; margin-top: 0; }
.kpi-delta--up   { color: #22c55e; }
.kpi-delta--down { color: #f87171; }

/* Two-column grid (chart + QR) */
.dash-two-col {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--sp-6); margin-bottom: var(--sp-8);
  align-items: stretch;
}
.dash-two-col .dash-section { margin-bottom: 0; display: flex; flex-direction: column; padding: 0; background: none; border: none; }

/* Section */
.dash-section { margin-bottom: var(--sp-8); }
.dash-section__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-5); }
.dash-section__title { font-size: .875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--c-text-muted); margin-bottom: var(--sp-4); }
.dash-section__header .dash-section__title { margin-bottom: 0; }

/* Activity card — same visual style as QR card */
.act-card {
  background: var(--glass-fill);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(140%); backdrop-filter: blur(var(--glass-blur)) saturate(140%);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg); padding: var(--sp-5);
  height: 100%; box-sizing: border-box; display: flex; flex-direction: column;
  max-width: 100%; overflow: hidden;
  box-shadow: inset 0 1px 0 var(--glass-highlight);
}
.act-card canvas { max-width: 100% !important; height: auto !important; }

/* QR Card */
.qr-card {
  display: flex; gap: var(--sp-5); align-items: flex-start;
  background: var(--glass-fill);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(140%); backdrop-filter: blur(var(--glass-blur)) saturate(140%);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg); padding: var(--sp-5);
  max-width: 100%; box-sizing: border-box; overflow: hidden;
  box-shadow: inset 0 1px 0 var(--glass-highlight);
}
.qr-card__code {
  flex-shrink: 0; width: 110px; height: 110px;
  background: #fff; border-radius: var(--r-sm);
  padding: 5px; display: flex; align-items: center; justify-content: center;
}
.qr-svg { width: 100%; height: 100%; }
.qr-card__body { display: flex; flex-direction: column; gap: var(--sp-3); min-width: 0; }
.qr-card__label { font-size: .8rem; color: var(--c-text-muted); line-height: 1.5; }
.qr-card__url {
  display: block; font-family: var(--font-mono); font-size: .7rem;
  color: var(--c-text-dim); background: var(--c-bg);
  border-radius: var(--r-xs); padding: var(--sp-2) var(--sp-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  border: 1px solid var(--c-border);
}
.qr-card__actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; }

/* Tables */
.table-wrap {
  background: var(--glass-fill);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(140%); backdrop-filter: blur(var(--glass-blur)) saturate(140%);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg); overflow: hidden; overflow-x: auto;
  box-shadow: inset 0 1px 0 var(--glass-highlight);
}
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead { background: var(--glass-fill-strong); }
.data-table th {
  padding: .45rem .85rem; text-align: left;
  font-size: .65rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--c-text-dim); border-bottom: 1px solid var(--glass-border); font-weight: 600;
}
.data-table td {
  padding: .55rem .85rem; font-size: .8rem;
  border-bottom: 1px solid var(--glass-border); vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background .1s; }
.data-table tbody tr:hover { background: var(--glass-fill-strong); }
.data-table tbody tr:hover td:first-child { border-left: 2px solid var(--c-accent); padding-left: calc(.85rem - 2px); }
.data-table tbody tr[data-hidden] { display: none; }
.td-muted { color: var(--c-text-muted); }
.td-message { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--c-text-muted); }
.data-table a { color: var(--c-text); text-decoration: underline; text-underline-offset: 2px; }
/* Vivid score badges */
.score-badge { display:inline-flex;align-items:center;font-size:.7rem;font-weight:700;padding:.18rem .55rem;border-radius:20px; }
.score-badge--high { background:rgba(52,211,153,.18);color:#34d399; }
.score-badge--mid  { background:rgba(251,191,36,.18);color:#fbbf24; }
.score-badge--low  { background:rgba(248,113,113,.18);color:#f87171; }
/* Copy-email flash */
.copy-email-flash { animation: emailFlash .5s ease; }
@keyframes emailFlash { 0%,100%{color:var(--c-text)} 50%{color:var(--c-accent)} }

/* Empty state */
.empty-state {
  text-align: center; padding: var(--sp-12) var(--sp-8);
  color: var(--c-text-muted);
  background: var(--glass-fill); border: 1px solid var(--glass-border); border-radius: var(--r-lg);
}
.empty-state svg { margin: 0 auto var(--sp-4); opacity: .25; }
.empty-state p { margin-bottom: var(--sp-2); }
.empty-state a { color: var(--c-text); text-decoration: underline; }

/* Settings */
.settings-form { display: flex; flex-direction: column; gap: var(--sp-5); }
.settings-card {
  background: var(--glass-fill);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(140%); backdrop-filter: blur(var(--glass-blur)) saturate(140%);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg); padding: var(--sp-6);
  box-shadow: inset 0 1px 0 var(--glass-highlight);
}
.settings-card__title {
  font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: var(--c-text-muted); margin-bottom: var(--sp-5);
  padding-bottom: var(--sp-4); border-bottom: 1px solid var(--glass-border);
}
.settings-actions { display: flex; gap: var(--sp-3); }

/* Avatar upload */
.avatar-upload-row { display: flex; align-items: center; gap: var(--sp-5); }
.avatar-upload-preview {
  width: 76px; height: 76px; border-radius: 50%;
  background: var(--c-surface-2); border: 1px solid var(--c-border-strong);
  overflow: hidden; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.avatar-upload-preview img { width: 100%; height: 100%; object-fit: cover; }
.avatar-upload-preview__initials { font-size: 1.75rem; font-weight: 700; color: var(--c-text); }
.avatar-upload-info { display: flex; flex-direction: column; gap: var(--sp-2); }
.avatar-file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.avatar-upload-hint { font-size: .75rem; color: var(--c-text-dim); }
.avatar-upload-hint--current { color: var(--c-success); }

/* ── VCard ───────────────────────────────────────────────────── */
.vcard-page {
  background: #0f0f17;
  min-height: 100svh;
  display: flex; justify-content: center;
}
.vcard-light.vcard-page { background: #f5f5f0; }
.vcard {
  width: 100%; max-width: 430px;
  height: 100svh;
  display: flex; flex-direction: column; align-items: center;
  justify-content: space-between;
  padding: 4vh var(--sp-4) 3vh;
  position: relative; overflow: hidden;
}
.vcard__glow {
  position: absolute; top: -60px; left: 50%; transform: translateX(-50%);
  width: 220px; height: 220px;
  background: radial-gradient(circle, var(--brand-accent) 0%, transparent 70%);
  opacity: .07; pointer-events: none;
}
.vcard__hero { text-align: center; position: relative; z-index: 1; width: 100%; }
.vcard__avatar-wrap { position: relative; display: inline-block; margin-bottom: 1.5vh; }
.vcard__avatar {
  width: 18vw; height: 18vw; max-width: 96px; max-height: 96px; min-width: 72px; min-height: 72px;
  border-radius: 50%; object-fit: cover;
  border: 2px solid rgba(255,255,255,.15);
}
.vcard__avatar--initials {
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.08);
  color: #fff; font-size: clamp(1.1rem, 3vw, 1.6rem); font-weight: 700;
}
.vcard__avatar-ring {
  position: absolute; inset: -5px; border-radius: 50%;
  border: 1px solid var(--brand-accent);
  opacity: .35; animation: pulse-ring 3s ease infinite;
}
@keyframes pulse-ring {
  0%,100% { transform: scale(1); opacity: .35; }
  50%      { transform: scale(1.06); opacity: .1; }
}
.vcard__name    { font-size: clamp(1.1rem, 4.5vw, 1.5rem); font-weight: 700; letter-spacing: -.02em; color: #fff; line-height: 1.1; }
.vcard__title   { font-size: clamp(.75rem, 2.5vw, .9rem); color: rgba(255,255,255,.55); margin-top: .25vh; }
.vcard__company { display: inline-flex; align-items: center; gap: 4px; font-size: clamp(.68rem, 2vw, .8rem); color: rgba(255,255,255,.45); margin-top: .2vh; }
.btn-save-contact {
  display: flex; align-items: center; justify-content: center; gap: .4rem;
  width: calc(100% - 2rem); padding: 1.4vh var(--sp-4);
  background: var(--brand-accent);
  color: #fff; border-radius: var(--r-pill);
  font-weight: 700; font-size: clamp(.8rem, 2.5vw, .95rem);
  transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease);
  position: relative; z-index: 1;
  box-shadow: 0 4px 20px color-mix(in srgb, var(--brand-accent) 40%, transparent);
}
.btn-save-contact:hover { opacity: .88; transform: translateY(-1px); }
.btn-save-contact:active { transform: scale(.97); }
.vcard__links {
  display: flex; flex-direction: column; gap: 1vh;
  width: 100%; padding: 0 1rem; position: relative; z-index: 1;
}
.vcard__link {
  display: flex; align-items: center; gap: .65rem;
  padding: 1.2vh 1.1rem;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--r-md); color: #fff;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
  backdrop-filter: blur(4px);
}
.vcard__link:hover {
  background: color-mix(in srgb, var(--brand-accent) 15%, transparent);
  border-color: color-mix(in srgb, var(--brand-accent) 50%, transparent);
  transform: translateX(3px); opacity: 1;
}
.vcard__link-icon {
  width: 28px; height: 28px; border-radius: 5px;
  background: color-mix(in srgb, var(--brand-accent) 20%, transparent);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.vcard__link-label { flex: 1; font-size: clamp(.78rem, 2.2vw, .9rem); font-weight: 500; }
.vcard__link-arrow { color: color-mix(in srgb, var(--brand-accent) 60%, transparent); flex-shrink: 0; }
.vcard__footer { text-align: center; position: relative; z-index: 1; }
.vcard__footer-brand { font-size: .68rem; color: rgba(255,255,255,.25); }
.vcard__footer-brand strong { color: rgba(255,255,255,.4); font-weight: 600; }
.vcard__footer-brand:hover { opacity: .6; }

/* ── Light theme overrides ───────────────────────────────────── */
.vcard-light .vcard-page,
.vcard-light { background: #f5f5f0; }
.vcard-light .vcard { background: #ffffff; box-shadow: 0 2px 32px rgba(0,0,0,.10); }
.vcard-light .vcard__glow { display: none; }
.vcard-light .vcard__name    { color: #111111; }
.vcard-light .vcard__title   { color: rgba(0,0,0,.55); }
.vcard-light .vcard__company { color: rgba(0,0,0,.45); }
.vcard-light .vcard__avatar-ring { border-color: rgba(0,0,0,.12); }
.vcard-light .vcard__link {
  background: rgba(0,0,0,.04);
  border: 1px solid rgba(0,0,0,.10);
  color: #111111;
}
.vcard-light .vcard__link:hover { background: rgba(0,0,0,.08); border-color: rgba(0,0,0,.18); }
.vcard-light .vcard__link-icon { background: color-mix(in srgb, var(--brand-accent) 15%, transparent); }
.vcard-light .vcard__link-arrow { color: color-mix(in srgb, var(--brand-accent) 60%, transparent); }
.vcard-light .vcard__footer-brand { color: rgba(0,0,0,.35); }
.vcard-light .vcard__footer-brand strong { color: rgba(0,0,0,.5); }

/* ── Lead Gate ───────────────────────────────────────────────── */
.lead-gate {
  width: 100%; max-width: 430px; min-height: 100svh;
  display: flex; flex-direction: column;
  padding: var(--sp-10) var(--sp-5) var(--sp-8); margin: 0 auto;
}
.lead-gate__header { text-align: center; margin-bottom: var(--sp-6); }
.lead-gate__avatar {
  width: 76px; height: 76px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.15); margin: 0 auto var(--sp-4); object-fit: cover;
}
.lead-gate__avatar--initials {
  width: 76px; height: 76px; border-radius: 50%;
  background: var(--c-surface-3); color: var(--c-text);
  font-size: 1.75rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; margin: 0 auto var(--sp-4);
}
.lead-gate__name  { font-size: 1.375rem; font-weight: 700; }
.lead-gate__title { font-size: .875rem; color: rgba(255,255,255,.5); margin-top: 4px; }

.lead-gate__body {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--r-xl); padding: var(--sp-6); backdrop-filter: blur(8px);
}
.lead-gate__intro { font-size: .9375rem; color: rgba(255,255,255,.6); margin-bottom: var(--sp-6); line-height: 1.6; }
.lead-form { display: flex; flex-direction: column; gap: var(--sp-4); }
.lead-form .form-input { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.1); }
.lead-form .form-input:focus { border-color: rgba(255,255,255,.3); box-shadow: 0 0 0 3px rgba(255,255,255,.05); }
.lead-gate__skip { display: block; text-align: center; margin-top: var(--sp-4); font-size: .8125rem; color: rgba(255,255,255,.3); }
.lead-gate__skip:hover { color: rgba(255,255,255,.5); }

/* ── Responsive ──────────────────────────────────────────────── */

/* Tablet / large phone → wider cards, 2-col form grid */
@media (min-width: 600px) {
  .form-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Full desktop */
@media (min-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
  .dash-main { padding: var(--sp-10) var(--sp-10); }
}

/* Mobile: bottom nav bar (hidden by default, shown ≤767px below) */
.mobile-bottom-nav { display: none; }
.mobile-nav-sheet { display: none; }

@media (max-width: 767px) {
  /* Scale down the whole rem-based type/spacing system on mobile —
     shrinks text, padding and card sizes together in one lever. */
  html { font-size: 14px; }

  .dash-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    min-height: 100svh;
  }

  /* Hide sidebar entirely — replaced by bottom nav */
  .sidebar { display: none; }

  .stats-grid { gap: .5rem; margin-bottom: 1.25rem; }
  .stat-card { padding: .5rem .6rem; gap: .45rem; border-radius: 7px; }
  .stat-card__icon { width: 26px; height: 26px; border-radius: 5px; }
  .stat-card__icon svg { width: 16px; height: 16px; }
  .stat-card__value { font-size: .92rem; }
  .stat-card__value--sm { font-size: .78rem; }
  .stat-card__label { font-size: .6rem; }
  .dash-header__title { font-size: 1.25rem; }
  .settings-card { padding: .85rem; }

  /* Bottom navigation bar */
  .dash-layout::after {
    content: '';
    display: block;
    height: 64px; /* spacer so content doesn't hide behind bottom nav */
  }

  /* Bottom nav bar */
  .mobile-bottom-nav {
    display: flex;
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 200;
    background: var(--c-surface-2);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(140%); backdrop-filter: blur(var(--glass-blur)) saturate(140%);
    border-top: 1px solid var(--glass-border);
    align-items: flex-start;
    height: calc(60px + max(env(safe-area-inset-bottom, 0px), 20px));
    padding-top: 6px;
    box-sizing: border-box;
  }
  .mobile-bottom-nav a {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 3px;
    font-size: .6rem; font-weight: 500; letter-spacing: .03em;
    color: var(--c-text-muted); text-transform: uppercase;
    transition: color .15s;
  }
  .mobile-bottom-nav a svg { flex-shrink: 0; }
  .mobile-bottom-nav a.active,
  .mobile-bottom-nav a:hover { color: var(--c-text); opacity: 1; }
  .mobile-bottom-nav a.active svg { stroke: var(--c-accent, #6366f1); }

  /* "Más" overflow sheet */
  .mobile-nav-sheet { display: block; position: fixed; inset: 0; z-index: 300; pointer-events: none; }
  .mobile-nav-sheet__backdrop {
    position: absolute; inset: 0; background: rgba(0,0,0,.55);
    opacity: 0; transition: opacity .2s;
  }
  .mobile-nav-sheet__panel {
    position: absolute; left: 0; right: 0; bottom: 0;
    background: var(--c-surface-2);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(140%); backdrop-filter: blur(var(--glass-blur)) saturate(140%);
    border-top: 1px solid var(--glass-border);
    border-radius: 16px 16px 0 0;
    padding: .5rem 1rem calc(1.25rem + max(env(safe-area-inset-bottom, 0px), 20px));
    display: grid; grid-template-columns: 1fr 1fr; gap: .25rem .75rem;
    transform: translateY(100%);
    transition: transform .25s ease;
    box-sizing: border-box;
    max-height: 70vh; overflow-y: auto;
  }
  .mobile-nav-sheet__handle {
    grid-column: 1 / -1;
    width: 36px; height: 4px; border-radius: 2px;
    background: var(--c-border); margin: .6rem auto .5rem;
  }
  .mobile-nav-sheet.open { pointer-events: auto; }
  .mobile-nav-sheet.open .mobile-nav-sheet__backdrop { opacity: 1; }
  .mobile-nav-sheet.open .mobile-nav-sheet__panel { transform: translateY(0); }
  .mobile-nav-sheet__link {
    display: flex; align-items: center; gap: .6rem;
    padding: .7rem .5rem; border-radius: 10px;
    font-size: .82rem; font-weight: 600; color: var(--c-text);
    text-decoration: none;
  }
  .mobile-nav-sheet__link:hover { background: var(--c-bg); }
  .mobile-nav-sheet__link svg { flex-shrink: 0; color: var(--c-text-muted); }

  .dash-main {
    padding: calc(1rem + env(safe-area-inset-top, 0px)) 1rem calc(76px + max(env(safe-area-inset-bottom, 0px), 20px));
    width: 100vw;
    max-width: 100vw;
    min-width: 0;
    overflow-x: hidden;
    box-sizing: border-box;
  }
  .dash-main > * {
    width: 100%;
    max-width: calc(100vw - 2rem);
    box-sizing: border-box;
  }
  .dash-header {
    position: sticky; top: 0; z-index: 10;
    background: var(--c-bg, #0f0f17);
    padding-top: .75rem;
    margin-bottom: 1rem;
  }
  .dash-two-col {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 1rem;
    width: 100%;
  }
  .dash-two-col > * {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  .act-card, .qr-card, .settings-card {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    overflow: hidden;
  }
  .act-card canvas { width: 100% !important; max-width: 100% !important; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid--color { grid-template-columns: 1fr; }
  .qr-card { flex-direction: column !important; align-items: center !important; text-align: center !important; width: 100% !important; box-sizing: border-box !important; }
  .qr-card__body { width: 100% !important; min-width: 0 !important; box-sizing: border-box !important; }
  .qr-card__url { white-space: normal !important; word-break: break-all !important; width: 100% !important; box-sizing: border-box !important; }
  .qr-card__actions { justify-content: center !important; }
  .settings-card { padding: .85rem; }
}

/* Small phones */
@media (max-width: 420px) {
  .auth-card { padding: var(--sp-8) var(--sp-5); border-radius: var(--r-lg); }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .qr-card { flex-direction: column !important; align-items: center !important; text-align: center !important; width: 100% !important; box-sizing: border-box !important; }
  .qr-card__body { width: 100% !important; min-width: 0 !important; box-sizing: border-box !important; }
  .qr-card__url { white-space: normal !important; word-break: break-all !important; width: 100% !important; box-sizing: border-box !important; }
  .qr-card__actions { justify-content: center !important; }
  .brand-logo__wordmark { font-size: 2.2rem; }
  .vcard__name { font-size: 1.5rem; }
}

/* ── Admin Badge ─────────────────────────────────────────────── */
.admin-badge {
  display: inline-flex; align-items: center; gap: .35rem; padding: 4px 12px;
  background: rgba(250,204,21,.1); border: 1px solid rgba(250,204,21,.3);
  color: var(--c-warn); border-radius: var(--r-pill);
  font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  flex-shrink: 0;
}

/* ── Settings Tabs ───────────────────────────────────────────── */
.settings-tabs {
  display: flex; gap: 2px; margin-bottom: var(--sp-6);
  background: var(--glass-fill); border: 1px solid var(--glass-border);
  border-radius: var(--r-lg); padding: 4px;
}
.settings-tab {
  flex: 1; text-align: center; padding: .5rem 1rem;
  border-radius: calc(var(--r-lg) - 4px);
  font-size: .875rem; font-weight: 500;
  color: var(--c-text-muted);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
  cursor: pointer;
}
.settings-tab:hover { color: var(--c-text); opacity: 1; }
.settings-tab--active { background: var(--glass-fill-strong); color: var(--c-text); font-weight: 600; box-shadow: inset 0 1px 0 var(--glass-highlight); }

/* ── Integration settings ────────────────────────────────────── */
.integration-badge {
  display: inline-flex; align-items: center; margin-left: var(--sp-3);
  padding: 2px 10px; border-radius: var(--r-pill);
  font-size: .7rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  background: rgba(255,255,255,.06); color: var(--c-text-dim); border: 1px solid var(--c-border);
}
.integration-badge--ok {
  background: rgba(74,222,128,.1); color: var(--c-success); border-color: rgba(74,222,128,.25);
}
.integration-section { margin-top: var(--sp-4); }
.settings-hint { font-size: .82rem; color: var(--c-text-muted); margin-bottom: var(--sp-4); line-height: 1.5; }

/* ── Radio group ─────────────────────────────────────────────── */
.radio-group { display: flex; gap: var(--sp-4); flex-wrap: wrap; }
.radio-option {
  display: flex; align-items: center; gap: var(--sp-2);
  padding: .6rem 1rem;
  background: var(--c-surface-2); border: 1px solid var(--c-border);
  border-radius: var(--r-sm); cursor: pointer;
  font-size: .875rem;
  transition: border-color var(--dur) var(--ease);
}
.radio-option:has(input:checked) { border-color: rgba(255,255,255,.3); color: var(--c-text); }
.radio-option input { accent-color: var(--c-text); }
.radio-option small { color: var(--c-text-muted); font-size: .78rem; }

/* ── AI Provider buttons ──────────────────────────────────────── */
.provider-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .4rem; padding: .75rem .5rem; border-radius: 10px;
  border: 1px solid var(--c-border); background: transparent;
  color: var(--c-text-muted); cursor: pointer; font-size: .72rem; font-weight: 600;
  transition: border-color .15s, color .15s, background .15s;
}
.provider-btn:hover { border-color: rgba(255,255,255,.25); color: var(--c-text); background: rgba(255,255,255,.04); }
.provider-btn--active {
  border-color: var(--c-accent); color: var(--c-text);
  background: rgba(99,102,241,.12);
}
.provider-btn svg { opacity: .7; }
.provider-btn--active svg { opacity: 1; }
.provider-btn--offline { text-align: left; }
.provider-btn--offline:hover { border-color: rgba(99,102,241,.4); background: rgba(99,102,241,.05); }
.provider-btn--offline.provider-btn--active { border-color: var(--c-accent); background: rgba(99,102,241,.12); }

/* ── Leads filter bar ────────────────────────────────────────── */
.leads-filter { margin-bottom: var(--sp-5); }
.filter-row {
  display: flex; gap: var(--sp-2); flex-wrap: wrap; align-items: center;
}
.filter-search {
  position: relative; flex: 1; min-width: 200px;
}
.filter-search svg {
  position: absolute; left: .875rem; top: 50%; transform: translateY(-50%);
  color: var(--c-text-dim); pointer-events: none;
}
.filter-search .form-input { padding-left: 2.5rem; }
.filter-date { width: 145px; flex-shrink: 0; }

/* ── Expandable text ─────────────────────────────────────────── */
.td-expandable { max-width: 200px; }
.td-notes { max-width: 200px; }
.expandable-text { display: block; }
.expandable-text__short { color: var(--c-text-muted); font-size: .875rem; }
.expandable-text__full { color: var(--c-text); font-size: .875rem; line-height: 1.5; white-space: pre-wrap; }
.expand-btn {
  display: inline; background: none; border: none; cursor: pointer;
  color: var(--c-text-dim); font-size: .8rem; padding: 0 2px;
  font-family: inherit;
}
.expand-btn:hover { color: var(--c-text); }

/* ── Notes cell ──────────────────────────────────────────────── */
.notes-cell { min-width: 140px; }
.notes-display { cursor: pointer; min-height: 1.5rem; display: block; }
.notes-display:hover { opacity: .8; }
.notes-empty { color: var(--c-text-dim); font-size: .8rem; }
.notes-editor { display: block; width: 100%; min-width: 160px; }
.notes-actions { display: flex; gap: var(--sp-2); margin-top: var(--sp-2); }

/* ── Modal ───────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.75);
  z-index: 9000; display: flex; align-items: center; justify-content: center;
  padding: var(--sp-4); backdrop-filter: blur(4px);
}
.modal {
  background: var(--c-surface-2);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(140%); backdrop-filter: blur(var(--glass-blur)) saturate(140%);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-xl); width: 100%; max-width: 640px;
  box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-highlight); max-height: 90vh; overflow-y: auto;
}
.modal--wide { max-width: 860px; }
.modal__header {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: var(--sp-6) var(--sp-6) 0;
  gap: var(--sp-4);
}
.modal__title { font-size: 1.125rem; font-weight: 700; }
.modal__sub { font-size: .8rem; color: var(--c-text-muted); margin-top: 4px; }
.modal__close {
  background: none; border: none; color: var(--c-text-muted); font-size: 1.1rem;
  cursor: pointer; flex-shrink: 0; padding: 0;
}
.modal__close:hover { color: var(--c-text); }
.modal__body { padding: var(--sp-6); }

/* Modal tabs */
.modal-tabs {
  display: flex; gap: 2px; margin: var(--sp-5) var(--sp-6) 0;
  border-bottom: 1px solid var(--c-border);
}
.modal-tab {
  padding: .5rem 1.25rem; background: none; border: none; cursor: pointer;
  font-size: .875rem; font-weight: 500; color: var(--c-text-muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.modal-tab:hover { color: var(--c-text); }
.modal-tab--active { color: var(--c-text); border-bottom-color: var(--c-text); font-weight: 600; }

/* Modal panels */
.modal-panel { padding: var(--sp-6); }
.modal-two-col {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-5);
}
.modal-col { display: flex; flex-direction: column; gap: var(--sp-3); }

/* INTELLI thinking animation */
.intelli-thinking {
  display: flex; align-items: center; gap: var(--sp-2);
  color: var(--c-text-muted); font-size: .85rem;
  margin-top: var(--sp-2);
}
.thinking-dot {
  display: inline-block; width: 8px; height: 8px;
  border-radius: 50%; background: var(--c-info);
  animation: thinkPulse 1.2s ease-in-out infinite;
}
@keyframes thinkPulse {
  0%,100% { opacity: .3; transform: scale(.8); }
  50%      { opacity: 1; transform: scale(1.2); }
}

@media (max-width: 640px) {
  .modal-two-col { grid-template-columns: 1fr; }
  .modal { max-width: 100%; border-radius: var(--r-lg); }
  .filter-date { width: 100%; }
  .filter-row { flex-direction: column; }
  .filter-search { width: 100%; }
}

/* ── Pagination ───────────────────────────────────────────────── */
.pagination {
  display: flex; align-items: center; justify-content: center; gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-top: 1px solid var(--c-border);
}
.pagination__btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: var(--r-sm);
  background: var(--c-surface-2); border: 1px solid var(--c-border);
  color: var(--c-text-muted);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.pagination__btn:hover { background: var(--c-surface-3); color: var(--c-text); opacity: 1; }
.pagination__btn--disabled { opacity: .3; pointer-events: none; }
.pagination__info { font-size: .8125rem; color: var(--c-text-muted); white-space: nowrap; }

/* ═══════════════════════════════════════════════════════════════
   MOBILE RESPONSIVE — comprehensive improvements
   Mobile-first: styles above are base; overrides below fix desktop-
   -only assumptions that break on phones.
═══════════════════════════════════════════════════════════════ */

/* ── Dash header: stack title + action button on small screens ── */
@media (max-width: 600px) {
  .dash-header {
    flex-direction: column;
    align-items: stretch;
    gap: var(--sp-3);
  }
  .dash-header .btn { width: 100%; justify-content: center; }
}

/* ── Settings tabs: horizontal scroll on mobile ────────────────── */
@media (max-width: 600px) {
  .settings-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }
  .settings-tabs::-webkit-scrollbar { display: none; }
  .settings-tab { flex: 0 0 auto; white-space: nowrap; }
}

/* ── Table: mobile card layout ─────────────────────────────────── */
/* On mobile, generic tables still stack as label:value rows (default). */
@media (max-width: 767px) {
  .table-wrap { border-radius: var(--r-md); }

  .data-table { display: block; }
  .data-table thead { display: none; }
  .data-table tbody { display: block; }
  .data-table tr {
    display: block;
    border-bottom: 1px solid var(--c-border);
    padding: var(--sp-4) var(--sp-4);
  }
  .data-table tr:last-child { border-bottom: none; }
  .data-table tbody tr:hover { background: var(--c-surface-2); }

  .data-table td {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-3);
    padding: var(--sp-1) 0;
    border-bottom: none;
    font-size: .875rem;
  }
  .data-table td[data-label]::before {
    content: attr(data-label);
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--c-text-dim);
    min-width: 80px;
    flex-shrink: 0;
    padding-top: 2px;
  }
}

/* ── Leads table: purpose-built card layout (not generic label:value) ──
   Every field that was hidden before (Score, Follow-On, Outreach) is now
   visible — nothing that exists on desktop disappears on mobile. */
@media (max-width: 767px) {
  #leadsTable tr {
    display: flex; flex-wrap: wrap; align-items: flex-start;
    gap: .35rem .6rem;
    padding: .85rem .9rem;
    border-radius: 12px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    margin-bottom: .6rem;
  }
  #leadsTable td { padding: 0; }
  #leadsTable td[data-label]::before { content: none; }   /* card layout: no generic label prefix */

  #leadsTable .td-check { order: 1; flex: 0 0 auto; }
  #leadsTable .td-index { display: none; }

  #leadsTable .td-name {
    order: 2; flex: 1 1 auto; min-width: 0;
    font-size: .92rem;
  }
  #leadsTable .td-name strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  #leadsTable .td-score { order: 3; flex: 0 0 auto; }

  #leadsTable .td-email {
    order: 4; flex: 1 1 100%;
    font-size: .78rem; color: var(--c-text-muted);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }

  #leadsTable .td-phone, #leadsTable .td-event, #leadsTable .td-date, #leadsTable .td-outreach {
    order: 5; flex: 0 0 auto;
    font-size: .72rem; color: var(--c-text-muted);
    background: var(--c-bg); border: 1px solid var(--c-border);
    border-radius: 20px; padding: .15rem .55rem;
  }
  #leadsTable .td-phone:empty, #leadsTable .td-event:empty { display: none; }

  #leadsTable .td-msg, #leadsTable .td-notes {
    order: 6; flex: 1 1 100%;
    font-size: .8rem; max-width: none;
    padding-top: .3rem; border-top: 1px dashed var(--c-border); margin-top: .3rem;
  }

  #leadsTable .td-ia { order: 7; flex: 1 1 100%; margin-top: .4rem; }
  .followon-btn { width: 100%; justify-content: center; }
}

/* ── Modal: bottom sheet on mobile ───────────────────────────── */
@media (max-width: 767px) {
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .modal {
    border-radius: 20px 20px 0 0;
    max-height: 92svh;
    width: 100%;
    max-width: 100%;
  }
  .modal--wide { max-width: 100%; }
  .modal__header { padding: 1.1rem 1rem 0; }
  .modal__body { padding: .75rem 1rem; }
  .modal-panel { padding: .75rem 1rem 1rem; }
  .modal-tabs { margin: .75rem 1rem 0; gap: .25rem; }
  .modal-tab { font-size: .8rem; padding: .5rem .6rem; }
  .modal-two-col {
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem;
  }
  .modal-col { gap: .5rem; }
  /* Shrink textareas so both fit on screen */
  #emailObservations, #waObservations { rows: 3; height: 80px; resize: vertical; }
  #emailMessage, #waMessage { rows: 5; height: 120px; resize: vertical; }
  /* Add a drag handle indicator */
  .modal::before {
    content: '';
    display: block;
    width: 36px; height: 4px;
    background: var(--c-border-strong);
    border-radius: 2px;
    margin: .65rem auto 0;
  }
}

/* ── Sidebar mobile: show icon + truncate long labels ─────────── */
@media (max-width: 767px) {
  .sidebar__link svg { display: inline-block; flex-shrink: 0; }
  .sidebar__link {
    font-size: .8125rem;
    padding: var(--sp-2) var(--sp-2);
    gap: var(--sp-2);
  }
}

/* ── Filter actions: stack on mobile ─────────────────────────── */
@media (max-width: 500px) {
  .filter-row .btn { width: 100%; }
  .leads-filter { margin-bottom: var(--sp-4); }
}

/* ── QR card: full-width on very small ────────────────────────── */
@media (max-width: 380px) {
  .qr-card { flex-direction: column !important; align-items: center !important; text-align: center !important; width: 100% !important; box-sizing: border-box !important; }
  .qr-card__body { width: 100% !important; min-width: 0 !important; box-sizing: border-box !important; }
  .qr-card__url { white-space: normal !important; word-break: break-all !important; width: 100% !important; box-sizing: border-box !important; }
  .qr-card__actions { justify-content: center !important; }
  .qr-card__code { width: 140px; height: 140px; }
  .qr-card__actions { justify-content: center; }
}

/* ── Stats cards: always 2 columns (no 1-col fallback) ─────────── */
@media (max-width: 380px) {
  .stat-card { padding: .45rem .55rem; }
  .stat-card__value { font-size: .85rem; }
  .stat-card__icon { width: 22px; height: 22px; }
  .stat-card__icon svg { width: 14px; height: 14px; }
}

/* ── Settings form actions: stack buttons ─────────────────────── */
@media (max-width: 500px) {
  .settings-actions { flex-direction: column; }
  .settings-actions .btn { width: 100%; justify-content: center; }
}

/* ── Radio group: stack vertically on mobile ──────────────────── */
@media (max-width: 500px) {
  .radio-group { flex-direction: column; gap: var(--sp-2); }
  .radio-option { width: 100%; }
}

/* ── Avatar upload: stack on mobile ──────────────────────────── */
@media (max-width: 500px) {
  .avatar-upload-row { flex-direction: column; align-items: flex-start; }
}

/* ── Integration section grids: single column on mobile ─────── */
@media (max-width: 600px) {
  .form-grid { grid-template-columns: 1fr !important; }
  .form-grid--color { grid-template-columns: 1fr 1fr !important; }
}

/* ── Color picker on tiny screens ────────────────────────────── */
@media (max-width: 380px) {
  .form-grid--color { grid-template-columns: 1fr !important; }
}

/* ── Touch-friendly tap targets ──────────────────────────────── */
@media (max-width: 767px) {
  .btn { padding: .55rem 1.05rem; font-size: .82rem; }
  .btn--sm { padding: .38rem .8rem; font-size: .74rem; min-height: 32px; }
  .btn--lg { padding: .75rem 1.3rem; font-size: .88rem; }
  .toggle-switch { width: 48px; height: 26px; }
}

/* ── Vcard: already mobile-first, minor tweaks ───────────────── */
@media (max-width: 380px) {
  .vcard { padding: var(--sp-8) var(--sp-4) var(--sp-6); }
  .vcard__name { font-size: 1.375rem; }
  .vcard__link { padding: var(--sp-3) var(--sp-4); }
}

/* ── Lead gate form: comfortable on all phone sizes ──────────── */
@media (max-width: 500px) {
  .lead-gate { padding: var(--sp-6) var(--sp-4) var(--sp-6); }
  .lead-gate__body { padding: var(--sp-4); }
}

/* ── Score badge ─────────────────────────────────────────────── */
.score-badge {
  display: inline-flex;
  align-items: center;
  padding: .2rem .6rem;
  border-radius: 99px;
  font-size: .75rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: default;
}
.score-badge--high { background: #d1fae5; color: #065f46; }
.score-badge--mid  { background: #fef3c7; color: #92400e; }
.score-badge--low  { background: #fee2e2; color: #991b1b; }

/* ── Outreach badge ──────────────────────────────────────────── */
.outreach-badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .2rem .6rem;
  border-radius: 99px;
  font-size: .72rem;
  font-weight: 500;
  white-space: nowrap;
  background: var(--c-surface-2);
  color: var(--c-text-muted);
}
.outreach-badge--email    { background: #eff6ff; color: #1d4ed8; }
.outreach-badge--whatsapp { background: #f0fdf4; color: #15803d; }

/* ── Analytics pills ─────────────────────────────────────────── */
.analytics-pills { display: flex; flex-direction: column; gap: .625rem; }
.analytics-pill {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: .5rem .75rem;
}
.analytics-pill__label { font-size: .875rem; color: var(--c-text); }
.analytics-pill__count {
  font-size: .8125rem;
  font-weight: 600;
  color: var(--c-text-muted);
  text-align: right;
  white-space: nowrap;
}
.analytics-pill__bar {
  grid-column: 1 / -1;
  height: 6px;
  border-radius: 99px;
  background: var(--c-surface-3);
  overflow: hidden;
}
.analytics-pill__fill {
  height: 100%;
  border-radius: 99px;
  background: var(--c-accent);
  transition: width .4s ease;
}

/* ── Dashboard header actions ────────────────────────────────── */
.dash-header__actions {
  display: flex;
  align-items: center;
  gap: .625rem;
  flex-wrap: wrap;
}
@media (max-width: 600px) {
  .dash-header { flex-wrap: wrap; gap: .75rem; }
  .dash-header__actions { width: 100%; }
  .dash-header__actions .btn { flex: 1; justify-content: center; }
}

/* ── Events grid ─────────────────────────────────────────────── */
.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: .75rem;
}
.event-card {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .9rem 1rem;
  background: var(--glass-fill);
  -webkit-backdrop-filter: blur(var(--glass-blur)); backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  text-decoration: none;
  color: var(--c-text);
  transition: border-color .12s, transform .1s;
}
.event-card:hover {
  border-color: var(--c-accent);
  transform: translateY(-1px);
}
.event-card--auto { opacity: .9; }
.event-card__icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: rgba(99,102,241,.1); color: #a5b4fc;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.event-card__body { flex: 1; min-width: 0; }
.event-card__name {
  font-weight: 700; font-size: .88rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.event-card__meta { font-size: .74rem; color: var(--c-text-muted); margin-top: .15rem; }
.event-card__arrow { color: var(--c-text-muted); flex-shrink: 0; }

/* ══════════ Sidebar colapsable + Topbar + Chat INTELLI ══════════ */
.sidebar-collapsed .sidebar { overflow: hidden; }
.sidebar-collapsed .sidebar__link span,
.sidebar-collapsed .sidebar__preview-link span,
.sidebar-collapsed .sidebar__footer { display: none; }
.sidebar-collapsed .sidebar__link { justify-content: center; padding-left: 0; padding-right: 0; }

/* Brand logo: word‑mark and icon share one grid cell and crossfade
   instead of popping via display:none, so the collapse reads as one
   smooth motion together with the sidebar width transition. */
.sidebar__brand { display: grid; place-items: center; }
.sidebar__brand-word, .sidebar__brand-icon {
  grid-area: 1 / 1;
  transition: opacity .22s ease, transform .22s ease;
}
.sidebar__brand-icon { width: 34px; height: 34px; opacity: 0; transform: scale(.8); object-fit: contain; }
.sidebar__brand-word { opacity: 1; transform: scale(1); }
.sidebar-collapsed .sidebar__brand-word { opacity: 0; transform: scale(.8); }
.sidebar-collapsed .sidebar__brand-icon { opacity: 1; transform: scale(1); }

.app-topbar {
  position: fixed; top: max(.8rem, calc(env(safe-area-inset-top, 0px) + .5rem)); right: 1rem; z-index: 3000;
  display: flex; align-items: center; gap: .3rem;
  padding: .32rem;
  background:
    linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.01) 40%),
    var(--c-surface-2);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  box-shadow: 0 10px 40px rgba(0,0,0,.5), inset 0 1px 0 var(--glass-highlight);
}
.app-topbar__btn {
  width: 36px; height: 36px; border-radius: 10px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--c-text-muted); cursor: pointer; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all .12s;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}
.app-topbar__btn:hover { color: var(--c-text); background: var(--glass-fill-strong); }

.admin-badge--topbar {
  height: 36px; padding: 0 .9rem; margin-right: .15rem;
  background: linear-gradient(155deg, rgba(250,204,21,.22), rgba(250,204,21,.06));
  border-color: rgba(250,204,21,.4);
  box-shadow: 0 0 0 1px rgba(250,204,21,.08) inset, 0 2px 14px rgba(250,204,21,.15);
}
.admin-badge--topbar svg { flex-shrink: 0; }

/* ── Sidebar edge toggle ──────────────────────────────────────── */
/* #id selector so it wins the position:fixed cascade over the later,
   equal-specificity [data-tip] { position: relative } tooltip rule. */
#sidebarEdgeToggle.sidebar-edge-toggle {
  position: fixed; z-index: 3001;
  top: 44px; left: calc(var(--sidebar-w) - 13px);
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--c-surface-2);
  -webkit-backdrop-filter: blur(var(--glass-blur)); backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  color: var(--c-text-muted); cursor: pointer; padding: 0;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-highlight);
  transition: left .28s cubic-bezier(.4,0,.2,1), color .12s, border-color .12s;
}
.sidebar-edge-toggle:hover { color: var(--c-text); border-color: var(--c-accent); }
.sidebar-edge-toggle svg { transition: transform .28s cubic-bezier(.4,0,.2,1); }
body.sidebar-collapsed #sidebarEdgeToggle.sidebar-edge-toggle { left: calc(64px - 13px); }
body.sidebar-collapsed .sidebar-edge-toggle svg { transform: rotate(180deg); }
@media (max-width: 767px) { .sidebar-edge-toggle { display: none; } }

/* ── Custom hover tooltips (replace native title attr) ── */
[data-tip] { position: relative; }
[data-tip]::after {
  content: attr(data-tip);
  position: absolute; top: calc(100% + 10px); left: 50%;
  transform: translate(-50%, -4px);
  background: var(--c-surface-2);
  -webkit-backdrop-filter: blur(var(--glass-blur)); backdrop-filter: blur(var(--glass-blur));
  color: var(--c-text); font-size: .72rem; font-weight: 500; white-space: nowrap;
  padding: .4rem .65rem; border-radius: 8px;
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  opacity: 0; pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
  z-index: 10;
}
[data-tip]:hover::after { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 767px) { [data-tip]::after { display: none; } }

.notif-badge {
  position: absolute; top: 6px; right: 7px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--c-accent);
  box-shadow: 0 0 0 2px var(--c-bg);
}

.app-topbar__profile { position: relative; }
.app-topbar__avatar {
  width: 36px; height: 36px; border-radius: 50%; overflow: hidden;
  background: var(--c-accent); color: var(--c-accent-text); font-weight: 700; font-size: .95rem;
  display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid var(--glass-border); box-sizing: border-box;
  cursor: pointer; padding: 0;
  -webkit-tap-highlight-color: transparent;
}
.app-topbar__avatar img { width: 100%; height: 100%; object-fit: cover; }

.notif-panel, .profile-panel {
  position: absolute; top: 44px; right: 0;
  background: var(--c-surface-2);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(140%); backdrop-filter: blur(var(--glass-blur)) saturate(140%);
  border: 1px solid var(--glass-border);
  border-radius: 14px; box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-highlight);
  overflow: hidden;
}
.notif-panel { width: 300px; padding: .4rem 0; }
.notif-panel__title {
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--c-text-muted); padding: .4rem .8rem;
}

.profile-panel { width: 250px; padding: .6rem; }
.profile-panel__id { display: flex; align-items: center; gap: .65rem; padding: .3rem .3rem .7rem; border-bottom: 1px solid var(--glass-border); margin-bottom: .4rem; }
.profile-panel__avatar {
  width: 38px; height: 38px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  background: var(--c-accent); color: var(--c-accent-text); font-weight: 700; font-size: .95rem;
  display: inline-flex; align-items: center; justify-content: center;
}
.profile-panel__avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-panel__name { font-size: .85rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-panel__email { font-size: .72rem; color: var(--c-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-panel__links { display: flex; flex-direction: column; gap: 1px; padding-bottom: .4rem; border-bottom: 1px solid var(--glass-border); margin-bottom: .4rem; }
.profile-panel__link {
  display: flex; align-items: center; gap: .55rem;
  padding: .5rem .55rem; border-radius: 8px;
  font-size: .82rem; font-weight: 500; color: var(--c-text-muted);
  transition: background .12s, color .12s;
}
.profile-panel__link svg { flex-shrink: 0; opacity: .75; }
.profile-panel__link:hover { background: var(--glass-fill-strong); color: var(--c-text); opacity: 1; }
.profile-panel__link--danger { color: var(--c-danger); margin-bottom: 0; }
.profile-panel__link--danger:hover { background: rgba(248,113,113,.1); color: var(--c-danger); }

.intelli-chat {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 3500;
  width: 420px; max-width: 100vw; height: 100vh;
  background: var(--c-surface-2);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(140%); backdrop-filter: blur(var(--glass-blur)) saturate(140%);
  border-left: 1px solid var(--glass-border);
  box-shadow: -12px 0 48px rgba(0,0,0,.5);
  display: flex; flex-direction: column; overflow: hidden;
  transform: translateX(100%);
  transition: transform .28s cubic-bezier(.2,.9,.3,1);
}
.intelli-chat.open { transform: translateX(0); }
.intelli-thinking-dots { display: inline-flex; gap: 4px; align-items: center; padding: .2rem 0; }
.intelli-thinking-dots span {
  width: 7px; height: 7px; border-radius: 50%; background: var(--c-accent);
  animation: intelliBounce 1.2s ease-in-out infinite;
}
.intelli-thinking-dots span:nth-child(2) { animation-delay: .18s; }
.intelli-thinking-dots span:nth-child(3) { animation-delay: .36s; }
@keyframes intelliBounce { 0%, 70%, 100% { transform: translateY(0); opacity: .4; } 35% { transform: translateY(-5px); opacity: 1; } }
/* Markdown inside AI bubbles */
.intelli-msg--ai p { margin: 0 0 .45rem; } .intelli-msg--ai p:last-child { margin-bottom: 0; }
.intelli-msg--ai ul, .intelli-msg--ai ol { margin: .2rem 0 .45rem; padding-left: 1.15rem; }
.intelli-msg--ai li { margin-bottom: .2rem; }
.intelli-msg--ai strong { color: var(--c-text); }
.intelli-msg--ai code {
  background: rgba(129,140,248,.14); padding: .08rem .35rem; border-radius: 5px;
  font-size: .76rem; font-family: ui-monospace, monospace;
}
.intelli-msg--ai h4 { font-size: .84rem; margin: .3rem 0 .25rem; }
.intelli-chat__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .7rem .9rem; border-bottom: 1px solid var(--c-border); flex-shrink: 0;
}
.intelli-chat__messages {
  flex: 1; overflow-y: auto; padding: .8rem;
  display: flex; flex-direction: column; gap: .5rem;
}
.intelli-msg {
  max-width: 85%; padding: .55rem .8rem; border-radius: 14px;
  font-size: .82rem; line-height: 1.45; white-space: pre-wrap; word-break: break-word;
}
.intelli-msg--ai { background: var(--c-bg); border: 1px solid var(--c-border); align-self: flex-start; border-bottom-left-radius: 4px; }
.intelli-msg--user { background: var(--c-accent); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.intelli-chat__input {
  display: flex; gap: .45rem; padding: .6rem; border-top: 1px solid var(--c-border); flex-shrink: 0;
}

@media (max-width: 767px) {
  .app-topbar { top: max(.55rem, calc(env(safe-area-inset-top, 0px) + .45rem)); right: .6rem; }
  #sidebarToggle { display: none; }
  .intelli-chat {
    width: 100vw; max-width: 100vw;
    height: 100vh; height: 100dvh;
    border-left: none; box-shadow: none;
  }
  .intelli-chat__input {
    padding-bottom: max(env(safe-area-inset-bottom, 0px), 28px);
  }
  .intelli-chat__messages {
    padding-bottom: 1.2rem;
  }
  .intelli-chat__header {
    padding-top: calc(.7rem + env(safe-area-inset-top, 0px) + 10px);
  }
}
