/* ─── Liquid Glass · Monochrome · Telegram MiniApp theme ──────────────────── */

:root,
html[data-theme="monochrome"] {
  color-scheme: dark;
  --theme-color: #000000;
  --bg0: #000000;
  --bg1: #0a0a0c;
  --bg2: #141416;
  --bg-radial-top: #1a1a1d;
  --txt: #f4f4f5;
  --muted: #b4b4bd;
  --muted2: #888891;
  --line: rgba(255, 255, 255, 0.14);
  --accent: #f4f4f5;
  --accent-rgb: 244, 244, 245;
  --on-accent: #09090b;
  --accent-soft: rgba(244, 244, 245, 0.12);
  --focus-ring: rgba(244, 244, 245, 0.78);
  --glass-bg: rgba(255, 255, 255, 0.055);
  --glass-brd: rgba(255, 255, 255, 0.12);
  --glass-hi: rgba(255, 255, 255, 0.22);
  --inset-bg: rgba(255, 255, 255, 0.045);
  --inset-brd: rgba(255, 255, 255, 0.08);
  --inset-hi: rgba(255, 255, 255, 0.12);
  --scroll-rgb: 255, 255, 255;
  --fx-dot-rgb: 255, 255, 255;
  --blob-1: #ffffff;
  --blob-2: #cfcfcf;
  --blob-3: #9a9a9a;
  --shadow-rgb: 0, 0, 0;
  --radius: 22px;
  --radius-sm: 14px;
  --blur: 22px;
  --sidebar-w: 266px;
  --content-max: 1180px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bot: env(safe-area-inset-bottom, 0px);
  --font-xs: 0.6875rem;
  --font-sm: 0.75rem;
  --font-md: 0.875rem;
  --font-lg: 1.125rem;
  --font-xl: clamp(1.35rem, 2vw, 1.75rem);
  --ok: #4ade80;
  --ok-rgb: 74, 222, 128;
  --ok-glow: rgba(74, 222, 128, 0.45);
  --warn: #fbbf24;
  --warn-rgb: 251, 191, 36;
  --err: #f87171;
  --err-rgb: 248, 113, 113;
  --err-glow: rgba(248, 113, 113, 0.45);
}

html[data-theme="slate"] {
  --theme-color: #080b10;
  --bg0: #080b10;
  --bg1: #101722;
  --bg2: #182334;
  --bg-radial-top: #27364c;
  --accent: #a8b6c9;
  --accent-rgb: 168, 182, 201;
  --on-accent: #080b10;
  --accent-soft: rgba(168, 182, 201, 0.14);
  --focus-ring: rgba(168, 182, 201, 0.82);
  --blob-1: #91a4bd;
  --blob-2: #526a86;
  --blob-3: #334962;
  --fx-dot-rgb: 168, 182, 201;
  --scroll-rgb: 168, 182, 201;
}

html[data-theme="graphite"] {
  --theme-color: #080808;
  --bg0: #080808;
  --bg1: #141414;
  --bg2: #202022;
  --bg-radial-top: #303034;
  --accent: #d4d4d8;
  --accent-rgb: 212, 212, 216;
  --on-accent: #09090b;
  --accent-soft: rgba(212, 212, 216, 0.12);
  --focus-ring: rgba(212, 212, 216, 0.8);
  --blob-1: #d4d4d8;
  --blob-2: #8a8a91;
  --blob-3: #5c5c63;
  --fx-dot-rgb: 212, 212, 216;
  --scroll-rgb: 212, 212, 216;
}

html[data-theme="midnight"] {
  --theme-color: #030712;
  --bg0: #030712;
  --bg1: #071326;
  --bg2: #0d2140;
  --bg-radial-top: #173968;
  --accent: #60a5fa;
  --accent-rgb: 96, 165, 250;
  --on-accent: #06101e;
  --accent-soft: rgba(96, 165, 250, 0.15);
  --focus-ring: rgba(96, 165, 250, 0.86);
  --blob-1: #60a5fa;
  --blob-2: #2563eb;
  --blob-3: #1e3a8a;
  --fx-dot-rgb: 125, 184, 255;
  --scroll-rgb: 96, 165, 250;
}

html[data-theme="steel"] {
  --theme-color: #070b0f;
  --bg0: #070b0f;
  --bg1: #101820;
  --bg2: #192631;
  --bg-radial-top: #294254;
  --accent: #7dd3fc;
  --accent-rgb: 125, 211, 252;
  --on-accent: #061017;
  --accent-soft: rgba(125, 211, 252, 0.14);
  --focus-ring: rgba(125, 211, 252, 0.84);
  --blob-1: #7dd3fc;
  --blob-2: #3b82a0;
  --blob-3: #365365;
  --fx-dot-rgb: 125, 211, 252;
  --scroll-rgb: 125, 211, 252;
}

html[data-theme="cyan"] {
  --theme-color: #020b0d;
  --bg0: #020b0d;
  --bg1: #06191d;
  --bg2: #0c2930;
  --bg-radial-top: #124854;
  --accent: #22d3ee;
  --accent-rgb: 34, 211, 238;
  --on-accent: #031012;
  --accent-soft: rgba(34, 211, 238, 0.14);
  --focus-ring: rgba(34, 211, 238, 0.84);
  --blob-1: #22d3ee;
  --blob-2: #0891b2;
  --blob-3: #155e75;
  --fx-dot-rgb: 34, 211, 238;
  --scroll-rgb: 34, 211, 238;
}

html[data-theme="emerald"] {
  --theme-color: #030b08;
  --bg0: #030b08;
  --bg1: #071912;
  --bg2: #0d2b1f;
  --bg-radial-top: #124a34;
  --accent: #34d399;
  --accent-rgb: 52, 211, 153;
  --on-accent: #03120c;
  --accent-soft: rgba(52, 211, 153, 0.14);
  --focus-ring: rgba(52, 211, 153, 0.84);
  --blob-1: #34d399;
  --blob-2: #059669;
  --blob-3: #065f46;
  --fx-dot-rgb: 52, 211, 153;
  --scroll-rgb: 52, 211, 153;
}

html[data-theme="violet"] {
  --theme-color: #080512;
  --bg0: #080512;
  --bg1: #130b24;
  --bg2: #21133b;
  --bg-radial-top: #382168;
  --accent: #a78bfa;
  --accent-rgb: 167, 139, 250;
  --on-accent: #10091d;
  --accent-soft: rgba(167, 139, 250, 0.15);
  --focus-ring: rgba(167, 139, 250, 0.86);
  --blob-1: #a78bfa;
  --blob-2: #7c3aed;
  --blob-3: #4c1d95;
  --fx-dot-rgb: 183, 160, 255;
  --scroll-rgb: 167, 139, 250;
}

html[data-theme="amber"] {
  --theme-color: #0d0902;
  --bg0: #0d0902;
  --bg1: #1d1205;
  --bg2: #332008;
  --bg-radial-top: #5a390d;
  --accent: #fbbf24;
  --accent-rgb: 251, 191, 36;
  --on-accent: #171004;
  --accent-soft: rgba(251, 191, 36, 0.14);
  --focus-ring: rgba(251, 191, 36, 0.86);
  --blob-1: #fbbf24;
  --blob-2: #d97706;
  --blob-3: #92400e;
  --fx-dot-rgb: 251, 191, 36;
  --scroll-rgb: 251, 191, 36;
}

html[data-theme="crimson"] {
  --theme-color: #0f0406;
  --bg0: #0f0406;
  --bg1: #22080e;
  --bg2: #3a0d18;
  --bg-radial-top: #66172a;
  --accent: #fb7185;
  --accent-rgb: 251, 113, 133;
  --on-accent: #21080d;
  --accent-soft: rgba(251, 113, 133, 0.15);
  --focus-ring: rgba(251, 113, 133, 0.86);
  --blob-1: #fb7185;
  --blob-2: #e11d48;
  --blob-3: #881337;
  --fx-dot-rgb: 251, 137, 153;
  --scroll-rgb: 251, 113, 133;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

/* ── themed scrollbars (site-wide, liquid glass) ── */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--scroll-rgb), 0.34) transparent;
}
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(var(--scroll-rgb), 0.04);
  border-radius: 999px;
  margin: 4px 0;
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(var(--scroll-rgb), 0.42), rgba(var(--scroll-rgb), 0.2));
  border: 2px solid transparent;
  background-clip: padding-box;
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(var(--scroll-rgb), 0.28);
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(var(--scroll-rgb), 0.58), rgba(var(--scroll-rgb), 0.32));
  background-clip: padding-box;
}
::-webkit-scrollbar-corner {
  background: transparent;
}

html,
body {
  margin: 0;
  height: 100%;
  background: radial-gradient(
    140% 120% at 50% -10%,
    var(--bg-radial-top) 0%,
    var(--bg1) 45%,
    var(--bg0) 100%
  );
  color: var(--txt);
  font-family:
    "Inter",
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    sans-serif;
  overscroll-behavior: none;
}

body {
  overflow: hidden;
}
h1,
h2,
h3,
h4,
h5,
h6,
p {
  margin: 0;
  color: inherit;
  font: inherit;
}
button,
input,
textarea,
select {
  font-family: inherit;
}
:where(button, a, input, textarea, select, [tabindex]):focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

svg {
  display: block;
}
.ic {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ic.fill {
  fill: currentColor;
  stroke: none;
}

/* ── ambient background (grayscale, slow float) ── */
.bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  filter: blur(8px);
}
.blob {
  position: absolute;
  border-radius: 50%;
  opacity: 0.16;
  mix-blend-mode: screen;
  animation: float 20s ease-in-out infinite;
}
.b1 {
  width: 46vh;
  height: 46vh;
  left: -12vh;
  top: -8vh;
  background: radial-gradient(circle, var(--blob-1), transparent 62%);
}
.b2 {
  width: 40vh;
  height: 40vh;
  right: -10vh;
  top: 18vh;
  background: radial-gradient(circle, var(--blob-2), transparent 62%);
  animation-delay: -7s;
}
.b3 {
  width: 52vh;
  height: 52vh;
  left: 10vh;
  bottom: -18vh;
  background: radial-gradient(circle, var(--blob-3), transparent 62%);
  animation-delay: -13s;
}
@keyframes float {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(6vw, 4vh) scale(1.08);
  }
  66% {
    transform: translate(-4vw, -3vh) scale(0.95);
  }
}
/* cursor-reactive dot field — above the blurred blobs, below the app.
   <canvas> is a replaced element, so it needs an explicit size (inset
   alone won't stretch it). */
.fx {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  display: block;
}

/* ── glass primitives ── */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--blur)) saturate(120%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(120%);
  border: 1px solid var(--glass-brd);
  box-shadow:
    inset 0 1px 0 var(--glass-hi),
    0 12px 40px rgba(0, 0, 0, 0.5);
}
.glass-inset {
  background: var(--inset-bg);
  border: 1px solid var(--inset-brd);
  box-shadow: inset 0 1px 0 var(--inset-hi);
}

/* ── layout (full-screen: sidebar + main) ── */
.app {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: row;
  height: 100dvh;
  width: 100%;
  gap: 0;
}

