/* ── Design tokens ───────────────────────────────────────────── */
:root {
  --bg:            #fafafa;
  --bg-subtle:     #f4f4f5;
  --bg-card:       #ffffff;
  --bg-hover:      #f4f4f5;

  --sidebar-bg:    #09090b;
  --sidebar-border:#1a1a1d;
  --sidebar-fg:    #a1a1aa;
  --sidebar-fg-active: #fafafa;
  --sidebar-accent-bg: rgba(129, 140, 248, 0.12);
  --sidebar-accent-fg: #a5b4fc;

  --text:          #09090b;
  --text-2:        #52525b;
  --text-3:        #a1a1aa;
  --border:        #e4e4e7;
  --border-strong: #d4d4d8;

  --accent:        #6366f1;
  --accent-2:      #8b5cf6;
  --accent-soft:   #eef2ff;

  --success:       #10b981;
  --success-soft:  #ecfdf5;
  --warning:       #f59e0b;
  --warning-soft:  #fffbeb;
  --danger:        #ef4444;
  --danger-soft:   #fef2f2;

  --shadow-sm:     0 1px 2px rgba(9, 9, 11, 0.04);
  --shadow-md:     0 1px 3px rgba(9, 9, 11, 0.06), 0 8px 24px rgba(9, 9, 11, 0.04);

  --radius-sm:     6px;
  --radius:        10px;
  --radius-lg:     14px;

  --sidebar-w:     248px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  color: var(--text);
  background: var(--bg);
  letter-spacing: -0.005em;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; font-size: inherit; letter-spacing: inherit; }

/* ── Shell ───────────────────────────────────────────────────── */
.shell { display: flex; min-height: 100vh; position: relative; }
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  overflow: hidden;
  transition: width 0.32s cubic-bezier(0.2, 0, 0, 1),
              min-width 0.32s cubic-bezier(0.2, 0, 0, 1);
}
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* Collapsed state — hide the sidebar entirely */
.shell-menu-hidden .sidebar {
  width: 0;
  min-width: 0;
  border-right-color: transparent;
}
.shell-menu-hidden .sidebar > * {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

/* Floating reopen chevron (only visible when sidebar is hidden) */
.menu-show-btn {
  position: fixed;
  top: 14px;
  left: 14px;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--sidebar-bg);
  color: var(--sidebar-accent-fg);
  border: 1px solid var(--sidebar-border);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 500;
  box-shadow: 0 8px 18px -8px rgba(9, 9, 11, 0.4);
  transition: background 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}
