/* SEO Genius — web-new stylesheet. Single dark :root (cascade flattened from prior 3-block build). */
:root {
  --bg: #080a10;
  --bg2: #0c0f17;
  --rail: rgba(12, 15, 21, .72);
  --card: #13161f;
  --card-glass: rgba(19, 22, 31, .72);
  --card2: #1a1e29;
  --card3: #232838;
  --border: rgba(255, 255, 255, .075);
  --border-strong: rgba(255, 255, 255, .15);
  --soft: #1a1e29;
  --text: #eef1f7;
  --muted: #9aa4b6;
  --faint: #606b7e;
  --accent: #fc3f1d;
  --accent2: #ff824c;
  --green: #33e08a;
  --blue: #5b8dff;
  --teal: #19cbb6;
  --amber: #ffb638;
  --purple: #a78bfa;
  --grad-accent: linear-gradient(135deg, #fc3f1d 0%, #ff824c 100%);
  --grad-teal: linear-gradient(135deg, #19cbb6 0%, #37e0c0 100%);
  --grad-head: linear-gradient(100deg, #ffffff 0%, #cfd6e6 60%, #9aa4b6 100%);
  --radius: 18px;
  --radius-sm: 13px;
  --radius-xs: 9px;
  --shadow: 0 26px 60px -42px rgba(0, 0, 0, .85);
  --shadow-glow: 0 10px 26px -12px rgba(252, 63, 29, .4);
  --shadow-teal: 0 10px 26px -12px rgba(25, 203, 182, .38);
  --surface: var(--card);
  --surface-2: rgba(24, 28, 37, .96);
  --surface-3: rgba(32, 38, 50, .94);
  --accent-2: var(--accent2);
  --r: var(--radius);
  --r-sm: var(--radius-sm);
  --r-xs: var(--radius-xs);
  --pad: 22px;
  --gap: 18px;
  --sh-card: 0 2px 0 rgba(255, 255, 255, .02) inset, 0 26px 55px -46px rgba(0, 0, 0, .9);
  --chrome-line: rgba(255,255,255,.075);
  --font-ui: Manrope, "Segoe UI", Arial, sans-serif;
  --font-brand: "Unbounded", Manrope, "Segoe UI", Arial, sans-serif;
  --focus: rgba(255, 63, 47, .28);
  --surface-1: rgba(18, 21, 28, .96);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --z-nav: 80;
  --z-modal: 110;
  --z-toast: 130;
}

:root[data-theme="light"] {
  --bg: #f3f6fb;
  --bg2: #eef3f9;
  --rail: rgba(255, 255, 255, .86);
  --card: #ffffff;
  --card-glass: rgba(255, 255, 255, .86);
  --card2: #f5f7fb;
  --card3: #eef2f8;
  --border: #d7deea;
  --border-strong: #c5cfdf;
  --soft: #e4e9f2;
  --text: #182231;
  --muted: #637083;
  --faint: #8b96a7;
  --grad-head: linear-gradient(100deg, #101827 0%, #4b5567 70%, #8b96a7 100%);
  --shadow: 0 20px 44px -34px rgba(45, 56, 75, .42);
  --shadow-glow: 0 12px 28px -16px rgba(252, 63, 29, .34);
  --shadow-teal: 0 12px 28px -16px rgba(23, 201, 182, .32);
}

@font-face {
  font-family: "Unbounded";
  src: url("fonts/Unbounded-Bold.ttf") format("truetype");
  font-weight: 700 900;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  color: var(--text);
  font-family: Manrope, "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(1100px 560px at 88% -8%, rgba(252, 63, 29, .045), transparent 60%),
    radial-gradient(960px 680px at -5% 105%, rgba(23, 201, 182, .035), transparent 55%),
    linear-gradient(180deg, var(--bg2), var(--bg));
  background-attachment: fixed;
}
:root[data-theme="light"] body {
  background:
    radial-gradient(900px 520px at 92% -8%, rgba(252, 63, 29, .08), transparent 62%),
    radial-gradient(920px 620px at -8% 100%, rgba(23, 201, 182, .08), transparent 58%),
    linear-gradient(180deg, var(--bg2), var(--bg));
}
::selection { background: rgba(252, 63, 29, .32); }

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb { background: #2a3140; border-radius: 20px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #3a4356; background-clip: content-box; }

button, input, textarea, select, table { font-family: Manrope, "Segoe UI", Arial, sans-serif; }
input, textarea, select { font-weight: 700; }
button { transition: transform .16s cubic-bezier(.2,.7,.3,1), box-shadow .18s ease, background .18s ease, border-color .18s ease, color .18s ease, filter .18s ease; }
a { color: inherit; }

/* ---------------- boot preloader ---------------- */
.preloader {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  background:
    linear-gradient(135deg, rgba(252,63,29,.14), transparent 34%),
    linear-gradient(225deg, rgba(23,201,182,.13), transparent 34%),
    linear-gradient(180deg, #0d1017, #07090d);
  transition: opacity .32s ease, visibility .32s ease;
}
.preloader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.preloader::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(circle at 50% 45%, #000 0%, transparent 68%);
}
.preloader-core {
  position: relative; width: min(360px, calc(100vw - 44px));
  display: grid; justify-items: center; gap: 10px; padding: 34px 30px;
  border: 1px solid rgba(255,255,255,.12); border-radius: 12px;
  background: linear-gradient(180deg, rgba(25,30,41,.86), rgba(14,17,24,.88));
  box-shadow: 0 32px 80px -34px rgba(0,0,0,.95), 0 0 38px -24px rgba(23,201,182,.4);
}
.preloader-core img {
  width: 78px; height: 78px; object-fit: contain;
  filter: drop-shadow(0 16px 24px rgba(23,201,182,.18));
  animation: logoPulse 1.9s ease-in-out infinite;
}
.preloader-core strong { font: 900 24px "Unbounded", Inter, sans-serif; color: var(--text); }
.preloader-core span { color: var(--muted); font-weight: 800; font-size: 13px; }
.preloader-bar {
  width: 100%; height: 7px; margin-top: 12px; border-radius: 99px;
  background: rgba(255,255,255,.07); overflow: hidden;
}
.preloader-bar i {
  display: block; width: 44%; height: 100%; border-radius: inherit;
  background: var(--grad-teal); box-shadow: 0 0 18px rgba(23,201,182,.55);
  animation: preloaderSlide 1.25s ease-in-out infinite;
}
@keyframes preloaderSlide {
  0% { transform: translateX(-115%); }
  55% { transform: translateX(80%); }
  100% { transform: translateX(250%); }
}
@keyframes logoPulse {
  0%, 100% { transform: translateY(0) scale(1); opacity: .92; }
  50% { transform: translateY(-2px) scale(1.035); opacity: 1; }
}

/* ---------------- sidebar ---------------- */
.rail {
  width: 262px;
  min-height: 100vh;
  height: 100vh;
  padding: 22px 16px;
  background: var(--rail);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-right: 1px solid var(--border);
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 5;
  overflow: hidden;
}
.brand {
  display: flex;
  gap: 13px;
  align-items: center;
  padding: 6px 8px 20px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--soft);
  flex: none;
}
.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: transparent;
}
.brand-mark img { width: 100%; height: 100%; object-fit: contain; display: block; }
.brand strong { display: block; font-size: 15.5px; font-family: "Unbounded", sans-serif; letter-spacing: 0; }
.brand span { color: var(--faint); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0; }
.muted { color: var(--faint); font-size: 12px; font-weight: 700; }

.rail-nav {
  min-height: 0;
  flex: 1 1 auto;
  display: grid;
  align-content: start;
  gap: 4px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
  margin-right: -4px;
}
.rail-nav::-webkit-scrollbar { width: 6px; }
.rail-nav::-webkit-scrollbar-thumb { border-width: 1px; }

.nav {
  position: relative;
  width: 100%;
  border: 0;
  color: var(--muted);
  background: transparent;
  text-align: left;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
}
.rail-nav .nav:first-of-type { margin-top: 2px; }
.rail-nav .nav:last-of-type { margin-bottom: 8px; }
.nav svg { width: 20px; height: 20px; flex: none; opacity: .85; transition: transform .18s ease; }
.nav:hover { color: var(--text); background: rgba(255,255,255,.035); transform: none; }
.nav:hover svg { transform: translateX(1px) scale(1.05); }
.nav.active {
  color: #fff;
  background: linear-gradient(100deg, rgba(252,63,29,.18), rgba(252,63,29,.05) 70%);
  box-shadow: inset 0 0 0 1px rgba(252,63,29,.22);
}
.nav.active svg { opacity: 1; color: var(--accent2); filter: drop-shadow(0 0 6px rgba(252,63,29,.5)); }
.nav.active::before {
  content: "";
  position: absolute; left: -16px; top: 50%; transform: translateY(-50%);
  width: 4px; height: 22px; border-radius: 0 4px 4px 0; background: var(--grad-accent);
  box-shadow: 0 0 10px rgba(252,63,29,.5);
}
.nav-group { display: grid; gap: 4px; }
.nav-parent {
  list-style: none;
  user-select: none;
}
.nav-parent::-webkit-details-marker { display: none; }
.nav-parent b {
  width: 8px;
  height: 8px;
  margin-left: auto;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  opacity: .65;
  transition: transform .18s ease;
}
.nav-group[open] .nav-parent b { transform: rotate(225deg); }
.nav-group.active > .nav-parent {
  color: #fff;
  background: linear-gradient(100deg, rgba(252,63,29,.13), rgba(252,63,29,.04) 70%);
}
.nav-sub {
  display: grid;
  gap: 4px;
  padding-left: 13px;
  margin-left: 10px;
  border-left: 1px solid var(--soft);
}
.nav-sub .nav {
  min-height: 39px;
  padding: 9px 11px;
  font-size: 12px;
}
.nav-sub .nav svg { width: 17px; height: 17px; }
.rail-foot {
  flex: none; margin-top: auto; padding: 14px 0 2px;
  color: var(--faint); font-size: 11px; font-weight: 700; display: grid; gap: 12px;
  background: linear-gradient(180deg, transparent, rgba(16,19,25,.96) 18%);
}
.rail-user { display: grid; grid-template-columns: 38px 1fr; gap: 10px; align-items: center; padding: 0 4px; }
.rail-user strong { display: block; color: var(--text); font-size: 12px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-user span { display: block; color: var(--faint); font-size: 11px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-avatar {
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 999px;
  background: var(--grad-teal); color: #06201d; font-weight: 900; font-family: "Unbounded", sans-serif;
}
.ready-widget {
  position: relative; display: grid; grid-template-columns: 34px 1fr 8px; gap: 10px; align-items: center;
  padding: 12px; border: 1px solid var(--border); border-radius: 11px; background: var(--card2);
}
.ready-widget .ready-icon { width: 28px; height: 28px; display: grid; place-items: center; color: var(--teal); background: rgba(23,201,182,.13); border-radius: 11px; }
.ready-widget .ready-icon svg { width: 16px; height: 16px; }
.ready-widget span { display: block; font-size: 10.5px; color: var(--faint); }
.ready-widget strong { display: block; color: var(--green); font-size: 18px; line-height: 1.05; font-family: "Unbounded", sans-serif; }
.ready-widget small { display: block; margin-top: 2px; color: var(--faint); font-size: 10.5px; }
.ready-widget i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 9px rgba(46,224,138,.75); }
.rail-locale, .rail-product { text-align: center; color: var(--faint); font-size: 11px; }
.rail-locale { color: var(--muted); }

/* ---------------- main ---------------- */
.main {
  flex: 1;
  padding: 30px 34px 60px;
  min-width: 0;
  max-width: 1520px;
  animation: fade .4s ease both;
}
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 26px;
}
h1, h2, h3, p { margin: 0; }
h1, h2, h3, .brand strong { font-family: "Unbounded", Manrope, "Segoe UI", Arial, sans-serif; }
h1 {
  font-size: 27px; line-height: 1.1; font-weight: 900; letter-spacing: 0;
  color: var(--text);
}
h2 { font-size: 19px; }
h3 { font-size: 15px; letter-spacing: 0; }
#viewSubtitle { margin-top: 7px; color: var(--faint); font-weight: 600; font-size: 13.5px; }
.userbox { display: flex; align-items: center; gap: 12px; color: var(--muted); font-weight: 800; font-size: 13px; }
.userbox > span { padding: 8px 12px; background: var(--card-glass); border: 1px solid var(--border); border-radius: 999px; }
.theme-toggle {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card-glass);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}
.theme-toggle:hover { color: var(--text); border-color: var(--border-strong); transform: translateY(-1px); }

/* ---------------- grid & cards ---------------- */
.dash-hero {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 28px 30px; border: 1px solid var(--border); border-radius: var(--radius);
  background: linear-gradient(90deg, rgba(23,201,182,.08), rgba(75,141,255,.04), transparent);
  box-shadow: var(--shadow);
}
.dash-hero h2 { font-size: 26px; line-height: 1.15; }
.dash-hero p { margin-top: 8px; color: var(--muted); font-weight: 700; }
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.grid.two { grid-template-columns: 1.4fr 1fr; }
.profile-folder-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin: 0 0 16px;
  padding: 0;
}
.folder-jump {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 12px;
  align-items: center;
  min-height: 72px;
  padding: 14px 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow), inset 0 1px 0 var(--chrome-line);
  overflow: hidden;
}
.folder-jump::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 0;
  height: 2px;
  border-radius: 999px 999px 0 0;
  background: transparent;
  transition: background .18s ease, transform .18s ease;
  transform: scaleX(.65);
}
.folder-jump span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 900;
}
.folder-jump strong {
  min-width: 34px;
  min-height: 30px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--card3);
  color: var(--muted);
  font-family: "Unbounded", sans-serif;
  font-size: 12px;
}
.folder-jump small {
  grid-column: 1 / -1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--faint);
  font-size: 11px;
  font-weight: 800;
}
.folder-jump:hover,
.folder-jump.active {
  transform: translateY(-1px);
}
.folder-jump:hover {
  border-color: var(--border-strong);
  background: var(--card2);
  box-shadow: 0 20px 42px -34px rgba(0,0,0,.9), inset 0 1px 0 var(--chrome-line);
}
.folder-jump.active {
  border-color: rgba(252,63,29,.54);
  background:
    linear-gradient(135deg, rgba(252,63,29,.18), rgba(252,63,29,.045) 62%),
    var(--card);
  box-shadow: 0 22px 48px -34px rgba(252,63,29,.7), inset 0 1px 0 var(--chrome-line);
}
.folder-jump.active::after {
  background: var(--grad-accent);
  transform: scaleX(1);
}
.folder-jump.active strong {
  background: var(--grad-accent);
  color: #fff;
  box-shadow: 0 10px 22px -14px rgba(252,63,29,.9);
}
:root[data-theme="light"] .folder-jump {
  background: #fff;
}
:root[data-theme="light"] .folder-jump:hover {
  background: #fff;
}
:root[data-theme="light"] .folder-jump.active {
  background:
    linear-gradient(135deg, rgba(252,63,29,.105), rgba(252,63,29,.028) 64%),
    #fff;
}
.profile-folders { display: grid; gap: 18px; }
.profile-folder { scroll-margin-top: 112px; }
.profile-folder .section-head { align-items: flex-start; }
.profile-folder.drag-over {
  border-color: rgba(255, 63, 47, .72);
  box-shadow: 0 0 0 1px rgba(255, 63, 47, .34), 0 28px 70px -42px rgba(255, 63, 47, .72);
}
.profile-folder.is-focused {
  animation: folderFocus .9s cubic-bezier(.22,1,.36,1);
}
@keyframes folderFocus {
  0% { box-shadow: 0 0 0 0 rgba(252,63,29,0), var(--shadow); }
  34% { box-shadow: 0 0 0 3px rgba(252,63,29,.28), 0 24px 58px -38px rgba(252,63,29,.72); }
  100% { box-shadow: var(--shadow); }
}
.profile-row { cursor: grab; }
.profile-row.dragging { opacity: .52; }
.profile-row:active { cursor: grabbing; }
.warmup-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.warmup-grid textarea { min-height: 104px; }
.card {
  position: relative;
  background: var(--card-glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 1px; border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.12), transparent);
}
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.label { color: var(--muted); font-weight: 800; font-size: 12px; }

/* stat cards */
.stat { min-height: 138px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
.stat::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: linear-gradient(90deg, rgba(23,201,182,.65), rgba(75,141,255,.35), transparent);
  pointer-events: none;
}
.stat-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.stat-top span { color: var(--muted); font-weight: 800; font-size: 12px; }
.stat-icon {
  width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center;
  color: var(--teal); background: rgba(23,201,182,.13); box-shadow: inset 0 0 0 1px rgba(23,201,182,.22);
}
.stat-icon svg { width: 21px; height: 21px; }
.stat.a .stat-icon { color: var(--accent2); background: rgba(252,63,29,.13); box-shadow: inset 0 0 0 1px rgba(252,63,29,.22); }
.stat.b .stat-icon { color: var(--blue); background: rgba(75,141,255,.13); box-shadow: inset 0 0 0 1px rgba(75,141,255,.22); }
.stat.c .stat-icon { color: var(--amber); background: rgba(255,176,32,.13); box-shadow: inset 0 0 0 1px rgba(255,176,32,.22); }
.stat strong {
  display: block; font-family: "Unbounded", sans-serif; font-size: 34px; line-height: 1; margin-top: 10px; letter-spacing: 0;
}
.stat .sub { color: var(--faint); font-weight: 700; font-size: 12px; margin-top: 6px; }

/* ---------------- buttons ---------------- */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.btn {
  border: 0; border-radius: 11px; padding: 11px 17px; min-height: 42px;
  color: #fff; font-weight: 800; font-size: 13.5px; cursor: pointer;
  background: var(--grad-accent); box-shadow: var(--shadow-glow);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  max-width: 100%; white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.05); box-shadow: 0 14px 30px -14px rgba(252,63,29,.45); }
.btn:active { transform: translateY(0); }
.btn.teal {
  color: #fff;
  background: var(--grad-accent);
  box-shadow: var(--shadow-glow);
}
.btn.teal:hover { box-shadow: 0 14px 30px -14px rgba(252,63,29,.45); }
.btn.ghost {
  background: var(--card2); color: var(--muted); border: 1px solid var(--border); box-shadow: none;
}
.btn.ghost:hover { color: var(--text); border-color: var(--border-strong); background: var(--card3); filter: none; }
.btn.ghost.danger-text:hover { color: var(--accent); border-color: rgba(252,63,29,.5); }
.btn:disabled { opacity: .4; cursor: default; transform: none; box-shadow: none; filter: none; }
.btn svg { width: 17px; height: 17px; }
.btn.mini { min-height: 32px; padding: 7px 10px; font-size: 11px; }
.btn-spinner {
  width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255,255,255,.34);
  border-top-color: #fff; display: inline-block; animation: spin .75s linear infinite;
}

select {
  background: var(--card2); color: var(--text); border: 1px solid var(--border);
  border-radius: 11px; min-height: 42px; padding: 0 34px 0 14px; outline: none; font-weight: 700; cursor: pointer;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%2399a2b4' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M3 5l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
select:focus { border-color: var(--accent); }

/* ---------------- tables ---------------- */
.table-wrap { border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); background: var(--card-glass); box-shadow: var(--shadow); }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 14px 18px; border-bottom: 1px solid var(--soft); text-align: left; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table thead th { color: var(--faint); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0; font-weight: 900; background: rgba(255,255,255,.02); }
.table td { font-weight: 700; font-size: 13px; }
.table tbody tr { transition: background .15s ease; }
.table tbody tr:hover { background: rgba(255,255,255,.028); }
.mono { font-family: "JetBrains Mono", Consolas, monospace; font-size: 12.5px; color: var(--text); }

/* ---------------- pills ---------------- */
.pill {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 999px;
  font-weight: 800; font-size: 11px; background: rgba(153,162,180,.14); color: var(--muted); white-space: nowrap;
  border: 1px solid transparent;
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.pill.running, .pill.online, .pill.searching { background: rgba(75,141,255,.15); color: var(--blue); border-color: rgba(75,141,255,.25); }
.pill.done, .pill.ready, .pill.success, .pill.found { background: rgba(46,224,138,.14); color: var(--green); border-color: rgba(46,224,138,.25); }
.pill.stopped, .pill.warn, .pill.busy, .pill.warming, .pill.queued { background: rgba(255,176,32,.14); color: var(--amber); border-color: rgba(255,176,32,.25); }
.pill.error, .pill.offline, .pill.failed, .pill.not_found { background: rgba(252,63,29,.15); color: var(--accent); border-color: rgba(252,63,29,.28); }
.pill.idle { background: rgba(98,107,125,.16); color: var(--faint); }
.proxy-pill.free, .proxy-pill.used {
  background: rgba(46,224,138,.16); color: var(--green); border-color: rgba(46,224,138,.34);
}
.proxy-pill.dead {
  background: rgba(252,63,29,.17); color: var(--accent); border-color: rgba(252,63,29,.36);
}
.proxy-pill.unknown {
  background: rgba(98,107,125,.16); color: var(--faint); border-color: rgba(98,107,125,.22);
}
.proxy-new-box {
  display: grid;
  gap: 12px;
}

/* ---------------- campaign cards ---------------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.campaign-card {
  cursor: pointer; display: flex; flex-direction: column; gap: 4px; min-height: 190px;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.campaign-card:hover { transform: translateY(-3px); border-color: rgba(23,201,182,.5); box-shadow: 0 24px 48px -26px rgba(23,201,182,.5); }
.campaign-card h3 { margin-bottom: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.campaign-card-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: start; }
.campaign-title { min-width: 0; }
.campaign-actions {
  display: flex; justify-content: flex-end; align-items: center; gap: 7px; margin-top: auto; padding-top: 14px;
  border-top: 1px solid var(--soft);
}
.campaign-actions .icon-btn { background: rgba(255,255,255,.025); }
.campaign-edit-btn { flex: 1 1 auto; min-width: 148px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.mini-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.campaign-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.campaign-metrics .metric { min-width: 0; }
.campaign-profile-strip {
  grid-column: 1 / -1;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border: 1px solid rgba(75,141,255,.24);
  border-radius: 11px;
  color: var(--muted);
  border-color: rgba(75,141,255,.24);
  background:
    linear-gradient(180deg, rgba(75,141,255,.08), transparent),
    var(--card2);
}
.campaign-profile-strip span {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}
.campaign-profile-strip strong {
  font-family: "Unbounded", sans-serif;
  color: var(--text);
  font-size: 18px;
  line-height: 1;
}
.campaign-profile-strip small,
.campaign-profile-strip em {
  color: var(--faint);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.2;
}
.campaign-profile-strip em {
  flex: none;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(75,141,255,.12);
  color: var(--blue);
}
.campaign-card .progress {
  flex: none;
  margin-top: 12px;
}
.metric { background: var(--card2); border: 1px solid var(--border); border-radius: 11px; padding: 12px 14px; }
.metric strong { display: block; font-size: 18px; font-family: "Unbounded", sans-serif; }
.metric span { color: var(--faint); font-weight: 700; font-size: 11px; }
.queue-card { margin-top: 18px; }
.queue-legend { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin-bottom: 14px; color: var(--muted); font-size: 12px; font-weight: 700; }
.queue-legend span { display: inline-flex; align-items: center; gap: 7px; }
.queue-legend i { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); }
.queue-legend strong { color: var(--text); }
.queue-legend small { color: var(--faint); }
.queue-legend .blue i { background: var(--blue); }
.queue-legend .warn i { background: var(--amber); }
.queue-legend .success i { background: var(--green); }
.queue-legend .error i { background: var(--accent); }
.queue-bar { height: 12px; border-radius: 99px; display: flex; overflow: hidden; background: rgba(255,255,255,.06); }
.queue-bar i { min-width: 0; height: 100%; }
.queue-bar .planned { background: var(--faint); }
.queue-bar .ready { background: var(--blue); }
.queue-bar .processing { background: var(--amber); }
.queue-bar .done { background: var(--green); }

/* ---------------- agent cards ---------------- */
.agent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 18px;
}
.agent-card {
  display: grid;
  gap: 17px;
  min-height: 224px;
  overflow: hidden;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.agent-card:hover {
  transform: translateY(-3px);
  border-color: rgba(75,141,255,.45);
  box-shadow: 0 24px 48px -26px rgba(75,141,255,.48);
}
.agent-card.online:hover { border-color: rgba(46,224,138,.42); box-shadow: 0 24px 48px -26px rgba(46,224,138,.45); }
.agent-card.busy:hover { border-color: rgba(255,176,32,.42); box-shadow: 0 24px 48px -26px rgba(255,176,32,.44); }
.agent-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.agent-device {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}
.agent-device > span {
  width: 46px;
  height: 46px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: var(--blue);
  background: rgba(75,141,255,.12);
  border: 1px solid rgba(75,141,255,.24);
}
.agent-card.online .agent-device > span { color: var(--green); background: rgba(46,224,138,.12); border-color: rgba(46,224,138,.24); }
.agent-card.busy .agent-device > span { color: var(--amber); background: rgba(255,176,32,.12); border-color: rgba(255,176,32,.24); }
.agent-device svg { width: 22px; height: 22px; }
.agent-device h3 {
  margin: 0 0 5px;
  font-size: 18px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.agent-device p { margin: 0; color: var(--faint); }
.agent-profile-meter {
  height: 12px;
  display: flex;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.055);
}
.agent-profile-meter i {
  min-width: 0;
  height: 100%;
  transition: opacity .25s ease, filter .25s ease;
}
.agent-profile-meter .ready { background: var(--green); }
.agent-profile-meter .running { background: var(--blue); }
.agent-profile-meter .warming { background: var(--amber); }
.agent-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.agent-stats span {
  min-width: 0;
  padding: 12px 10px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--card2);
}
.agent-stats strong {
  display: block;
  font-family: "Unbounded", sans-serif;
  font-size: 20px;
  line-height: 1;
}
.agent-stats small {
  display: block;
  margin-top: 6px;
  color: var(--faint);
  font-size: 10.5px;
  font-weight: 800;
}
.agent-card-foot {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--soft);
}
.agent-card-foot span { min-width: 0; }
.agent-card-foot small {
  display: block;
  color: var(--faint);
  font-size: 10.5px;
  font-weight: 800;
  margin-bottom: 3px;
}
.agent-card-foot strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
}