/* ── sidebar ── */
.sidebar {
  flex: 0 0 var(--sidebar-w);
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: calc(var(--safe-top) + 16px) 14px calc(var(--safe-bot) + 16px);
  border-radius: 0;
  border: 0;
  border-right: 1px solid var(--glass-brd);
  overflow: hidden;
}
.sidebar-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px 14px;
}
.logo {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: #000;
  background: linear-gradient(135deg, #ffffff, #b8b8bd);
  box-shadow:
    0 6px 18px rgba(255, 255, 255, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
.logo .ic {
  width: 24px;
  height: 24px;
}
.brand-txt h1 {
  margin: 0;
  font-size: 16px;
  letter-spacing: 0.2px;
}
.brand-txt p {
  margin: 3px 0 0;
  font-size: 11.5px;
  color: var(--muted);
}
.header-user {
  color: var(--muted2);
  font-weight: 500;
}

.sidebar-foot {
  flex: 0 0 auto;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.side-user {
  width: 100%;
  border: 0;
  cursor: pointer;
  text-align: left;
  font: inherit;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.045);
  color: inherit;
  transition:
    background 0.18s,
    box-shadow 0.18s,
    transform 0.12s;
}
.side-user:hover {
  background: rgba(255, 255, 255, 0.09);
}
.side-user:active {
  transform: scale(0.98);
}
.side-user.active {
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}
.side-av {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  flex: 0 0 auto;
  overflow: hidden;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 16px;
  color: #000;
  background: linear-gradient(135deg, #ffffff, #b8b8bd);
}
.side-av img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.side-user-id {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.side-name {
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.side-plan {
  font-size: 11px;
  color: var(--muted2);
  margin-top: 1px;
}

/* ── main column ── */
.main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: calc(var(--safe-top) + 16px) 20px calc(var(--safe-bot) + 16px);
}
.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  background: var(--muted2);
  box-sizing: border-box;
}
.dot.idle {
  background: var(--muted2);
}
.dot.running,
.dot.initializing {
  background: var(--ok);
  box-shadow: 0 0 10px var(--ok-glow);
  animation: pulse-ok 1.2s ease-in-out infinite;
}
.dot.done {
  background: var(--ok);
  box-shadow: 0 0 8px var(--ok-glow);
}
.dot.error,
.dot.stopped {
  background: var(--err);
  border: none;
  box-shadow: 0 0 10px var(--err-glow);
  animation: pulse-err 0.85s ease-in-out infinite;
}
@keyframes pulse {
  50% {
    opacity: 0.3;
  }
}
@keyframes pulse-ok {
  50% {
    opacity: 0.45;
    box-shadow: 0 0 4px var(--ok-glow);
  }
}
@keyframes pulse-err {
  50% {
    opacity: 0.4;
    transform: scale(1.2);
  }
}

.run-spinner {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  width: 1ch;
  text-align: center;
  line-height: 1;
  flex: 0 0 auto;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.45);
}
.run-spinner[hidden] {
  display: none;
}

.counter {
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  text-align: center;
  min-width: 64px;
}
.counter span {
  font-size: 20px;
  font-weight: 700;
  display: block;
  line-height: 1;
}
.counter small {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── scroll view ── */
.view {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 2px 4px 6px;
  scrollbar-gutter: stable;
}
.view > * {
  width: 100%;
  max-width: var(--content-max);
}
.view > *,
.subview > * {
  flex-shrink: 0;
}

/* ── cards ── */
.card {
  border-radius: var(--radius);
  padding: 16px;
}
.card h2 {
  margin: 0 0 4px;
  font-size: 15px;
}
.card .sub {
  margin: 0 0 14px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
}
.card h2 b,
.card .sub b {
  color: var(--txt);
  font-weight: 600;
}

/* Shared icon-led hierarchy for every module card. */
.page-card {
  position: relative;
  overflow: hidden;
}
.page-card::before {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.32), transparent);
  opacity: 0.7;
  pointer-events: none;
}
.page-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  margin-bottom: 16px;
}
.page-head.compact {
  align-items: center;
  margin-bottom: 12px;
}
.page-head-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.055));
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 8px 20px rgba(0, 0, 0, 0.22);
}
.page-head-icon .ic {
  width: 21px;
  height: 21px;
}
.page-head-copy {
  flex: 1 1 auto;
  min-width: 0;
}
.page-head-copy h2 {
  margin: 1px 0 0;
  color: #fff;
  font-size: 16px;
  font-weight: 750;
  letter-spacing: 0.01em;
  text-shadow: 0 0 16px rgba(255, 255, 255, 0.16);
}
.page-head-copy .sub {
  margin: 4px 0 0;
  max-width: 78ch;
}
.page-head > .btn {
  flex: 0 0 auto;
  margin-left: auto;
}
.page-head-eyebrow {
  margin-bottom: 3px;
  color: var(--muted2);
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}
.resource-hub {
  padding-bottom: 13px;
}

.overview-stats {
  align-items: center;
  gap: 7px;
  margin: -1px 0 14px;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.07);
}
.overview-stats .chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  line-height: 1.25;
}
.empty-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}
.empty-panel b {
  color: var(--txt);
  font-size: 14px;
}
.empty-panel > span:last-child {
  max-width: 42ch;
  line-height: 1.5;
}

.field {
  margin-bottom: 12px;
}
.field:last-child {
  margin-bottom: 0;
}
.field label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 7px;
  letter-spacing: 0.3px;
}
.field .val {
  float: right;
  color: var(--txt);
  font-weight: 700;
}
/* sliders read as their own row — keep the gap to the next field even */
.range-field {
  margin-bottom: 12px;
}
.range-field label {
  margin-bottom: 0;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="search"],
textarea,
select {
  width: 100%;
  color: var(--txt);
  font: inherit;
  font-size: 14px;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  outline: none;
  min-height: 22px;
}
/* Standalone inputs (legacy / scraper sliders context) outside .input-wrap */
.field > input[type="text"],
.field > input[type="number"],
.field > input[type="search"],
.field > textarea,
.field > select,
.add-row > input {
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  padding: 12px 13px;
  transition:
    border-color 0.15s,
    box-shadow 0.15s,
    background 0.15s;
}
.field > input:focus,
.field > textarea:focus,
.field > select:focus,
.add-row > input:focus {
  border-color: rgba(255, 255, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.07);
}

/* glass input wrapper — used for profile, auth, admin search, passwords */
.input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: var(--radius-sm);
  padding: 0 12px;
  min-height: 46px;
  transition:
    border-color 0.15s,
    box-shadow 0.15s,
    background 0.15s;
}
.input-wrap:focus-within {
  border-color: rgba(255, 255, 255, 0.55) !important;
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.07) !important;
}
.input-wrap input,
.input-wrap textarea {
  flex: 1;
  min-width: 0;
  padding: 12px 0;
}
.input-wrap.textarea-wrap {
  align-items: stretch;
  padding: 10px 12px;
  min-height: 88px;
}
.input-wrap.textarea-wrap textarea {
  resize: vertical;
  min-height: 68px;
  line-height: 1.45;
  font-family: inherit;
  font-size: 13px;
  padding: 0;
}
.input-wrap.compact {
  min-height: 42px;
  padding: 0 12px;
}
.input-wrap.compact input {
  padding: 10px 0;
  font-size: 13px;
}
.input-wrap input,
.input-wrap textarea {
  font-size: 13px;
}
.input-prefix {
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  flex: 0 0 auto;
  user-select: none;
}
.input-toggle {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition:
    background 0.15s,
    color 0.15s;
}
.input-toggle:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}
.input-toggle .ic {
  width: 18px;
  height: 18px;
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.form-stack .field:last-child {
  margin-bottom: 0;
}
/* section headers pop: white + bold + soft glow, with a hairline fading right */
.form-section-title,
.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 22px 0 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--txt);
  text-shadow: 0 0 14px rgba(255, 255, 255, 0.22);
}
.form-section-title::after,
.section-title::after {
  content: "";
  flex: 1 1 24px;
  height: 1px;
  border-radius: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.02));
}
.form-section-title:first-child,
.section-title:first-child {
  margin-top: 4px;
}
.section-hint {
  margin: -4px 0 12px;
  font-size: 12px;
}

.pw-hints {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 12px;
}
.pw-hint {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  color: var(--muted2);
}
.pw-hint .ic {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  opacity: 0.5;
}
.pw-hint.ok {
  color: var(--muted);
}
.pw-hint.ok .ic {
  opacity: 1;
  color: #fff;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
textarea:focus,
select:focus {
  outline: none;
}
/* neutralize built-in reveal/clear controls so password fields match the theme */
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear {
  display: none;
}
input::-webkit-credentials-auto-fill-button {
  background-color: var(--muted);
}
input:-webkit-autofill,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--txt);
  -webkit-box-shadow: 0 0 0 1000px rgba(30, 30, 33, 0.9) inset;
  caret-color: var(--txt);
  transition: background-color 9999s ease-in-out 0s;
}
textarea {
  resize: vertical;
  min-height: 96px;
  line-height: 1.5;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 12.5px;
}
select {
  appearance: none;
}

/* range slider (monochrome, with filled track) */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  outline: none;
  margin: 9px 0 3px;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0.88) 0%,
    rgba(255, 255, 255, 0.88) var(--fill, 0%),
    rgba(255, 255, 255, 0.12) var(--fill, 0%),
    rgba(255, 255, 255, 0.12) 100%
  );
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffffff, #cfcfcf);
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  cursor: pointer;
  border: none;
  transition: transform 0.12s;
}
input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffffff, #cfcfcf);
  cursor: pointer;
}
input[type="range"]:active::-webkit-slider-thumb {
  transform: scale(1.14);
}
input[type="range"]:focus-visible {
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.22);
}

/* segmented control */
.seg {
  display: flex;
  gap: 4px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 4px;
}
.seg button {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 10px;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s;
}
.seg button.on {
  color: #000;
  background: linear-gradient(135deg, #ffffff, #d4d4d8);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}
/* wrapping variant: labels never get squeezed — a button that doesn't fit
   moves to the next row at full width instead of cramping its text */
.seg-wrap {
  flex-wrap: wrap;
}
.seg-wrap button {
  flex: 1 0 auto;
  min-width: 64px;
  font-size: 12px;
  padding: 9px 12px;
}
.objective-seg {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.objective-seg button {
  min-width: 0;
}
/* hint that sits right under a segmented control (inside the same field) */
.section-hint.seg-hint {
  margin: 8px 2px 0;
}

/* ── buttons ── */
.btn {
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  border-radius: var(--radius-sm);
  padding: 13px 18px;
  color: var(--txt);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition:
    transform 0.12s,
    box-shadow 0.2s,
    opacity 0.2s;
}
.btn:active {
  transform: scale(0.97);
}
.btn .ic {
  width: 18px;
  height: 18px;
}
.btn.primary {
  flex: 0 0 auto;
  color: var(--on-accent);
  background: linear-gradient(135deg, var(--accent), rgba(var(--accent-rgb), 0.78));
  box-shadow:
    0 8px 20px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
.btn.primary:disabled {
  opacity: 0.45;
}
.btn.ghost {
  background: rgba(var(--accent-rgb), 0.07);
  border: 1px solid rgba(var(--accent-rgb), 0.16);
}
.btn.ghost:disabled {
  opacity: 0.4;
}
.btn.off,
.btn[aria-disabled="true"] {
  opacity: 0.45;
  pointer-events: none;
  cursor: not-allowed;
}
.btn.small {
  padding: 9px 14px;
  font-size: 13px;
}

.runbar {
  flex: 0 0 auto;
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  border-radius: var(--radius);
  padding: 10px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  transition:
    border-color 0.25s,
    box-shadow 0.25s;
}
.runbar .run-meta {
  flex: 1 1 auto;
}
.runbar .run-actions {
  flex: 0 0 auto;
}
.runbar.is-running {
  border-color: rgba(34, 197, 94, 0.35);
  box-shadow:
    inset 0 1px 0 var(--glass-hi),
    0 12px 40px rgba(0, 0, 0, 0.5),
    0 0 20px rgba(34, 197, 94, 0.12);
}
.runbar.is-stopped {
  border-color: rgba(239, 68, 68, 0.45);
  box-shadow:
    inset 0 1px 0 var(--glass-hi),
    0 12px 40px rgba(0, 0, 0, 0.5),
    0 0 18px rgba(239, 68, 68, 0.18);
  animation: runbar-alert 1.1s ease-in-out infinite;
}
@keyframes runbar-alert {
  50% {
    border-color: rgba(239, 68, 68, 0.75);
    box-shadow:
      inset 0 1px 0 var(--glass-hi),
      0 0 24px rgba(239, 68, 68, 0.28);
  }
}
.run-meta.is-active #statusText {
  color: var(--ok);
}
.run-meta.is-alert #statusText {
  color: var(--err);
}
.run-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--muted);
}
.run-found {
  margin-left: auto;
  color: var(--muted2);
}
.run-found b {
  color: var(--txt);
  font-weight: 700;
}
.run-actions {
  display: flex;
  gap: 10px;
}

/* ── nav (vertical inside sidebar) ── */
.tabbar {
  flex: 0 0 auto;
  display: flex;
  gap: 2px;
}
.tab {
  border: 0;
  background: transparent;
  color: var(--muted2);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  border-radius: 12px;
  transition:
    background 0.18s,
    color 0.18s,
    box-shadow 0.18s;
}
.tab .tic {
  width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
}
.tab .tic .ic {
  width: 21px;
  height: 21px;
}
.tab.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.09);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.sidebar .tabbar {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  flex-direction: column;
  gap: 4px;
  padding: 6px 2px;
}
.sidebar .tab {
  flex: 0 0 auto;
  flex-direction: row;
  justify-content: flex-start;
  gap: 13px;
  padding: 11px 12px;
  font-size: 13.5px;
  letter-spacing: 0.2px;
  position: relative;
}
.sidebar .tab > span:last-child {
  flex: 1;
  text-align: left;
}
.sidebar .tab:hover:not(.active) {
  color: var(--txt);
  background: rgba(255, 255, 255, 0.055);
}
.sidebar .tab.active::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 18px;
  border-radius: 3px;
  background: #fff;
}

