:root {
  /* Light is the default theme. Dark is opt-in via <html data-theme="dark">. */
  --bg: #eef1f8;
  --bg-2: #ffffff;
  --panel: #ffffff;
  --panel-2: #f5f7fc;
  --line: #e2e7f2;
  --line-2: #d3dbec;
  --text: #1a2138;
  --muted: #5b6588;
  --accent: #3a66d6;
  --accent-2: #6a47d6;
  --ok: #1f9d6b;
  --err: #d6455a;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(20,30,60,.07), 0 2px 6px rgba(20,30,60,.05);
  --shadow: 0 10px 30px rgba(20,30,60,.10), 0 2px 8px rgba(20,30,60,.05);
  --shadow-lg: 0 24px 60px -18px rgba(20,30,60,.16), 0 8px 24px -12px rgba(20,30,60,.10);
  --ring: 0 0 0 3px rgba(58,102,214,.22);
  font-synthesis: none;
  color-scheme: light;
}

/* ---- Dark theme (toggled via <html data-theme="dark">, top-right button) ---- */
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1020;
  --bg-2: #111733;
  --panel: #151c3a;
  --panel-2: #1b2347;
  --line: #232c52;
  --line-2: #2c3768;
  --text: #e8ecf8;
  --muted: #8a93b8;
  --accent: #5b8cff;
  --accent-2: #7c5cff;
  --ok: #46d39a;
  --err: #ff6b7d;
  /* Layered, soft shadows for a premium sense of depth. */
  --shadow-sm: 0 1px 2px rgba(2, 6, 23, .4), 0 2px 6px rgba(2, 6, 23, .25);
  --shadow: 0 10px 30px rgba(2, 6, 23, .45), 0 2px 8px rgba(2, 6, 23, .3);
  --shadow-lg: 0 24px 60px -18px rgba(2, 6, 23, .7), 0 8px 24px -12px rgba(2, 6, 23, .5);
  --ring: 0 0 0 3px rgba(91, 140, 255, .25);
}
html[data-theme="dark"] body {
  background:
    radial-gradient(1200px 600px at 80% -10%, #1a2350 0%, rgba(11,16,32,0) 55%),
    radial-gradient(900px 500px at 0% 0%, #161d40 0%, rgba(11,16,32,0) 45%),
    var(--bg);
}
html[data-theme="dark"] .sidebar { background: rgba(10, 14, 30, .7); }

/* Theme toggle button (topbar, top-right) */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; padding: 0; margin: 0;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel); color: var(--muted);
  font-size: 17px; line-height: 1; cursor: pointer;
  transition: border-color .14s ease, color .14s ease, background .14s ease;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--text); }

/* ---------- Maintenance kill-switch (god-tier only) ---------- */
.maint-form { margin: 0; }
.maint-btn {
  display: inline-flex; align-items: center; gap: 7px; height: 38px; margin: 0;
  padding: 0 13px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel); color: var(--muted);
  font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: border-color .12s ease, color .12s ease, background .12s ease;
}
.maint-btn .maint-ico { font-size: 14px; line-height: 1; }
.maint-btn:hover { border-color: var(--accent); color: var(--text); }
.maint-btn.on {
  background: var(--err); border-color: var(--err); color: #fff; font-weight: 800; letter-spacing: .2px;
  box-shadow: 0 0 0 0 rgba(255, 107, 125, .6); animation: maintPulse 1.8s ease-out infinite;
}
.maint-btn.on:hover { background: var(--err); color: #fff; opacity: .94; }
.maint-btn.on .maint-ico { animation: maintBlink 1.1s steps(2, start) infinite; }
@keyframes maintPulse {
  0%   { box-shadow: 0 0 0 0 rgba(255, 107, 125, .55); }
  70%  { box-shadow: 0 0 0 9px rgba(255, 107, 125, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 107, 125, 0); }
}
@keyframes maintBlink { 50% { opacity: .35; } }

.maint-banner {
  display: flex; align-items: center; gap: 12px; margin: 0 0 18px; padding: 11px 16px;
  border-radius: var(--radius); border: 1px solid var(--err); border-left: 4px solid var(--err);
  background: linear-gradient(90deg, rgba(255, 107, 125, .12), transparent 70%), var(--panel);
}
.maint-banner-dot {
  flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--err);
  box-shadow: 0 0 0 4px rgba(255, 107, 125, .15); animation: maintBlink 1.1s steps(2, start) infinite;
}
.maint-banner-msg { flex: 1; color: var(--text); font-weight: 500; }
.maint-banner-form { margin: 0; }
.maint-banner-form button {
  margin: 0; width: auto; padding: 7px 14px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--err); background: var(--err); color: #fff;
  font-family: inherit; font-size: 13px; font-weight: 700;
}
.maint-banner-form button:hover { opacity: .92; }

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 80% -10%, #e3e9fb 0%, rgba(238,241,248,0) 55%),
    radial-gradient(900px 500px at 0% 0%, #eaf0ff 0%, rgba(238,241,248,0) 45%),
    var(--bg);
  background-attachment: fixed;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv02", "cv03", "cv04", "ss01";
}

h1, h2, h3 { letter-spacing: -0.02em; }

a { color: var(--accent); text-decoration: none; }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: .2px;
  font-size: 18px;
  color: var(--text);
  text-decoration: none;
}
a.brand:hover { color: var(--text); }
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-weight: 800;
}

/* ---------- Auth screens ---------- */
.auth-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}
.auth-card h1 { margin: 18px 0 2px; font-size: 22px; }
.auth-card .sub { margin: 0 0 18px; color: var(--muted); font-size: 14px; }

/* Split sign-in: pitch on the left, sign-in card on the right. */
.auth-split-body { background:
    radial-gradient(900px 500px at 12% 18%, rgba(124,92,255,.16), transparent 60%),
    radial-gradient(800px 520px at 85% 80%, rgba(91,140,255,.12), transparent 55%),
    var(--bg); }
.auth-split {
  width: 100%; max-width: 1000px;
  display: grid; grid-template-columns: 1.25fr 380px; gap: 56px; align-items: center;
}
.auth-split .auth-panel { display: flex; justify-content: flex-end; }
.auth-split .auth-card { box-shadow: var(--shadow), 0 30px 80px -40px rgba(0,0,0,.7); }
.brand-compact { font-size: 15px; opacity: .85; }

.auth-pitch { max-width: 480px; }
.auth-pitch .brand { font-size: 17px; margin-bottom: 30px; }
.pitch-h {
  font-size: 40px; line-height: 1.04; letter-spacing: -.02em; margin: 0 0 16px;
  font-weight: 800; color: var(--text);
  background: linear-gradient(120deg, var(--text) 30%, var(--accent) 120%);
  -webkit-background-clip: text; background-clip: text;
}
.pitch-lead { font-size: 15.5px; line-height: 1.55; color: var(--muted); margin: 0 0 24px; max-width: 440px; }
.pitch-points { list-style: none; margin: 0 0 24px; padding: 0; display: flex; flex-direction: column; gap: 11px; }
.pitch-points li {
  position: relative; padding-left: 26px; font-size: 14px; color: var(--text); line-height: 1.4;
}
.pitch-points li::before {
  content: ""; position: absolute; left: 0; top: 6px; width: 9px; height: 9px; border-radius: 3px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 12px rgba(91,140,255,.6);
}
.pitch-points b { color: var(--text); font-weight: 800; }
.pitch-foot {
  font-size: 12.5px; color: var(--muted); margin: 0; padding-top: 18px;
  border-top: 1px solid var(--line); letter-spacing: .2px; font-style: italic; opacity: .9;
}
@media (max-width: 820px) {
  .auth-split { grid-template-columns: 1fr; gap: 28px; max-width: 420px; }
  .auth-pitch { max-width: none; text-align: center; }
  .auth-split .auth-panel { justify-content: center; }
  .auth-pitch .brand { display: none; }
  .pitch-h { font-size: 30px; }
  .pitch-points { text-align: left; max-width: 340px; margin-inline: auto; }
}

label {
  display: block;
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--muted);
}
label small { color: var(--muted); opacity: .8; }
input[type=text], input[type=password], input[type=search], input[type=email], input[type=number], select, textarea {
  width: 100%;
  margin-top: 6px;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--text);
  font-size: 15px;
  outline: none;
}
textarea { font-family: inherit; line-height: 1.5; resize: vertical; }
input, select, textarea { transition: border-color .16s ease, box-shadow .16s ease; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: var(--ring); }

button, .btn {
  margin-top: 20px;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 6px 18px -6px rgba(91,140,255,.5), inset 0 1px 0 rgba(255,255,255,.18);
  transition: filter .16s ease, transform .16s ease, box-shadow .16s ease;
}
button:hover, .btn:hover { filter: brightness(1.07); transform: translateY(-1px); box-shadow: 0 10px 24px -6px rgba(91,140,255,.6), inset 0 1px 0 rgba(255,255,255,.22); }
button:active, .btn:active { transform: translateY(0); }

.err { background: rgba(255,107,125,.12); color: var(--err); padding: 10px 12px; border-radius: 9px; font-size: 14px; }
.ok  { background: rgba(70,211,154,.12); color: var(--ok); padding: 10px 12px; border-radius: 9px; font-size: 14px; }

