/* ============================================================
   Epicurus Pro — Account / Dashboard
   Light edition — matches the landing (Epicurus.one cool-light bg, white cards, ink text, single purple accent).
   ============================================================ */

:root {
  --bg:         #f8f9fc;
  --bg-soft:    #f0f1f6;
  --surface:    #ffffff;
  --border:     rgba(26,26,46,.08);
  --border-2:   rgba(26,26,46,.05);
  --text:       #1a1a2e;
  --text-secondary: #555580;
  --text-faint: #8888a4;
  --accent:     #883dff;
  --accent-2:   #00d2a0; /* secondary brand colour — overridden per-org on white-label subdomains */
  --accent-light: #c4a0ff;
  --grad:       linear-gradient(135deg, #1a1a2e 0%, #883dff 100%); /* Epicurus One ink→purple display gradient */
  --grad-soft:  linear-gradient(135deg, rgba(136,61,255,.12), rgba(160,107,255,.10));
  --green:      #00d2a0;
  --danger:     #d6455d;
  --shadow:     0 1px 2px rgba(26,26,46,.04), 0 18px 50px -28px rgba(26,26,46,.18);
  --shadow-lg:  0 30px 80px -40px rgba(136,61,255,.30);
  --radius:     16px;
  --font:       'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Inter', system-ui, sans-serif; /* Epicurus One parity — Inter black for headings */
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background:
    radial-gradient(60% 45% at 50% -8%, var(--grad-soft) 0%, transparent 70%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(136,61,255,.22); color: var(--text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border);
  background: rgba(248,249,252,.82);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  /* long white-label org names truncate instead of wrapping the whole header (mobile) */
  min-width: 0;
  flex: 1 1 auto;
}
#topbarWordmark { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
/* keep an org logo's ORIGINAL proportions — never squash to fill the square (capped box) */
.brand-icon { height: 28px; width: auto; max-width: 140px; max-height: 28px; object-fit: contain; }
/* top-left branded monogram tile — shown when a white-label org has no logo image yet */
.brand-mono {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 7px;
  background: var(--accent); color: #fff; font-weight: 800; font-size: 0.8rem; letter-spacing: -0.02em;
}
.brand-accent { color: var(--text-faint); font-weight: 500; }
/* mobile burger — hidden on desktop; paints only in the signed-in shell ≤860px */
.nav-burger {
  display: none;
  align-items: center; justify-content: center;
  width: 38px; height: 38px; flex-shrink: 0;
  border: 1px solid var(--border); border-radius: 10px;
  background: #fff; color: var(--text); cursor: pointer;
  transition: border-color .15s, background .15s;
}
.nav-burger:hover { border-color: var(--text-faint); }
.nav-burger svg { width: 20px; height: 20px; }
.nav-burger .nb-close { display: none; }
.nav-burger.open .nb-open { display: none; }
.nav-burger.open .nb-close { display: block; }
/* EpIcons — inline SVG icons replacing emojis; sized to sit in running text and buttons */
.ep-ico { display: inline-flex; width: 1.02em; height: 1.02em; vertical-align: -0.14em; flex: none; }
.ep-ico svg { width: 100%; height: 100%; }
.topbar-email {
  color: var(--text-secondary); font-size: 0.9rem;
  /* long emails (demo.admin@frasers.epicurus.pro) truncate — never squeeze the logout button */
  max-width: 300px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar-right { display: flex; align-items: center; gap: 0.85rem; flex-shrink: 0; min-width: 0; }
.btn-logout {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.85rem;
  padding: 0.38rem 0.85rem;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color .15s, border-color .15s, background .15s;
}
.btn-logout:hover { color: var(--text); border-color: var(--text-faint); background: rgba(0,0,0,.03); }
.btn-logout:disabled { opacity: .6; cursor: default; }

.app-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 1.5rem 1rem 2.5rem;
  font-size: 0.85rem;
  color: var(--text-faint);
}
.app-footer a { color: var(--text-secondary); text-decoration: none; }
.app-footer a:hover { color: var(--text); text-decoration: underline; }

.spend-meter { margin: 0.75rem 0 0.25rem; }
.spend-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(0,0,0,.08);
  overflow: hidden;
}
.spend-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent, #883dff), var(--accent-light, #c4a0ff));
  width: 0%;
  transition: width .4s ease;
}
.spend-legend {
  display: flex;
  justify-content: space-between;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.spend-legend strong { color: var(--text); }

.feedback-choice { display: flex; gap: 0.6rem; margin: 0.6rem 0 1rem; }
.btn-choice {
  flex: 1;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.btn-choice:hover { border-color: var(--text-faint); color: var(--text); }
.btn-choice.selected {
  border-color: var(--accent, #883dff);
  color: var(--accent, #883dff);
  background: rgba(136,61,255,.08);
  font-weight: 600;
}
.access-toggles { margin: 0.6rem 0 0.2rem; display: flex; flex-direction: column; gap: 0.5rem; }
.access-toggle { display: flex; align-items: flex-start; gap: 0.55rem; font-size: 0.9rem; color: var(--text); cursor: pointer; }
.access-toggle input { margin-top: 0.2rem; }
.access-toggle small { display: block; color: var(--text-faint); font-size: 0.78rem; margin-top: 0.1rem; }

#feedbackReason {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
  font: inherit;
  font-size: 0.9rem;
  resize: vertical;
  margin: 0.35rem 0 0.85rem;
  background: #fff;
  color: var(--text);
}

.shell { max-width: 960px; margin: 0 auto; padding: 2.75rem 1.5rem 4rem; }

.panel h1, .dash-header h1 {
  font-family: var(--font-display);
  font-size: 1.95rem;
  font-weight: 900; /* Epicurus One — Inter black headings */
  letter-spacing: -0.035em;
  margin-bottom: 0.5rem;
}
.lede { color: var(--text-secondary); margin-bottom: 1.5rem; max-width: 460px; }

.login-form { display: flex; flex-direction: column; gap: 0.75rem; max-width: 420px; }
.login-form label { font-size: 0.82rem; font-weight: 500; color: var(--text-secondary); }
.login-form input {
  padding: 0.8rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.login-form input::placeholder { color: var(--text-faint); }
.login-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(136,61,255,.12);
}

/* Buttons — match the landing page exactly: ink pill primary + ghost/outline secondary,
   pill radius, inline-flex so <a class="btn"> renders as a real button (no underline/cramp). */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 100px;
  padding: 0.8rem 1.4rem;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, border-color 0.2s ease;
}
.btn-primary { background: var(--text); color: #fff; box-shadow: var(--shadow); } /* landing ink pill */
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 18px 40px -18px rgba(24,19,32,.55); }
.btn-primary:disabled { opacity: 0.6; cursor: progress; transform: none; box-shadow: none; }
.btn-secondary { background: #fff; color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg-soft); border-color: var(--text-faint); transform: translateY(-2px); }
/* a button inside a card must never overflow it — long labels (e.g. "Add / manage payment method")
   wrap instead of spilling past the card's right edge (default .btn white-space is nowrap). */
.card .btn { max-width: 100%; white-space: normal; }

.hint { color: var(--danger); margin-top: 0.75rem; font-size: 0.9rem; }
.hint.ok { color: var(--green); }

.trial-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.32rem 0.8rem;
  border-radius: 999px;
  background: var(--grad-soft);
  border: 1px solid rgba(136,61,255,.22);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 1rem;
}
.trial-badge::before { content: '✦'; }

.fine-print { margin-top: 0.6rem; font-size: 0.8rem; color: var(--text-faint); }

.consent {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin-top: 0.35rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.45;
}
.consent input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-top: 0.15rem;
  flex-shrink: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.consent a { color: var(--accent); text-decoration: none; font-weight: 600; }
.consent a:hover { text-decoration: underline; }

/* beta window: the review-consent disclosure INSIDE the Terms label (hidden outside beta) */
.consent-beta {
  display: block;
  margin: 0.4rem 0 0;
  padding: 0.5rem 0.7rem;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--text-secondary);
  background: var(--accent-soft, rgba(123, 107, 255, 0.08));
  border-radius: 10px;
}
.consent-beta[hidden] { display: none; }

.credit-balance {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.4rem 0 1.1rem;
  max-width: 420px;
  color: var(--text-faint);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.oauth-stack { display: flex; gap: 0.65rem; max-width: 420px; }
.btn-oauth {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  flex: 1;
  padding: 0.78rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.18s, border-color 0.18s, transform 0.15s;
}
.btn-oauth:hover { background: var(--bg-soft); border-color: var(--text-faint); transform: translateY(-1px); }
.btn-oauth.slack:hover { border-color: rgba(224,30,90,.45); }
.btn-oauth.microsoft:hover { border-color: rgba(0,120,212,.45); }
.btn-oauth.is-disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
/* branded connect buttons in a card (Teams/Slack) — app logo + label, compact (not full-width, not black) */
.btn-connect { display: inline-flex; flex: 0 0 auto; gap: 0.55rem; }
.btn-oauth .conn-icon { width: 20px; height: 20px; flex-shrink: 0; }
.oauth-icon { width: 18px; height: 18px; flex-shrink: 0; }

.auth-tabs { display: flex; gap: 0.5rem; margin-bottom: 1.25rem; max-width: 420px; }
.auth-tab {
  flex: 1;
  padding: 0.65rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: 0.18s ease;
}
.auth-tab:hover { color: var(--text); border-color: var(--text-faint); }
.auth-tab.active {
  color: var(--accent);
  border-color: rgba(136,61,255,.35);
  background: var(--grad-soft);
}

.label-optional { font-weight: 400; color: var(--text-faint); }
.field-hint { display: block; font-weight: 400; color: var(--text-faint); font-size: 0.78rem; margin: 0.15rem 0 0.35rem; }

.team-list { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.team-member {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--border-2);
}
.team-member:last-child { border-bottom: none; }
.team-member-info { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.team-member-name { font-size: 0.95rem; font-weight: 600; }
.team-member-email { font-size: 0.85rem; color: var(--text-secondary); }

/* sign-in domains card */
.domain-list { list-style: none; display: flex; flex-direction: column; gap: 0.35rem; margin: 0 0 1rem; padding: 0; }
.domain-row { display: flex; align-items: center; gap: 0.6rem; padding: 0.55rem 0; border-bottom: 1px solid var(--border-2); flex-wrap: wrap; }
.domain-row:last-child { border-bottom: none; }
.domain-empty { color: var(--text-faint); font-size: 0.9rem; }
.domain-name { font-weight: 600; font-family: ui-monospace, Menlo, monospace; font-size: 0.92rem; }
.domain-chip {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 0.12rem 0.55rem; border-radius: 999px; border: 1px solid var(--border);
  color: var(--text-secondary); background: var(--bg-soft);
}
.domain-chip.on { color: var(--accent); background: var(--grad-soft); border-color: rgba(136,61,255,.25); }
.domain-row .btn-mini { margin-left: auto; }

/* phone numbers tile */
.number-list { list-style: none; display: flex; flex-direction: column; gap: 0.4rem; margin: 0 0 1rem; padding: 0; }
.number-row { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; padding: 0.55rem 0; border-bottom: 1px solid var(--border-2); }
.number-row:last-child { border-bottom: none; }
.number-e164 { font-size: 0.95rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.number-empty { color: var(--text-secondary); font-size: 0.9rem; }
.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.82rem; }
.btn-ghost { background: transparent; color: var(--text-secondary); border-color: transparent; }
.btn-ghost:hover { color: var(--text); background: var(--bg-soft); }

.role-badge {
  flex-shrink: 0;
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.role-badge-admin { border-color: rgba(136,61,255,.35); background: var(--grad-soft); color: var(--accent); }

/* min-width:0 + shrink so the row WRAPS on narrow screens instead of dragging the whole
   dashboard past the viewport (5 buttons ≈ 460px — wider than a phone) */
.team-member-actions { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 1; min-width: 0; flex-wrap: wrap; justify-content: flex-end; }

.btn-mini {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn-mini:hover { background: var(--bg-soft); border-color: var(--text-faint); color: var(--text); }
.btn-mini:disabled { opacity: 0.5; cursor: progress; }
.btn-mini-danger { color: var(--danger); border-color: rgba(214,69,93,.30); }
.btn-mini-danger:hover { background: rgba(214,69,93,.08); border-color: var(--danger); color: var(--danger); }

.add-member-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}
.add-member-form label { font-size: 0.82rem; color: var(--text-secondary); }
.add-member-form input {
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font: inherit;
}
.add-member-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(136,61,255,.12); }
.add-member-form .dash-subheading { margin-top: 0; }
.add-member-form textarea {
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font: inherit;
  resize: vertical;
}
.add-member-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(136,61,255,.12); }

/* persona editor row spans the full team-list width under a member */
.persona-editor { list-style: none; }
.persona-editor .add-member-form { margin-top: 0.75rem; }
.persona-jump { margin-bottom: 0.5rem; }

/* Connect Teams card */
.connect-steps { margin: 0.95rem 0 0.75rem; padding-left: 1.2rem; color: var(--text-secondary); font-size: 0.9rem; }
.connect-steps li { margin: 0.35rem 0; }
#teamsStatus.connected { color: var(--text); }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem;
  box-shadow: var(--shadow);
}
.card-wide { grid-column: 1 / -1; }
/* view roots that render sibling cards OUTSIDE the .cards grid (Licenses, Usage, …) get the
   same breathing room the grid gives — bare <article.card> siblings were stuck together */
.dashboard.view > .card + .card { margin-top: 1.1rem; }
.card h2 { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; margin-bottom: 0.75rem; }
.card-meta { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 1rem; }

/* Licenses summary tile on the home dashboard — counts only, purchase lives in the Licenses view */
.lic-mini { display: flex; gap: 0.6rem; flex-wrap: wrap; margin: 0.35rem 0 0.9rem; }
.lic-mini-stat {
  flex: 1 1 76px; display: flex; flex-direction: column; gap: 0.1rem;
  background: var(--bg-soft); border: 1px solid var(--border-2); border-radius: 12px;
  padding: 0.6rem 0.75rem;
}
.lic-mini-stat strong { font-family: var(--font-display); font-weight: 800; font-size: 1.2rem; line-height: 1.2; }
.lic-mini-stat span { font-size: 0.74rem; color: var(--text-faint); }
/* a CTA that closes a stat card — full width so it reads as the card's single action */
.card .card-cta { width: 100%; margin-top: 0.85rem; }

/* "Meet your colleague" launcher — the org's own subdomain home */
#orgLauncherCard { border-color: rgba(136,61,255,.35); background: var(--grad-soft, rgba(136,61,255,.05)); }
.org-launcher { display: flex; align-items: center; flex-wrap: wrap; gap: 1rem; }
.org-address { display: flex; flex-direction: column; gap: 0.3rem; }
.org-address .org-name { font-weight: 700; font-size: 1rem; }
.org-address .org-host {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9rem; color: var(--accent);
  background: rgba(136,61,255,.08); padding: 0.2rem 0.55rem; border-radius: 8px;
  align-self: flex-start;
}
.org-launcher .btn { margin-left: auto; }

/* home-panel quick stats — people · burn · trajectory · hours saved */
.home-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem; margin: 1.1rem 0 1rem;
}
.home-stat {
  display: flex; flex-direction: column; gap: 0.15rem;
  background: var(--surface); border: 1px solid var(--border-2);
  border-radius: 12px; padding: 0.85rem 1rem;
}
.home-stat-value {
  font-family: var(--font-display); font-size: 1.55rem; font-weight: 800;
  letter-spacing: -0.02em; line-height: 1.15; color: var(--text);
}
.home-stat.is-up .home-stat-value { background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.home-stat.is-down .home-stat-value { color: #b3541e; }
.home-stat-label { font-size: 0.82rem; font-weight: 700; color: var(--text); }
.home-stat-sub { font-size: 0.76rem; color: var(--text-secondary); }

.dash-header { display: flex; align-items: center; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1.5rem; }
.dash-logo { width: 32px; height: 32px; object-fit: contain; border-radius: 6px; }

.surface-badge {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(136,61,255,.3);
  background: var(--grad-soft);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: capitalize;
}
/* universal "powered by" pill next to the org-name heading — Epicurus logo + epicurus.pro. Neutral
   (not the org accent) so it reads as the platform mark on every dashboard, white-label or not. */
.brand-pill {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.22rem 0.62rem 0.22rem 0.42rem;
  border-radius: 999px; border: 1px solid var(--border);
  background: #fff; color: var(--text-secondary);
  font-size: 0.8rem; font-weight: 600;
}
.brand-pill-logo { width: 15px; height: 15px; object-fit: contain; border-radius: 4px; }

.dash-subheading {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin: 1rem 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.dash-subheading:first-child { margin-top: 0; }

#dashConnections .card-meta { margin-bottom: 0; }
#dashUsage .usage-summary p + p { margin-top: 0.35rem; }

.apps { list-style: none; display: flex; flex-direction: column; gap: 0.65rem; }
.apps li { display: flex; align-items: center; gap: 0.5rem; text-transform: capitalize; }

.dot { width: 8px; height: 8px; border-radius: 50%; background: #cfcad6; }
.dot.on { background: var(--green); box-shadow: 0 0 8px rgba(0,210,160,.45); }
/* brand glyph beside a connected surface (Slack/Teams/…) in the connections list */
.apps .conn-icon { width: 16px; height: 16px; display: block; flex-shrink: 0; }
/* People & Mailboxes: breathing room between the people-table card and the "Add someone" card */
#peopleView .card + .card { margin-top: 1.25rem; }

.usage-summary { color: var(--text-secondary); margin-bottom: 1rem; line-height: 1.5; }
.usage-bars { display: flex; flex-direction: column; gap: 0.75rem; }
.usage-row {
  display: grid;
  grid-template-columns: 168px 1fr 76px;
  gap: 0.75rem;
  align-items: center;
  font-size: 0.9rem;
}
/* model-lane identity: icon chip + name (+ optional sub-label, e.g. Fable 5 · ultra thinking) */
.usage-label { display: flex; align-items: center; gap: 0.55rem; min-width: 0; }
.usage-ico {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 9px;
  background: var(--grad-soft); border: 1px solid rgba(136,61,255,.18); color: var(--accent);
}
.usage-ico svg { width: 16px; height: 16px; }
.usage-label-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; font-weight: 600; }
.usage-label-txt small { font-size: 0.7rem; font-weight: 600; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.04em; }
.usage-val {
  display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25;
  font-variant-numeric: tabular-nums; font-weight: 700; text-align: right; white-space: nowrap;
}
.usage-val small { font-size: 0.7rem; font-weight: 600; color: var(--text-faint); }
.bar-track { height: 8px; background: var(--bg-soft); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); border-radius: 999px; }

.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--text);
  color: #fff;
  border: none;
  padding: 0.85rem 1.1rem;
  border-radius: 12px;
  box-shadow: var(--shadow);
  max-width: 340px;
}