/* ── scraper sub-navigation ── */
.subnav {
  border-radius: var(--radius-sm);
  padding: 5px;
  display: flex;
  gap: 2px;
  margin-bottom: 2px;
  position: sticky;
  top: 0;
  z-index: 3;
}
.subtab {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--muted2);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 2px;
  border-radius: 11px;
  transition: all 0.18s;
}
.subtab .tic {
  width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
}
.subtab .tic .ic {
  width: 19px;
  height: 19px;
}
.subtab.active {
  color: #000;
  background: linear-gradient(135deg, #ffffff, #d4d4d8);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
.subview {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── result cards ── */
.result {
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideIn 0.3s ease both;
}
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}
.avatar {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 17px;
  color: #000;
  background: linear-gradient(135deg, #ffffff, #b8b8bd);
}
.r-main {
  flex: 1;
  min-width: 0;
}
.r-name {
  display: flex;
  align-items: center;
  gap: 6px;
}
.r-name a {
  color: var(--txt);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.r-name .ver {
  color: var(--txt);
  display: inline-flex;
}
.r-name .ver .ic {
  width: 15px;
  height: 15px;
}
.r-handle {
  color: var(--muted);
  font-size: 12px;
}
.r-stats {
  display: flex;
  gap: 12px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.chip {
  font-size: 11px;
  color: var(--muted);
}
.chip b {
  color: var(--txt);
  font-weight: 600;
}
.chip.er b {
  color: #fff;
}

/* ── console (monochrome, differentiated by weight/opacity/bar) ── */
.console {
  border-radius: var(--radius-sm);
  padding: 12px;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 11.5px;
  line-height: 1.55;
  color: #d4d4d8;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 300px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.4);
  scrollbar-gutter: stable;
}
.console div {
  padding-left: 8px;
  border-left: 2px solid transparent;
}
.console .console-line {
  display: grid;
  grid-template-columns: 5ch minmax(0, 1fr);
  gap: 10px;
}
.console-line-number {
  color: rgba(255, 255, 255, 0.34);
  font-variant-numeric: tabular-nums;
  text-align: right;
  user-select: none;
}
.console-line-text {
  min-width: 0;
}
.console .l-ok {
  color: #fff;
  border-left-color: rgba(255, 255, 255, 0.55);
}
.console .l-warn {
  color: #b4b4bb;
  border-left-color: rgba(255, 255, 255, 0.28);
}
.console .l-err {
  color: #fff;
  font-weight: 700;
  border-left-color: #fff;
}
.console .l-plus {
  color: #fff;
  border-left-color: rgba(255, 255, 255, 0.8);
}

/* ── list editor (queries / seeds / tokens) ── */
.list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.list-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition:
    border-color 0.16s,
    background 0.16s,
    transform 0.12s;
}
.list-item span {
  flex: 1;
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list-item span.mono {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 13px;
  letter-spacing: 0.3px;
}
.list-item button {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  display: grid;
  place-items: center;
  transition:
    background 0.15s,
    color 0.15s,
    border-color 0.15s,
    transform 0.12s;
}
.list-item button .ic {
  width: 15px;
  height: 15px;
}
.list-item button:active {
  transform: scale(0.9);
}
.list-editor {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}
.list-editor:last-child {
  margin-bottom: 0;
}
.list-editor .list:has(.empty) {
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.018);
}
.list-editor .empty {
  padding: 13px 12px;
}
.add-row {
  display: flex;
  gap: 10px;
  margin-top: 0;
  align-items: stretch;
}
.add-row input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 46px;
}
.add-row .btn {
  flex: 0 0 48px;
  width: 48px;
  min-height: 46px;
  padding: 0;
}

/* ── token / proxy manager ── */
.tm-head {
  display: flex;
  align-items: flex-start;
  gap: 11px;
}
.tm-head-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.tm-head-icon .ic {
  width: 20px;
  height: 20px;
}
.tm-head-copy {
  flex: 1 1 auto;
  min-width: 0;
}
.tm-stats {
  align-items: center;
  margin: 2px 0 14px;
  min-height: 30px;
}
.tm-stats .chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  font-size: 11.5px;
}
.tm-stats .chip b {
  font-weight: 700;
}
.tm-stats .chip.warm {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.16);
  color: var(--txt);
}
.tm-clear {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted2);
  padding: 6px 11px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition:
    color 0.15s,
    border-color 0.15s,
    background 0.15s;
}
.tm-clear .btn-ic .ic {
  width: 14px;
  height: 14px;
}
.tm-list {
  margin-bottom: 12px;
}
.tm-list .list-item {
  animation: viewIn 0.28s cubic-bezier(0.22, 0.61, 0.36, 1) both;
  animation-delay: calc(var(--i, 0) * 22ms);
}
.tm-add {
  margin: 0;
}
.tm-add textarea {
  min-height: 84px;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
}
.tm-add-btn {
  width: 100%;
}

.upload-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.upload-stack > .textarea-wrap {
  margin: 0;
}
.upload-stack > .btn {
  width: 100%;
  min-height: 42px;
  margin: 0;
}
.upload-stack .upload-help {
  margin: 0;
  padding: 10px 2px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.055);
}

.empty {
  text-align: center;
  color: var(--muted2);
  font-size: 13px;
  padding: 32px 12px;
}
.empty .big {
  display: grid;
  place-items: center;
  margin: 0 auto 10px;
  opacity: 0.6;
}
.empty .big .ic {
  width: 34px;
  height: 34px;
}

.hint {
  font-size: 11.5px;
  color: var(--muted2);
  margin-top: 8px;
  line-height: 1.5;
}
.hint b {
  color: var(--muted);
}

.divider {
  height: 1px;
  background: var(--line);
  margin: 16px 0;
  border: 0;
}

/* ── auth screen ── */
.auth-wrap {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 30px 26px;
  text-align: center;
  overflow: hidden;
  background:
    radial-gradient(90% 70% at 50% 0%, rgba(255, 255, 255, 0.09), transparent 70%), var(--glass-bg);
}
.auth-logo {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: #000;
  background: linear-gradient(135deg, #ffffff, #b8b8bd);
  box-shadow:
    0 6px 18px rgba(255, 255, 255, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
.auth-logo .ic {
  width: 28px;
  height: 28px;
}
.auth-kicker {
  margin-bottom: 5px;
  color: var(--muted2);
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.auth-title {
  margin: 0 0 6px;
  color: #fff;
  font-size: 22px;
  letter-spacing: -0.01em;
}
.auth-sub {
  margin: 0 auto 18px;
  max-width: 34ch;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}
.auth-steps {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 18px;
  text-align: left;
}
.auth-steps > div {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 12px;
  color: var(--muted);
  font-size: 11.5px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.auth-steps b {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #000;
  font-size: 10px;
  background: linear-gradient(135deg, #fff, #cfcfd3);
}
.auth-steps strong {
  color: var(--txt);
  font-weight: 700;
}
.auth-primary {
  width: 100%;
  text-align: center;
  text-decoration: none;
}
.auth-card .field {
  text-align: left;
}
.auth-card label {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.auth-card label .opt {
  color: var(--muted2);
  font-weight: 400;
  text-transform: none;
}
.auth-err {
  color: #fff;
  font-size: 12.5px;
  min-height: 0;
  max-height: 0;
  overflow: hidden;
  transition: all 0.2s;
  opacity: 0;
  text-align: left;
}
.auth-err.show {
  min-height: 18px;
  max-height: 40px;
  opacity: 1;
  margin-bottom: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.06);
}
.auth-card .btn.primary {
  margin-top: 4px;
}
.auth-switch {
  margin: 14px 0 0;
  font-size: 11.5px;
  color: var(--muted2);
  line-height: 1.5;
}
.auth-switch a {
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}
.auth-ok {
  color: #fff;
  font-size: 12.5px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: all 0.2s;
  text-align: left;
}
.auth-ok.show {
  max-height: 80px;
  opacity: 1;
  margin-bottom: 10px;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.07);
  line-height: 1.4;
}
body.auth-mode .bg {
  filter: blur(8px);
}

/* ── profile ── */
.profile-hero {
  position: relative;
  overflow: hidden;
  padding: 20px;
  background:
    radial-gradient(80% 160% at 100% 0%, rgba(255, 255, 255, 0.09), transparent 58%),
    var(--glass-bg);
}
.profile-head {
  display: flex;
  align-items: center;
  gap: 14px;
}
.p-avatar {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  flex: 0 0 auto;
  padding: 0;
  margin: 0;
  display: block;
  color: #000;
  background: linear-gradient(135deg, #ffffff, #b8b8bd);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  position: relative;
  overflow: hidden;
  border: 0;
  cursor: default;
  line-height: 0;
}
.p-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.p-initial {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 26px;
  line-height: 1;
}
.p-avatar.edit {
  cursor: pointer;
}
.avatar-ov {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(0, 0, 0, 0.42);
  opacity: 0;
  transition: opacity 0.18s;
}
.avatar-ov .ic {
  width: 22px;
  height: 22px;
}
.p-avatar.edit:hover .avatar-ov,
.p-avatar.edit:active .avatar-ov {
  opacity: 1;
}
.p-id {
  flex: 1;
  min-width: 0;
}
.p-name {
  font-size: 17px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.p-handle {
  font-size: 13px;
  color: var(--muted);
}
.plan-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
}
.plan-badge.pro {
  color: #000;
  background: linear-gradient(135deg, #ffffff, #cfcfd3);
  border-color: transparent;
}
.plan-badge .ic {
  width: 13px;
  height: 13px;
}
.profile-sync-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 15px;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.4;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.profile-sync-note > .ic {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  color: #fff;
}
.profile-sync-note b {
  color: var(--txt);
}

.plan-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}
.plan-col {
  border-radius: var(--radius-sm);
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
}
.plan-col.hi {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.06);
}
.plan-col.current {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}
.plan-title {
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 10px;
}
.plan-title .ic {
  width: 16px;
  height: 16px;
}
.plan-feats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.plan-feats li {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.4;
}
.plan-feats li .ic {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  margin-top: 1px;
  color: var(--txt);
}

.meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.meta-item {
  border-radius: var(--radius-sm);
  padding: 11px 12px;
}
.meta-item span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}
.meta-item b {
  font-size: 14px;
  font-weight: 700;
}

.full-btn {
  width: 100%;
  margin-top: 14px;
}
.full-btn.no-top-gap {
  margin-top: 0;
}

/* ── home module ── */
.home-hero {
  padding: 20px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(90% 150% at 100% 0%, rgba(255, 255, 255, 0.1), transparent 58%), var(--glass-bg);
}
.home-hero::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  right: -70px;
  top: -100px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  pointer-events: none;
}
.home-user {
  display: flex;
  align-items: center;
  gap: 14px;
}
.home-av {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  overflow: hidden;
  flex: 0 0 auto;
  background: linear-gradient(135deg, #ffffff, #b8b8bd);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 22px;
  color: #000;
}
.home-av img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.home-copy {
  min-width: 0;
  flex: 1 1 auto;
}
.home-greet {
  font-size: 12px;
  color: var(--muted);
}
.home-name {
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  margin-top: 2px;
  letter-spacing: -0.01em;
}
.home-plan {
  max-width: 58ch;
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
  line-height: 1.45;
}
.home-status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}
.home-status {
  min-width: 0;
  min-height: 44px;
  padding: 9px 11px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
}
.home-status > .ic {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  color: #fff;
}
.home-status > span:not(.dot) {
  white-space: nowrap;
}
.home-status b {
  margin-left: auto;
  min-width: 0;
  color: var(--txt);
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tool-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}
.tool-card {
  min-height: 132px;
  text-align: left;
  cursor: pointer;
  padding: 15px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  position: relative;
  color: inherit;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.025));
  border: 1px solid rgba(255, 255, 255, 0.09);
  transition:
    transform 0.12s,
    box-shadow 0.18s,
    border-color 0.18s,
    background 0.18s;
}
.tool-card:active {
  transform: scale(0.98);
}
.tool-card.soon {
  cursor: default;
  opacity: 0.72;
}
.tool-ic {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  margin-bottom: 2px;
  border-radius: 12px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.tool-ic .ic {
  width: 20px;
  height: 20px;
}
.tool-title {
  color: #fff;
  font-weight: 750;
  font-size: 14px;
}
.tool-desc {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.45;
}
.soon-tag {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px dashed rgba(255, 255, 255, 0.35);
  color: var(--muted);
}

/* ── sender ── */
.sender-choice-field {
  margin-top: 4px;
}
.sender-choice-label {
  margin-bottom: 7px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.3px;
}
.sender-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.sender-choice {
  min-width: 0;
  min-height: 72px;
  padding: 12px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 11px;
  text-align: left;
  cursor: pointer;
  color: var(--muted);
  font: inherit;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.09);
  transition:
    color 0.16s,
    border-color 0.16s,
    background 0.16s,
    transform 0.12s;
}
.sender-choice:active {
  transform: scale(0.985);
}
.sender-choice.on {
  color: var(--txt);
  border-color: rgba(255, 255, 255, 0.42);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.065));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 8px 22px rgba(0, 0, 0, 0.22);
}
.sender-choice-icon {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.07);
}
.sender-choice-icon .ic {
  width: 19px;
  height: 19px;
}
.sender-choice.on .sender-choice-icon {
  color: #fff;
  background: rgba(255, 255, 255, 0.13);
}
.sender-choice-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.sender-choice-copy b {
  color: inherit;
  font-size: 13px;
  font-weight: 700;
}
.sender-choice-copy small {
  color: var(--muted2);
  font-size: 11px;
  line-height: 1.35;
}
.sender-choice.on .sender-choice-copy small {
  color: var(--muted);
}
.sender-choice-field.compact {
  margin-bottom: 14px;
}
.sender-choice-grid.compact {
  grid-template-columns: repeat(var(--choice-cols, 3), minmax(0, 1fr));
}
.sender-choice-grid.compact .sender-choice {
  min-height: 62px;
  padding: 10px;
  gap: 9px;
}
.sender-choice-grid.compact .sender-choice-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
}
.sender-choice-grid.compact .sender-choice-icon .ic {
  width: 17px;
  height: 17px;
}
.sender-choice-grid.compact .sender-choice-copy b {
  font-size: 12.5px;
}
.sender-choice-grid.compact .sender-choice-copy small {
  font-size: 10.5px;
}
.sender-resource-note {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 4px;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.4;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.sender-resource-note b {
  color: var(--txt);
  font-weight: 650;
}
.sender-resource-icon {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}
.sender-resource-icon .ic {
  width: 15px;
  height: 15px;
}

.sender-settings-hub {
  padding-bottom: 12px;
}
.sender-settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.sender-settings-tile {
  min-width: 0;
  padding: 11px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 9px;
  text-align: left;
  cursor: pointer;
  color: var(--muted);
  font: inherit;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.09);
  transition:
    color 0.16s,
    border-color 0.16s,
    background 0.16s,
    transform 0.12s;
}
.sender-settings-tile:active {
  transform: scale(0.98);
}
.sender-settings-tile.active {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.sender-settings-icon {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
}
.sender-settings-icon .ic {
  width: 17px;
  height: 17px;
}
.sender-settings-copy {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sender-settings-copy b {
  color: inherit;
  font-size: 12.5px;
}
.sender-settings-copy small {
  color: var(--muted2);
  font-size: 10px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sender-settings-count {
  min-width: 25px;
  padding: 4px 7px;
  border-radius: 999px;
  text-align: center;
  color: var(--txt);
  font-size: 10px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
}
.step-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 2px;
}
.add-step-btn {
  margin-top: 2px;
  align-self: flex-start;
}

.setup-shared {
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.setup-shared .field:first-child {
  margin-top: 0;
}

.step-row {
  padding: 12px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.step-row .field {
  margin-bottom: 10px;
}
.step-row .field:last-child {
  margin-bottom: 0;
}
.step-head {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.45px;
  margin-bottom: 2px;
}
.field.inline {
  display: flex;
  align-items: center;
  gap: 10px;
}
.field.inline label {
  margin: 0;
  white-space: nowrap;
}
.field.inline .input-wrap {
  width: 88px;
  flex: 0 0 auto;
}

.toggle-field {
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.07);
  transition:
    border-color 0.15s,
    background 0.15s;
}
.toggle-field:last-child {
  margin-bottom: 0;
}
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 20px;
}
/* label.toggle-label: must out-cascade `.field label` (same specificity, later wins) —
   otherwise its margin-bottom:7px pushes the text ~3.5px above center in every bubble */
label.toggle-label {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px 6px;
  margin: 0;
  font-size: 12.5px;
  color: var(--txt);
  letter-spacing: 0.2px;
  font-weight: 500;
  line-height: 1.3;
  cursor: pointer;
}
.hint-inline {
  flex-basis: 100%;
  font-weight: 400;
  color: var(--muted2);
  font-size: 11px;
  line-height: 1.35;
}

/* grouped toggles read as one intentional settings list (no crooked bubbles) */
.toggle-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 12px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.035);
  overflow: hidden;
}
.toggle-group:last-child {
  margin-bottom: 0;
}
.toggle-group .toggle-field {
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.toggle-group .toggle-field:last-child {
  border-bottom: 0;
}

/* collapsible "Advanced" group for rarely-used fields */
.adv-group {
  margin: 2px 0 12px;
}
.adv-group > summary {
  cursor: pointer;
  list-style: none;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  letter-spacing: 0.45px;
  text-transform: uppercase;
  color: var(--muted2);
  font-weight: 600;
  padding: 6px 0;
}
.adv-group > summary::-webkit-details-marker {
  display: none;
}
.adv-group > summary::before {
  content: "▸";
  font-size: 10px;
  color: var(--muted2);
  transition: transform 0.15s;
}
.adv-group[open] > summary::before {
  transform: rotate(90deg);
}
.adv-group > summary:hover {
  color: var(--txt);
}
.adv-group > *:not(summary) {
  margin-top: 10px;
}

/* .section-title shares the prominent header style defined with .form-section-title above */

/* results: Grok verdict badges + human-score chip + verified-only toggle */
.gver {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  vertical-align: middle;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
}
.gver.ok {
  background: rgba(52, 199, 120, 0.16);
  color: #7ee0a6;
  border: 1px solid rgba(52, 199, 120, 0.35);
}
.gver.bad {
  background: rgba(255, 99, 99, 0.14);
  color: #ff9d9d;
  border: 1px solid rgba(255, 99, 99, 0.32);
}
.chip.hs b {
  color: #fff;
}
.chip.hs.good b {
  color: #7ee0a6;
}
.chip.hs.mid b {
  color: #f0d98c;
}
.chip.hs.bad b {
  color: #ff9d9d;
}
.rt-verified {
  flex: 0 0 auto;
  height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition:
    color 0.15s,
    background 0.15s,
    border-color 0.15s;
}
.rt-verified:hover {
  color: var(--txt);
  border-color: rgba(255, 255, 255, 0.22);
}
.rt-verified.on {
  color: #06110b;
  background: #6fe0a3;
  border-color: transparent;
}

.switch {
  flex: 0 0 auto;
  width: 40px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  padding: 2px;
  cursor: pointer;
  position: relative;
  transition:
    background 0.18s,
    border-color 0.18s;
}
.switch.on {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(255, 255, 255, 0.92);
}
.switch-knob {
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  transition:
    transform 0.18s,
    background 0.18s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}
.switch.on .switch-knob {
  transform: translateX(18px);
  background: #111;
}

.row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.row-actions .btn,
.row-actions a.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.panel-actions {
  margin-top: 12px;
}
.panel-actions.top-actions {
  margin-top: -2px;
  margin-bottom: 12px;
}
.target-editor {
  min-height: 170px;
}
.target-editor textarea {
  min-height: 148px;
}
.target-editor.disabled {
  opacity: 0.55;
  pointer-events: none;
}
.log-list {
  margin-top: 0;
}

.sender-summary {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}
.sender-msg {
  margin-top: 4px;
  font-size: 12.5px;
  line-height: 1.45;
  white-space: pre-wrap;
}
.result .l-err {
  margin-top: 7px;
  padding: 7px 9px;
  border-radius: 9px;
  color: #fca5a5;
  font-size: 11.5px;
  line-height: 1.4;
  background: rgba(239, 68, 68, 0.09);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn.sm {
  padding: 6px 10px;
  font-size: 11px;
}
.btn .btn-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn .btn-ic .ic {
  width: 16px;
  height: 16px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 4px 0 14px;
}
@media (max-width: 560px) {
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .tool-grid {
    grid-template-columns: 1fr;
  }
}
.admin-bulk {
  margin-bottom: 12px;
}
.admin-bulk .btn {
  width: 100%;
}
.admin-tools {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  align-items: stretch;
  flex-wrap: wrap;
}
.admin-tools .seg {
  flex: 1;
  min-width: 200px;
}
.admin-tools .seg button {
  text-transform: capitalize;
  font-size: 12px;
  padding: 8px 10px;
}
.admin-search {
  flex: 1;
  min-width: 140px;
  max-width: 240px;
}
.admin-search input {
  padding: 10px 0 !important;
}
.admin-search-ic {
  display: grid;
  place-items: center;
  color: var(--muted);
}
.admin-search-ic .ic {
  width: 16px;
  height: 16px;
}
.nav-badge {
  position: absolute;
  top: -5px;
  right: -9px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #fff;
  color: #000;
  font-size: 10px;
  font-weight: 800;
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.5);
}
.tab .tic {
  position: relative;
  overflow: visible;
}
.icon-btn.hi {
  background: linear-gradient(135deg, #ffffff, #d4d4d8);
  color: #000;
  border-color: transparent;
}
.icon-btn.off {
  opacity: 0.3;
  cursor: not-allowed;
}
.pill.hi {
  color: #000;
  background: #fff;
  border-color: transparent;
}

.admin-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  flex-wrap: wrap;
}
.ar-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #000;
  background: linear-gradient(135deg, #ffffff, #b8b8bd);
  overflow: hidden;
}
.ar-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ar-main {
  flex: 1;
  min-width: 140px;
}
.ar-name {
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ar-handle {
  font-size: 11.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  flex-wrap: wrap;
}
.ar-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}
.ar-bio {
  font-size: 11.5px;
  color: var(--muted2);
  flex: 1 1 100%;
  line-height: 1.4;
}
.stat {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-sm);
  padding: 14px 9px;
  text-align: left;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.025));
}
.stat::after {
  content: "";
  position: absolute;
  left: 9px;
  right: 9px;
  bottom: 0;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: rgba(255, 255, 255, 0.14);
}
.stat-pending::after {
  background: rgba(240, 217, 140, 0.58);
}
.stat-approved::after,
.stat-pro::after {
  background: rgba(255, 255, 255, 0.72);
}
.stat-n {
  display: block;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}