/* Direct VPS-to-VPS profile transfer. */
.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.profile-transfer-form {
  width: 100%;
  display: grid;
  gap: 16px;
}
.profile-transfer-card.modal-card {
  width: min(760px, calc(100vw - 32px));
  max-width: 760px;
}
.transfer-route {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr);
  align-items: end;
  gap: 10px;
}
.transfer-arrow {
  height: 42px;
  display: grid;
  place-items: center;
  color: var(--accent);
  font-size: 20px;
}
.transfer-fields {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) 110px minmax(0, 1fr);
  gap: 10px;
}
.transfer-overwrite {
  width: fit-content;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.transfer-overwrite input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.transfer-overwrite span {
  position: relative;
  width: 38px;
  height: 22px;
  flex: none;
  border-radius: 999px;
  background: var(--surface-3);
  box-shadow: inset 0 0 0 1px var(--border-strong);
  transition: background .2s var(--ease-out), box-shadow .2s var(--ease-out);
}
.transfer-overwrite span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform .22s var(--ease-out), background .2s var(--ease-out);
}
.transfer-overwrite input:checked + span {
  background: rgba(255,63,47,.2);
  box-shadow: inset 0 0 0 1px rgba(255,63,47,.55);
}
.transfer-overwrite input:checked + span::after {
  transform: translateX(16px);
  background: var(--accent);
}
.transfer-overwrite input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.transfer-overwrite b {
  font-size: 12px;
}
.transfer-note {
  padding: 11px 12px;
  border-radius: 11px;
  background: var(--surface-2);
  color: var(--faint);
  font-size: 12px;
  line-height: 1.5;
}
.transfer-progress {
  display: grid;
  gap: 8px;
}
.transfer-progress[hidden] { display: none; }
.transfer-progress > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
}
.transfer-progress > div:first-child span {
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.profile-transfer-form .modal-actions {
  margin-top: 2px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
@media (max-width: 680px) {
  .profile-transfer-form { width: auto; }
  .transfer-route { grid-template-columns: 1fr; }
  .transfer-arrow { height: 18px; transform: rotate(90deg); }
  .transfer-fields { grid-template-columns: minmax(0, 1fr) 92px; }
  .transfer-host { grid-column: 1 / -1; }
  .toolbar-actions { width: 100%; }
  .toolbar-actions .btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .transfer-overwrite span,
  .transfer-overwrite span::after { transition: none; }
}
.command-collapse {
  margin-top: 18px;
  padding: 0;
  overflow: hidden;
}
.command-collapse summary {
  list-style: none;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 20px;
  cursor: pointer;
  font-weight: 900;
}
.command-collapse summary::-webkit-details-marker { display: none; }
.command-collapse summary::after {
  content: "";
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform .18s ease, border-color .18s ease;
}
.command-collapse[open] summary::after {
  transform: rotate(225deg) translate(-2px, -2px);
  border-color: var(--text);
}
.command-collapse summary span { font-size: 18px; }
.command-collapse summary b {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card2);
}
.command-collapse > .table-wrap,
.command-collapse > .empty {
  margin: 0 20px 20px;
}
.queue-bar .errors { background: var(--accent); }
.quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.quick-action {
  min-height: 116px; border: 1px solid var(--border); border-radius: 11px; background: var(--card2);
  color: var(--text); text-align: left; padding: 16px; cursor: pointer; display: grid; align-content: start; gap: 8px;
}
.quick-action:hover { border-color: var(--border-strong); background: var(--card3); transform: translateY(-1px); }
.quick-action span { width: 34px; height: 34px; display: grid; place-items: center; color: var(--teal); background: rgba(23,201,182,.13); border-radius: 11px; }
.quick-action svg { width: 18px; height: 18px; }
.quick-action strong { font-size: 13px; font-family: "Unbounded", sans-serif; }
.quick-action small { color: var(--muted); font-weight: 700; }
.system-card { display: grid; gap: 4px; }
.system-line { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 10px 2px; color: var(--muted); font-size: 13px; font-weight: 700; }
.system-line strong { color: var(--text); }

/* ---------------- settings ---------------- */
.settings-page { display: grid; gap: 18px; }
.settings-hero {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 20px;
  padding: 22px; border: 1px solid var(--border); border-radius: 11px;
  background: linear-gradient(135deg, rgba(252,63,29,.12), rgba(23,201,182,.06) 48%, rgba(255,255,255,.02));
  box-shadow: var(--shadow); overflow: hidden; position: relative;
}
.settings-hero::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 2px;
  background: linear-gradient(90deg, rgba(252,63,29,.72), rgba(23,201,182,.5), transparent);
}
.settings-kicker { display: block; margin-bottom: 8px; color: var(--teal); font-size: 11px; font-weight: 900; text-transform: uppercase; }
.settings-hero h2 { font-size: 26px; margin-bottom: 8px; }
.settings-hero p { color: var(--muted); font-weight: 700; max-width: 660px; line-height: 1.5; }
.settings-summary { display: grid; grid-template-columns: repeat(3, minmax(96px, 1fr)); gap: 10px; min-width: 360px; }
.settings-summary span {
  min-height: 76px; padding: 12px; border: 1px solid var(--border); border-radius: 11px;
  background: rgba(15,18,26,.58); display: grid; align-content: center; gap: 4px;
}
.settings-summary strong { font-family: "Unbounded", sans-serif; font-size: 17px; }
.settings-summary small { color: var(--faint); font-weight: 800; font-size: 11px; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.settings-panel {
  padding: 18px; border: 1px solid var(--border); border-radius: 11px;
  background: var(--card-glass); box-shadow: var(--shadow);
}
.settings-panel.compact { align-self: stretch; }
.settings-panel.wide { grid-column: 1 / -1; }
.settings-panel-head {
  display: grid; grid-template-columns: 42px 1fr; gap: 13px; align-items: start;
  padding-bottom: 14px; margin-bottom: 16px; border-bottom: 1px solid var(--soft);
}
.settings-panel-head h3 { font-size: 16px; margin-bottom: 5px; }
.settings-panel-head p { color: var(--muted); font-size: 12.5px; font-weight: 700; line-height: 1.45; }
.settings-panel-icon {
  width: 42px; height: 42px; display: grid; place-items: center; border-radius: 11px;
  color: var(--teal); background: rgba(23,201,182,.13); border: 1px solid rgba(23,201,182,.22);
}
.settings-panel-icon svg { width: 20px; height: 20px; }
.settings-panel-icon.amber { color: var(--amber); background: rgba(255,176,32,.12); border-color: rgba(255,176,32,.22); }
.settings-panel-icon.blue { color: var(--blue); background: rgba(75,141,255,.12); border-color: rgba(75,141,255,.22); }
.settings-panel-icon.green { color: var(--green); background: rgba(46,224,138,.12); border-color: rgba(46,224,138,.22); }
.settings-body { display: grid; gap: 14px; }
.settings-form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.settings-form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.settings-panel:not(.wide) .settings-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.settings-panel:not(.wide) .field { min-width: 0; }
.settings-note { color: var(--faint); font-size: 12px; font-weight: 700; margin-top: 9px; line-height: 1.45; }
.settings-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.settings-import { align-items: center; }
.settings-import + .btn { justify-content: center; }
.settings-segmented { max-width: 420px; }

/* ---------------- member stats ---------------- */
.stats-page { display: grid; gap: 18px; }
.stats-hero .settings-summary { grid-template-columns: repeat(3, minmax(110px, 1fr)); }
.stats-kpis { margin-top: 0; }
.member-picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.member-picker-card {
  border: 1px solid var(--border); color: var(--text); cursor: pointer; text-align: left;
  display: grid; gap: 16px; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.member-picker-card:hover {
  transform: translateY(-3px); border-color: rgba(252,63,29,.5);
  box-shadow: 0 24px 48px -28px rgba(252,63,29,.55);
}
.picker-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.picker-stats span {
  min-height: 64px; display: grid; align-content: center; gap: 3px; padding: 10px;
  border-radius: 11px; border: 1px solid var(--border); background: var(--card2);
}
.picker-stats strong { font-family: "Unbounded", sans-serif; font-size: 17px; line-height: 1; }
.picker-stats small { color: var(--faint); font-size: 10.5px; font-weight: 800; }
.picker-foot {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding-top: 12px; border-top: 1px solid var(--soft); color: var(--muted); font-size: 12px; font-weight: 800;
}
.picker-foot b { color: var(--accent2); font-family: "Unbounded", sans-serif; font-size: 11px; }
.member-list { display: grid; gap: 18px; }
.member-card { display: grid; gap: 18px; overflow: hidden; }
.member-card.detailed { max-width: none; }
.member-card::after {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, rgba(23,201,182,.58), rgba(252,63,29,.48), transparent);
}
.member-head {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding-bottom: 16px; border-bottom: 1px solid var(--soft);
}
.member-person { display: flex; align-items: center; gap: 14px; min-width: 0; }
.member-person img, .member-avatar {
  width: 56px; height: 56px; border-radius: 12px; flex: none; object-fit: cover;
  border: 1px solid var(--border-strong); background: var(--card2);
}
.member-avatar {
  display: grid; place-items: center; color: var(--teal); font-family: "Unbounded", sans-serif;
  font-size: 20px; font-weight: 900; box-shadow: inset 0 0 0 1px rgba(23,201,182,.14);
}
.member-person h3 { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.admin-badge {
  display: inline-flex; align-items: center; min-height: 22px; padding: 4px 8px; border-radius: 999px;
  background: rgba(252,63,29,.12); color: var(--accent2); border: 1px solid rgba(252,63,29,.24);
  font: 800 10px Inter, sans-serif; text-transform: uppercase;
}
.member-score {
  min-width: 114px; padding: 12px 14px; border-radius: 11px; border: 1px solid var(--border);
  background: rgba(255,255,255,.025); text-align: right;
}
.member-score strong { display: block; font-family: "Unbounded", sans-serif; font-size: 24px; line-height: 1; }
.member-score span { color: var(--faint); font-size: 11px; font-weight: 800; }
.member-metrics {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px;
}
.member-metric {
  min-height: 94px; display: grid; align-content: center; gap: 4px; padding: 13px;
  border: 1px solid var(--border); border-radius: 11px; background: var(--card2);
}
.member-metric strong { font-family: "Unbounded", sans-serif; font-size: 21px; line-height: 1; }
.member-metric span { color: var(--text); font-size: 12px; font-weight: 800; }
.member-metric small { color: var(--faint); font-size: 11px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.member-panel {
  padding: 14px; border-radius: 11px; border: 1px solid var(--border);
  background: rgba(255,255,255,.018); display: grid; gap: 12px;
}
.mini-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.mini-head strong { font-family: "Unbounded", sans-serif; font-size: 13px; }
.mini-head span { color: var(--faint); font-size: 11px; font-weight: 800; }
.split-bars { display: grid; gap: 10px; }
.split-line { display: grid; gap: 7px; }
.split-line div { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 12px; font-weight: 800; }
.split-line strong { color: var(--text); }
.split-line i { display: block; height: 7px; border-radius: 99px; overflow: hidden; background: rgba(255,255,255,.06); }
.split-line b { display: block; height: 100%; border-radius: inherit; background: var(--teal); }
.split-line.amber b { background: var(--amber); }
.split-line.blue b { background: var(--blue); }
.split-line.red b { background: var(--accent); }
.command-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.command-grid span {
  min-height: 48px; display: grid; align-content: center; gap: 2px; padding: 9px;
  border-radius: 11px; background: var(--card2); color: var(--muted); font-size: 11px; font-weight: 800;
}
.command-grid b { color: var(--text); font-family: "Unbounded", sans-serif; font-size: 15px; }
.member-sites, .member-activity { display: grid; gap: 12px; }
.mini-regions { display: flex; flex-wrap: wrap; gap: 6px; }
.mini-regions span {
  display: inline-flex; align-items: center; gap: 5px; min-height: 25px; padding: 4px 8px;
  border-radius: 11px; border: 1px solid var(--border); background: var(--card2);
  color: var(--muted); font-size: 11px; font-weight: 800;
}
.mini-regions small { color: var(--faint); }
.compact-activity .activity-row { grid-template-columns: 120px 160px 1fr 1fr 1fr; }

/* ---------------- checks ---------------- */
.checks-page { display: grid; gap: 18px; }
.checks-hero { align-items: flex-start; }
.check-select { min-width: 380px; }
.checks-control { align-items: flex-start; }
.check-domain-box { min-width: min(520px, 100%); display: grid; gap: 10px; }
.check-keyline {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  min-height: 42px; padding: 9px 10px; border-radius: 11px; border: 1px solid var(--border); background: rgba(255,255,255,.018);
}
.check-keyline span { color: var(--muted); font-size: 12px; font-weight: 800; }
.check-keyline strong { color: var(--text); font-family: "Unbounded", sans-serif; }
.check-preset .field { gap: 5px; }
.checks-actions-row {
  display: flex; gap: 12px; flex-wrap: wrap; align-items: center;
  padding: 14px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--card-glass); box-shadow: var(--shadow);
}
.checks-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(420px, .9fr); gap: 18px; align-items: start; }
.checks-main { min-width: 0; display: grid; gap: 16px; }
.checks-side { min-width: 0; position: sticky; top: 26px; }
.checks-side .audit-workspace { gap: 14px; }
.checks-side .audit-summary-card, .checks-side .audit-columns { grid-template-columns: 1fr; }
.checks-side .audit-score { margin: 0 auto; }
.checks-side .audit-counters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.checks-side .audit-prompt-card textarea { min-height: 260px; }
.audit-card { display: grid; gap: 14px; }
.audit-card textarea { min-height: 118px; }
.audit-workspace { display: grid; gap: 18px; }
.audit-summary-card {
  display: grid; grid-template-columns: 132px minmax(0, 1fr) minmax(220px, .45fr);
  gap: 18px; align-items: center;
}
.audit-columns { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(360px, .8fr); gap: 18px; align-items: start; }
.audit-problems, .audit-prompt-card { min-width: 0; }
.audit-score {
  width: 118px; height: 118px; border-radius: 50%; display: grid; place-items: center; align-content: center;
  margin: 0; border: 1px solid var(--border); background: radial-gradient(circle, rgba(255,255,255,.045), rgba(255,255,255,.015));
  box-shadow: inset 0 0 0 8px rgba(255,255,255,.035);
}
.audit-score strong { font-family: "Unbounded", sans-serif; font-size: 34px; line-height: 1; }
.audit-score span { color: var(--faint); font-size: 11px; font-weight: 800; }
.audit-score.success { color: var(--green); border-color: rgba(46,224,138,.28); box-shadow: inset 0 0 0 8px rgba(46,224,138,.1); }
.audit-score.warn { color: var(--amber); border-color: rgba(255,176,32,.3); box-shadow: inset 0 0 0 8px rgba(255,176,32,.1); }
.audit-score.error { color: var(--accent); border-color: rgba(252,63,29,.3); box-shadow: inset 0 0 0 8px rgba(252,63,29,.1); }
.audit-meta { display: grid; gap: 7px; min-width: 0; }
.audit-meta strong { font-family: "Unbounded", sans-serif; font-size: 18px; }
.audit-meta span { color: var(--muted); font-size: 12px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.audit-meta small { color: var(--faint); font-weight: 700; }
.audit-counters { display: grid; grid-template-columns: 1fr; gap: 8px; }
.audit-counters span {
  min-height: 34px; display: grid; place-items: center; border-radius: 11px; border: 1px solid var(--border);
  background: var(--card2); font-size: 11px; font-weight: 900;
}
.audit-snippet {
  grid-column: 1 / -1; display: flex; gap: 11px; align-items: flex-start; padding: 12px; border: 1px solid var(--border);
  border-radius: 11px; background: rgba(255,255,255,.018);
}
.audit-snippet img { width: 28px; height: 28px; object-fit: contain; flex: none; }
.audit-snippet strong { display: block; margin-bottom: 4px; color: #8ab4f8; font-size: 13px; }
.audit-snippet span { color: var(--muted); font-size: 12px; line-height: 1.35; }
.audit-findings { display: grid; gap: 8px; max-height: 520px; overflow: auto; padding-right: 3px; }
.audit-finding {
  display: grid; gap: 6px; padding: 11px; border-radius: 11px; border: 1px solid var(--border);
  background: var(--card2);
}
.audit-finding div { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.audit-finding strong { font-size: 12.5px; line-height: 1.35; }
.audit-finding span { color: var(--faint); font-size: 10.5px; font-weight: 900; text-transform: uppercase; }
.audit-finding p { color: var(--muted); font-size: 12px; line-height: 1.4; }
.audit-finding.ok { border-color: rgba(46,224,138,.18); }
.audit-finding.warn { border-color: rgba(255,176,32,.24); }
.audit-finding.error { border-color: rgba(252,63,29,.28); }
.audit-history { display: grid; gap: 9px; padding-top: 12px; border-top: 1px solid var(--soft); }
.audit-history > strong { font-family: "Unbounded", sans-serif; font-size: 13px; }
.audit-history > div { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.audit-history span {
  display: grid; gap: 3px; min-height: 62px; padding: 9px; border-radius: 11px; border: 1px solid var(--border);
  background: rgba(255,255,255,.018);
}
.audit-history b { font-family: "Unbounded", sans-serif; font-size: 17px; }
.audit-history small, .audit-history i { color: var(--faint); font-size: 10.5px; font-style: normal; font-weight: 800; }
.audit-prompt-card textarea {
  width: 100%; min-height: 420px; resize: vertical;
  border-radius: 11px; border: 1px solid var(--border); background: var(--card2);
  color: var(--text); padding: 13px; outline: none; line-height: 1.45;
}
.audit-brief {
  display: grid; gap: 8px; margin-bottom: 12px; padding: 12px;
  border-radius: 11px; border: 1px solid var(--border); background: rgba(255,255,255,.018);
}
.audit-brief strong { font-family: "Unbounded", sans-serif; font-size: 13px; }
.audit-brief p, .audit-brief li { color: var(--muted); font-size: 12px; line-height: 1.45; }
.audit-brief ul { margin: 0; padding-left: 18px; }

/* ---------------- metrika ---------------- */
.metrika-page { display: grid; gap: 18px; }
.metrika-page.compact { gap: 12px; }
.metrika-hero { align-items: flex-end; }
.metrika-summary { grid-template-columns: repeat(3, minmax(98px, 1fr)); }
.metrika-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.metrika-info {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.metrika-info span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(255,255,255,.02);
}
.metrika-info strong {
  margin-right: 5px;
  color: var(--text);
  font-family: "Unbounded", sans-serif;
  font-size: 12px;
}
.metrika-layout {
  display: grid;
  grid-template-columns: minmax(340px, 390px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.metrika-layout.compact {
  grid-template-columns: minmax(270px, 340px) minmax(0, 1fr);
  gap: 12px;
}
.metrika-side { position: sticky; top: 26px; min-width: 0; overflow: hidden; }
.metrika-layout.compact .metrika-side,
.metrika-layout.compact .metrika-main { padding: 16px; }
.metrika-connect-only {
  width: min(520px, 100%);
  margin: 0 auto;
}
.metrika-side .field,
.metrika-side input,
.metrika-side select { min-width: 0; }
.metrika-side .settings-form-grid { grid-template-columns: 1fr; }
.metrika-side .settings-form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.settings-panel-icon.red {
  color: var(--accent2);
  background: rgba(252,63,29,.13);
  border-color: rgba(252,63,29,.25);
}
.metrika-connect {
  display: grid;
  gap: 14px;
  padding: 14px;
  border-radius: 11px;
  border: 1px solid rgba(252,63,29,.24);
  background: linear-gradient(135deg, rgba(252,63,29,.12), rgba(255,255,255,.02));
}
.metrika-connect.connected {
  border-color: rgba(46,224,138,.25);
  background: linear-gradient(135deg, rgba(46,224,138,.11), rgba(255,255,255,.02));
}
.metrika-connect-top {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
}
.metrika-connect-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: var(--accent2);
  background: rgba(252,63,29,.14);
  border: 1px solid rgba(252,63,29,.22);
}
.metrika-connect.connected .metrika-connect-icon {
  color: var(--green);
  background: rgba(46,224,138,.13);
  border-color: rgba(46,224,138,.24);
}
.metrika-connect-icon svg { width: 18px; height: 18px; }
.metrika-connect strong {
  display: block;
  margin-bottom: 3px;
  font-family: "Unbounded", sans-serif;
  font-size: 13px;
}
.metrika-connect span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}
.metrika-connect-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.metrika-connect-actions.two { grid-template-columns: 1fr 1fr; }
.metrika-section-title {
  margin: 4px 0 -2px;
  color: var(--accent2);
  font-size: 10.5px;
  font-weight: 900;
  text-transform: uppercase;
}
.metrika-advanced {
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(255,255,255,.018);
  padding: 0;
}
.metrika-advanced summary {
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 11px 13px;
  cursor: pointer;
  color: var(--muted);
  font-weight: 900;
  font-size: 12px;
  list-style: none;
}
.metrika-advanced summary::-webkit-details-marker { display: none; }
.metrika-advanced[open] {
  padding: 0 12px 12px;
}
.metrika-advanced[open] summary {
  margin: 0 -12px 12px;
  border-bottom: 1px solid var(--soft);
}
.metrika-advanced.compact summary {
  min-height: 36px;
  padding: 9px 11px;
}
.metrika-actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.metrika-actions-row .btn { width: 100%; }
.metrika-periods {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.metrika-periods button {
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--card2);
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
  font-size: 11px;
}
.metrika-periods button:hover {
  color: var(--text);
  border-color: rgba(252,63,29,.38);
  background: rgba(252,63,29,.08);
  transform: translateY(-1px);
}
.metrika-refresh { width: 100%; }
.metrika-main { min-width: 0; display: grid; gap: 14px; }
.metrika-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--soft);
}
.metrika-head h3 { margin-bottom: 5px; }
.metrika-head p {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}
.metrika-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.metrika-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr)) minmax(180px, 1.2fr) auto;
  gap: 9px;
}
.metrika-filters input {
  min-height: 38px;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--card2);
  color: var(--text);
  outline: none;
  padding: 9px 11px;
  font-weight: 700;
}
.metrika-filters input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(252,63,29,.12); }
.metrika-table-wrap {
  max-height: min(66vh, 720px);
  overflow: auto;
}
.metrika-table { min-width: 720px; }
.metrika-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #171b24;
}
.metrika-table thead th button {
  border: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
  font: inherit;
  text-transform: inherit;
}
.metrika-table thead th button:hover { color: var(--text); }
.metrika-table td:first-child,
.metrika-table th:first-child {
  width: 42px;
  text-align: center;
}
.metrika-table td:nth-child(2),
.metrika-table th:nth-child(2) { width: 64px; }
.metrika-table td:nth-child(4),
.metrika-table th:nth-child(4),
.metrika-table td:nth-child(5),
.metrika-table th:nth-child(5) {
  width: 130px;
  text-align: right;
}
.metrika-table input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
}
.metrika-loading {
  min-height: 260px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  border: 1px dashed var(--border);
  border-radius: 11px;
  background: rgba(255,255,255,.015);
  text-align: center;
}
.metrika-loading strong { font-family: "Unbounded", sans-serif; }
.metrika-loading p { color: var(--muted); font-size: 12px; font-weight: 700; }
.metrika-cell-loader {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.18);
  border-top-color: var(--accent2);
  display: inline-block;
  animation: spin .75s linear infinite;
}
.metrika-empty { min-height: 260px; }