/* tappable action pop-up (e.g. "reload to see your new branding") — whole card is the button */
.toast-action {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 60;
  display: flex; align-items: center; gap: 0.8rem;
  background: var(--text); color: #fff; border: none; cursor: pointer;
  padding: 1rem 1.2rem; border-radius: 14px; box-shadow: var(--shadow);
  max-width: 360px; text-align: left; font: inherit;
  animation: toastIn .28s cubic-bezier(.34,1.56,.64,1);
}
.toast-action:hover { transform: translateY(-2px); }
.toast-action .toast-action-emoji { font-size: 1.3rem; }
.toast-action .toast-action-text { display: flex; flex-direction: column; gap: 0.1rem; }
.toast-action .toast-action-text strong { font-size: 0.92rem; }
.toast-action .toast-action-text span { font-size: 0.8rem; opacity: 0.75; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

[hidden] { display: none !important; }

/* ============================================================
   Registration surface picker — Slack / Teams primary, Other secondary
   ============================================================ */
.surface-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.9rem;
  max-width: 640px;
  margin: 0.5rem 0 1.1rem;
}
.surface-skeleton {
  grid-column: 1 / -1;
  padding: 2rem;
  text-align: center;
  color: var(--text-faint);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}
.surface-card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  text-align: left;
  padding: 1.2rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  font: inherit;
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.16s ease, box-shadow 0.2s ease, border-color 0.18s ease;
}
.surface-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: rgba(136,61,255,.35); }
.surface-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.surface-slack:hover { border-color: rgba(224,30,90,.45); }
.surface-teams:hover { border-color: rgba(80,89,201,.5); }
.surface-card.is-disabled { opacity: 0.55; cursor: not-allowed; }
.surface-card.is-disabled:hover { transform: none; box-shadow: var(--shadow); border-color: var(--border); }

.surface-card-head { display: flex; align-items: center; gap: 0.7rem; }
.surface-card-head > div { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.surface-card-head strong { font-family: var(--font-display); font-size: 1.05rem; font-weight: 800; letter-spacing: -0.02em; }
.surface-tagline { font-size: 0.8rem; color: var(--text-secondary); }
.surface-icon { width: 30px; height: 30px; flex-shrink: 0; }
.surface-go { font-size: 1.2rem; color: var(--text-faint); transition: transform 0.16s ease, color 0.16s ease; }
.surface-card:hover .surface-go { transform: translateX(3px); color: var(--accent); }

.surface-steps { list-style: none; display: flex; flex-direction: column; gap: 0.4rem; margin: 0; padding: 0; }
.surface-steps li { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; color: var(--text-secondary); }
.step-n {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; flex-shrink: 0;
  border-radius: 50%; background: var(--grad-soft); color: var(--accent);
  font-size: 0.7rem; font-weight: 700;
}
.surface-disabled-note { font-size: 0.78rem; color: var(--text-faint); margin: 0; }

.other-toggle {
  display: inline-flex; align-items: center; gap: 0.35rem;
  margin-top: 0.4rem;
  background: none; border: none; padding: 0.3rem 0;
  font: inherit; font-size: 0.9rem; font-weight: 600;
  color: var(--text-secondary); cursor: pointer;
}
.other-toggle:hover { color: var(--accent); }
.other-toggle .chev { transition: transform 0.2s ease; font-size: 0.75rem; }
.other-toggle.open .chev { transform: rotate(180deg); }

.other-panel { margin-top: 1rem; animation: otherIn 0.25s ease; }
@keyframes otherIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.other-surfaces { display: flex; flex-wrap: wrap; gap: 0.65rem; }
.other-chip {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.55rem 0.85rem;
  border-radius: 999px; border: 1px solid var(--border);
  background: #fff; color: var(--text); text-decoration: none;
  font-size: 0.85rem;
}
.other-icon { width: 18px; height: 18px; flex-shrink: 0; }
.other-chip-label { font-weight: 600; }
.other-chip-note { color: var(--text-faint); font-size: 0.78rem; }

.consent-flash { animation: consentFlash 1.4s ease; border-radius: 10px; }
@keyframes consentFlash {
  0%, 100% { background: transparent; }
  20%, 60% { background: rgba(214,69,93,.10); box-shadow: 0 0 0 3px rgba(214,69,93,.12); }
}

@media (max-width: 640px) {
  .topbar { padding: 0.85rem 1rem; }
  /* the signed-in email lives in the org switcher chip's dropdown — drop it from the cramped
     mobile header so the brand + chip + Log out sit clean on one line */
  .topbar-email { display: none; }
  .btn-logout { padding: 0.32rem 0.65rem; font-size: 0.8rem; }
  .shell { padding-top: 1.5rem; padding-left: 1.1rem; padding-right: 1.1rem; }
  /* one rogue wide element must never drag the whole page sideways again (the People-table
     nowrap columns were h-scrolling the entire dashboard, clipping every panel) */
  body.app-mode .shell { overflow-x: clip; }
  .card { padding: 1.1rem; }
  /* phones: lane name left + count right on one line, the bar full-width beneath */
  .usage-row { grid-template-columns: 1fr auto; gap: 0.4rem 0.6rem; }
  .usage-row .usage-label { grid-row: 1; grid-column: 1; }
  .usage-row .usage-val { grid-row: 1; grid-column: 2; }
  .usage-row .bar-track { grid-row: 2; grid-column: 1 / -1; }
  .surface-picker { grid-template-columns: 1fr; }
  /* team rows stack on phones: name on top, action buttons wrapping beneath */
  .team-member { flex-direction: column; align-items: flex-start; gap: 0.55rem; }
  .team-member-actions { justify-content: flex-start; }
  /* long addresses / hosts / code snippets wrap instead of forcing width */
  .card-meta code, .people-sub, .card-meta, .people-addr, .srv-host, .aff-link,
  .intg-voice-steps code, .org-address .org-host, .lede { overflow-wrap: anywhere; }

  /* ── Branding: the fetch form stacks; palette chips wrap cleanly ── */
  #brandingView .brand-extract .btn { width: 100%; }
  #brandingView .brand-extract input[type=text] { min-width: 0; flex: 1 1 100%; }

  /* modal action rows never overflow the card */
  .pp-modal-actions, .intg-modal-actions { flex-wrap: wrap; row-gap: 0.5rem; }
}
/* People/Integrations/modal MOBILE overrides live at the BOTTOM of this sheet — their base
   rules are declared later than this block, and equal-specificity rules resolve by file order,
   so overrides declared here silently lose (the People nowrap cells were h-dragging phones). */

/* ============================================================
   App shell — sidebar + workspace (Viktor-style layout, our purple)
   ============================================================ */
.layout { display: flex; align-items: flex-start; }
.sidebar {
  position: sticky;
  top: 61px; /* under the topbar */
  align-self: stretch;
  width: 280px;
  flex-shrink: 0;
  height: calc(100vh - 61px);
  border-right: 1px solid var(--border);
  background: rgba(255,255,255,.55);
  backdrop-filter: blur(8px);
  padding: 1.1rem 0.85rem;
  display: flex;
  flex-direction: column;
}
.side-nav { display: flex; flex-direction: column; gap: 0.15rem; flex: 1; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background .15s, color .15s, border-color .15s;
}
.nav-item:hover { background: var(--bg-soft); color: var(--text); }
.nav-item.active {
  background: var(--grad-soft);
  color: var(--accent);
  border-color: rgba(136,61,255,.22);
}
.nav-item .nav-ico { width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; opacity: .9; }
.nav-item .nav-ico svg { width: 18px; height: 18px; }
.nav-item.active .nav-ico { opacity: 1; }
.nav-item.is-soon { cursor: default; opacity: .55; }
.nav-item.is-soon:hover { background: transparent; color: var(--text-secondary); }
.soon-pill {
  margin-left: auto;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.05rem 0.4rem;
}
.side-divider {
  margin: 0.9rem 0.75rem 0.4rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-faint);
}