.stat-k {
  display: block;
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 5px;
}
.ar-actions {
  display: flex;
  gap: 6px;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--txt);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition:
    transform 0.12s,
    background 0.18s;
}
.icon-btn:active {
  transform: scale(0.94);
}
.icon-btn.ok {
  background: linear-gradient(135deg, #ffffff, #d4d4d8);
  color: #000;
  border-color: transparent;
}
.icon-btn .ic {
  width: 17px;
  height: 17px;
}
.pill {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--muted);
}
.pill.ok {
  color: #05120a;
  background: var(--ok);
  border-color: rgba(var(--ok-rgb), 0.9);
}
.pill.warn {
  color: var(--warn);
  background: rgba(var(--warn-rgb), 0.1);
  border-color: rgba(var(--warn-rgb), 0.52);
}
.pill.err {
  color: #fff;
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.5);
}
.pill.bad {
  color: var(--err);
  background: rgba(var(--err-rgb), 0.1);
  border-color: rgba(var(--err-rgb), 0.48);
}
.pill.new {
  color: #bfdbfe;
  background: rgba(96, 165, 250, 0.1);
  border-color: rgba(96, 165, 250, 0.42);
}
.pill.warm {
  color: var(--warn);
  border-color: rgba(var(--warn-rgb), 0.5);
  background: rgba(var(--warn-rgb), 0.08);
}
.chip.warm b {
  color: #f0d98c;
}

/* ── toasts (stacked, typed, click-to-dismiss) ── */
.toasts {
  position: fixed;
  left: 50%;
  bottom: calc(var(--safe-bot) + 92px);
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: max-content;
  max-width: min(90vw, 440px);
}
.toast-item {
  display: flex;
  align-items: center;
  gap: 9px;
  background: rgba(20, 20, 22, 0.94);
  backdrop-filter: blur(14px);
  border: 1px solid var(--glass-brd);
  color: #fff;
  padding: 10px 15px;
  border-radius: 13px;
  font-size: 13px;
  line-height: 1.35;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  pointer-events: auto;
  cursor: pointer;
  opacity: 0;
  transform: translateY(14px) scale(0.98);
  transition:
    opacity 0.26s,
    transform 0.26s;
}
.toast-item.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.toast-item .toast-ic {
  display: inline-flex;
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}
.toast-item .toast-ic .ic {
  width: 17px;
  height: 17px;
}
.toast-item .toast-msg {
  min-width: 0;
}
.toast-item.success {
  border-color: rgba(74, 222, 128, 0.5);
}
.toast-item.success .toast-ic {
  color: #4ade80;
}
.toast-item.error {
  border-color: rgba(239, 68, 68, 0.55);
}
.toast-item.error .toast-ic {
  color: #f87171;
}
.toast-item.info .toast-ic {
  color: rgba(255, 255, 255, 0.85);
}

/* ── motion: content entrance ────────────────────────────────────────────── */
@keyframes viewIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.view > * {
  animation: viewIn 0.34s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
.view > *:nth-child(2) {
  animation-delay: 0.05s;
}
.view > *:nth-child(3) {
  animation-delay: 0.1s;
}
.view > *:nth-child(n + 4) {
  animation-delay: 0.13s;
}
/* subnav is sticky and subview is a bare wrapper — animate its children instead. */
.view > .subnav,
.view > .subview {
  animation: none;
}
.subview > * {
  animation: viewIn 0.34s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
.subview > *:nth-child(2) {
  animation-delay: 0.06s;
}
.subview > *:nth-child(3) {
  animation-delay: 0.11s;
}
.subview > *:nth-child(4) {
  animation-delay: 0.15s;
}
.subview > *:nth-child(n + 5) {
  animation-delay: 0.18s;
}

.card {
  transition:
    box-shadow 0.2s,
    border-color 0.2s;
}

/* ── hover polish (pointer devices only) ─────────────────────────────────── */
@media (hover: hover) {
  .btn.primary:hover:not(:disabled) {
    filter: brightness(1.04);
    box-shadow:
      0 10px 26px rgba(0, 0, 0, 0.55),
      inset 0 1px 0 rgba(255, 255, 255, 0.85);
  }
  .btn.ghost:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
  }
  .btn.small:hover:not(:disabled),
  .btn.sm:hover:not(:disabled) {
    filter: brightness(1.04);
  }
  .tool-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.42);
  }
  .tool-card.soon:hover {
    transform: none;
    box-shadow: none;
  }
  .result:hover {
    border-color: rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.06);
  }
  .list-item:hover {
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
  }
  .list-item button:hover {
    background: rgba(255, 255, 255, 0.14);
    color: var(--txt);
  }
  .tm-del:hover {
    background: rgba(239, 68, 68, 0.16) !important;
    border-color: rgba(239, 68, 68, 0.5) !important;
    color: #fff !important;
  }
  .tm-clear:hover {
    color: var(--txt);
    border-color: rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.05);
  }
  .icon-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.13);
    border-color: rgba(255, 255, 255, 0.22);
  }
  .toggle-field:hover {
    border-color: rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.05);
  }
  .seg button:hover:not(.on) {
    color: var(--txt);
  }
  .sender-choice:hover:not(.on),
  .sender-settings-tile:hover:not(.active) {
    color: var(--txt);
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.06);
  }
  .subtab:hover:not(.active) {
    color: var(--txt);
    background: rgba(255, 255, 255, 0.05);
  }
  .plan-col:hover {
    border-color: rgba(255, 255, 255, 0.24);
  }
  .input-toggle:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
  }
}