/* ---------------- topvisor ---------------- */
.topvisor-page { display: grid; gap: 18px; }
.topvisor-layout {
  display: grid;
  grid-template-columns: minmax(360px, 430px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.topvisor-side {
  position: sticky;
  top: 26px;
  display: grid;
  gap: 16px;
  min-width: 0;
  overflow: hidden;
}
.topvisor-side .settings-panel-head {
  margin-bottom: 0;
}
.topvisor-create-head {
  margin-top: 6px;
  padding-top: 16px;
  border-top: 1px solid var(--soft);
}
.topvisor-connect {
  display: grid;
  gap: 4px;
  padding: 14px;
  border-radius: 11px;
  border: 1px solid rgba(252,63,29,.24);
  background: rgba(252,63,29,.08);
}
.topvisor-connect.connected {
  border-color: rgba(46,224,138,.26);
  background: rgba(46,224,138,.08);
}
.topvisor-connect strong {
  font-family: "Unbounded", sans-serif;
  font-size: 13px;
}
.topvisor-connect span {
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
}
.topvisor-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.topvisor-actions .btn { width: 100%; }
.topvisor-price {
  display: grid;
  gap: 4px;
  padding: 13px;
  border-radius: 11px;
  border: 1px solid rgba(75,141,255,.22);
  background: rgba(75,141,255,.08);
}
.topvisor-price strong {
  font-family: "Unbounded", sans-serif;
  font-size: 20px;
}
.topvisor-price span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.topvisor-main { min-width: 0; display: grid; gap: 14px; }
.topvisor-controls {
  display: grid;
  grid-template-columns: minmax(280px, .9fr) minmax(420px, 1.35fr);
  gap: 18px;
  align-items: start;
}
.topvisor-control-card {
  min-width: 0;
  display: grid;
  gap: 14px;
}
.topvisor-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.topvisor-project-list {
  display: grid;
  gap: 12px;
}
.topvisor-project-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255,255,255,.022);
  overflow: hidden;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.topvisor-project-card.active {
  border-color: rgba(252,63,29,.38);
  background: rgba(252,63,29,.045);
  box-shadow: 0 16px 34px -28px rgba(252,63,29,.9);
}
.topvisor-project-main {
  display: grid;
  grid-template-columns: minmax(170px, auto) minmax(170px, 1.2fr) minmax(160px, .9fr) minmax(280px, 1.5fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
}
.topvisor-project-regions {
  min-width: 0;
}
.topvisor-project-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(58px, 1fr));
  gap: 8px;
  align-items: center;
}
.topvisor-project-metrics > span {
  min-height: 42px;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 7px 9px;
  border: 1px solid rgba(255,255,255,.055);
  border-radius: 11px;
  background: rgba(0,0,0,.12);
}
.topvisor-project-metrics b {
  font-family: "Unbounded", sans-serif;
  font-size: 13px;
}
.topvisor-project-metrics small {
  color: var(--faint);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}
.topvisor-table-wrap,
.topvisor-key-table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(255,255,255,.018);
}
.topvisor-table,
.topvisor-key-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}
.topvisor-table th,
.topvisor-key-table th {
  padding: 12px 14px;
  color: var(--faint);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  text-align: left;
  border-bottom: 1px solid var(--soft);
}
.topvisor-table td,
.topvisor-key-table td {
  padding: 13px 14px;
  border-bottom: 1px solid rgba(255,255,255,.055);
  vertical-align: middle;
  font-size: 13px;
  font-weight: 800;
}
.topvisor-table tr:last-child td,
.topvisor-key-table tr:last-child td { border-bottom: 0; }
.topvisor-table tr.active td { background: rgba(252,63,29,.055); }
.topvisor-project-link {
  display: grid;
  gap: 3px;
  width: 100%;
  max-width: 310px;
  padding: 0;
  color: var(--text);
  background: transparent;
  border: 0;
  text-align: left;
  cursor: pointer;
}
.topvisor-project-link strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topvisor-project-link span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 12px;
}
.topvisor-run {
  min-width: 162px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid rgba(252,63,29,.35);
  border-radius: 11px;
  color: #fff;
  background: var(--grad-accent);
  box-shadow: var(--shadow-glow);
  cursor: pointer;
  font-family: "Unbounded", sans-serif;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}
.topvisor-run svg { width: 13px; height: 13px; flex: none; }
.topvisor-run:disabled { opacity: .78; cursor: wait; }
.topvisor-run:disabled .btn-spinner {
  width: 14px;
  height: 14px;
}
.topvisor-check-status {
  display: grid;
  gap: 9px;
  margin: 0 16px 14px 16px;
  padding: 12px 14px;
  border: 1px solid rgba(252,63,29,.24);
  border-radius: 11px;
  background: linear-gradient(90deg, rgba(252,63,29,.10), rgba(255,122,69,.045));
}
.topvisor-check-status-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  font-weight: 900;
}
.topvisor-check-status-head strong {
  font-family: "Unbounded", sans-serif;
  font-size: 12px;
}
.topvisor-check-status-head span {
  color: var(--muted);
  text-align: right;
}
.topvisor-check-bar {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,.07);
}
.topvisor-check-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--grad-accent);
  box-shadow: 0 0 16px rgba(252,63,29,.65);
  transition: opacity .25s ease, filter .25s ease;
  position: relative;
}
.topvisor-check-bar i::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent);
  animation: topvisorShimmer 1.2s linear infinite;
}
@keyframes topvisorShimmer {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}
.topvisor-dynamics,
.topvisor-tops,
.topvisor-history {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}
.topvisor-dynamics span,
.topvisor-tops span,
.topvisor-history span {
  padding: 5px 8px;
  border-radius: 11px;
  background: rgba(255,255,255,.04);
  white-space: nowrap;
  font-size: 12px;
  font-weight: 900;
}
.topvisor-tops strong { color: var(--text); }
.topvisor-row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  white-space: nowrap;
}
.topvisor-detail {
  display: grid;
  gap: 14px;
  margin: 0 16px 16px 74px;
  padding: 16px;
  border: 1px solid rgba(75,141,255,.22);
  border-radius: 11px;
  background: rgba(75,141,255,.055);
}
.topvisor-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}
.topvisor-detail-head h3 { margin-bottom: 5px; }
.topvisor-detail-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(90px, 1fr));
  gap: 8px;
  min-width: 310px;
}
.topvisor-detail-metrics span {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(0,0,0,.12);
}
.topvisor-detail-metrics strong {
  font-family: "Unbounded", sans-serif;
  font-size: 16px;
}
.topvisor-detail-metrics small { color: var(--faint); font-weight: 900; font-size: 11px; }
.topvisor-region-detail {
  display: grid;
  gap: 9px;
}
.topvisor-region-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 900;
}
.topvisor-region-title span {
  color: var(--faint);
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 12px;
}
.topvisor-confirm {
  display: grid;
  gap: 14px;
}
.topvisor-confirm-price,
.topvisor-confirm-project {
  display: grid;
  gap: 3px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(255,255,255,.035);
}
.topvisor-confirm-price strong {
  font-family: "Unbounded", sans-serif;
  font-size: 26px;
}
.topvisor-confirm-price span,
.topvisor-confirm-project span {
  color: var(--muted);
  font-weight: 800;
  font-size: 12px;
}
.topvisor-region-modal {
  gap: 16px;
}
.topvisor-position {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: "Unbounded", sans-serif;
  font-size: 14px;
}
.topvisor-position small { font-family: Manrope, sans-serif; font-weight: 900; }
.topvisor-key-table.compact { min-width: 620px; }
.topvisor-key-table.compact th:not(:first-child),
.topvisor-key-table.compact td:not(:first-child) {
  text-align: center;
  min-width: 120px;
}
.topvisor-key-table.compact td:first-child {
  min-width: 220px;
}
.topvisor-position-date {
  display: block;
  margin-top: 3px;
  color: var(--faint);
  font-size: 10px;
  font-weight: 800;
}
.topvisor-help {
  display: grid;
  gap: 12px;
}
.topvisor-help-line {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 11px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.018);
}
.topvisor-help-line strong {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: #fff;
  background: var(--grad-accent);
  font-family: "Unbounded", sans-serif;
  font-size: 12px;
}
.topvisor-help-line span {
  color: var(--text);
  font-weight: 800;
  font-size: 13px;
  line-height: 1.35;
}
.topvisor-help .btn { width: 100%; }

.position-stats { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.position-stat.success strong { color: var(--green); }
.position-stat.warn strong { color: var(--amber); }
.position-stat.error strong { color: var(--accent); }
.position-meta {
  display: flex; flex-wrap: wrap; gap: 12px; margin-top: 14px; color: var(--muted);
  font-size: 12px; font-weight: 700;
}
.position-meta span { padding: 8px 10px; border: 1px solid var(--border); border-radius: 11px; background: var(--card2); }
.position-meta strong { color: var(--text); }
.region-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.region-chips span {
  display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 5px 9px;
  border-radius: 11px; border: 1px solid var(--border); background: var(--card2);
  color: var(--text); font-size: 12px; font-weight: 800;
}
.region-chips small { color: var(--faint); font-weight: 700; }
.position-badge {
  display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 28px;
  gap: 7px; border-radius: 11px; font-weight: 900; font-size: 12px; background: rgba(98,107,125,.16); color: var(--muted);
  border: 1px solid transparent;
}
.position-badge.success { color: var(--green); background: rgba(46,224,138,.12); border-color: rgba(46,224,138,.22); }
.position-badge.warn { color: var(--amber); background: rgba(255,176,32,.12); border-color: rgba(255,176,32,.22); }
.position-badge.error { color: var(--accent); background: rgba(252,63,29,.12); border-color: rgba(252,63,29,.22); }
.position-badge.searching { color: var(--accent2); background: rgba(252,63,29,.12); border-color: rgba(252,63,29,.25); }
.position-checking {
  margin: 14px 0 2px; display: flex; align-items: center; gap: 13px; padding: 14px;
  border-radius: 11px; border: 1px solid rgba(252,63,29,.24);
  background: linear-gradient(135deg, rgba(252,63,29,.12), rgba(255,255,255,.018));
}
.position-checking strong { display: block; margin-bottom: 3px; font-family: "Unbounded", sans-serif; font-size: 13px; }
.position-checking small { color: var(--muted); font-weight: 700; line-height: 1.4; }
.loader-ring {
  width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(252,63,29,.18);
  border-top-color: var(--accent2); box-shadow: 0 0 18px rgba(252,63,29,.18);
  animation: spin .8s linear infinite; flex: none;
}
.mini-spinner {
  width: 12px; height: 12px; border-radius: 50%; border: 2px solid rgba(252,63,29,.24);
  border-top-color: var(--accent2); animation: spin .7s linear infinite;
}
.position-stat.loading { position: relative; overflow: hidden; }
.position-stat.loading::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.06), transparent);
  animation: shimmer 1.1s linear infinite;
}
.stat-skeleton {
  width: 54px; height: 20px; display: inline-block; border-radius: 7px;
  background: linear-gradient(90deg, rgba(255,255,255,.06), rgba(255,255,255,.14), rgba(255,255,255,.06));
  background-size: 180% 100%; animation: skeleton 1s linear infinite;
}
.history-strip { display: flex; flex-wrap: wrap; gap: 6px; }
.history-strip span {
  display: inline-grid; gap: 1px; min-height: 30px; padding: 4px 8px; border-radius: 7px;
  background: var(--card2); border: 1px solid var(--border); color: var(--muted);
  font: 700 11px "JetBrains Mono", Consolas, monospace;
}
.history-strip b { color: var(--text); font: 900 11px "JetBrains Mono", Consolas, monospace; }
.history-strip small { color: var(--faint); font: 700 10px Inter, sans-serif; }
.pos-bucket { margin: 5px 0; font-size: 11px; }
.progress { height: 8px; border-radius: 99px; overflow: hidden; background: rgba(255,255,255,.06); margin-top: 15px; position: relative; }
.progress i { display: block; height: 100%; border-radius: inherit; background: var(--grad-teal); box-shadow: 0 0 12px rgba(23,201,182,.5); position: relative; overflow: hidden; }
.progress i::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.4), transparent);
  animation: shimmer 1.8s linear infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(200%); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes skeleton { to { background-position: -180% 0; } }

/* ---------------- task detail ---------------- */
.task-hero {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 20px; flex-wrap: wrap;
  border: 1px solid var(--border); background: var(--card-glass); border-radius: var(--radius); margin-bottom: 18px;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.task-hero::after {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, rgba(252,63,29,.75), rgba(23,201,182,.45), transparent); pointer-events: none;
}
.task-title { display: flex; align-items: center; gap: 14px; min-width: 260px; flex: 1 1 420px; }
.back-btn { width: 42px; height: 42px; border-radius: 11px; padding: 0; justify-content: center; }
.task-title strong { display: block; font-size: 19px; font-family: "Unbounded", sans-serif; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-actions { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; justify-content: flex-end; z-index: 1; min-width: 0; }
.task-stat-strip { margin-bottom: 18px; }
.task-stat-strip .stat { min-height: 116px; }
.task-stat-strip .stat strong { font-size: 25px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-stat-strip .stat .sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-hint {
  min-height: 34px; display: inline-flex; align-items: center; padding: 7px 10px;
  border-radius: 11px; border: 1px solid var(--border); background: var(--card2);
  color: var(--muted); font-size: 12px; font-weight: 800;
}
.agent-hint.error { color: var(--accent); border-color: rgba(252,63,29,.35); }
.tabs { display: flex; flex-wrap: wrap; gap: 9px; margin: 18px 0; }
.tab { background: var(--card2); color: var(--muted); border: 1px solid var(--border); border-radius: 11px; padding: 10px 16px; font-weight: 800; font-size: 13px; cursor: pointer; }
.tab:hover { color: var(--text); transform: translateY(-1px); }
.tab.active { color: #fff; background: var(--grad-accent); border-color: transparent; box-shadow: var(--shadow-glow); }

/* ---------------- forms ---------------- */
.form { display: grid; gap: 14px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 4px; }
.field { display: grid; gap: 7px; }
.field label { color: var(--muted); font-size: 12px; font-weight: 800; }
.field-hint { color: var(--faint); font-size: 11.5px; font-weight: 700; line-height: 1.45; }
.field input, .field textarea, .field select {
  width: 100%; background: var(--card2); border: 1px solid var(--border); color: var(--text);
  border-radius: 11px; padding: 13px; outline: none; transition: border-color .16s ease, box-shadow .16s ease;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(252,63,29,.15); }
.field textarea { min-height: 140px; resize: vertical; font-family: inherit; }
.region-field label { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.region-field label small { color: var(--faint); font-weight: 800; }
.region-picker { position: relative; }
.region-picker summary {
  min-height: 46px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 13px; border-radius: 11px; border: 1px solid var(--border); background: var(--card2);
  color: var(--text); cursor: pointer; font-weight: 800; list-style: none;
}
.region-picker summary::-webkit-details-marker { display: none; }
.region-picker summary b {
  padding: 4px 8px; border-radius: 999px; background: rgba(23,201,182,.12);
  color: var(--teal); font-size: 11px;
}
.region-dropdown {
  position: absolute; z-index: 60; inset: calc(100% + 6px) 0 auto 0; padding: 10px;
  border-radius: 11px; border: 1px solid var(--border-strong); background: #151923;
  box-shadow: 0 24px 54px -26px rgba(0,0,0,.9);
}
.region-search {
  width: 100%; margin-bottom: 9px; background: var(--card2); border: 1px solid var(--border);
  color: var(--text); border-radius: 11px; padding: 11px 12px; outline: none;
}
.region-options { display: grid; gap: 7px; max-height: 270px; overflow: auto; padding-right: 3px; }
.region-row { justify-content: flex-start; }
.import-box { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 16px; border-radius: 11px; background: var(--card2); border: 1px solid var(--border); }
.import-box strong { display: block; margin-bottom: 4px; }
.file-btn { position: relative; overflow: hidden; display: inline-flex; align-items: center; cursor: pointer; white-space: nowrap; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ---------------- misc ---------------- */
.empty {
  display: grid; place-items: center; min-height: 170px; color: var(--faint); font-weight: 700; text-align: center;
  border: 1.5px dashed var(--border); border-radius: var(--radius); background: rgba(255,255,255,.015); padding: 24px; gap: 6px;
}
.notices {
  position: fixed; right: 22px; top: 22px; z-index: 90; width: min(440px, calc(100vw - 32px));
  display: grid; gap: 10px; pointer-events: none;
}
.notice {
  pointer-events: auto; position: relative; display: grid; gap: 5px; padding: 14px 42px 14px 15px;
  border-radius: 10px; border: 1px solid var(--border); background: rgba(22,26,36,.96);
  box-shadow: 0 22px 52px -26px rgba(0,0,0,.9); animation: fade .2s ease both;
}
.notice strong { font-family: "Unbounded", sans-serif; font-size: 12px; color: var(--text); }
.notice span { white-space: pre-line; color: var(--muted); font-size: 12.5px; font-weight: 700; line-height: 1.45; }
.notice button {
  position: absolute; right: 10px; top: 9px; width: 24px; height: 24px; border: 0; border-radius: 11px;
  background: transparent; color: var(--muted); cursor: pointer; font-size: 18px; line-height: 1;
}
.notice.warn { border-color: rgba(255,176,32,.32); box-shadow: 0 22px 52px -26px rgba(255,176,32,.34); }
.notice.error { border-color: rgba(252,63,29,.36); box-shadow: 0 22px 52px -26px rgba(252,63,29,.34); }
.notice.success { border-color: rgba(46,224,138,.3); box-shadow: 0 22px 52px -26px rgba(46,224,138,.28); }
.login {
  position: fixed; inset: 0; display: none; place-items: center;
  background:
    radial-gradient(780px 460px at 32% 18%, rgba(252,63,29,.16), transparent 62%),
    radial-gradient(780px 520px at 76% 78%, rgba(23,201,182,.13), transparent 62%),
    rgba(7,9,13,.84);
  backdrop-filter: blur(12px); z-index: 30; padding: 22px;
}
.login.visible { display: grid; }
.login::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.028) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(circle at 50% 50%, #000 0%, transparent 72%);
}
.login-card {
  position: relative; width: min(560px, calc(100vw - 30px));
  background: linear-gradient(180deg, rgba(24,29,40,.92), rgba(15,18,26,.94));
  border: 1px solid rgba(255,255,255,.12); border-radius: 14px; padding: 34px;
  box-shadow: 0 44px 100px -36px rgba(0,0,0,.96), 0 0 42px -26px rgba(23,201,182,.8);
  overflow: hidden;
}
.login-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, rgba(252,63,29,.9), rgba(23,201,182,.65), transparent);
}
.modal-card {
  width: min(520px, calc(100vw - 30px)); background: linear-gradient(180deg, #171b24, #12151d);
  border: 1px solid var(--border-strong); border-radius: 11px; padding: 28px; box-shadow: 0 40px 80px -30px rgba(0,0,0,.9);
}
:root[data-theme="light"] .modal-card {
  background: #fff;
  box-shadow: 0 36px 90px -42px rgba(31, 41, 55, .65);
}
.project-wizard-card {
  width: min(640px, calc(100vw - 28px));
  padding: 0;
  overflow: hidden;
}
.project-wizard-card .modal-head {
  min-height: 62px;
  margin: 0;
  padding: 20px 24px 10px;
}
.project-wizard-card .modal-head h2 { font-size: 16px; }
.project-wizard-card .modal-body { padding: 0; }
.project-wizard { display: grid; min-height: min(760px, calc(100vh - 52px)); }
.wizard-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: center;
  gap: 0;
  padding: 0 24px 16px;
  border-bottom: 1px solid var(--soft);
}
.wizard-steps span {
  position: relative;
  display: inline-flex;
  justify-self: start;
  align-items: center;
  min-height: 26px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--card2);
  color: var(--faint);
  font-size: 12px;
  font-weight: 900;
}
.wizard-steps span::after {
  content: "";
  position: absolute;
  left: 100%;
  top: 50%;
  width: calc(100vw / 6);
  height: 1px;
  background: var(--border);
}
.wizard-steps span:last-child::after { display: none; }
.wizard-steps .active { color: #4047ff; background: rgba(75,141,255,.12); }
.wizard-steps .done { color: #087840; background: rgba(46,224,138,.16); }
.wizard-scroll {
  min-height: 0;
  max-height: min(620px, calc(100vh - 196px));
  overflow: auto;
  padding: 22px 24px;
}
.wizard-pane { display: grid; gap: 15px; }
.wizard-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.wizard-two.compact { align-items: end; }
.wizard-region-box {
  min-height: 74px;
  padding: 7px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--card2);
}
.wizard-region-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 5px;
}
.wizard-region-tags button {
  border: 1px solid rgba(46,224,138,.32);
  border-radius: 999px;
  background: rgba(46,224,138,.12);
  color: #0a9d58;
  min-height: 24px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.wizard-region-tags small { color: var(--faint); }
.wizard-region-box input {
  width: 100%;
  border: 0;
  min-height: 30px;
  background: transparent;
  color: var(--text);
  outline: none;
  padding: 0 4px;
}
.wizard-region-actions { display: flex; gap: 6px; margin-top: 6px; }
.mini-soft {
  min-height: 24px;
  padding: 3px 10px;
  border-radius: 6px;
  background: transparent;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.mini-soft.green { color: #0a9d58; border: 1px solid rgba(46,224,138,.38); }
.mini-soft.red { color: var(--accent); border: 1px solid rgba(252,63,29,.35); }
.wizard-blue-box {
  padding: 14px;
  border: 1px solid rgba(75,141,255,.24);
  border-radius: 11px;
  background: rgba(75,141,255,.09);
}
.wizard-blue-box strong { color: #5260ff; }
.wizard-blue-box p { margin: 7px 0 12px; color: #6585ff; font-size: 12px; font-weight: 700; line-height: 1.45; }
.wizard-suggested {
  margin-top: 12px;
  border: 1px solid rgba(75,141,255,.28);
  border-radius: 11px;
  overflow: hidden;
  background: rgba(255,255,255,.04);
}
.wizard-suggested > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  color: #6386ff;
  font-size: 11px;
  font-weight: 800;
}
.wizard-suggested button {
  border: 1px solid rgba(75,141,255,.28);
  border-radius: 6px;
  background: rgba(255,255,255,.08);
  color: #5260ff;
  font-size: 11px;
  font-weight: 800;
  padding: 5px 8px;
  cursor: pointer;
}
.wizard-suggested table { width: 100%; border-collapse: collapse; font-size: 12px; }
.wizard-suggested th,
.wizard-suggested td { padding: 7px 10px; border-top: 1px solid rgba(75,141,255,.16); text-align: left; }
.wizard-suggested th:last-child,
.wizard-suggested td:last-child { text-align: right; color: #5260ff; font-weight: 900; }
.wizard-budget {
  max-height: 180px;
  overflow: auto;
  padding: 12px;
  border: 1px solid rgba(46,224,138,.26);
  border-radius: 11px;
  background: rgba(46,224,138,.08);
}
.wizard-budget > div,
.wizard-budget p {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 70px 86px;
  align-items: center;
  gap: 10px;
}
.wizard-budget > div { margin-bottom: 8px; }
.wizard-budget > div b,
.wizard-budget p b { color: #0a9d58; text-align: right; }
.wizard-budget p {
  margin: 0;
  padding: 5px 0;
  border-top: 1px solid rgba(46,224,138,.13);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.wizard-summary {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--card2);
}
.wizard-summary h3 { margin: 0 0 12px; font-size: 14px; }
.wizard-summary p {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 16px;
  margin: 6px 0;
  color: var(--faint);
  font-weight: 800;
}
.wizard-summary strong { color: var(--text); overflow: hidden; text-overflow: ellipsis; }
.traffic-limit-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 11px;
}
.traffic-limit-strip span {
  display: grid;
  gap: 4px;
  min-height: 58px;
  align-content: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card2);
}
.traffic-limit-strip strong {
  color: var(--text);
  font: 900 15px/1 var(--font-brand);
}
.traffic-limit-strip small {
  color: var(--faint);
  font-size: 11px;
  font-weight: 850;
}
.wizard-option {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--card-glass);
}
.wizard-option.warn { border-color: rgba(255,176,32,.36); background: rgba(255,176,32,.08); }
.wizard-option span { display: grid; gap: 5px; }
.wizard-option small { color: var(--muted); line-height: 1.45; }
.wizard-section {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--card-glass);
}
.wizard-section h3 { margin: 0 0 8px; font-size: 14px; }
.wizard-section h3 small { color: var(--faint); font-size: 11px; }
.schedule-card {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 8px;
  padding: 12px;
  margin-top: 9px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--card2);
}
.schedule-card.active { border-color: #5147ff; background: rgba(75,141,255,.10); }
.schedule-card span { display: grid; gap: 5px; }
.schedule-card small { color: var(--muted); }
.schedule-card i {
  width: 220px;
  max-width: 100%;
  height: 38px;
  background: linear-gradient(90deg, rgba(185,216,255,.82), rgba(185,216,255,.18));
  opacity: .85;
}
.schedule-card.active i { background: linear-gradient(90deg, #5147ff, #b9d8ff); }
.weekday-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}
.weekday-grid label {
  display: grid;
  justify-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}
.weekday-grid input {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--card2);
  color: var(--text);
  text-align: center;
}
.wizard-error {
  margin-bottom: 14px;
  padding: 11px 12px;
  border: 1px solid rgba(252,63,29,.28);
  border-radius: 11px;
  background: rgba(252,63,29,.08);
  color: var(--accent);
  font-weight: 800;
}
.wizard-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 24px;
  border-top: 1px solid var(--soft);
  background: var(--card-glass);
}
.login-brand { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; }
.login-brand img {
  width: 76px; height: 76px; object-fit: contain;
  filter: drop-shadow(0 18px 26px rgba(23,201,182,.16));
}
.login-brand span {
  display: block; margin-bottom: 6px; color: var(--faint);
  font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: 0;
}
.login-card h2 { font-size: 32px; line-height: 1; }
.login-card p { color: var(--muted); margin: 0 0 20px; line-height: 1.55; font-weight: 700; }
.login-card a { color: var(--teal); font-weight: 800; }
.login-points { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; }
.login-points span {
  min-height: 30px; display: inline-flex; align-items: center; padding: 6px 10px;
  border: 1px solid var(--border); border-radius: 999px; background: rgba(255,255,255,.035);
  color: var(--muted); font-size: 11px; font-weight: 900;
}
.telegram-widget-shell {
  min-height: 74px; display: flex; align-items: center; justify-content: center;
  padding: 16px; border-radius: 12px; border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(28,33,44,.86), rgba(20,24,33,.86));
}
#telegramLogin { min-height: 44px; display: grid; place-items: center; }
.login-loader {
  min-height: 44px; display: inline-flex; align-items: center; padding: 10px 12px;
  border-radius: 11px; border: 1px solid var(--border); background: var(--card2);
  color: var(--muted); font-size: 13px; font-weight: 800;
}
.login-fallback {
  width: 100%; display: grid; gap: 10px; justify-items: center; text-align: center;
}
.login-fallback strong { font-family: "Unbounded", sans-serif; font-size: 15px; }
.login-fallback span { color: var(--muted); font-size: 12.5px; font-weight: 700; line-height: 1.45; }
.login-fallback-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; margin-top: 4px; }
.login-fallback-actions .btn { min-height: 38px; padding: 9px 13px; text-decoration: none; }
.bot-login { gap: 14px; }
.login-steps {
  width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 2px;
}
.login-steps span {
  min-height: 54px; display: grid; align-content: center; justify-items: center; gap: 5px;
  padding: 9px; border-radius: 11px; border: 1px solid var(--border); background: rgba(255,255,255,.025);
  color: var(--muted); font-size: 11px; font-weight: 800;
}
.login-steps b {
  width: 22px; height: 22px; display: grid; place-items: center; border-radius: 999px;
  background: var(--grad-accent); color: #fff; font: 900 11px "Unbounded", sans-serif;
}
#loginHint {
  display: block; margin: 14px 0 0; padding: 10px 12px; border-radius: 11px;
  border: 1px solid rgba(255,176,32,.22); background: rgba(255,176,32,.08);
  color: var(--amber); line-height: 1.45;
}
#loginHint:empty { display: none; }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(6px); display: grid; place-items: center; z-index: 40; animation: fade .2s ease both; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.icon-btn { width: 36px; height: 36px; border: 1px solid var(--border); border-radius: 11px; background: var(--card2); color: var(--muted); cursor: pointer; font-size: 20px; line-height: 1; display: inline-grid; place-items: center; }
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }
.icon-btn:disabled { opacity: .45; cursor: default; color: var(--faint); }
.icon-btn.small { width: 32px; height: 32px; }
.icon-btn.small svg { width: 16px; height: 16px; }
.icon-btn.danger:hover { color: var(--accent); border-color: rgba(252,63,29,.5); }
.table-actions { display: flex; justify-content: flex-end; gap: 7px; flex-wrap: wrap; min-width: 84px; }
.inline-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.keyword-toolbar { margin-top: 16px; margin-bottom: 10px; }
.fingerprint-box {
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
  padding: 14px; border-radius: 11px; border: 1px solid var(--border); background: var(--card2);
}
.fingerprint-box strong { display: block; margin-bottom: 4px; font-size: 13px; }
.check-row {
  display: flex; align-items: center; gap: 10px; padding: 12px 13px; border-radius: 11px;
  border: 1px solid var(--border); background: var(--card2); color: var(--muted); font-weight: 800; font-size: 12px;
}
.check-row input { width: 17px; height: 17px; accent-color: var(--teal); }
.check-row small { display: block; margin-top: 2px; color: var(--faint); font-weight: 700; }
.check-row.standalone { margin-top: 14px; }
.profile-picker {
  display: grid; gap: 8px; max-height: 240px; overflow: auto;
  padding: 12px; border-radius: 11px; border: 1px solid var(--border); background: rgba(255,255,255,.018);
}
.profile-picker-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 2px; }
.profile-picker-head strong { font-size: 13px; }
.warmup-summary {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 4px;
  padding: 12px; border-radius: 11px; border: 1px solid var(--border); background: rgba(255,255,255,.018);
}
.warmup-summary span {
  display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 5px 9px;
  border-radius: 11px; background: var(--card2); color: var(--muted); font-size: 12px; font-weight: 800;
}
.warmup-summary strong { color: var(--text); font-family: "Unbounded", sans-serif; font-size: 13px; }
.warmup-summary small { color: var(--faint); font-weight: 700; min-width: 220px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.warmup-modal-card {
  width: min(760px, calc(100vw - 28px));
  padding: 0;
  overflow: hidden;
}
.warmup-modal-card .modal-head {
  margin: 0;
  padding: 18px 20px 10px;
  border-bottom: 1px solid var(--soft);
}
.warmup-modal {
  display: grid;
  gap: 14px;
  padding: 18px 20px 20px;
}
.warmup-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255,63,47,.12), rgba(255,255,255,.025));
}
.warmup-modal-head strong {
  display: block;
  font-family: var(--font-brand);
  font-size: 16px;
}
.warmup-modal-head span {
  display: block;
  margin-top: 4px;
  color: var(--faint);
  font-size: 12px;
  font-weight: 800;
}
.warmup-modal-head b {
  flex: none;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 7px 11px;
  border-radius: 999px;
  color: #fff;
  background: var(--grad-accent);
  font-size: 12px;
}
.warmup-metrics,
.warmup-settings-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.warmup-metrics span {
  display: grid;
  gap: 5px;
  min-height: 72px;
  align-content: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card2);
}
.warmup-metrics strong {
  color: var(--text);
  font: 900 17px/1 var(--font-brand);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.warmup-metrics small {
  color: var(--faint);
  font-size: 11px;
  font-weight: 850;
}
.warmup-query-field textarea {
  min-height: 210px;
  max-height: 36vh;
  resize: vertical;
  font-weight: 700;
  line-height: 1.45;
}
.warmup-modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
  padding-top: 4px;
}
.warmup-modal-actions .btn {
  min-height: 39px;
}
.empty.compact { min-height: 72px; padding: 14px; }
.proxy-console { display: grid; gap: 16px; }
.proxy-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}
.proxy-hero h2 { margin: 0 0 5px; font-size: 22px; line-height: 1.15; }
.proxy-metrics,
.proxy-session-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.proxy-metrics .metric small {
  display: block;
  margin-top: 7px;
  color: var(--faint);
  font-size: 10.5px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.proxy-session-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: 14px; }