.sso-divider {
  display: flex; align-items: center; gap: 12px; margin: 22px 0 16px;
  color: var(--muted); font-size: 11px; letter-spacing: 1.4px; text-transform: uppercase;
}
.sso-divider::before, .sso-divider::after { content: ""; flex: 1; height: 1px; background: rgba(255,255,255,.1); }

.sso-btn {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 13px;
  width: 100%; padding: 13px 15px; box-sizing: border-box;
  text-decoration: none; color: var(--text);
  border: 1px solid var(--line); border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(124,92,255,.10), rgba(91,140,255,.04)),
    var(--panel-2);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
  transition: border-color .18s, transform .18s, box-shadow .18s;
}
/* sweeping sheen on hover */
.sso-btn::after {
  content: ""; position: absolute; top: 0; left: -60%; width: 50%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.10), transparent);
  transform: skewX(-18deg); transition: left .55s ease;
}
.sso-btn:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(91,140,255,.22), inset 0 1px 0 rgba(255,255,255,.06);
}
.sso-btn:hover::after { left: 130%; }

.sso-ico {
  display: inline-grid; place-items: center; flex: 0 0 auto;
  width: 36px; height: 36px; border-radius: 9px;
  background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.25);
}
.sso-txt { display: flex; flex-direction: column; line-height: 1.25; text-align: left; }
.sso-txt strong { font-size: 15px; font-weight: 700; color: var(--text); }
.sso-txt small { font-size: 11.5px; color: var(--muted); }
.sso-arrow {
  margin-left: auto; font-size: 22px; line-height: 1; color: var(--muted);
  transition: transform .18s, color .18s;
}
.sso-btn:hover .sso-arrow { transform: translateX(3px); color: var(--accent); }

/* ---------- App shell ---------- */
.app-body { display: flex; min-height: 100vh; }

.sidebar {
  width: 230px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, .9);
  border-right: 1px solid var(--line);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  /* When the nav is taller than the viewport it must still scroll, but a raw
     browser scrollbar in the chrome looks awful - hide it and keep the scroll. */
  scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { width: 0; height: 0; }
/* On short viewports, tighten the nav so it fits without needing to scroll at
   all in the common case (the Admin block adds extra rows for operators). */