/* On desktop, center toasts over the main column (not the whole window). */
@media (min-width: 861px) {
  .toasts {
    left: calc(50% + (var(--sidebar-w) / 2));
  }
}

/* ── responsive: tablet ──────────────────────────────────────────────────── */
@media (max-width: 1080px) and (min-width: 861px) {
  :root {
    --sidebar-w: 224px;
  }
  .main {
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* ── responsive: mobile (sidebar collapses to a bottom bar) ──────────────── */
@media (max-width: 860px) {
  .app {
    flex-direction: column;
  }
  .objective-seg {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .main {
    order: 1;
    flex: 1 1 auto;
    min-height: 0;
    padding: calc(var(--safe-top) + 10px) 12px 10px;
    gap: 10px;
  }
  .view > *,
  .runbar {
    max-width: 720px;
  }
  .runbar {
    flex-direction: column;
    align-items: stretch;
  }

  .sidebar {
    order: 2;
    flex: 0 0 auto;
    flex-direction: row;
    align-items: center;
    gap: 0;
    padding: 6px 8px calc(var(--safe-bot) + 6px);
    border-right: 0;
    border-top: 1px solid var(--glass-brd);
    border-radius: 0;
  }
  .sidebar-head,
  .sidebar-foot {
    display: none;
  }
  .sidebar .tabbar {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0;
    gap: 2px;
    width: 100%;
  }
  .sidebar .tab {
    flex: 1 1 0;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    padding: 8px 1px;
    font-size: 10px;
    letter-spacing: 0;
    min-width: 0;
  }
  .sidebar .tab > span:last-child {
    flex: 0 0 auto;
    text-align: center;
  }
  .sidebar .tab.active::before {
    display: none;
  }
}

@media (max-width: 560px) {
  .sender-choice-grid,
  .sender-choice-grid.compact {
    grid-template-columns: 1fr;
  }
  .sender-settings-tile {
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    padding: 10px 5px;
    text-align: center;
  }
  .sender-settings-copy {
    flex: 0 1 auto;
  }
  .sender-settings-copy small {
    display: none;
  }
  .sender-settings-count {
    min-width: 22px;
    padding: 3px 6px;
  }
  .page-head {
    gap: 10px;
  }
  .page-head-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }
  .page-head-icon .ic {
    width: 19px;
    height: 19px;
  }
  .page-head-copy h2 {
    font-size: 15px;
  }
  .page-head.has-action {
    flex-wrap: wrap;
  }
  .page-head.has-action > .btn {
    flex-basis: 100%;
    width: 100%;
    margin-left: 0;
  }
  .home-hero {
    padding: 16px;
  }
  .home-user {
    align-items: flex-start;
  }
  .home-user > .plan-badge {
    position: absolute;
    top: 16px;
    right: 16px;
  }
  .home-copy {
    padding-right: 52px;
  }
  .home-status-grid {
    grid-template-columns: 1fr;
  }
  .profile-head {
    align-items: center;
    flex-wrap: nowrap;
    padding-right: 62px;
  }
  .profile-head .plan-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    margin: 0;
  }
  .plan-grid,
  .meta-grid {
    grid-template-columns: 1fr;
  }
  .admin-tools {
    flex-direction: column;
  }
  .admin-tools .seg,
  .admin-search {
    width: 100%;
    min-width: 0;
    max-width: none;
  }
  .results-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .rt-search,
  .rt-sort,
  .rt-verified {
    width: 100%;
    flex: 0 0 auto;
  }
}

/* ── keyboard focus rings (pointer clicks stay clean) ────────────────────── */
.btn:focus-visible,
.tab:focus-visible,
.subtab:focus-visible,
.icon-btn:focus-visible,
.tm-del:focus-visible,
.tm-clear:focus-visible,
.switch:focus-visible,
.seg button:focus-visible,
.side-user:focus-visible,
.tool-card:focus-visible,
.sender-choice:focus-visible,
.sender-settings-tile:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* ── skeleton loaders (initial data fetch) ───────────────────────────────── */
@keyframes skShimmer {
  0% {
    background-position: -420px 0;
  }
  100% {
    background-position: 420px 0;
  }
}
.card.skeleton {
  pointer-events: none;
}
.card.skeleton .sk-line,
.card.skeleton .sk-box {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.05) 25%,
    rgba(255, 255, 255, 0.12) 37%,
    rgba(255, 255, 255, 0.05) 63%
  );
  background-size: 840px 100%;
  animation: skShimmer 1.4s ease-in-out infinite;
  border-radius: 8px;
}
.card.skeleton .sk-line {
  height: 13px;
  margin-bottom: 11px;
}
.card.skeleton .sk-line.sk-title {
  height: 20px;
  width: 44%;
  margin-bottom: 18px;
  border-radius: 9px;
}
.card.skeleton .sk-line.short {
  width: 62%;
}
.card.skeleton .sk-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 16px;
}
.card.skeleton .sk-box {
  height: 58px;
  border-radius: 12px;
}

/* ── run progress bar (top edge of the runbar) ───────────────────────────── */
.run-progress {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  overflow: hidden;
  border-radius: 2px 2px 0 0;
  background: rgba(255, 255, 255, 0.08);
}
.runbar {
  position: relative;
}
.run-progress > span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.6), #fff);
  border-radius: inherit;
  transition: width 0.5s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.run-progress.indeterminate > span {
  width: 40% !important;
  transition: none;
  animation: runIndet 1.15s ease-in-out infinite;
}
@keyframes runIndet {
  0% {
    transform: translateX(-110%);
  }
  100% {
    transform: translateX(320%);
  }
}

/* ── animated counter bump ───────────────────────────────────────────────── */
.run-found b {
  display: inline-block;
  transition: transform 0.18s ease;
}
.run-found b.bump {
  transform: scale(1.28);
}

/* ── token/proxy line validation ─────────────────────────────────────────── */
.tm-add textarea.invalid {
  box-shadow: inset 0 0 0 1.5px rgba(239, 68, 68, 0.7);
  border-radius: 12px;
}
.tm-invalid {
  margin: 8px 2px 0;
  font-size: 12px;
  color: #f87171;
  line-height: 1.4;
}

/* ── results toolbar (filter + sort) ─────────────────────────────────────── */
.results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.results-count {
  color: var(--muted);
  font-weight: 500;
}
.results-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.result-list {
  margin-top: 12px;
}
.rt-search {
  flex: 1 1 220px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  height: 40px;
  border-radius: 12px;
}
.rt-search .rt-ic {
  display: inline-flex;
  width: 16px;
  height: 16px;
  color: var(--muted);
  flex: 0 0 auto;
}
.rt-search .rt-ic .ic {
  width: 16px;
  height: 16px;
}
.rt-input {
  flex: 1 1 auto;
  background: none;
  border: 0;
  outline: none;
  color: var(--txt);
  font-size: 13.5px;
  font-family: inherit;
  height: 100%;
}
.rt-input::placeholder {
  color: var(--muted);
}
.rt-sort {
  flex: 0 0 auto;
  height: 40px;
  padding: 0 34px 0 13px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: var(--txt);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.rt-sort option {
  background: #17171a;
  color: var(--txt);
}

/* ── themed select control — avoids the native Windows option popup ─────── */
.select-control {
  position: relative;
  min-width: 0;
  height: 40px;
  color: var(--txt);
  font-size: 13px;
  font-family: inherit;
}
.select-control.rt-sort,
.select-control.proxy-move,
.select-control.account-role-move {
  padding: 0;
  border: 0;
  background: none;
  background-image: none;
}
.select-control.proxy-move {
  width: 106px;
  height: 32px;
  min-height: 32px;
  font-size: 10.5px;
}
.select-control.proxy-move .select-trigger {
  padding: 0 7px 0 9px;
  border-radius: 9px;
}
.select-trigger {
  width: 100%;
  height: 100%;
  min-width: 0;
  padding: 0 11px 0 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  color: var(--txt);
  font: inherit;
  text-align: left;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.035));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
  transition:
    border-color 0.16s,
    background 0.16s,
    box-shadow 0.16s;
}
.select-value {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.select-arrow {
  flex: 0 0 auto;
  color: var(--muted);
  transition:
    transform 0.18s ease,
    color 0.18s;
}
.select-arrow .ic {
  width: 15px;
  height: 15px;
}
.select-control.open .select-trigger {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.09);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}
.select-control.open .select-arrow {
  transform: rotate(180deg);
  color: #fff;
}
.select-control.disabled {
  opacity: 0.48;
  pointer-events: none;
}
.select-popover {
  position: fixed;
  z-index: 220;
  padding: 5px;
  overflow-y: auto;
  opacity: 0;
  transform: translateY(-5px) scale(0.985);
  transform-origin: top center;
  border-radius: 13px;
  background: rgba(18, 18, 21, 0.98);
  box-shadow:
    0 18px 55px rgba(0, 0, 0, 0.72),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition:
    opacity 0.14s ease,
    transform 0.14s ease;
}
.select-popover.show {
  opacity: 1;
  transform: none;
}
.select-option {
  width: 100%;
  min-height: 38px;
  padding: 9px 10px;
  border: 0;
  border-radius: 9px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 12.5px;
  text-align: left;
  transition:
    color 0.12s,
    background 0.12s;
}
.select-option > span:first-child {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.select-option .ic {
  width: 15px;
  height: 15px;
}
.select-option.selected {
  color: #fff;
  background: rgba(255, 255, 255, 0.09);
  font-weight: 650;
}
.select-option:hover,
.select-option:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  outline: none;
}
.select-option:disabled {
  opacity: 0.45;
  pointer-events: none;
}