.proxy-session-card { display: grid; gap: 14px; }
.proxy-session-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.proxy-session-head h3 { margin: 0 0 5px; font-size: 16px; line-height: 1.2; }
.proxy-session-head p { margin: 0; color: var(--faint); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proxy-session-grid span {
  min-width: 0;
  padding: 10px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--card2);
}
.proxy-session-grid strong {
  display: block;
  color: var(--text);
  font-family: "Unbounded", sans-serif;
  font-size: 13px;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.proxy-session-grid small { display: block; margin-top: 5px; color: var(--faint); font-size: 10.5px; font-weight: 800; }
.proxy-other { padding: 0; overflow: hidden; }
.proxy-other summary {
  min-height: 58px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  cursor: pointer;
  list-style: none;
  font-weight: 900;
}
.proxy-other summary::-webkit-details-marker { display: none; }
.segmented {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px;
  padding: 5px; border-radius: 11px; background: var(--card2); border: 1px solid var(--border);
}
.segmented button {
  min-height: 38px; border: 0; border-radius: 7px; background: transparent; color: var(--muted);
  cursor: pointer; font-weight: 800; font-size: 12.5px;
}
.segmented button.active { color: #fff; background: var(--grad-accent); box-shadow: var(--shadow-glow); }
.modal-card { max-height: calc(100vh - 34px); overflow: auto; }

.activity-list { border: 1px solid var(--border); border-radius: 11px; overflow: hidden; box-shadow: var(--shadow); }
.activity-row {
  display: grid; grid-template-columns: 92px 180px 1.2fr 1fr 1fr; gap: 14px; padding: 13px 16px;
  border-bottom: 1px solid var(--soft); align-items: center; background: var(--card-glass); transition: background .15s ease;
}
.activity-row:hover { background: rgba(255,255,255,.03); }
.activity-row:last-child { border-bottom: 0; }
.activity-row strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-row span { color: var(--muted); font-size: 12px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 7px; }
.success { color: var(--green); } .success .dot { background: var(--green); }
.warn { color: var(--amber); } .warn .dot { background: var(--amber); }
.error { color: var(--accent); } .error .dot { background: var(--accent); }
.info { color: var(--blue); } .info .dot { background: var(--blue); }

.keyword-stats-card {
  width: min(720px, calc(100vw - 34px));
  overflow: hidden;
}
.keyword-stats-card .modal-body { overflow: hidden; }
.keyword-stats-modal {
  display: grid;
  gap: 12px;
  width: 100%;
  min-width: 0;
}
.keyword-stats-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 14px;
  padding: 14px; border: 1px solid var(--border); border-radius: 11px; background: var(--card2);
}
.keyword-stats-head strong { display: block; font-size: 16px; line-height: 1.25; overflow-wrap: anywhere; }
.keyword-stats-head span { display: block; margin-top: 5px; color: var(--faint); font-size: 12px; font-weight: 800; overflow-wrap: anywhere; }
.keyword-stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.keyword-stats-grid div {
  min-height: 76px; padding: 13px; border-radius: 11px; border: 1px solid var(--border);
  background: rgba(255,255,255,.025);
}
.keyword-stats-grid div.hot { border-color: rgba(252,63,29,.35); background: rgba(252,63,29,.09); }
.keyword-stats-grid strong { display: block; font: 900 22px/1 "Unbounded", sans-serif; color: var(--text); }
.keyword-stats-grid span { display: block; margin-top: 8px; color: var(--faint); font-size: 11px; font-weight: 900; }
.keyword-fallback-note {
  display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 11px;
  border: 1px solid rgba(252,63,29,.28); background: rgba(252,63,29,.08); color: var(--accent2);
  font-size: 12px; font-weight: 900;
}
.keyword-fallback-note svg { width: 17px; height: 17px; flex: none; }
.keyword-events-scroll {
  max-height: min(50vh, 420px); overflow-y: auto; overflow-x: hidden; border: 1px solid var(--border);
  border-radius: 11px; background: var(--card-glass);
}
.keyword-event-row {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--soft);
  background: rgba(255,255,255,.018);
}
.keyword-event-row:last-child { border-bottom: 0; }
.keyword-event-top {
  display: grid;
  grid-template-columns: minmax(108px, .8fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  color: var(--faint);
  font-size: 11.5px;
  font-weight: 900;
}
.keyword-event-top span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.keyword-event-top b { color: var(--text); font-size: 13px; }
.keyword-event-row strong {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  font-size: 13px;
  line-height: 1.25;
}
.keyword-event-row p {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 750;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.keyword-event-empty { padding: 18px; color: var(--faint); font-size: 13px; font-weight: 800; text-align: center; }
.domain-fallback-row { background: rgba(252,63,29,.055); }
.domain-fallback-row .keyword-event-top span:first-child { color: var(--accent2); }
.keyword-stats-foot {
  display: flex; justify-content: space-between; gap: 10px; color: var(--faint);
  font-size: 11.5px; font-weight: 900;
}

/* ---------------- responsive ---------------- */
@media (max-width: 1040px) {
  body { display: block; }
  .rail { width: auto; min-height: auto; height: auto; position: static; flex-direction: row; overflow-x: auto; gap: 8px; align-items: center; }
  .brand, .rail-foot { display: none; }
  .rail-nav { display: flex; flex: none; overflow: visible; gap: 8px; padding-right: 0; margin-right: 0; }
  .nav-group, .nav-sub { display: contents; }
  .nav-parent { display: none; }
  .nav { white-space: nowrap; width: auto; padding: 10px 14px; }
  .nav.active::before { display: none; }
  .main { padding: 22px 18px 48px; }
  .dash-hero { align-items: flex-start; flex-direction: column; }
  .grid, .grid.two { grid-template-columns: 1fr 1fr; }
  .settings-hero { align-items: stretch; flex-direction: column; }
  .settings-summary { min-width: 0; width: 100%; }
  .settings-grid { grid-template-columns: 1fr; }
  .checks-hero { align-items: stretch; }
  .check-select { min-width: 0; width: 100%; }
  .checks-grid { grid-template-columns: 1fr; }
  .checks-side { position: static; }
  .metrika-layout { grid-template-columns: 1fr; }
  .metrika-side { position: static; }
  .topvisor-controls { grid-template-columns: 1fr; }
  .topvisor-layout { grid-template-columns: 1fr; }
  .topvisor-side { position: static; }
  .topvisor-project-main {
    grid-template-columns: minmax(170px, auto) minmax(0, 1fr) auto;
  }
  .topvisor-project-regions,
  .topvisor-project-metrics {
    grid-column: 2 / -1;
  }
  .topvisor-row-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
  .topvisor-detail { margin-left: 16px; }
  .topvisor-detail-head { flex-direction: column; }
  .topvisor-detail-metrics { min-width: 0; width: 100%; }
  .metrika-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .metrika-filters .wide { grid-column: span 2; }
  .audit-summary-card, .audit-columns { grid-template-columns: 1fr; }
  .audit-counters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .settings-form-grid,
  .settings-panel:not(.wide) .settings-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .member-picker-grid { grid-template-columns: 1fr; }
  .member-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .member-detail-grid { grid-template-columns: 1fr; }
  .compact-activity .activity-row { grid-template-columns: 1fr 1fr; }
  .warmup-grid { grid-template-columns: 1fr; }
  .proxy-hero { display: grid; }
  .proxy-metrics,
  .proxy-session-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .proxy-session-list { grid-template-columns: 1fr; }
  .position-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cards { grid-template-columns: 1fr; }
  .task-hero { align-items: flex-start; flex-direction: column; }
  .activity-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
  .grid { grid-template-columns: 1fr; }
  .quick-grid { grid-template-columns: 1fr; }
  .inline-grid { grid-template-columns: 1fr; }
  .settings-hero { padding: 18px; }
  .settings-hero h2 { font-size: 22px; }
  .settings-summary,
  .settings-form-grid,
  .settings-form-grid.two,
  .settings-panel:not(.wide) .settings-form-grid { grid-template-columns: 1fr; }
  .settings-panel { padding: 16px; }
  .settings-panel-head { grid-template-columns: 38px 1fr; gap: 11px; }
  .settings-panel-icon { width: 38px; height: 38px; }
  .settings-import { align-items: flex-start; flex-direction: column; }
  .proxy-metrics,
  .proxy-session-grid { grid-template-columns: 1fr; }
  .agent-grid { grid-template-columns: 1fr; gap: 12px; }
  .agent-card { min-height: 0; padding: 15px; gap: 14px; }
  .agent-card-head { align-items: flex-start; }
  .agent-device { gap: 10px; }
  .agent-device > span { width: 40px; height: 40px; }
  .agent-device h3 { font-size: 15px; white-space: normal; }
  .agent-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .agent-card-foot { grid-template-columns: 1fr auto; }
  .agent-card-foot span:nth-child(2) { grid-column: 1 / -1; order: 3; }
  .agent-card-foot .icon-btn { justify-self: end; }
  .command-collapse summary { min-height: 54px; padding: 16px; }
  .command-collapse summary span { font-size: 15px; }
  .command-collapse > .table-wrap,
  .command-collapse > .empty { margin: 0 14px 14px; }
  .audit-counters, .audit-history > div { grid-template-columns: 1fr; }
  .metrika-actions-row,
  .metrika-periods,
  .topvisor-actions,
  .metrika-filters {
    grid-template-columns: 1fr 1fr;
  }
  .metrika-filters .wide { grid-column: 1 / -1; }
  .metrika-filters .btn { grid-column: 1 / -1; }
  .metrika-head { flex-direction: column; }
  .topvisor-table,
  .topvisor-key-table { min-width: 760px; }
  .topvisor-key-table.compact { min-width: 620px; }
  .topvisor-project-main {
    grid-template-columns: 1fr;
    padding: 12px;
  }
  .topvisor-run { width: 100%; }
  .topvisor-project-link,
  .topvisor-project-regions,
  .topvisor-project-metrics { grid-column: 1 / -1; }
  .topvisor-project-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .topvisor-row-actions {
    display: grid;
    grid-template-columns: 1fr repeat(3, 38px);
    width: 100%;
  }
  .topvisor-row-actions .btn { width: 100%; }
  .topvisor-detail { margin: 0 12px 12px; padding: 12px; }
  .topvisor-detail-metrics { grid-template-columns: 1fr; }
  .audit-score { margin: 0 auto; }
  .member-head { align-items: flex-start; flex-direction: column; }
  .member-score { width: 100%; text-align: left; }
  .picker-stats { grid-template-columns: 1fr 1fr; }
  .member-metrics, .command-grid { grid-template-columns: 1fr 1fr; }
  .member-person { align-items: flex-start; }
  .member-person img, .member-avatar { width: 48px; height: 48px; }
  .fingerprint-box { align-items: flex-start; flex-direction: column; }
  .login-card { padding: 26px 20px; }
  .login-brand { align-items: flex-start; flex-direction: column; gap: 12px; }
  .login-brand img { width: 66px; height: 66px; }
  .login-card h2 { font-size: 27px; }
  .telegram-widget-shell { justify-content: flex-start; overflow: hidden; }
  .login-steps { grid-template-columns: 1fr; }
  .project-wizard-card { width: min(100vw - 16px, 640px); }
  .project-wizard-card .modal-head { padding: 16px 16px 8px; }
  .wizard-steps { padding: 0 16px 12px; }
  .wizard-steps span { font-size: 11px; padding: 5px 8px; }
  .wizard-scroll { padding: 16px; max-height: calc(100vh - 178px); }
  .wizard-two { grid-template-columns: 1fr; }
  .wizard-foot { padding: 12px 16px; }
  .wizard-foot .btn { flex: 1; }
  .weekday-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .wizard-budget > div,
  .wizard-budget p { grid-template-columns: minmax(0, 1fr) 58px 74px; }
}

/* ---------------- phone polish ---------------- */
@media (max-width: 760px) {
  html { scroll-padding-bottom: 104px; }
  body {
    display: block;
    min-width: 320px;
    padding-bottom: calc(86px + env(safe-area-inset-bottom));
    background-attachment: scroll;
  }

  .rail {
    position: fixed;
    left: 0; right: 0; bottom: 0; top: auto;
    width: auto; height: auto; min-height: 0;
    display: block;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    border-right: 0;
    border-top: 1px solid rgba(255,255,255,.08);
    background: rgba(12,15,22,.93);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 -18px 42px -28px rgba(0,0,0,.95);
    z-index: 80;
  }
  .brand, .rail-foot { display: none; }
  .rail-nav {
    width: 100%;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(74px, 1fr);
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 2px 2px;
    margin: 0;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }
  .nav-group, .nav-sub { display: contents; }
  .nav-parent { display: none; }
  .rail-nav::-webkit-scrollbar { display: none; }
  .nav {
    scroll-snap-align: center;
    width: 100%;
    min-height: 58px;
    padding: 8px 7px;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    text-align: center;
    font-size: 10px;
    line-height: 1.1;
    border: 1px solid transparent;
    background: rgba(255,255,255,.018);
  }
  .nav span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .nav svg { width: 20px; height: 20px; }
  .nav.active {
    border-color: rgba(252,63,29,.32);
    background: linear-gradient(180deg, rgba(252,63,29,.18), rgba(252,63,29,.07));
  }
  .nav.active::before { display: none; }

  .main {
    max-width: none;
    padding: 10px 12px 24px;
  }
  .topbar {
    display: none;
  }
  h1 { font-size: 21px; }
  #viewSubtitle { font-size: 12px; line-height: 1.35; }
  .userbox {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }
  .userbox span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 9px 10px;
  }
  .userbox .btn { min-height: 38px; padding: 9px 12px; }

  .dash-hero,
  .settings-hero,
  .task-hero,
  .card,
  .settings-panel {
    border-radius: 10px;
  }
  .dash-hero, .settings-hero { padding: 18px 16px; }
  .dash-hero h2, .settings-hero h2 { font-size: 21px; }
  .card, .settings-panel { padding: 15px; }
  .section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
  .section-head .btn,
  .toolbar .btn,
  .form-actions .btn,
  .checks-actions-row .btn {
    width: 100%;
    justify-content: center;
  }

  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .grid.two,
  .settings-grid,
  .checks-grid,
  .audit-columns,
  .member-detail-grid,
  .warmup-grid,
  .inline-grid {
    grid-template-columns: 1fr;
  }
  .stat { min-height: 112px; padding: 14px; }
  .stat strong { font-size: 25px; }
  .stat-icon { width: 36px; height: 36px; }
  .stat-icon svg { width: 18px; height: 18px; }
  .stat .sub { font-size: 11px; line-height: 1.25; }

  .toolbar {
    align-items: stretch;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .cards { grid-template-columns: 1fr; gap: 12px; }
  .campaign-card { padding: 15px; }
  .campaign-card-top {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .campaign-card h3 { white-space: normal; line-height: 1.25; }
  .campaign-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 36px 36px;
    gap: 8px;
  }
  .campaign-edit-btn { min-width: 0; }
  .mini-metrics { gap: 8px; }
  .metric { padding: 10px; }
  .metric strong { font-size: 16px; }

  .task-title {
    width: 100%;
    min-width: 0;
    flex: none;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
  }
  .task-title .pill { grid-column: 2; width: max-content; max-width: 100%; }
  .task-title strong { font-size: 16px; white-space: normal; line-height: 1.25; }
  .task-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
  }
  .task-hero {
    padding: 13px;
    margin-bottom: 12px;
  }
  .task-hero .back-btn {
    width: 38px;
    height: 38px;
  }
  .task-stat-strip {
    display: none;
  }
  .task-settings-page {
    gap: 10px;
  }
  .task-settings-main,
  .task-autoprofiles,
  .task-settings-more {
    padding: 13px;
  }
  .task-settings-main .field,
  .task-settings-main .region-field {
    gap: 5px;
    margin-bottom: 9px;
  }
  .task-settings-main .section-head,
  .task-autoprofiles .section-head {
    margin-bottom: 10px;
  }
  .task-settings-main .section-head .label {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .task-settings-save .btn.ghost,
  .task-settings-rkn,
  .task-autoprofiles p {
    display: none;
  }
  .task-autoprofiles .mini-metrics {
    grid-template-columns: 1fr 1fr;
    margin-top: 0;
  }
  .task-settings-more {
    margin-top: 10px !important;
  }
  .task-settings-more .task-actions {
    grid-template-columns: 1fr 1fr;
  }
  .task-settings-more .task-actions .danger-text {
    grid-column: 1 / -1;
  }
  .agent-hint { justify-content: center; }
  .tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin: 12px -12px 14px;
    padding: 0 12px 4px;
    scrollbar-width: none;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tab {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 10px 13px;
    white-space: nowrap;
  }

  .field input,
  .field textarea,
  .field select,
  select {
    min-height: 44px;
    font-size: 16px;
    padding: 11px 12px;
  }
  .field textarea { min-height: 102px; }
  .field label { font-size: 11px; }
  .field-hint { display: none; }
  .form-actions,
  .settings-actions,
  .settings-import,
  .import-box,
  .fingerprint-box {
    align-items: stretch;
    flex-direction: column;
  }
  .settings-summary,
  .settings-form-grid,
  .settings-form-grid.two,
  .settings-panel:not(.wide) .settings-form-grid,
  .metrika-summary,
  .member-metrics,
  .command-grid,
  .picker-stats,
  .audit-counters,
  .audit-history > div,
  .position-stats {
    grid-template-columns: 1fr 1fr;
  }
  .settings-panel-head {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 10px;
  }
  .settings-panel-head h3 { font-size: 14px; }
  .settings-panel-head p { font-size: 12px; }

  .checks-actions-row {
    padding: 12px;
    display: grid;
    grid-template-columns: 1fr;
  }
  .check-domain-box { min-width: 0; }
  .check-keyline {
    align-items: stretch;
    display: grid;
    grid-template-columns: 1fr;
  }
  .audit-summary-card {
    grid-template-columns: 1fr;
    justify-items: stretch;
    gap: 12px;
  }
  .audit-score {
    width: 96px;
    height: 96px;
    margin: 0 auto;
  }
  .audit-score strong { font-size: 28px; }
  .audit-meta strong { font-size: 15px; word-break: break-word; }
  .audit-meta span { white-space: normal; overflow-wrap: anywhere; }
  .audit-findings { max-height: none; }
  .audit-finding div {
    display: grid;
    gap: 4px;
  }
  .audit-prompt-card textarea { min-height: 260px; font-size: 13px; }
  .position-checking {
    align-items: flex-start;
    padding: 12px;
  }
  .position-meta {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .history-strip { gap: 5px; }

  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 10px;
  }
  .table { min-width: 680px; }
  .table th, .table td { padding: 12px 13px; }
  .table-actions { justify-content: flex-start; }

  .activity-list { border-radius: 10px; }
  .activity-row,
  .compact-activity .activity-row {
    grid-template-columns: 1fr;
    gap: 5px;
    padding: 12px;
  }
  .activity-row strong,
  .activity-row span {
    white-space: normal;
    overflow: visible;
  }
  .keyword-stats-modal { min-width: 0; }
  .keyword-stats-head {
    display: grid;
    gap: 10px;
  }
  .keyword-stats-grid { grid-template-columns: 1fr 1fr; }
  .keyword-events-scroll { max-height: 52vh; }

  .modal {
    place-items: stretch;
    padding: 10px;
    align-items: end;
  }
  .modal-card {
    width: 100%;
    max-height: min(90vh, 760px);
    padding: 14px;
    border-radius: 14px 14px 10px 10px;
  }
  .modal-head {
    position: sticky;
    top: -14px;
    z-index: 2;
    margin: -14px -14px 12px;
    padding: 13px 14px 10px;
    background: linear-gradient(180deg, #171b24, rgba(23,27,36,.94));
    border-bottom: 1px solid var(--soft);
  }
  .modal-head h2 { font-size: 17px; }
  .modal-body .form { gap: 10px; }
  .warmup-modal-card {
    width: 100%;
    max-height: min(92vh, 780px);
  }
  .warmup-modal-card .modal-head {
    padding: 13px 14px 10px;
  }
  .warmup-modal {
    padding: 14px;
    gap: 11px;
  }
  .warmup-modal-head {
    align-items: flex-start;
    padding: 12px;
  }
  .warmup-metrics,
  .warmup-settings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .warmup-metrics span {
    min-height: 62px;
    padding: 10px;
  }
  .warmup-query-field textarea {
    min-height: 150px;
    max-height: 32vh;
  }
  .warmup-modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .warmup-modal-actions .btn {
    width: 100%;
    min-width: 0;
    justify-content: center;
  }
  .modal-body .import-box {
    padding: 11px;
  }
  .modal-body .import-box p,
  .modal-body .import-box .muted {
    display: none;
  }
  #taskKeywords {
    min-height: 86px;
  }
  .region-dropdown {
    position: fixed;
    inset: auto 10px calc(84px + env(safe-area-inset-bottom)) 10px;
    max-height: 58vh;
    overflow: auto;
  }
  .region-options { max-height: 42vh; }

  .login {
    padding: 14px;
    align-items: end;
  }
  .login-card {
    width: 100%;
    padding: 24px 18px;
    border-radius: 16px;
  }
  .login-brand {
    display: grid;
    grid-template-columns: 62px minmax(0, 1fr);
    align-items: center;
    gap: 13px;
  }
  .login-brand img { width: 62px; height: 62px; }
  .login-card h2 { font-size: 25px; }
  .login-points { gap: 6px; }
  .login-points span { font-size: 10px; }
  .telegram-widget-shell {
    min-height: 68px;
    justify-content: center;
    overflow: hidden;
  }

  .notices {
    top: 10px;
    left: 10px;
    right: 10px;
    width: auto;
  }
  .notice {
    padding: 12px 38px 12px 13px;
    border-radius: 12px;
  }
}

@media (max-width: 430px) {
  .main { padding-left: 10px; padding-right: 10px; }
  .topbar { display: none; }
  .grid,
  .settings-summary,
  .settings-form-grid,
  .settings-form-grid.two,
  .settings-panel:not(.wide) .settings-form-grid,
  .member-metrics,
  .command-grid,
  .picker-stats,
  .audit-counters,
  .audit-history > div,
  .position-stats {
    grid-template-columns: 1fr;
  }
  .rail-nav { grid-auto-columns: minmax(68px, 1fr); }
  .nav { min-height: 56px; font-size: 9.5px; }
  .nav svg { width: 19px; height: 19px; }
  .userbox { grid-template-columns: 1fr; }
  .userbox .btn { width: 100%; justify-content: center; }
  .campaign-actions { grid-template-columns: 1fr 36px 36px; }
  .task-settings-more .task-actions { grid-template-columns: 1fr; }
  .metrika-periods,
  .metrika-actions-row,
  .metrika-filters { grid-template-columns: 1fr; }
  .metrika-toolbar .btn { width: 100%; }
  .mini-metrics { grid-template-columns: 1fr; }
  .task-stat-strip .stat strong { font-size: 22px; }
  .position-badge { min-width: 40px; }
  .login-brand { grid-template-columns: 54px minmax(0, 1fr); }
  .login-brand img { width: 54px; height: 54px; }
}

/* ---------------- premium redesign layer ---------------- */

:root[data-theme="light"] {
  --bg: #f5f7fb;
  --bg2: #edf1f7;
  --rail: rgba(255, 255, 255, .92);
  --card: #ffffff;
  --card-glass: rgba(255, 255, 255, .9);
  --card2: #f3f6fb;
  --card3: #e9eef6;
  --border: #d9e0eb;
  --border-strong: #bdc8d8;
  --soft: #e6ebf3;
  --text: #151c29;
  --muted: #5e6b7e;
  --faint: #8894a5;
  --grad-head: linear-gradient(100deg, #111827 0%, #374151 64%, #8792a3 100%);
  --shadow: 0 24px 70px -48px rgba(35, 49, 72, .42);
  --shadow-glow: 0 18px 44px -28px rgba(255, 63, 47, .34);
  --shadow-teal: 0 18px 44px -28px rgba(43, 212, 198, .32);
  --chrome-line: rgba(20, 28, 42, .08);
}

body {
  background:
    linear-gradient(180deg, rgba(255,255,255,.018), transparent 180px),
    linear-gradient(135deg, #0c0f15 0%, #08090d 48%, #06070a 100%);
}
:root[data-theme="light"] body {
  background:
    linear-gradient(180deg, rgba(255,255,255,.72), transparent 220px),
    linear-gradient(135deg, #f8fafc 0%, #f1f5f9 48%, #edf2f7 100%);
}

body,
button,
input,
textarea,
select,
table {
  font-family: Manrope, "Segoe UI", Arial, sans-serif;
}

h1,
h2,
h3,
.brand strong,
.stat strong,
.member-metric strong,
.metric strong {
  font-family: "Unbounded", Manrope, "Segoe UI", Arial, sans-serif;
}

.rail {
  width: 272px;
  padding: 18px 14px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.035), transparent 240px),
    var(--rail);
  border-right: 1px solid var(--chrome-line);
  box-shadow: 18px 0 60px -52px rgba(0,0,0,.95);
}
:root[data-theme="light"] .rail {
  box-shadow: 18px 0 56px -54px rgba(35,49,72,.45);
}

.brand {
  min-height: 66px;
  padding: 8px 9px 18px;
  border-bottom: 1px solid var(--soft);
}
.brand-mark {
  width: 48px;
  height: 48px;
  filter: drop-shadow(0 16px 24px rgba(43,212,198,.16));
}
.brand strong { font-size: 16px; }
.brand span {
  color: var(--muted);
  font-size: 10px;
}

.nav {
  min-height: 44px;
  padding: 11px 12px;
  border: 1px solid transparent;
  color: var(--muted);
}
.nav:hover {
  background: rgba(255,255,255,.046);
  border-color: var(--chrome-line);
}
:root[data-theme="light"] .nav:hover {
  background: rgba(15,23,42,.035);
}
.nav.active,
.nav-group.active > .nav-parent {
  color: var(--text);
  background:
    linear-gradient(90deg, rgba(255,63,47,.17), rgba(255,63,47,.055)),
    rgba(255,255,255,.035);
  border-color: rgba(255,63,47,.24);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 16px 30px -28px rgba(255,63,47,.75);
}
.nav.active::before {
  left: -14px;
  height: 26px;
  width: 3px;
}
.nav-sub {
  border-left-color: var(--border);
  margin-top: 2px;
}
.rail-foot {
  background: linear-gradient(180deg, transparent, rgba(9,11,16,.98) 24%);
  padding-top: 18px;
}
:root[data-theme="light"] .rail-foot {
  background: linear-gradient(180deg, transparent, rgba(255,255,255,.98) 24%);
}
.ready-widget {
  background:
    linear-gradient(145deg, rgba(49,216,137,.09), transparent 58%),
    var(--card2);
  border-color: var(--border);
}

.main {
  max-width: 1600px;
  padding: 32px 38px 70px;
}
.topbar {
  min-height: 58px;
  margin-bottom: 28px;
}
h1 {
  font-size: 30px;
  line-height: 1.04;
}
#viewSubtitle {
  font-size: 13px;
  color: var(--muted);
}
.userbox span,
.theme-toggle {
  background: var(--card-glass);
  border-color: var(--border);
  box-shadow: inset 0 1px 0 var(--chrome-line);
}
.theme-toggle {
  color: var(--text);
}

.dash-hero,
.settings-hero,
.checks-hero,
.stats-hero {
  border-color: var(--border);
  background:
    linear-gradient(135deg, rgba(255,63,47,.11), transparent 38%),
    linear-gradient(180deg, rgba(255,255,255,.045), transparent),
    var(--card-glass);
  box-shadow: var(--shadow);
}
:root[data-theme="light"] .dash-hero,
:root[data-theme="light"] .settings-hero,
:root[data-theme="light"] .checks-hero,
:root[data-theme="light"] .stats-hero {
  background:
    linear-gradient(135deg, rgba(255,63,47,.07), transparent 38%),
    #fff;
}

.card,
.settings-panel,
.topvisor-project-card,
.member-picker-card,
.agent-card,
.profile-folder {
  background:
    linear-gradient(180deg, rgba(255,255,255,.038), rgba(255,255,255,.012)),
    var(--card-glass);
  border-color: var(--border);
  box-shadow: var(--shadow), inset 0 1px 0 var(--chrome-line);
}
:root[data-theme="light"] .card,
:root[data-theme="light"] .settings-panel,
:root[data-theme="light"] .topvisor-project-card,
:root[data-theme="light"] .member-picker-card,
:root[data-theme="light"] .agent-card,
:root[data-theme="light"] .profile-folder {
  background: #fff;
}
.card:hover,
.campaign-card:hover,
.agent-card:hover,
.member-picker-card:hover,
.topvisor-project-card:hover {
  border-color: rgba(255,63,47,.34);
  box-shadow: 0 28px 70px -50px rgba(255,63,47,.55), inset 0 1px 0 var(--chrome-line);
}

.stat {
  min-height: 146px;
}
.stat::after {
  height: 2px;
  background: linear-gradient(90deg, rgba(255,63,47,.84), rgba(255,106,74,.38), transparent);
}
.stat-top span,
.label,
.field label,
.table thead th {
  letter-spacing: 0;
  text-transform: none;
}
.stat-icon,
.settings-panel-icon,
.ready-widget .ready-icon {
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.05), transparent),
    rgba(255,63,47,.11);
  color: var(--accent2);
  border: 1px solid rgba(255,63,47,.2);
  box-shadow: inset 0 1px 0 var(--chrome-line);
}
.stat.b .stat-icon,
.settings-panel-icon.blue {
  color: var(--blue);
  background: rgba(109,141,255,.11);
  border-color: rgba(109,141,255,.22);
}
.stat.c .stat-icon,
.settings-panel-icon.amber {
  color: var(--amber);
  background: rgba(245,176,65,.11);
  border-color: rgba(245,176,65,.22);
}
.settings-panel-icon.green {
  color: var(--green);
  background: rgba(49,216,137,.11);
  border-color: rgba(49,216,137,.22);
}