.side-foot { position: relative; border-top: 1px solid var(--border); padding-top: 0.7rem; margin-top: 0.5rem; }
.org-switch {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.55rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  font: inherit;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: border-color .15s, box-shadow .15s;
}
.org-switch:hover { border-color: var(--text-faint); }
.org-avatar {
  width: 30px; height: 30px; flex-shrink: 0;
  border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--grad); color: #fff;
  font-weight: 800; font-size: 0.9rem;
}
.org-switch-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.org-switch-text strong { font-size: 0.88rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.org-switch-text small { font-size: 0.75rem; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.org-switch-chev { color: var(--text-faint); font-size: 0.8rem; }
.org-menu {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0; right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 0.5rem;
  z-index: 20;
}
.org-menu-label { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-faint); padding: 0.25rem 0.5rem; }
.org-menu-current { font-size: 0.9rem; font-weight: 700; padding: 0.1rem 0.5rem 0.15rem; }
/* signed-in identity inside the dropdown — carries what the compact mobile chip hides */
.org-menu-email {
  font-size: 0.78rem; color: var(--text-faint); padding: 0 0.5rem 0.45rem;
  border-bottom: 1px solid var(--border-2); margin-bottom: 0.3rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.org-menu-item {
  display: block; width: 100%; text-align: left;
  padding: 0.5rem; border: none; background: transparent;
  font: inherit; font-size: 0.88rem; color: var(--text); border-radius: 8px;
  cursor: pointer; text-decoration: none;
}
.org-menu-item:hover { background: var(--bg-soft); }

/* multi-entity switcher rows (#37/#50) — mounted by DashboardOrgSwitcher when linked into >1 org */
.org-menu-switch-label { border-top: 1px solid var(--border-2); margin-top: 0.3rem; padding-top: 0.5rem; }
.org-menu-org {
  display: flex; align-items: center; gap: 0.5rem; width: 100%; text-align: left;
  padding: 0.45rem 0.5rem; border: none; background: transparent;
  font: inherit; border-radius: 8px; cursor: pointer;
}
.org-menu-org:hover:not(:disabled) { background: var(--bg-soft); }
.org-menu-org:disabled { cursor: default; }
.org-menu-org .org-row-avatar {
  width: 26px; height: 26px; border-radius: 8px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent, #883dff); color: #fff; font-size: 0.78rem; font-weight: 800;
}
.org-menu-org .org-row-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.org-menu-org .org-row-text strong { font-size: 0.86rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.org-menu-org .org-row-text small { font-size: 0.72rem; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.org-menu-org .org-row-check { color: var(--accent, #883dff); font-weight: 800; flex: none; }

/* in app mode the sidebar + workspace are one centered block on wide screens */
body.app-mode .layout { max-width: 1400px; margin: 0 auto; }
body.app-mode .shell { max-width: none; margin: 0; padding: 2.25rem 2.75rem 4rem; flex: 1; min-width: 0; }
/* full-bleed topbar; only inset its content to the centered block once the layout actually
   centers (>=1401px). Below that the layout is full-bleed, so the topbar keeps its base padding. */
@media (min-width: 1401px) {
  body.app-mode .topbar { padding-left: calc(50% - 700px); padding-right: calc(50% - 700px); }
}

@media (max-width: 860px) {
  /* stretch (not flex-start) — fit-content sizing let one wide row widen the whole shell
     past the viewport and h-scroll the page; stretched, the shell IS the viewport width */
  .layout { flex-direction: column; align-items: stretch; }
  /* fixed topbar height so the drawer can dock exactly beneath it */
  .topbar { height: 56px; padding: 0 1rem; }
  body.app-mode .nav-burger { display: inline-flex; }
  /* the sidebar becomes a burger-opened DRAWER — the old swipe tab strip read as a static menu,
     so nobody discovered the sections past the fold (Filip's Jul-9 mobile call) */
  .sidebar {
    position: fixed; top: 56px; left: 0; bottom: 0; z-index: 40;
    width: min(300px, 84vw); height: auto;
    border-right: 1px solid var(--border);
    background: rgba(255,255,255,.97); backdrop-filter: blur(12px);
    box-shadow: 0 24px 60px -18px rgba(26,26,46,.35);
    flex-direction: column; gap: 0;
    padding: 0.9rem 0.85rem;
    overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
    transform: translateX(-104%);
    transition: transform .28s cubic-bezier(.22,.61,.36,1);
  }
  .sidebar.open { transform: none; }
  .side-nav { flex-direction: column; gap: 0.2rem; }
  .nav-item { padding: 0.7rem 0.8rem; font-size: 0.98rem; }
  .side-divider, .nav-item.is-soon { display: none; }
  /* dimmed backdrop behind the open drawer — tap anywhere outside to close */
  .nav-scrim {
    position: fixed; inset: 56px 0 0 0; z-index: 35;
    background: rgba(26,26,46,.35); backdrop-filter: blur(2px);
    opacity: 0; pointer-events: none; transition: opacity .22s ease;
  }
  .nav-scrim.show { opacity: 1; pointer-events: auto; }
  body.nav-open { overflow: hidden; }
  @media (prefers-reduced-motion: reduce) {
    .sidebar, .nav-scrim { transition: none; }
  }
  /* org/account switcher: the big card is redundant here — app.js relocates #sideFoot into the
     topbar as a compact avatar chip (name + email live in its dropdown). */
  .side-foot { border-top: none; padding-top: 0; margin-top: 0; }
  .topbar-right .side-foot { width: auto; }
  .topbar-right .org-switch {
    width: auto; padding: 0.22rem; border-radius: 999px; gap: 0.25rem;
  }
  .topbar-right .org-avatar { width: 28px; height: 28px; border-radius: 50%; font-size: 0.85rem; }
  .topbar-right .org-switch-text { display: none; }
  .topbar-right .org-switch-chev { font-size: 0.7rem; padding-right: 0.15rem; }
  .topbar-right .org-menu {
    bottom: auto; top: calc(100% + 8px);
    left: auto; right: 0; width: min(270px, calc(100vw - 2rem));
  }
  /* sidebar-docked fallback (signed-out / pre-relocation): dropdown opens downward */
  .sidebar .org-menu { bottom: auto; top: calc(100% + 6px); }
  body.app-mode .shell { padding: 1.75rem 1.25rem 3rem; }
}

/* ============================================================
   Integrations view
   ============================================================ */
.intg-skeleton { padding: 3rem; text-align: center; color: var(--text-faint); border: 1px dashed var(--border); border-radius: var(--radius); }
.intg-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.intg-head-text h1 { font-family: var(--font-display); font-size: 1.95rem; font-weight: 900; letter-spacing: -0.035em; margin-bottom: 0.35rem; }
.intg-head .lede { margin-bottom: 0; }
.intg-add-wrap { position: relative; }
.intg-add-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30;
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow); padding: 0.4rem; min-width: 180px;
  display: flex; flex-direction: column;
}
.intg-add-menu button {
  text-align: left; padding: 0.55rem 0.7rem; border: none; background: transparent;
  font: inherit; font-size: 0.9rem; font-weight: 600; color: var(--text); border-radius: 8px; cursor: pointer;
}
.intg-add-menu button:hover { background: var(--bg-soft); color: var(--accent); }

.intg-search { position: relative; margin-bottom: 1.75rem; max-width: 560px; }
.intg-search-ico { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--text-faint); font-size: 1.05rem; }
.intg-search input {
  width: 100%;
  padding: 0.8rem 1rem 0.8rem 2.5rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
}
.intg-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(136,61,255,.12); }

.intg-sections { display: flex; flex-direction: column; gap: 1.75rem; }
.intg-section-title { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-secondary); margin-bottom: 0.85rem; }
.intg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 0.85rem; }