/* ── command palette (Ctrl / ⌘ + K) ──────────────────────────────────────── */
.cmdk-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 16px 16px;
  animation: cmdkFade 0.16s ease both;
}
@keyframes cmdkFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.cmdk {
  width: min(560px, 96vw);
  max-height: 62vh;
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  animation: cmdkPop 0.2s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
@keyframes cmdkPop {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.cmdk-input {
  border: 0;
  outline: none;
  background: rgba(255, 255, 255, 0.04);
  color: var(--txt);
  font-size: 15px;
  font-family: inherit;
  padding: 17px 18px;
  border-bottom: 1px solid var(--glass-brd);
}
.cmdk-input::placeholder {
  color: var(--muted);
}
.cmdk-list {
  overflow-y: auto;
  padding: 7px;
}
.cmdk-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 11px;
  cursor: pointer;
  color: var(--txt);
}
.cmdk-item.active {
  background: rgba(255, 255, 255, 0.09);
}
.cmdk-ic {
  display: inline-flex;
  width: 17px;
  height: 17px;
  color: var(--muted);
  flex: 0 0 auto;
}
.cmdk-ic .ic {
  width: 17px;
  height: 17px;
}
.cmdk-label {
  flex: 1 1 auto;
  font-size: 13.5px;
}
.cmdk-hint {
  flex: 0 0 auto;
  font-size: 10.5px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 3px 8px;
  border-radius: 999px;
}
.cmdk-empty {
  padding: 22px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

/* ── keyboard focus rings for new controls ───────────────────────────────── */
.rt-input:focus-visible,
.rt-sort:focus-visible,
.select-trigger:focus-visible,
.cmdk-input:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* ── reduced motion ──────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .blob {
    animation: none !important;
  }
  .fx {
    display: none !important;
  }
  .card.skeleton .sk-line,
  .card.skeleton .sk-box {
    animation: none !important;
  }
  .run-progress.indeterminate > span {
    animation: none !important;
  }
}

/* ── unified operations dashboard ────────────────────────────────────────── */
.home-refresh {
  flex: 0 0 auto;
  margin-left: auto;
}
.op-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}
.op-stat {
  min-width: 0;
  min-height: 82px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: var(--radius-sm);
}
.op-stat.good {
  border-color: rgba(34, 197, 94, 0.3);
}
.op-stat.warn {
  border-color: rgba(240, 217, 140, 0.35);
}
.op-stat.bad {
  border-color: rgba(239, 68, 68, 0.35);
}
.op-stat-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}
.op-stat-icon .ic {
  width: 18px;
  height: 18px;
}
.op-stat-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.op-stat-copy small {
  color: var(--muted2);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.45px;
}
.op-stat-copy b {
  color: #fff;
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.op-stat-copy em {
  color: var(--muted);
  font-size: 10.5px;
  font-style: normal;
  line-height: 1.35;
}
.quick-action-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.quick-action {
  min-width: 0;
}
.dashboard-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.dashboard-columns > * {
  min-width: 0;
}
.compact-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.compact-row {
  width: 100%;
  min-width: 0;
  padding: 10px 11px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  cursor: pointer;
  color: var(--txt);
  font: inherit;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition:
    background 0.15s,
    border-color 0.15s,
    transform 0.12s;
}
.compact-row:active {
  transform: scale(0.99);
}
.compact-icon {
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}
.compact-icon .ic {
  width: 16px;
  height: 16px;
}
.compact-main {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.compact-main b,
.compact-main small {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.compact-main b {
  font-size: 12px;
}
.compact-main small {
  color: var(--muted2);
  font-size: 10.5px;
}

/* ── campaign controls ───────────────────────────────────────────────────── */
.campaign-field {
  padding: 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.campaign-controls {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.campaign-select {
  flex: 1 1 230px;
  min-width: 0;
  width: auto;
}
.campaign-controls .btn {
  flex: 0 0 auto;
}

/* ── settings: stable accounts and proxies ───────────────────────────────── */
.settings-subnav .subtab {
  min-width: 0;
}
.settings-stats {
  margin-top: 2px;
}
.account-upload .account-upload-destination {
  margin-bottom: 0;
}
.account-upload .upload-stack {
  margin-top: 16px;
}
.account-role-switcher {
  --role-index: 0;
  position: relative;
  isolation: isolate;
  margin-top: 14px;
  padding: 4px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  border-radius: 16px;
  overflow: hidden;
}
.account-role-switcher::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 4px;
  top: 4px;
  bottom: 4px;
  width: calc((100% - 20px) / 4);
  border-radius: 12px;
  opacity: 0;
  background: linear-gradient(135deg, #fff, #d3d3d7);
  box-shadow:
    0 7px 22px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition:
    transform 0.34s cubic-bezier(0.22, 0.8, 0.24, 1),
    opacity 0.2s;
}
.account-role-switcher:has(.account-role-tab.active)::before {
  opacity: 1;
}
.account-role-switcher:has(.account-role-tab:nth-child(2).active)::before {
  transform: translateX(calc(100% + 4px));
}
.account-role-switcher:has(.account-role-tab:nth-child(3).active)::before {
  transform: translateX(calc(200% + 8px));
}
.account-role-switcher:has(.account-role-tab:nth-child(4).active)::before {
  transform: translateX(calc(300% + 12px));
}
.account-role-tab {
  min-width: 0;
  min-height: 54px;
  padding: 8px 9px;
  border: 0;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font: inherit;
  transition:
    color 0.25s,
    transform 0.2s;
}
.account-role-tab > span:first-child {
  flex: 0 0 auto;
}
.account-role-tab > span:first-child .ic {
  width: 18px;
  height: 18px;
}
.account-role-tab > span:last-child {
  min-width: 0;
  display: flex;
  flex-direction: column;
  text-align: left;
}
.account-role-tab b {
  font-size: 11.5px;
  white-space: nowrap;
}
.account-role-tab small {
  margin-top: 1px;
  color: var(--muted2);
  font-size: 9px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.account-role-tab.active {
  color: #08080a;
}
.account-role-tab.active small {
  color: rgba(0, 0, 0, 0.56);
}
.account-role-tab.active > span:first-child {
  animation: roleIconIn 0.38s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes roleIconIn {
  0% {
    transform: scale(0.7) rotate(-10deg);
    opacity: 0.2;
  }
  100% {
    transform: none;
    opacity: 1;
  }
}
.account-category-toolbar {
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.account-category-toolbar .rt-search {
  flex: 1 1 auto;
}
.account-page-summary {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}
.account-upload-destination,
.campaign-dialog-workflow {
  min-height: 50px;
  padding: 9px 11px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 13px;
  margin-bottom: 12px;
}
.account-upload-destination > span:first-child,
.campaign-dialog-workflow > span:first-child {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}
.account-upload-destination .ic,
.campaign-dialog-workflow .ic {
  width: 17px;
  height: 17px;
}
.account-upload-destination > span:nth-child(2),
.campaign-dialog-workflow > span:nth-child(2) {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.account-upload-destination small,
.campaign-dialog-workflow small {
  color: var(--muted2);
  font-size: 9.5px;
}
.account-upload-destination b,
.campaign-dialog-workflow b {
  font-size: 12px;
}
.role-field {
  margin: 0 0 12px;
  padding: 0;
  border: 0;
}
.role-field legend {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.3px;
}
.role-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}
.role-option {
  min-width: 0;
  min-height: 44px;
  padding: 9px 10px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 650;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.09);
}
.role-option.on {
  color: #000;
  background: linear-gradient(135deg, #fff, #d4d4d8);
  border-color: transparent;
}
.role-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.role-option .btn-ic .ic {
  width: 15px;
  height: 15px;
}
.account-list,
.proxy-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.account-category-stage {
  animation: accountCategoryIn 0.3s cubic-bezier(0.2, 0.75, 0.25, 1) both;
}
@keyframes accountCategoryIn {
  from {
    opacity: 0;
    transform: translateY(7px);
    filter: blur(3px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}
.account-row {
  padding: 12px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "avatar main actions" "avatar roles actions";
  align-items: center;
  gap: 8px 12px;
  border-radius: var(--radius-sm);
}
.account-avatar {
  grid-area: avatar;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  overflow: hidden;
  display: grid;
  place-items: center;
  color: var(--on-accent);
  font-weight: 800;
  position: relative;
  background: linear-gradient(135deg, var(--accent), rgba(var(--accent-rgb), 0.68));
}
.account-avatar.has-image {
  color: transparent;
  background: rgba(255, 255, 255, 0.06);
}
.account-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: avatarIn 0.24s ease both;
}
@keyframes avatarIn {
  from {
    opacity: 0;
    transform: scale(1.08);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.account-main {
  grid-area: main;
  min-width: 0;
}
.account-title {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.account-title > b {
  font-size: 13.5px;
}
.account-name {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}
.account-state-message {
  margin-top: 4px;
  color: var(--muted2);
  font-size: 10.5px;
  line-height: 1.4;
}
.account-token {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted2);
}
.account-token .ic {
  width: 12px;
  height: 12px;
}
.account-token code {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 10.5px;
}
.account-error {
  margin-top: 7px;
  padding: 7px 9px;
  border-radius: 9px;
  color: #fca5a5;
  font-size: 10.5px;
  line-height: 1.4;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
}
.account-health-details {
  margin-top: 8px;
  color: var(--muted);
  font-size: 10.5px;
}
.account-health-details > summary {
  width: fit-content;
  cursor: pointer;
  color: var(--muted2);
  font-weight: 650;
  list-style-position: inside;
}
.account-health-details[open] > summary {
  color: var(--txt);
}
.account-health-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.account-health-item {
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid var(--glass-brd);
  border-radius: 9px;
  background: var(--glass-bg);
}
.account-health-item small,
.account-health-item b {
  display: block;
  overflow-wrap: anywhere;
}
.account-health-item small {
  color: var(--muted2);
  font-size: 9px;
}
.account-health-item b {
  margin-top: 2px;
  color: var(--txt);
  font-size: 10px;
}
.account-roles {
  grid-area: roles;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.account-role-move,
.account-proxy-select {
  width: 176px;
  height: 32px;
  font-size: 10.5px;
}
.account-role-move .select-trigger,
.account-proxy-select .select-trigger {
  padding-left: 9px;
  border-radius: 9px;
}
.shared-role-warning {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #facc15;
  font-size: 9.5px;
  line-height: 1.25;
}
.shared-role-warning > .ic {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
}
.role-chip {
  padding: 5px 8px;
  border-radius: 999px;
  cursor: pointer;
  color: var(--muted2);
  font: inherit;
  font-size: 9.5px;
  font-weight: 700;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.role-chip.on {
  color: #000;
  background: #fff;
  border-color: transparent;
}
.account-actions {
  grid-area: actions;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.account-load-more {
  margin-top: 10px;
}
.account-row-skeleton {
  min-height: 88px;
  grid-template-columns: 46px minmax(0, 1fr);
  grid-template-areas: none;
  overflow: hidden;
}
.account-row-skeleton span {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  animation: accountSkeleton 1.25s ease-in-out infinite alternate;
}
.account-row-skeleton span:first-child {
  grid-row: 1 / 4;
  width: 46px;
  height: 46px;
  border-radius: 14px;
}
.account-row-skeleton span:nth-child(2) {
  width: 45%;
}
.account-row-skeleton span:nth-child(3) {
  width: 72%;
}
@keyframes accountSkeleton {
  to {
    opacity: 0.35;
  }
}
.btn.danger {
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}
.proxy-pool-card {
  overflow: visible;
}
.proxy-row {
  padding: 11px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: var(--radius-sm);
}
.proxy-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.07);
}
.proxy-icon .ic {
  width: 17px;
  height: 17px;
}
.proxy-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.proxy-main b,
.proxy-main small,
.proxy-main em {
  overflow: hidden;
  text-overflow: ellipsis;
}
.proxy-main b {
  font-size: 12px;
  white-space: nowrap;
}
.proxy-main small {
  color: var(--muted);
  font-size: 10.5px;
  white-space: nowrap;
}
.proxy-main em {
  color: #fca5a5;
  font-size: 10px;
  font-style: normal;
  white-space: normal;
}
.proxy-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}
.proxy-move {
  width: auto;
  min-height: 32px;
  padding: 6px 24px 6px 8px;
  border-radius: 9px;
  color: var(--txt);
  font: inherit;
  font-size: 10.5px;
  background: #17171a;
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.proxy-add {
  margin-top: 16px;
}
.proxy-add .textarea-wrap {
  min-height: 88px;
}
.proxy-add textarea {
  min-height: 68px;
}

/* ── access route and experimental warning ──────────────────────────────── */
.access-route-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.access-route {
  padding: 13px;
  border-radius: var(--radius-sm);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 9px;
  align-items: center;
}
.access-route > span {
  grid-row: 1 / 3;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
}
.access-route > span .ic {
  width: 19px;
  height: 19px;
}
.access-route b {
  font-size: 12px;
}
.access-route small {
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.35;
}
.experimental-warning {
  border-color: rgba(240, 217, 140, 0.45);
  background:
    radial-gradient(100% 160% at 100% 0%, rgba(240, 217, 140, 0.1), transparent 62%),
    var(--glass-bg);
}
.warning-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 13px;
  margin-bottom: 10px;
  border-radius: 12px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
  background: rgba(240, 217, 140, 0.07);
  border: 1px solid rgba(240, 217, 140, 0.2);
}
.warning-copy b {
  color: #f5e8b8;
  font-size: 12px;
}
.experimental-warning .toggle-group {
  margin-bottom: 0;
  border-color: rgba(240, 217, 140, 0.22);
  background: rgba(240, 217, 140, 0.045);
}
.experimental-warning .experimental-ack-toggle {
  min-height: 54px;
}
.lead-check,
.lead-select-all input {
  appearance: none;
  -webkit-appearance: none;
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  margin: 0;
  display: grid;
  place-items: center;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.055);
  cursor: pointer;
  transition:
    background 0.16s,
    border-color 0.16s,
    transform 0.16s;
}
.lead-check::after,
.lead-select-all input::after {
  content: "";
  width: 7px;
  height: 4px;
  opacity: 0;
  border-left: 2px solid #0a0a0c;
  border-bottom: 2px solid #0a0a0c;
  transform: translateY(-1px) rotate(-45deg) scale(0.7);
  transition:
    opacity 0.14s,
    transform 0.14s;
}
.lead-check:checked,
.lead-select-all input:checked {
  border-color: rgba(255, 255, 255, 0.95);
  background: rgba(255, 255, 255, 0.95);
}
.lead-check:checked::after,
.lead-select-all input:checked::after {
  opacity: 1;
  transform: translateY(-1px) rotate(-45deg) scale(1);
}
.lead-check:active,
.lead-select-all input:active {
  transform: scale(0.92);
}
.experimental-nav {
  position: static;
}
.experimental-run-btn {
  width: 100%;
}
.experimental-run-actions {
  margin: 12px 0 2px;
  flex-wrap: nowrap;
}
.experimental-run-actions .experimental-run-btn {
  flex: 1 1 auto;
}

/* ── durable run views ───────────────────────────────────────────────────── */
.durable-run-select {
  display: flex;
  align-items: center;
  gap: 10px;
}
.durable-run-select label {
  flex: 0 0 auto;
  margin: 0;
}
.durable-summary {
  padding: 12px;
  margin-bottom: 12px;
  border-radius: var(--radius-sm);
}
.durable-status {
  display: flex;
  align-items: center;
  gap: 9px;
}
.durable-status > span:nth-child(2) {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.durable-status small {
  color: var(--muted2);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.45px;
}
.durable-status b {
  font-size: 13px;
}
.durable-status time {
  margin-left: auto;
  color: var(--muted2);
  font-size: 10.5px;
}
.durable-progress {
  height: 5px;
  margin: 11px 0;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}
.durable-progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.55), #fff);
  transition: width 0.35s;
}
.run-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
.run-stat-grid > span {
  padding: 8px;
  border-radius: 10px;
  text-align: center;
  background: rgba(255, 255, 255, 0.035);
}
.run-stat-grid b {
  display: block;
  color: #fff;
  font-size: 14px;
}
.run-stat-grid small {
  display: block;
  margin-top: 2px;
  color: var(--muted2);
  font-size: 9px;
}
.run-lifecycle-actions {
  margin-top: 10px;
}
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 10px;
}
.activity-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 8px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}
.activity-row:last-child {
  border-bottom: 0;
}
.activity-dot {
  width: 7px;
  height: 7px;
  margin-top: 5px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #fff;
}
.activity-dot.err {
  background: var(--err);
  box-shadow: 0 0 7px var(--err-glow);
}
.activity-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.activity-copy b {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.activity-copy span {
  font-size: 11px;
  line-height: 1.4;
}
.activity-row time {
  flex: 0 0 auto;
  color: var(--muted2);
  font-size: 9.5px;
}
.diagnostics {
  margin: 6px 0 0;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}
.diagnostics > summary {
  padding: 7px 0;
}
.diagnostics .console {
  margin-top: 8px;
}
.durable-log-filters {
  margin: 8px 0 12px;
}
.durable-log-filters button {
  font-size: 11.5px;
}
.durable-items {
  min-height: 90px;
}
.durable-item-number {
  color: var(--muted);
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  user-select: none;
}

/* ── lead review ─────────────────────────────────────────────────────────── */
.lead-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.lead-toolbar .rt-search {
  min-width: 190px;
}
.lead-bulk {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin: 10px 0;
  padding: 9px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.07);
}
.lead-selected {
  margin-right: auto;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 650;
}
.lead-bulk .campaign-select {
  min-width: 180px;
}
.lead-select-all {
  padding: 9px 11px;
  border-radius: 12px;
  color: var(--muted);
  font-size: 11.5px;
}
.lead-row {
  align-items: flex-start;
}
.lead-check {
  margin-top: 12px;
}

/* ── preflight modal ─────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  padding: 18px;
  display: grid;
  place-items: center;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(7px);
  animation: modalOverlayIn 0.2s ease-out both;
  overscroll-behavior: contain;
}
.dialog-open {
  overflow: hidden;
}
.dialog-shell-content {
  min-width: 0;
}
.modal-card {
  width: min(620px, 100%);
  max-height: min(760px, calc(100dvh - 36px));
  overflow-y: auto;
  padding: 16px;
  border-radius: var(--radius);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.75);
  animation: modalCardIn 0.24s cubic-bezier(0.2, 0.75, 0.25, 1) both;
  overscroll-behavior: contain;
}
@keyframes modalOverlayIn {
  from {
    opacity: 0;
  }
}
@keyframes modalCardIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.975);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.modal-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.modal-head h2 {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 17px;
}
.preflight-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 12px;
}
.preflight-summary > div {
  padding: 10px;
  border-radius: 12px;
  text-align: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.preflight-summary small {
  display: block;
  color: var(--muted2);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.preflight-summary b {
  display: block;
  margin-top: 4px;
  color: #fff;
  font-size: 14px;
}
.preflight-checks {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.preflight-check {
  padding: 10px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.preflight-check.warning {
  border-color: rgba(240, 217, 140, 0.3);
}
.preflight-check.error {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.06);
}
.preflight-check-icon {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
}
.preflight-check-icon .ic {
  width: 17px;
  height: 17px;
}
.preflight-check > span:nth-child(2) {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.preflight-check b {
  font-size: 11.5px;
}
.preflight-check small {
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.4;
}
.preflight-note {
  min-height: 18px;
  margin: 11px 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  position: sticky;
  bottom: -16px;
  padding: 10px 0 0;
  background: linear-gradient(transparent, color-mix(in srgb, var(--bg1) 96%, transparent) 32%);
}
.campaign-dialog {
  width: min(520px, 100%);
  padding: 20px;
}
.account-token-dialog {
  width: min(520px, 100%);
}
.account-token-dialog .dialog-shell-content {
  display: grid;
  gap: 12px;
}
.campaign-dialog-workflow {
  margin: 2px 0 16px;
}
.campaign-dialog .field {
  margin-bottom: 12px;
}
.campaign-dialog-note {
  padding: 11px 12px;
  border-radius: 12px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
}
.campaign-dialog-error {
  min-height: 18px;
  margin: 7px 2px 0;
  color: #fca5a5;
  font-size: 11px;
}
.campaign-dialog .modal-actions {
  margin-top: 2px;
}

.confirm-dialog {
  width: min(500px, 100%);
  padding: 20px;
}
.confirm-dialog-body {
  min-height: 82px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 13px;
  border-radius: 14px;
}
.confirm-dialog-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.confirm-dialog-icon.danger {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.24);
}
.confirm-dialog-icon .ic {
  width: 20px;
  height: 20px;
}
.confirm-dialog-copy {
  min-width: 0;
}
.confirm-dialog-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-line;
}
.confirm-dialog .modal-actions {
  margin-top: 8px;
}
.confirm-dialog .btn.primary.danger {
  color: #fff;
  background: linear-gradient(180deg, #ef6262, #c93f3f);
  border-color: rgba(255, 130, 130, 0.38);
  box-shadow: 0 8px 24px rgba(185, 45, 45, 0.22);
}

/* ── new control focus and hover states ──────────────────────────────────── */
.compact-row:focus-visible,
.role-option:focus-within,
.role-chip:focus-visible,
.proxy-move:focus-visible,
.lead-check:focus-visible,
.lead-select-all:focus-within,
.campaign-select:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}
@media (hover: hover) {
  .compact-row:hover {
    background: rgba(255, 255, 255, 0.065);
    border-color: rgba(255, 255, 255, 0.15);
  }
  .role-chip:hover:not(.on) {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.26);
  }
}

/* ── unified responsive layouts: 1440 / 768 / 390 / 320 ─────────────────── */
@media (max-width: 980px) {
  .op-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .quick-action-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .role-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 768px) {
  .dashboard-columns {
    grid-template-columns: 1fr;
  }
  .account-row {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "avatar main" "roles roles" "actions actions";
  }
  .account-role-move,
  .account-proxy-select {
    width: min(220px, 100%);
  }
  .account-actions {
    flex-direction: row;
    justify-content: flex-end;
  }
  .proxy-row {
    flex-wrap: wrap;
  }
  .proxy-actions {
    width: 100%;
    justify-content: flex-end;
  }
}
@media (max-width: 560px) {
  .home-refresh span {
    display: none;
  }
  .home-refresh {
    width: 38px;
    height: 38px;
    padding: 0;
  }
  .op-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .op-stat {
    min-height: 72px;
    padding: 9px;
    gap: 7px;
  }
  .op-stat-icon {
    width: 29px;
    height: 29px;
  }
  .op-stat-copy b {
    font-size: 13px;
  }
  .quick-action-grid,
  .access-route-grid {
    grid-template-columns: 1fr;
  }
  .campaign-controls {
    align-items: stretch;
  }
  .campaign-select {
    flex-basis: 100%;
    width: 100%;
  }
  .campaign-controls .btn {
    flex: 1 1 auto;
  }
  .settings-subnav {
    overflow-x: auto;
  }
  .settings-subnav .subtab {
    min-width: 76px;
  }
  .account-role-tab {
    min-height: 50px;
    padding: 7px 4px;
    gap: 4px;
    flex-direction: column;
  }
  .account-role-tab > span:last-child {
    text-align: center;
  }
  .account-role-tab small {
    display: none;
  }
  .account-category-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 7px;
  }
  .account-page-summary {
    padding: 0 2px;
  }
  .durable-run-select {
    align-items: stretch;
    flex-direction: column;
    gap: 6px;
  }
  .durable-run-select .select-control {
    width: 100%;
  }
  .run-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .activity-row time {
    display: none;
  }
  .lead-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .lead-toolbar > *,
  .lead-toolbar .rt-search {
    width: 100%;
    flex: 0 0 auto;
  }
  .lead-bulk {
    align-items: stretch;
  }
  .lead-selected {
    flex-basis: 100%;
  }
  .lead-bulk .btn {
    flex: 1;
  }
  .lead-bulk .campaign-select {
    width: 100%;
    flex-basis: 100%;
  }
  .modal-overlay {
    padding: 8px;
    place-items: end center;
  }
  .modal-card {
    width: 100%;
    max-height: calc(100dvh - 16px);
    border-radius: 20px 20px 14px 14px;
  }
  .preflight-summary {
    grid-template-columns: 1fr;
  }
  .modal-actions .btn {
    flex: 1;
  }
}
@media (max-width: 390px) {
  .main {
    padding-left: 8px;
    padding-right: 8px;
  }
  .card {
    padding: 13px;
  }
  .home-hero .home-user {
    align-items: flex-start;
    padding-right: 36px;
  }
  .home-hero .home-refresh {
    position: absolute;
    right: 13px;
    top: 13px;
  }
  .home-hero .home-av {
    width: 48px;
    height: 48px;
    border-radius: 14px;
  }
  .home-hero .home-name {
    font-size: 18px;
  }
  .op-stat-grid {
    grid-template-columns: 1fr;
  }
  .role-grid {
    grid-template-columns: 1fr 1fr;
  }
  .account-row {
    padding: 10px;
  }
  .account-role-tab b {
    font-size: 9.5px;
  }
  .account-role-tab > span:first-child .ic {
    width: 16px;
    height: 16px;
  }
  .account-roles {
    align-items: stretch;
    flex-direction: column;
  }
  .account-role-move,
  .account-proxy-select {
    width: 100%;
  }
  .account-health-grid {
    grid-template-columns: 1fr;
  }
  .account-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }
  .proxy-actions .btn span:last-child {
    display: none;
  }
  .proxy-actions .btn {
    width: 34px;
    padding: 0;
  }
  .sidebar .tab {
    font-size: 9px;
  }
}
@media (max-width: 340px) {
  .runbar .run-actions {
    width: 100%;
    min-width: 0;
    gap: 8px;
  }
  .runbar .run-actions .btn {
    min-width: 0;
    padding-right: 12px;
    padding-left: 12px;
  }
  .runbar .run-actions .btn.primary {
    flex: 1 1 auto;
  }
  .runbar .run-actions .btn.ghost {
    flex: 0 1 auto;
  }
  .sidebar {
    padding-left: 4px;
    padding-right: 4px;
  }
  .sidebar .tab {
    flex: 0 0 52px;
    font-size: 8.5px;
  }
  .sidebar .tabbar {
    justify-content: flex-start;
    scrollbar-width: none;
  }
  .sidebar .tabbar::-webkit-scrollbar {
    display: none;
  }
  .role-grid {
    grid-template-columns: 1fr;
  }
  .page-head-icon {
    width: 36px;
    height: 36px;
  }
  .modal-actions {
    flex-direction: column-reverse;
  }
}

/* Admin observability, reversible health and protected operations */
.header-actions,
.admin-health-actions,
.incident-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.account-row.is-disabled,
.proxy-row.is-disabled,
.health-resource-row.is-disabled {
  opacity: 0.68;
  border-style: dashed;
}
.incident-list,
.audit-list,
.health-resource-list,
.admin-health-stage {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}
.incident-row,
.health-resource-row,
.audit-row {
  padding: 13px;
}
.incident-title,
.incident-main small,
.health-resource-row,
.audit-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.incident-main {
  display: grid;
  gap: 6px;
}
.incident-actions {
  margin-top: 10px;
}
.incident-detail {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.incident-detail[hidden] {
  display: none;
}
.incident-occurrence {
  padding: 12px;
}
.incident-occurrence p {
  margin: 7px 0;
  white-space: pre-wrap;
}
.incident-occurrence pre,
.audit-row code {
  overflow: auto;
  max-height: 260px;
  margin: 6px 0 0;
  padding: 9px;
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.24);
  color: var(--muted);
  font-size: 11px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.native-select {
  min-height: 40px;
  padding: 0 36px 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--glass-bg);
  color: var(--txt);
}
.admin-user-select {
  width: min(100%, 440px);
  margin-top: 12px;
}
.admin-health-actions {
  margin: 12px 0;
}
.health-resource-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
}
.health-resource-row > span:nth-child(2) {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.health-resource-scopes,
.health-resource-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}
.health-resource-row small {
  color: var(--muted);
  overflow-wrap: anywhere;
}
.superadmin-export-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr)) auto;
  gap: 10px;
  margin-top: 14px;
}
.audit-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(120px, 0.7fr) auto;
}
.audit-row code {
  grid-column: 1 / -1;
}
@media (max-width: 760px) {
  .superadmin-export-grid {
    grid-template-columns: 1fr;
  }
  .health-resource-row,
  .audit-row {
    grid-template-columns: auto 1fr;
  }
  .health-resource-row .btn,
  .health-resource-actions,
  .audit-row code {
    grid-column: 1 / -1;
  }
  .health-resource-actions {
    justify-content: flex-start;
  }
}