.menu-show-btn svg { width: 16px; height: 16px; }
.menu-show-btn:hover { background: #15151a; transform: translateX(1px); border-color: #2a2a30; }
.shell-menu-hidden .menu-show-btn {
  display: inline-flex;
  animation: menu-show-in 0.3s cubic-bezier(0.2, 0, 0, 1);
}
@keyframes menu-show-in {
  from { opacity: 0; transform: translateX(-6px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Hide-menu chevron inside the brand area */
.menu-collapse-btn {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--sidebar-fg);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.menu-collapse-btn svg { width: 14px; height: 14px; }
.menu-collapse-btn:hover {
  background: #15151a;
  color: var(--sidebar-fg-active);
  border-color: #2a2a30;
  transform: translateX(-1px);
}

/* ── Sidebar brand ───────────────────────────────────────────── */
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 18px 16px;
  border-bottom: 1px solid var(--sidebar-border);
}
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 12px; letter-spacing: -0.02em;
  box-shadow: 0 1px 0 rgba(255,255,255,0.08) inset, 0 6px 18px rgba(99, 102, 241, 0.28);
}
.brand-text {
  color: #fafafa; font-weight: 700; font-size: 15px; letter-spacing: -0.015em;
  display: flex; align-items: center; gap: 8px; flex: 1;
}

.workspace-pill {
  margin: 14px 14px 4px;
  padding: 10px 12px;
  background: #15151a;
  border: 1px solid #212126;
  border-radius: 10px;
  display: flex; align-items: center; gap: 10px;
  cursor: pointer;
}
.workspace-pill:hover { background: #1a1a20; }
.ws-avatar {
  width: 26px; height: 26px; border-radius: 7px;
  background: linear-gradient(135deg, #f472b6, #8b5cf6);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 11px;
}
.ws-info { flex: 1; min-width: 0; overflow: hidden; }
.ws-name { color: #fafafa; font-weight: 600; font-size: 13px; letter-spacing: -0.01em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ws-plan { color: #71717a; font-size: 11px; font-weight: 500; margin-top: 1px; }

.nav-group { padding: 14px 10px 6px; }
.nav-label {
  font-size: 10px; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; color: #52525b;
  padding: 0 10px 8px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: 7px;
  color: var(--sidebar-fg);
  font-size: 13px; font-weight: 500; letter-spacing: -0.005em;
  margin-bottom: 1px;
  cursor: pointer;
  position: relative;
  background: none; border: none; width: 100%; text-align: left;
}
.nav-item:hover { background: #15151a; color: #d4d4d8; }
.nav-item.active {
  background: var(--sidebar-accent-bg);
  color: var(--sidebar-accent-fg);
}
.nav-item.active::before {
  content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px;
  width: 2px; background: var(--sidebar-accent-fg); border-radius: 2px;
}
.nav-icon { width: 16px; height: 16px; stroke-width: 2; flex-shrink: 0; }
.nav-item-label { flex: 1; }
/* Unread badge for dual-indicator notifications (feedback, leads,
   conversations). Red dot with count, similar to Slack / Linear. */
.nav-badge {
  margin-left: auto;
  min-width: 18px;
  height: 16px;
  padding: 0 5px;
  background: var(--danger, #ef4444);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 2px #09090b, 0 2px 6px rgba(239, 68, 68, 0.35);
  letter-spacing: -0.01em;
  transition: transform 0.22s cubic-bezier(0.2, 0, 0, 1);
}
.nav-badge.pop {
  animation: nav-badge-pop 0.45s cubic-bezier(0.2, 0, 0, 1);
}
@keyframes nav-badge-pop {
  0%   { transform: scale(0.4); opacity: 0; }
  60%  { transform: scale(1.3);  opacity: 1; }
  100% { transform: scale(1);    opacity: 1; }
}
.nav-item.active .nav-badge {
  box-shadow: 0 0 0 2px rgba(129, 140, 248, 0.25),
              0 2px 6px rgba(239, 68, 68, 0.4);
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--sidebar-border);
  padding: 12px 14px;
  display: flex; align-items: center; gap: 10px;
}
.user-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, #22d3ee, #6366f1);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 12px;
  flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-name { color: #fafafa; font-size: 13px; font-weight: 600; letter-spacing: -0.01em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.user-email { color: #71717a; font-size: 11px; font-weight: 450; margin-top: 1px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.menu-btn, .logout-btn {
  background: none; border: none; cursor: pointer;
  width: 28px; height: 28px; border-radius: 6px;
  color: #71717a;
  display: inline-flex; align-items: center; justify-content: center;
}
.menu-btn:hover, .logout-btn:hover { background: #15151a; color: #d4d4d8; }

/* ── Topbar ──────────────────────────────────────────────────── */
.topbar {
  height: 60px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center;
  padding: 0 28px;
  gap: 20px;
}
.breadcrumb { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 13px; font-weight: 500; }
.breadcrumb .sep { color: var(--text-3); }
.breadcrumb .current { color: var(--text); font-weight: 600; }
.topbar-spacer { flex: 1; }
.search {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 11px;
  width: 280px;
  color: var(--text-2);
  font-size: 13px;
}
.search:hover { border-color: var(--border-strong); background: #fff; }
.search .kbd {
  margin-left: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; font-weight: 500;
  background: #fff; border: 1px solid var(--border);
  padding: 1px 6px; border-radius: 4px;
  color: var(--text-3);
}
.icon-btn {
  width: 34px; height: 34px;
  background: transparent; border: 1px solid transparent;
  border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-2);
  cursor: pointer;
  position: relative;
}
.icon-btn:hover { background: var(--bg-subtle); color: var(--text); }
/* Topbar links with inline label — render as pill-shaped buttons */
.icon-btn.topbar-link {
  width: auto;
  padding: 0 12px;
  gap: 6px;
  height: 34px;
  border: 1px solid var(--border);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  text-decoration: none;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}
.icon-btn.topbar-link:hover {
  border-color: #c7d2fe;
  color: var(--accent);
  background: var(--accent-soft);
}
.icon-btn.topbar-link .topbar-link-label { white-space: nowrap; }
.icon-btn.topbar-link svg { width: 14px; height: 14px; }
@media (max-width: 1100px) {
  .icon-btn.topbar-link .topbar-link-label { display: none; }
  .icon-btn.topbar-link { width: 34px; padding: 0; }
}
.icon-btn .dot {
  position: absolute; top: 8px; right: 8px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--danger);
  border: 2px solid #fff;
}
#topbar-bell-btn { position: relative; }
.bell-count {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 9.5px;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 2px #fff, 0 2px 6px rgba(239, 68, 68, 0.4);
  letter-spacing: -0.01em;
  animation: bell-count-pulse 2s ease-out infinite;
}
.bell-count.pop {
  animation: bell-count-pop 0.45s cubic-bezier(0.2, 0, 0, 1),
             bell-count-pulse 2s ease-out 0.5s infinite;
}
@keyframes bell-count-pop {
  0%   { transform: scale(0.4); opacity: 0; }
  60%  { transform: scale(1.25); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes bell-count-pulse {
  0%, 100% { box-shadow: 0 0 0 2px #fff, 0 2px 6px rgba(239, 68, 68, 0.4); }
  50%      { box-shadow: 0 0 0 2px #fff, 0 2px 14px rgba(239, 68, 68, 0.7); }
}

/* Notifications dropdown */
.notif-dropdown {
  position: fixed;
  width: min(380px, 92vw);
  max-height: 560px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow:
    0 24px 48px -16px rgba(9, 9, 11, 0.25),
    0 12px 32px -20px rgba(99, 102, 241, 0.2),
    0 1px 0 rgba(255, 255, 255, 0.5) inset;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  z-index: 900;
  animation: notif-pop 0.22s cubic-bezier(0.2, 0, 0, 1);
}
@keyframes notif-pop {
  from { opacity: 0; transform: translateY(-6px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.notif-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.notif-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.notif-unread-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
/* Mini summary chips inside the bell dropdown — one clickable chip
   per source (Feedback / Leads / Sessions) showing its unread count. */
.notif-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
}
.notif-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 9px 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.notif-chip:hover {
  border-color: #c7d2fe;
  transform: translateY(-1px);
  box-shadow: 0 6px 14px -10px rgba(99, 102, 241, 0.35);
}
.notif-chip.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.notif-chip-icon { font-size: 16px; line-height: 1; }
.notif-chip-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.notif-chip-count {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.notif-chip.active .notif-chip-count { color: var(--accent); }

.notif-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 0;
}
.notif-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  align-items: flex-start;
  width: 100%;
  padding: 12px 16px;
  background: transparent;
  border: none;
  border-bottom: 1px dashed var(--border);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  position: relative;
  transition: background 0.15s ease;
}
.notif-row:last-child { border-bottom: none; }
.notif-row:hover { background: var(--bg-subtle); }
.notif-row.unread { background: rgba(99, 102, 241, 0.035); }
.notif-row.unread:hover { background: rgba(99, 102, 241, 0.08); }
.notif-rating {
  font-size: 18px;
  line-height: 1;
  margin-top: 2px;
}
.notif-rating.up { filter: hue-rotate(0deg); }
.notif-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
/* Row that holds the question text + its source-tab chip. The
   question truncates with ellipsis while the chip stays fixed-width
   on the right — this gives every notification a single consistent
   two-column layout instead of the chip wrapping under the text. */
.notif-q-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.notif-q {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.005em;
  flex: 1;
  min-width: 0;
}
/* Source-tab chip: tells the user which Feedback page filter tab
   this item lives in (Positive / Negative / Fixed / Dismissed).
   Clicking the row filters the Feedback page to match. Four tones,
   reusing design tokens for color coherence. */
.notif-tag {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 800;
  line-height: 1.6;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: 1px solid transparent;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.notif-row:hover .notif-tag { transform: translateY(-1px); }
.notif-tag-up {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}
.notif-tag-down {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}
.notif-tag-fixed {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: #c7d2fe;
}
.notif-tag-dismissed {
  background: var(--bg-subtle);
  color: var(--text-3);
  border-color: var(--border);
}
.notif-tag-text {
  background: var(--bg-subtle);
  color: var(--text-3);
  border-color: var(--border);
}
.notif-a {
  font-size: 11.5px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}
.notif-time {
  font-size: 10.5px;
  color: var(--text-3);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  padding-top: 3px;
}
.notif-dot {
  position: absolute;
  right: 12px;
  top: 16px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}
.notif-empty {
  padding: 40px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}
.notif-empty-icon { font-size: 28px; opacity: 0.55; }
.notif-empty-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.notif-empty-sub {
  font-size: 12px;
  color: var(--text-3);
  max-width: 260px;
  line-height: 1.5;
}
.notif-foot {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  background: var(--bg-subtle);
  display: flex;
  justify-content: flex-end;
}
.notif-foot .ghost-btn {
  color: var(--accent);
  font-weight: 600;
}
.primary-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  background: var(--text); color: #fff;
  border: none; border-radius: 8px;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,0.12), 0 0 0 1px rgba(0,0,0,0.04) inset;
}
.primary-btn:hover { background: #18181b; }
.primary-btn.danger { background: var(--danger); }
.primary-btn.danger:hover { background: #dc2626; }
.ghost-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
}
.ghost-btn:hover { border-color: var(--border-strong); background: var(--bg-subtle); }
.ghost-btn.sm { padding: 5px 11px; font-size: 12px; }
.ghost-btn.danger { color: var(--danger); border-color: #fecaca; }
.ghost-btn.danger:hover { background: var(--danger-soft); }

/* ── Content ─────────────────────────────────────────────────── */
.content { padding: 28px 28px 48px; max-width: 1400px; width: 100%; }
.page-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 24px;
  gap: 20px; flex-wrap: wrap;
}
.page-title { font-size: 26px; font-weight: 700; letter-spacing: -0.025em; color: var(--text); margin: 0 0 4px; }
.page-sub { color: var(--text-2); font-size: 14px; font-weight: 450; margin: 0; }
.page-actions { display: flex; gap: 10px; }

.trial-banner {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 18px;
  background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 100%);
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}
.trial-icon {
  width: 36px; height: 36px; border-radius: 8px;
  background: #fef3c7; border: 1px solid #fde68a;
  display: inline-flex; align-items: center; justify-content: center;
  color: #92400e;
}
.trial-text { flex: 1; }
.trial-title { font-size: 13px; font-weight: 600; color: #78350f; letter-spacing: -0.01em; }
.trial-sub { font-size: 12px; color: #92400e; margin-top: 2px; font-weight: 450; }
.trial-cta {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  background: #78350f; color: #fffbeb;
  border: none; border-radius: 7px;
  font-size: 12px; font-weight: 600;
  cursor: pointer;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
@media (max-width: 980px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}
.stat-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.stat-label { font-size: 12px; font-weight: 550; color: var(--text-2); }
.stat-trend {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11px; font-weight: 600;
  padding: 2px 7px; border-radius: 999px;
}
.stat-trend.up { background: var(--success-soft); color: #047857; }
.stat-trend.down { background: var(--danger-soft); color: #b91c1c; }
.stat-trend.flat { background: var(--bg-subtle); color: var(--text-2); }
.stat-value { font-size: 28px; font-weight: 700; letter-spacing: -0.03em; color: var(--text); font-feature-settings: "tnum"; }
.stat-unit { font-size: 14px; font-weight: 500; color: var(--text-3); margin-left: 4px; }

.two-col {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 14px;
  margin-bottom: 24px;
}
@media (max-width: 1100px) { .two-col { grid-template-columns: 1fr; } }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 12px;
}
.card-title { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; color: var(--text); display: flex; align-items: center; gap: 8px; }
.card-sub { font-size: 12px; color: var(--text-2); font-weight: 450; margin-top: 2px; }
.card-body { padding: 0 20px 20px; }
.card-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-2);
  font-size: 13px;
}
.card-empty-title { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 6px; }

.usage-row {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}
.usage-row:first-of-type { border-top: none; }
.usage-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.usage-name { font-size: 13px; font-weight: 600; color: var(--text); }
.usage-nums { font-size: 12px; color: var(--text-2); font-weight: 500; font-feature-settings: "tnum"; }
.bar { height: 6px; background: var(--bg-subtle); border-radius: 999px; overflow: hidden; }
.bar-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.bar-fill.warn { background: linear-gradient(90deg, #f59e0b, #f97316); }
.bar-fill.danger { background: linear-gradient(90deg, #ef4444, #dc2626); }

/* ── Tables ──────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left; font-size: 11px; font-weight: 600;
  color: var(--text-2); letter-spacing: 0.02em; text-transform: uppercase;
  padding: 10px 20px; background: var(--bg-subtle);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
tbody td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 13px; color: var(--text); font-weight: 450;
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--bg-subtle); }
.cell-visitor { display: flex; align-items: center; gap: 10px; }
.visitor-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 600; font-size: 11px;
  flex-shrink: 0;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
}
.cell-preview { color: var(--text-2); max-width: 360px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 600;
}
.pill-voice { background: var(--accent-soft); color: var(--accent); }
.pill-text { background: var(--bg-subtle); color: var(--text-2); }
.pill-lead { background: var(--success-soft); color: #047857; }
.pill-escalated { background: var(--warning-soft); color: #92400e; }
.cell-time { color: var(--text-3); font-size: 12px; font-feature-settings: "tnum"; }

/* ── Login screen ────────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: linear-gradient(180deg, #fafafa 0%, #f4f4f5 100%);
}
.login-card {
  width: 100%; max-width: 420px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px 32px;
  box-shadow: var(--shadow-md);
}
.login-brand {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 20px;
}
.login-card h1 {
  font-size: 22px; font-weight: 700; letter-spacing: -0.02em;
  margin: 0 0 6px;
}
.login-card p { color: var(--text-2); font-size: 13px; margin: 0 0 20px; }
.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 12px; font-weight: 600; color: var(--text);
  margin-bottom: 6px;
}
.field input {
  width: 100%;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px; color: var(--text);
  font-family: inherit;
}
.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}
.full-btn {
  width: 100%;
  padding: 11px 14px;
  background: var(--text);
  color: #fff;
  border: none; border-radius: 8px;
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  margin-top: 6px;
}
.full-btn:hover { background: #18181b; }
.full-btn:disabled { opacity: 0.6; cursor: wait; }
.login-alert {
  padding: 10px 12px;
  background: var(--danger-soft);
  border: 1px solid #fecaca;
  color: #991b1b;
  border-radius: 8px;
  font-size: 12px;
  margin-bottom: 12px;
}
.login-success {
  padding: 10px 12px;
  background: var(--success-soft);
  border: 1px solid #bbf7d0;
  color: #166534;
  border-radius: 8px;
  font-size: 12px;
  margin-bottom: 12px;
}
.login-success a {
  color: #047857; font-weight: 700; text-decoration: underline;
}

/* ── Forms ───────────────────────────────────────────────────── */
.form-row { display: flex; gap: 10px; align-items: flex-start; }
textarea {
  width: 100%;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px; color: var(--text);
  font-family: inherit;
  resize: vertical; min-height: 90px;
}
textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99,102,241,0.12); }
.code-block {
  display: block;
  padding: 14px 16px;
  background: #09090b;
  color: #a1a1aa;
  border-radius: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  overflow-x: auto;
  line-height: 1.6;
}
.code-block b { color: #fafafa; font-weight: 600; }

.toast {
  position: fixed;
  bottom: 20px; right: 20px;
  padding: 10px 14px;
  background: #09090b;
  color: #fafafa;
  border-radius: 8px;
  font-size: 13px; font-weight: 500;
  box-shadow: var(--shadow-md);
  z-index: 1000;
  animation: slideIn 0.2s ease;
}
.toast.error { background: #b91c1c; }
.toast.success { background: #047857; }
@keyframes slideIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ── Toggle switch ───────────────────────────────────────────── */
.toggle {
  width: 38px; height: 22px; border-radius: 999px;
  border: none; cursor: pointer;
  background: #d4d4d8;
  position: relative;
  transition: background 0.15s;
  flex-shrink: 0;
}
.toggle.on { background: var(--accent); }
.toggle::after {
  content: ""; position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: left 0.15s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle.on::after { left: 18px; }

/* ── Horizontal sub-tab strip (Linear/Stripe-style, polished) ──── */

/* The easing curves — matched to what top SaaS products use:
 *   --ease-out    : fast start, smooth stop     (for color/opacity)
 *   --ease-smooth : symmetric smooth in/out     (for position)
 *   --ease-spring : overshoots slightly, lands  (for scale/icon pop)
 */
:root {
  --ease-out:    cubic-bezier(0.22, 1, 0.36, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
}

.subtab-strip {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 2px;
  padding: 12px 16px 0;
  overflow-x: auto;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
  scrollbar-width: thin;
}
.subtab-strip::-webkit-scrollbar { height: 6px; }
.subtab-strip::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }

/* The moving underline — positioned via JS on tab change */
.subtab-indicator {
  position: absolute;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 2px 2px 0 0;
  pointer-events: none;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.35);
  left: 0;
  width: 0;
  opacity: 0;
  transition:
    left 380ms var(--ease-out),
    width 380ms var(--ease-out),
    opacity 200ms var(--ease-smooth);
}
.subtab-indicator.ready { opacity: 1; }

.subtab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  background: transparent;
  border: none;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 550;
  letter-spacing: -0.005em;
  cursor: pointer;
  white-space: nowrap;
  border-radius: 8px 8px 0 0;
  position: relative;
  transition:
    color 220ms var(--ease-smooth),
    background-color 220ms var(--ease-smooth),
    transform 140ms var(--ease-out);
  transform-origin: center bottom;
}
.subtab:hover {
  color: var(--text);
  background: var(--bg-subtle);
}
.subtab:active {
  transform: scale(0.96) translateY(1px);
}
.subtab.active {
  color: var(--accent);
}
.subtab.active:hover {
  background: rgba(99, 102, 241, 0.06);
}
.subtab .subtab-icon {
  width: 15px; height: 15px; stroke-width: 2;
  flex-shrink: 0;
  transition:
    color 220ms var(--ease-smooth),
    transform 320ms var(--ease-spring);
}
.subtab.active .subtab-icon {
  transform: scale(1.12) rotate(-2deg);
}

/* ── Content body transition on sub-tab switch ─────────────────── */
.subtab-body-enter {
  animation: subtabFadeIn 280ms var(--ease-out);
}
@keyframes subtabFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
    filter: blur(2px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

/* ── Feedback list item cards ──────────────────────────────────── */
.fb-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
  transition:
    border-color 220ms var(--ease-smooth),
    box-shadow 260ms var(--ease-smooth),
    transform 260ms var(--ease-out),
    opacity 260ms var(--ease-out),
    max-height 300ms var(--ease-out),
    margin 260ms var(--ease-out),
    padding 260ms var(--ease-out);
  transform-origin: center top;
  will-change: transform, opacity;
}
.fb-item:hover {
  border-color: var(--border-strong);
  box-shadow: 0 6px 18px rgba(9, 9, 11, 0.06), 0 1px 3px rgba(9, 9, 11, 0.04);
  transform: translateY(-2px);
}
.fb-item-body { padding: 16px 20px; }

/* Staggered entry — animation-delay is set via JS per-index */
.fb-item.entering {
  animation: fbItemEnter 380ms var(--ease-out) both;
}
@keyframes fbItemEnter {
  from { opacity: 0; transform: translateY(14px) scale(0.985); filter: blur(3px); }
  to   { opacity: 1; transform: translateY(0)   scale(1);     filter: blur(0); }
}

/* Exit state — applied with inline transition when an item is removed */
.fb-item.leaving {
  opacity: 0 !important;
  transform: translateX(-24px) scale(0.96) !important;
  max-height: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  border-width: 0 !important;
  overflow: hidden;
}

/* Filter switch: whole list container crossfades */
.fb-list-fade {
  transition: opacity 200ms var(--ease-smooth), transform 200ms var(--ease-out);
}
.fb-list-fade.out {
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
}

/* Stat cards on the feedback page: staggered entry on first render */
.stat-card.stagger {
  animation: statCardEnter 420ms var(--ease-out) both;
}
@keyframes statCardEnter {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}
/* Make stat-card hover lift feel alive too */
.stat-card {
  transition:
    border-color 220ms var(--ease-smooth),
    box-shadow 260ms var(--ease-smooth),
    transform 260ms var(--ease-out);
}
.stat-card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 6px 18px rgba(9, 9, 11, 0.06);
  transform: translateY(-1px);
}

/* ── Auto-Learn item cards ─────────────────────────────────────── */
.al-item {
  border: 1px solid var(--border);
  border-left: 4px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg-card);
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  transition:
    border-color 220ms var(--ease-smooth),
    box-shadow 260ms var(--ease-smooth),
    transform 260ms var(--ease-out),
    opacity 260ms var(--ease-out),
    max-height 300ms var(--ease-out),
    margin 260ms var(--ease-out),
    padding 260ms var(--ease-out);
  transform-origin: center top;
  will-change: transform, opacity;
}
.al-item:hover {
  border-color: var(--border-strong);
  box-shadow: 0 6px 18px rgba(9, 9, 11, 0.06), 0 1px 3px rgba(9, 9, 11, 0.04);
  transform: translateY(-2px);
}
.al-item.status-pending   { border-left-color: #f59e0b; }
.al-item.status-approved  { border-left-color: #10b981; }
.al-item.status-dismissed { border-left-color: #a1a1aa; }
.al-item-body { padding: 16px 20px; }

.al-item.entering {
  animation: alItemEnter 400ms var(--ease-out) both;
}
@keyframes alItemEnter {
  from { opacity: 0; transform: translateY(14px) scale(0.985); filter: blur(3px); }
  to   { opacity: 1; transform: translateY(0)   scale(1);     filter: blur(0); }
}
.al-item.leaving {
  opacity: 0 !important;
  transform: translateX(-24px) scale(0.96) !important;
  max-height: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  border-width: 0 !important;
  overflow: hidden;
}

/* Reason badges */
.reason-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid transparent;
  letter-spacing: -0.005em;
}
.reason-repeated         { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
.reason-low_confidence   { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.reason-generic_response { background: #fffbeb; color: #a16207; border-color: #fde68a; }
.reason-other            { background: var(--bg-subtle); color: var(--text-2); border-color: var(--border); }

.occurrence-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid #c7d2fe;
}

/* Inline textarea for the "correct answer" input on pending items */
.al-answer-input {
  width: 100%;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  line-height: 1.6;
  color: var(--text);
  resize: vertical;
  min-height: 72px;
  outline: none;
  box-sizing: border-box;
  transition: border-color 200ms var(--ease-smooth), box-shadow 200ms var(--ease-smooth);
}
.al-answer-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

/* Approve button — success gradient with shimmer + spring press */
.btn-approve {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 1px 2px rgba(5, 150, 105, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.1) inset,
    0 8px 20px -6px rgba(16, 185, 129, 0.35);
  transition:
    transform 160ms var(--ease-spring),
    box-shadow 260ms var(--ease-smooth),
    filter 220ms var(--ease-smooth);
}
.btn-approve::after {
  content: "";
  position: absolute;
  top: 0;
  left: -130%;
  width: 60%;
  height: 100%;
  background: linear-gradient(100deg, transparent 0%, rgba(255, 255, 255, 0.28) 50%, transparent 100%);
  transform: skewX(-18deg);
  pointer-events: none;
  transition: left 700ms var(--ease-out);
}
.btn-approve:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow:
    0 1px 2px rgba(5, 150, 105, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.12) inset,
    0 14px 28px -8px rgba(16, 185, 129, 0.45);
}
.btn-approve:hover::after { left: 130%; }
.btn-approve:active { transform: scale(0.96) translateY(0); }
.btn-approve:disabled { opacity: 0.6; cursor: wait; filter: grayscale(0.2); }
.btn-approve > * { position: relative; z-index: 1; }

/* Textarea: magnetic focus — lift + indigo halo */
.al-answer-input {
  transition:
    border-color 220ms var(--ease-smooth),
    box-shadow 260ms var(--ease-smooth),
    transform 260ms var(--ease-out),
    background-color 220ms var(--ease-smooth);
}
.al-answer-input:focus {
  border-color: var(--accent);
  background-color: #fefeff;
  transform: translateY(-1px);
  box-shadow:
    0 0 0 4px rgba(99, 102, 241, 0.12),
    0 10px 24px -8px rgba(99, 102, 241, 0.2);
}

/* Staggered inner-content reveal inside entering cards */
.al-item.entering .al-item-body > * {
  opacity: 0;
  animation: alInnerFade 440ms var(--ease-out) both;
}
.al-item.entering .al-item-body > *:nth-child(1) { animation-delay: 120ms; }
.al-item.entering .al-item-body > *:nth-child(2) { animation-delay: 170ms; }
.al-item.entering .al-item-body > *:nth-child(3) { animation-delay: 220ms; }
.al-item.entering .al-item-body > *:nth-child(4) { animation-delay: 270ms; }
.al-item.entering .al-item-body > *:nth-child(5) { animation-delay: 320ms; }
.al-item.entering .al-item-body > *:nth-child(n+6) { animation-delay: 370ms; }
@keyframes alInnerFade {
  from { opacity: 0; transform: translateY(4px); filter: blur(2px); }
  to   { opacity: 1; transform: translateY(0); filter: blur(0); }
}

/* APPROVE SUCCESS BURST — card glows green, then collapses upward */
.al-item.approving {
  animation: alApproveBurst 780ms var(--ease-out) forwards !important;
  pointer-events: none;
}
@keyframes alApproveBurst {
  0% {
    transform: scale(1);
    border-color: var(--border);
    border-left-color: #f59e0b;
    background: var(--bg-card);
    box-shadow: 0 1px 2px rgba(9, 9, 11, 0.04);
  }
  22% {
    transform: scale(1.012);
    border-color: #10b981;
    border-left-color: #10b981;
    background: #ecfdf5;
    box-shadow:
      0 0 0 3px rgba(16, 185, 129, 0.25),
      0 18px 50px -8px rgba(16, 185, 129, 0.4);
  }
  55% {
    transform: scale(1);
    border-color: #10b981;
    border-left-color: #10b981;
    background: #ecfdf5;
    box-shadow:
      0 0 0 2px rgba(16, 185, 129, 0.18),
      0 14px 36px -10px rgba(16, 185, 129, 0.32);
  }
  100% {
    opacity: 0;
    transform: scale(0.985) translateY(-10px);
    max-height: 0;
    margin-top: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-width: 0;
    border-left-width: 0;
    box-shadow: 0 0 0 rgba(16, 185, 129, 0);
  }
}
/* During the burst, dim out the inner content so the glow is the hero */
.al-item.approving .al-item-body { transition: opacity 200ms ease 300ms; opacity: 0; }

/* Stat card number — tabular nums so count-up doesn't jitter */
.stat-value {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

/* Subtle scale-in pop on the reason / occurrence pills when the card enters */
.al-item.entering .reason-pill,
.al-item.entering .occurrence-pill {
  animation: pillPop 520ms var(--ease-spring) both;
  animation-delay: 180ms;
}
@keyframes pillPop {
  0%   { opacity: 0; transform: scale(0.82); }
  70%  { opacity: 1; transform: scale(1.06); }
  100% { opacity: 1; transform: scale(1); }
}

/* Count badges inside filter tabs */
.subtab .subtab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--text-2);
  font-size: 10px;
  font-weight: 700;
  font-feature-settings: "tnum";
  margin-left: 2px;
  transition:
    background 220ms var(--ease-smooth),
    color 220ms var(--ease-smooth);
}
.subtab.active .subtab-count {
  background: rgba(99, 102, 241, 0.18);
  color: var(--accent);
}

.row-toggle {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}
.row-toggle.disabled { opacity: 0.5; pointer-events: none; }
.row-toggle.disabled .toggle { cursor: not-allowed; }

/* Big picker-card grid — used for Answer Mode, Response Speed, Voice grid */
.picker-grid { display: grid; gap: 10px; }
.picker-grid.two { grid-template-columns: 1fr 1fr; }
.picker-grid.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 760px) {
  .picker-grid.two, .picker-grid.three { grid-template-columns: 1fr; }
}

.picker-card {
  padding: 14px 16px;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  color: var(--text);
  transition:
    border-color 220ms var(--ease-smooth),
    background 220ms var(--ease-smooth),
    transform 220ms var(--ease-out),
    box-shadow 260ms var(--ease-smooth);
}
.picker-card:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(9,9,11,0.05); }
.picker-card:disabled, .picker-card[aria-disabled="true"] { opacity: 0.4; pointer-events: none; }
.picker-card.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.picker-card.selected.warn { border-color: #f59e0b; background: #fffbeb; }
.picker-card .pc-title { font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.picker-card .pc-desc  { font-size: 11px; color: var(--text-2); font-weight: 400; line-height: 1.5; }
.picker-card.selected .pc-title { color: var(--accent); }
.picker-card.selected.warn .pc-title { color: #b45309; }

/* Range slider — styled to match the design tokens */
.range-row {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 10px;
}
input[type="range"].range {
  flex: 1;
  -webkit-appearance: none;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(to right, var(--accent) 0%, var(--accent) var(--val, 50%), var(--bg-subtle) var(--val, 50%), var(--bg-subtle) 100%);
  outline: none;
  transition: background 180ms var(--ease-smooth);
}
input[type="range"].range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--accent);
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.35);
  cursor: grab;
  transition: transform 160ms var(--ease-spring);
}
input[type="range"].range::-webkit-slider-thumb:hover { transform: scale(1.15); }
input[type="range"].range::-webkit-slider-thumb:active { cursor: grabbing; transform: scale(1.05); }
input[type="range"].range::-moz-range-thumb {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--accent);
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.35);
  cursor: grab;
}
.range-value {
  min-width: 70px;
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.range-ticks { display: flex; justify-content: space-between; font-size: 10px; color: var(--text-3); padding: 0 8px; }

/* Preset chip row — used for delay presets */
.preset-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.preset-chip {
  padding: 6px 12px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 180ms var(--ease-smooth);
}
.preset-chip:hover { border-color: var(--border-strong); color: var(--text); }
.preset-chip.selected {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

/* Mode hint bar — contextual label that changes as you toggle voice features */
.mode-hint {
  padding: 10px 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12px;
  color: var(--text-2);
  font-weight: 500;
  margin-top: 10px;
  transition: background 220ms var(--ease-smooth);
}

/* ── Notification channel card (cohesive unit inside Notifications section) ── */
.notif-channel {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
  transition:
    border-color 280ms var(--ease-smooth),
    background 280ms var(--ease-smooth),
    box-shadow 280ms var(--ease-smooth);
}
.notif-channel.on {
  border-color: rgba(99, 102, 241, 0.3);
  background: linear-gradient(180deg, #ffffff 0%, #eef2ff 100%);
  box-shadow: 0 1px 2px rgba(99, 102, 241, 0.04), 0 0 0 1px rgba(99, 102, 241, 0.06) inset;
}
.notif-channel.off {
  opacity: 0.85;
}

.notif-channel-icon {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  background: #ffffff;
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(9, 9, 11, 0.04), 0 0 0 1px rgba(255, 255, 255, 0.6) inset;
  transition: color 280ms var(--ease-smooth), background 280ms var(--ease-smooth), border-color 280ms var(--ease-smooth);
}
.notif-channel.on .notif-channel-icon {
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
  border-color: rgba(99, 102, 241, 0.3);
  color: var(--accent);
}
.notif-channel-icon svg { width: 20px; height: 20px; stroke-width: 2; }

.notif-channel-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.notif-channel-title {
  font-size: 14px;
  font-weight: 650;
  color: var(--text);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.notif-channel-desc {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.55;
  font-weight: 450;
  max-width: 520px;
}
.notif-channel-desc b { color: var(--text); font-weight: 600; }

.notif-channel-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-subtle);
  color: var(--text-2);
  letter-spacing: -0.005em;
  align-self: flex-start;
  transition: background 280ms var(--ease-smooth), color 280ms var(--ease-smooth);
}
.notif-channel.on .notif-channel-meta {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
}
.notif-status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  position: relative;
}
.notif-channel.on .notif-status-dot::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.35;
  animation: notifPulse 1.8s var(--ease-smooth) infinite;
}
@keyframes notifPulse {
  0%   { transform: scale(1);   opacity: 0.35; }
  70%  { transform: scale(2.2); opacity: 0; }
  100% { transform: scale(2.2); opacity: 0; }
}

.notif-channel > .toggle { margin-top: 4px; }

/* ── Engagement module cards (siblings of notif-channel) ───────── */
.eng-module {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 20px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
  transition:
    border-color 280ms var(--ease-smooth),
    background 280ms var(--ease-smooth),
    box-shadow 280ms var(--ease-smooth);
}
.eng-module + .eng-module { margin-top: 12px; }
.eng-module:hover { border-color: var(--border-strong); }
.eng-module.active {
  border-color: rgba(99, 102, 241, 0.3);
  background: linear-gradient(180deg, #ffffff 0%, #f5f3ff 100%);
  box-shadow: 0 1px 2px rgba(99, 102, 241, 0.04), 0 0 0 1px rgba(99, 102, 241, 0.06) inset;
}
.eng-module-icon {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  background: #ffffff;
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(9, 9, 11, 0.04), 0 0 0 1px rgba(255, 255, 255, 0.6) inset;
  transition: all 280ms var(--ease-smooth);
}
.eng-module.active .eng-module-icon {
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
  border-color: rgba(99, 102, 241, 0.3);
  color: var(--accent);
}
.eng-module-icon svg { width: 20px; height: 20px; stroke-width: 2; }
.eng-module-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.eng-module-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.eng-module-title {
  font-size: 14px;
  font-weight: 650;
  color: var(--text);
  letter-spacing: -0.01em;
}
.eng-module-desc {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.55;
  font-weight: 450;
  max-width: 520px;
  margin-top: 2px;
}
.eng-module-controls {
  margin-top: 10px;
}
.eng-module-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-subtle);
  color: var(--text-2);
  letter-spacing: -0.005em;
  align-self: flex-start;
  transition: background 280ms var(--ease-smooth), color 280ms var(--ease-smooth);
}
.eng-module.active .eng-module-status {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
}

/* ── Chip editor (for Quick prompts) ───────────────────────────── */
.chip-editor {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  transition: border-color 220ms var(--ease-smooth), box-shadow 260ms var(--ease-smooth);
  min-height: 44px;
}
.chip-editor:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 6px 5px 12px;
  background: linear-gradient(135deg, #eef2ff, #e0e7ff);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: var(--accent);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  animation: chipIn 320ms var(--ease-spring) both;
  transform-origin: left center;
}
@keyframes chipIn {
  from { opacity: 0; transform: scale(0.7) translateX(-6px); }
  to   { opacity: 1; transform: scale(1) translateX(0); }
}
.chip.leaving {
  animation: chipOut 220ms var(--ease-out) forwards;
}
@keyframes chipOut {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(0.7) translateX(-6px); }
}
.chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.18);
  color: var(--accent);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
  transition: background 180ms var(--ease-smooth), transform 160ms var(--ease-out);
}
.chip-remove:hover { background: var(--accent); color: #fff; transform: scale(1.1); }
.chip-input {
  flex: 1;
  min-width: 140px;
  border: none;
  outline: none;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  background: transparent;
  padding: 4px 4px;
}
.chip-input::placeholder { color: var(--text-3); }

/* ── Scale chips (for Lead capture N) ──────────────────────────── */
.scale-chips {
  display: flex;
  gap: 0;
  position: relative;
  padding: 4px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow-x: auto;
}
.scale-chip {
  flex: 1;
  min-width: 64px;
  padding: 9px 8px;
  border: none;
  background: transparent;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 7px;
  font-family: inherit;
  transition: all 200ms var(--ease-smooth);
  white-space: nowrap;
  position: relative;
  z-index: 1;
}
.scale-chip:hover { color: var(--text); }
.scale-chip.selected {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.15) inset;
}
.scale-chip .sc-label { display: block; font-size: 11px; opacity: 0.7; font-weight: 500; margin-bottom: 2px; }
.scale-chip.selected .sc-label { opacity: 0.85; }
.scale-chip .sc-value { display: block; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Inline email field (for escalation input inside engagement) */
.inline-field {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.inline-field input {
  flex: 1;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 220ms var(--ease-smooth), box-shadow 260ms var(--ease-smooth);
}
.inline-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}

/* Slide-down for conditional sections (e.g. escalation email) */
.slide-section {
  overflow: hidden;
  max-height: 260px;
  opacity: 1;
  transform: translateY(0);
  transition:
    max-height 320ms var(--ease-out),
    opacity 260ms var(--ease-smooth),
    transform 260ms var(--ease-out),
    margin-top 260ms var(--ease-out);
}
.slide-section.hidden {
  max-height: 0;
  opacity: 0;
  transform: translateY(-6px);
  margin-top: 0 !important;
}

/* Section heading for Settings sub-sections */
.settings-section-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.settings-section-sub {
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 12px;
  line-height: 1.5;
}
.row-toggle:first-of-type { border-top: none; }
.row-toggle-title { font-size: 13px; font-weight: 600; color: var(--text); }
.row-toggle-sub { font-size: 12px; color: var(--text-2); margin-top: 2px; max-width: 460px; }

.i { width: 14px; height: 14px; stroke-width: 2; display: inline-block; vertical-align: middle; }
.i-lg { width: 18px; height: 18px; stroke-width: 2; }

.fade-in { animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-page {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 80px 20px; color: var(--text-2);
}
.loading-page .spinner { margin-bottom: 12px; }

/* ── Native Avatar Builder (2026) ──────────────────────────────── */
.builder-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 14px;
  margin-top: 14px;
}
@media (max-width: 1100px) {
  .builder-layout { grid-template-columns: 1fr; }
}

.builder-preview-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
}
.builder-preview-canvas-wrap {
  width: 340px;
  height: 340px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(9, 9, 11, 0.18);
  background: #0f1321;
  position: relative;
}
.builder-preview-canvas-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.builder-preview-name {
  margin-top: 16px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.builder-preview-sub {
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-2);
  font-weight: 500;
}
.builder-preview-actions {
  margin-top: 18px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}
.builder-preview-actions button {
  flex: 1;
  min-width: 110px;
}

.builder-controls-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
}
.builder-controls-body {
  padding: 20px 22px 26px;
  min-height: 400px;
}

/* Preset grid (inside the Presets tab) */
.preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}
.preset-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 10px 12px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-family: inherit;
  color: var(--text);
  transition:
    border-color 220ms var(--ease-smooth),
    transform 220ms var(--ease-out),
    box-shadow 260ms var(--ease-smooth);
  overflow: hidden;
}
.preset-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(9, 9, 11, 0.08);
  border-color: var(--border-strong);
}
.preset-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12), 0 8px 24px rgba(99, 102, 241, 0.18);
}
.preset-card canvas {
  width: 100%;
  max-width: 110px;
  height: 110px;
  display: block;
  border-radius: 8px;
  background: #0f1321;
}
.preset-card-name {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: -0.005em;
  color: var(--text);
  text-align: center;
}
.preset-card-sub {
  font-size: 10px;
  color: var(--text-3);
  margin-top: 2px;
}
.preset-card .selected-badge {
  position: absolute;
  top: 8px; right: 8px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}
.preset-card.selected .selected-badge { display: inline-flex; }

/* Color swatch grid */
.swatch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
  gap: 8px;
}
.swatch {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  border: 2px solid var(--border);
  background: transparent;
  cursor: pointer;
  transition:
    transform 180ms var(--ease-spring),
    border-color 180ms var(--ease-smooth),
    box-shadow 220ms var(--ease-smooth);
  position: relative;
}
.swatch:hover { transform: scale(1.08); }
.swatch.selected {
  border-color: var(--accent);
  transform: scale(1.05);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18), 0 4px 12px rgba(9, 9, 11, 0.08);
}
.swatch.selected::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Style button grid (for hair style, glasses style, face shape, etc.) */
.style-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
}
.style-btn {
  padding: 10px 12px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  transition: all 200ms var(--ease-smooth);
  font-family: inherit;
  text-align: center;
}
.style-btn:hover {
  border-color: var(--border-strong);
  color: var(--text);
  background: var(--bg-subtle);
}
.style-btn.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