.intg-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem 1.05rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
  font: inherit;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .2s ease, border-color .18s ease;
}
.intg-card::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: 0 0 0 0 rgba(136,61,255,0); transition: box-shadow .2s ease;
}
.intg-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: rgba(136,61,255,.4); }
.intg-card:hover::after { box-shadow: 0 0 0 3px rgba(136,61,255,.10); }
.intg-card:active { transform: translateY(-1px); }
.intg-card .intg-icon { transition: transform .18s cubic-bezier(.34,1.56,.64,1); }
.intg-card:hover .intg-icon { transform: scale(1.08) rotate(-2deg); }
.intg-card-body { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 0.15rem; }
.intg-card-body strong { font-size: 0.98rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.intg-card-meta { display: flex; align-items: center; gap: 0.4rem; font-size: 0.82rem; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.intg-card-go { color: var(--text-faint); font-size: 1.05rem; opacity: .35; transition: transform .18s ease, color .18s ease, opacity .18s ease; }
.intg-card:hover .intg-card-go { transform: translateX(4px); color: var(--accent); opacity: 1; }

/* stagger-in on first render */
@keyframes intgIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.intg-card.intg-in { animation: intgIn .34s cubic-bezier(.22,.61,.36,1) both; }

/* header actions + connected count chip */
.intg-head-actions { display: flex; align-items: center; gap: 0.7rem; }
.intg-count-chip {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.4rem 0.8rem; border-radius: 999px;
  border: 1px solid rgba(0,210,160,.28); background: rgba(0,210,160,.08);
  color: #0a8f73; font-size: 0.82rem; font-weight: 700; white-space: nowrap;
}
.intg-caret { font-size: 0.7rem; opacity: .7; }
.intg-menu-ico { display: inline-block; width: 1.1rem; text-align: center; margin-right: 0.15rem; }

/* section count chip */
.intg-section-title { display: flex; align-items: center; gap: 0.5rem; }
.intg-section-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.25rem; height: 1.25rem; padding: 0 0.35rem;
  border-radius: 999px; background: var(--bg-soft); border: 1px solid var(--border);
  color: var(--text-faint); font-size: 0.7rem; font-weight: 700; letter-spacing: 0;
}

.intg-icon {
  flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 11px;
  overflow: hidden;
  font-weight: 800;
  border: 1px solid var(--border);
  background: #fff;
}
.intg-icon svg, .intg-icon img { width: 58%; height: 58%; object-fit: contain; }
.intg-icon.has-logo { background: #fff; box-shadow: inset 0 0 0 1px rgba(26,26,46,.02); }
/* refined pastel monogram — soft brand-hue tint + deeper letter, cohesive across the grid */
.intg-icon.is-mono {
  background: hsl(var(--tile-h, 265) 72% 96%);
  border-color: hsl(var(--tile-h, 265) 60% 90%);
  color: hsl(var(--tile-h, 265) 48% 46%);
}
/* branded color chip — official brand hex + white initial (logo dropped upstream) */
.intg-icon.is-brandtint {
  background: var(--tint, var(--accent));
  border-color: rgba(0,0,0,.08);
  color: var(--tint-fg, #fff); /* dark ink on light tints, white on dark — set per-tile in JS */
}
/* custom-connector kind glyph (API / MCP / Browser) */
.intg-icon.is-kind { background: var(--grad-soft); border-color: rgba(136,61,255,.22); color: var(--accent); }
.intg-icon.is-kind.is-kind-api { background: rgba(0,210,160,.12); border-color: rgba(0,210,160,.3); color: #0a8f73; }
.intg-icon.is-kind.is-kind-browser { background: rgba(45,140,255,.12); border-color: rgba(45,140,255,.3); color: #1f6fd6; }
.intg-icon.is-kind svg { width: 54%; height: 54%; }
.intg-icon-md { width: 42px; height: 42px; font-size: 1.05rem; }
.intg-icon-lg { width: 60px; height: 60px; font-size: 1.6rem; border-radius: 14px; }

.intg-dot { width: 7px; height: 7px; border-radius: 50%; background: #cfcad6; flex-shrink: 0; }
.intg-dot.on { background: var(--green); box-shadow: 0 0 7px rgba(0,210,160,.5); }
.intg-tag {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
  color: var(--accent); background: var(--grad-soft); border: 1px solid rgba(136,61,255,.22);
  border-radius: 999px; padding: 0.08rem 0.5rem;
}

.intg-empty { padding: 2rem; text-align: center; color: var(--text-secondary); border: 1px dashed var(--border); border-radius: var(--radius); }
.intg-empty .btn { margin-top: 0.85rem; display: inline-block; }
.intg-searching { border-style: none; padding: 1rem; font-size: 0.88rem; animation: intgPulse 1.2s ease-in-out infinite; }
@keyframes intgPulse { 0%, 100% { opacity: .45; } 50% { opacity: .9; } }
.intg-empty-lg strong { display: block; font-size: 1.05rem; color: var(--text); margin-bottom: 0.3rem; }
.intg-voice-steps { text-align: left; max-width: 460px; margin: 0.9rem auto; padding-left: 1.2rem; display: grid; gap: 0.5rem; }
.intg-voice-steps li { line-height: 1.5; }
.intg-voice-steps code { background: var(--bg-soft); padding: 0.05rem 0.35rem; border-radius: 6px; font-size: 0.88em; }

/* detail */
.intg-back {
  display: inline-flex; align-items: center; gap: 0.3rem;
  background: none; border: none; padding: 0.3rem 0; margin-bottom: 1rem;
  font: inherit; font-size: 0.9rem; font-weight: 600; color: var(--text-secondary); cursor: pointer;
}
.intg-back:hover { color: var(--accent); }
.intg-detail-head { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.75rem; }
.intg-detail-headtext { flex: 1; min-width: 200px; }
.intg-detail-headtext h1 { font-family: var(--font-display); font-size: 1.7rem; font-weight: 900; letter-spacing: -0.03em; margin-bottom: 0.25rem; display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.intg-detail-headtext .lede { margin-bottom: 0; }
.intg-detail-body { display: flex; flex-direction: column; gap: 1rem; }

.intg-accounts { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
.intg-acct-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--border-2);
}
.intg-acct-row:last-child { border-bottom: none; }
.intg-acct-head { background: var(--bg-soft); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-secondary); }
.intg-acct-label { font-weight: 600; }
.intg-acct-by { color: var(--text-secondary); font-size: 0.9rem; }
.intg-acct-actions { display: flex; align-items: center; gap: 0.5rem; justify-content: flex-end; }
.intg-pill {
  display: inline-block; padding: 0.18rem 0.55rem; border-radius: 999px;
  border: 1px solid var(--border); background: var(--bg-soft); color: var(--text-secondary);
  font-size: 0.72rem; font-weight: 700;
}
.intg-pill-warn { color: #b8842a; background: rgba(214,160,42,.1); border-color: rgba(214,160,42,.3); }

/* teams self-install steps */
.intg-steps-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); padding: 1.35rem 1.5rem; }
.intg-steps-card h2 { font-family: var(--font-display); font-size: 1.1rem; font-weight: 800; margin-bottom: 0.9rem; }
.intg-steps { list-style: none; counter-reset: step; display: flex; flex-direction: column; gap: 0.85rem; }
.intg-steps li { position: relative; padding-left: 2.2rem; }
.intg-steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 1.5rem; height: 1.5rem;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--grad-soft); color: var(--accent);
  font-size: 0.8rem; font-weight: 800;
}
.intg-steps li strong { display: block; font-size: 0.95rem; }
.intg-steps li span { display: block; color: var(--text-secondary); font-size: 0.88rem; }
.intg-help { margin-top: 0.25rem; }
.intg-help a { color: var(--accent); text-decoration: none; font-weight: 600; }
.intg-help a:hover { text-decoration: underline; }

/* voice app QR hand-off */
.intg-voice-qr { margin-top: 1rem; display: flex; flex-direction: column; gap: 0.75rem; align-items: flex-start; }
.intg-voice-qr img { border: 1px solid var(--border); border-radius: var(--radius); background: #fff; padding: 0.5rem; }
.intg-voice-linkrow { display: flex; gap: 0.5rem; align-items: center; width: 100%; max-width: 520px; }
.intg-voice-linkinput {
  flex: 1; min-width: 0; font-size: 0.8rem; color: var(--text-secondary);
  border: 1px solid var(--border); border-radius: 8px; padding: 0.45rem 0.6rem; background: var(--bg-soft);
}

/* inline account editor (label + access) */
.intg-acct-edit {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.75rem;
  padding: 0.9rem 1.1rem; background: var(--bg-soft); border-bottom: 1px solid var(--border-2);
}
.intg-acct-edit label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.78rem; font-weight: 600; color: var(--text-secondary); }
.intg-acct-edit input, .intg-acct-edit select {
  padding: 0.5rem 0.7rem; border-radius: 9px; border: 1px solid var(--border); background: #fff; color: var(--text); font: inherit; font-size: 0.9rem;
}
.intg-acct-edit input:focus, .intg-acct-edit select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(136,61,255,.12); }
.intg-edit-actions { display: flex; gap: 0.5rem; margin-left: auto; }

/* custom MCP modal — same phone-safe pattern as .pp-modal (padded overlay + inner scroll) */
.intg-modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(26,26,46,.45); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: max(1.25rem, env(safe-area-inset-top)) 1.25rem max(1.25rem, env(safe-area-inset-bottom));
  animation: otherIn .2s ease;
}
.intg-modal {
  width: 100%; max-width: 460px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 1.6rem 1.7rem;
  display: flex; flex-direction: column; gap: 0.7rem;
  max-height: calc(100dvh - 3rem); overflow-y: auto; -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.intg-modal h2 { font-family: var(--font-display); font-size: 1.3rem; font-weight: 800; letter-spacing: -0.02em; }
.intg-modal label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.82rem; font-weight: 600; color: var(--text-secondary); }
.intg-modal input {
  padding: 0.7rem 0.9rem; border-radius: 10px; border: 1px solid var(--border); background: #fff; color: var(--text); font: inherit; font-size: 0.93rem;
}
.intg-modal input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(136,61,255,.12); }
.intg-modal-actions { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: 0.6rem; }