/* Followers quality model, exact preview, and confirmed snapshot */
.follower-quality-setup,
.follower-plan-progress,
.follower-shadow,
.follower-candidate-review {
  display: grid;
  gap: 14px;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(var(--accent-rgb), 0.07), transparent 48%),
    color-mix(in srgb, var(--bg2) 38%, transparent);
}
.follower-quality-head,
.follower-shadow-head,
.follower-review-head,
.follower-plan-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.follower-quality-title,
.follower-shadow-head > span:first-child,
.follower-review-head > span,
.follower-plan-progress-head > span:nth-child(2) {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.follower-quality-title small,
.follower-shadow-head small,
.follower-review-head small,
.follower-plan-progress-head small {
  color: var(--muted);
  font-size: 11px;
}
.follower-quality-title h3,
.follower-shadow-head b,
.follower-review-head b,
.follower-plan-progress-head b {
  font-size: 14px;
  font-weight: 720;
  line-height: 1.25;
}
.follower-quality-title small {
  max-width: 64ch;
  line-height: 1.45;
}
.follower-quality-copy {
  min-height: 34px;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}
.follower-quality-copy .ic {
  width: 15px;
  height: 15px;
}
.follower-quality-copy > span:last-child {
  font-size: 11px;
  line-height: 1;
}
.follower-quality-warning,
.follower-plan-error {
  display: grid;
  gap: 4px;
  padding: 11px 13px;
  border-left: 3px solid rgba(var(--warn-rgb), 0.8);
  border-radius: 6px 12px 12px 6px;
  background: rgba(var(--warn-rgb), 0.08);
  color: var(--muted);
  font-size: 12px;
}
.follower-plan-error {
  margin: 16px 0;
  border-left-color: rgba(var(--err-rgb), 0.8);
  background: rgba(var(--err-rgb), 0.08);
}
.follower-plan-error b {
  color: var(--txt);
  font-size: 14px;
}
.follower-quality-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 12px;
}
.follower-quality-grid .field {
  min-width: 0;
}
.follower-quality-grid .input-suffix {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
}
.follower-quality-grid .follower-quality-wide {
  grid-column: span 2;
}
.follower-copy-diff {
  display: grid;
  gap: 7px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
}
.follower-copy-diff > div {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) minmax(90px, 0.8fr) auto minmax(90px, 0.8fr);
  align-items: center;
  gap: 8px;
  font-size: 11px;
}
.follower-copy-diff code {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.follower-quality-note {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}
.follower-plan-progress-head strong {
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}
.follower-plan-pulse {
  flex: 0 0 auto;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #71e6a2;
  box-shadow: 0 0 0 0 rgba(113, 230, 162, 0.48);
  animation: follower-plan-pulse 1.8s ease-out infinite;
}
.follower-plan-progress-bar {
  position: relative;
  height: 8px;
  overflow: hidden;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
}
.follower-plan-progress-bar > span {
  display: block;
  position: relative;
  height: 100%;
  min-width: 3px;
  border-radius: inherit;
  background: linear-gradient(90deg, #6edaa0, #c1f2d5);
  transition: width 420ms cubic-bezier(0.22, 1, 0.36, 1);
}
.follower-plan-progress-bar > span::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.55), transparent 75%);
  content: "";
  transform: translateX(-100%);
  animation: follower-progress-sweep 2.2s ease-in-out infinite;
}
.follower-plan-progress > p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.follower-plan-log {
  overflow: auto;
  max-height: 230px;
  margin: 10px 0 0;
  padding: 12px;
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.27);
  color: var(--muted);
  font:
    11px/1.55 ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
  white-space: pre-wrap;
}
.follower-plan-overview {
  display: grid;
  grid-template-columns: repeat(6, minmax(80px, 1fr));
  gap: 8px;
  margin-top: 16px;
}
.follower-plan-overview > div {
  display: grid;
  gap: 3px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
}
.follower-plan-overview small,
.follower-plan-meta,
.follower-candidate-intro {
  color: var(--muted);
  font-size: 10px;
}
.follower-plan-overview b {
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}
.follower-plan-meta,
.follower-candidate-intro {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 10px;
}
.follower-plan-sender {
  margin-top: 16px;
}
.follower-plan-sender .select-control {
  width: min(100%, 620px);
}
.follower-shadow {
  border-color: rgba(255, 193, 92, 0.22);
  background:
    linear-gradient(135deg, rgba(255, 181, 67, 0.07), transparent 55%), rgba(7, 11, 18, 0.35);
}
.follower-shadow-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.follower-shadow-columns > div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
}
.follower-shadow-columns small {
  color: var(--muted);
}
.follower-shadow-columns p {
  margin: 7px 0 0;
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.follower-candidate-review {
  padding: 0;
  border: 0;
  background: transparent;
}
.follower-candidate-loading {
  padding: 20px;
  color: var(--muted);
  text-align: center;
}
.follower-candidate-list {
  display: grid;
  overflow-y: auto;
  max-height: min(74vh, 920px);
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(5, 8, 13, 0.35);
}
.follower-candidate {
  border-bottom: 1px solid var(--line);
  animation: follower-candidate-enter 380ms both;
  animation-delay: calc(var(--candidate-index, 0) * 20ms);
}
.follower-candidate:last-child {
  border-bottom: 0;
}
.follower-candidate[open] {
  background: rgba(255, 255, 255, 0.032);
}
.follower-candidate > summary {
  display: grid;
  grid-template-columns: 24px minmax(150px, 0.8fr) minmax(320px, 1.7fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 68px;
  padding: 10px 13px;
  cursor: pointer;
  list-style: none;
}
.follower-candidate > summary::-webkit-details-marker {
  display: none;
}
.follower-candidate-check {
  width: 17px;
  height: 17px;
  accent-color: #78dda3;
}
.follower-candidate-spacer {
  width: 17px;
}
.follower-candidate-identity {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.follower-candidate-identity b,
.follower-candidate-identity small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.follower-candidate-identity small {
  color: var(--muted);
  font-size: 10px;
}
.follower-candidate-metrics,
.follower-candidate-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px 9px;
}
.follower-candidate-metrics {
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}
.follower-candidate-badges {
  justify-content: flex-end;
}
.follower-score {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(121, 225, 165, 0.32);
  border-radius: 50%;
  background: rgba(121, 225, 165, 0.09);
  color: #bdf1d0;
  font-size: 11px;
  font-weight: 750;
}
.follower-candidate.skipped .follower-score,
.follower-candidate.none .follower-score {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
}
.follower-candidate-detail {
  display: grid;
  gap: 12px;
  padding: 0 48px 16px;
}
.follower-candidate-bio {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}
.follower-score-breakdown {
  display: grid;
  grid-template-columns: repeat(5, minmax(70px, 1fr));
  gap: 7px;
}
.follower-score-breakdown > span {
  display: grid;
  gap: 2px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.follower-score-breakdown small {
  color: var(--muted);
  font-size: 9px;
  text-transform: capitalize;
}
.follower-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.follower-reasons li {
  padding: 5px 8px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  font-size: 10px;
}
.follower-candidate-detail h4 {
  margin: 0;
  font-size: 11px;
}
.follower-sample-posts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}
.follower-sample-posts blockquote {
  overflow: hidden;
  max-height: 84px;
  margin: 0;
  padding: 10px;
  border-left: 2px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}
.follower-plan-actions {
  margin-top: 16px;
}

@keyframes follower-plan-pulse {
  70% {
    box-shadow: 0 0 0 9px rgba(113, 230, 162, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(113, 230, 162, 0);
  }
}
@keyframes follower-progress-sweep {
  50%,
  100% {
    transform: translateX(120%);
  }
}
@keyframes follower-candidate-enter {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
}

@media (max-width: 1100px) {
  .follower-quality-head {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .follower-quality-head .row-actions {
    flex: 1 1 100%;
    justify-content: flex-start;
  }
}
@media (max-width: 920px) {
  .follower-quality-grid {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }
  .follower-plan-overview {
    grid-template-columns: repeat(3, 1fr);
  }
  .follower-candidate > summary {
    grid-template-columns: 24px minmax(125px, 0.8fr) minmax(220px, 1.4fr) auto;
  }
}
@media (max-width: 680px) {
  .follower-quality-head,
  .follower-shadow-head,
  .follower-plan-progress-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .follower-quality-head .btn {
    width: 100%;
  }
  .follower-quality-grid {
    grid-template-columns: 1fr;
  }
  .follower-quality-grid .follower-quality-wide {
    grid-column: auto;
  }
  .follower-copy-diff > div {
    grid-template-columns: 1fr;
  }
  .follower-copy-diff .diff-arrow {
    display: none;
  }
  .follower-plan-overview {
    grid-template-columns: repeat(2, 1fr);
  }
  .follower-shadow-columns,
  .follower-sample-posts {
    grid-template-columns: 1fr;
  }
  .follower-candidate > summary {
    grid-template-columns: 22px minmax(0, 1fr) auto;
    gap: 7px;
  }
  .follower-candidate-metrics {
    grid-column: 2 / -1;
    grid-row: 2;
  }
  .follower-candidate-detail {
    padding: 0 12px 14px 40px;
  }
  .follower-score-breakdown {
    grid-template-columns: repeat(2, minmax(70px, 1fr));
  }
  .follower-plan-actions .btn {
    flex: 1 1 150px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .follower-plan-pulse,
  .follower-plan-progress-bar > span::after,
  .follower-candidate {
    animation: none;
  }
  .follower-plan-progress-bar > span {
    transition: none;
  }
}

/* ── synchronized palette picker ─────────────────────────────────────────── */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}
.theme-option {
  --preview-bg: #000;
  --preview-surface: #141416;
  --preview-accent: #f4f4f5;
  position: relative;
  min-width: 0;
  padding: 10px;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  cursor: pointer;
  color: var(--txt);
  text-align: left;
  border: 1px solid var(--glass-brd);
  border-radius: var(--radius-sm);
  background: var(--inset-bg);
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}
.theme-option[data-theme-preview="slate"] {
  --preview-bg: #080b10;
  --preview-surface: #182334;
  --preview-accent: #a8b6c9;
}
.theme-option[data-theme-preview="graphite"] {
  --preview-bg: #080808;
  --preview-surface: #202022;
  --preview-accent: #d4d4d8;
}
.theme-option[data-theme-preview="midnight"] {
  --preview-bg: #030712;
  --preview-surface: #0d2140;
  --preview-accent: #60a5fa;
}
.theme-option[data-theme-preview="steel"] {
  --preview-bg: #070b0f;
  --preview-surface: #192631;
  --preview-accent: #7dd3fc;
}
.theme-option[data-theme-preview="cyan"] {
  --preview-bg: #020b0d;
  --preview-surface: #0c2930;
  --preview-accent: #22d3ee;
}
.theme-option[data-theme-preview="emerald"] {
  --preview-bg: #030b08;
  --preview-surface: #0d2b1f;
  --preview-accent: #34d399;
}
.theme-option[data-theme-preview="violet"] {
  --preview-bg: #080512;
  --preview-surface: #21133b;
  --preview-accent: #a78bfa;
}
.theme-option[data-theme-preview="amber"] {
  --preview-bg: #0d0902;
  --preview-surface: #332008;
  --preview-accent: #fbbf24;
}
.theme-option[data-theme-preview="crimson"] {
  --preview-bg: #0f0406;
  --preview-surface: #3a0d18;
  --preview-accent: #fb7185;
}
.theme-option.active {
  border-color: rgba(var(--accent-rgb), 0.72);
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.12);
}
.theme-option:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}
@media (hover: hover) {
  .theme-option:hover:not(:disabled) {
    transform: translateY(-1px);
    border-color: rgba(var(--accent-rgb), 0.48);
  }
}
.theme-preview {
  height: 62px;
  display: grid;
  grid-template-columns: 25px 1fr;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--preview-accent) 30%, transparent);
  border-radius: 9px;
  background: var(--preview-bg);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
}
.theme-preview-sidebar {
  background: color-mix(in srgb, var(--preview-surface) 82%, black);
  border-right: 1px solid color-mix(in srgb, var(--preview-accent) 16%, transparent);
}
.theme-preview-content {
  padding: 8px;
  display: grid;
  align-content: center;
  gap: 6px;
}
.theme-preview-content i {
  width: 75%;
  height: 4px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--preview-accent) 32%, transparent);
}
.theme-preview-content i:nth-child(2) {
  width: 52%;
}
.theme-preview-content b {
  width: 34px;
  height: 10px;
  border-radius: 4px;
  background: var(--preview-accent);
}
.theme-option-copy {
  min-width: 0;
}
.theme-option-copy b,
.theme-option-copy small {
  display: block;
}
.theme-option-copy b {
  font-size: 12px;
}
.theme-option-copy small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}
.theme-selected {
  width: 18px;
  color: var(--accent);
}
.theme-selected .ic {
  width: 17px;
  height: 17px;
}
.appearance-sync-note {
  margin-top: 12px;
}
.side-theme-select {
  width: 100%;
  margin-top: 7px;
}
.side-theme-select .select-trigger {
  min-height: 34px;
  border-radius: 11px;
  background: var(--inset-bg);
}
.follower-endpoint-wait {
  margin: 10px 0;
  padding: 10px 11px;
  display: grid;
  gap: 3px;
  color: var(--warn);
  border: 1px solid rgba(var(--warn-rgb), 0.32);
  border-radius: 11px;
  background: rgba(var(--warn-rgb), 0.07);
}
.follower-endpoint-wait b {
  font-size: 11px;
}
.follower-endpoint-wait span {
  color: var(--muted);
  font-size: 10px;
}

@media (max-width: 520px) {
  .theme-grid {
    grid-template-columns: 1fr;
  }
  .theme-option {
    grid-template-columns: 80px minmax(0, 1fr) auto;
  }
  .account-actions {
    flex-wrap: wrap;
    justify-content: stretch;
  }
  .account-actions .btn {
    flex: 1 1 120px;
    min-width: 0;
  }
}

/* Accent-bearing controls share the palette while status colors stay semantic. */
.seg button.on,
.subtab.active {
  color: var(--on-accent);
  background: linear-gradient(135deg, var(--accent), rgba(var(--accent-rgb), 0.76));
}
.tab.active,
.side-user.active {
  color: var(--txt);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.24);
}
.sidebar .tab.active::before {
  background: var(--accent);
}
.account-role-switcher::before {
  background: linear-gradient(135deg, var(--accent), rgba(var(--accent-rgb), 0.76));
}
.account-role-tab.active {
  color: var(--on-accent);
}
.account-role-tab.active small {
  color: color-mix(in srgb, var(--on-accent) 66%, transparent);
}
.lead-check:checked,
.lead-select-all input:checked {
  border-color: var(--accent);
  background: var(--accent);
}