.btn {
  border-radius: 10px;
  min-height: 42px;
  background: var(--grad-accent);
  box-shadow: var(--shadow-glow), inset 0 1px 0 rgba(255,255,255,.2);
}
.btn:hover {
  transform: translateY(-1px);
}
.btn.ghost,
.icon-btn,
.tab,
.agent-hint,
.theme-toggle {
  background: var(--card2);
  color: var(--muted);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 var(--chrome-line);
}
.btn.ghost:hover,
.icon-btn:hover,
.tab:hover {
  background: var(--card3);
  color: var(--text);
}

.table-wrap {
  border-color: var(--border);
  background: var(--card-glass);
  box-shadow: var(--shadow), inset 0 1px 0 var(--chrome-line);
}
.table thead th {
  background: rgba(255,255,255,.028);
  color: var(--faint);
  font-size: 11px;
}
:root[data-theme="light"] .table thead th {
  background: #f6f8fb;
}
.table td {
  font-size: 13px;
}
.table tbody tr:hover {
  background: rgba(255,63,47,.045);
}
:root[data-theme="light"] .table tbody tr:hover {
  background: rgba(255,63,47,.035);
}

.field input,
.field textarea,
.field select,
select,
.metrika-filters input,
.weekday-grid input {
  background: var(--card2);
  border-color: var(--border);
  color: var(--text);
  border-radius: 10px;
  box-shadow: inset 0 1px 0 var(--chrome-line);
}
.field input:focus,
.field textarea:focus,
.field select:focus,
select:focus,
.metrika-filters input:focus {
  border-color: rgba(255,63,47,.68);
  box-shadow: 0 0 0 3px rgba(255,63,47,.14), inset 0 1px 0 var(--chrome-line);
}
.field input::placeholder,
.field textarea::placeholder {
  color: var(--faint);
}

.pill {
  border-color: var(--border);
  background: rgba(255,255,255,.055);
}
:root[data-theme="light"] .pill {
  background: rgba(15,23,42,.045);
}

.campaign-card,
.agent-card {
  overflow: hidden;
}
.campaign-card-top,
.agent-card-head {
  align-items: center;
}
.campaign-title h3,
.agent-device h3 {
  letter-spacing: 0;
}
.metric,
.agent-stats span,
.member-metric,
.system-line,
.quick-action {
  background: var(--card2);
  border-color: var(--border);
  box-shadow: inset 0 1px 0 var(--chrome-line);
}

.modal {
  background: rgba(3, 4, 7, .72);
  backdrop-filter: blur(14px);
}
:root[data-theme="light"] .modal {
  background: rgba(15, 23, 42, .42);
}
.modal-card {
  background:
    linear-gradient(180deg, rgba(255,255,255,.045), transparent),
    #12151c;
  border-color: var(--border-strong);
  box-shadow: 0 42px 110px -44px rgba(0,0,0,.96);
}
:root[data-theme="light"] .modal-card {
  background: #fff;
}
.modal-head {
  border-bottom-color: var(--soft);
}
.project-wizard-card {
  border-radius: 14px;
}
.project-wizard-card .modal-head {
  padding: 22px 26px 12px;
}
.wizard-steps {
  padding-left: 26px;
  padding-right: 26px;
}
.wizard-steps span {
  background: var(--card2);
  color: var(--muted);
  box-shadow: inset 0 1px 0 var(--chrome-line);
}
.wizard-steps .active {
  color: #fff;
  background: var(--grad-accent);
}
.wizard-steps .done {
  color: #09371f;
  background: linear-gradient(135deg, rgba(49,216,137,.95), rgba(125,235,188,.86));
}
.wizard-scroll {
  scrollbar-color: var(--border-strong) transparent;
}
.wizard-blue-box {
  background:
    linear-gradient(135deg, rgba(109,141,255,.12), transparent 60%),
    var(--card2);
  border-color: rgba(109,141,255,.24);
}
.wizard-blue-box strong,
.wizard-blue-box p {
  color: var(--text);
}
.wizard-region-box,
.wizard-summary,
.wizard-section,
.schedule-card,
.wizard-suggested,
.wizard-budget {
  background: var(--card2);
  border-color: var(--border);
}
.wizard-region-tags button {
  background: rgba(49,216,137,.12);
}
.wizard-budget {
  background:
    linear-gradient(135deg, rgba(49,216,137,.1), transparent 70%),
    var(--card2);
}
.wizard-option {
  background: var(--card2);
}
.wizard-option.warn {
  background:
    linear-gradient(135deg, rgba(245,176,65,.12), transparent 70%),
    var(--card2);
}
.schedule-card.active {
  border-color: rgba(255,63,47,.7);
  background:
    linear-gradient(135deg, rgba(255,63,47,.11), transparent 72%),
    var(--card2);
}
.schedule-card.active i {
  background: linear-gradient(90deg, var(--accent), rgba(255,255,255,.16));
}

.login-card,
.preloader-core {
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.06), transparent),
    #12151c;
}
:root[data-theme="light"] .login-card,
:root[data-theme="light"] .preloader-core {
  background: #fff;
}

@media (max-width: 760px) {
  .main {
    padding-left: 14px;
    padding-right: 14px;
  }
  .rail {
    width: auto;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    background: var(--rail);
  }
  .nav {
    border-radius: 12px;
  }
  .project-wizard-card .modal-head {
    padding: 16px 16px 8px;
  }
  .wizard-steps {
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* ---------------- impeccable polish layer ---------------- */

:root[data-theme="light"] {
  --surface-1: rgba(255, 255, 255, .98);
  --surface-2: rgba(246, 248, 252, .98);
  --surface-3: rgba(235, 240, 248, .96);
  --focus: rgba(255, 63, 47, .22);
}

html {
  text-rendering: optimizeLegibility;
}
body,
button,
input,
textarea,
select,
table,
.nav,
.btn,
.tab,
.label,
.pill,
.field label,
.table th,
.table td,
.topvisor-position small,
.history-strip small {
  font-family: var(--font-ui);
  letter-spacing: 0;
}
h1,
h2,
h3,
.brand strong,
.stat strong,
.metric strong,
.member-metric strong,
.topvisor-confirm-price strong,
.topvisor-detail-metrics strong {
  font-family: var(--font-brand);
  letter-spacing: 0;
  text-wrap: balance;
}
p,
.muted,
.field-hint,
.login-card p,
.position-checking small {
  text-wrap: pretty;
}

button,
a,
summary,
select {
  -webkit-tap-highlight-color: transparent;
}
button:focus-visible,
a:focus-visible,
summary:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
.nav:focus-visible,
.tab:focus-visible,
.icon-btn:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

body {
  background:
    radial-gradient(900px 520px at 86% -14%, rgba(252, 63, 29, .09), transparent 60%),
    radial-gradient(760px 580px at -12% 112%, rgba(25, 203, 182, .06), transparent 58%),
    linear-gradient(180deg, #0c0f17 0%, #080a10 54%, #060810 100%);
}
:root[data-theme="light"] body {
  background:
    radial-gradient(820px 460px at 88% -12%, rgba(255, 63, 47, .09), transparent 62%),
    radial-gradient(720px 520px at -12% 108%, rgba(43, 212, 198, .075), transparent 60%),
    linear-gradient(135deg, #fbfcff 0%, #f3f6fb 54%, #edf2f8 100%);
}

.preloader::before {
  display: none;
}
.preloader-core {
  border: 1px solid rgba(255, 255, 255, .1);
  background:
    radial-gradient(circle at 50% 0%, rgba(43, 212, 198, .12), transparent 38%),
    linear-gradient(180deg, rgba(255,255,255,.055), transparent),
    #11141b;
}
.preloader-core strong {
  font-family: var(--font-brand);
}

.rail {
  background:
    linear-gradient(180deg, rgba(255,255,255,.038), transparent 210px),
    linear-gradient(180deg, rgba(10, 12, 17, .98), rgba(8, 10, 14, .94));
  box-shadow: none;
}
:root[data-theme="light"] .rail {
  background:
    linear-gradient(180deg, rgba(255,255,255,.94), rgba(249,251,255,.92)),
    var(--rail);
}
.brand {
  border-bottom-color: color-mix(in srgb, var(--border) 72%, transparent);
}
.brand-mark {
  filter: drop-shadow(0 12px 18px rgba(255, 63, 47, .12));
}
.brand span {
  text-transform: none;
  font-weight: 800;
}
.nav {
  font-size: 13px;
  font-weight: 800;
  transition: color .18s var(--ease-out), background .18s var(--ease-out), border-color .18s var(--ease-out), transform .18s var(--ease-out);
}
.nav:hover {
  background: rgba(255,255,255,.055);
}
.nav.active,
.nav-group.active > .nav-parent {
  background:
    linear-gradient(90deg, rgba(255, 63, 47, .2), rgba(255, 63, 47, .07)),
    rgba(255,255,255,.042);
  border-color: rgba(255, 63, 47, .34);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.075);
}
.rail-foot {
  border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}

.main {
  width: 100%;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 4;
  margin: -12px -10px 26px;
  padding: 12px 10px 14px;
  background: linear-gradient(180deg, rgba(7,8,11,.94), rgba(7,8,11,.74) 72%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
:root[data-theme="light"] .topbar {
  background: linear-gradient(180deg, rgba(245,247,251,.94), rgba(245,247,251,.76) 72%, transparent);
}
h1 {
  font-size: 28px;
}
#viewSubtitle {
  max-width: 74ch;
}

.card,
.settings-panel,
.topvisor-project-card,
.member-picker-card,
.agent-card,
.profile-folder,
.task-hero,
.table-wrap {
  background:
    linear-gradient(180deg, rgba(255,255,255,.034), transparent 120px),
    var(--surface-1);
  border-color: color-mix(in srgb, var(--border) 86%, transparent);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.055);
}
:root[data-theme="light"] .card,
:root[data-theme="light"] .settings-panel,
:root[data-theme="light"] .topvisor-project-card,
:root[data-theme="light"] .member-picker-card,
:root[data-theme="light"] .agent-card,
:root[data-theme="light"] .profile-folder,
:root[data-theme="light"] .task-hero,
:root[data-theme="light"] .table-wrap {
  background: var(--surface-1);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.92);
}
.card:hover,
.campaign-card:hover,
.agent-card:hover,
.member-picker-card:hover,
.topvisor-project-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 63, 47, .36);
  box-shadow: 0 10px 22px -18px rgba(255, 63, 47, .42), inset 0 1px 0 rgba(255,255,255,.07);
}

.dash-hero,
.settings-hero,
.checks-hero,
.stats-hero {
  background:
    linear-gradient(135deg, rgba(255, 63, 47, .125), transparent 35%),
    linear-gradient(180deg, rgba(255,255,255,.05), transparent 110px),
    var(--surface-1);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.065);
}
.dash-hero h2,
.settings-hero h2,
.checks-hero h2,
.stats-hero h2 {
  font-size: 25px;
  line-height: 1.14;
}

.stat {
  min-height: 136px;
  transition: transform .18s var(--ease-out), border-color .18s var(--ease-out), background .18s var(--ease-out);
}
.stat::after {
  background: linear-gradient(90deg, var(--accent), rgba(255,106,74,.42), transparent 72%);
}
.stat-top span,
.metric span,
.member-metric span,
.topvisor-project-metrics small,
.field label,
.table thead th {
  color: var(--faint);
  font-size: 11px;
  font-weight: 850;
}
.stat strong {
  font-size: 30px;
}

.btn,
.topvisor-run,
.segmented button.active {
  border: 1px solid rgba(255, 63, 47, .42);
  background:
    linear-gradient(180deg, rgba(255,255,255,.12), transparent 45%),
    var(--grad-accent);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22);
}
.btn:hover,
.topvisor-run:hover {
  filter: brightness(1.04);
  box-shadow: 0 8px 18px -14px rgba(255, 63, 47, .6), inset 0 1px 0 rgba(255,255,255,.24);
}
.btn.ghost,
.icon-btn,
.tab,
.theme-toggle {
  background: var(--surface-2);
  color: var(--muted);
  border-color: var(--border);
}
.btn.ghost:hover,
.icon-btn:hover,
.tab:hover,
.theme-toggle:hover {
  background: var(--surface-3);
  color: var(--text);
}
.btn:disabled,
.topvisor-run:disabled {
  opacity: .52;
  filter: grayscale(.15);
}