/* ── Guided connect flow (Pipedream/OAuth-style centered walkthrough) ── */
.intg-connect {
  width: 100%; max-width: 460px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 1.7rem 1.7rem 1.5rem;
  display: flex; flex-direction: column; gap: 0.7rem;
  max-height: 90vh; overflow-y: auto;
}
.intg-connect-head { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 0.3rem; margin-bottom: 0.4rem; }
.intg-connect-logos { display: flex; align-items: center; justify-content: center; gap: 0.55rem; margin-bottom: 0.55rem; }
.intg-connect-logo {
  width: 52px; height: 52px; border-radius: 13px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow);
}
.intg-connect-logo img { width: 60%; height: 60%; object-fit: contain; }
.intg-connect-app .intg-icon { box-shadow: var(--shadow); }
.intg-connect-link { display: inline-flex; gap: 4px; }
.intg-connect-link i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); opacity: .35; animation: gcDots 1.2s ease-in-out infinite; }
.intg-connect-link i:nth-child(2) { animation-delay: .2s; }
.intg-connect-link i:nth-child(3) { animation-delay: .4s; }
@keyframes gcDots { 0%,100% { opacity: .25; } 50% { opacity: 1; } }
.intg-connect-head h2 { font-family: var(--font-display); font-size: 1.3rem; font-weight: 800; letter-spacing: -0.02em; }
.intg-connect-head .card-meta { margin: 0; }
.intg-connect-steps { list-style: none; counter-reset: gcstep; display: flex; flex-direction: column; gap: 0.6rem; margin: 0.2rem 0 0.4rem; padding: 0.85rem 1rem; background: var(--bg-soft); border: 1px solid var(--border-2); border-radius: 12px; }
.intg-connect-steps li { position: relative; padding-left: 2rem; }
.intg-connect-steps li::before {
  counter-increment: gcstep; content: counter(gcstep);
  position: absolute; left: 0; top: 0; width: 1.4rem; height: 1.4rem;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--grad-soft); color: var(--accent); font-size: 0.74rem; font-weight: 800;
}
.intg-connect-steps li strong { display: block; font-size: 0.88rem; }
.intg-connect-steps li span { display: block; color: var(--text-secondary); font-size: 0.82rem; }
.intg-connect label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.82rem; font-weight: 600; color: var(--text-secondary); }
.intg-connect input {
  padding: 0.7rem 0.9rem; border-radius: 10px; border: 1px solid var(--border); background: #fff; color: var(--text); font: inherit; font-size: 0.93rem;
}
.intg-connect input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(136,61,255,.12); }
.intg-connect input[readonly] { background: var(--bg-soft); color: var(--text-secondary); }
.intg-connect-status { font-size: 0.85rem; font-weight: 600; margin: 0.2rem 0 0; padding: 0.5rem 0.7rem; border-radius: 9px; }
.intg-connect-status.is-pending { color: var(--text-secondary); background: var(--bg-soft); }
.intg-connect-status.is-ok { color: #0a8f73; background: rgba(0,210,160,.1); }
.intg-connect-status.is-err { color: #b8842a; background: rgba(214,160,42,.12); }
.intg-connect-status.is-info { color: var(--text-secondary); background: var(--bg-soft); }
.intg-connect-done { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 0.5rem; padding: 0.8rem 0; }
.intg-connect-check {
  width: 52px; height: 52px; border-radius: 50%; background: var(--green); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 1.6rem; font-weight: 800;
  box-shadow: 0 6px 18px rgba(0,210,160,.4);
}
.intg-connect-done h2 { font-family: var(--font-display); font-size: 1.3rem; font-weight: 800; }
.intg-connect-done .intg-modal-actions { justify-content: center; margin-top: 0.4rem; width: 100%; }
.intg-pill-ok { color: #0a8f73; background: rgba(0,210,160,.1); border-color: rgba(0,210,160,.3); }

@media (max-width: 560px) {
  .intg-acct-row { grid-template-columns: 1fr auto; }
  .intg-acct-row > span:nth-child(2), .intg-acct-row > span:nth-child(3) { display: none; }
  .intg-acct-edit label { flex: 1 1 100%; }
}

/* ── People & Mailboxes ───────────────────────────────────── */
.people-head { margin-bottom: 1.5rem; }
/* view headers match the dashboard h1 exactly (Inter black) — the drift read as a different app */
.people-head h1 { font-family: var(--font-display); font-size: 1.95rem; font-weight: 900; letter-spacing: -0.035em; }
.people-sub { color: var(--text-secondary); margin-top: 0.4rem; max-width: 60ch; }
.people-sub strong { color: var(--accent); }
.people-card { padding: 0.5rem 0.5rem 0.25rem; }
.people-table-wrap { overflow-x: auto; }
.people-table { width: 100%; border-collapse: collapse; font-size: 0.94rem; }
.people-table th {
  text-align: left; font-weight: 600; color: var(--text-faint);
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em;
  padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--border);
}
.people-table td { padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--border-2); vertical-align: middle; }
.people-table tr:last-child td { border-bottom: none; }
.people-name { font-weight: 600; color: var(--text); }
.people-linked {
  display: inline-block; margin-left: 0.4rem; font-size: 0.68rem; font-weight: 600;
  color: var(--accent); background: var(--grad-soft); padding: 0.05rem 0.4rem; border-radius: 999px;
  text-transform: uppercase; letter-spacing: 0.03em; vertical-align: middle;
}
/* owner/admin access badge — a touch stronger than the plain "account" chip */
.people-linked-admin { border: 1px solid rgba(136,61,255,.35); font-weight: 700; }
/* preloaded matchmaking email (admin-set) under the person's name */
.people-email { font-size: 0.78rem; color: var(--text-secondary); margin-top: 0.1rem; }
.people-pill {
  display: inline-block; font-size: 0.74rem; font-weight: 600; color: #fff;
  background: var(--pill, #6b7280); padding: 0.12rem 0.55rem; border-radius: 999px;
}
.people-ago { color: var(--text-secondary); white-space: nowrap; }
.people-mail { white-space: nowrap; }
.people-addr {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 0.85rem; color: var(--text);
  cursor: pointer; border-bottom: 1px dashed var(--accent-light); padding-bottom: 1px;
}
.people-addr:hover { color: var(--accent); }
.btn-mini-ghost { color: var(--text-faint); padding: 0.2rem 0.55rem; }
.people-empty { color: var(--text-secondary); text-align: center; padding: 1.4rem 0.9rem; }

/* My phone book (personal contacts card) */
.pb-actions { display: flex; flex-wrap: wrap; gap: 0.55rem; align-items: center; margin: 0.35rem 0 0.6rem; }
.pb-list { margin-top: 0.4rem; }
.pb-row { display: flex; align-items: center; gap: 0.7rem; padding: 0.5rem 0.15rem; border-top: 1px solid var(--border-2); }
.pb-row:first-child { border-top: 0; }
.pb-name { font-weight: 600; font-size: 0.92rem; white-space: nowrap; }
.pb-sub { flex: 1; color: var(--text-faint); font-size: 0.82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.people-actions { white-space: nowrap; }
.people-actions .btn-mini { margin-left: 0.3rem; }
.people-actions-h { text-align: right; }
td.people-actions { text-align: right; }

/* edit modal — breathes on phones: padded overlay (safe-area aware) + the card scrolls INSIDE
   itself when the form is taller than the screen (was pinned edge-to-edge and unscrollable) */
.pp-modal {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center;
  background: rgba(26,26,46,.42); backdrop-filter: blur(2px);
  padding: max(1.1rem, env(safe-area-inset-top)) 1.1rem max(1.1rem, env(safe-area-inset-bottom));
}
.pp-modal[hidden] { display: none; }
.pp-modal-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 1.5rem; width: min(420px, 100%);
  max-height: calc(100dvh - 2.5rem); overflow-y: auto; -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.pp-modal-card h3 { font-weight: 800; font-size: 1.2rem; margin-bottom: 1rem; }
.pp-modal-card label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--text-secondary); margin: 0.7rem 0 0.3rem; }
.pp-modal-card input,
.pp-modal-card textarea,
.pp-modal-card select {
  width: 100%; padding: 0.6rem 0.7rem; border: 1px solid var(--border); border-radius: 10px;
  font: inherit; color: var(--text); background: var(--bg);
}
.pp-modal-card textarea { resize: vertical; min-height: 4.4rem; line-height: 1.5; }
.pp-modal-card input:focus, .pp-modal-card textarea:focus, .pp-modal-card select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(136,61,255,.12);
}
.pp-persona-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }
.pp-sep { border: none; border-top: 1px solid var(--border); margin: 1.15rem 0 0.1rem; }
.pp-mail-edit { display: flex; align-items: center; gap: 0.4rem; }
.pp-mail-edit input { flex: 1; }
.pp-domain { color: var(--text-faint); font-family: ui-monospace, Menlo, monospace; font-size: 0.85rem; white-space: nowrap; }
.pp-modal-actions { display: flex; align-items: center; gap: 0.6rem; margin-top: 1.3rem; }
.pp-modal-actions .btn { margin: 0; }
.pp-modal-actions #ppRemoveMail { color: var(--danger); border-color: rgba(214,69,93,.30); margin-left: auto; }
.pp-modal-actions #ppRemoveMail:hover { background: rgba(214,69,93,.08); border-color: var(--danger); }