/* Slider row */
.slider-row {
  display: flex;
  align-items: center;
  gap: 14px;
}
.slider-row input[type="range"].range {
  flex: 1;
}
.slider-row .slider-value {
  min-width: 60px;
  text-align: right;
  font-size: 13px;
  font-weight: 650;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

/* Control group — wraps each labeled control inside a tab body */
.control-group {
  margin-bottom: 22px;
}
.control-group:last-child { margin-bottom: 0; }
.control-group > label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.control-group .muted {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 6px;
  font-weight: 500;
}

/* ── Conversations page ───────────────────────────────────────── */

/* Live indicator in page header */
.live-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #10b981;
  margin: 0 6px 0 10px;
  position: relative;
  vertical-align: 1px;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
  animation: live-pulse 2s ease-out infinite;
}
@keyframes live-pulse {
  0%   { box-shadow: 0 0 0 0   rgba(16, 185, 129, 0.55); }
  60%  { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);     }
  100% { box-shadow: 0 0 0 0   rgba(16, 185, 129, 0);     }
}
.live-label {
  font-size: 11px;
  font-weight: 700;
  color: #10b981;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ── Stat tiles ─────────────────────────────────────────────── */
.stat-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.stat-tile {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 14px;
  row-gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 18px 16px;
  overflow: hidden;
  transition: transform 0.2s cubic-bezier(0.2, 0, 0, 1),
              box-shadow 0.2s ease,
              border-color 0.2s ease;
  animation: stat-fade-in 0.45s cubic-bezier(0.2, 0, 0, 1) both;
}
.stat-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, var(--tile-glow, rgba(99,102,241,0.08)), transparent 55%);
  pointer-events: none;
  opacity: 0.9;
}
@keyframes stat-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.stat-tile:nth-child(1) { animation-delay: 0ms; }
.stat-tile:nth-child(2) { animation-delay: 60ms; }
.stat-tile:nth-child(3) { animation-delay: 120ms; }
.stat-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px -24px rgba(99, 102, 241, 0.35),
              0 2px 8px rgba(9, 9, 11, 0.04);
  border-color: #c7d2fe;
}
.stat-tile-icon {
  grid-row: 1;
  grid-column: 1;
  width: 40px; height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: var(--tile-icon-bg, linear-gradient(135deg, #6366f1, #8b5cf6));
  box-shadow: 0 8px 18px -10px var(--tile-icon-shadow, rgba(99, 102, 241, 0.5));
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.stat-tile-icon svg,
.stat-tile-icon .nav-icon,
.stat-tile-icon .i,
.stat-tile-icon .i-lg {
  width: 20px; height: 20px;
}
.stat-tile-main {
  grid-row: 1;
  grid-column: 2;
  min-width: 0;
  position: relative;
  z-index: 1;
}
.stat-tile-num {
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.stat-tile-label {
  font-size: 11px;
  color: var(--text-2);
  margin-top: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.stat-tile-foot {
  grid-row: 2;
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  z-index: 1;
}
.stat-tile-bar {
  flex: 1;
  height: 4px;
  background: var(--bg-subtle);
  border-radius: 999px;
  overflow: hidden;
}
.stat-tile-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  border-radius: 999px;
  transition: width 0.5s cubic-bezier(0.2, 0, 0, 1);
}
.stat-tile-hint {
  font-size: 11px;
  color: var(--text-3);
  font-weight: 500;
  white-space: nowrap;
}
/* Per-tile color themes */
.stat-tile-accent {
  --tile-glow: rgba(99, 102, 241, 0.10);
  --tile-icon-bg: linear-gradient(135deg, #6366f1, #8b5cf6);
  --tile-icon-shadow: rgba(99, 102, 241, 0.5);
}
.stat-tile-violet {
  --tile-glow: rgba(168, 85, 247, 0.10);
  --tile-icon-bg: linear-gradient(135deg, #8b5cf6, #ec4899);
  --tile-icon-shadow: rgba(168, 85, 247, 0.5);
}
.stat-tile-slate {
  --tile-glow: rgba(14, 165, 233, 0.10);
  --tile-icon-bg: linear-gradient(135deg, #0ea5e9, #6366f1);
  --tile-icon-shadow: rgba(14, 165, 233, 0.45);
}

/* ── Toolbar (search + meta) ───────────────────────────────── */
.conv-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.search-pill {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.search-pill:focus-within {
  border-color: #a5b4fc;
  box-shadow: 0 0 0 4px rgba(129, 140, 248, 0.15);
  background: #fff;
}
.search-pill.has-value {
  border-color: #c7d2fe;
}
.search-pill .search-icon {
  width: 18px; height: 18px;
  color: var(--text-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.search-pill:focus-within .search-icon { color: var(--accent); }
.search-pill .search-icon svg { width: 16px; height: 16px; }
.search-pill .search-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 13.5px;
  color: var(--text);
  outline: none;
  padding: 2px 0;
}
.search-pill .search-input::placeholder { color: var(--text-3); }
.search-pill .search-clear {
  width: 22px; height: 22px;
  border-radius: 999px;
  border: none;
  background: var(--bg-subtle);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}
.search-pill .search-clear:hover {
  background: var(--danger-soft);
  color: var(--danger);
}
.conv-toolbar-meta {
  flex-shrink: 0;
}
.conv-result-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  padding: 6px 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}

/* ── Conversation list + cards ─────────────────────────────── */
.conv-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.conv-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color 0.2s ease,
              box-shadow 0.2s ease,
              transform 0.2s cubic-bezier(0.2, 0, 0, 1);
  animation: conv-card-in 0.45s cubic-bezier(0.2, 0, 0, 1) both;
}
@keyframes conv-card-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.conv-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, #6366f1, #8b5cf6);
  transform: scaleY(0);
  transform-origin: center;
  transition: transform 0.25s cubic-bezier(0.2, 0, 0, 1);
}
.conv-card:hover {
  border-color: #c7d2fe;
  box-shadow: 0 12px 28px -20px rgba(99, 102, 241, 0.3);
}
.conv-card:hover::before { transform: scaleY(0.4); }
.conv-card.open {
  border-color: #c7d2fe;
  box-shadow: 0 16px 40px -22px rgba(99, 102, 241, 0.4);
}
.conv-card.open::before { transform: scaleY(1); }

.conv-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: background 0.15s ease;
}
.conv-head:hover { background: rgba(99, 102, 241, 0.04); }
.conv-card.open .conv-head { background: rgba(99, 102, 241, 0.06); }

.conv-avatar {
  width: 38px; height: 38px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.03em;
  flex-shrink: 0;
  box-shadow: 0 6px 14px -8px rgba(99, 102, 241, 0.4),
              inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.conv-head-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.conv-head-top {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}
.conv-head-preview {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.005em;
}
.conv-head-time {
  font-size: 11px;
  color: var(--text-3);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.conv-head-sub {
  font-size: 12px;
  color: var(--text-2);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.9;
}
.conv-head-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.conv-msg-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 8px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  border: 1px solid transparent;
  transition: background 0.15s ease;
}
.conv-card:hover .conv-msg-pill,
.conv-card.open .conv-msg-pill {
  background: #e0e7ff;
}
.conv-msg-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.conv-chev {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  transition: transform 0.28s cubic-bezier(0.2, 0, 0, 1),
              color 0.2s ease;
}
.conv-card.open .conv-chev {
  transform: rotate(180deg);
  color: var(--accent);
}

/* ── Conversation body (expanded transcript) ──────────────── */
.conv-body {
  padding: 4px 18px 18px;
  border-top: 1px dashed var(--border);
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.02), transparent 120px), var(--bg-subtle);
  animation: conv-slide-down 0.28s cubic-bezier(0.2, 0, 0, 1);
}
@keyframes conv-slide-down {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.conv-msgs {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 14px;
}

.msg-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  max-width: 82%;
}
.msg-row.msg-user {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.msg-row.msg-ai {
  align-self: flex-start;
}
.msg-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 10px -4px rgba(0, 0, 0, 0.2),
              inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.msg-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.msg-user .msg-content { align-items: flex-end; }
.msg-ai   .msg-content { align-items: flex-start; }
.msg-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-3);
  padding: 0 6px;
}
.msg-role { color: var(--text-2); }
.msg-ts   { font-variant-numeric: tabular-nums; font-weight: 500; }
.msg-bubble {
  padding: 11px 14px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  max-width: 100%;
  box-shadow: 0 2px 6px -2px rgba(9, 9, 11, 0.06);
}
.msg-user .msg-bubble {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.msg-ai .msg-bubble {
  background: #fff;
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.conv-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
}
.conv-actions-meta {
  font-size: 11px;
  color: var(--text-3);
  font-weight: 500;
}
.conv-actions .ghost-btn { display: inline-flex; align-items: center; gap: 6px; }
.conv-actions .ghost-btn svg { width: 14px; height: 14px; }

/* ── Empty / error / loading states ────────────────────────── */
.conv-state-card {
  padding: 56px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  animation: state-fade-in 0.35s ease both;
}
@keyframes state-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.conv-state-art {
  width: 56px; height: 56px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid #e0e7ff;
  margin-bottom: 6px;
}
.conv-state-art svg,
.conv-state-art .nav-icon,
.conv-state-art .i,
.conv-state-art .i-lg {
  width: 26px; height: 26px;
}
.conv-state-icon {
  width: 52px; height: 52px;
  border-radius: 50%;
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
}
.conv-state-icon-danger {
  background: var(--danger);
  box-shadow: 0 10px 24px -12px rgba(239, 68, 68, 0.5);
}
.conv-state-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.conv-state-body {
  font-size: 13px;
  color: var(--text-2);
  max-width: 420px;
  line-height: 1.55;
}

/* Skeleton loader */
.conv-skel-list .conv-skel {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.skel-avatar {
  width: 38px; height: 38px;
  border-radius: 12px;
  flex-shrink: 0;
}
.skel-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.skel-line {
  height: 10px;
  border-radius: 4px;
}
.skel-line-top { width: 68%; }
.skel-line-sub { width: 42%; height: 8px; }
.skel-meta {
  width: 48px; height: 22px;
  border-radius: 999px;
  flex-shrink: 0;
}
.skel-avatar,
.skel-line,
.skel-meta {
  background: linear-gradient(90deg, #f4f4f5 0%, #e8e8ea 50%, #f4f4f5 100%);
  background-size: 200% 100%;
  animation: skel-shimmer 1.4s ease-in-out infinite;
}
@keyframes skel-shimmer {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* ── Responsive collapse for narrower viewports ───────────── */
@media (max-width: 900px) {
  .stat-row { grid-template-columns: 1fr; }
  .conv-toolbar { flex-direction: column; align-items: stretch; }
  .conv-head-sub { display: none; }
}

/* ── Analytics page ───────────────────────────────────────── */
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
}
@media (max-width: 1100px) {
  .analytics-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 680px) {
  .analytics-grid { grid-template-columns: 1fr; }
}
.analytics-two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 14px;
  padding: 0 18px 18px;
}
@media (max-width: 1100px) {
  .analytics-two-col { grid-template-columns: 1fr; }
}

/* KPI card */
.kpi-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 18px 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform 0.22s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.22s ease, border-color 0.2s ease;
  animation: kpi-fade-in 0.4s cubic-bezier(0.2, 0, 0, 1) both;
}
@keyframes kpi-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.kpi-card:nth-child(1) { animation-delay: 0ms; }
.kpi-card:nth-child(2) { animation-delay: 50ms; }
.kpi-card:nth-child(3) { animation-delay: 100ms; }
.kpi-card:nth-child(4) { animation-delay: 150ms; }
.kpi-card:nth-child(5) { animation-delay: 200ms; }
.kpi-card:nth-child(6) { animation-delay: 250ms; }
.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px -24px rgba(99, 102, 241, 0.3);
  border-color: #c7d2fe;
}
.kpi-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, var(--kpi-glow, rgba(99,102,241,0.08)), transparent 55%);
  pointer-events: none;
}
.kpi-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: var(--kpi-icon-bg, linear-gradient(135deg,#6366f1,#8b5cf6));
  box-shadow: 0 8px 18px -10px var(--kpi-icon-shadow, rgba(99,102,241,0.5));
  margin-bottom: 4px;
  position: relative;
  z-index: 1;
}
.kpi-icon svg, .kpi-icon .i, .kpi-icon .nav-icon, .kpi-icon .i-lg { width: 18px; height: 18px; }
.kpi-label {
  font-size: 11px;
  color: var(--text-2);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  position: relative;
  z-index: 1;
}
.kpi-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
  position: relative;
  z-index: 1;
}
.kpi-sub {
  font-size: 12px;
  color: var(--text-3);
  font-weight: 500;
  position: relative;
  z-index: 1;
}
.kpi-bar {
  margin-top: 8px;
  height: 5px;
  background: var(--bg-subtle);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
  z-index: 1;
}
.kpi-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.2, 0, 0, 1);
}
/* Tone variants */
.kpi-accent  { --kpi-glow: rgba(99,102,241,0.10);  --kpi-icon-bg: linear-gradient(135deg,#6366f1,#8b5cf6); --kpi-icon-shadow: rgba(99,102,241,0.5); }
.kpi-violet  { --kpi-glow: rgba(168,85,247,0.10);  --kpi-icon-bg: linear-gradient(135deg,#8b5cf6,#ec4899); --kpi-icon-shadow: rgba(168,85,247,0.5); }
.kpi-emerald { --kpi-glow: rgba(16,185,129,0.10);  --kpi-icon-bg: linear-gradient(135deg,#10b981,#14b8a6); --kpi-icon-shadow: rgba(16,185,129,0.5); }
.kpi-sky     { --kpi-glow: rgba(14,165,233,0.10);  --kpi-icon-bg: linear-gradient(135deg,#0ea5e9,#6366f1); --kpi-icon-shadow: rgba(14,165,233,0.5); }
.kpi-amber   { --kpi-glow: rgba(245,158,11,0.10);  --kpi-icon-bg: linear-gradient(135deg,#f59e0b,#f97316); --kpi-icon-shadow: rgba(245,158,11,0.5); }
.kpi-slate   { --kpi-glow: rgba(100,116,139,0.08); --kpi-icon-bg: linear-gradient(135deg,#64748b,#475569); --kpi-icon-shadow: rgba(100,116,139,0.4); }

/* Card head/body used inside analytics sections */
.analytics-two-col .card-head,
.card > .card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 16px 18px 10px;
  gap: 12px;
  border-bottom: 1px dashed var(--border);
}
.card > .card-body { padding: 16px 18px 18px; }

/* SVG bar chart (horizontal) */
.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bar-chart-row {
  display: grid;
  grid-template-columns: 160px 1fr 48px;
  gap: 10px;
  align-items: center;
  animation: bar-row-in 0.5s cubic-bezier(0.2, 0, 0, 1) both;
}
@keyframes bar-row-in { from { opacity: 0; transform: translateX(-4px); } to { opacity: 1; transform: translateX(0); } }
.bar-chart-label {
  font-size: 12px;
  color: var(--text-2);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bar-chart-track {
  height: 10px;
  background: var(--bg-subtle);
  border-radius: 999px;
  overflow: hidden;
}
.bar-chart-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.2, 0, 0, 1);
}
.bar-chart-value {
  text-align: right;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* SVG column chart (vertical) */
.column-chart {
  width: 100%;
  height: auto;
  display: block;
}
.column-bar rect { animation: col-grow 0.6s cubic-bezier(0.2, 0, 0, 1) both; transform-origin: bottom center; }
@keyframes col-grow { from { transform: scaleY(0); opacity: 0; } to { transform: scaleY(1); opacity: 1; } }

.chart-empty {
  padding: 26px 0;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
  font-style: italic;
}

/* Radial gauge */
.gauge-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.gauge-svg { width: 140px; height: 140px; }
.gauge-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.gauge-foot { font-size: 11px; color: var(--text-3); }

/* Donut chart */
.donut-wrap {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 20px;
  align-items: center;
}
@media (max-width: 620px) { .donut-wrap { grid-template-columns: 1fr; justify-items: center; } }
.donut-svg { width: 140px; height: 140px; }
.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.donut-legend-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 12px;
}
.donut-legend-row:last-child { border-bottom: none; }
.donut-dot {
  width: 10px; height: 10px;
  border-radius: 3px;
}
.donut-label {
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.donut-value {
  color: var(--text-2);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Overview plan gauges side-by-side */
.overview-plan {
  display: flex;
  gap: 20px;
  justify-content: space-around;
  align-items: center;
  flex-wrap: wrap;
}

/* Usage tab grid */
.usage-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
}
@media (max-width: 1100px) { .usage-grid { grid-template-columns: 1fr; } }
.usage-panel .card-body { display: flex; flex-direction: column; gap: 14px; align-items: stretch; }
.usage-panel-body { flex-direction: row !important; align-items: center !important; }
@media (max-width: 620px) { .usage-panel-body { flex-direction: column !important; } }
.usage-panel-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 12px;
  color: var(--text-2);
}
.meta-row:last-child { border-bottom: none; }
.meta-row b {
  color: var(--text);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.meta-row b.good   { color: #10b981; }
.meta-row b.warn   { color: #f59e0b; }
.meta-row b.danger { color: #ef4444; }

.plan-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid #c7d2fe;
  margin-bottom: 6px;
  align-self: flex-start;
}
.plan-badge.plan-starter { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.plan-badge.plan-growth  { background: #eef2ff; color: #4338ca; border-color: #c7d2fe; }
.plan-badge.plan-scale   { background: #fdf4ff; color: #86198f; border-color: #f5d0fe; }
.plan-badge.plan-none    { background: var(--bg-subtle); color: var(--text-3); border-color: var(--border); }

/* Quality recent list */
.quality-recent-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.quality-recent-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color 0.18s ease, background 0.18s ease;
}
.quality-recent-row:hover {
  border-color: #c7d2fe;
  background: #fff;
}
.quality-recent-rating {
  font-size: 16px;
  line-height: 1;
  padding-top: 2px;
}
.quality-recent-body { min-width: 0; }
.quality-recent-q {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}
.quality-recent-a {
  font-size: 11px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.quality-recent-time {
  font-size: 10px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

/* Keep subtab-icons a consistent size inside the analytics tab strip */
.subtab .subtab-icon { width: 14px; height: 14px; }