.field input,
.field textarea,
.field select,
select,
.metrika-filters input,
.weekday-grid input {
  background: var(--surface-2);
  border-color: var(--border);
  min-height: 42px;
}
.field textarea {
  line-height: 1.5;
}
.field input:hover,
.field textarea:hover,
.field select:hover,
select:hover,
.metrika-filters input:hover {
  border-color: var(--border-strong);
}
.field input:focus,
.field textarea:focus,
.field select:focus,
select:focus,
.metrika-filters input:focus {
  border-color: rgba(255,63,47,.72);
  box-shadow: 0 0 0 3px var(--focus);
}

.table thead th {
  background: var(--surface-2);
  text-transform: none;
}
.table td {
  background: transparent;
}
.table tbody tr {
  transition: background .16s var(--ease-out);
}
.table tbody tr:hover {
  background: rgba(255, 63, 47, .052);
}

.campaign-card,
.agent-card {
  position: relative;
}
.campaign-card::before,
.agent-card::before,
.topvisor-project-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.14), transparent);
  pointer-events: none;
}
.campaign-card .pill,
.agent-card .pill {
  align-self: start;
}
.metric,
.agent-stats span,
.member-metric,
.system-line,
.quick-action,
.wizard-region-box,
.wizard-summary,
.wizard-section,
.schedule-card,
.wizard-suggested,
.wizard-budget,
.wizard-option,
.topvisor-project-metrics > span,
.topvisor-detail-metrics span,
.topvisor-confirm-price,
.topvisor-confirm-project {
  background: var(--surface-2);
  border-color: color-mix(in srgb, var(--border) 86%, transparent);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.045);
}
.campaign-metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.campaign-metrics .metric {
  min-width: 0;
}
.campaign-profile-strip {
  grid-column: 1 / -1;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border: 1px solid rgba(75,141,255,.28);
  border-radius: 11px;
  color: var(--muted);
  border-color: rgba(75,141,255,.28);
  background:
    linear-gradient(180deg, rgba(75,141,255,.08), transparent),
    var(--surface-2);
}
.campaign-profile-strip span {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}
.campaign-profile-strip strong {
  font-size: 18px;
  line-height: 1;
}
.campaign-profile-strip small,
.campaign-profile-strip em {
  color: var(--faint);
  font-size: 11px;
  font-style: normal;
  font-weight: 850;
  line-height: 1.2;
}
.campaign-profile-strip em {
  flex: none;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(75,141,255,.12);
  color: var(--blue);
}
.campaign-card .progress {
  flex: none;
  margin-top: 12px;
}