/* ── White-label splash (branded org subdomain logged-out hero) ───────────────── */
.wl-splash { margin: 0 0 1.8rem; padding-bottom: 1.6rem; border-bottom: 1px solid var(--border); }
.wl-brandmark { display: flex; align-items: center; margin-bottom: 1.1rem; }
.wl-logo { max-height: 52px; max-width: 220px; object-fit: contain; }
.wl-monogram {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-weight: 900; font-size: 1.4rem; letter-spacing: .02em;
  box-shadow: 0 12px 30px -14px var(--accent);
}
.wl-headline {
  font-family: var(--font-display); font-weight: 900; line-height: 1.05;
  font-size: clamp(1.7rem, 4.4vw, 2.5rem); letter-spacing: -0.02em;
  color: var(--text); margin-bottom: 0.6rem;
}
.wl-subhead { color: var(--text-secondary); font-size: 1.05rem; max-width: 480px; margin-bottom: 1.3rem; }
.wl-agents {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 0.7rem; margin-bottom: 1.2rem;
}
.wl-agent {
  display: flex; align-items: center; gap: 0.65rem;
  padding: 0.7rem 0.8rem; background: var(--surface);
  border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow);
}
.wl-agent-av {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 11px;
  background: var(--grad-soft); color: var(--accent); font-weight: 800; font-size: 0.95rem;
}
.wl-agent-meta { display: flex; flex-direction: column; min-width: 0; }
.wl-agent-meta strong { font-size: 0.94rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl-agent-meta small { font-size: 0.78rem; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl-signin-note { color: var(--accent); font-weight: 700; font-size: 0.95rem; }
/* logged-out org subdomain — sign-in only, no marketing hero */
body.subdomain-login #trialBadge,
body.subdomain-login #loginHeadline,
body.subdomain-login #loginLede,
body.subdomain-login #tabCreateOrg,
body.subdomain-login #createOrgForm,
body.subdomain-login .consent,
body.subdomain-login .consent-beta,
body.subdomain-login #authTabs,
body.subdomain-login .wl-subhead,
body.subdomain-login #wlAgents,
body.subdomain-login .wl-signin-note { display: none !important; }
body.subdomain-login .wl-splash { margin-bottom: 1.25rem; padding-bottom: 1.1rem; }
body.subdomain-login .wl-headline { font-size: clamp(1.45rem, 3.8vw, 2rem); margin-bottom: 0; }

.platform-admin-chip {
  display: inline-flex; align-items: center;
  padding: 0.22rem 0.62rem; border-radius: 999px;
  border: 1px solid rgba(136,61,255,.28); background: var(--grad-soft);
  color: var(--accent); font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.02em; white-space: nowrap;
}
#platformAdminCard { border-color: rgba(136,61,255,.35); background: var(--grad-soft, rgba(136,61,255,.05)); }
.platform-tenant-list { list-style: none; display: flex; flex-direction: column; gap: 0.45rem; margin: 0; padding: 0; }
.platform-tenant-row {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  padding: 0.65rem 0.85rem; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); text-decoration: none; color: var(--text);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.platform-tenant-row:hover { border-color: rgba(136,61,255,.35); box-shadow: var(--shadow); transform: translateY(-1px); }
.platform-tenant-name { font-weight: 700; font-size: 0.95rem; }
.platform-tenant-host {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82rem; color: var(--accent); flex-shrink: 0;
}
@media (max-width: 640px) {
  .platform-admin-chip { display: none; }
  .platform-tenant-row { flex-direction: column; align-items: flex-start; }
}
/* on a white-labeled org, the topbar wordmark renders the org name in the brand accent */
.white-label .brand #topbarWordmark { color: var(--accent); font-weight: 800; }

/* ── Persona visibility (People & Personas panel) ─────────────────────────────── */
.people-cta-inline { display: inline-block; background: var(--grad-soft); color: var(--accent); font-weight: 700; padding: 0 .4rem; border-radius: 6px; white-space: nowrap; }
.people-persona-sum { margin-top: .25rem; font-size: .82rem; }
.people-persona-chip { color: var(--text-secondary); }
.people-persona-chip strong { color: var(--accent); font-weight: 700; }
.people-persona-cta {
  font: inherit; font-size: .82rem; font-weight: 700; cursor: pointer;
  color: var(--accent); background: var(--grad-soft);
  border: 1px solid rgba(136,61,255,.22); border-radius: 8px; padding: .18rem .55rem;
}
.people-persona-cta:hover { border-color: var(--accent); }
/* admin name-lock controls in the persona modal — the label is INSIDE .pp-modal-card, whose
   label rule (display:block) outranks a bare class, so match its specificity to stay a flex row */
.pp-lock-row, .pp-modal-card label.pp-lock-row {
  display: flex; align-items: flex-start; gap: 0.5rem; margin-top: 0.7rem;
  font-size: 0.85rem; color: var(--text-secondary); cursor: pointer;
}
/* the modal's blanket input{width:100%} stretches the checkbox and shoves the text aside */
.pp-lock-row input[type="checkbox"], .pp-modal-card .pp-lock-row input[type="checkbox"] {
  width: auto; flex: none; margin-top: 0.15rem; accent-color: var(--accent);
}
.pp-lock-note {
  margin: 0.7rem 0 0; font-size: 0.83rem; color: var(--text-secondary);
  background: var(--grad-soft); border: 1px solid rgba(136,61,255,.18);
  border-radius: 10px; padding: 0.55rem 0.7rem;
}
#ppAgentName:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-mini-persona {
  color: var(--accent); border-color: rgba(136,61,255,.30); background: var(--grad-soft); font-weight: 700;
}
.btn-mini-persona:hover { border-color: var(--accent); background: rgba(136,61,255,.14); color: var(--accent); }
.pp-modal-lede { color: var(--text-secondary); font-size: .9rem; margin: -.5rem 0 .4rem; }
.pp-field-lead { font-weight: 800 !important; color: var(--text) !important; }
.pp-mailbox-section { margin-top: 1rem; border-top: 1px solid var(--border); padding-top: .4rem; }
.pp-mailbox-section > summary { cursor: pointer; font-weight: 700; color: var(--text-secondary); font-size: .9rem; padding: .35rem 0; list-style: revert; }
.pp-mailbox-section > summary:hover { color: var(--accent); }
/* artifact (Dashboards panel) example prompt */
.af-example { background: var(--bg-soft); border-left: 3px solid var(--accent); padding: .7rem .9rem; border-radius: 8px; color: var(--text-secondary); font-style: italic; margin: .6rem 0; }
/* artifact version history (expander row under each dashboard) */
.af-hist-cell { background: var(--bg-soft); border-radius: 8px; padding: .6rem .9rem; }
.af-hist-list { display: flex; flex-direction: column; gap: .4rem; }
.af-hist-item { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; font-size: .9rem; }
/* Dashboards panel — header action + the template gallery (#D2) */
.af-head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.af-new-btn { flex: none; margin-top: .35rem; font-weight: 700; }
.af-gallery { margin-bottom: 1rem; }
.af-tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: .8rem; margin: .8rem 0; }
.af-tpl-card { border: 1px solid var(--border, #e6e8f0); border-radius: 12px; padding: .85rem .95rem; background: var(--surface, #fff); display: flex; flex-direction: column; gap: .35rem; }
.af-tpl-name { font-weight: 800; font-size: .95rem; }
.af-tpl-layout { font-weight: 600; font-size: .72rem; color: var(--text-secondary); background: var(--bg-soft); border-radius: 999px; padding: .12rem .55rem; margin-left: .3rem; }
.af-tpl-desc { font-size: .84rem; color: var(--text-secondary); margin: 0; flex: 1; }
.af-tpl-meta { font-size: .74rem; color: var(--text-secondary); opacity: .75; margin: 0; }
.af-tpl-card .btn-mini { align-self: flex-start; }
/* Dashboards panel — per-person access editor (#D2) */
.af-acc-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .15rem .8rem; padding: .3rem .1rem .5rem; }
.af-acc-person { display: flex; align-items: center; gap: .45rem; font-size: .88rem; cursor: pointer; }
.af-acc-person input { accent-color: var(--accent, #883dff); }
.af-acc-actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; padding: .45rem 0 .2rem; border-top: 1px dashed var(--border, #e6e8f0); margin-top: .3rem; }
/* Dashboards panel — password share links (#D5) */
.af-share-form { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; padding-top: .45rem; border-top: 1px dashed var(--border, #e6e8f0); margin-top: .3rem; }
.af-share-input { background: var(--surface, #fff); border: 1px solid var(--border, #e6e8f0); border-radius: 8px; padding: .38rem .6rem; font-size: .86rem; color: inherit; width: 168px; }
.af-share-input-num { width: 118px; }

/* ── Telephony tab ── */
/* ── Mailbox — the agent's own email activity (read-only) ── */
.mbx-tabs { display: flex; gap: .5rem; margin: 0 0 1rem; }
.mbx-tab { font: inherit; font-size: .85rem; font-weight: 700; padding: .45rem 1rem; border-radius: 999px; border: 1px solid var(--border, #e6e8f0); background: var(--surface, #fff); color: var(--text, #0f172a); cursor: pointer; }
.mbx-tab.active { background: var(--accent, #883dff); border-color: transparent; color: #fff; }
.mbx-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .6rem; }
.mbx-row { display: flex; align-items: flex-start; gap: .8rem; padding: .85rem 1rem; border: 1px solid var(--border, #e6e8f0); border-radius: 14px; background: var(--surface, #fff); }
.mbx-dir { flex: none; width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; font-weight: 800; }
.mbx-dir.in { background: rgba(0,184,144,.12); color: var(--green, #00b890); }
.mbx-dir.out { background: rgba(136,61,255,.12); color: var(--accent, #883dff); }
.mbx-main { flex: 1; min-width: 0; }
.mbx-top { font-size: .85rem; }
.mbx-via { color: var(--text-secondary, #5a6072); font-size: .78rem; }
.mbx-subject { font-weight: 700; font-size: .95rem; margin-top: .1rem; }
.mbx-preview { color: var(--text-secondary, #5a6072); font-size: .82rem; margin-top: .15rem; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.mbx-time { flex: none; color: var(--text-secondary, #5a6072); font-size: .76rem; white-space: nowrap; }
.mbx-chip { display: inline-block; font-size: .68rem; font-weight: 700; padding: .1rem .5rem; border-radius: 999px; background: rgba(136,61,255,.1); color: var(--accent, #883dff); margin-left: .35rem; }
.mbx-empty { color: var(--text-secondary, #5a6072); padding: 1.2rem; text-align: center; border: 1px dashed var(--border, #e6e8f0); border-radius: 14px; list-style: none; }

.tel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.tel-number-card { border-color: rgba(136,61,255,.22); background: linear-gradient(180deg, var(--grad-soft), var(--surface) 60%); }
.tel-number { font-family: var(--font-display); font-size: 1.9rem; font-weight: 800; letter-spacing: -0.01em; line-height: 1.15; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; margin-bottom: .4rem; }
.tel-stat { font-family: var(--font-display); font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; color: var(--text); }
.tel-rates { margin: -.2rem 0 1rem; }
.tel-num-actions { display: inline-flex; gap: .4rem; flex-wrap: wrap; }

/* activation flow — telephony terms consent + real-time provision */
.tel-activate-card { border-color: rgba(136,61,255,.22); background: linear-gradient(180deg, var(--grad-soft), var(--surface) 60%); }
.tel-activate-perks { list-style: none; margin: 0.8rem 0 1rem; padding: 0; display: flex; flex-direction: column; gap: 0.45rem; }
.tel-activate-perks li { position: relative; padding-left: 1.5rem; font-size: 0.92rem; color: var(--text); }
.tel-activate-perks li::before { content: '✓'; position: absolute; left: 0; color: #883dff; font-weight: 700; }
.tel-consent { background: var(--bg-soft); border: 1px solid var(--border-2); border-radius: 10px; padding: 0.85rem 1rem; margin-bottom: 1rem; }
.tel-consent-label { display: flex; gap: 0.65rem; align-items: flex-start; cursor: pointer; font-size: 0.88rem; line-height: 1.45; color: var(--text-secondary); }
.tel-consent-label input[type="checkbox"] { margin-top: 0.2rem; width: 1rem; height: 1rem; accent-color: #883dff; flex: none; cursor: pointer; }
.tel-consent-label a { color: #883dff; font-weight: 600; }
.tel-consent-done { color: #00a37a; font-weight: 600; margin-bottom: 1rem; }
.tel-activate-note { min-height: 1.2em; margin-top: 0.6rem; }

/* ── Server tab (org box — the isolated per-org app server) ── */
.srv-card { border-color: rgba(136,61,255,.22); background: linear-gradient(180deg, var(--grad-soft), var(--surface) 60%); }
.srv-status-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: .6rem; }
.srv-host { display: inline-block; margin-top: .35rem; font-family: var(--font-mono, ui-monospace, monospace); font-size: .95rem; font-weight: 600; color: var(--accent); text-decoration: none; word-break: break-all; }
.srv-host:hover { text-decoration: underline; }
.srv-pill { display: inline-flex; align-items: center; gap: .45rem; font-size: .85rem; font-weight: 700; padding: .3rem .8rem; border-radius: 999px; border: 1px solid; white-space: nowrap; }
.srv-dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; flex: none; }
.srv-pill-ok { color: #0a8f73; background: rgba(0,210,160,.1); border-color: rgba(0,210,160,.3); }
.srv-pill-ok .srv-dot { background: #22c55e; box-shadow: 0 0 0 0 rgba(34,197,94,.5); animation: srv-pulse 2s ease-out infinite; }
@keyframes srv-pulse { 0% { box-shadow: 0 0 0 0 rgba(34,197,94,.45); } 70% { box-shadow: 0 0 0 7px rgba(34,197,94,0); } 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); } }
@media (prefers-reduced-motion: reduce) { .srv-pill-ok .srv-dot { animation: none; } }
.srv-pill-warn { color: #b8842a; background: rgba(214,160,42,.1); border-color: rgba(214,160,42,.3); }
.srv-pill-bad { color: #c0392b; background: rgba(220,80,60,.08); border-color: rgba(220,80,60,.3); }
.srv-verified { color: #0a8f73; font-weight: 600; }
.srv-bad-txt { color: #c0392b; }
.srv-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .7rem; margin: 1rem 0 1.1rem; }
.srv-fact { background: var(--bg-soft); border: 1px solid var(--border-2); border-radius: 10px; padding: .65rem .8rem; display: flex; flex-direction: column; gap: .2rem; }
.srv-fact-k { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-faint); }
.srv-fact-v { font-size: .92rem; font-weight: 600; color: var(--text); }
.srv-actions { display: inline-flex; gap: .5rem; flex-wrap: wrap; }
.srv-note { margin-top: .7rem; }

/* ── Affiliate tab (10% recurring referral program) ── */
.aff-rate { color: #883dff; }
.aff-link-card { border-color: rgba(136,61,255,.22); background: linear-gradient(180deg, var(--grad-soft), var(--surface) 60%); }
.aff-link-row { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; margin-bottom: 0.5rem; }
.aff-link { flex: 1 1 260px; min-width: 0; font-family: var(--font-mono, ui-monospace, monospace); font-size: 0.9rem; font-weight: 600; color: var(--accent); background: var(--bg-soft); border: 1px solid var(--border-2); border-radius: 10px; padding: 0.6rem 0.8rem; word-break: break-all; }
.aff-alias-row { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; margin-top: 0.8rem; margin-bottom: 0.4rem; }
.aff-alias-row input { flex: 1 1 180px; min-width: 0; font-size: 0.92rem; padding: 0.55rem 0.8rem; border: 1px solid var(--border-2); border-radius: 10px; background: var(--surface); color: var(--text); }
.aff-table-wrap { overflow-x: auto; }
.aff-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.aff-table th { text-align: left; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-faint); padding: 0.5rem 0.7rem; border-bottom: 1px solid var(--border-2); }
.aff-table td { padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--border-2); color: var(--text); white-space: nowrap; }
.aff-table tr:last-child td { border-bottom: 0; }
.aff-num { font-variant-numeric: tabular-nums; font-weight: 600; }
.aff-status { display: inline-flex; align-items: center; font-size: 0.78rem; font-weight: 700; padding: 0.15rem 0.6rem; border-radius: 999px; border: 1px solid var(--border-2); background: var(--bg-soft); color: var(--text-secondary); }
.aff-status-active, .aff-status-trialing { color: #0a8f73; background: rgba(0,210,160,.1); border-color: rgba(0,210,160,.3); }
.aff-status-past_due { color: #b8842a; background: rgba(214,160,42,.1); border-color: rgba(214,160,42,.3); }
.aff-status-canceled { color: #c0392b; background: rgba(220,80,60,.08); border-color: rgba(220,80,60,.3); }
.aff-enroll-card { border-color: rgba(136,61,255,.22); background: linear-gradient(180deg, var(--grad-soft), var(--surface) 60%); }
.aff-enroll-note { min-height: 1.2em; margin-top: 0.6rem; }
.aff-payout-note { margin-top: 1rem; }

/* ── Teams app-icon customizer (install panel) ── */
.intg-icon-row { display: flex; align-items: center; gap: 1.1rem; margin-top: 0.9rem; flex-wrap: wrap; }
.intg-icon-custom { margin-top: 1rem; }
.intg-icon-custom > label { display: block; font-size: 0.78rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 0.35rem; }
.intg-icon-custom-row { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.intg-icon-custom-row input[type=text] {
  flex: 1 1 220px; min-width: 180px; font-size: 0.82rem;
  border: 1px solid var(--border); border-radius: 8px; padding: 0.45rem 0.6rem; background: var(--bg-soft);
}
.btn-link { border: none; background: none; padding: 0.3rem 0.2rem; font: inherit; font-size: 0.8rem; font-weight: 600; color: var(--accent); cursor: pointer; }
.btn-link:hover { text-decoration: underline; }
.intg-icon-preview {
  width: 92px; height: 92px; border-radius: 22%;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); box-shadow: var(--shadow);
  transition: background .15s ease;
  flex: none;
}
.intg-icon-preview img { width: 70%; height: 70%; object-fit: contain; }
.intg-icon-mono { font-family: var(--font-display); font-size: 2rem; font-weight: 900; color: #fff; mix-blend-mode: difference; }
.intg-icon-picks { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.intg-swatch {
  width: 34px; height: 34px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--border-2); box-shadow: inset 0 0 0 2px rgba(255,255,255,.35);
  transition: transform .12s ease, outline .12s ease;
}
.intg-swatch:hover { transform: translateY(-1px); }
.intg-swatch.sel { outline: 2px solid var(--accent); outline-offset: 2px; }
/* the custom-colour pick — a rainbow ring so it reads as "tap to pick ANY colour"
   (was a bare native input that looked like a broken white swatch — Filip, Jul 7) */
.intg-swatch-custom {
  width: 34px; height: 34px; padding: 3px; border: none; border-radius: 10px;
  background: conic-gradient(#ff5d5d, #ffb84d, #f5e04b, #52d273, #4dc3ff, #8a6bff, #ff5db1, #ff5d5d);
  cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06);
  transition: transform .12s ease;
}
.intg-swatch-custom:hover { transform: translateY(-1px); }
.intg-swatch-custom::-webkit-color-swatch-wrapper { padding: 0; }
.intg-swatch-custom::-webkit-color-swatch { border: 2px solid #fff; border-radius: 7px; }
.intg-swatch-custom::-moz-color-swatch { border: 2px solid #fff; border-radius: 7px; }

/* the Teams display-name field — a real labeled input (was a bare unstyled native input) */
.intg-appname-label {
  display: flex; flex-direction: column; gap: 0.35rem; max-width: 420px;
  font-size: 0.82rem; font-weight: 600; color: var(--text-secondary);
}
.intg-appname-label input {
  padding: 0.7rem 0.9rem; border-radius: 10px; border: 1px solid var(--border);
  background: #fff; color: var(--text); font: inherit; font-size: 0.95rem; font-weight: 500;
}
.intg-appname-label input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(136,61,255,.12); }

/* live Teams-chat preview — a faithful mock that updates as name/icon/colour change */
.intg-tpv-card .tpv-stage {
  margin-top: 0.4rem; padding: 1rem 1.1rem; border-radius: 14px;
  background: #f5f5f7; border: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 0.9rem;
}
.tpv-row { display: flex; gap: 0.6rem; align-items: flex-start; }
.tpv-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; transition: background .15s ease;
}
.tpv-avatar img { width: 72%; height: 72%; object-fit: contain; }
.tpv-avatar span { font-family: var(--font-display); font-weight: 900; font-size: 0.85rem; color: #fff; }
.tpv-bubblewrap { min-width: 0; max-width: 30rem; }
.tpv-meta { font-size: 0.8rem; color: #616161; margin-bottom: 0.25rem; }
.tpv-meta strong { color: #242424; font-weight: 700; }
.tpv-time { margin-left: 0.35rem; font-size: 0.72rem; color: #8a8a8a; }
.tpv-bubble {
  background: #fff; border: 1px solid #e1e1e1; border-radius: 4px 12px 12px 12px;
  padding: 0.55rem 0.7rem; font-size: 0.86rem; color: #242424; line-height: 1.4;
}
.tpv-bubble-plain { color: #242424; }
/* the Join-call adaptive card, as TeamsAdapter.sendCallButton renders it */
.tpv-card { display: flex; flex-direction: column; gap: 0.45rem; }
.tpv-card-head { font-weight: 700; color: #242424; font-size: 0.9rem; }
.tpv-card-body { font-size: 0.83rem; color: #424242; }
.tpv-card-action {
  align-self: flex-start; margin-top: 0.15rem;
  background: #5b5fc7; color: #fff; font-weight: 600; font-size: 0.82rem;
  padding: 0.35rem 0.85rem; border-radius: 6px;
}
@media (prefers-color-scheme: dark) {
  .intg-tpv-card .tpv-stage { background: #1f1f1f; border-color: #333; }
  .tpv-bubble { background: #2d2c2c; border-color: #3d3d3d; color: #e8e8e8; }
  .tpv-bubble-plain, .tpv-card-head, .tpv-card-body { color: #e8e8e8; }
  .tpv-meta strong { color: #f0f0f0; }
}

/* ===== Licenses & Fable 5 (per-person seats, Jul 2026) ===== */
.lic-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem; margin: 0 0 1.1rem;
}
.lic-stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 0.8rem 1rem; display: flex; flex-direction: column; box-shadow: var(--shadow);
}
.lic-stat strong { font-family: var(--font-display); font-weight: 900; font-size: 1.35rem; line-height: 1.2; }
.lic-stat span { font-size: 0.78rem; color: var(--text-faint); }
.lic-stat-fable strong { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.lic-seats { display: flex; flex-direction: column; gap: 0.65rem; margin-top: 0.5rem; }
.lic-seat {
  border: 1px solid var(--border-2); border-radius: 14px; padding: 0.85rem 1rem;
  background: var(--bg); display: flex; flex-direction: column; gap: 0.55rem;
}
.lic-seat-main { display: flex; align-items: center; gap: 0.7rem; min-width: 0; }
.lic-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  background: var(--grad); color: #fff; font-weight: 800; font-family: var(--font-display);
  display: flex; align-items: center; justify-content: center; font-size: 0.95rem;
}
.lic-avatar-empty { background: var(--bg-soft); color: var(--text-faint); border: 1px dashed var(--border); }
.lic-seat-id { min-width: 0; display: flex; flex-direction: column; gap: 0.2rem; }
.lic-seat-id strong { font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lic-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.lic-chip {
  font-size: 0.72rem; font-weight: 600; padding: 0.12rem 0.55rem; border-radius: 999px;
  background: var(--bg-soft); border: 1px solid var(--border); color: var(--text-secondary);
}
.lic-chip-ent { background: rgba(136,61,255,.10); border-color: rgba(136,61,255,.25); color: var(--accent); }
.lic-chip-fable { background: var(--grad); color: #fff; border: none; }
.lic-chip-req { background: rgba(214,69,93,.08); border-color: rgba(214,69,93,.3); color: var(--danger); }
.lic-pending { font-size: 0.72rem; color: var(--text-faint); font-style: italic; }

.lic-usage { display: flex; flex-direction: column; gap: 0.25rem; }
.lic-usage-track { height: 7px; border-radius: 999px; background: var(--bg-soft); overflow: hidden; }
.lic-usage-fill { height: 100%; border-radius: 999px; background: var(--accent); transition: width .3s ease; }
.lic-usage-fill.lic-warn { background: #e8a13c; }
.lic-usage-fill.lic-over { background: var(--danger); }
.lic-usage small { font-size: 0.74rem; color: var(--text-faint); }

.lic-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.btn-mini {
  font: inherit; font-size: 0.76rem; font-weight: 600; cursor: pointer;
  padding: 0.28rem 0.7rem; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-secondary);
  transition: border-color .15s ease, color .15s ease;
}
.btn-mini:hover { border-color: var(--accent); color: var(--accent); }
.btn-mini-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-mini-primary:hover { color: #fff; opacity: .92; }
.btn-mini-fable { border-color: rgba(136,61,255,.4); color: var(--accent); }
.btn-mini-danger:hover { border-color: var(--danger); color: var(--danger); }

.lic-inline { border-top: 1px dashed var(--border); padding-top: 0.6rem; }
.lic-inline-row { display: flex; flex-wrap: wrap; gap: 0.45rem; align-items: center; }
.lic-inline-row select, .lic-inline-row input {
  font: inherit; font-size: 0.82rem; padding: 0.35rem 0.6rem; border-radius: 9px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); min-width: 0;
}
.lic-inline-note { display: block; margin-top: 0.35rem; font-size: 0.72rem; color: var(--text-faint); }

/* buy seats */
.lic-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin: 0.75rem 0; }
.lic-mode {
  font: inherit; text-align: left; cursor: pointer;
  border: 1.5px solid var(--border); border-radius: 14px; padding: 0.9rem 1rem;
  background: var(--surface); display: flex; flex-direction: column; gap: 0.35rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.lic-mode.sel { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(136,61,255,.12); }
.lic-mode strong { font-family: var(--font-display); font-weight: 900; font-size: 1rem; }
.lic-mode-price { font-family: var(--font-display); font-weight: 900; font-size: 1.5rem; color: var(--text); }
.lic-mode-price small { font-size: 0.78rem; font-weight: 600; color: var(--text-faint); margin-left: 0.2rem; }
.lic-mode small { font-size: 0.76rem; color: var(--text-faint); }
.lic-mode input[type="range"] { width: 100%; accent-color: var(--accent); margin: 0.25rem 0 0.1rem; }
/* enterprise-by-arrangement tile (locked orgs — honest contact-us, no purchasable lane) */
.lic-mode-contact { cursor: default; opacity: 0.92; }
.lic-mode-contact .btn-mini { align-self: flex-start; margin-top: 0.35rem; text-decoration: none; }

/* ── the billing panel (Jul-17 lock-in: plan · balance · auto top-up · currency · cards) ── */
.billing-balance { font-family: var(--font-display); font-weight: 900; font-size: 1.6rem; letter-spacing: -0.02em; margin: 0.35rem 0 0.6rem; }
.billing-balance strong { font-size: inherit; }
.billing-money { font-size: 0.85rem; font-weight: 600; color: var(--text-faint); margin-left: 0.5rem; }
.billing-row { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin: 0.5rem 0; }
.billing-label { display: flex; gap: 0.45rem; align-items: center; font-size: 0.82rem; font-weight: 600; color: var(--text-secondary); }
.billing-label select { font: inherit; font-size: 0.85rem; padding: 0.35rem 0.5rem; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.billing-autotopup { border: 1.5px solid var(--border); border-radius: 14px; padding: 0.8rem 1rem; margin: 0.7rem 0; display: flex; flex-direction: column; gap: 0.5rem; }
.billing-row-head { justify-content: flex-start; margin: 0; }
.billing-toggle { display: flex; gap: 0.45rem; align-items: center; cursor: pointer; }
.billing-toggle input { accent-color: var(--accent); width: 1.05rem; height: 1.05rem; }
.billing-card-chip { font-size: 0.76rem; font-weight: 700; padding: 0.2rem 0.55rem; border-radius: 999px; background: var(--surface-2, #f3f0fa); color: var(--text-secondary); text-transform: capitalize; }
.billing-card-none { opacity: 0.75; }
.billing-suspended { font-size: 0.8rem; font-weight: 600; color: #9a3412; background: #fff7ed; border: 1px solid #fdba74; border-radius: 10px; padding: 0.5rem 0.7rem; }
.billing-sliders { display: flex; flex-direction: column; gap: 0.55rem; }
.billing-sliders label { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.8rem; color: var(--text-secondary); font-weight: 600; }
.billing-sliders input[type="range"] { width: 100%; accent-color: var(--accent); }
.billing-sliders .btn-mini { align-self: flex-start; }
.billing-receipts { display: flex; flex-direction: column; gap: 0.15rem; }
.billing-receipts small { font-size: 0.74rem; color: var(--text-faint); }
.lic-buy-row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: end; }
.lic-qty, .lic-emails { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.78rem; color: var(--text-secondary); font-weight: 600; }
.lic-qty input { width: 4.5rem; }
.lic-emails { flex: 1; min-width: 14rem; }
.lic-qty input, .lic-emails input {
  font: inherit; font-size: 0.88rem; padding: 0.45rem 0.65rem; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
}

/* Fable 5 card — same visual system as the rest of the dash: standard chip badge (the old
   dark-gradient LIVE pill shouted) + the stats in the SAME bordered tiles as .lic-stat */
.lic-fable-card {
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(136,61,255,.10) 0%, transparent 55%),
    var(--surface);
  border: 1px solid rgba(136,61,255,.22);
}
.lic-fable-head { display: flex; align-items: center; gap: 0.6rem; }
.lic-fable-head h2 { margin-bottom: 0; }
.lic-fable-head { margin-bottom: 0.75rem; }
.lic-fable-spark { color: var(--accent); }
.lic-fable-badge {
  font-size: 0.68rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  padding: 0.14rem 0.6rem; border-radius: 999px;
  color: var(--accent); background: var(--grad-soft); border: 1px solid rgba(136,61,255,.28);
}
.lic-fable-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(124px, 1fr));
  gap: 0.6rem; margin: 0.9rem 0 0.8rem;
}
.lic-fable-stats > div {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border-2); border-radius: 12px;
  padding: 0.65rem 0.8rem;
}
.lic-fable-stats strong { font-family: var(--font-display); font-weight: 900; font-size: 1.2rem; line-height: 1.25; }
.lic-fable-stats span { font-size: 0.72rem; color: var(--text-faint); }
.lic-fable-packs { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.4rem 0; }
.btn-pack {
  font: inherit; font-weight: 700; font-size: 0.88rem; cursor: pointer;
  padding: 0.45rem 1rem; border-radius: 999px;
  background: var(--surface); border: 1.5px solid rgba(136,61,255,.35); color: var(--accent);
  transition: background .15s ease, color .15s ease;
}
.btn-pack:hover { background: var(--accent); color: #fff; }
.lic-fable-fine { font-size: 0.76rem; }

@media (max-width: 640px) {
  .lic-modes { grid-template-columns: 1fr; }
  .lic-buy-row { align-items: stretch; flex-direction: column; }
  .lic-actions { gap: 0.35rem; }
}

/* ── Mobile form-control zoom guard ──────────────────────────
   iOS Safari auto-zooms (and stays zoomed) when a focused control's font-size is under 16px —
   that was the "Branding page is giant and cut off" bug. On phone widths every text-entry
   control renders at 16px; !important intentionally beats the per-view injected styles. */
@media (max-width: 860px) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
  select, textarea { font-size: 16px !important; }
}

/* ============================================================
   Phone overrides for LATE-declared sections (People & Personas,
   integration detail pages, persona modal). These MUST sit at the
   end of the sheet: their base rules are declared mid-file, and
   equal-specificity CSS resolves by file order — earlier copies of
   these overrides silently lost (the People nowrap mailbox cell
   was h-dragging the whole phone dashboard sideways).
   ============================================================ */
@media (max-width: 640px) {
  .people-cta-inline { white-space: normal; }

  /* ── People & Personas: the table becomes stacked person cards ── */
  .people-card { padding: 0.35rem 0.9rem 0.5rem; }
  .people-table, .people-table tbody, .people-table tr, .people-table td { display: block; width: 100%; }
  .people-table thead { display: none; }
  .people-table tr { padding: 0.85rem 0 0.95rem; border-bottom: 1px solid var(--border-2); }
  .people-table tr:last-child { border-bottom: none; }
  .people-table td { padding: 0.15rem 0; border-bottom: none; }
  .people-table td.people-ago { display: inline-block; width: auto; color: var(--text-faint); font-size: 0.8rem; }
  .people-table td:nth-child(2) { display: inline-block; width: auto; margin-right: 0.55rem; }
  /* wrap freely on phones — nowrap cells force min-content width past the viewport */
  .people-mail, .people-ago, .people-actions { white-space: normal; }
  td.people-actions { text-align: left; padding-top: 0.5rem; }
  .people-actions .btn-mini { margin: 0 0.35rem 0.35rem 0; }
  .people-empty { padding: 1.2rem 0.25rem; }

  /* ── Integration detail pages (voice app / Teams install) ── */
  .intg-detail-head { gap: 0.8rem; }
  .intg-detail-head .btn { width: 100%; }
  .intg-detail-headtext { min-width: 0; flex-basis: calc(100% - 76px); }
  .intg-detail-body .intg-empty, .intg-detail-body .intg-empty-lg { text-align: left; padding: 1.25rem 1.1rem; }
  .intg-detail-body .intg-voice-steps { margin: 0.9rem 0; max-width: none; }
  .intg-steps-card { padding: 1.15rem 1.1rem; }

  /* ── Persona modal: selects stack one-per-row on phones ── */
  .pp-persona-row { grid-template-columns: 1fr; }
}

/* ── Automations panel (#AU1) — the united see/manage view ── */
.auto-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.auto-new-btn { display: inline-flex; align-items: center; gap: 0.45rem; white-space: nowrap; flex-shrink: 0; margin-top: 0.35rem; }
.auto-new-btn svg { width: 16px; height: 16px; }

.auto-picker { margin-bottom: 1.25rem; }
.auto-picker-head h2 { margin-bottom: 0.1rem; }
.tmpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 0.8rem; margin: 1rem 0 1.1rem; }
.tmpl-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.35rem; text-align: left;
  padding: 1rem 1rem 0.9rem; background: var(--bg); border: 1px solid var(--border);
  border-radius: 14px; cursor: pointer; font-family: var(--font); color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.tmpl-card:hover { border-color: var(--accent-light); box-shadow: var(--shadow); transform: translateY(-1px); }
.tmpl-ico { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--grad-soft); color: var(--accent); }
.tmpl-ico svg { width: 19px; height: 19px; }
.tmpl-name { font-weight: 700; font-size: 0.95rem; letter-spacing: -0.01em; }
.tmpl-desc { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.45; }
.tmpl-cadence { font-size: 0.72rem; color: var(--text-faint); margin-top: auto; padding-top: 0.3rem; }
.tmpl-scratch { border-style: dashed; }

.auto-editor { margin-bottom: 1.25rem; }
.auto-label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); margin: 0.85rem 0 0.3rem; }
.auto-input {
  width: 100%; padding: 0.55rem 0.7rem; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text); font-family: var(--font); font-size: 0.9rem;
}
.auto-input:focus { outline: none; border-color: var(--accent-light); box-shadow: 0 0 0 3px rgba(136,61,255,.12); }
.auto-brief { resize: vertical; min-height: 74px; line-height: 1.5; }
.auto-sched-row { display: flex; gap: 0.8rem; flex-wrap: wrap; }
.auto-sched-row > div { flex: 1 1 180px; }
.auto-tz { font-size: 0.75rem; color: var(--text-faint); margin-top: 0.5rem; }
.auto-editor-actions { display: flex; align-items: center; gap: 0.6rem; margin-top: 1.05rem; flex-wrap: wrap; }
.auto-editor-note { font-size: 0.8rem; color: var(--danger); }

.auto-list { display: flex; flex-direction: column; gap: 0.65rem; }
.auto-row {
  display: flex; align-items: flex-start; gap: 0.85rem; padding: 0.95rem 1.05rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow);
}
.auto-row.paused { opacity: 0.62; }
.auto-row-ico { width: 34px; height: 34px; flex-shrink: 0; display: grid; place-items: center; border-radius: 10px; background: var(--grad-soft); color: var(--accent); margin-top: 0.1rem; }
.auto-row-ico svg { width: 18px; height: 18px; }
.auto-ico-watcher { background: rgba(0,210,160,.12); color: #0a9c7b; }
.auto-ico-reminder { background: rgba(255,171,61,.14); color: #b9740a; }
.auto-row-main { flex: 1; min-width: 0; }
.auto-row-brief { font-size: 0.92rem; font-weight: 500; line-height: 1.45; overflow-wrap: anywhere; }
.auto-row-meta { display: flex; align-items: center; gap: 0.55rem; flex-wrap: wrap; margin-top: 0.4rem; }
.auto-chip {
  font-size: 0.72rem; font-weight: 600; color: var(--accent); background: var(--grad-soft);
  padding: 0.14rem 0.55rem; border-radius: 999px; white-space: nowrap;
}
.auto-next, .auto-last, .auto-owner { font-size: 0.75rem; color: var(--text-faint); }
.auto-owner { color: var(--text-secondary); font-weight: 600; }
.auto-row-actions { display: flex; align-items: center; gap: 0.35rem; flex-shrink: 0; margin-top: 0.15rem; }
.auto-ibtn {
  width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid transparent;
  background: none; border-radius: 9px; color: var(--text-faint); cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}
.auto-ibtn svg { width: 15.5px; height: 15.5px; }
.auto-ibtn:hover { color: var(--accent); background: var(--bg-soft); }
.auto-ibtn-danger:hover { color: var(--danger); background: rgba(214,69,93,.08); }
.auto-toggle {
  width: 36px; height: 21px; border-radius: 999px; border: none; cursor: pointer;
  background: rgba(26,26,46,.16); position: relative; transition: background 0.18s ease; flex-shrink: 0;
}
.auto-toggle span {
  position: absolute; top: 2.5px; left: 2.5px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(26,26,46,.25); transition: transform 0.18s ease;
}
.auto-toggle.on { background: var(--accent); }
.auto-toggle.on span { transform: translateX(15px); }
.auto-empty-chips { display: flex; gap: 0.55rem; flex-wrap: wrap; margin-top: 0.9rem; }
.auto-empty-chip {
  display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.45rem 0.85rem;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
  font-family: var(--font); font-size: 0.82rem; font-weight: 600; color: var(--text); cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.auto-empty-chip:hover { border-color: var(--accent-light); color: var(--accent); }
.auto-empty-chip svg { width: 15px; height: 15px; color: var(--accent); }

@media (max-width: 860px) {
  .auto-head { flex-direction: column; }
  .auto-row { flex-wrap: wrap; }
  .auto-row-actions { margin-left: auto; }
  .tmpl-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .tmpl-grid { grid-template-columns: 1fr; }
}

/* #LG1 — updated-terms re-accept banner (bounded, dismissible, never blocks) */
.terms-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 0.9rem;
  flex-wrap: wrap; margin: 0 0 1rem; padding: 0.7rem 1rem;
  border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: 12px; background: var(--surface);
  font-size: 0.88rem; color: var(--text);
}
.terms-banner a { color: var(--accent); font-weight: 600; }
.terms-banner-actions { display: inline-flex; gap: 0.5rem; flex-shrink: 0; }


/* ── THE USAGE & AUDIT PAGE (#M5): daily bars · bucket chips · action matrix · per-user ── */
.usage-head-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.35rem; }
.usage-head-row h2 { margin-bottom: 0; }
.usage-seg { display: inline-flex; border: 1px solid var(--border-2); border-radius: 999px; overflow: hidden; }
.usage-seg-btn { border: 0; background: transparent; padding: 0.28rem 0.8rem; font: inherit; font-size: 0.82rem; font-weight: 700; color: var(--text-faint); cursor: pointer; }
.usage-seg-btn.active { background: var(--accent); color: #fff; }
.usage-chart { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding-top: 0.5rem; }
.usage-chart.dense { gap: 2px; }
.usage-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 0.35rem; height: 100%; }
.usage-vtrack { width: 100%; max-width: 34px; flex: 1; display: flex; align-items: flex-end; background: var(--bg-soft); border-radius: 6px 6px 3px 3px; overflow: hidden; }
.usage-col.slim .usage-vtrack { border-radius: 3px; }
.usage-vfill { width: 100%; background: var(--accent); border-radius: 6px 6px 0 0; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; transition: height .25s ease; }
.usage-vseg { width: 100%; }
.usage-vseg.seg-monthly { background: var(--accent); }
.usage-vseg.seg-carryover { background: #e8a13c; }
.usage-vseg.seg-permanent { background: #2fa06a; }
.usage-collabel { font-size: 0.62rem; font-weight: 600; color: var(--text-faint); white-space: nowrap; overflow: hidden; max-width: 100%; text-overflow: ellipsis; min-height: 0.8rem; }
.usage-chiprow { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: -0.4rem 0 0.9rem; }
.usage-chip { font-size: 0.74rem; font-weight: 700; padding: 0.22rem 0.65rem; border-radius: 999px; background: var(--bg-soft); color: var(--text-secondary); }
.usage-chip.chip-monthly { background: rgba(136, 61, 255, 0.12); color: var(--accent); }
.usage-chip.chip-carryover { background: rgba(232, 161, 60, 0.14); color: #a86a14; }
.usage-chip.chip-permanent { background: rgba(47, 160, 106, 0.13); color: #1f7a4e; }
.usage-expiry { margin-top: -0.5rem; }
.usage-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
th.usage-num, .people-table th.usage-num { text-align: right; }
.usage-user { font-weight: 600; }
.usage-user-sub { display: block; font-size: 0.74rem; color: var(--text-faint); }
.usage-unattributed td { color: var(--text-faint); }
.usage-zero { color: var(--text-faint); opacity: 0.55; }
.usage-spark { width: 100px; height: 22px; color: var(--accent); display: block; }
.usage-spark-empty { color: var(--text-faint); }
.usage-sparkcell { width: 110px; }
.usage-search { border: 1px solid var(--border-2); border-radius: 10px; padding: 0.4rem 0.75rem; font: inherit; font-size: 0.88rem; min-width: 200px; background: var(--bg); color: var(--text); }
.usage-sort { border: 0; background: transparent; padding: 0; font: inherit; font-size: inherit; font-weight: inherit; text-transform: inherit; letter-spacing: inherit; color: inherit; cursor: pointer; }
.usage-sort:hover { color: var(--accent); }
.usage-pager { display: flex; align-items: center; justify-content: center; gap: 0.9rem; margin-top: 0.9rem; }
.usage-pager .card-meta { margin-bottom: 0; }
@media (max-width: 700px) {
  .usage-chart { height: 110px; }
  .usage-sparkcell, .usage-spark { width: 64px; }
  .usage-search { min-width: 0; width: 100%; }
}