@media (max-height: 820px) {
  .sidebar { padding-top: 16px; padding-bottom: 16px; }
  .sidebar .brand { margin-bottom: 16px; }
  .nav-main, .nav-admin { gap: 2px; }
  .nav-section { margin: 10px 0 3px; }
  .nav-admin { padding-top: 10px; }
  .sidebar nav a { padding: 7px 12px; }
}
@media (max-height: 680px) {
  .sidebar .brand { margin-bottom: 12px; }
  .nav-section { margin: 7px 0 2px; }
  .sidebar nav a { padding: 6px 12px; font-size: 13px; }
}
.brand-mark { box-shadow: 0 4px 12px -2px rgba(91,140,255,.5); }
.sidebar .brand { margin-bottom: 26px; }
.sidebar nav { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.nav-main { display: flex; flex-direction: column; gap: 4px; }
/* Admin block is sunk to the bottom of the nav so it reads as a separate,
   de-emphasised tools area rather than part of the everyday workflow. */
.nav-admin {
  display: flex; flex-direction: column; gap: 4px;
  margin-top: auto; padding-top: 14px;
  border-top: 1px solid var(--line);
}
.nav-section-admin { opacity: .5; }
.nav-admin a { font-size: 13px; opacity: .8; }
.nav-admin a:hover { opacity: 1; }
.nav-admin a.active { opacity: 1; }
/* Collapsible Admin group: the section header is a toggle; items hide unless open. */
.nav-admin-toggle {
  display: flex; align-items: center; gap: 6px; width: 100%;
  background: none; border: 0; cursor: pointer; font: inherit; text-align: left;
}
.nav-admin-toggle > span:first-child { flex: 1; }
.nav-admin-toggle:hover { opacity: 1; }
.nav-admin-toggle .nav-caret { font-size: 9px; opacity: .7; transition: transform .15s ease; }
.nav-admin.open .nav-admin-toggle .nav-caret { transform: rotate(90deg); }
.nav-admin-items { display: none; flex-direction: column; gap: 4px; }
.nav-admin.open .nav-admin-items { display: flex; }
.nav-admin.open .admin-collapsed-badge { display: none; }
.sidebar nav a {
  color: var(--muted);
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  transition: background .14s ease, color .14s ease, box-shadow .14s ease;
}
.sidebar nav a:hover { background: var(--panel); color: var(--text); }
.sidebar nav a.active {
  background: linear-gradient(180deg, rgba(124,92,255,.16), rgba(91,140,255,.08)), var(--panel-2);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(91,140,255,.22), var(--shadow-sm);
}
.sidebar nav a.shake { animation: shake .35s; }
@keyframes shake {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}
/* ---------- Account / admin bar ---------- */
.account { position: relative; }
.account-btn {
  margin: 0; width: auto;
  display: flex; align-items: center; gap: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 6px 10px;
  min-height: 44px; box-sizing: border-box;
  cursor: pointer;
  color: var(--text);
  text-align: left;
}
.account-btn:hover { filter: none; border-color: var(--accent); }
.avatar {
  display: inline-grid; place-items: center;
  width: 30px; height: 30px; flex-shrink: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-weight: 700; font-size: 14px;
}
.account-meta { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.account-name { font-size: 13px; font-weight: 600; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-sub { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); font-weight: 500; }
.account-sub-name { line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.caret { color: var(--muted); font-size: 11px; margin-left: 2px; }

/* Role view-switcher (top bar, left of the account). Styled like the account box:
   a pill button showing the current role as a badge, opening a dropdown of role
   badges you can switch to. Accent ring while you're acting as a lower role. A
   plain badge (no button) when there's nothing below you. */
.role-switch { position: relative; }
.role-switch-btn {
  margin: 0; width: auto; display: flex; align-items: center; gap: 10px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 6px 10px; min-height: 44px; box-sizing: border-box;
  cursor: pointer; color: var(--text); text-align: left;
}
.role-switch-btn:hover { border-color: var(--accent); }
.role-switch-ico {
  width: 30px; height: 30px; flex-shrink: 0; border-radius: 8px;
  display: grid; place-items: center;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--muted);
  transition: background .14s ease, color .14s ease, border-color .14s ease;
}
.role-switch-meta { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.role-switch-cap { font-size: 9.5px; text-transform: uppercase; letter-spacing: .5px; font-weight: 600; color: var(--muted); line-height: 1; }
.role-switch.acting .role-switch-btn { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(91,140,255,.18); }
.role-switch.acting .role-switch-ico { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; color: #fff; }
.role-menu {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 230px; margin: 0;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px;
  padding: 6px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; z-index: 50;
}
.role-menu[hidden] { display: none; }
.role-menu-head { display: flex; flex-direction: column; gap: 2px; font-size: 10px; text-transform: uppercase; letter-spacing: .5px; font-weight: 700; color: var(--muted); padding: 5px 8px 6px; }
.role-menu-head span { text-transform: none; letter-spacing: 0; font-weight: 400; opacity: .8; font-size: 10.5px; }
.role-menu-sep { height: 1px; margin: 5px 8px; background: var(--line); }
.role-menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; margin: 0; font: inherit;
  background: none; border: 0; cursor: pointer; text-align: left;
  padding: 8px 10px; border-radius: 8px; color: var(--text);
}
.role-menu-item:hover,
.role-menu-item.active { background: var(--panel); }
.role-menu-lbl { font-size: 12px; color: var(--muted); }
.role-menu-check { margin-left: auto; color: var(--accent); font-weight: 700; }

/* Collapsible grouped nav (director + god views): default collapsed, the active group auto-opens.
   Scoped under .nav-col so these win over the base .nav-section styling. */
.nav-col { gap: 2px; }
.nav-col > a { font-size: 14px; padding: 10px 12px; }
.nav-col .nav-grp { display: flex; flex-direction: column; gap: 3px; margin-top: 10px; }
.nav-col .nav-grp-toggle {
  display: flex; align-items: center; gap: 8px; width: 100%; margin: 0;
  background: none; border: 0; cursor: pointer; text-align: left;
  padding: 9px 12px; border-radius: 9px;
  font-family: inherit; font-size: 12px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase;
  color: var(--muted); opacity: .85;
  transition: background .12s ease, color .12s ease, opacity .12s ease;
}
.nav-col .nav-grp-toggle:hover { background: var(--panel); color: var(--text); opacity: 1; }
.nav-col .nav-grp.open > .nav-grp-toggle { color: var(--text); opacity: 1; }
.nav-col .nav-grp-toggle > span:first-child { flex: 1; }
.nav-col .nav-grp-toggle .nav-caret { font-size: 9px; opacity: .7; transition: transform .15s ease; }
.nav-col .nav-grp.open .nav-grp-toggle .nav-caret { transform: rotate(90deg); }
.nav-col .nav-grp-items { display: none; flex-direction: column; gap: 3px; padding-top: 2px; }
.nav-col .nav-grp.open .nav-grp-items { display: flex; }

/* Sidebar "report a bug / idea" button + its modal (available to every user). */
.nav-feedback { width: 100%; margin: 14px 0 0; padding: 9px 12px; text-align: left; font: inherit; font-size: 13px; font-weight: 500; color: var(--muted); background: none; border: 1px dashed var(--line); border-radius: 10px; cursor: pointer; }
.nav-feedback:hover { color: var(--text); border-color: var(--accent); }
.fb-modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 200; padding: 20px; }
.fb-modal[hidden] { display: none; }
.fb-box { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 22px 24px; max-width: 480px; width: 100%; margin: 0; }
.fb-box h3 { margin: 0 0 14px; font-size: 18px; }
.fb-types { display: flex; gap: 18px; margin-bottom: 12px; font-size: 14px; }
.fb-types label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.fb-box textarea { width: 100%; box-sizing: border-box; margin: 0; }
.fb-acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.fb-acts .btn-sm { width: auto; margin: 0; }

.account-menu {
  position: absolute;
  right: 0; left: auto; top: calc(100% + 6px);
  min-width: 200px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 6px;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 2px;
  z-index: 50;
}
.account-menu[hidden] { display: none; }
.account-menu a {
  color: var(--text);
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 14px;
}
.account-menu a:hover { background: var(--panel); }
.menu-sep { height: 1px; margin: 5px 6px; background: var(--line); }

/* ---------- Site-wide maintenance banner ---------- */
.site-banner {
  display: flex; align-items: center; gap: 11px;
  margin: 0 0 18px;
  padding: 11px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  border-left-width: 3px;
  background: var(--panel);
  color: var(--text);
  font-size: 13.5px; line-height: 1.45;
}
.site-banner-dot {
  flex: none; width: 7px; height: 7px; border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .04);
}
.site-banner-label {
  flex: none; font-size: 11px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
}
.site-banner-msg { flex: 1; font-weight: 500; color: var(--text); }
.site-banner-info {
  border-left-color: var(--accent);
  background: linear-gradient(90deg, rgba(91, 140, 255, .10), transparent 70%), var(--panel);
}
.site-banner-info .site-banner-dot   { background: var(--accent); }
.site-banner-info .site-banner-label { color: var(--accent); }
.site-banner-warning {
  border-left-color: #ffb020;
  background: linear-gradient(90deg, rgba(255, 176, 32, .10), transparent 70%), var(--panel);
}
.site-banner-warning .site-banner-dot   { background: #ffb020; }
.site-banner-warning .site-banner-label { color: #ffb020; }
.site-banner-critical {
  border-left-color: var(--err);
  background: linear-gradient(90deg, rgba(255, 107, 125, .11), transparent 70%), var(--panel);
}
.site-banner-critical .site-banner-dot   { background: var(--err); }
.site-banner-critical .site-banner-label { color: var(--err); }
hr.sep { border: none; border-top: 1px solid var(--line); margin: 18px 0; }

/* ---------- Role badges ---------- */
.role-badge {
  display: inline-block;
  font-size: 11px; font-weight: 700;
  letter-spacing: .3px; text-transform: uppercase;
  padding: 2px 8px; border-radius: 999px;
}
.role-admin { background: rgba(124,92,255,.18); color: #b7a4ff; border: 1px solid rgba(124,92,255,.4); }
.role-subscriber { background: rgba(138,147,184,.14); color: var(--muted); border: 1px solid var(--line); }
.role-sales_agent { background: rgba(138,147,184,.14); color: var(--muted); border: 1px solid var(--line); }
.role-sales_manager { background: rgba(91,140,255,.16); color: var(--accent); border: 1px solid rgba(91,140,255,.4); }
.role-data_operator { background: rgba(45,212,125,.14); color: var(--ok,#2bd47d); border: 1px solid rgba(45,212,125,.4); }
/* Anubis - the god-tier role. Solid gold, faintly glowing. */
.role-anubis {
  color: #2a2000;
  background: linear-gradient(135deg, #f7d774 0%, #d4af37 45%, #b8860b 100%);
  border: 1px solid #f0c54a;
  box-shadow: 0 0 6px rgba(212,175,55,.55), inset 0 1px 0 rgba(255,255,255,.45);
  text-shadow: 0 1px 0 rgba(255,255,255,.35);
}
/* Horus - Egyptian sky-god operator badge. Polished obsidian with a brushed
   silver sheen, a steel rim and a faint moonlit glow. An Ankh leads the label. */
.role-horus {
  position: relative;
  color: #e7ebf3;
  background:
    linear-gradient(135deg, #2b2f38 0%, #14161b 42%, #050608 75%, #1c1f26 100%);
  border: 1px solid #767d8c;
  box-shadow:
    0 0 7px rgba(190,200,220,.40),
    inset 0 1px 0 rgba(255,255,255,.30),
    inset 0 -1px 2px rgba(0,0,0,.65);
  text-shadow: 0 1px 1px rgba(0,0,0,.85), 0 0 5px rgba(200,212,235,.45);
}
.role-horus::before {
  content: "\2625";          /* Ankh - guaranteed-legible Egyptian glyph */
  margin-right: 5px;
  font-weight: 700;
  /* brushed-silver gradient on the glyph itself */
  background: linear-gradient(180deg, #ffffff 0%, #c7cdd9 50%, #8b93a4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
}
/* Ganos Lal - the Ascended badge. The coolest thing on the page, by design:
   a facet-cut diamond wrapped in living aurora. A slow borealis gradient drifts
   behind crystal-clear text, a prismatic sheen sweeps across the crystal, and a
   soft multi-hue halo glows around the whole pill. Outranks gold and obsidian. */
.role-ganos {
  position: relative;
  overflow: hidden;
  color: #f4fbff;
  background: linear-gradient(
    115deg,
    #0a2a3a 0%, #0e7c8c 16%, #18d6b0 34%, #58e6a0 48%,
    #7c5cff 64%, #b06cff 80%, #18a0d6 100%);
  background-size: 320% 320%;
  border: 1px solid rgba(180,240,255,.75);
  box-shadow:
    0 0 10px rgba(70,230,200,.55),
    0 0 20px rgba(124,92,255,.40),
    inset 0 1px 0 rgba(255,255,255,.55),
    inset 0 -1px 3px rgba(0,30,40,.55);
  text-shadow: 0 1px 2px rgba(0,20,30,.85), 0 0 6px rgba(150,255,235,.6);
  animation: ganos-aurora 7s ease-in-out infinite;
}
.role-ganos::before {
  content: "\25C6";          /* Diamond - facet-cut gem glyph */
  margin-right: 5px;
  font-weight: 700;
  background: linear-gradient(180deg, #ffffff 0%, #bdf4ff 45%, #7cf0d0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 6px rgba(170,255,240,.85);
}
.role-ganos::after {     /* prismatic sheen sweeping across the crystal */
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(
    115deg, transparent 30%, rgba(255,255,255,.55) 48%, transparent 66%);
  transform: translateX(-120%);
  animation: ganos-sheen 4.5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes ganos-aurora {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes ganos-sheen {
  0%, 100% { transform: translateX(-120%); }
  55%      { transform: translateX(120%); }
}
/* Respect users who ask the OS to reduce motion: keep the gem + glow, drop the
   drifting aurora and the sheen sweep. */
@media (prefers-reduced-motion: reduce) {
  .role-ganos { animation: none; background-position: 30% 50%; }
  .role-ganos::after { display: none; }
}

/* ---------- Layout helpers ---------- */
.grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } }
.panel.narrow { max-width: 480px; }
.stack label { margin-top: 0; }
.stack > * + * { margin-top: 14px; }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 20px; }
.form-actions button { margin-top: 0; width: auto; }

/* ---------- Settings page ---------- */
.settings-wrap { max-width: 760px; }
.settings-intro { margin: 0 0 22px; color: var(--muted); font-size: 14px; max-width: 680px; }
.flash-msg { margin-bottom: 18px; }

.set-panel {
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,0)), var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 24px; box-shadow: var(--shadow-sm);
}
.set-panel + .set-panel { margin-top: 18px; }
.set-panel[id] { scroll-margin-top: 18px; }

.set-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 18px; }
.set-ico {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 11px;
  display: grid; place-items: center; font-size: 19px; color: #cdd6f4;
  background: linear-gradient(180deg, rgba(124,92,255,.20), rgba(91,140,255,.06));
  border: 1px solid var(--line); box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}
.set-ico.ico-green  { background: linear-gradient(180deg, rgba(70,211,154,.22), rgba(70,211,154,.05)); color: #7ef0c0; }
.set-ico.ico-violet { background: linear-gradient(180deg, rgba(124,92,255,.26), rgba(124,92,255,.06)); color: #c3b2ff; }
.set-ico.ico-amber  { background: linear-gradient(180deg, rgba(240,179,74,.22), rgba(240,179,74,.05)); color: #f3cd83; }
.set-head h2 { margin: 0; font-size: 17px; line-height: 1.2; }
.set-head .set-sub { margin: 4px 0 0; font-size: 13px; color: var(--muted); line-height: 1.45; }

.set-kv { margin: 0; }
.set-actions { margin-top: 16px; }
.set-note { margin: 14px 0 0; font-size: 13px; }

/* live ARR readout strip */
.set-readout {
  display: flex; flex-wrap: wrap; gap: 8px 32px;
  padding: 16px 18px; border-radius: 12px;
  border: 1px solid rgba(70,211,154,.28);
  background: linear-gradient(180deg, rgba(70,211,154,.08), rgba(70,211,154,.01));
}
.set-readout .ro { display: flex; flex-direction: column; gap: 3px; }
.set-readout .ro b { font-size: 23px; font-weight: 700; color: var(--text); line-height: 1; }
.set-readout .ro span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }

/* forms */
.set-form { margin-top: 20px; }
.field-set-label { margin: 22px 0 0; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-top: 12px; }
.field { display: flex; flex-direction: column; }
.field .field-label { font-size: 13px; color: var(--muted); margin-bottom: 7px; }
.field .hint { font-size: 12px; color: var(--muted); opacity: .82; margin-top: 7px; line-height: 1.4; }

/* input with affix tag (%, EUR, days, rows...) */
.affix {
  display: flex; align-items: stretch; overflow: hidden;
  border: 1px solid var(--line); border-radius: 10px; background: var(--bg-2);
  transition: border-color .16s ease, box-shadow .16s ease;
}
.affix:focus-within { border-color: var(--accent); box-shadow: var(--ring); }
.affix input { flex: 1 1 auto; min-width: 0; border: 0 !important; background: transparent !important; box-shadow: none !important; margin: 0 !important; }
.affix .affix-tag {
  display: grid; place-items: center; padding: 0 13px;
  background: rgba(255,255,255,.04); color: var(--muted);
  font-size: 13.5px; font-weight: 600; white-space: nowrap;
}
.affix .affix-tag:first-child { border-right: 1px solid var(--line); }
.affix .affix-tag:last-child  { border-left: 1px solid var(--line); }

/* toggle switch */
.switch { display: inline-flex; align-items: center; gap: 12px; margin-top: 20px; cursor: pointer; font-size: 14px; color: var(--text); }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track {
  flex: 0 0 auto; width: 44px; height: 25px; border-radius: 999px; position: relative;
  background: var(--bg-2); border: 1px solid var(--line);
  transition: background .18s ease, border-color .18s ease;
}
.switch .track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 19px; height: 19px;
  border-radius: 50%; background: #9aa3b8; transition: transform .18s ease, background .18s ease;
}
.switch input:checked + .track { background: rgba(70,211,154,.28); border-color: var(--ok); }
.switch input:checked + .track::after { transform: translateX(19px); background: var(--ok); }
.switch input:focus-visible + .track { box-shadow: var(--ring); }

/* role-inbox chips */
.chip-field { margin-top: 20px; }
.chip-field .field-label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 11px; }
.role-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.role-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--bg-2);
  color: var(--muted); font-size: 13px; cursor: pointer; user-select: none;
  transition: border-color .14s ease, color .14s ease, background .14s ease;
}
.role-chip input { position: absolute; opacity: 0; pointer-events: none; }
.role-chip:hover { border-color: var(--accent); color: var(--text); }
.role-chip:has(input:checked) { background: rgba(124,92,255,.18); border-color: var(--accent); color: var(--text); }
.role-chip:has(input:checked)::before { content: "\2713"; font-weight: 700; color: var(--accent); font-size: 12px; }
.role-chip:has(input:focus-visible) { box-shadow: var(--ring); }

/* recrawl band hints */
.band-grid .field-label { font-weight: 600; }
.band-a { color: #7ef0c0 !important; } .band-b { color: #b7e38a !important; }
.band-c { color: #f3cd83 !important; } .band-d { color: #f0a878 !important; }
.band-f { color: #f08a98 !important; }

.set-form .form-actions { margin-top: 24px; }

/* ---------- Data table ---------- */
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th {
  text-align: left; color: var(--muted); font-weight: 600;
  font-size: 12px; text-transform: uppercase; letter-spacing: .4px;
  padding: 8px 10px; border-bottom: 1px solid var(--line);
}
table.data td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
.you { font-size: 11px; color: var(--accent); margin-left: 6px; }
.row-actions { display: flex; gap: 8px; justify-content: flex-end; }
.row-actions form { display: inline; }

.btn-sm {
  margin: 0; width: auto;
  display: inline-block;
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color .14s ease, background .14s ease, transform .14s ease;
}
.btn-sm:hover { border-color: var(--accent); filter: none; transform: translateY(-1px); }
.btn-sm:active { transform: translateY(0); }
.btn-sm.danger { border-color: rgba(255,107,125,.4); color: var(--err); background: rgba(255,107,125,.08); }
.btn-sm.danger:hover { background: rgba(255,107,125,.16); }
/* Inert action - rendered as a <span>, not a link/button. Greyed, no pointer. */
.btn-sm.is-disabled {
  opacity: .4;
  cursor: not-allowed;
  pointer-events: auto; /* keep the title tooltip on hover */
  box-shadow: none;
}
.btn-sm.is-disabled:hover { border-color: var(--line); transform: none; }

/* Instant CSS tooltip (no native title delay). Put .tip on the element and the
   text in data-tip; shows immediately on hover/focus, above the element. */
.tip { position: relative; }
.tip::after {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  padding: 4px 8px; border-radius: 5px;
  background: #11151c; color: #fff; border: 1px solid var(--line);
  font-size: 11px; font-weight: 500; line-height: 1.2; white-space: nowrap;
  opacity: 0; pointer-events: none; z-index: 60;
}
.tip:hover::after, .tip:focus-visible::after { opacity: 1; }

.kv { display: grid; grid-template-columns: 120px 1fr; gap: 8px 16px; margin: 0; }
.kv.wide { grid-template-columns: 150px 1fr; }
.kv dt { color: var(--muted); font-size: 14px; }
.kv dd { margin: 0; font-size: 14px; word-break: break-word; }

/* card-as-link */
a.card { color: var(--text); text-decoration: none; transition: border-color .12s; }
a.card:hover { border-color: var(--accent); }

/* ---------- Filter bar + list ---------- */
.filterbar {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 16px;
}
.filterbar input[type=search], .filterbar select {
  width: auto; margin: 0;
  padding: 8px 10px; font-size: 13px;
}
.filterbar input[type=search] { min-width: 240px; flex: 1; }
.filterbar .btn-sm { margin: 0; }
.list-meta { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }

/* ---------- Leads filter panel (card with a separated action row) ---------- */
.filters {
  display: flex; flex-direction: column; gap: 12px;
  margin-bottom: 16px; padding: 14px 16px;
  background: linear-gradient(180deg, rgba(255,255,255,.025), rgba(255,255,255,0)), var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.filters-search { position: relative; }
.filters-search-ico {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  font-size: 13px; opacity: .5; pointer-events: none;
}
.filters-search input[type=search] {
  width: 100%; margin: 0; padding: 10px 12px 10px 34px; font-size: 14px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; color: var(--text);
}
.filters-search input[type=search]:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.filters-fields { display: flex; flex-wrap: wrap; gap: 8px; }
.filters-fields select,
.filters-fields input[type=text] {
  width: auto; margin: 0; padding: 8px 11px; font-size: 13px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 9px; color: var(--text);
  transition: border-color .14s ease;
}
.filters-fields select:hover,
.filters-fields input[type=text]:hover { border-color: var(--line-2); }
.filters-fields select:focus,
.filters-fields input[type=text]:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.filters-actions {
  display: flex; align-items: center; gap: 14px;
  border-top: 1px solid var(--line); padding-top: 12px;
}
.filters-hint { font-size: 12.5px; color: var(--muted); margin-right: auto; }
.filters-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; margin-right: 4px;
  font-size: 11px; font-weight: 700; line-height: 1; color: #0b0e1a;
  background: var(--accent); border-radius: 999px;
}
.filters-reset { font-size: 13px; color: var(--muted); white-space: nowrap; }
.filters-reset:hover { color: var(--text); text-decoration: underline; }
.filters-apply { padding: 8px 18px; font-weight: 600; }
/* Compact one-row variant for sparse filter bars (inbox, crm, suppression,
   audit): fields and the action group share a single row, no divider. The
   buttons still read as primary-action + quiet-link so they never blend in
   with the selects. */
.filters-inline { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 12px; }
.filters-inline .filters-fields { flex: 1 1 auto; }
.filters-inline .filters-search { flex: 1 1 240px; min-width: 200px; }
.filters-inline .filters-actions { border-top: none; padding-top: 0; margin-left: auto; gap: 12px; }
.pager { display: flex; align-items: center; gap: 14px; margin-top: 16px; }
.nowrap { white-space: nowrap; }
code.audit-action {
  font-size: 12px; padding: 2px 6px; border-radius: 4px;
  background: var(--panel-2); color: var(--text);
}

.clickrow { cursor: pointer; }
.clickrow:hover td { background: var(--panel-2); }
td.strong, .strong { font-weight: 600; }

/* ---------- Pills ---------- */
.pill {
  display: inline-block; font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 999px; white-space: nowrap;
  background: rgba(138,147,184,.14); color: var(--muted); border: 1px solid var(--line);
  text-transform: capitalize;
}
.pill.wp { background: rgba(91,140,255,.16); color: #9bb6ff; border-color: rgba(91,140,255,.4); }
.pill.warn { background: rgba(255,180,84,.16); color: #ffce8a; border-color: rgba(255,180,84,.4); }
.pill.customer { background: rgba(70,211,154,.16); color: #7fe3bd; border-color: rgba(70,211,154,.45); text-transform: none; }
.ssl-free  { background: rgba(255,180,84,.14); color: #ffce8a; border-color: rgba(255,180,84,.35); }
.ssl-paid  { background: rgba(70,211,154,.14); color: #7fe3bd; border-color: rgba(70,211,154,.35); }
.load-superfast { background: rgba(94,201,255,.16); color: #9fe0ff; border-color: rgba(94,201,255,.45); }
.load-fast   { background: rgba(70,211,154,.14); color: #7fe3bd; border-color: rgba(70,211,154,.35); }
.load-medium { background: rgba(255,180,84,.14); color: #ffce8a; border-color: rgba(255,180,84,.35); }
.load-slow   { background: rgba(255,107,125,.14); color: #ff9ba6; border-color: rgba(255,107,125,.4); }
.es-valid    { background: rgba(70,211,154,.14); color: #7fe3bd; border-color: rgba(70,211,154,.35); }
.es-invalid  { background: rgba(255,107,125,.14); color: #ff9ba6; border-color: rgba(255,107,125,.4); }
.es-risky    { background: rgba(255,180,84,.14); color: #ffce8a; border-color: rgba(255,180,84,.35); }
.es-catchall { background: rgba(124,92,255,.14); color: #b7a4ff; border-color: rgba(124,92,255,.35); }
.es-unknown  { background: rgba(138,147,184,.14); color: var(--muted); border-color: var(--line); }
.st-new { background: rgba(91,140,255,.14); color: #9bb6ff; border-color: rgba(91,140,255,.35); }
.st-qualified, .st-contacted, .st-replied { background: rgba(124,92,255,.16); color: #b7a4ff; border-color: rgba(124,92,255,.4); }
.st-won { background: rgba(70,211,154,.16); color: #7fe3bd; border-color: rgba(70,211,154,.4); }
.st-dead, .st-error { background: rgba(255,107,125,.14); color: #ff9ba6; border-color: rgba(255,107,125,.4); }
.st-queued  { background: rgba(91,140,255,.14); color: #9bb6ff; border-color: rgba(91,140,255,.35); }
.st-claimed { background: rgba(255,180,84,.14); color: #ffce8a; border-color: rgba(255,180,84,.35); }
/* Lead-score bands: A hot (green) -> F unusable (red). */
.pill.score-A { background: rgba(70,211,154,.18);  color: #7fe3bd; border-color: rgba(70,211,154,.5);  font-weight: 600; }
.pill.score-B { background: rgba(94,201,255,.16);  color: #9fe0ff; border-color: rgba(94,201,255,.45); font-weight: 600; }
.pill.score-C { background: rgba(255,180,84,.16);  color: #ffce8a; border-color: rgba(255,180,84,.45); font-weight: 600; }
.pill.score-D { background: rgba(255,140,100,.16); color: #ffb38f; border-color: rgba(255,140,100,.45); font-weight: 600; }
.pill.score-F { background: rgba(255,107,125,.16); color: #ff9ba6; border-color: rgba(255,107,125,.45); font-weight: 600; }
.ls-val-unit { font-size: .62em; color: var(--muted); font-weight: 400; margin-left: 1px; }

/* ---------- Sub-tabs ---------- */
.subtabs {
  display: flex; gap: 4px; margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.subtabs a {
  padding: 9px 16px; color: var(--muted); font-size: 14px; font-weight: 600;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  display: inline-flex; align-items: center; gap: 7px;
}
.subtabs a:hover { color: var(--text); }
.subtabs a.active { color: var(--text); border-bottom-color: var(--accent); }

/* ---------- Verify queue: ETA + priority ---------- */
.eta-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 16px; padding: 12px 16px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
}
.eta-prios { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.eta-msg strong { color: var(--text); }
.warn-text { color: #ffce8a; }
.prio-chip {
  display: inline-block; font-size: 11px; font-weight: 600;
  padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line);
  background: rgba(138,147,184,.12); color: var(--muted);
}
.prio-chip strong { color: var(--text); margin-left: 2px; }
.prio-high   { background: rgba(255,107,125,.14); color: #ff9ba6; border-color: rgba(255,107,125,.4); }
.prio-normal { background: rgba(91,140,255,.14); color: #9bb6ff; border-color: rgba(91,140,255,.35); }
.prio-low    { background: rgba(138,147,184,.12); color: var(--muted); border-color: var(--line); }

/* ---------- Bulk verify preview ---------- */
.bulk-summary {
  display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 18px;
}
.bulk-stat {
  flex: 1 1 120px; padding: 14px 16px; border-radius: 12px;
  background: var(--panel-2, rgba(138,147,184,.06)); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 4px;
}
.bulk-num { font-size: 24px; font-weight: 700; color: var(--text); line-height: 1.1; }
.bulk-lbl { font-size: 12px; color: var(--muted); }
.bulk-h3 { margin: 22px 0 6px; font-size: 15px; }
.tier-bar {
  display: flex; height: 14px; border-radius: 999px; overflow: hidden;
  background: rgba(138,147,184,.12); margin: 10px 0;
}
.tier-seg { height: 100%; display: block; }
.tier-seg.prio-high   { background: #ff6b7d; }
.tier-seg.prio-normal { background: #5b8cff; }
.tier-seg.prio-low    { background: #6b7390; }
.bulk-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.bulk-prio { display: flex; gap: 8px; align-items: center; margin-top: 18px; }
.bulk-prio select { padding: 6px 10px; }
.bulk-confirm { display: flex; gap: 10px; align-items: center; margin-top: 14px; }
.btn-sm.primary { background: var(--accent); color: #0b0e1a; border-color: var(--accent); font-weight: 600; }
.btn-sm.primary:hover { filter: brightness(1.08); }

/* ---------- Lead detail ---------- */
.lead-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.lead-head h2 { margin: 6px 0 8px; font-size: 24px; }
.lead-head .btn-sm { flex-shrink: 0; }
.lead-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; flex-shrink: 0; }
.lead-actions form.inline { display: inline; margin: 0; }
.lead-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.back { font-size: 13px; color: var(--muted); display: inline-block; margin-bottom: 12px; }
.back:hover { color: var(--accent); }
.kv.cols { grid-template-columns: 150px 1fr 150px 1fr; }

/* Lead detail: even, well-spaced card grid. Every info panel gets equal
   width and aligns to the top of its row, so Site/tech, Campaign, DNS and
   Contact read as four clean cards instead of overlapping uneven columns.
   Registry & scan spans the full width as a wide footer card. */
.lead-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px; align-items: start;
}
.lead-grid .lead-span { grid-column: 1 / -1; }
.lead-grid .panel { height: 100%; }
@media (max-width: 860px) { .lead-grid { grid-template-columns: 1fr; } }

/* ---------- Lead detail: hero + summary strip ---------- */
.lead-hero {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 20px; margin-bottom: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,0)), var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.lead-id { display: flex; align-items: center; gap: 14px; min-width: 0; }
.lead-avatar {
  flex-shrink: 0; width: 48px; height: 48px; border-radius: 13px;
  display: inline-grid; place-items: center; font-size: 22px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: var(--shadow-sm);
}
.lead-id-meta { min-width: 0; }
.lead-id-meta h2 { margin: 0 0 7px; font-size: 23px; line-height: 1; word-break: break-all; }
.lead-hero .lead-actions { align-items: center; }
@media (max-width: 760px) { .lead-hero { flex-direction: column; align-items: flex-start; } }

.lead-summary {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 1px; margin-bottom: 16px; overflow: hidden;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--radius);
}
.ls-tile { background: var(--panel); padding: 13px 16px; display: flex; flex-direction: column; gap: 5px; }
.ls-lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.ls-val { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; color: var(--text); line-height: 1.1; }
.ls-val small { font-size: 13px; color: var(--muted); font-weight: 600; }
.ls-val-sm { font-size: 15px; font-weight: 600; }

/* refined key/value panels */
.panel .kv.wide dt, .panel .kv.cols dt { padding: 7px 0; border-top: 1px solid var(--line); }
.panel .kv.wide dd, .panel .kv.cols dd { padding: 7px 0; border-top: 1px solid var(--line); }
.panel .kv.wide > dt:first-of-type, .panel .kv.wide > dd:nth-of-type(1),
.panel .kv.cols > dt:first-of-type { border-top: 0; }
@media (max-width: 700px) { .kv.cols { grid-template-columns: 150px 1fr; } }

/* ---------- Workers ---------- */
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; vertical-align: middle; }
.dot-on { background: var(--ok); box-shadow: 0 0 0 3px rgba(70,211,154,.18); }
.dot-paused { background: #ffce8a; box-shadow: 0 0 0 3px rgba(255,180,84,.18); }
.dot-off { background: #5a6388; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }
.small { font-size: 12px; }
td.small { line-height: 1.5; }
.bulk { display: inline-flex; gap: 8px; }
.bulk form { display: inline; }
.bulk .btn-sm { margin: 0; }
.check { display: flex; align-items: center; gap: 8px; color: var(--text); }
.check input { width: auto; margin: 0; }

.keybox {
  background: var(--panel-2);
  border: 1px solid rgba(91,140,255,.4);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 16px;
}
.keybox p { margin: 0 0 10px; }
.keyval {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
  word-break: break-all;
  color: #9bb6ff;
}
.keybox code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 20px; margin: 0; }
.account-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 10px;
  background: linear-gradient(135deg, rgba(91,140,255,0.12), rgba(124,92,255,0.12));
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.01em;
}
.account-tag-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(70,211,154,0.18);
}
.account-tag-name { line-height: 1; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.who { color: var(--muted); font-size: 14px; }
.btn-ghost {
  margin: 0; width: auto;
  background: transparent;
  border: 1px solid var(--line);
  padding: 8px 14px;
  border-radius: 9px;
  color: var(--text);
  font-size: 13px;
}

.content { padding: 26px 28px; }
.muted { color: var(--muted); }

/* ---------- Cards ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}
.card {
  background: linear-gradient(180deg, rgba(255,255,255,.025), rgba(255,255,255,0)), var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow-sm);
  transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}
.card-label { color: var(--muted); font-size: 13px; }
.card-value { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }
.card-foot { font-size: 12px; }

/* ---------- Dashboard: KPI tiles ---------- */
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 18px; }
/* kpi-quad: lock to a strict 4-up grid on desktop so 8 cards lay out as two clean rows of four (instead of auto-fit cramming them onto one row on wide screens). */
@media (min-width: 980px) { .kpi-quad { grid-template-columns: repeat(4, 1fr); } }
.kpi {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,0)), var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; display: flex; flex-direction: column; gap: 8px;
  box-shadow: var(--shadow-sm);
  transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: linear-gradient(180deg, var(--accent), var(--accent-2)); opacity: .85; }
.kpi.kpi-accent::before { background: linear-gradient(180deg, var(--ok), #2bb87f); }
.kpi:hover { transform: translateY(-2px); border-color: var(--line-2); box-shadow: var(--shadow); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.kpi-label { color: var(--muted); font-size: 12.5px; text-transform: uppercase; letter-spacing: .5px; }
.kpi-chip { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: rgba(91,140,255,.16); color: #9bb6ff; border: 1px solid rgba(91,140,255,.34); }
.kpi-chip.ok { background: rgba(70,211,154,.16); color: #7fe3bd; border-color: rgba(70,211,154,.4); }
.kpi-value { font-size: 32px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; color: var(--text); }
.kpi-foot { font-size: 12.5px; color: var(--muted); }
.trend-up { color: var(--ok); font-weight: 700; }

/* ---------- Dashboard density (scoped to .dash) ---------- */
/* The dashboard reads great but ran long; tighten gaps, padding, panel
   heights and chart sizes so it fits with noticeably less vertical scroll
   without dropping any data or changing the look. */
.dash .kpi-row { gap: 12px; margin-bottom: 12px; }
.dash .kpi { padding: 13px 16px; gap: 6px; }
.dash .kpi-value { font-size: 28px; }
.dash .dash-split { gap: 12px; margin-bottom: 12px; }
.dash .grid-2 { gap: 12px; }
.dash .panel { padding: 15px 17px; }
.dash .panel-head h2,
.dash .panel-head-row h2 { margin-bottom: 9px; }
.dash .funnel { gap: 7px; }
.dash .funnel-track { height: 18px; }
.dash .rings { gap: 6px; }
.dash .ring { --size: 78px; }
.dash .ring::before { inset: 8px; }
.dash .ring-pct { font-size: 17px; }
.dash .rings-foot { margin-top: 12px; }
.dash .card-mini { padding: 9px 12px; }
.dash .statbars { gap: 7px; }
.dash .statbar .sb-track { height: 7px; }

/* ---------- Dashboard: condensed breakdown pane (single glass) ---------- */
/* Pipeline / email / hosts / geography were four full-height panels; fold them
   into one pane as four compact columns so the page ends in a single band. */
/* ---- Dashboard trends (inline-SVG line charts) -------------------------- */
.trends { margin-bottom: 16px; }
.trends .trend-sub { font-size: 12px; font-weight: 400; }
.trend-filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.seg-btn { padding: 5px 12px; font-size: 12px; font-weight: 600; color: var(--muted); text-decoration: none; background: transparent; line-height: 1.5; transition: background .12s, color .12s; }
.seg-btn + .seg-btn { border-left: 1px solid var(--line); }
.seg-btn:hover { color: var(--text); background: rgba(138, 147, 184, .08); }
.seg-btn.active { color: #fff; background: var(--accent); }
.trend-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.trend-card {
  border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px 10px;
  background: linear-gradient(180deg, rgba(138, 147, 184, .07), rgba(138, 147, 184, .02));
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.trend-card:hover { border-color: var(--line-2); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.trend-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.trend-headings { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.trend-title { font-size: 11px; font-weight: 700; color: var(--text); text-transform: uppercase; letter-spacing: .5px; }
.trend-cap { font-size: 11px; color: var(--muted); }
.trend-figure { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; white-space: nowrap; }
.trend-now { font-size: 22px; font-weight: 800; color: var(--text); line-height: 1.1; letter-spacing: -.5px; }
.trend-delta { font-size: 11px; font-weight: 700; }
.trend-delta.up { color: var(--ok); }
.trend-delta.down { color: var(--err); }
.trend-chart { width: 100%; height: 88px; display: block; margin-top: 8px; overflow: visible; }
.trend-axis { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); margin-top: 2px; }
@media (max-width: 640px) { .trend-grid { grid-template-columns: 1fr; } }

.breakdowns { margin-bottom: 12px; }
.bd-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px 28px; }
.bd-grid > .bd + .bd { position: relative; }
.bd-grid > .bd + .bd::before {
  content: ""; position: absolute; left: -14px; top: 2px; bottom: 2px;
  width: 1px; background: var(--line);
}
@media (max-width: 1040px) {
  .bd-grid { grid-template-columns: repeat(2, 1fr); }
  .bd-grid > .bd + .bd::before { display: none; }
}
@media (max-width: 580px) { .bd-grid { grid-template-columns: 1fr; } }
.bd-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  margin-bottom: 11px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.bd-head h3 { margin: 0; font-size: 11.5px; font-weight: 600; letter-spacing: .5px;
  text-transform: uppercase; color: var(--muted); }
.bd-link { font-size: 11px; color: var(--muted); white-space: nowrap; }
.bd-link:hover { color: var(--accent); }
.bd .statbars { gap: 6px; }
.bd .statbar { grid-template-columns: 76px 1fr 40px; gap: 9px; }
.bd .statbar .sb-label { font-size: 12px; }
.bd .statbar .sb-track { height: 6px; }
.bd .statbar .sb-count { font-size: 12px; }

/* ---------- Dashboard: funnel + rings split ---------- */
.dash-split { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; align-items: stretch; margin-bottom: 16px; }
@media (max-width: 900px) { .dash-split { grid-template-columns: 1fr; } }
.panel-head-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.panel-head-row h2 { margin: 0 0 12px; font-size: 16px; }
.panel-link { font-size: 12.5px; color: var(--muted); }
.panel-link:hover { color: var(--accent); }

/* ---------- Crons dashboard ---------- */
.code-block { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; line-height: 1.6; color: var(--text); white-space: pre-wrap; word-break: break-all; overflow-x: auto; }
.cron-desc-row td { padding-top: 0 !important; border-top: 0 !important; }
.cron-desc-row { border-bottom: 1px solid var(--line); }

.funnel { display: flex; flex-direction: column; gap: 11px; }
.funnel-row { display: grid; grid-template-columns: 110px 1fr 92px; align-items: center; gap: 12px; }
.funnel-label { font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.funnel-track { height: 22px; border-radius: 7px; background: var(--bg-2); overflow: hidden; border: 1px solid var(--line); }
.funnel-fill { display: block; height: 100%; border-radius: 6px 0 0 6px; transition: width .4s ease; box-shadow: inset 0 1px 0 rgba(255,255,255,.18); }
.funnel-num { font-size: 13px; font-weight: 700; text-align: right; color: var(--text); }
.funnel-num small { color: var(--muted); font-weight: 600; margin-left: 3px; }
.funnel-row:hover .funnel-label { color: var(--accent); }

.rings-panel { display: flex; flex-direction: column; }
.rings { display: flex; justify-content: space-around; gap: 10px; flex-wrap: wrap; flex: 1; align-items: center; }
.ring-stat { display: flex; flex-direction: column; align-items: center; gap: 9px; text-align: center; }
.ring {
  --size: 92px; --pct: 0;
  width: var(--size); height: var(--size); border-radius: 50%;
  display: grid; place-items: center; position: relative;
  background: conic-gradient(var(--ring-c, var(--accent)) calc(var(--pct) * 1%), var(--bg-2) 0);
}
.ring::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: var(--panel); border: 1px solid var(--line); }
.ring.ring-accent { --ring-c: var(--accent); }
.ring.ring-violet { --ring-c: var(--accent-2); }
.ring.ring-ok { --ring-c: var(--ok); }
.ring-pct { position: relative; font-size: 20px; font-weight: 800; letter-spacing: -0.02em; color: var(--text); }
.ring-pct small { font-size: 12px; font-weight: 600; color: var(--muted); }
.ring-label { font-size: 13px; font-weight: 600; color: var(--text); display: block; }
.ring-sub { font-size: 11.5px; }
.rings-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.card-mini { padding: 11px 13px; border-radius: 11px; background: var(--bg-2); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; transition: border-color .15s ease; }
.card-mini:hover { border-color: var(--line-2); }
.card-mini-val { font-size: 19px; font-weight: 700; color: var(--text); letter-spacing: -0.02em; }
.card-mini-lbl { font-size: 11.5px; color: var(--muted); }
/* Archived/dead tile: muted-red accent when there are any */
.card-mini-dead { border-color: rgba(255,107,125,.45); background: rgba(255,107,125,.06); }
.card-mini-dead:hover { border-color: var(--err); }
.card-mini-dead .card-mini-val { color: var(--err); }
/* Dead/archived rows in the Leads table read dimmed + struck */
tr.lead-dead { opacity: .62; }
tr.lead-dead td.strong { text-decoration: line-through; text-decoration-color: rgba(255,107,125,.6); }
.pill.dead-pill { background: rgba(255,107,125,.16); color: var(--err); }

/* ---------- Panel ---------- */
.panel {
  background: linear-gradient(180deg, rgba(255,255,255,.025), rgba(255,255,255,0)), var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,.03);
}
.panel-head h2 { margin: 0 0 12px; font-size: 16px; }

/* ---------- Stat strip (audience / suppression / analytics) ---------- */
.stat-row { display: flex; flex-wrap: wrap; gap: 10px; }
.stat {
  flex: 1 1 92px; min-width: 92px;
  padding: 14px 16px; border-radius: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,0)), var(--bg-2);
  border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 4px;
}
.stat-num { font-size: 24px; font-weight: 700; line-height: 1.05; letter-spacing: -0.02em; color: var(--text); }
.stat-lbl { font-size: 12px; color: var(--muted); }
.steps { margin: 0; padding-left: 18px; line-height: 1.9; color: var(--muted); }
.steps strong { color: var(--text); }

/* ---------- Stat bars (dashboard / verify) ---------- */
.statbars { display: flex; flex-direction: column; gap: 10px; }
.statbar { display: grid; grid-template-columns: 130px 1fr 56px; align-items: center; gap: 12px; }
.statbar .sb-label { font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.statbar .sb-label a { color: var(--text); }
.statbar .sb-label a:hover { color: var(--accent); }
.statbar .sb-track { height: 8px; border-radius: 999px; background: var(--bg-2); overflow: hidden; }
.statbar .sb-fill { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.statbar .sb-count { font-size: 13px; font-weight: 600; text-align: right; color: var(--text); }
.statbar.sb-status .sb-fill,
.statbar.sb-email .sb-fill { background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
@media (max-width: 560px) { .statbar { grid-template-columns: 100px 1fr 44px; } }

/* ---------- Connect wizard ---------- */
.panel.narrow.wizard { max-width: 760px; }
.conn-status {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: 10px; margin-bottom: 18px;
  font-size: 14px; border: 1px solid var(--line); background: var(--bg-2);
}
.conn-status.waiting .conn-text { color: var(--muted); }
.conn-status.waiting .dot { animation: pulse 1.2s ease-in-out infinite; }
.conn-status.live { border-color: rgba(70,211,154,.4); background: rgba(70,211,154,.08); }
@keyframes pulse { 0%,100% { opacity: .35; } 50% { opacity: 1; } }

.keybox.warn { border-color: rgba(255,107,125,.4); }

.wsteps { list-style: none; counter-reset: step; margin: 6px 0 0; padding: 0; }
.wsteps > li { position: relative; padding: 0 0 22px 44px; }
.wsteps > li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; font-size: 14px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.wsteps > li:not(:last-child)::after {
  content: ''; position: absolute; left: 13px; top: 30px; bottom: 6px; width: 2px; background: var(--line);
}
.wsteps h3 { margin: 4px 0 6px; font-size: 15px; }
.wsteps p { margin: 0 0 10px; }

.cmd { position: relative; }
.cmd pre {
  margin: 0; padding: 14px 70px 14px 14px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px;
  color: var(--text); white-space: pre; overflow-x: auto; line-height: 1.6;
}
.cmd .copy {
  position: absolute; top: 10px; right: 10px; margin: 0; width: auto;
  padding: 5px 12px; font-size: 12px; background: var(--panel-2);
  border: 1px solid var(--line); color: var(--text); border-radius: 8px; cursor: pointer;
}
.cmd .copy:hover { border-color: var(--accent); filter: none; }
.cmd .copy.done { color: var(--ok); border-color: rgba(70,211,154,.4); }

/* ---------- Nav sections ---------- */
.nav-section {
  margin: 16px 0 4px; padding: 0 12px;
  font-size: 11px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase;
  color: var(--muted); opacity: .65;
}
.nav-section:first-child { margin-top: 0; }
/* Sales-agent nav: few items, so give them room and presence (premium feel,
   and headroom to add "more" later). */
.nav-agent { gap: 2px; }
.nav-agent .nav-section { margin: 24px 0 6px; opacity: .8; }
.nav-agent .nav-section:first-child { margin-top: 4px; }
.nav-agent > a { font-size: 15px; padding: 12px 14px; }
.nav-agent-find { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); }
.nav-agent-find .nav-section { margin-top: 0; }
.nav-badge {
  display: inline-block; min-width: 18px; padding: 1px 6px; margin-left: 4px;
  border-radius: 9px; background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 700; text-align: center;
}
/* Live/active count (e.g. online workers) - green, with a soft pulse glow. */
.nav-badge-live {
  background: var(--ok); color: #04140d;
  box-shadow: 0 0 0 0 rgba(70, 211, 154, 0.5);
  animation: nav-badge-pulse 2.4s ease-out infinite;
}
@keyframes nav-badge-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(70, 211, 154, 0.5); }
  70%  { box-shadow: 0 0 0 5px rgba(70, 211, 154, 0); }
  100% { box-shadow: 0 0 0 0 rgba(70, 211, 154, 0); }
}

/* ---------- Forms: rows / advanced ---------- */
.field-row { display: flex; gap: 12px; align-items: flex-end; }
.field-row > label { flex: 1; margin-top: 14px; }
.field-row .narrow-field { flex: 0 0 92px; }
.advanced { margin-top: 14px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--bg-2); }
.advanced summary { cursor: pointer; color: var(--muted); font-size: 13px; user-select: none; }
.advanced[open] summary { margin-bottom: 6px; color: var(--text); }

/* ---------- Mailboxes: domain groups + DNS auth ---------- */
.list-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.list-meta .inline-form { margin: 0; }
.domain-group { border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); margin-bottom: 10px; overflow: hidden; }
.domain-group[open] { background: var(--panel); }
.domain-summary { display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; user-select: none; list-style: none; }
.domain-summary::-webkit-details-marker { display: none; }
.domain-summary::before { content: "▸"; color: var(--muted); font-size: 11px; transition: transform .15s ease; }
.domain-group[open] .domain-summary::before { transform: rotate(90deg); }
.domain-name { font-size: 14.5px; font-weight: 600; color: var(--text); }
.domain-meta { flex: 1; }
.auth-badges { display: inline-flex; gap: 5px; flex-shrink: 0; }
.auth-badge { font-size: 10.5px; font-weight: 700; letter-spacing: .4px; padding: 2px 7px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); }
.auth-pass { background: rgba(70,211,154,.16);  color: #7fe3bd; border-color: rgba(70,211,154,.4); }
.auth-warn { background: rgba(255,180,84,.16);  color: #ffce8a; border-color: rgba(255,180,84,.4); }
.auth-fail { background: rgba(255,107,107,.16); color: #ff9b9b; border-color: rgba(255,107,107,.42); }
.auth-none { background: var(--panel-2); color: var(--muted); border-color: var(--line); }
.domain-body { padding: 4px 14px 14px; border-top: 1px solid var(--line); }
.auth-detail { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin: 12px 0 14px; }
.auth-detail-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.auth-detail-head h3 { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.auth-detail-head .inline-form { margin: 0; }
.auth-list { list-style: none; margin: 12px 0 4px; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.auth-list li { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.auth-rec { font-family: var(--mono, ui-monospace, monospace); font-size: 11.5px; color: var(--text); background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 2px 7px; word-break: break-all; max-width: 100%; }
.mb-bulkbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 9px 12px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-2); }
.mb-bulkbar .bulk-all { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); cursor: pointer; }
.mb-bulk-actions { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mb-bulk-actions .btn-sm:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.domain-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0 12px; }
.domain-actions .inline-form { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
.col-check { width: 28px; text-align: center; }
.col-check input { accent-color: var(--accent); cursor: pointer; }

/* quiet, collapsible "Add mailbox" form */
.panel-quiet { padding: 0; background: transparent; border: none; box-shadow: none; }
.add-mailbox { border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); overflow: hidden; }
.add-mailbox[open] { background: var(--panel); }
.add-mailbox-summary { display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; user-select: none; list-style: none; color: var(--muted); }
.add-mailbox-summary::-webkit-details-marker { display: none; }
.add-mailbox-icon { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 6px; background: var(--panel-2); border: 1px solid var(--line); font-size: 15px; line-height: 1; color: var(--accent); transition: transform .15s ease; }
.add-mailbox[open] .add-mailbox-icon { transform: rotate(45deg); }
.add-mailbox-label { font-size: 14px; font-weight: 600; color: var(--text); }
.add-mailbox[open] .add-mailbox-summary { border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.add-mailbox .stack { padding: 6px 14px 4px; }
.add-mailbox > p.muted { padding: 0 14px 14px; margin: 0; }

/* sequence pill states (extend lead st-* set) */
.st-active { background: rgba(70,211,154,.16); color: #7fe3bd; border-color: rgba(70,211,154,.4); }
.st-paused { background: rgba(255,180,84,.16); color: #ffce8a; border-color: rgba(255,180,84,.4); }
.st-draft  { background: rgba(138,147,184,.14); color: var(--muted); border-color: var(--line); }

/* ---------- Fancy dark scrollbar (reusable) ---------- */
.fancy-scroll { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.fancy-scroll::-webkit-scrollbar { width: 10px; height: 10px; }
.fancy-scroll::-webkit-scrollbar-track { background: transparent; border-radius: 999px; }
.fancy-scroll::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--line-2), var(--line));
  border: 2px solid transparent; background-clip: padding-box;
  border-radius: 999px;
}
.fancy-scroll::-webkit-scrollbar-thumb:hover { background: var(--accent); background-clip: padding-box; }
.fancy-scroll::-webkit-scrollbar-corner { background: transparent; }

/* ---------- Unified inbox ---------- */
/* Both panes share one bounded height and scroll independently; the grid
   itself never grows the page, so the list and reader scroll on their own. */
.inbox-grid {
  display: grid; grid-template-columns: minmax(280px, 380px) 1fr; gap: 16px;
  align-items: start;
  height: calc(100vh - 230px); min-height: 420px;
}
@media (max-width: 860px) { .inbox-grid { grid-template-columns: 1fr; height: auto; } }
.inbox-grid .msg-list,
.inbox-grid .msg-detail { height: 100%; max-height: 100%; overflow-y: auto; }
@media (max-width: 860px) {
  .inbox-grid .msg-list { max-height: 60vh; height: auto; }
  .inbox-grid .msg-detail { max-height: none; height: auto; overflow: visible; }
}
.msg-list { padding: 8px; }
/* Sticky toolbar pins to the top of the scroll container without overlapping
   rows: it has a solid panel background and a top inset so it covers the
   panel's own padding gap as the list scrolls under it. */
.bulk-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 6px; position: sticky; top: -8px; background: var(--panel); z-index: 2; border-bottom: 1px solid var(--line); margin: -8px -8px 6px; padding-left: 14px; padding-right: 14px; }
.bulk-toolbar .bulk-all { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); cursor: pointer; }
.bulk-toolbar .btn-sm { margin: 0; }
.bulk-toolbar .btn-sm:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.bulk-actions { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.bulk-actions .bulk-status { font-size: 12px; padding: 5px 8px; border-radius: 7px; border: 1px solid var(--line); background: var(--bg-2); color: var(--text); }
.bulk-actions .bulk-status:disabled { opacity: .45; cursor: not-allowed; }
.msg-item-wrap { display: flex; align-items: flex-start; gap: 8px; }
.msg-item-wrap + .msg-item-wrap { margin-top: 2px; }
.msg-check { margin-top: 14px; flex-shrink: 0; accent-color: var(--accent); cursor: pointer; }
.msg-item-wrap .msg-item { flex: 1; min-width: 0; }
.msg-item-wrap .msg-item + .msg-item { margin-top: 0; }
.msg-item { display: block; padding: 11px 12px; border-radius: 10px; color: var(--text); border: 1px solid transparent; }
.msg-item + .msg-item { margin-top: 2px; }
.msg-item:hover { background: var(--panel-2); }
.msg-item.selected { background: var(--panel-2); border-color: var(--line); }
.msg-item.unread .msg-subj { font-weight: 700; }
.msg-item.unread { border-left: 3px solid var(--accent); }
.msg-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.msg-who { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-subj { font-size: 14px; margin: 3px 0 1px; }
.msg-snip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-time { flex-shrink: 0; display: inline-flex; align-items: center; gap: 5px; }
.flag-dot { color: #f0b34a; }
.status-tag { font-size: 10.5px; font-weight: 600; padding: 1px 6px; border-radius: 999px; line-height: 1.5; text-transform: uppercase; letter-spacing: .3px; background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); }
.status-tag.status-todo      { background: rgba(91,140,255,.16);  color: #9bb6ff; border-color: rgba(91,140,255,.4); }
.status-tag.status-waiting   { background: rgba(240,179,74,.16);  color: #f0c277; border-color: rgba(240,179,74,.4); }
.status-tag.status-done      { background: rgba(70,211,154,.16);  color: #7fe3bd; border-color: rgba(70,211,154,.4); }
.status-tag.status-important { background: rgba(255,107,107,.16); color: #ff9b9b; border-color: rgba(255,107,107,.4); }
.status-tag.status-sending   { background: rgba(240,179,74,.16);  color: #f0c277; border-color: rgba(240,179,74,.4); }
.status-tag.status-failed    { background: rgba(255,107,107,.18); color: #ff9b9b; border-color: rgba(255,107,107,.45); }
/* ----- Opened message header ----- */
.mail-head { border-bottom: 1px solid var(--line); padding-bottom: 14px; margin-bottom: 4px; }
.mail-head-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.mail-subj { margin: 0; font-size: 18px; line-height: 1.3; }
.mail-head-top .pill { flex-shrink: 0; margin-top: 3px; }
.mail-from { display: flex; align-items: center; gap: 11px; margin-top: 13px; }
.mail-avatar { width: 38px; height: 38px; font-size: 15px; flex-shrink: 0; }
.mail-from-meta { min-width: 0; flex: 1; }
.mail-addr { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-when { flex-shrink: 0; white-space: nowrap; }
.mail-lead { margin-top: 11px; }
.msg-body {
  margin-top: 16px; font-size: 14.5px; line-height: 1.6;
  white-space: normal; word-break: break-word; overflow-wrap: anywhere;
  color: var(--text); max-width: 68ch;
}
/* Collapse runs of blank lines (stacked <br>) so quoted/forwarded mail that
   ships lots of empty lines doesn't render as a wall of whitespace. */
.msg-body br + br { display: none; }
.msg-body br + br + br { display: none; }
.msg-body p { margin: 0 0 10px; }
.msg-body > :first-child { margin-top: 0; }
.msg-body > :last-child { margin-bottom: 0; }
.pill.dir-in  { background: rgba(70,211,154,.16); color: #7fe3bd; border-color: rgba(70,211,154,.4); }
.pill.dir-out { background: rgba(91,140,255,.16); color: #9bb6ff; border-color: rgba(91,140,255,.4); }

/* ----- Opened message action bar + reply ----- */
.mail-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.mail-actions form { margin: 0; }
.mail-actions .inline-form select { font-size: 12px; padding: 6px 9px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-2); color: var(--text); cursor: pointer; }
.mail-actions .btn-sm.is-flagged { background: rgba(240,179,74,.16); color: #f0c277; border-color: rgba(240,179,74,.45); }
.reply-box { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); display: block; }
.reply-label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.reply-box textarea { width: 100%; resize: vertical; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-2); color: var(--text); font: inherit; font-size: 14px; line-height: 1.6; }
.reply-box textarea:disabled { opacity: .5; cursor: not-allowed; }
.reply-actions { display: flex; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }

/* ---------- Import wizard ---------- */
input[type=file] {
  width: 100%; margin-top: 6px; padding: 10px 12px;
  border: 1px dashed var(--line); border-radius: 10px;
  background: var(--bg-2); color: var(--text); font-size: 14px; cursor: pointer;
}
input[type=file]::file-selector-button {
  margin-right: 12px; padding: 7px 12px; border: 0; border-radius: 8px;
  background: var(--panel-2); color: var(--text); cursor: pointer; font-size: 13px;
}
.import-steps {
  list-style: none; display: flex; gap: 10px; flex-wrap: wrap;
  margin: 0 0 20px; padding: 0;
}
.import-steps li {
  display: flex; align-items: center; gap: 8px;
  color: var(--muted); font-size: 14px;
}
.import-steps li + li::before { content: ''; }
.import-steps li span {
  display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--panel-2); color: var(--muted); font-size: 12px; font-weight: 700;
  border: 1px solid var(--line);
}
.import-steps li.active { color: var(--text); }
.import-steps li.active span { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; border-color: transparent; }
.import-steps li.done span { background: rgba(70,211,154,.18); color: var(--ok); border-color: rgba(70,211,154,.4); }
.map-table td { vertical-align: middle; }
.map-table select { margin: 0; max-width: 280px; }
.map-table td:nth-child(2) { max-width: 320px; }

/* ---------- Sequence builder ---------- */
.seq-steps { list-style: none; counter-reset: step; margin: 0; padding: 0; }
.seq-step { position: relative; padding: 12px 12px 12px 44px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-2); }
.seq-step + .seq-step { margin-top: 12px; }
.seq-step::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 12px; top: 12px;
  width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.seq-step-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.seq-subj { margin: 4px 0; font-size: 14px; }
.seq-body { line-height: 1.55; }