.modal {
  z-index: var(--z-modal);
  background: rgba(4, 5, 8, .78);
}
.modal-card {
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.055), transparent 150px),
    var(--surface-1);
  box-shadow: 0 18px 54px -30px rgba(0,0,0,.95);
}
.modal-head {
  position: sticky;
  top: 0;
  z-index: 2;
  background: color-mix(in srgb, var(--surface-1) 94%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.project-wizard-card {
  width: min(920px, calc(100vw - 34px));
}
.wizard-steps span {
  font-family: var(--font-ui);
  font-weight: 850;
}
.wizard-steps span::after {
  opacity: .5;
}
.schedule-card.active i {
  background: linear-gradient(90deg, var(--accent), rgba(255,255,255,.24));
}
.wizard-error {
  border-color: rgba(255, 63, 47, .34);
  background: rgba(255, 63, 47, .1);
}

.login {
  background:
    radial-gradient(720px 520px at 50% -10%, rgba(255, 63, 47, .18), transparent 62%),
    radial-gradient(680px 540px at 18% 105%, rgba(43, 212, 198, .12), transparent 58%),
    rgba(5, 6, 9, .82);
}
.login-card {
  width: min(480px, calc(100vw - 28px));
  border-radius: 18px;
  background:
    radial-gradient(circle at 24% 0%, rgba(255,63,47,.16), transparent 38%),
    linear-gradient(180deg, rgba(255,255,255,.065), transparent 160px),
    var(--surface-1);
  box-shadow: 0 18px 54px -30px rgba(0,0,0,.95);
}
.login-brand {
  align-items: center;
}
.login-brand h2 {
  font-family: var(--font-brand);
}
.login-points span {
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.topvisor-project-card.active {
  border-color: rgba(255,63,47,.42);
  background:
    linear-gradient(90deg, rgba(255,63,47,.08), transparent 42%),
    var(--surface-1);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}
.topvisor-check-bar i,
.progress i,
.preloader-bar i {
  background: linear-gradient(90deg, var(--accent), var(--accent2));
}
.topvisor-check-bar i::after,
.progress i::after,
.position-stat.loading::after {
  opacity: .75;
}

@media (max-width: 1040px) {
  .topbar {
    position: static;
    margin: 0 0 20px;
    padding: 0;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

@media (max-width: 760px) {
  body {
    padding-bottom: calc(82px + env(safe-area-inset-bottom));
  }
  .rail {
    z-index: var(--z-nav);
    background:
      linear-gradient(180deg, rgba(255,255,255,.06), transparent),
      rgba(8, 10, 14, .96);
  }
  :root[data-theme="light"] .rail {
    background:
      linear-gradient(180deg, rgba(255,255,255,.95), rgba(245,248,252,.94));
  }
  .nav {
    min-height: 56px;
    font-size: 10px;
    border-radius: 14px;
  }
  .main {
    padding-top: 14px;
  }
  .dash-hero,
  .settings-hero,
  .checks-hero,
  .stats-hero {
    padding: 16px;
  }
  .dash-hero h2,
  .settings-hero h2,
  .checks-hero h2,
  .stats-hero h2 {
    font-size: 20px;
  }
  .grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .stat {
    min-height: 108px;
    padding: 13px;
  }
  .stat strong {
    font-size: 23px;
  }
  .stat-top {
    gap: 8px;
  }
  .stat-top span {
    font-size: 10.5px;
  }
  .campaign-actions {
    grid-template-columns: minmax(0, 1fr) 40px 40px;
  }
  .project-wizard-card,
  .modal-card {
    width: min(100vw - 14px, 720px);
    border-radius: 16px;
    max-height: calc(100dvh - 14px);
  }
  .project-wizard {
    min-height: min(720px, calc(100dvh - 18px));
  }
  .wizard-scroll {
    max-height: calc(100dvh - 176px);
  }
  .wizard-foot {
    position: sticky;
    bottom: 0;
    z-index: 2;
  }
  .wizard-foot .btn {
    min-width: 0;
  }
  .table-wrap,
  .topvisor-table-wrap,
  .topvisor-key-table-wrap {
    border-radius: 12px;
  }
}

@media (max-width: 430px) {
  .grid {
    grid-template-columns: 1fr;
  }
  .stat {
    min-height: 96px;
  }
  .campaign-actions {
    grid-template-columns: 1fr 38px 38px;
  }
  .wizard-steps {
    overflow-x: auto;
    scrollbar-width: none;
  }
  .wizard-steps::-webkit-scrollbar {
    display: none;
  }
  .wizard-steps span {
    min-width: max-content;
  }
  .login-card {
    padding: 24px 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}

/* ---------------- compact project wizard ---------------- */
.project-wizard-card {
  width: min(760px, calc(100vw - 28px));
  max-height: min(720px, calc(100dvh - 24px));
  border-radius: 14px;
  overflow: hidden;
}
.project-wizard-card.modal-card {
  padding: 0;
}
.project-wizard-card .modal-head {
  min-height: 54px;
  padding: 16px 18px 10px;
  border-bottom: 0;
}
.project-wizard-card .modal-head h2 {
  font-size: 16px;
  line-height: 1.2;
}
.project-wizard-card .modal-head .icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}
.project-wizard {
  min-height: 0;
  height: min(640px, calc(100dvh - 78px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}
.wizard-steps {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 18px 12px;
  border-bottom: 1px solid var(--soft);
}
.wizard-steps span {
  min-height: 28px;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 11px;
  line-height: 1;
}
.wizard-steps span::after {
  content: "";
  position: static;
  width: 44px;
  height: 1px;
  margin-left: 8px;
  background: var(--border);
}
.wizard-steps span:last-child::after {
  display: none;
}
.wizard-steps .active {
  color: #fff;
  background: linear-gradient(180deg, rgba(255,255,255,.12), transparent 45%), var(--grad-accent);
}
.wizard-steps .done {
  color: #06351f;
  background: linear-gradient(135deg, rgba(49,216,137,.95), rgba(101,230,178,.88));
}
.wizard-scroll {
  max-height: none;
  padding: 16px 18px 18px;
}
.wizard-pane {
  gap: 12px;
}
.project-wizard .field {
  display: grid;
  gap: 6px;
}
.project-wizard .field label {
  font-size: 11px;
  line-height: 1.2;
}
.project-wizard .field label small,
.project-wizard .field-hint {
  font-size: 10.5px;
  color: var(--faint);
}
.project-wizard .field input,
.project-wizard .field select,
.project-wizard select {
  min-height: 40px;
  border-radius: 10px;
  padding-left: 12px;
  padding-right: 34px;
  font-size: 13px;
}
.project-wizard .field textarea {
  min-height: 132px;
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 13px;
}
.wizard-two {
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: 12px;
}
.wizard-region-box {
  min-height: 86px;
  padding: 8px;
  border-radius: 10px;
  background: var(--surface-2);
}
.wizard-region-tags {
  min-height: 24px;
  max-height: 58px;
  overflow: auto;
  gap: 5px;
  margin-bottom: 4px;
}
.wizard-region-tags button {
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10.5px;
}
.wizard-region-box input {
  min-height: 30px;
  font-size: 13px;
}
.wizard-region-actions {
  gap: 6px;
  margin-top: 6px;
}
.mini-soft {
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 11px;
  font-size: 10.5px;
}
.wizard-blue-box,
.wizard-summary,
.wizard-section,
.wizard-option,
.wizard-budget,
.wizard-suggested {
  border-radius: 10px;
}
.wizard-blue-box,
.wizard-section,
.wizard-summary {
  padding: 12px;
}
.wizard-blue-box p {
  margin: 5px 0 10px;
  font-size: 11.5px;
}
.wizard-suggested {
  margin-top: 10px;
}
.wizard-suggested > div {
  padding: 8px;
  flex-wrap: wrap;
}
.wizard-budget {
  max-height: 138px;
  padding: 10px;
}
.wizard-budget > div,
.wizard-budget p {
  grid-template-columns: minmax(0, 1fr) 54px 76px;
  gap: 8px;
  font-size: 11.5px;
}
.wizard-summary p {
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 12px;
  margin: 5px 0;
  font-size: 12px;
}
.wizard-option {
  padding: 12px;
}
.schedule-card {
  margin-top: 7px;
  padding: 10px;
}
.schedule-card i {
  height: 20px;
}
.weekday-grid {
  gap: 6px;
}
.weekday-grid input {
  min-height: 32px;
}
.wizard-foot {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 18px 14px;
  border-top: 1px solid var(--soft);
  background: color-mix(in srgb, var(--surface-1) 94%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.wizard-foot .btn {
  min-height: 40px;
  min-width: 118px;
  padding: 9px 15px;
  border-radius: 10px;
  font-size: 12px;
}
.wizard-foot .btn.teal {
  min-width: 132px;
}

@media (max-width: 760px) {
  .project-wizard-card {
    width: min(100vw - 12px, 760px);
    max-height: calc(100dvh - 12px);
  }
  .project-wizard-card .modal-head {
    padding: 14px 14px 8px;
  }
  .project-wizard {
    height: calc(100dvh - 66px);
  }
  .wizard-steps {
    padding: 0 14px 10px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .wizard-steps::-webkit-scrollbar {
    display: none;
  }
  .wizard-steps span {
    flex: 0 0 auto;
  }
  .wizard-steps span::after {
    width: 22px;
  }
  .wizard-scroll {
    padding: 14px;
  }
  .wizard-two {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .wizard-foot {
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: .82fr 1fr;
  }
  .wizard-foot .btn,
  .wizard-foot .btn.teal {
    width: 100%;
    min-width: 0;
  }
}

/* ---------------- calm light theme ---------------- */
:root[data-theme="light"] {
  --bg: #eef3f8;
  --bg2: #e7edf5;
  --rail: rgba(248, 250, 253, .96);
  --card: #ffffff;
  --card-glass: rgba(255, 255, 255, .96);
  --card2: #f4f7fb;
  --card3: #eaf0f7;
  --border: #cbd7e6;
  --border-strong: #aebdd1;
  --soft: #dde6f1;
  --text: #111827;
  --muted: #536176;
  --faint: #7a879b;
  --surface-1: #ffffff;
  --surface-2: #f5f8fc;
  --surface-3: #eaf0f7;
  --chrome-line: rgba(16, 24, 40, .08);
  --shadow: 0 18px 46px -38px rgba(31, 45, 68, .34);
  --shadow-glow: 0 12px 28px -20px rgba(255, 63, 47, .36);
  --shadow-teal: 0 12px 28px -20px rgba(18, 184, 166, .28);
}

:root[data-theme="light"] body {
  color: var(--text);
  background:
    radial-gradient(820px 480px at 92% -12%, rgba(255, 63, 47, .055), transparent 64%),
    radial-gradient(740px 520px at -12% 112%, rgba(18, 184, 166, .055), transparent 62%),
    linear-gradient(135deg, #f3f7fb 0%, #edf3f9 52%, #e8eef6 100%);
  }

  .profile-folder-nav {
    display: flex;
    margin: 0 0 12px;
    padding: 0 2px 4px;
    gap: 8px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
  }
  .profile-folder-nav::-webkit-scrollbar { height: 0; }
  .folder-jump {
    flex: 0 0 min(232px, 72vw);
    flex-basis: min(232px, 72vw);
    min-height: 56px;
    padding: 10px 11px;
  }
  .folder-jump span { font-size: 12px; }
  .folder-jump strong { min-width: 28px; min-height: 26px; font-size: 11px; }
  .folder-jump small { font-size: 10.5px; }
  .profile-folder { scroll-margin-top: 92px; }

  :root[data-theme="light"] .rail {
  background:
    linear-gradient(180deg, rgba(255,255,255,.94), rgba(247,250,253,.94)),
    var(--rail);
  border-right-color: #d5dfeb;
  box-shadow: 14px 0 38px -34px rgba(31, 45, 68, .4);
}
:root[data-theme="light"] .brand {
  border-bottom-color: #d9e3ef;
}
:root[data-theme="light"] .brand-mark {
  filter: drop-shadow(0 10px 16px rgba(31, 45, 68, .12));
}
:root[data-theme="light"] .brand strong {
  color: #121827;
}
:root[data-theme="light"] .brand span,
:root[data-theme="light"] .rail-locale,
:root[data-theme="light"] .rail-product {
  color: #6e7b91;
}

:root[data-theme="light"] .nav {
  color: #66758c;
  border-color: transparent;
}
:root[data-theme="light"] .nav svg {
  color: #718096;
  opacity: 1;
}
:root[data-theme="light"] .nav:hover {
  color: #182235;
  background: #eef4fa;
  border-color: #d4dfec;
}
:root[data-theme="light"] .nav:hover svg {
  color: #40506a;
  filter: none;
}
:root[data-theme="light"] .nav.active,
:root[data-theme="light"] .nav-group.active > .nav-parent {
  color: #121827;
  background:
    linear-gradient(90deg, rgba(255, 63, 47, .115), rgba(255, 63, 47, .035)),
    #fff8f6;
  border-color: #ffb7ad;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 8px 18px -16px rgba(255, 63, 47, .55);
}
:root[data-theme="light"] .nav.active svg,
:root[data-theme="light"] .nav-group.active > .nav-parent svg {
  color: var(--accent);
  filter: none;
}
:root[data-theme="light"] .nav-sub {
  border-left-color: #d9e3ef;
}
:root[data-theme="light"] .rail-foot {
  background: linear-gradient(180deg, transparent, rgba(248,250,253,.98) 18%);
  border-top-color: #d8e2ee;
}

:root[data-theme="light"] .ready-widget {
  background:
    linear-gradient(135deg, rgba(46, 216, 137, .08), transparent 62%),
    #f7fafc;
  border-color: #cbd8e8;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9);
}
:root[data-theme="light"] .ready-widget .ready-icon {
  color: #087a4a;
  background: #e7f8ef;
  border: 1px solid #b7ebce;
}
:root[data-theme="light"] .ready-widget strong {
  color: #12a266;
}

:root[data-theme="light"] .topbar {
  background: linear-gradient(180deg, rgba(238,243,248,.96), rgba(238,243,248,.78) 72%, transparent);
}
:root[data-theme="light"] h1,
:root[data-theme="light"] h2,
:root[data-theme="light"] h3 {
  color: #111827;
}
:root[data-theme="light"] #viewSubtitle,
:root[data-theme="light"] .muted,
:root[data-theme="light"] .label {
  color: #66758a;
}

:root[data-theme="light"] .card,
:root[data-theme="light"] .settings-panel,
:root[data-theme="light"] .topvisor-project-card,
:root[data-theme="light"] .member-picker-card,
:root[data-theme="light"] .agent-card,
:root[data-theme="light"] .profile-folder,
:root[data-theme="light"] .task-hero,
:root[data-theme="light"] .table-wrap {
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(250,252,255,.98)),
    var(--surface-1);
  border-color: #cbd8e8;
  box-shadow: 0 12px 32px -28px rgba(31,45,68,.38), inset 0 1px 0 rgba(255,255,255,.95);
}
:root[data-theme="light"] .card:hover,
:root[data-theme="light"] .campaign-card:hover,
:root[data-theme="light"] .agent-card:hover,
:root[data-theme="light"] .member-picker-card:hover,
:root[data-theme="light"] .topvisor-project-card:hover {
  border-color: #ffb2a7;
  box-shadow: 0 14px 34px -28px rgba(255, 63, 47, .34), inset 0 1px 0 rgba(255,255,255,.95);
}
:root[data-theme="light"] .profile-folder {
  background:
    linear-gradient(180deg, #ffffff, #fbfdff);
}
:root[data-theme="light"] .profile-folder > .section-head {
  padding-bottom: 12px;
  border-bottom: 1px solid #dde6f1;
}

:root[data-theme="light"] .warmup-summary,
:root[data-theme="light"] .warmup-metrics span,
:root[data-theme="light"] .warmup-modal-head,
:root[data-theme="light"] .metric,
:root[data-theme="light"] .agent-stats span,
:root[data-theme="light"] .member-metric,
:root[data-theme="light"] .system-line,
:root[data-theme="light"] .quick-action,
:root[data-theme="light"] .wizard-region-box,
:root[data-theme="light"] .wizard-summary,
:root[data-theme="light"] .wizard-section,
:root[data-theme="light"] .schedule-card,
:root[data-theme="light"] .traffic-limit-strip span,
:root[data-theme="light"] .wizard-suggested,
:root[data-theme="light"] .wizard-budget,
:root[data-theme="light"] .wizard-option,
:root[data-theme="light"] .topvisor-project-metrics > span,
:root[data-theme="light"] .topvisor-detail-metrics span,
:root[data-theme="light"] .topvisor-confirm-price,
:root[data-theme="light"] .topvisor-confirm-project {
  background: #f6f9fd;
  border-color: #d2deec;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.92);
}
:root[data-theme="light"] .warmup-summary small,
:root[data-theme="light"] .metric span,
:root[data-theme="light"] .agent-stats small {
  color: #6e7c91;
}
:root[data-theme="light"] .campaign-profile-strip {
  background:
    linear-gradient(180deg, rgba(75,141,255,.08), transparent),
    #f6f9fd;
  border-color: #cbdaf0;
}

:root[data-theme="light"] .table-wrap {
  overflow: hidden;
}
:root[data-theme="light"] .table thead th {
  background: #edf3f9;
  color: #65758b;
  border-bottom-color: #ccd9e8;
}
:root[data-theme="light"] .table th,
:root[data-theme="light"] .table td {
  border-bottom-color: #dde6f1;
}
:root[data-theme="light"] .table td {
  color: #182235;
}
:root[data-theme="light"] .table tbody tr {
  background: #fff;
}
:root[data-theme="light"] .table tbody tr:hover {
  background: #fff5f2;
}
:root[data-theme="light"] .mono {
  color: #172033;
}

:root[data-theme="light"] .field input,
:root[data-theme="light"] .field textarea,
:root[data-theme="light"] .field select,
:root[data-theme="light"] select,
:root[data-theme="light"] .metrika-filters input,
:root[data-theme="light"] .weekday-grid input {
  color: #121827;
  background: #f8fbff;
  border-color: #cbd8e8;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.95);
}
:root[data-theme="light"] .field input::placeholder,
:root[data-theme="light"] .field textarea::placeholder {
  color: #7c8ba0;
}
:root[data-theme="light"] .field input:hover,
:root[data-theme="light"] .field textarea:hover,
:root[data-theme="light"] .field select:hover,
:root[data-theme="light"] select:hover {
  border-color: #aebdd1;
}

:root[data-theme="light"] .btn.ghost,
:root[data-theme="light"] .icon-btn,
:root[data-theme="light"] .tab,
:root[data-theme="light"] .theme-toggle,
:root[data-theme="light"] .agent-hint {
  color: #516078;
  background: #f4f7fb;
  border-color: #c6d3e4;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.95);
}
:root[data-theme="light"] .btn.ghost:hover,
:root[data-theme="light"] .icon-btn:hover,
:root[data-theme="light"] .tab:hover,
:root[data-theme="light"] .theme-toggle:hover {
  color: #172033;
  background: #ffffff;
  border-color: #ffb2a7;
}
:root[data-theme="light"] .icon-btn svg,
:root[data-theme="light"] .btn.ghost svg {
  color: currentColor;
  stroke: currentColor;
}
:root[data-theme="light"] .icon-btn.danger:hover {
  color: #e33120;
  border-color: #ffafa3;
  background: #fff5f2;
}

:root[data-theme="light"] .pill {
  color: #5b687d;
  background: #f1f5fa;
  border-color: #d2deec;
}
:root[data-theme="light"] .pill.ready,
:root[data-theme="light"] .pill.done,
:root[data-theme="light"] .pill.success,
:root[data-theme="light"] .pill.found {
  color: #087a4a;
  background: #e9fbf2;
  border-color: #b9ebd0;
}
:root[data-theme="light"] .pill.running,
:root[data-theme="light"] .pill.online,
:root[data-theme="light"] .pill.searching {
  color: #2857b8;
  background: #eaf1ff;
  border-color: #c4d6ff;
}
:root[data-theme="light"] .pill.stopped,
:root[data-theme="light"] .pill.warn,
:root[data-theme="light"] .pill.busy,
:root[data-theme="light"] .pill.warming,
:root[data-theme="light"] .pill.queued {
  color: #9a5c00;
  background: #fff6df;
  border-color: #f3d899;
}
:root[data-theme="light"] .pill.error,
:root[data-theme="light"] .pill.offline,
:root[data-theme="light"] .pill.failed,
:root[data-theme="light"] .pill.not_found {
  color: #c73022;
  background: #fff0ed;
  border-color: #ffc6bd;
}

:root[data-theme="light"] .modal {
  background: rgba(18, 28, 45, .42);
}
:root[data-theme="light"] .modal-card,
:root[data-theme="light"] .login-card,
:root[data-theme="light"] .preloader-core {
  background: #ffffff;
  border-color: #cbd8e8;
}

@media (max-width: 760px) {
  :root[data-theme="light"] .rail {
    background: rgba(248,250,253,.97);
    border-top-color: #d2deec;
    box-shadow: 0 -18px 38px -30px rgba(31,45,68,.36);
  }
}

/* ---------------- theme motion ---------------- */
body,
.rail,
.topbar,
.card,
.settings-panel,
.topvisor-project-card,
.member-picker-card,
.agent-card,
.profile-folder,
.task-hero,
.table-wrap,
.modal-card,
.login-card,
.preloader-core,
.nav,
.btn,
.icon-btn,
.tab,
.theme-toggle,
.top-recharge,
.top-notify,
.rail-logout,
input,
textarea,
select {
  transition:
    color .38s cubic-bezier(.22,1,.36,1),
    background-color .38s cubic-bezier(.22,1,.36,1),
    border-color .38s cubic-bezier(.22,1,.36,1),
    box-shadow .38s cubic-bezier(.22,1,.36,1),
    filter .38s cubic-bezier(.22,1,.36,1),
    transform .16s cubic-bezier(.2,.7,.3,1);
}
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: .82s;
  animation-timing-function: cubic-bezier(.22, 1, .36, 1);
  mix-blend-mode: normal;
}
::view-transition-old(root) {
  animation: none;
}
::view-transition-new(root) {
  animation-name: themeReveal;
}
@keyframes themeReveal {
  from { clip-path: circle(0 at var(--theme-x, 50%) var(--theme-y, 48px)); }
  to { clip-path: circle(150vmax at var(--theme-x, 50%) var(--theme-y, 48px)); }
}

/* ---------------- top utility bar ---------------- */
.userbox {
  flex: none;
}
.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
.top-actions .theme-toggle,
.top-recharge,
.top-notify,
.top-avatar,
.rail-logout {
  min-height: 38px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  box-shadow: inset 0 1px 0 var(--chrome-line);
}
.top-actions .theme-toggle {
  padding: 0 14px;
  font-size: 12px;
}
.top-recharge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 15px;
  color: #fff;
  cursor: default;
  font-weight: 850;
  letter-spacing: 0;
  background: #f04438;
  border-color: #f04438;
  box-shadow: none;
}
.top-recharge svg {
  width: 16px;
  height: 16px;
  opacity: .96;
}
.top-recharge span {
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}
.top-recharge:hover {
  color: #fff;
  background: #ff5a4d;
  border-color: #ff5a4d;
  transform: translateY(-1px);
  box-shadow: 0 8px 16px -13px rgba(255, 70, 55, .8);
}
.top-recharge:active {
  transform: translateY(0);
  background: #d9362c;
  border-color: #d9362c;
}
.top-recharge:focus-visible {
  outline: 3px solid rgba(255, 90, 77, .26);
  outline-offset: 2px;
}
.top-notify {
  position: relative;
  width: 40px;
  display: grid;
  place-items: center;
  cursor: default;
}
.top-notify svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.2;
}
.top-notify i {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--surface-2);
}
.top-avatar {
  width: 40px;
  display: grid;
  place-items: center;
  color: #fff;
  font-family: var(--font-brand);
  font-size: 13px;
  font-weight: 900;
  background: linear-gradient(135deg, #6d5cff, #5738d9);
  border-color: rgba(109, 92, 255, .45);
}
.rail-user {
  grid-template-columns: 38px minmax(0, 1fr) 34px;
}
.rail-logout {
  width: 34px;
  min-height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
}
.rail-logout svg {
  width: 17px;
  height: 17px;
}
.rail-logout:hover {
  color: var(--accent);
  border-color: rgba(255, 63, 47, .42);
  background: rgba(255, 63, 47, .09);
}

:root[data-theme="light"] .top-actions .theme-toggle,
:root[data-theme="light"] .top-notify,
:root[data-theme="light"] .rail-logout {
  color: #5b687d;
  background: #f7f9fd;
  border-color: #d2deec;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.96), 0 8px 18px -16px rgba(31,45,68,.34);
}
:root[data-theme="light"] .top-actions .theme-toggle:hover,
:root[data-theme="light"] .top-notify:hover {
  color: #172033;
  background: #fff;
  border-color: #c1cfdf;
}
:root[data-theme="light"] .top-recharge {
  color: #fff;
  background: #e83f34;
  border-color: #e83f34;
  box-shadow: none;
}
:root[data-theme="light"] .top-recharge:hover {
  color: #fff;
  background: #f25549;
  border-color: #f25549;
  box-shadow: 0 8px 16px -13px rgba(211, 55, 46, .55);
}
:root[data-theme="light"] .top-notify i {
  box-shadow: 0 0 0 3px #f7f9fd;
}
:root[data-theme="light"] .top-avatar {
  background: linear-gradient(135deg, #6b5cff, #4938d8);
  border-color: rgba(73,56,216,.34);
}
:root[data-theme="light"] .rail-user {
  background: transparent;
}
:root[data-theme="light"] .rail-logout:hover {
  color: #e33120;
  border-color: #ffafa3;
  background: #fff5f2;
}

@media (max-width: 760px) {
  .top-actions {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none;
  }
}

/* ============================================================
   Project wizard — full-width stepper with gradient progress
   fill + branded range slider. Appended last so it wins the
   cascade over the earlier, drifted wizard rules.
   ============================================================ */
.wizard-steps { display: none; } /* legacy pill stepper, replaced by .wizard-stepper */
.wizard-stepper { padding: 8px 24px 26px; }
.wizard-nodes {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.wizard-track {
  position: absolute; left: 14px; right: 14px; top: 12px;
  height: 3px; border-radius: 999px; background: var(--border);
}
.wizard-fill {
  height: 100%; width: 100%; border-radius: inherit;
  transform-origin: left center;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  box-shadow: 0 0 10px rgba(252,63,29,.5);
  transition: transform .35s cubic-bezier(.22,1,.36,1);
}
.wizard-node { position: relative; width: 28px; display: grid; justify-items: center; }
.wizard-dot {
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: "Unbounded", sans-serif; font-size: 12px; font-weight: 900;
  background: var(--card2); color: var(--muted);
  border: 1px solid var(--border);
  transition: background .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.wizard-node.done .wizard-dot,
.wizard-node.active .wizard-dot {
  background: var(--accent); color: #fff; border-color: var(--accent);
}
.wizard-node.active .wizard-dot { box-shadow: 0 0 0 4px rgba(252,63,29,.18); }
.wizard-node-label {
  position: absolute; top: calc(100% + 7px); left: 50%; transform: translateX(-50%);
  white-space: nowrap; font-size: 11.5px; font-weight: 800; color: var(--faint);
  transition: color .2s ease;
}
.wizard-node.active .wizard-node-label,
.wizard-node.done .wizard-node-label { color: var(--text); }

/* branded range slider (was unstyled native) */
.wizard-pane input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 6px; margin: 9px 0 4px;
  border-radius: 999px; background: var(--border); outline: none; cursor: pointer;
}
.wizard-pane input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent); border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(252,63,29,.5); cursor: pointer;
  transition: box-shadow .15s ease;
}
.wizard-pane input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%; border: 3px solid #fff;
  background: var(--accent); box-shadow: 0 2px 8px rgba(252,63,29,.5); cursor: pointer;
}
.wizard-pane input[type="range"]:focus-visible { outline: none; }
.wizard-pane input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 5px rgba(252,63,29,.25); }
.wizard-pane input[type="range"]:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 5px rgba(252,63,29,.25); }

/* kill the last blue drift (Metrika keys box) → brand surface */
.wizard-blue-box { background: var(--card2); border-color: var(--border); }
.wizard-blue-box strong { color: var(--text); }

/* the budget block is now a stable in-place update target */
.wizard-budget:empty { display: none; }

@media (prefers-reduced-motion: reduce) {
  .wizard-fill, .wizard-dot, .wizard-node-label,
  .wizard-pane input[type="range"]::-webkit-slider-thumb { transition: none; }
}

/* ============================================================
   Project wizard polish — final cascade layer.
   Keeps the campaign modal compact, aligned and scroll-stable.
   ============================================================ */
.project-wizard-card.modal-card {
  width: min(820px, calc(100vw - 28px));
  max-height: min(740px, calc(100dvh - 24px));
  border-radius: 16px;
  overflow: hidden;
}
.project-wizard-card .modal-head {
  min-height: 58px;
  padding: 18px 20px 8px;
  border-bottom: 0;
}
.project-wizard-card .modal-head h2 {
  font-size: 18px;
  line-height: 1.1;
}
.project-wizard {
  height: auto !important;
  max-height: min(660px, calc(100dvh - 82px));
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}
.wizard-stepper {
  padding: 8px 24px 24px;
  border-bottom: 1px solid var(--soft);
}
.wizard-nodes {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: center;
}
.wizard-track {
  position: absolute;
  left: calc(16.666% + 14px);
  right: calc(16.666% + 14px);
  top: 50%;
  height: 4px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--border) 78%, transparent);
  transform: translateY(-50%);
  overflow: hidden;
  z-index: 0;
}
.wizard-fill {
  width: 100%;
  height: 100%;
  transform-origin: left center;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  box-shadow: 0 0 18px rgba(252,63,29,.42);
  transition: transform .42s cubic-bezier(.22,1,.36,1);
}
.wizard-node {
  position: relative;
  z-index: 1;
  width: auto;
  min-width: 0;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--card2) 94%, transparent);
}
.wizard-dot {
  width: 24px;
  height: 24px;
  flex: none;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-family: "Unbounded", sans-serif;
  font-size: 11px;
  font-weight: 900;
  color: var(--muted);
  background: var(--card3);
  border: 1px solid var(--border-strong);
}
.wizard-node-label {
  position: static;
  transform: none;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}
.wizard-node.done,
.wizard-node.active {
  border-color: rgba(252,63,29,.42);
  background: linear-gradient(180deg, rgba(252,63,29,.13), rgba(255,255,255,.018)), var(--card2);
}
.wizard-node.done .wizard-dot,
.wizard-node.active .wizard-dot {
  color: #fff;
  background: var(--grad-accent);
  border-color: transparent;
  box-shadow: 0 10px 22px -14px rgba(252,63,29,.8);
}
.wizard-node.active {
  box-shadow: 0 18px 42px -34px rgba(252,63,29,.75), inset 0 1px 0 rgba(255,255,255,.08);
}
.wizard-node.active .wizard-node-label,
.wizard-node.done .wizard-node-label {
  color: var(--text);
}
.wizard-scroll {
  min-height: 0;
  overflow: auto;
  max-height: calc(100dvh - 252px);
  padding: 18px 20px 20px;
  scroll-behavior: auto;
}
.wizard-pane {
  display: grid;
  gap: 14px;
}
.wizard-two {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: 12px;
  align-items: start;
}
.wizard-two > .field {
  align-self: start;
  min-height: 0;
}
.project-wizard .field {
  gap: 7px;
  min-width: 0;
}
.project-wizard .field label {
  min-height: 15px;
  color: var(--faint);
  font-size: 11.5px;
  font-weight: 900;
}
.project-wizard .field input,
.project-wizard .field select,
.project-wizard select {
  min-height: 44px;
  height: 44px;
  border-radius: 10px;
  padding: 0 13px;
  font-size: 13px;
}
.project-wizard .field textarea {
  min-height: 132px;
  border-radius: 10px;
  padding: 12px 13px;
  font-size: 13px;
}
.wizard-region-box {
  min-height: 0;
  padding: 8px;
  border-radius: 10px;
}
.wizard-region-tags {
  min-height: 27px;
  max-height: 58px;
  overflow: auto;
  margin-bottom: 6px;
}
.wizard-region-box input {
  min-height: 36px;
  height: 36px;
}
.wizard-region-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.wizard-blue-box,
.wizard-summary,
.wizard-section,
.wizard-option,
.wizard-budget,
.wizard-suggested {
  border-radius: 12px;
}
.wizard-budget {
  max-height: 172px;
  overflow: auto;
}
.wizard-budget > div,
.wizard-budget p {
  grid-template-columns: minmax(0, 1fr) 66px 88px;
}
.wizard-pane input[type="range"] {
  height: 8px;
  padding: 0;
  border: 0;
  background: linear-gradient(90deg, var(--accent) 0 var(--range-pct, 19%), color-mix(in srgb, var(--border) 82%, transparent) var(--range-pct, 19%) 100%);
}
.project-wizard .wizard-pane input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  min-height: 4px;
  padding: 0;
  margin: 14px 0 8px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent) 0 var(--range-pct, 19%), var(--border) var(--range-pct, 19%) 100%);
  box-shadow: none;
}
.project-wizard .wizard-pane input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 3px solid #fff;
  background: var(--accent);
  box-shadow: 0 4px 12px -6px rgba(252,63,29,.9);
}
.project-wizard .wizard-pane input[type="range"]::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 3px solid #fff;
  background: var(--accent);
  box-shadow: 0 4px 12px -6px rgba(252,63,29,.9);
}
.project-wizard .wizard-pane input[type="range"]::-moz-range-track {
  height: 4px;
  border: 0;
  border-radius: 999px;
  background: var(--border);
}
.project-wizard .wizard-pane input[type="range"]::-moz-range-progress {
  height: 4px;
  border-radius: 999px;
  background: var(--accent);
}
.project-wizard .wizard-pane input[type="range"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(252,63,29,.14);
}
.wizard-foot {
  position: sticky;
  bottom: 0;
  min-height: 72px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  padding: 13px 20px 16px;
  border-top: 1px solid var(--soft);
  background: color-mix(in srgb, var(--card) 88%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.wizard-foot .btn,
.wizard-foot .btn.teal,
.wizard-foot .btn.ghost {
  flex: 0 0 auto !important;
  width: auto !important;
  min-width: 128px;
  height: 44px !important;
  min-height: 44px !important;
  padding: 0 18px;
  border-radius: 12px;
}
.wizard-foot .btn.teal {
  min-width: 152px;
}

@media (max-width: 760px) {
  .project-wizard-card.modal-card {
    width: min(100vw - 12px, 820px);
    max-height: calc(100dvh - 12px);
  }
  .project-wizard-card .modal-head {
    padding: 14px 14px 8px;
  }
  .project-wizard {
    height: auto !important;
    max-height: calc(100dvh - 66px);
  }
  .wizard-stepper {
    padding: 4px 14px 18px;
  }
  .wizard-nodes {
    gap: 6px;
  }
  .wizard-track {
    left: calc(16.666% + 10px);
    right: calc(16.666% + 10px);
  }
  .wizard-node {
    min-height: 38px;
    padding: 7px 6px;
    gap: 5px;
    border-radius: 10px;
  }
  .wizard-dot {
    width: 21px;
    height: 21px;
    font-size: 10px;
  }
  .wizard-node-label {
    font-size: 10.5px;
  }
  .wizard-scroll {
    padding: 14px;
    max-height: calc(100dvh - 218px);
  }
  .wizard-two {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .wizard-budget > div,
  .wizard-budget p {
    grid-template-columns: minmax(0, 1fr) 54px 76px;
  }
  .wizard-foot {
    min-height: 66px;
    display: grid;
    grid-template-columns: .82fr 1fr;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  }
  .wizard-foot .btn,
  .wizard-foot .btn.teal,
  .wizard-foot .btn.ghost {
    width: 100% !important;
    min-width: 0;
  }
}

/* selected schedule cards are always red, even before a wizard re-render */
.project-wizard .schedule-card:has(input:checked) {
  border-color: rgba(255, 63, 47, .72);
  background:
    linear-gradient(135deg, rgba(255, 63, 47, .14), rgba(255, 122, 69, .045) 58%, transparent),
    var(--card2);
  box-shadow: 0 18px 46px -38px rgba(255, 63, 47, .7), inset 0 1px 0 rgba(255,255,255,.06);
}
.project-wizard .schedule-card:has(input:checked) strong {
  color: var(--text);
}
.project-wizard .schedule-card:has(input:checked) i {
  background: linear-gradient(90deg, var(--accent), rgba(255, 122, 69, .22));
  opacity: 1;
}

/* Project-wide toggle style: no native tiny square/circle controls. */
input[type="checkbox"],
input[type="radio"] {
  -webkit-appearance: none;
  appearance: none;
  width: 36px !important;
  height: 20px !important;
  min-width: 36px;
  flex: none;
  position: relative;
  display: inline-block;
  vertical-align: middle;
  border: 1px solid var(--border-strong);
  border-radius: 999px !important;
  background: color-mix(in srgb, var(--card3) 92%, #000 8%);
  box-shadow: inset 0 1px 2px rgba(0,0,0,.24);
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, box-shadow .18s ease;
}
input[type="checkbox"]::before,
input[type="radio"]::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 2px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 2px 7px rgba(0,0,0,.35);
  transition: transform .18s cubic-bezier(.2,.7,.3,1);
}
input[type="checkbox"]:checked,
input[type="radio"]:checked {
  border-color: rgba(255,63,47,.85);
  background: var(--grad-accent);
  box-shadow: 0 8px 20px -14px rgba(252,63,29,.85), inset 0 1px 0 rgba(255,255,255,.16);
}
input[type="checkbox"]:checked::before,
input[type="radio"]:checked::before {
  transform: translateX(16px);
}
input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(252,63,29,.17), inset 0 1px 2px rgba(0,0,0,.18);
}
input[type="checkbox"]:disabled,
input[type="radio"]:disabled {
  opacity: .5;
  cursor: default;
}
.check-row input,
.wizard-option input,
.schedule-card input,
.metrika-table input[type="checkbox"],
.profile-check,
.region-check {
  margin: 0;
}
.wizard-option,
.schedule-card {
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: start;
}
.check-row {
  align-items: center;
}

/* Toasts: capped in JS, animated in CSS, auto-hide progress line. */
.notices {
  position: fixed;
  right: 22px;
  top: 22px;
  z-index: 120;
  width: min(420px, calc(100vw - 28px));
  display: grid;
  gap: 10px;
  pointer-events: none;
}
.notice {
  pointer-events: auto;
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 5px;
  padding: 14px 42px 16px 15px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(255,255,255,.06), transparent),
    color-mix(in srgb, var(--card) 94%, #000 6%);
  box-shadow: 0 24px 70px -34px rgba(0,0,0,.92);
  animation: noticePop .48s cubic-bezier(.16,1.28,.34,1) both;
}
.notice::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: var(--accent);
  transform-origin: left center;
  animation: noticeTimer var(--notice-ttl, 9000ms) linear forwards;
}
.notice strong {
  font-family: "Unbounded", sans-serif;
  font-size: 12px;
  color: var(--text);
}
.notice span {
  white-space: pre-line;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 800;
  line-height: 1.45;
}
.notice button {
  position: absolute;
  right: 10px;
  top: 9px;
  width: 25px;
  height: 25px;
  border: 0;
  border-radius: 9px;
  background: rgba(255,255,255,.04);
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}
.notice.warn { border-color: rgba(255,176,32,.36); box-shadow: 0 24px 70px -34px rgba(255,176,32,.38); }
.notice.warn::after { background: var(--amber); }
.notice.error { border-color: rgba(252,63,29,.46); box-shadow: 0 24px 70px -34px rgba(252,63,29,.48); }
.notice.error::after { background: var(--grad-accent); }
.notice.success { border-color: rgba(46,224,138,.34); box-shadow: 0 24px 70px -34px rgba(46,224,138,.34); }
.notice.success::after { background: var(--green); }

@keyframes noticePop {
  0% { opacity: 0; transform: translateX(34px) scale(.96); }
  65% { opacity: 1; transform: translateX(-5px) scale(1.015); }
  100% { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes noticeTimer {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

@media (max-width: 760px) {
  .notices {
    left: 12px;
    right: 12px;
    top: 12px;
    width: auto;
  }
  .notice {
    animation-name: noticePopMobile;
  }
}
@keyframes noticePopMobile {
  0% { opacity: 0; transform: translateY(-18px) scale(.96); }
  65% { opacity: 1; transform: translateY(4px) scale(1.01); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* Metric cards: safe gradient border, no negative layers. */
.stat.card {
  --stat-a: #fc3f1d;
  --stat-b: #4b8dff;
  min-height: 146px;
  border: 2px solid transparent;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(24,29,39,.98), rgba(12,15,22,.98)) padding-box,
    linear-gradient(145deg, color-mix(in srgb, var(--stat-a) 86%, #fff 6%), color-mix(in srgb, var(--stat-b) 76%, #fff 4%) 58%, rgba(255,255,255,.18)) border-box;
  box-shadow:
    0 20px 46px -34px rgba(0,0,0,.98),
    0 0 0 1px rgba(255,255,255,.035),
    0 0 22px -16px color-mix(in srgb, var(--stat-a) 58%, transparent);
  transition: transform .22s cubic-bezier(.22,1,.36,1), box-shadow .22s cubic-bezier(.22,1,.36,1);
}
.stat.card.b { --stat-a: #4b8dff; --stat-b: #8b5cf6; }
.stat.card.c { --stat-a: #ffb020; --stat-b: #fc3f1d; }
.stat.card::before {
  opacity: .65;
}
.stat.card::after {
  content: "";
  position: absolute;
  inset: 1px;
  height: auto;
  border-radius: 12px;
  background:
    radial-gradient(260px 120px at 100% 0%, color-mix(in srgb, var(--stat-a) 14%, transparent), transparent 62%),
    linear-gradient(180deg, rgba(255,255,255,.06), transparent 42%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.075), inset 0 0 0 1px rgba(255,255,255,.03);
  pointer-events: none;
}
.stat.card .stat-top,
.stat.card > div:not(.stat-top) {
  position: relative;
  z-index: 1;
}
.stat.card:hover {
  transform: translateY(-2px);
  box-shadow:
    0 20px 46px -34px rgba(0,0,0,.98),
    0 0 0 1px color-mix(in srgb, var(--stat-a) 36%, transparent),
    0 0 30px -10px color-mix(in srgb, var(--stat-a) 44%, transparent);
}
.stat.card .stat-icon {
  color: var(--stat-a);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--stat-a) 20%, transparent), color-mix(in srgb, var(--stat-a) 9%, transparent)),
    rgba(255,255,255,.025);
  border: 1px solid color-mix(in srgb, var(--stat-a) 36%, transparent);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 12px 26px -18px var(--stat-a);
}
:root[data-theme="light"] .stat.card {
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,250,254,.98)) padding-box,
    linear-gradient(145deg, color-mix(in srgb, var(--stat-a) 78%, #fff 12%), color-mix(in srgb, var(--stat-b) 70%, #fff 10%)) border-box;
  box-shadow:
    0 18px 40px -34px rgba(45,56,75,.5),
    0 0 0 1px rgba(24,34,49,.035),
    0 0 18px -14px color-mix(in srgb, var(--stat-a) 42%, transparent);
}
:root[data-theme="light"] .stat.card::after {
  background:
    radial-gradient(260px 120px at 100% 0%, color-mix(in srgb, var(--stat-a) 10%, transparent), transparent 62%),
    linear-gradient(180deg, rgba(255,255,255,.78), transparent 44%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), inset 0 0 0 1px rgba(24,34,49,.025);
}
@media (max-width: 520px) {
  .stat.card {
    min-height: 118px;
    padding: 16px;
    border-radius: 13px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .stat.card { transition: none; }
  .stat.card:hover { transform: none; }
}

/* Glass radio tabs, repeated from the requested pattern. */
.task-stat-strip {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}
.task-stat-strip .stat.card {
  min-height: 124px;
  padding: 18px 20px;
}
.task-stat-strip .stat strong {
  font-size: 22px;
}
.task-stat-strip .stat-icon {
  width: 38px;
  height: 38px;
}
.task-stat-strip .stat-icon svg {
  width: 19px;
  height: 19px;
}
.tabs.glass-radio-group {
  --bg: rgba(255, 255, 255, 0.06);
  --text: #e5e5e5;
  display: flex;
  position: relative;
  width: fit-content;
  max-width: 100%;
  margin: 18px auto;
  padding: 0;
  gap: 0;
  justify-content: center;
  background: var(--bg);
  border: 0;
  border-radius: 1rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow:
    inset 1px 1px 4px rgba(255, 255, 255, 0.2),
    inset -1px -1px 6px rgba(0, 0, 0, 0.3),
    0 4px 12px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}
.tabs.glass-radio-group input {
  display: none;
}
.tabs.glass-radio-group .tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  margin: 0;
  padding: .8rem 1.35rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .3px;
  position: relative;
  z-index: 2;
  transition: color .3s ease-in-out;
}
.tabs.glass-radio-group .tab:hover,
.tabs.glass-radio-group .tab.active {
  color: #fff;
  background: transparent;
  transform: none;
}
.glass-glider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: calc(100% / var(--tabs-count, 1));
  border-radius: 1rem;
  z-index: 1;
  transform: translateX(calc(var(--active-index, 0) * 100%));
  background: linear-gradient(135deg, rgba(252, 63, 29, .42), #ff4f3d);
  box-shadow:
    0 0 18px rgba(252, 63, 29, 0.5),
    0 0 10px rgba(255, 170, 145, 0.4) inset;
  transition:
    transform .5s cubic-bezier(.37, 1.95, .66, .56),
    background .4s ease-in-out,
    box-shadow .4s ease-in-out;
}
#task-tab-overview:checked ~ .glass-glider { transform: translateX(0%); }
#task-tab-positions:checked ~ .glass-glider { transform: translateX(100%); }
#task-tab-clicks:checked ~ .glass-glider { transform: translateX(200%); }
#task-tab-activity:checked ~ .glass-glider { transform: translateX(300%); }
#task-tab-queue:checked ~ .glass-glider { transform: translateX(400%); }
#task-tab-behavior:checked ~ .glass-glider { transform: translateX(500%); }
#task-tab-settings:checked ~ .glass-glider { transform: translateX(600%); }
:root[data-theme="light"] .tabs.glass-radio-group {
  --bg: rgba(255,255,255,.72);
  --text: #5e687a;
  box-shadow:
    inset 1px 1px 4px rgba(255,255,255,.9),
    inset -1px -1px 6px rgba(24,34,49,.1),
    0 4px 14px rgba(45,56,75,.1);
}
@media (max-width: 1180px) {
  .task-stat-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 760px) {
  .task-stat-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .tabs.glass-radio-group {
    width: 100%;
    margin: 14px 0;
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .tabs.glass-radio-group::-webkit-scrollbar { display: none; }
  .tabs.glass-radio-group .tab {
    min-width: 92px;
    flex: 0 0 92px;
    padding: .75rem 1rem;
  }
  .glass-glider {
    width: 92px;
  }
}
@media (max-width: 520px) {
  .task-stat-strip {
    grid-template-columns: 1fr;
  }
}

/* Andrew-style sliced preloader text */
.preloader-core {
  width: min(520px, calc(100vw - 44px));
  gap: 14px;
}
.preloader-core > strong {
  margin-top: 2px;
}
.preloader .loader {
  --main-size: clamp(3.2em, 9vw, 5.4em);
  --text-color: #ffffff;
  --shine-color: #ffffff40;
  --shadow-color: #ff4f3d;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  user-select: none;
  position: relative;
  font-size: var(--main-size);
  font-family: "Unbounded", Manrope, sans-serif;
  font-weight: 900;
  text-transform: uppercase;
  color: var(--text-color);
  width: min(7.6em, calc(100vw - 56px));
  height: 1.28em;
  filter: drop-shadow(0 0 .08em var(--shine-color));
}
.preloader .loader .text {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  position: absolute;
}
.preloader .loader .text:nth-child(1) { clip-path: polygon(0% 0%, 11.11% 0%, 11.11% 100%, 0% 100%); font-size: calc(var(--main-size) / 20); margin-left: -2.1em; opacity: .6; }
.preloader .loader .text:nth-child(2) { clip-path: polygon(11.11% 0%, 22.22% 0%, 22.22% 100%, 11.11% 100%); font-size: calc(var(--main-size) / 16); margin-left: -.98em; opacity: .7; }
.preloader .loader .text:nth-child(3) { clip-path: polygon(22.22% 0%, 33.33% 0%, 33.33% 100%, 22.22% 100%); font-size: calc(var(--main-size) / 13); margin-left: -.33em; opacity: .8; }
.preloader .loader .text:nth-child(4) { clip-path: polygon(33.33% 0%, 44.44% 0%, 44.44% 100%, 33.33% 100%); font-size: calc(var(--main-size) / 11); margin-left: -.05em; opacity: .9; }
.preloader .loader .text:nth-child(5) { clip-path: polygon(44.44% 0%, 55.55% 0%, 55.55% 100%, 44.44% 100%); font-size: calc(var(--main-size) / 10); margin-left: 0; opacity: 1; }
.preloader .loader .text:nth-child(6) { clip-path: polygon(55.55% 0%, 66.66% 0%, 66.66% 100%, 55.55% 100%); font-size: calc(var(--main-size) / 11); margin-left: .05em; opacity: .9; }
.preloader .loader .text:nth-child(7) { clip-path: polygon(66.66% 0%, 77.77% 0%, 77.77% 100%, 66.66% 100%); font-size: calc(var(--main-size) / 13); margin-left: .33em; opacity: .8; }
.preloader .loader .text:nth-child(8) { clip-path: polygon(77.77% 0%, 88.88% 0%, 88.88% 100%, 77.77% 100%); font-size: calc(var(--main-size) / 16); margin-left: .98em; opacity: .7; }
.preloader .loader .text:nth-child(9) { clip-path: polygon(88.88% 0%, 100% 0%, 100% 100%, 88.88% 100%); font-size: calc(var(--main-size) / 20); margin-left: 2.1em; opacity: .6; }
.preloader .loader .text span {
  animation:
    loaderScrolling 2s cubic-bezier(.1, .6, .9, .4) infinite,
    loaderShadow 2s cubic-bezier(.1, .6, .9, .4) infinite;
}
.preloader .loader .text:nth-child(1) span { background: linear-gradient(to right, var(--text-color) 4%, var(--shadow-color) 7%); background-size: 200% auto; background-clip: text; -webkit-background-clip: text; color: transparent; }
.preloader .loader .text:nth-child(2) span { background: linear-gradient(to right, var(--text-color) 9%, var(--shadow-color) 13%); background-size: 200% auto; background-clip: text; -webkit-background-clip: text; color: transparent; }
.preloader .loader .text:nth-child(3) span { background: linear-gradient(to right, var(--text-color) 15%, var(--shadow-color) 18%); background-size: 200% auto; background-clip: text; -webkit-background-clip: text; color: transparent; }
.preloader .loader .text:nth-child(4) span { background: linear-gradient(to right, var(--text-color) 20%, var(--shadow-color) 23%); background-size: 200% auto; background-clip: text; -webkit-background-clip: text; color: transparent; }
.preloader .loader .text:nth-child(6) span { background: linear-gradient(to right, var(--shadow-color) 29%, var(--text-color) 32%); background-size: 200% auto; background-clip: text; -webkit-background-clip: text; color: transparent; }
.preloader .loader .text:nth-child(7) span { background: linear-gradient(to right, var(--shadow-color) 34%, var(--text-color) 37%); background-size: 200% auto; background-clip: text; -webkit-background-clip: text; color: transparent; }
.preloader .loader .text:nth-child(8) span { background: linear-gradient(to right, var(--shadow-color) 39%, var(--text-color) 42%); background-size: 200% auto; background-clip: text; -webkit-background-clip: text; color: transparent; }
.preloader .loader .text:nth-child(9) span { background: linear-gradient(to right, var(--shadow-color) 45%, var(--text-color) 48%); background-size: 200% auto; background-clip: text; -webkit-background-clip: text; color: transparent; }
.preloader .loader .line {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  height: .05em;
  width: calc(var(--main-size) / 2);
  margin-top: .95em;
  border-radius: .05em;
}
.preloader .loader .line::before,
.preloader .loader .line::after {
  content: "";
  position: absolute;
  height: 100%;
  width: 100%;
  background-color: var(--text-color);
}
.preloader .loader .line::before { opacity: .3; }
.preloader .loader .line::after {
  border-radius: .05em;
  transform: translateX(-90%);
  animation: loaderWobble 2s cubic-bezier(.5, .8, .5, .2) infinite;
}
@keyframes loaderWobble {
  0% { transform: translateX(-90%); }
  50% { transform: translateX(90%); }
  100% { transform: translateX(-90%); }
}
@keyframes loaderScrolling {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
@keyframes loaderShadow {
  0% { background-position: -98% 0; }
  100% { background-position: 102% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .preloader .loader .text span,
  .preloader .loader .line::after {
    animation: none;
  }
}

/* Compact centered sliced loader */
.preloader-core {
  width: min(460px, calc(100vw - 44px));
  padding: 36px 34px 34px;
  justify-items: center;
}
.preloader-core img {
  width: 76px;
  height: 76px;
}
.preloader .loader {
  --main-size: clamp(2.85em, 7.2vw, 4.25em);
  width: min(6.45em, 100%);
  max-width: 100%;
  height: 1.08em;
  text-transform: uppercase;
  margin-inline: auto;
}
.preloader .loader .text {
  width: auto;
  letter-spacing: 0;
}
.preloader .loader .text span {
  animation:
    loaderScrolling 2s cubic-bezier(.1, .6, .9, .4) infinite,
    loaderShadow 2s cubic-bezier(.1, .6, .9, .4) infinite;
}
.preloader .loader .line {
  width: min(2.45em, 62%);
  margin-top: .88em;
}

/* SelfMadeSystem-inspired rain background for boot loader */
.preloader {
  --loader-rain: #ff3f2f;
  overflow: hidden;
  isolation: isolate;
  background-color: #050609;
  background-image:
    radial-gradient(4px 100px at 0px 235px, var(--loader-rain), #0000),
    radial-gradient(4px 100px at 300px 235px, var(--loader-rain), #0000),
    radial-gradient(1.5px 1.5px at 150px 117.5px, var(--loader-rain) 100%, #0000 150%),
    radial-gradient(4px 100px at 0px 252px, var(--loader-rain), #0000),
    radial-gradient(4px 100px at 300px 252px, var(--loader-rain), #0000),
    radial-gradient(1.5px 1.5px at 150px 126px, var(--loader-rain) 100%, #0000 150%),
    radial-gradient(4px 100px at 0px 150px, var(--loader-rain), #0000),
    radial-gradient(4px 100px at 300px 150px, var(--loader-rain), #0000),
    radial-gradient(1.5px 1.5px at 150px 75px, var(--loader-rain) 100%, #0000 150%),
    radial-gradient(4px 100px at 0px 253px, var(--loader-rain), #0000),
    radial-gradient(4px 100px at 300px 253px, var(--loader-rain), #0000),
    radial-gradient(1.5px 1.5px at 150px 126.5px, var(--loader-rain) 100%, #0000 150%),
    radial-gradient(4px 100px at 0px 204px, var(--loader-rain), #0000),
    radial-gradient(4px 100px at 300px 204px, var(--loader-rain), #0000),
    radial-gradient(1.5px 1.5px at 150px 102px, var(--loader-rain) 100%, #0000 150%),
    radial-gradient(4px 100px at 0px 134px, var(--loader-rain), #0000),
    radial-gradient(4px 100px at 300px 134px, var(--loader-rain), #0000),
    radial-gradient(1.5px 1.5px at 150px 67px, var(--loader-rain) 100%, #0000 150%),
    radial-gradient(4px 100px at 0px 179px, var(--loader-rain), #0000),
    radial-gradient(4px 100px at 300px 179px, var(--loader-rain), #0000),
    radial-gradient(1.5px 1.5px at 150px 89.5px, var(--loader-rain) 100%, #0000 150%),
    radial-gradient(4px 100px at 0px 299px, var(--loader-rain), #0000),
    radial-gradient(4px 100px at 300px 299px, var(--loader-rain), #0000),
    radial-gradient(1.5px 1.5px at 150px 149.5px, var(--loader-rain) 100%, #0000 150%),
    radial-gradient(4px 100px at 0px 215px, var(--loader-rain), #0000),
    radial-gradient(4px 100px at 300px 215px, var(--loader-rain), #0000),
    radial-gradient(1.5px 1.5px at 150px 107.5px, var(--loader-rain) 100%, #0000 150%),
    radial-gradient(4px 100px at 0px 281px, var(--loader-rain), #0000),
    radial-gradient(4px 100px at 300px 281px, var(--loader-rain), #0000),
    radial-gradient(1.5px 1.5px at 150px 140.5px, var(--loader-rain) 100%, #0000 150%),
    radial-gradient(4px 100px at 0px 158px, var(--loader-rain), #0000),
    radial-gradient(4px 100px at 300px 158px, var(--loader-rain), #0000),
    radial-gradient(1.5px 1.5px at 150px 79px, var(--loader-rain) 100%, #0000 150%),
    radial-gradient(4px 100px at 0px 210px, var(--loader-rain), #0000),
    radial-gradient(4px 100px at 300px 210px, var(--loader-rain), #0000),
    radial-gradient(1.5px 1.5px at 150px 105px, var(--loader-rain) 100%, #0000 150%);
  background-size:
    300px 235px, 300px 235px, 300px 235px,
    300px 252px, 300px 252px, 300px 252px,
    300px 150px, 300px 150px, 300px 150px,
    300px 253px, 300px 253px, 300px 253px,
    300px 204px, 300px 204px, 300px 204px,
    300px 134px, 300px 134px, 300px 134px,
    300px 179px, 300px 179px, 300px 179px,
    300px 299px, 300px 299px, 300px 299px,
    300px 215px, 300px 215px, 300px 215px,
    300px 281px, 300px 281px, 300px 281px,
    300px 158px, 300px 158px, 300px 158px,
    300px 210px, 300px 210px, 300px 210px;
  animation: preloaderRainFall 150s linear infinite;
}

.preloader::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  pointer-events: none;
  backdrop-filter: blur(.82em) brightness(2.35) saturate(1.18);
  -webkit-backdrop-filter: blur(.82em) brightness(2.35) saturate(1.18);
  background-image: radial-gradient(circle at 50% 50%, #0000 0, #0000 2px, rgba(8, 9, 13, .92) 2px);
  background-size: 8px 8px;
  opacity: .82;
  mask-image: radial-gradient(circle at 50% 47%, #000 0%, #000 62%, transparent 100%);
}

.preloader::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(680px 360px at 50% 42%, rgba(255, 63, 47, .22), transparent 68%),
    radial-gradient(580px 420px at 50% 56%, rgba(23, 201, 182, .10), transparent 72%),
    linear-gradient(180deg, rgba(5, 6, 9, .18), rgba(5, 6, 9, .72));
}

.preloader-core {
  z-index: 3;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 63, 47, .18), transparent 42%),
    linear-gradient(180deg, rgba(255,255,255,.07), transparent),
    rgba(12, 14, 20, .78);
  box-shadow:
    0 34px 90px -36px rgba(0,0,0,.98),
    0 0 52px -24px rgba(255,63,47,.62),
    inset 0 1px 0 rgba(255,255,255,.09);
}

@keyframes preloaderRainFall {
  0% {
    background-position:
      0px 220px, 3px 220px, 151.5px 337.5px,
      25px 24px, 28px 24px, 176.5px 150px,
      50px 16px, 53px 16px, 201.5px 91px,
      75px 224px, 78px 224px, 226.5px 350.5px,
      100px 19px, 103px 19px, 251.5px 121px,
      125px 120px, 128px 120px, 276.5px 187px,
      150px 31px, 153px 31px, 301.5px 120.5px,
      175px 235px, 178px 235px, 326.5px 384.5px,
      200px 121px, 203px 121px, 351.5px 228.5px,
      225px 224px, 228px 224px, 376.5px 364.5px,
      250px 26px, 253px 26px, 401.5px 105px,
      275px 75px, 278px 75px, 426.5px 180px;
  }
  to {
    background-position:
      0px 6800px, 3px 6800px, 151.5px 6917.5px,
      25px 13632px, 28px 13632px, 176.5px 13758px,
      50px 5416px, 53px 5416px, 201.5px 5491px,
      75px 17175px, 78px 17175px, 226.5px 17301.5px,
      100px 5119px, 103px 5119px, 251.5px 5221px,
      125px 8428px, 128px 8428px, 276.5px 8495px,
      150px 9876px, 153px 9876px, 301.5px 9965.5px,
      175px 13391px, 178px 13391px, 326.5px 13540.5px,
      200px 14741px, 203px 14741px, 351.5px 14848.5px,
      225px 18770px, 228px 18770px, 376.5px 18910.5px,
      250px 5082px, 253px 5082px, 401.5px 5161px,
      275px 6375px, 278px 6375px, 426.5px 6480px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .preloader {
    animation: none;
  }
}

/* Campaign keyword priorities: compact, directly editable rows. */
.wizard-budget {
  max-height: 248px;
}
.wizard-keyword-columns,
.wizard-keyword-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 118px 82px;
  gap: 10px;
  align-items: center;
}
.wizard-keyword-columns {
  padding: 2px 10px 7px;
  color: var(--faint);
  font-size: 10px;
  font-weight: 900;
}
.wizard-keyword-row {
  min-height: 48px;
  padding: 7px 9px;
  border-top: 1px solid var(--soft);
}
.wizard-keyword-row > span {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.wizard-keyword-row strong {
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wizard-keyword-row small {
  color: var(--faint);
  font-size: 10px;
  font-weight: 800;
}
.project-wizard .wizard-keyword-row select,
.project-wizard .wizard-keyword-row input {
  width: 100%;
  min-height: 34px;
  height: 34px;
  padding: 0 9px;
  border-radius: 11px;
  font-size: 11px;
  font-weight: 850;
}
.project-wizard .wizard-keyword-row input {
  text-align: center;
}

@media (max-width: 560px) {
  .wizard-keyword-columns {
    display: none;
  }
  .wizard-keyword-row {
    grid-template-columns: minmax(0, 1fr) 104px 66px;
    gap: 6px;
    padding-inline: 4px;
  }
}

/* Sun / moon theme switch. */
.bloom-switch {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}
.bloom-switch input {
  position: absolute;
  width: 0 !important;
  height: 0 !important;
  min-width: 0;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}
.bloom-switch__track {
  display: inline-block;
  position: relative;
  width: 4.5rem;
  height: 2.2rem;
  overflow: hidden;
  border: 1px solid rgba(165, 123, 255, .4);
  border-radius: 999px;
  background: linear-gradient(120deg, #1f0a4a, #0e0322);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, .45);
  transition: background 320ms cubic-bezier(.22, 1, .36, 1), border-color 320ms cubic-bezier(.22, 1, .36, 1);
}
.bloom-switch__thumb {
  position: absolute;
  top: 50%;
  left: .2rem;
  width: 1.75rem;
  height: 1.75rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #0e0322;
  background: #ffd23f;
  box-shadow: 0 0 16px rgba(255, 210, 63, .55);
  transform: translateY(-50%);
  transition: left 360ms cubic-bezier(.34, 1.56, .64, 1), background 320ms cubic-bezier(.22, 1, .36, 1), color 320ms cubic-bezier(.22, 1, .36, 1), box-shadow 320ms cubic-bezier(.22, 1, .36, 1);
}
.bloom-switch__sun,
.bloom-switch__moon {
  position: absolute;
  width: 1rem;
  height: 1rem;
  transition: opacity 220ms cubic-bezier(.22, 1, .36, 1), transform 320ms cubic-bezier(.22, 1, .36, 1);
}
.bloom-switch__moon {
  opacity: 0;
  transform: rotate(-60deg) scale(.8);
}
.bloom-switch__star {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #fbf5ff;
  opacity: 0;
  transition: opacity 320ms cubic-bezier(.22, 1, .36, 1), transform 360ms cubic-bezier(.22, 1, .36, 1);
}
.bloom-switch__star--1 { top: 22%; left: 58%; transform: scale(.4); }
.bloom-switch__star--2 { top: 55%; left: 70%; width: 3px; height: 3px; transform: scale(.4); }
.bloom-switch__star--3 { top: 38%; left: 82%; width: 2px; height: 2px; transform: scale(.4); }
.bloom-switch input:checked ~ .bloom-switch__track {
  border-color: rgba(165, 123, 255, .55);
  background: linear-gradient(120deg, #150633, #0e0322);
}
.bloom-switch input:checked ~ .bloom-switch__track .bloom-switch__thumb {
  left: calc(100% - 1.95rem);
  color: #1f0a4a;
  background: #fbf5ff;
  box-shadow: 0 0 16px rgba(165, 123, 255, .6);
}
.bloom-switch input:checked ~ .bloom-switch__track .bloom-switch__sun {
  opacity: 0;
  transform: rotate(60deg) scale(.6);
}
.bloom-switch input:checked ~ .bloom-switch__track .bloom-switch__moon {
  opacity: 1;
  transform: rotate(0) scale(1);
}
.bloom-switch input:checked ~ .bloom-switch__track .bloom-switch__star {
  opacity: 1;
  transform: scale(1);
}
.bloom-switch input:focus-visible ~ .bloom-switch__track {
  outline: 2px solid #ffd23f;
  outline-offset: 3px;
}
.bloom-switch:hover .bloom-switch__track {
  border-color: rgba(190, 158, 255, .72);
}

@media (prefers-reduced-motion: reduce) {
  .bloom-switch__track,
  .bloom-switch__thumb,
  .bloom-switch__sun,
  .bloom-switch__moon,
  .bloom-switch__star {
    transition-duration: 0s;
  }
}

/* Campaign keyword groups. */
.wizard-group-toolbar,
.wizard-key-group-head,
.wizard-group-controls,
.wizard-group-result-head,
.wizard-group-keyword {
  display: flex;
  align-items: center;
}
.wizard-group-toolbar {
  justify-content: space-between;
  gap: 12px;
}
.wizard-group-toolbar > div:first-child {
  display: grid;
  gap: 4px;
}
.wizard-group-toolbar > div:last-child {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.wizard-group-toolbar small {
  color: var(--faint);
  font-size: 11px;
  font-weight: 800;
}
.wizard-groups {
  display: grid;
  gap: 12px;
}
.wizard-key-group {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card2);
}
.wizard-key-group-head {
  gap: 10px;
}
.wizard-key-group-head .field {
  flex: 1;
}
.wizard-key-group-head .icon-btn {
  margin-top: 21px;
}
.wizard-key-group textarea {
  min-height: 92px !important;
}
.wizard-group-controls {
  display: grid;
  grid-template-columns: minmax(130px, .8fr) minmax(150px, 1fr) auto;
  gap: 10px;
  align-items: end;
}
.wizard-group-controls .btn {
  min-height: 44px;
}
.wizard-group-result {
  max-height: 190px;
  overflow: auto;
  border-top: 1px solid var(--soft);
}
.wizard-group-result-head,
.wizard-group-keyword {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 82px;
  gap: 10px;
}
.wizard-group-result-head {
  padding: 9px 8px 6px;
  color: var(--faint);
  font-size: 10px;
  font-weight: 900;
}
.wizard-group-keyword {
  min-height: 45px;
  padding: 6px 8px;
  border-top: 1px solid var(--soft);
  align-items: center;
}
.wizard-group-keyword > span {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.wizard-group-keyword strong {
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wizard-group-keyword small {
  color: var(--faint);
  font-size: 10px;
}
.project-wizard .wizard-group-keyword input {
  width: 100%;
  min-height: 34px;
  height: 34px;
  padding: 0 8px;
  text-align: center;
}
.wizard-group-empty {
  padding: 14px 8px 4px;
  color: var(--faint);
  font-size: 12px;
  text-align: center;
}

@media (max-width: 620px) {
  .wizard-group-toolbar {
    align-items: stretch;
    flex-direction: column;
  }
  .wizard-group-toolbar > div:last-child {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .wizard-group-controls {
    grid-template-columns: 1fr 1fr;
  }
  .wizard-group-controls .btn {
    grid-column: 1 / -1;
  }
  .wizard-key-group {
    padding: 11px;
  }
}

/* ===== new-design dashboard (2026-07-14 rebuild) ===== */
.dash-row { display: grid; gap: var(--gap); margin-top: var(--gap); align-items: start; }
.dash-row-chart { grid-template-columns: 1.65fr 1fr; }
.dash-row-map { grid-template-columns: 1.5fr 1fr; }
.dash-side { display: grid; gap: var(--gap); align-content: start; }
.dash-chart .section-head, .dash-queue .section-head, .dash-map .section-head { align-items: flex-start; }
.dash-chart .chip { display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; border-radius: 999px; background: var(--surface-3); color: var(--muted); font-size: 11.5px; font-weight: 800; }
.dash-chart .chip i { width: 9px; height: 9px; border-radius: 3px; background: var(--teal); }
.dash-axis { display: flex; justify-content: space-between; margin-top: 4px; padding: 0 4px; color: var(--faint); font-size: 11px; font-weight: 800; }

.dash-queue-body { display: flex; align-items: center; gap: 18px; margin-top: 6px; }
.dash-ring { position: relative; width: 150px; height: 150px; flex: 0 0 auto; }
.dash-ring svg { width: 100%; height: 100%; }
.dash-ring-mid { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.dash-ring-mid strong { font-family: "Unbounded", sans-serif; font-size: 24px; line-height: 1; }
.dash-ring-mid span { color: var(--faint); font-size: 10.5px; font-weight: 800; }
.dash-zones { flex: 1; display: grid; gap: 11px; }
.dash-zone { display: flex; align-items: center; gap: 9px; }
.dash-zone span { flex: 1; display: inline-flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; font-weight: 800; }
.dash-zone span i { width: 9px; height: 9px; border-radius: 3px; flex: 0 0 auto; }
.dash-zone strong { font-family: "Unbounded", sans-serif; font-size: 13px; }

.dash-map-legend { display: flex; gap: 12px; flex-wrap: wrap; }
.dash-map-leg { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10.5px; font-weight: 800; }
.dash-map-leg i { width: 9px; height: 9px; border-radius: 3px; }
.dash-map-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 4px; }
.dash-map-cell { padding: 12px; border-radius: var(--r-sm); border: 1px solid transparent; }
.dash-map-kw { color: var(--text); font-size: 11px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-map-pos { display: flex; align-items: baseline; justify-content: space-between; margin-top: 8px; }
.dash-map-pos strong { font-family: "Unbounded", sans-serif; font-size: 20px; }
.dash-map-pos span { font-size: 10.5px; font-weight: 900; }
.dash-map-pos .up { color: var(--green); }
.dash-map-pos .down { color: var(--accent); }
.dash-map-pos .flat { color: var(--faint); }

.dash-bars { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; height: 150px; margin-top: 6px; }
.dash-bar-col { flex: 1; display: grid; justify-items: center; gap: 9px; height: 100%; grid-template-rows: auto 1fr auto; }
.dash-bar-col strong { font-family: "Unbounded", sans-serif; font-size: 15px; }
.dash-bar-track { width: 100%; display: flex; align-items: flex-end; }
.dash-bar-fill { width: 100%; min-height: 4px; border-radius: 8px 8px 3px 3px; }
.dash-bar-col span { color: var(--faint); font-size: 10.5px; font-weight: 800; }

@media (max-width: 1080px) {
  .dash-row-chart, .dash-row-map { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .dash-map-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-queue-body { flex-direction: column; align-items: stretch; }
  .dash-ring { margin: 0 auto; }
}
.toolbar-sub { color: var(--faint); font-weight: 800; font-style: normal; }
