/* =============================================
   ARWIX AGENT — DESIGN SYSTEM
   Light SaaS default (MVP v4)
   ============================================= */

/* === THEME VARIABLES === */
:root {
  --bg:              #eceff2;
  --bg2:             #e2e6eb;
  --surface:         rgba(255,255,255,0.82);
  --surface-hover:   rgba(255,255,255,0.97);
  --surface-strong:  rgba(255,255,255,0.98);
  --border:          rgba(89,98,112,0.12);
  --border-strong:   rgba(89,98,112,0.20);

  --text-primary:    #1b212a;
  --text-secondary:  #5f6875;
  --text-muted:      #8a93a0;

  --accent:          #72b5ff;
  --accent-soft:     #e6f3ff;
  --accent-grad:     linear-gradient(135deg, #7ac4ff 0%, #4b90ff 100%);
  --accent-glow:     rgba(91,154,255,0.24);
  --accent-glow-sm:  rgba(163,211,255,0.12);

  --active-bg:       rgba(255,255,255,0.07);
  --active-border:   rgba(255,255,255,0.11);
  --active-text:     #ffffff;

  --hover-glow:      0 0 0 1px rgba(228,242,255,0.14), 0 0 0 4px rgba(122,196,255,0.08), 0 16px 36px rgba(58,106,171,0.20);

  --sidebar-bg:      rgba(241,243,246,0.34);
  --blob-1:          rgba(255,255,255,0.45);
  --blob-2:          rgba(161,168,178,0.10);
  --blob-3:          rgba(120,128,139,0.08);

  --input-bg:        rgba(247,248,250,0.96);
  --input-border:    rgba(89,98,112,0.14);
  --scrollbar-c:     rgba(0,0,0,0.1);

  --radius-sm:       14px;
  --radius-md:       20px;
  --radius-lg:       26px;
  --radius-xl:       32px;
}

[data-theme="dark"] {
  --bg:              #17191d;
  --bg2:             #21242a;
  --surface:         rgba(40,43,49,0.84);
  --surface-hover:   rgba(52,56,63,0.94);
  --surface-strong:  rgba(61,66,74,0.98);
  --border:          rgba(255,255,255,0.08);
  --border-strong:   rgba(255,255,255,0.15);

  --text-primary:    #f2f4f7;
  --text-secondary:  #b2b9c4;
  --text-muted:      #79818d;

  --accent:          #72b5ff;
  --accent-soft:     #e6f3ff;
  --accent-grad:     linear-gradient(135deg, #7ac4ff 0%, #4b90ff 100%);
  --accent-glow:     rgba(91,154,255,0.24);
  --accent-glow-sm:  rgba(163,211,255,0.12);

  --sidebar-bg:      rgba(26,29,34,0.36);
  --blob-1:          rgba(255,255,255,0.025);
  --blob-2:          rgba(144,151,162,0.05);
  --blob-3:          rgba(98,104,114,0.045);

  --input-bg:        rgba(255,255,255,0.055);
  --input-border:    rgba(255,255,255,0.10);
  --scrollbar-c:     rgba(255,255,255,0.08);
}

/* === RESET === */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* === BODY + BLOB BACKGROUND === */
html {
  background: var(--bg);
}

body {
  font-family: "Inter", "Plus Jakarta Sans", -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  overflow: hidden;
  position: relative;
  transition: background 0.35s ease, color 0.35s ease;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 700px 500px at 10% 15%, var(--blob-1), transparent 70%),
    radial-gradient(ellipse 500px 700px at 90% 85%, var(--blob-2), transparent 70%),
    radial-gradient(ellipse 400px 300px at 70% 5%,  var(--blob-3), transparent 70%);
}

/* === SIDEBAR === */
.sidebar {
  width: 240px;
  height: 100vh;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-right: 0;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  left: 0; top: 0;
  z-index: 10;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 24px 20px 20px;
  border-bottom: 0;
}
.logo > svg {
  display: none !important;
}
.logo:hover .brand-badge {
  transform: translateY(-1px) scale(1.03);
  box-shadow: none;
}
.logo:hover .logo-name {
  filter: brightness(1.06);
}

.logo-name {
  font-size: 15px;
  font-weight: 500;
  color: #eaf3ff;
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  letter-spacing: 0.22em;
  white-space: nowrap;
  text-transform: uppercase;
  line-height: 1;
  text-shadow: none;
}

.brand-badge {
  width: 40px;
  height: 40px;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #e4f2ff;
  position: relative;
  overflow: visible;
  background: transparent;
  border: none;
  box-shadow: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.brand-badge::before {
  display: none;
}

.brand-badge::after {
  display: none;
}

.brand-badge .brand-mark {
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 2px 7px rgba(4, 12, 20, 0.28));
}

[data-theme="light"] .brand-badge {
  color: #1f3f63;
  background: transparent;
  border: none;
  box-shadow: none;
}
[data-theme="light"] .logo:hover .brand-badge {
  box-shadow: none;
}

[data-theme="light"] .logo-name {
  color: #192532;
}

.nav {
  flex: 1;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 52px;
  padding: 7px 11px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0;
  color: var(--text-secondary);
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0.08px;
}

.nav a:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
  box-shadow: var(--hover-glow);
}

.nav a.active {
  background: linear-gradient(135deg, #f4fbff 0%, #d7ecff 100%);
  color: #111418;
  font-weight: 600;
  border: 1px solid rgba(232,245,255,0.92);
  box-shadow: 0 14px 28px rgba(53,103,177,0.18), inset 0 1px 0 rgba(255,255,255,0.9);
}

.nav a.active svg { opacity: 1; }

.nav a svg {
  width: 34px;
  height: 34px;
  padding: 8px;
  flex-shrink: 0;
  stroke-width: 1.8;
  border-radius: 50%;
  background: rgba(0,0,0,0.42);
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03), 0 8px 18px rgba(0,0,0,0.14);
}

.nav a[data-page="dashboard"] svg    { stroke: #7fb2ff !important; color: #7fb2ff !important; }
.nav a[data-page="agents"] svg       { stroke: #4ee39b !important; color: #4ee39b !important; }
.nav a[data-page="knowledge"] svg    { stroke: #ffc55c !important; color: #ffc55c !important; }
.nav a[data-page="channels"] svg     { stroke: #52d1ff !important; color: #52d1ff !important; }
.nav a[data-page="inbox"] svg        { stroke: #ff77b3 !important; color: #ff77b3 !important; }
.nav a[data-page="integrations"] svg { stroke: #b38dff !important; color: #b38dff !important; }

.nav a.active svg {
  background: rgba(0,0,0,0.88);
  border-color: rgba(255,255,255,0.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 8px 18px rgba(0,0,0,0.16);
}

.nav-label {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06px;
  color: currentColor;
}

.badge {
  margin-left: auto;
  background: linear-gradient(135deg, #f4fbff 0%, #d7ecff 100%);
  color: #111418;
  font-size: 9px;
  font-weight: 700;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(232,245,255,0.92);
  box-shadow: 0 10px 20px rgba(53,103,177,0.16), inset 0 1px 0 rgba(255,255,255,0.9);
}

[data-theme="light"] .nav a {
  color: #253246;
}

[data-theme="light"] .nav a .nav-label {
  font-weight: 600;
  letter-spacing: 0.08px;
}

[data-theme="light"] .nav a svg {
  background: linear-gradient(145deg, #182235 0%, #0f1729 100%);
  border-color: rgba(15, 23, 42, 0.26);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 10px 18px rgba(9,14,24,0.22);
  opacity: 1;
}

[data-theme="light"] .nav a.active svg {
  background: linear-gradient(145deg, #0e1524 0%, #0a111d 100%);
  border-color: rgba(15, 23, 42, 0.30);
}

[data-theme="light"] .nav-footer a {
  color: #2d3a4d;
}

[data-theme="light"] .nav-footer a svg {
  background: linear-gradient(145deg, #182235 0%, #0f1729 100%);
  border-color: rgba(15,23,42,0.24);
}

[data-theme="light"] .badge {
  background: linear-gradient(145deg, #172338 0%, #0f1729 100%);
  color: #f8fbff;
  border-color: rgba(15,23,42,0.28);
  box-shadow: 0 8px 16px rgba(8,12,21,0.3), inset 0 1px 0 rgba(255,255,255,0.07);
}

.nav-sep {
  display: none;
}

.nav-footer {
  padding: 10px 10px 6px;
  border-top: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
  padding-bottom: 0;
}
.nav-footer a {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 5px 10px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0;
  color: var(--text-muted);
  font-weight: 600;
  transition: all 0.2s;
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0.1px;
}
.nav-footer a:hover { color: var(--text-secondary); background: var(--surface); box-shadow: var(--hover-glow); }
.nav-footer .theme-toggle-switch {
  order: 1;
  align-self: flex-start;
  margin: 0;
}
.nav-footer .nav-support-btn {
  order: 2;
  align-self: flex-start;
  width: auto;
  min-height: 34px;
  padding: 4px 8px;
  gap: 6px;
  background: linear-gradient(135deg, rgba(245,251,255,0.98) 0%, rgba(224,239,255,0.95) 100%);
  border: 1px solid rgba(208,229,247,0.95);
  color: #111418 !important;
  box-shadow: 0 10px 20px rgba(52,96,164,0.18), inset 0 1px 0 rgba(255,255,255,0.95);
}
.nav-footer .nav-support-btn:hover {
  background: linear-gradient(135deg, rgba(248,253,255,1) 0%, rgba(233,244,255,0.98) 100%);
  border-color: rgba(196,221,245,0.98);
  color: #0e1218 !important;
  box-shadow: 0 12px 24px rgba(52,96,164,0.22), inset 0 1px 0 rgba(255,255,255,0.98);
}
.nav-footer a svg {
  width: 26px;
  height: 26px;
  padding: 6px;
  border-radius: 50%;
  background: rgba(0,0,0,0.42);
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03), 0 8px 16px rgba(0,0,0,0.14);
}

.nav-footer .nav-support-btn .nav-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18px;
  color: #111418 !important;
}
.nav-footer a .nav-label {
  font-size: 11px;
  letter-spacing: 0.1px;
  color: currentColor;
}
.nav-footer .nav-support-btn svg {
  width: 24px;
  height: 24px;
  padding: 5px;
  background: linear-gradient(145deg, #1d2a3f 0%, #0f1729 100%);
  border: 1px solid rgba(168,199,233,0.24);
  box-shadow: 0 8px 16px rgba(7,12,23,0.36), inset 0 1px 0 rgba(255,255,255,0.08);
  color: #78bce8 !important;
}

.user-card {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  margin: 8px 10px 10px;
  max-width: calc(100% - 20px);
  border-radius: var(--radius-lg);
  background: var(--surface-strong);
  border: 1px solid var(--border);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 10px 24px rgba(0,0,0,0.14);
  transition: all 0.2s;
}
.user-card:hover { background: var(--surface-hover); border-color: var(--border-strong); box-shadow: var(--hover-glow); }
.user-card > svg {
  display: none !important;
  flex-shrink: 0;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: center / cover no-repeat url("assets/placeholders/avatar-manager.svg");
  border: 1px solid rgba(214, 232, 248, 0.42);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
  font-weight: 800;
  color: transparent;
  text-indent: -9999px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 18px rgba(0,0,0,0.18);
}
.avatar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, rgba(0,0,0,0.12) 100%);
  pointer-events: none;
}

.uname { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.urole { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; }

/* === MAIN === */
.main {
  flex: 1;
  margin-left: 240px;
  padding: 26px 28px;
  overflow-y: auto;
  position: relative;
  z-index: 5;
  height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.page-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0;
}

.page-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0.1px;
}

.topbar-right { display: flex; align-items: center; gap: 10px; }

/* === CARDS === */
.card {
  background: var(--surface);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.14);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.card:hover { border-color: var(--border-strong); box-shadow: var(--hover-glow); }

.card-hd { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 16px; }
.card-title { font-size: 12px; font-weight: 700; color: var(--text-primary); text-transform: none; letter-spacing: 0.15px; }
.card-sub { font-size: 10.5px; color: var(--text-muted); text-transform: none; letter-spacing: 0.15px; margin-top: 3px; }

.kcard {
  background: var(--surface);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.14);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.kcard:hover { border-color: var(--border-strong); box-shadow: var(--hover-glow); }

.kcard-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
.kicon { width: 40px; height: 40px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; }
.kicon svg { width: 18px; height: 18px; }
.klabel { font-size: 10.5px; color: var(--text-muted); text-transform: none; letter-spacing: 0.15px; font-weight: 600; margin-bottom: 5px; }
.kval { font-size: 26px; font-weight: 700; color: var(--text-primary); letter-spacing: -0.35px; }

.trend { font-size: 10px; font-weight: 700; padding: 3px 9px; border-radius: 20px; text-transform: uppercase; letter-spacing: 0.3px; }
.t-up  { color: #34d399; background: rgba(52,211,153,0.1); }
.t-neu { color: var(--text-muted); background: var(--surface); }
.t-err { color: #f87171; background: rgba(248,113,113,0.1); }

/* Icon bg tints — calm muted palette */
.ic-in { background: rgba(56,189,248,0.1);  color: #38bdf8; }
.ic-vi { background: rgba(167,139,250,0.1); color: #a78bfa; }
.ic-cy { background: rgba(52,211,153,0.1);  color: #34d399; }
.ic-am { background: rgba(251,146,60,0.1);  color: #fb923c; }
.ic-pk { background: rgba(244,114,182,0.1); color: #f472b6; }
.ic-yw { background: rgba(250,204,21,0.1);  color: #facc15; }

/* === BUTTONS === */
.btn-primary {
  background: linear-gradient(135deg, #f4fbff 0%, #d7ecff 100%);
  color: #111418;
  border: 1px solid rgba(232,245,255,0.92);
  border-radius: 999px;
  padding: 10px 22px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.12px;
  text-transform: none;
  box-shadow: 0 14px 28px rgba(53,103,177,0.18), inset 0 1px 0 rgba(255,255,255,0.9);
  transition: all 0.2s;
}
.btn-primary:hover {
  background: linear-gradient(135deg, #ffffff 0%, #e4f2ff 100%);
  color: #0d1116;
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px rgba(228,242,255,.18), 0 0 0 5px rgba(122,196,255,.08), 0 14px 26px rgba(54,95,153,.16), inset 0 1px 0 rgba(255,255,255,.96);
}
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 9px 20px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.12px;
  text-transform: none;
  transition: all 0.2s;
}
.btn-ghost:hover { background: var(--surface-hover); border-color: var(--border-strong); color: var(--text-primary); box-shadow: var(--hover-glow); }

.btn-danger {
  background: rgba(248,113,113,0.08);
  color: #f87171;
  border: 1px solid rgba(248,113,113,0.18);
  border-radius: var(--radius-md);
  padding: 9px 20px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.12px;
  text-transform: none;
  transition: all 0.2s;
}
.btn-danger:hover { background: rgba(248,113,113,0.14); box-shadow: var(--hover-glow); }

.btn-sm { padding: 5px 14px; font-size: 10px; }

/* === ICONS === */
.icon-svg { width: 16px; height: 16px; flex-shrink: 0; display: inline-block; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.icon-sm  { width: 14px; height: 14px; }
.icon-lg  { width: 18px; height: 18px; }
.icon-xl  { width: 20px; height: 20px; }
.icon-text { display: inline-flex; align-items: center; gap: 6px; }
.title-with-icon { display: inline-flex; align-items: center; gap: 8px; }
.agent-icon .icon-svg, .ch-icon .icon-svg, .int-logo .icon-svg { width: 20px; height: 20px; }
.search-field { position: relative; }
.search-field .icon-svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; width: 15px; height: 15px; }
.search-field .input { padding-left: 38px; }
.btn-icon { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.icon-only { min-width: 34px; padding-inline: 10px; }
.chat-tool { background: none; border: none; cursor: pointer; color: var(--text-muted); padding: 4px; display: inline-flex; align-items: center; justify-content: center; transition: color 0.2s; }
.chat-tool:hover { color: var(--text-secondary); }
.msg-prefix-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-right: 7px;
  border-radius: 999px;
  vertical-align: -3px;
}
.msg-out-ai .msg-prefix-icon {
  color: #4b90ff;
  background: rgba(122,196,255,0.2);
}
.msg-out-human .msg-prefix-icon {
  color: #10b981;
  background: rgba(16,185,129,0.2);
}
.msg-log .msg-prefix-icon,
.badge-support .icon-svg {
  color: var(--accent-soft);
}
.msg-log .msg-prefix-icon {
  width: 15px;
  height: 15px;
  margin-right: 5px;
  background: transparent;
}
[data-theme="dark"] .msg-out-ai .msg-prefix-icon {
  color: #8cc9ff;
  background: rgba(122,196,255,0.2);
}
[data-theme="dark"] .msg-out-human .msg-prefix-icon {
  color: #6de2bb;
  background: rgba(52,211,153,0.18);
}
.feature-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.feature-item { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); }
.brand-mark { display: block; flex-shrink: 0; overflow: visible; shape-rendering: geometricPrecision; }
.brand-mark-sm { width: 15px; height: 15px; }
.brand-mark-md { width: 18px; height: 18px; }
.brand-mark-lg { width: 29px; height: 29px; }

/* === FORM === */
.input {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow-sm); }

.label { font-size: 10px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 6px; display: block; }

.textarea {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text-primary);
  outline: none;
  resize: vertical;
  min-height: 80px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow-sm); }

.select {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text-primary);
  outline: none;
  cursor: pointer;
  appearance: none;
}

.toggle { position: relative; width: 50px; height: 30px; flex-shrink: 0; display: inline-flex; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  cursor: pointer;
  border: 1px solid rgba(126,141,159,0.24);
  background:
    radial-gradient(circle at 28% 24%, rgba(255,255,255,0.7) 0%, rgba(255,255,255,0) 38%),
    linear-gradient(180deg, #d8e0e9 0%, #e7edf4 100%);
  box-shadow:
    inset 0 2px 5px rgba(98,112,128,0.2),
    inset 0 -2px 4px rgba(255,255,255,0.82),
    0 1px 1px rgba(255,255,255,0.45);
  transition: background 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.toggle-slider:before {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  left: 4px;
  top: 3px;
  background: linear-gradient(180deg, #ffffff 0%, #edf3f9 100%);
  border-radius: 50%;
  box-shadow:
    0 2px 5px rgba(22,33,52,0.14),
    inset 0 1px 0 rgba(255,255,255,0.98);
  transition: transform 0.25s, background 0.25s, box-shadow 0.25s;
}
.toggle input:checked + .toggle-slider {
  background:
    radial-gradient(circle at 74% 26%, rgba(255,255,255,0.46) 0%, rgba(255,255,255,0) 30%),
    linear-gradient(180deg, #cfe4ff 0%, #b8d7ff 100%);
  border-color: rgba(92,153,255,0.34);
  box-shadow:
    inset 0 2px 7px rgba(63,108,176,0.2),
    inset 0 -2px 4px rgba(255,255,255,0.34),
    0 1px 0 rgba(255,255,255,0.25);
}
.toggle input:checked + .toggle-slider:before {
  transform: translateX(20px);
  background: linear-gradient(180deg, #ffffff 0%, #eef7ff 100%);
  box-shadow:
    0 2px 6px rgba(20,52,111,0.18),
    inset 0 1px 0 rgba(255,255,255,0.98);
}
.toggle input:focus-visible + .toggle-slider {
  box-shadow:
    0 0 0 3px rgba(122,196,255,0.18),
    inset 0 2px 5px rgba(98,112,128,0.2),
    inset 0 -2px 4px rgba(255,255,255,0.82);
}
[data-theme="dark"] .toggle-slider {
  border-color: rgba(255,255,255,0.1);
  background:
    radial-gradient(circle at 72% 50%, rgba(116,132,156,0.22) 0%, rgba(116,132,156,0) 32%),
    radial-gradient(circle at 98% 50%, rgba(155,168,188,0.18) 0%, rgba(155,168,188,0) 48%),
    linear-gradient(90deg, #161a21 0%, #252c37 56%, #394352 100%);
  box-shadow:
    inset 0 2px 7px rgba(0,0,0,0.42),
    inset 0 -1px 2px rgba(255,255,255,0.06);
}
[data-theme="dark"] .toggle-slider:before {
  background: linear-gradient(180deg, #fbfdff 0%, #d8e4ef 100%);
}
[data-theme="dark"] .toggle input:checked + .toggle-slider {
  background:
    radial-gradient(circle at 74% 28%, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 26%),
    linear-gradient(180deg, #2d5d9b 0%, #21477d 100%);
  border-color: rgba(122,196,255,0.22);
  box-shadow:
    inset 0 2px 7px rgba(6,17,37,0.45),
    inset 0 -1px 2px rgba(255,255,255,0.08);
}
.toggle-wrap { display: flex; align-items: center; gap: 10px; }
.toggle-label { font-size: 13px; color: var(--text-secondary); font-weight: 500; }
.form-row { margin-bottom: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-hint {
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-muted);
}
.prompt-editor {
  position: relative;
}
.prompt-editor .textarea {
  padding-right: 56px;
}
.prompt-mic {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}
.prompt-mic:hover {
  transform: translateY(-1px);
  color: var(--text-primary);
  background: var(--surface-hover);
  border-color: var(--border-strong);
  box-shadow: var(--hover-glow);
}
.prompt-mic .icon-svg {
  width: 16px;
  height: 16px;
}
.workhours-panel {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.workhours-days {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.day-chip {
  min-width: 40px;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.18s ease;
}
.day-chip:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  color: var(--text-primary);
  box-shadow: var(--hover-glow);
}
.day-chip.active {
  background: linear-gradient(135deg, #f4fbff 0%, #d7ecff 100%);
  border-color: rgba(186,211,238,0.95);
  color: #13243a;
  box-shadow: 0 8px 18px rgba(53,103,177,0.14), inset 0 1px 0 rgba(255,255,255,0.92);
}
.workhours-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.upload-field {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 12px 14px;
  border: 1px dashed rgba(122,196,255,0.34);
  border-radius: 18px;
  background: rgba(244, 249, 255, 0.82);
  overflow: hidden;
}
.upload-field input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.upload-visual {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: linear-gradient(135deg, #f4fbff 0%, #d7ecff 100%);
  border: 1px solid rgba(186,211,238,0.95);
  color: #295b8d;
  box-shadow: 0 8px 16px rgba(53,103,177,0.14), inset 0 1px 0 rgba(255,255,255,0.92);
}
.upload-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.upload-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
}
.upload-note {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}
.visual-avatar-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.visual-avatar-option {
  min-height: 78px;
  padding: 10px 8px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  text-align: center;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.visual-avatar-option:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
  background: var(--surface-hover);
  box-shadow: var(--hover-glow);
}
.visual-avatar-option.active {
  border-color: rgba(122,196,255,0.38);
  background: rgba(244,249,255,0.92);
  box-shadow: 0 0 0 1px rgba(122,196,255,0.14), 0 12px 24px rgba(53,103,177,0.12);
}
.visual-avatar-option img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 8px 14px rgba(15,23,42,0.14);
}
.visual-avatar-option span {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
}
.channel-color-preview {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: 0.02em;
}
.integration-logo-badge {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 50%;
  background: transparent;
  border: 1px solid rgba(188, 202, 218, 0.92);
  color: #234f7a;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.88);
}
.integration-logo-badge svg {
  width: 30px;
  height: 30px;
  display: block;
}
.integration-logo-badge.logo-keycrm { color: #f59e0b; }
.integration-logo-badge.logo-bitrix24 { color: #14aaf5; }
.integration-logo-badge.logo-monobank { color: #121826; }
.integration-logo-badge.logo-novaposhta { color: #eb3c2f; }
.integration-support-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.integration-support-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}
.integration-support-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}
.integration-support-card .btn-ghost {
  margin-top: auto;
  align-self: flex-start;
}

/* Radio menus */
.radio-menu {
  display: grid;
  gap: 10px;
}
.radio-menu.stack {
  grid-template-columns: 1fr;
}
.radio-menu.inline {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.radio-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 3px 0;
  border-radius: 0;
  border: 0;
  background: transparent;
  color: #5a6574;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.25;
  cursor: pointer;
  user-select: none;
  transition: color 0.18s ease;
}
.radio-option:hover {
  color: #1f2c3f;
}
.radio-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  inset: 0;
  width: 100%;
  height: 100%;
}
.radio-indicator {
  position: relative;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid rgba(132, 145, 164, 0.82);
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.radio-indicator::after {
  content: "";
  position: relative;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4b90ff;
  transform: scale(0);
  transition: transform 0.16s ease;
  z-index: 1;
}
.radio-option-text {
  display: inline-block;
  color: inherit;
}
.radio-option:hover .radio-indicator {
  border-color: rgba(90, 136, 193, 0.92);
}
.radio-option input:checked + .radio-indicator {
  border-color: #66aef8;
  background: transparent;
  box-shadow: 0 0 0 3px rgba(122,196,255,0.11);
}
.radio-option input:checked + .radio-indicator::after {
  transform: scale(1);
}
.radio-option:has(input:checked) {
  color: #1b2a3f;
  font-weight: 700;
}
[data-theme="dark"] .radio-option {
  color: #c7d3e3;
}
[data-theme="dark"] .radio-option:hover {
  color: #edf4ff;
}
[data-theme="dark"] .radio-indicator {
  border-color: rgba(170, 184, 205, 0.44);
  background: transparent;
  box-shadow: none;
}
[data-theme="dark"] .radio-option input:checked + .radio-indicator {
  border-color: #82bfff;
  background: transparent;
  box-shadow: 0 0 0 3px rgba(122,196,255,0.1);
}
[data-theme="dark"] .radio-option:has(input:checked) {
  color: #eaf3ff;
  font-weight: 700;
}
[data-theme="dark"] .prompt-mic {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.1);
  color: #d0dceb;
}
[data-theme="dark"] .prompt-mic:hover {
  background: rgba(122,196,255,0.1);
  border-color: rgba(122,196,255,0.24);
  color: #eef6ff;
}
[data-theme="dark"] .workhours-panel {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.1);
}
[data-theme="dark"] .day-chip {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.1);
  color: #ced8e5;
}
[data-theme="dark"] .day-chip.active {
  background: rgba(122,196,255,0.16);
  border-color: rgba(122,196,255,0.28);
  color: #eef6ff;
  box-shadow: 0 12px 22px rgba(2,6,18,0.24);
}
[data-theme="dark"] .upload-field {
  background: rgba(255,255,255,0.04);
  border-color: rgba(122,196,255,0.2);
}
[data-theme="dark"] .upload-visual {
  background: rgba(122,196,255,0.12);
  border-color: rgba(122,196,255,0.2);
  color: #eaf3ff;
  box-shadow: 0 12px 20px rgba(2,6,18,0.24);
}
[data-theme="dark"] .visual-avatar-option {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.1);
}
[data-theme="dark"] .visual-avatar-option.active {
  background: rgba(122,196,255,0.12);
  border-color: rgba(122,196,255,0.24);
  box-shadow: 0 12px 24px rgba(2,6,18,0.24);
}
[data-theme="dark"] .visual-avatar-option span {
  color: #dce8f6;
}
[data-theme="dark"] .integration-logo-badge {
  background: transparent;
  border-color: rgba(255,255,255,0.12);
  color: #eef6ff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
[data-theme="dark"] .integration-logo-badge.logo-monobank { color: #f5f7fb; }

.slider {
  width: 100%;
  -webkit-appearance: none;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(114,181,255,0.9) 0%, rgba(114,181,255,0.9) 28%, rgba(148,163,184,0.2) 28%, rgba(148,163,184,0.2) 100%);
  border: 1px solid var(--border-strong);
  outline: none;
  cursor: pointer;
}
.slider::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 999px;
  background: transparent;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -6px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: linear-gradient(145deg, #7ac4ff 0%, #4b90ff 100%);
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(46,104,175,0.25), 0 6px 12px rgba(39,78,132,0.24);
}
.slider::-moz-range-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(148,163,184,0.2);
  border: 1px solid var(--border-strong);
}
.slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: linear-gradient(145deg, #7ac4ff 0%, #4b90ff 100%);
  box-shadow: 0 0 0 1px rgba(46,104,175,0.25), 0 6px 12px rgba(39,78,132,0.24);
}
.slider-labels { display: flex; justify-content: space-between; font-size: 10px; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; margin-top: 4px; }

/* === BADGES === */
.badge-type { font-size: 10px; font-weight: 700; padding: 3px 10px; border-radius: 20px; text-transform: uppercase; letter-spacing: 0.3px; }
.badge-in      { background: rgba(56,189,248,0.12);  color: #38bdf8; }
.badge-out     { background: rgba(167,139,250,0.12); color: #a78bfa; }
.badge-mix     { background: rgba(52,211,153,0.12);  color: #34d399; }
.badge-support { background: rgba(114,181,255,0.14); color: #2f628f; border: 1px solid rgba(122,196,255,0.26); }
.badge-comments{ background: rgba(244,114,182,0.12); color: #f472b6; }
[data-theme="dark"] .badge-support { color: #dceeff; background: rgba(114,181,255,0.18); border-color: rgba(122,196,255,0.24); }
.dot-active  { width: 8px; height: 8px; border-radius: 50%; background: #34d399; flex-shrink: 0; box-shadow: 0 0 6px rgba(52,211,153,0.5); }
.dot-paused  { width: 8px; height: 8px; border-radius: 50%; background: #fbbf24; flex-shrink: 0; }
.dot-error   { width: 8px; height: 8px; border-radius: 50%; background: #f87171; flex-shrink: 0; }
.status-pill { font-size: 10px; font-weight: 700; padding: 3px 10px; border-radius: 20px; text-transform: uppercase; letter-spacing: 0.3px; }
.sp-active { color: #34d399; background: rgba(52,211,153,0.1); }
.sp-paused { color: #fbbf24; background: rgba(251,191,36,0.1); }
.sp-error  { color: #f87171; background: rgba(248,113,113,0.1); }

/* === TABLE === */
.table-wrap { overflow: hidden; border-radius: var(--radius-md); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; }
thead th { font-size: 10px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.7px; padding: 12px 16px; background: var(--surface); text-align: left; border-bottom: 1px solid var(--border); }
tbody td { font-size: 13px; color: var(--text-secondary); padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border: none; }
tbody tr:hover td { background: var(--surface); }

/* === KNOWLEDGE BASE === */
.kb-doc-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  border: 0;
  padding: 4px 0;
  text-align: left;
  color: inherit;
  cursor: pointer;
  font: inherit;
}
.kb-doc-trigger:hover .kb-file-name {
  color: #2e6db1;
}
.kb-doc-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.kb-file-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kb-file-hint {
  font-size: 11px;
  color: var(--text-muted);
}
.kb-file-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: transparent !important;
  border: 1px solid rgba(160,172,188,0.28);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.74);
}
.kb-file-icon svg {
  width: 20px;
  height: 20px;
}
.kb-file-icon.kb-pdf {
  color: #ef4444;
}
.kb-file-icon.kb-docx {
  color: #0284c7;
}
.kb-file-icon.kb-txt {
  color: #0d9488;
}
.kb-file-icon.kb-large {
  width: 54px;
  height: 54px;
  border-radius: 50%;
}
.kb-file-icon.kb-large svg {
  width: 26px;
  height: 26px;
}
.kb-center-cell {
  text-align: center;
  vertical-align: middle;
}
.kb-delete-btn {
  min-width: 38px;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  border: 1px solid rgba(160,172,188,0.28);
  color: #ef4444;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.72);
}
.kb-delete-btn:hover {
  background: rgba(248,113,113,0.08);
  border-color: rgba(248,113,113,0.28);
  color: #dc2626;
  box-shadow: 0 0 0 3px rgba(248,113,113,0.08);
}
.kb-row-disabled td {
  opacity: 0.72;
}
.kb-empty-state {
  text-align: center;
  padding: 34px 20px !important;
}
.kb-empty-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(244,249,255,0.96) 0%, rgba(223,236,248,0.94) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #7a8ca0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
}
.kb-empty-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.kb-empty-sub {
  font-size: 12px;
  color: var(--text-muted);
}
.kb-editor-backdrop {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15,23,42,0.34);
  backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease;
  z-index: 1700;
}
.kb-editor-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}
.kb-editor-modal {
  width: min(1180px, calc(100vw - 40px));
  height: min(82vh, 760px);
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: 30px;
  box-shadow: 0 28px 72px rgba(15,23,42,0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(12px) scale(0.985);
  transition: transform 0.24s ease;
}
.kb-editor-backdrop.open .kb-editor-modal {
  transform: translateY(0) scale(1);
}
.kb-editor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 24px 20px;
  border-bottom: 1px solid var(--border);
}
.kb-editor-doc {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.kb-editor-titles {
  min-width: 0;
}
.kb-editor-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.45px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.kb-editor-name-input {
  width: min(520px, 58vw);
  max-width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  font: 700 24px/1.15 inherit;
  color: var(--text-primary);
  outline: none;
}
.kb-editor-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.kb-wordcount {
  font-size: 11px;
  color: var(--text-muted);
}
.kb-editor-head-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}
.kb-view-switch.active {
  background: linear-gradient(135deg, rgba(244,251,255,0.98) 0%, rgba(223,238,255,0.96) 100%);
  color: #18324f;
  border-color: rgba(186,211,238,0.95);
  box-shadow: 0 4px 10px rgba(53,103,177,0.1), inset 0 1px 0 rgba(255,255,255,0.92);
}
.kb-editor-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}
.kb-editor-sidebar {
  border-right: 1px solid var(--border);
  padding: 22px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.kb-editor-side-card {
  padding: 16px;
  border-radius: 22px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5);
}
.kb-editor-side-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 14px;
}
.kb-inline-toggle {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.kb-editor-main {
  min-width: 0;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
}
.kb-editor-textarea,
.kb-editor-preview {
  flex: 1;
  min-height: 0;
  border-radius: 24px;
  border: 1px solid var(--input-border);
  background: linear-gradient(180deg, rgba(255,255,255,0.96) 0%, rgba(248,250,252,0.98) 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.75);
}
.kb-editor-textarea {
  width: 100%;
  resize: none;
  padding: 22px 24px;
  font: 14px/1.7 "Inter", sans-serif;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.kb-editor-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(122,196,255,0.12), inset 0 1px 0 rgba(255,255,255,0.82);
}
.kb-editor-preview {
  overflow: auto;
  padding: 22px;
}
.kb-preview-sheet {
  min-height: 100%;
  background: linear-gradient(180deg, rgba(255,255,255,0.99) 0%, rgba(249,250,252,0.99) 100%);
  border: 1px solid rgba(208,216,227,0.7);
  border-radius: 24px;
  padding: 28px;
  box-shadow: 0 12px 28px rgba(15,23,42,0.08);
}
.kb-preview-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 16px;
  margin-bottom: 18px;
  border-bottom: 1px solid rgba(210,219,229,0.7);
}
.kb-preview-topline strong {
  font-size: 14px;
  color: var(--text-primary);
}
.kb-preview-topline span {
  font-size: 11px;
  color: var(--text-muted);
}
.kb-preview-rich p {
  margin-bottom: 14px;
  color: var(--text-secondary);
  line-height: 1.72;
}
.kb-preview-plain {
  white-space: pre-wrap;
  font: 13px/1.72 "IBM Plex Mono", "Consolas", monospace;
  color: var(--text-secondary);
}
[data-theme="dark"] .kb-doc-trigger:hover .kb-file-name {
  color: #9fceff;
}
[data-theme="dark"] .kb-file-icon {
  border-color: rgba(255,255,255,0.1);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}
[data-theme="dark"] .kb-file-icon.kb-pdf {
  color: #ff7a7a;
}
[data-theme="dark"] .kb-file-icon.kb-docx {
  color: #7cc9ff;
}
[data-theme="dark"] .kb-file-icon.kb-txt {
  color: #59d6c0;
}
[data-theme="dark"] .kb-delete-btn {
  background: transparent;
  border-color: rgba(255,255,255,0.1);
  color: #ff8b8b;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}
[data-theme="dark"] .kb-delete-btn:hover {
  background: rgba(248,113,113,0.08);
  border-color: rgba(248,113,113,0.22);
  color: #ff7a7a;
  box-shadow: 0 0 0 3px rgba(248,113,113,0.06);
}
[data-theme="dark"] .kb-editor-modal {
  box-shadow: 0 28px 72px rgba(0,0,0,0.42);
}
[data-theme="dark"] .kb-editor-side-card,
[data-theme="dark"] .kb-editor-textarea,
[data-theme="dark"] .kb-editor-preview {
  background: rgba(255,255,255,0.045);
  border-color: rgba(255,255,255,0.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
[data-theme="dark"] .kb-preview-sheet {
  background: linear-gradient(180deg, rgba(39,43,49,0.98) 0%, rgba(30,33,39,0.99) 100%);
  border-color: rgba(255,255,255,0.08);
  box-shadow: 0 14px 26px rgba(0,0,0,0.22);
}
[data-theme="dark"] .kb-preview-topline {
  border-bottom-color: rgba(255,255,255,0.08);
}
@media (max-width: 1024px) {
  .kb-editor-modal {
    width: min(100%, calc(100vw - 20px));
    height: min(88vh, 860px);
  }
  .kb-editor-head {
    flex-direction: column;
  }
  .kb-editor-name-input {
    width: 100%;
  }
  .kb-editor-layout {
    grid-template-columns: 1fr;
  }
  .kb-editor-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
}

/* === AGENT CARDS === */
.agent-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(300px,1fr)); gap: 14px; }
.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  align-items: stretch;
  margin-top: 6px;
}
.choice-grid .agent-card {
  min-height: 290px;
  height: 100%;
}
.agent-card {
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: 0 12px 28px rgba(0,0,0,0.14);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.agent-card:hover { border-color: var(--border-strong); box-shadow: 0 4px 28px var(--accent-glow-sm); }
.agent-card-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 12px; }
.agent-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: transparent !important;
  border: 1px solid rgba(160,172,188,0.28);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.72);
}
.agent-icon .icon-svg {
  width: 20px;
  height: 20px;
}
.agent-desc {
  font-size: 12px;
  line-height: 1.55;
  color: #6a7483;
  margin-bottom: 12px;
}
.agent-alert {
  color: #ef4444;
  font-weight: 700;
}
[data-theme="dark"] .agent-icon {
  border-color: rgba(255,255,255,0.1);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}
[data-theme="dark"] .agent-desc {
  color: #9aa5b3;
}
.scenario-thumb {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,0.22);
  box-shadow: 0 10px 20px rgba(0,0,0,0.18), inset 0 1px 0 rgba(255,255,255,0.26);
}
.scenario-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.03) contrast(1.02);
}
.scenario-thumb .scenario-initial {
  position: absolute;
  right: -2px;
  bottom: -2px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.25px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.86);
  color: #f8fbff;
  border: 1px solid rgba(255,255,255,0.3);
}
.agent-name { font-size: 14px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.agent-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.agent-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }

/* === SPLIT VIEW === */
.split-view {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  height: calc(100vh - 112px);
  overflow: hidden;
  border-radius: var(--radius-xl);
  background: var(--surface);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  box-shadow: 0 18px 42px rgba(0,0,0,0.16);
}
.split-left  { border-right: 1px solid var(--border); overflow-y: auto; }
.split-right { padding: 20px; overflow-y: auto; }

/* === CHANNEL ITEMS === */
.channel-item { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.channel-item:hover { background: var(--surface-hover); box-shadow: var(--hover-glow); }
.channel-item.active { background: var(--surface-hover); border-right: 2px solid var(--accent); box-shadow: var(--hover-glow); }
.ch-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(255,255,255,0.44);
  border: 1px solid rgba(148,163,184,0.18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.72), 0 4px 12px rgba(15,23,42,0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.ch-icon .brand-mark,
.ch-icon .icon-svg {
  width: 20px;
  height: 20px;
}
.ch-icon .icon-svg {
  stroke-width: 1.9;
}
.ch-icon.ch-web { color: #7f9dff; }
.ch-icon.ch-voice { color: #9e7dff; }
.ch-icon.ch-email { color: #8ca2bd; }
[data-theme="dark"] .ch-icon {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.1);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 4px 12px rgba(2,6,18,0.28);
}
.ch-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.ch-meta { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; font-weight: 600; margin-top: 2px; }

/* === INBOX === */
.inbox-layout {
  display: grid;
  grid-template-columns: 316px minmax(0, 1fr) 314px;
  height: calc(100vh - 112px);
  overflow: hidden;
  border-radius: 22px;
  background: var(--surface);
  backdrop-filter: blur(28px) saturate(160%);
  border: 1px solid var(--border);
  box-shadow: 0 12px 30px rgba(0,0,0,0.14), inset 0 1px 0 rgba(255,255,255,0.03);
  transition: grid-template-columns 0.42s cubic-bezier(0.22, 0.74, 0.18, 1), box-shadow 0.28s ease, border-color 0.28s ease;
  animation: inboxLayoutEnter 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.inbox-sidebar {
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0));
  transition: border-color 0.28s ease, background 0.28s ease;
}
.inbox-search {
  min-height: 66px;
  padding: 0 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: min-height 0.34s cubic-bezier(0.22, 0.74, 0.18, 1), padding 0.34s cubic-bezier(0.22, 0.74, 0.18, 1), border-color 0.24s ease;
}
.inbox-left-toggle {
  width: 36px;
  min-width: 36px;
  height: 36px;
  border-radius: 50%;
  aspect-ratio: 1 / 1;
  box-sizing: border-box;
  overflow: hidden;
  border: 1px solid rgba(186,211,238,0.95);
  background: linear-gradient(135deg, #f4fbff 0%, #d7ecff 100%);
  color: #13243a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(46, 80, 126, 0.2), inset 0 1px 0 rgba(255,255,255,0.92);
  transition: all 0.2s;
}
.inbox-left-toggle .icon-svg {
  width: 14px;
  height: 14px;
  stroke-width: 2.05;
}
.inbox-left-toggle:hover {
  background: linear-gradient(135deg, #ffffff 0%, #e4f2ff 100%);
  box-shadow: 0 6px 14px rgba(46, 80, 126, 0.24), inset 0 1px 0 rgba(255,255,255,0.96);
}
.inbox-left-toggle.active {
  background: linear-gradient(145deg, #22344f 0%, #131c2f 100%);
  color: #f5f9ff;
  border-color: rgba(110,148,190,0.52);
  box-shadow: 0 5px 13px rgba(10, 18, 31, 0.34), inset 0 1px 0 rgba(255,255,255,0.08);
}
.inbox-search .search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  border-radius: 14px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  padding: 10px 12px;
  transition: border-color 0.28s ease, box-shadow 0.28s ease, opacity 0.24s ease, transform 0.3s ease, width 0.3s ease, padding 0.3s ease;
}
.inbox-search .search-field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(122,196,255,0.25), 0 8px 16px rgba(53,103,177,0.12);
}
[data-theme="dark"] .inbox-search .search-field:focus-within {
  border-color: rgba(122,196,255,0.28);
  background: rgba(255,255,255,0.055);
  box-shadow: 0 0 0 1px rgba(122,196,255,0.12), 0 6px 12px rgba(5,11,22,0.24);
}
.inbox-search .search-field .icon-svg {
  position: static;
  left: auto;
  top: auto;
  transform: none;
  flex-shrink: 0;
}
.inbox-search .input {
  font-size: 13px !important;
  padding: 0 !important;
  padding-left: 0 !important;
  border: none !important;
  background: transparent !important;
}
[data-theme="dark"] .inbox-left-toggle {
  border-color: rgba(122,159,198,0.34);
  background: linear-gradient(145deg, #293750 0%, #1a2435 100%);
  color: #dfeaff;
  box-shadow: 0 5px 13px rgba(2,6,18,.45), inset 0 1px 0 rgba(255,255,255,.08);
}
[data-theme="dark"] .inbox-left-toggle:hover {
  background: linear-gradient(145deg, #324461 0%, #202b3f 100%);
  color: #f3f8ff;
}
[data-theme="dark"] .inbox-left-toggle.active {
  background: linear-gradient(135deg, #f4fbff 0%, #d7ecff 100%);
  color: #13243a;
  border-color: rgba(170,200,232,0.82);
  box-shadow: 0 4px 10px rgba(6,12,24,0.34), inset 0 1px 0 rgba(255,255,255,0.92);
}
.inbox-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 8px 10px;
  gap: 8px;
  border-bottom: 1px solid var(--border);
}
.inbox-tab {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 10.8px;
  font-weight: 800;
  text-transform: none;
  letter-spacing: 0.2px;
  cursor: pointer;
  color: var(--text-muted);
  border: 1px solid transparent;
  background: transparent;
  font-family: inherit;
  appearance: none;
  transition: all 0.2s;
}
.inbox-tab:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
  color: var(--text-primary);
}
.inbox-tab.active {
  background: linear-gradient(135deg, #f4fbff 0%, #d7ecff 100%);
  color: var(--text-primary);
  border-color: rgba(196,222,245,0.96);
  box-shadow: 0 4px 10px rgba(53,103,177,0.14), inset 0 1px 0 rgba(255,255,255,0.9);
}
[data-theme="dark"] .inbox-tab.active {
  background: var(--surface-strong);
  border-color: rgba(122,196,255,0.18);
  box-shadow: 0 3px 9px rgba(6,12,24,0.28), inset 0 1px 0 rgba(255,255,255,0.04);
}
.inbox-filters {
  padding: 10px 12px 12px;
  display: flex;
  gap: 9px;
  overflow-x: auto;
  align-items: center;
  border-bottom: 1px solid var(--border);
}
.fpill-sm {
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.35px;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
  appearance: none;
  transition: all 0.2s;
}
.fpill-sm:hover { box-shadow: 0 3px 8px rgba(34,57,86,0.12); }
.fpill-sm.active {
  background: linear-gradient(135deg, rgba(244,251,255,0.98) 0%, rgba(223,238,255,0.96) 100%);
  color: #1d3557;
  border-color: rgba(186,211,238,0.95);
  box-shadow: 0 4px 10px rgba(53,103,177,0.12), inset 0 1px 0 rgba(255,255,255,0.92);
}
[data-theme="dark"] .fpill-sm.active {
  background: rgba(114,181,255,0.11);
  color: var(--accent-soft);
  border-color: rgba(122,196,255,0.22);
  box-shadow: 0 3px 9px rgba(6,12,24,0.28), inset 0 1px 0 rgba(255,255,255,0.03);
}
.inbox-filters .fpill-sm {
  min-width: 38px;
  height: 36px;
  padding: 0 13px;
  border-radius: 999px;
  flex: 0 0 auto;
}
.inbox-filters .fpill-sm:not(.channel-filter) {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.28px;
}
.channel-filter {
  width: 36px;
  min-width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 999px;
  flex: 0 0 auto;
  border-color: rgba(122,196,255,0.24);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 4px 10px rgba(0,0,0,0.12);
  transition: transform 0.18s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.channel-filter:hover {
  transform: translateY(-1px) scale(1.045);
  box-shadow: 0 0 0 1px rgba(122,196,255,0.16), 0 6px 12px rgba(0,0,0,0.14);
}
.channel-filter.active {
  border-color: rgba(122,196,255,0.42);
  box-shadow: 0 0 0 1px rgba(122,196,255,0.2), 0 6px 12px rgba(48,93,153,0.18);
}
[data-theme="dark"] .channel-filter:hover {
  box-shadow: 0 5px 10px rgba(0,0,0,0.24);
  border-color: rgba(122,196,255,0.22);
}
[data-theme="dark"] .channel-filter.active {
  border-color: rgba(122,196,255,0.28);
  box-shadow: 0 0 0 1px rgba(122,196,255,0.1), 0 6px 12px rgba(0,0,0,0.26);
}
.channel-filter[data-channel="tg"] {
  background: radial-gradient(circle at 28% 24%, rgba(152,228,255,0.42), transparent 58%), rgba(42,171,238,0.2);
}
.channel-filter[data-channel="wa"] {
  background: radial-gradient(circle at 28% 24%, rgba(190,255,219,0.42), transparent 58%), rgba(37,211,102,0.2);
}
.channel-filter[data-channel="ig"] {
  background: radial-gradient(circle at 28% 24%, rgba(255,226,157,0.35), transparent 62%), rgba(244,114,182,0.18);
}
.channel-filter[data-channel="viber"] {
  background: radial-gradient(circle at 28% 24%, rgba(207,186,255,0.4), transparent 60%), rgba(115,96,242,0.2);
}
.channel-filter[data-channel="web"] {
  background: radial-gradient(circle at 28% 24%, rgba(187,212,255,0.36), transparent 60%), rgba(99,102,241,0.16);
}
.channel-filter[data-channel="email"] {
  background: radial-gradient(circle at 28% 24%, rgba(209,226,245,0.36), transparent 60%), rgba(148,163,184,0.18);
}
.channel-filter .brand-mark,
.channel-filter .icon-svg {
  width: 18px;
  height: 18px;
}
.channel-filter .icon-svg {
  stroke-width: 1.8;
}
.channel-filter[data-channel="web"] .icon-svg {
  stroke: #8eb7ff;
}
.channel-filter[data-channel="email"] .icon-svg {
  stroke: #a6b7cc;
}
.channel-filter[data-channel="ig"] .brand-mark rect:first-of-type {
  fill: none !important;
  stroke: #f472b6 !important;
  stroke-width: 2 !important;
}
.channel-filter[data-channel="ig"] .brand-mark rect:nth-of-type(2) {
  stroke: #fb923c !important;
  stroke-width: 2 !important;
}
.channel-filter[data-channel="ig"] .brand-mark circle:first-of-type {
  stroke: #fb923c !important;
  stroke-width: 2 !important;
}
.channel-filter[data-channel="ig"] .brand-mark circle:last-of-type {
  fill: #facc15 !important;
}
.inbox-agent-filter-wrap {
  margin: 12px 12px 12px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0));
}
.inbox-agent-filter-wrap .label {
  font-size: 10px;
  margin-bottom: 6px;
  display: block;
  letter-spacing: 0.5px;
}
.inbox-agent-filter-wrap .select {
  font-size: 12px;
  padding: 8px 10px;
  border-radius: 11px;
}
.chat-empty { padding: 24px 18px; text-align: center; font-size: 11px; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; }
.chat-item[hidden] { display: none; }
.chat-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 10px 12px;
}
.chat-item {
  display: flex;
  gap: 10px;
  padding: 11px 10px;
  border: 1px solid transparent;
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease, transform 0.22s ease;
  margin-bottom: 6px;
  animation: inboxItemEnter 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.chat-item:nth-child(1) { animation-delay: 0.02s; }
.chat-item:nth-child(2) { animation-delay: 0.05s; }
.chat-item:nth-child(3) { animation-delay: 0.08s; }
.chat-item:nth-child(4) { animation-delay: 0.11s; }
.chat-item:nth-child(5) { animation-delay: 0.14s; }
.chat-item:last-child {
  margin-bottom: 0;
}
.chat-item:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(34,57,86,0.12);
}
.chat-item.active {
  background: var(--surface-hover);
  border-color: rgba(122,196,255,0.28);
  box-shadow: inset 0 0 0 1px rgba(122,196,255,0.16), 0 4px 10px rgba(34,57,86,0.1);
}
[data-theme="dark"] .chat-item.active {
  background: rgba(255,255,255,0.03);
  border-color: rgba(122,196,255,0.2);
  box-shadow: inset 0 0 0 1px rgba(122,196,255,0.08), 0 5px 12px rgba(0,0,0,0.24);
}
.chat-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: center / cover no-repeat url("assets/placeholders/avatar-manager.svg") !important;
  border: 1px solid rgba(214, 232, 248, 0.42);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
  font-weight: 700;
  color: transparent !important;
  text-indent: -9999px;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
  box-shadow: 0 8px 18px rgba(0,0,0,0.18);
}
.chat-avatar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.08) 0%, rgba(0,0,0,0.08) 100%);
  pointer-events: none;
}
.chat-item[data-conversation="anna"] .chat-avatar,
#conversation-avatar[data-conversation="anna"] {
  background-image: url("assets/placeholders/avatar-anna.svg") !important;
}
.chat-item[data-conversation="peter"] .chat-avatar,
#conversation-avatar[data-conversation="peter"] {
  background-image: url("assets/placeholders/avatar-peter.svg") !important;
}
.chat-item[data-conversation="olena"] .chat-avatar,
#conversation-avatar[data-conversation="olena"] {
  background-image: url("assets/placeholders/avatar-olena.svg") !important;
}
.chat-item[data-conversation="vasyl"] .chat-avatar,
#conversation-avatar[data-conversation="vasyl"] {
  background-image: url("assets/placeholders/avatar-vasyl.svg") !important;
}
.chat-item[data-conversation="iryna"] .chat-avatar,
#conversation-avatar[data-conversation="iryna"] {
  background-image: url("assets/placeholders/avatar-iryna.svg") !important;
}
#conversation-avatar[data-conversation="empty"] {
  background-image: url("assets/placeholders/avatar-manager.svg") !important;
  filter: grayscale(0.18) saturate(0.85);
}
.chat-name { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.chat-main {
  flex: 1;
  min-width: 0;
}
.chat-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.chat-preview {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.chat-time { font-size: 11px; color: var(--text-muted); margin-left: auto; white-space: nowrap; font-weight: 700; }
.chat-meta-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}
.chat-channel-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 18px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  background: rgba(114,181,255,0.16);
  color: #1f3e62;
  border: 1px solid rgba(122,196,255,0.32);
}
.chat-item[data-channel="tg"] .chat-channel-badge {
  background: rgba(42,171,238,0.16);
  color: #0a6aa5;
  border-color: rgba(42,171,238,0.34);
}
.chat-item[data-channel="wa"] .chat-channel-badge {
  background: rgba(37,211,102,0.14);
  color: #0f7a47;
  border-color: rgba(37,211,102,0.28);
}
.chat-item[data-channel="ig"] .chat-channel-badge {
  background: rgba(244,114,182,0.16);
  color: #9d1f68;
  border-color: rgba(244,114,182,0.3);
}
.chat-item[data-channel="viber"] .chat-channel-badge {
  background: rgba(115,96,242,0.16);
  color: #4d38c2;
  border-color: rgba(115,96,242,0.34);
}
.chat-item[data-channel="email"] .chat-channel-badge {
  background: rgba(148,163,184,0.18);
  color: #46556b;
  border-color: rgba(148,163,184,0.34);
}
[data-theme="dark"] .chat-channel-badge {
  color: #dbeafe;
  border-color: rgba(122,196,255,0.3);
}
.chat-agent-hint {
  font-size: 10px;
  color: var(--text-muted);
}
.chat-agent-hint:empty {
  display: none;
}
.unread-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-grad); margin-top: 8px; flex-shrink: 0; }
.inbox-center { display: flex; flex-direction: column; overflow: hidden; border-right: 1px solid var(--border); transition: border-color 0.28s ease; }
.inbox-chat-header {
  min-height: 66px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 12px;
  row-gap: 8px;
  transition: min-height 0.34s cubic-bezier(0.22, 0.74, 0.18, 1), border-color 0.24s ease, padding 0.34s cubic-bezier(0.22, 0.74, 0.18, 1);
}
.inbox-header-left {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.inbox-header-left .chat-main {
  min-width: 0;
  display: block;
}
.inbox-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
#conversation-avatar.chat-avatar {
  width: 42px;
  height: 42px;
}
#conversation-name {
  font-size: 16px !important;
  font-weight: 700 !important;
  color: var(--text-primary) !important;
  line-height: 1.2;
}
#conversation-status {
  display: block;
  margin-top: 3px;
  font-size: 10px !important;
  font-weight: 700 !important;
  letter-spacing: 0.35px !important;
  text-transform: uppercase;
}
#conversation-agent.badge-type {
  font-size: 10px !important;
  padding: 6px 10px;
  border-radius: 999px;
  margin-left: 0;
  max-width: 190px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.inbox-chat-header .btn-sm {
  padding: 7px 12px;
  font-size: 10px;
  font-weight: 700;
  border-radius: 999px;
  white-space: nowrap;
  flex: 0 0 auto;
}
.inbox-chat-header .crm-burger-btn {
  margin-left: 0;
  height: 30px;
  border-radius: 999px;
  padding: 0 13px;
}
@media (max-width: 1480px) {
  .inbox-chat-header {
    grid-template-columns: 1fr;
  }
  .inbox-header-actions {
    justify-content: flex-start;
  }
  #conversation-agent.badge-type {
    max-width: none;
  }
}
.chat-messages { flex: 1; overflow-y: auto; padding: 20px 20px 18px; display: flex; flex-direction: column; gap: 13px; }
.chat-messages .msg,
.chat-messages .msg-log {
  animation: inboxBubbleEnter 0.34s ease both;
}
.msg {
  max-width: min(75%, 860px);
  padding: 12px 16px 10px;
  border-radius: 20px;
  font-size: 13.5px;
  line-height: 1.48;
  overflow-wrap: anywhere;
  word-break: break-word;
  position: relative;
  border: 1px solid transparent;
  box-shadow: 0 6px 16px rgba(16, 24, 40, 0.08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.msg:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(16, 24, 40, 0.1);
}
.msg-in {
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(255,255,255,0.78), transparent 60%),
    linear-gradient(145deg, rgba(255,255,255,0.96) 0%, rgba(242,247,252,0.95) 100%);
  color: var(--text-primary);
  align-self: flex-start;
  border-radius: 20px 20px 20px 9px;
  border-color: rgba(148,163,184,0.24);
}
.msg-out-ai {
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(231,245,255,0.58), transparent 64%),
    linear-gradient(145deg, rgba(218,237,255,0.78) 0%, rgba(195,222,250,0.68) 100%);
  color: #1b2b42;
  align-self: flex-end;
  border-radius: 20px 20px 9px 20px;
  border-color: rgba(122,196,255,0.44);
  box-shadow: 0 8px 18px rgba(72, 133, 204, 0.14);
}
.msg-out-human {
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(205,247,234,0.54), transparent 64%),
    linear-gradient(145deg, rgba(187,239,223,0.78) 0%, rgba(160,223,203,0.72) 100%);
  color: #12352b;
  align-self: flex-end;
  border-radius: 20px 20px 9px 20px;
  border-color: rgba(16,185,129,0.42);
  box-shadow: 0 8px 18px rgba(16,185,129,0.14);
}
.msg-meta {
  font-size: 10px;
  color: #697a90;
  margin-top: 6px;
  font-weight: 700;
  opacity: 0.96;
  letter-spacing: 0.16px;
}
.msg-log {
  font-size: 10.5px;
  color: var(--text-muted);
  text-align: center;
  padding: 6px 16px;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.5) 0%, rgba(232,238,246,0.44) 100%);
  border-radius: 999px;
  align-self: center;
  border: 1px solid rgba(148,163,184,0.2);
}
[data-theme="dark"] .msg {
  box-shadow: 0 7px 16px rgba(0,0,0,0.24);
}
[data-theme="dark"] .msg:hover {
  box-shadow: 0 11px 22px rgba(0,0,0,0.28);
}
[data-theme="dark"] .msg-in {
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(116,131,154,0.2), transparent 64%),
    linear-gradient(145deg, rgba(61,68,80,0.8) 0%, rgba(49,55,66,0.84) 100%);
  color: #e8edf5;
  border-color: rgba(148,163,184,0.3);
}
[data-theme="dark"] .msg-out-ai {
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(124,184,255,0.2), transparent 66%),
    linear-gradient(145deg, rgba(56,95,136,0.56) 0%, rgba(45,79,117,0.64) 100%);
  color: #e7f1ff;
  border-color: rgba(122,196,255,0.44);
  box-shadow: 0 6px 14px rgba(10,18,30,0.3);
}
[data-theme="dark"] .msg-out-human {
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(91,218,172,0.17), transparent 66%),
    linear-gradient(145deg, rgba(35,118,95,0.58) 0%, rgba(27,90,74,0.66) 100%);
  color: #ecfff8;
  border-color: rgba(52,211,153,0.44);
  box-shadow: 0 8px 18px rgba(15,37,31,0.34);
}
[data-theme="dark"] .msg-meta {
  color: #9bafc9;
}
[data-theme="dark"] .msg-log {
  background: linear-gradient(145deg, rgba(92,105,124,0.22) 0%, rgba(69,79,95,0.2) 100%);
  border-color: rgba(148,163,184,0.24);
  color: #a7b6c9;
}
.inbox-input { padding: 12px 16px; border-top: 0; }
.inbox-input-row { display: flex; align-items: center; gap: 8px; background: var(--input-bg); border: 1px solid var(--input-border); border-radius: 14px; padding: 10px 12px; transition: border-color 0.24s ease, box-shadow 0.24s ease, background 0.24s ease; }
.inbox-input-row:focus-within {
  border-color: rgba(122,196,255,0.72);
  background: rgba(255,255,255,0.92);
  box-shadow: 0 0 0 1px rgba(122,196,255,0.3), 0 8px 16px rgba(53,103,177,0.16);
}
[data-theme="dark"] .inbox-input-row:focus-within {
  border-color: rgba(122,196,255,0.34);
  background: rgba(255,255,255,0.065);
  box-shadow: 0 0 0 1px rgba(122,196,255,0.14), 0 6px 14px rgba(8,14,24,0.32);
}
.inbox-input-row textarea { flex: 1; border: none; background: transparent; font-family: inherit; font-size: 13px; color: var(--text-primary); outline: none; resize: none; }
.inbox-input-row #inbox-send.btn-primary.btn-sm {
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.inbox-input .chat-tool {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.inbox-input .chat-tool:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
  background: var(--surface-hover);
  box-shadow: 0 3px 8px rgba(34,57,86,0.14);
}
.inbox-input .chat-tool.active {
  border-color: rgba(122,196,255,0.4);
  background: linear-gradient(135deg, #f4fbff 0%, #d7ecff 100%);
  color: #143151;
  box-shadow: 0 4px 10px rgba(53,103,177,0.16), inset 0 1px 0 rgba(255,255,255,0.92);
}
[data-theme="dark"] .inbox-input .chat-tool.active {
  background: rgba(114,181,255,0.1);
  color: #e6f3ff;
  border-color: rgba(122,196,255,0.2);
  box-shadow: 0 3px 8px rgba(6,12,24,0.28), inset 0 1px 0 rgba(255,255,255,0.03);
}
.inbox-topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.crm-burger-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  border: 1px solid rgba(186,211,238,0.95);
  background: linear-gradient(135deg, #f4fbff 0%, #d7ecff 100%);
  color: #13243a;
  padding: 7px 13px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(53,103,177,0.16), inset 0 1px 0 rgba(255,255,255,0.92);
  transition: all 0.2s;
}
.crm-burger-btn .icon-svg {
  width: 15px;
  height: 15px;
  stroke-width: 1.8;
}
.crm-burger-btn:hover {
  color: #0f1d30;
  background: linear-gradient(135deg, #ffffff 0%, #e4f2ff 100%);
  border-color: rgba(170,199,230,0.98);
  box-shadow: 0 12px 24px rgba(53,103,177,0.2), inset 0 1px 0 rgba(255,255,255,0.96);
}
.crm-burger-btn.active {
  background: linear-gradient(145deg, #1b2a42 0%, #0f1729 100%);
  color: #f5f9ff;
  border-color: rgba(122,159,198,0.44);
  box-shadow: 0 10px 20px rgba(8,14,24,0.36), inset 0 1px 0 rgba(255,255,255,0.08);
}
[data-theme="dark"] .crm-burger-btn {
  border-color: rgba(122,159,198,0.34);
  background: linear-gradient(145deg, #293750 0%, #1a2435 100%);
  color: #dfeaff;
  box-shadow: 0 10px 20px rgba(2,6,18,.45), inset 0 1px 0 rgba(255,255,255,.08);
}
[data-theme="dark"] .crm-burger-btn:hover {
  background: linear-gradient(145deg, #324461 0%, #202b3f 100%);
  color: #f3f8ff;
}
[data-theme="dark"] .crm-burger-btn.active {
  background: linear-gradient(145deg, #f4fbff 0%, #d7ecff 100%);
  color: #13243a;
  border-color: rgba(170,200,232,0.82);
  box-shadow: 0 8px 16px rgba(6,12,24,0.34), inset 0 1px 0 rgba(255,255,255,0.92);
}
.inbox-layout.inbox-left-collapsed {
  grid-template-columns: 62px minmax(0, 1fr) 314px !important;
}
.inbox-layout.inbox-left-collapsed.crm-collapsed {
  grid-template-columns: 62px minmax(0, 1fr) 0 !important;
}
.inbox-layout.inbox-left-collapsed .inbox-search {
  min-height: 66px;
  padding: 0 12px;
  justify-content: flex-start;
}
.inbox-layout.inbox-left-collapsed .inbox-search .search-field {
  display: none;
}
.inbox-layout.inbox-left-collapsed .inbox-left-toggle {
  width: 36px;
  min-width: 36px;
  height: 36px;
  margin: 0;
}
.inbox-layout.inbox-left-collapsed .inbox-tabs,
.inbox-layout.inbox-left-collapsed .inbox-agent-filter-wrap {
  display: none;
}
.inbox-layout.inbox-left-collapsed .inbox-filters {
  padding: 8px 4px 8px;
  justify-content: center;
}
.inbox-layout.inbox-left-collapsed .inbox-filters .fpill-sm {
  display: none;
}
.inbox-layout.inbox-left-collapsed .inbox-filters .fpill-sm.active {
  display: inline-flex;
}
.inbox-layout.inbox-left-collapsed .chat-list {
  padding: 6px 3px 10px;
}
.inbox-layout.inbox-left-collapsed .chat-item {
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 7px 3px;
  border-radius: 13px;
}
.inbox-layout.inbox-left-collapsed .chat-list .chat-main {
  display: flex;
  align-items: center;
  justify-content: center;
}
.inbox-layout.inbox-left-collapsed .chat-list .chat-head,
.inbox-layout.inbox-left-collapsed .chat-list .chat-preview,
.inbox-layout.inbox-left-collapsed .chat-list .chat-agent-hint,
.inbox-layout.inbox-left-collapsed .chat-list .chat-time,
.inbox-layout.inbox-left-collapsed .chat-list .unread-dot {
  display: none;
}
.inbox-layout.inbox-left-collapsed .chat-list .chat-meta-row {
  margin-top: 0;
}
.inbox-layout.inbox-left-collapsed .chat-list .chat-channel-badge {
  min-width: 24px;
  height: 15px;
  padding: 0 5px;
  font-size: 8px;
  margin: 0;
}
.inbox-layout.crm-collapsed {
  grid-template-columns: 316px minmax(0, 1fr) 0 !important;
}
.inbox-layout.crm-collapsed .inbox-right {
  opacity: 0;
  transform: translateX(14px);
  visibility: hidden;
  pointer-events: none;
  overflow: hidden;
  padding-left: 0;
  padding-right: 0;
}
.inbox-layout.crm-collapsed .inbox-center {
  border-right: 0;
}
.inbox-right {
  padding: 18px 16px 16px;
  overflow-y: auto;
  opacity: 1;
  transform: translateX(0);
  visibility: visible;
  transition: opacity 0.32s ease, transform 0.36s cubic-bezier(0.22, 0.74, 0.18, 1), padding 0.34s cubic-bezier(0.22, 0.74, 0.18, 1);
}
.inbox-right .card-title {
  margin-bottom: 14px !important;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.2px;
}
.inbox-right .label {
  margin-bottom: 6px;
  display: block;
}
.inbox-right .input,
.inbox-right .textarea {
  font-size: 12px !important;
  border-radius: 12px;
}
#crm-notes {
  min-height: 88px !important;
}
#crm-tags {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
  margin-top: 6px !important;
}
#crm-history {
  gap: 8px !important;
}

@keyframes inboxLayoutEnter {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.997);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes inboxItemEnter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes inboxBubbleEnter {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* === INTEGRATIONS === */
.int-card {
  background: var(--surface);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 12px 28px rgba(0,0,0,0.14);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.int-card:hover { border-color: var(--border-strong); box-shadow: 0 4px 28px var(--accent-glow-sm); }
.int-logo { width: 48px; height: 48px; border-radius: var(--radius-sm); background: var(--surface-strong); display: flex; align-items: center; justify-content: center; font-size: 22px; }
.int-name { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.int-desc { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }
.int-lock { font-size: 10px; color: var(--text-muted); background: var(--surface-strong); padding: 3px 10px; border-radius: 20px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; width: fit-content; border: 1px solid var(--border); }

/* === MISC === */
.pr-wrap { height: 6px; background: var(--surface-strong); border-radius: 10px; overflow: hidden; }
.pr-fill { height: 100%; border-radius: 10px; background: var(--accent-grad); }
.sec-hd { font-size: 11px; font-weight: 800; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.8px; margin: 20px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.msg-pill { display: flex; align-items: center; background: var(--surface); backdrop-filter: blur(20px); border: 1px solid var(--border); border-radius: 20px; padding: 8px 18px; font-size: 12px; color: var(--text-secondary); font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; }
.chip-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 4px 0 0;
  min-height: auto;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  background: linear-gradient(135deg, rgba(244,251,255,0.95) 0%, rgba(228,241,255,0.92) 100%);
  border: 1px solid rgba(122,196,255,0.24);
  border-radius: 999px;
  padding: 0 11px;
  font-size: 11px;
  font-weight: 700;
  color: #1f3e62;
  cursor: default;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.82);
}
.chip span {
  color: #6f8daf;
  font-weight: 700;
}
.chip-text {
  color: inherit;
}
.chip-remove {
  appearance: none;
  border: 0;
  background: transparent;
  color: #6f8daf;
  font-weight: 800;
  font-size: 14px;
  line-height: 1;
  padding: 0 0 0 2px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.18s ease, transform 0.18s ease;
}
.chip-remove:hover {
  color: #d63b61;
  transform: scale(1.06);
}
.chip-add {
  cursor: pointer;
  font-family: inherit;
  color: #22354b;
  background: rgba(255,255,255,0.72);
  border-color: rgba(148,163,184,0.24);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.18s ease, background 0.2s;
}
.chip-add:hover {
  transform: translateY(-1px);
  border-color: rgba(122,196,255,0.34);
  background: linear-gradient(135deg, rgba(255,255,255,0.98) 0%, rgba(237,246,255,0.95) 100%);
  box-shadow: 0 6px 14px rgba(53,103,177,0.12), inset 0 1px 0 rgba(255,255,255,0.9);
}
[data-theme="dark"] .chip {
  color: #e6f3ff;
  background: linear-gradient(145deg, rgba(59,85,116,0.3) 0%, rgba(47,72,102,0.34) 100%);
  border-color: rgba(122,196,255,0.24);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}
[data-theme="dark"] .chip span {
  color: #a8bed8;
}
[data-theme="dark"] .chip-remove {
  color: #a8bed8;
}
[data-theme="dark"] .chip-remove:hover {
  color: #ff9ab2;
}
[data-theme="dark"] .chip-add {
  color: #eaf3ff;
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.12);
}
[data-theme="dark"] .chip-add:hover {
  background: rgba(122,196,255,0.12);
  border-color: rgba(122,196,255,0.24);
  box-shadow: 0 6px 14px rgba(2,6,18,0.28), inset 0 1px 0 rgba(255,255,255,0.05);
}
.code-block { background: #0d0d0d; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; font-family: monospace; font-size: 12px; color: #7dd3fc; overflow-x: auto; margin-top: 8px; }
.preset-wrap { display: flex; gap: 10px; flex-wrap: wrap; }
.preset-btn {
  min-width: 128px;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0.08px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-family: inherit;
  transition: all 0.2s;
}
.preset-btn:hover { background: var(--surface-hover); box-shadow: var(--hover-glow); }
.preset-btn.active { background: linear-gradient(135deg, #f4fbff 0%, #d7ecff 100%); color: #111418; border-color: rgba(186,211,238,0.95); box-shadow: 0 10px 20px rgba(53,103,177,0.16), inset 0 1px 0 rgba(255,255,255,0.92); }
[data-theme="dark"] .preset-btn.active { background: var(--accent-grad); color: #fff; border-color: transparent; box-shadow: var(--hover-glow), 0 4px 16px var(--accent-glow-sm); }
.badge-color-field {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}
.badge-color-input {
  appearance: none;
  -webkit-appearance: none;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
}
.badge-color-input::-webkit-color-swatch-wrapper {
  padding: 0;
}
.badge-color-input::-webkit-color-swatch {
  border: 2px solid rgba(255,255,255,0.92);
  border-radius: 50%;
  box-shadow: 0 8px 18px rgba(15,23,42,0.14);
}
.badge-color-input::-moz-color-swatch {
  border: 2px solid rgba(255,255,255,0.92);
  border-radius: 50%;
  box-shadow: 0 8px 18px rgba(15,23,42,0.14);
}
.badge-color-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.badge-color-preview {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid rgba(122,196,255,0.24);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: background .18s ease, border-color .18s ease, color .18s ease;
}
.badge-color-note {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.45;
}
[data-theme="dark"] .badge-color-field {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.1);
}
[data-theme="dark"] .badge-color-input::-webkit-color-swatch,
[data-theme="dark"] .badge-color-input::-moz-color-swatch {
  border-color: rgba(15,23,42,0.9);
  box-shadow: 0 10px 20px rgba(2,6,18,0.28);
}
[data-theme="dark"] .badge-color-note {
  color: var(--text-muted);
}
.agent-icon-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  --agent-accent: #6b78ff;
}
.agent-icon-option {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--agent-accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}
.agent-icon-option .icon-svg {
  width: 18px;
  height: 18px;
}
.agent-icon-option:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--agent-accent) 36%, transparent);
  box-shadow: 0 10px 18px rgba(15,23,42,0.08);
}
.agent-icon-option.active {
  background: color-mix(in srgb, var(--agent-accent) 12%, white);
  border-color: color-mix(in srgb, var(--agent-accent) 44%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--agent-accent) 18%, transparent), 0 10px 20px rgba(15,23,42,0.1);
}
[data-theme="dark"] .agent-icon-option {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.1);
}
[data-theme="dark"] .agent-icon-option.active {
  background: color-mix(in srgb, var(--agent-accent) 18%, rgba(16,24,40,0.92));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--agent-accent) 22%, transparent), 0 12px 22px rgba(2,6,18,0.22);
}
.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(114,181,255,0.12);
  color: #1f3e62;
  border-radius: 999px;
  min-height: 24px;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 700;
  margin: 2px;
  border: 1px solid rgba(122,196,255,0.24);
}
.tag-gray {
  background: var(--surface-strong);
  color: #41536a;
  border-color: var(--border);
}
.tag-add {
  cursor: pointer;
  font-family: inherit;
  line-height: 1;
  transition: all 0.2s;
}
.tag-add:hover {
  background: linear-gradient(135deg, #f4fbff 0%, #d7ecff 100%);
  border-color: rgba(186,211,238,0.95);
  color: #13243a;
  box-shadow: 0 8px 16px rgba(53,103,177,0.14), inset 0 1px 0 rgba(255,255,255,0.92);
}
[data-theme="dark"] .tag {
  color: #dbeafe;
}
[data-theme="dark"] .tag-gray {
  color: #d1d7e0;
}
.color-swatch { width: 28px; height: 28px; border-radius: 8px; cursor: pointer; border: 2px solid transparent; }
.color-swatch.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-glow-sm); }
.av-option { width: 100%; aspect-ratio: 1; border-radius: var(--radius-sm); background: var(--surface-strong); display: flex; align-items: center; justify-content: center; font-size: 24px; cursor: pointer; border: 2px solid transparent; transition: all 0.2s; }
.av-option:hover { border-color: var(--border-strong); }
.av-option.selected { border-color: var(--accent); box-shadow: 0 0 12px var(--accent-glow-sm); }
.avatar-grid { display: grid; grid-template-columns: repeat(5,1fr); gap: 8px; margin-top: 8px; }
.color-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.settings-tabs { display: flex; gap: 6px; margin-bottom: 22px; background: var(--surface); border-radius: 999px; padding: 6px; width: fit-content; max-width: 100%; border: 1px solid var(--border); box-shadow: inset 0 1px 0 rgba(255,255,255,0.26); }
.stab { padding: 10px 22px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; cursor: pointer; color: var(--text-secondary); transition: all 0.2s; }
.stab:hover { box-shadow: var(--hover-glow); color: var(--text-primary); }
.stab.active { background: var(--surface-strong); color: var(--accent-soft); box-shadow: var(--hover-glow), 0 2px 10px var(--accent-glow-sm); border: 1px solid var(--border-strong); }
[data-theme="light"] .stab.active {
  color: #18324f;
  background: linear-gradient(135deg, #f4fbff 0%, #d7ecff 100%);
  border-color: rgba(186,211,238,0.95);
  box-shadow: 0 10px 20px rgba(53,103,177,0.14), inset 0 1px 0 rgba(255,255,255,0.92);
}

.settings-page-grid { display: grid; gap: 20px; }
.settings-page-grid--profile { grid-template-columns: 1fr 1fr; }
.settings-page-grid--general { grid-template-columns: 1fr 0.92fr; }
.settings-page-grid--plan { grid-template-columns: 1.1fr 0.9fr; }
.settings-card { min-height: 100%; }
.settings-stack { display: flex; flex-direction: column; gap: 14px; }
.settings-avatar-row { display: flex; align-items: center; gap: 18px; margin-bottom: 22px; }
.settings-avatar-row .avatar { width: 64px; height: 64px; border: 1px solid rgba(214,232,248,0.48); box-shadow: 0 12px 28px rgba(13,22,35,0.18); }
.settings-avatar-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.settings-surface { border-radius: 24px; border: 1px solid var(--border); background: var(--surface-strong); box-shadow: inset 0 1px 0 rgba(255,255,255,0.26); }
.settings-option-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 20px; }
.settings-option-copy { flex: 1; min-width: 0; }
.settings-option-title { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.settings-option-note { margin-top: 6px; font-size: 12px; line-height: 1.55; color: var(--text-secondary); }
.settings-preview-stack { display: flex; flex-direction: column; gap: 12px; }
.settings-mini-card { padding: 16px 18px; }
.settings-kicker { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }
.settings-copy { margin-top: 8px; font-size: 13px; line-height: 1.55; color: var(--text-secondary); }
.settings-credit-meta { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-muted); }
.settings-plan-date { margin-bottom: 18px; font-size: 12px; color: var(--text-secondary); }
.settings-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.settings-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; border: 1px solid var(--border); background: var(--surface-strong); color: var(--text-primary); }
.settings-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; opacity: 0.7; }
.settings-plan-overview { display: flex; flex-direction: column; gap: 12px; }

[data-theme="dark"] .settings-tabs {
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), inset 0 -1px 0 rgba(0,0,0,0.16);
}

[data-theme="dark"] .settings-surface {
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), inset 0 -1px 0 rgba(0,0,0,0.16);
}

[data-theme="dark"] .settings-pill {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.1);
}

[data-theme="dark"] .settings-avatar-row .avatar {
  border-color: rgba(255,255,255,0.12);
}

@media (max-width: 1080px) {
  .settings-page-grid--profile,
  .settings-page-grid--general,
  .settings-page-grid--plan {
    grid-template-columns: 1fr;
  }

  .integration-support-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .integration-support-grid {
    grid-template-columns: 1fr;
  }
}

/* === AGENT CONFIG LAYOUT === */
.agent-config-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 0;
  height: calc(100vh - 112px);
  overflow: hidden;
  border-radius: var(--radius-xl);
  background: var(--surface);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  box-shadow: 0 18px 42px rgba(0,0,0,0.16);
}
.agent-config-left { padding: 24px; overflow-y: auto; border-right: 1px solid var(--border); }
.agent-config-right { display: flex; flex-direction: column; background: var(--surface); }
.sandbox-header { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.sandbox-title { font-size: 11px; font-weight: 800; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.6px; }
.sandbox-header .topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.sandbox-header .btn-ghost.btn-sm {
  min-width: 138px;
  padding: 8px 14px;
  white-space: nowrap;
  border-radius: 999px;
}
.sandbox-header .toggle-label {
  font-size: 11px;
  letter-spacing: 0.1px;
}
.sandbox-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.sandbox-input { padding: 12px; }
.sandbox-input-row textarea {
  min-height: 24px;
}
.debug-note {
  align-self: flex-end;
  max-width: min(78%, 420px);
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 11px;
  line-height: 1.55;
  color: var(--text-secondary);
  background: rgba(148,163,184,0.1);
  border: 1px solid rgba(148,163,184,0.16);
}
[data-theme="dark"] .debug-note {
  color: #b5c2d2;
  background: rgba(148,163,184,0.12);
  border-color: rgba(148,163,184,0.18);
}

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scrollbar-c); border-radius: 4px; }

/* === AUTH PAGE === */
.auth-page {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  z-index: 1000;
}

.auth-page::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 600px 400px at 15% 20%, var(--blob-1), transparent 70%),
    radial-gradient(ellipse 400px 500px at 85% 80%, var(--blob-2), transparent 70%);
}

.auth-card {
  background: var(--surface);
  backdrop-filter: blur(48px);
  -webkit-backdrop-filter: blur(48px);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  padding: 40px;
  width: 400px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.4), 0 0 60px var(--accent-glow-sm);
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 24px;
  color: var(--accent-soft);
}

.auth-title {
  font-size: 18px;
  font-weight: 900;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.auth-sub {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 30px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
}
.auth-divider span { font-size: 10px; color: var(--text-muted); font-weight: 800; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.btn-google {
  width: 100%;
  background: var(--surface-strong);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.2s;
  font-family: inherit;
}
.btn-google:hover { background: var(--surface-hover); border-color: var(--border-strong); }

/* === THEME SWITCHER === */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 14px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  transition: all 0.2s;
  font-family: inherit;
}
.theme-toggle:hover { background: var(--surface-hover); border-color: var(--border-strong); color: var(--text-primary); box-shadow: var(--hover-glow); }
.theme-toggle svg { width: 14px; height: 14px; }

.nav-footer .theme-toggle {
  display: none !important;
}

.theme-toggle-switch {
  position: relative;
  width: 50px;
  height: 22px;
  padding: 0;
  margin: 1px 0 0;
  align-self: flex-start;
  border: 1px solid #e5f4ff;
  border-radius: 999px;
  background: linear-gradient(180deg, #63b1ea 0%, #4d9ddc 58%, #3f8dce 100%);
  display: block;
  cursor: pointer;
  transition: transform 0.22s ease, box-shadow 0.24s ease, background 0.3s ease, border-color 0.3s ease;
  overflow: hidden;
  background-clip: padding-box;
  font-family: inherit;
  box-shadow:
    0 0 0 1px rgba(183,223,251,0.8),
    inset 0 1px 0 rgba(255,255,255,0.28),
    inset 0 -6px 10px rgba(11,29,51,0.18),
    0 4px 9px rgba(10,24,41,0.16);
}
[data-theme="light"] .theme-toggle-switch {
  border-color: rgba(207,216,226,0.96);
  box-shadow:
    0 0 0 1px rgba(220,227,235,0.92),
    inset 0 1px 0 rgba(255,255,255,0.34),
    inset 0 -6px 10px rgba(11,29,51,0.18),
    0 4px 9px rgba(10,24,41,0.16);
}
.theme-toggle-switch:hover {
  transform: translateY(-1px);
  box-shadow:
    0 0 0 1px rgba(196,231,255,0.92),
    inset 0 1px 0 rgba(255,255,255,0.34),
    inset 0 -6px 10px rgba(11,29,51,0.18),
    0 6px 11px rgba(10,24,41,0.2);
}
[data-theme="light"] .theme-toggle-switch:hover {
  box-shadow:
    0 0 0 1px rgba(225,231,238,0.98),
    inset 0 1px 0 rgba(255,255,255,0.38),
    inset 0 -6px 10px rgba(11,29,51,0.18),
    0 6px 11px rgba(10,24,41,0.2);
}
.theme-toggle-switch::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,0.22) 0%, rgba(255,255,255,0) 42%);
  opacity: 0.68;
  transition: opacity 0.24s ease;
  z-index: 1;
}
.theme-toggle-switch::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(18,26,38,0.12), inset 0 1px 5px rgba(7,11,18,0.08);
  opacity: 1;
  z-index: 1;
}
.theme-toggle-switch .tts-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 33%, #ffe24e 0%, #fdd430 60%, #efbe1f 100%);
  border: 1px solid rgba(182,136,9,0.64);
  box-shadow:
    0 3px 7px rgba(34,43,58,0.24),
    inset 0 1px 0 rgba(255,255,255,0.42);
  transition: transform 0.32s cubic-bezier(.22,.72,.2,1), background 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease;
  z-index: 3;
}
.theme-toggle-switch .tts-thumb::before {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: radial-gradient(circle at center, rgba(255,213,84,0.26) 0 62%, transparent 74%);
  opacity: 0.54;
  transition: opacity 0.24s ease;
}
.theme-toggle-switch .tts-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 70% 28%, rgba(134,146,164,0.62) 0 2px, transparent 2.8px),
    radial-gradient(circle at 42% 66%, rgba(129,141,160,0.56) 0 2.9px, transparent 3.7px),
    radial-gradient(circle at 66% 61%, rgba(129,141,160,0.5) 0 2.2px, transparent 3px);
  opacity: 0;
  transition: opacity 0.24s ease;
}
.theme-toggle-switch .tts-side {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  user-select: none;
  color: transparent;
  font-size: 0;
}
.theme-toggle-switch .tts-day {
  background:
    radial-gradient(65% 120% at 10% 40%, rgba(137,197,240,0.56) 0 52%, transparent 53%),
    radial-gradient(60% 120% at 24% 42%, rgba(122,188,236,0.5) 0 50%, transparent 51%),
    radial-gradient(58% 120% at 40% 42%, rgba(113,182,234,0.46) 0 49%, transparent 50%),
    radial-gradient(56% 120% at 56% 42%, rgba(108,177,230,0.42) 0 48%, transparent 49%),
    radial-gradient(50% 90% at 102% 24%, rgba(255,255,255,0.4) 0 48%, transparent 50%),
    linear-gradient(180deg, #67b8f0 0%, #4b9ddf 62%, #3f8fd2 100%);
  opacity: 1;
  transition: opacity 0.24s ease;
}
.theme-toggle-switch .tts-day::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 8px;
  background:
    radial-gradient(circle at 10% 92%, rgba(246,252,255,0.97) 0 5px, transparent 6px),
    radial-gradient(circle at 24% 86%, rgba(236,247,255,0.95) 0 6px, transparent 7px),
    radial-gradient(circle at 39% 92%, rgba(246,252,255,0.95) 0 5.5px, transparent 6.5px),
    radial-gradient(circle at 55% 87%, rgba(236,247,255,0.94) 0 6px, transparent 7px),
    radial-gradient(circle at 72% 92%, rgba(246,252,255,0.94) 0 5px, transparent 6px),
    radial-gradient(circle at 88% 87%, rgba(236,247,255,0.94) 0 4.5px, transparent 5.5px);
}
.theme-toggle-switch .tts-night {
  background:
    radial-gradient(circle at 14% 24%, rgba(255,255,255,0.94) 0 1px, transparent 1.3px),
    radial-gradient(circle at 26% 40%, rgba(255,255,255,0.8) 0 1.2px, transparent 1.5px),
    radial-gradient(circle at 42% 20%, rgba(255,255,255,0.9) 0 1px, transparent 1.3px),
    radial-gradient(circle at 57% 36%, rgba(255,255,255,0.74) 0 1.3px, transparent 1.7px),
    radial-gradient(circle at 71% 21%, rgba(255,255,255,0.9) 0 1.1px, transparent 1.4px),
    radial-gradient(circle at 82% 34%, rgba(255,255,255,0.82) 0 1.1px, transparent 1.5px),
    radial-gradient(circle at 92% 50%, rgba(198,206,220,0.30) 0 10%, transparent 11%),
    radial-gradient(circle at 84% 50%, rgba(141,151,170,0.24) 0 24%, transparent 25%),
    radial-gradient(circle at 72% 50%, rgba(95,105,127,0.24) 0 36%, transparent 37%),
    radial-gradient(circle at 56% 50%, rgba(56,64,83,0.22) 0 50%, transparent 51%),
    linear-gradient(180deg, #20283a 0%, #141b2c 60%, #0d1322 100%);
  opacity: 0;
  transition: opacity 0.24s ease;
}
.theme-toggle-switch .tts-side svg {
  display: none;
}
.theme-toggle-switch .tts-side span {
  display: none;
}
.theme-toggle-switch[data-theme="light"] .tts-thumb {
  transform: translateX(0);
}
.theme-toggle-switch[data-theme="dark"] .tts-thumb {
  transform: translateX(29px);
  background: radial-gradient(circle at 30% 30%, #f6f9fc 0%, #dce3ed 56%, #c2cbd8 100%);
  border-color: rgba(113,124,140,0.6);
  box-shadow: 0 2px 6px rgba(7,10,18,0.34), inset 0 2px 4px rgba(255,255,255,0.38);
}
.theme-toggle-switch[data-theme="dark"] .tts-thumb::before {
  opacity: 0;
}
.theme-toggle-switch[data-theme="dark"] .tts-thumb::after {
  opacity: 1;
}
.theme-toggle-switch[data-theme="dark"] {
  border-color: #0b1220;
  background: linear-gradient(180deg, #252d43 0%, #171e31 62%, #111728 100%);
  box-shadow:
    0 0 0 1px rgba(7,11,18,0.96),
    inset 0 0 0 1px rgba(8,12,20,0.48),
    inset 0 -5px 9px rgba(0,0,0,0.34),
    0 3px 7px rgba(0,0,0,0.2);
}
.theme-toggle-switch[data-theme="dark"]::before {
  opacity: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0) 40%);
}
.theme-toggle-switch[data-theme="dark"] .tts-day::after {
  opacity: 0;
  transform: translateY(6px);
}
.theme-toggle-switch[data-theme="dark"] .tts-day {
  opacity: 0;
  display: none;
}
.theme-toggle-switch[data-theme="dark"] .tts-night {
  opacity: 1;
}
.theme-toggle-switch[data-theme="dark"] .tts-night::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 64% 18%, rgba(155,168,186,0.10) 0 7px, transparent 8px),
    radial-gradient(circle at 78% 54%, rgba(155,168,186,0.06) 0 12px, transparent 13px);
}
.theme-toggle-switch[data-theme="dark"]::after {
  opacity: 1;
  box-shadow: inset 0 0 0 1px rgba(8,12,20,0.42);
}
.theme-toggle-switch[data-theme="dark"]:hover {
  box-shadow:
    0 0 0 1px rgba(12,18,28,0.98),
    inset 0 0 0 1px rgba(8,12,20,0.52),
    inset 0 -5px 9px rgba(0,0,0,0.36),
    0 4px 8px rgba(0,0,0,0.24);
}
.theme-toggle-switch[data-theme="light"] {
  border-color: rgba(207,216,226,0.96);
  box-shadow:
    0 0 0 1px rgba(220,227,235,0.92),
    inset 0 1px 0 rgba(255,255,255,0.34),
    inset 0 -6px 10px rgba(11,29,51,0.18),
    0 4px 9px rgba(10,24,41,0.16);
}
.theme-toggle-switch[data-theme="light"] .tts-day {
  opacity: 1;
}
.theme-toggle-switch[data-theme="light"] .tts-night {
  opacity: 0;
}
.theme-toggle-switch[data-theme="light"] .tts-day::after {
  transform: translateY(0);
}

/* === AUTH EXPERIENCE OVERRIDES === */
body.auth-scene {
  display: block;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
}

body.auth-scene::after {
  content: "";
  position: fixed;
  inset: auto auto -180px -140px;
  width: 540px;
  height: 540px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(circle, rgba(120, 186, 255, 0.13) 0%, rgba(120, 186, 255, 0.02) 58%, transparent 72%);
}

body.auth-scene .auth-page {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  padding: clamp(18px, 3vw, 30px);
  overflow-y: auto;
  background:
    radial-gradient(circle at 14% 18%, rgba(74, 132, 255, 0.34) 0%, transparent 18%),
    radial-gradient(circle at 86% 20%, rgba(0, 204, 255, 0.16) 0%, transparent 16%),
    radial-gradient(circle at 72% 78%, rgba(41, 89, 210, 0.26) 0%, transparent 22%),
    radial-gradient(circle at 32% 88%, rgba(0, 153, 255, 0.14) 0%, transparent 18%),
    linear-gradient(135deg, #030812 0%, #07111f 34%, #081425 64%, #03070f 100%);
  animation: authPageIn 0.45s cubic-bezier(.22,1,.36,1);
}

body.auth-scene .auth-page.hidden {
  display: none !important;
}

body.auth-scene .auth-page::before {
  display: block;
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle at 22% 24%, rgba(158, 223, 255, 0.14), transparent 12%),
    radial-gradient(circle at 72% 32%, rgba(122, 190, 255, 0.12), transparent 10%),
    linear-gradient(115deg, transparent 12%, rgba(92, 176, 255, 0.09) 38%, transparent 66%);
  mix-blend-mode: screen;
  opacity: 0.92;
  animation: authAuroraPulse 14s ease-in-out infinite alternate;
}

body.auth-scene .auth-top-actions {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 12;
  display: flex;
  align-items: center;
  gap: 12px;
}

body.auth-scene .skip-demo,
body.auth-scene .prototype-auth-skip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid rgba(86, 102, 124, 0.16);
  background: rgba(255, 255, 255, 0.82);
  color: var(--text-primary);
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  box-shadow: 0 16px 34px rgba(38, 60, 89, 0.10);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

body.auth-scene .skip-demo:hover,
body.auth-scene .prototype-auth-skip:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 22px 40px rgba(38, 60, 89, 0.14);
}

body.auth-scene .auth-layout {
  width: min(1220px, 100%);
  min-height: min(760px, calc(100vh - 60px));
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(390px, 0.92fr);
  gap: 22px;
  align-items: stretch;
}

body.auth-scene .auth-showcase,
body.auth-scene .auth-card {
  position: relative;
  overflow: hidden;
  border-radius: 32px;
  border: 1px solid rgba(89, 98, 112, 0.10);
  background: rgba(255, 255, 255, 0.76);
  box-shadow:
    0 28px 72px rgba(37, 54, 80, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

body.auth-scene .auth-showcase {
  padding: clamp(28px, 4vw, 42px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    radial-gradient(circle at top right, rgba(123, 184, 255, 0.18), transparent 28%),
    radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.72), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.84) 0%, rgba(240, 245, 251, 0.90) 100%);
}

body.auth-scene .auth-showcase::before,
body.auth-scene .auth-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.38) 0%, transparent 26%),
    linear-gradient(120deg, transparent 0%, rgba(255,255,255,0.12) 42%, transparent 60%);
}

body.auth-scene .auth-showcase::after {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 26px;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.44);
}

body.auth-scene .auth-showcase-main,
body.auth-scene .auth-showcase-bottom,
body.auth-scene .auth-card > * {
  position: relative;
  z-index: 1;
}

body.auth-scene .auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 26px;
}

body.auth-scene .auth-brand-mark {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  color: #18385a;
  filter: drop-shadow(0 10px 14px rgba(34, 67, 109, 0.12));
}

body.auth-scene .auth-brand-copy {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

body.auth-scene .auth-brand-name {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #192532;
}

body.auth-scene .auth-brand-sub {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

body.auth-scene .auth-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #3f6f9e;
}

body.auth-scene .auth-kicker::before {
  content: "";
  width: 34px;
  height: 1px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(70, 126, 186, 0), rgba(70, 126, 186, 0.72));
}

body.auth-scene .auth-headline {
  max-width: 9.6em;
  margin: 0;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 0.98;
  letter-spacing: -0.045em;
  font-weight: 800;
  color: #162230;
}

body.auth-scene .auth-showcase-sub {
  max-width: 540px;
  margin: 18px 0 0;
  font-size: 15px;
  line-height: 1.72;
  color: #5d6878;
}

body.auth-scene .auth-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 28px;
}

body.auth-scene .auth-stat {
  padding: 16px 16px 15px;
  border-radius: 22px;
  border: 1px solid rgba(89, 98, 112, 0.08);
  background: rgba(255, 255, 255, 0.56);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.65);
}

body.auth-scene .auth-stat-label {
  display: block;
  margin-bottom: 10px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7a8795;
}

body.auth-scene .auth-stat-value {
  display: block;
  font-size: 28px;
  line-height: 1;
  font-weight: 800;
  color: #172432;
}

body.auth-scene .auth-stat-note {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.5;
  color: #657184;
}

body.auth-scene .auth-showcase-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(220px, 0.95fr);
  gap: 16px;
  margin-top: 26px;
}

body.auth-scene .auth-preview,
body.auth-scene .auth-benefits {
  border-radius: 26px;
  border: 1px solid rgba(89, 98, 112, 0.10);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 16px 36px rgba(37, 54, 80, 0.08);
}

body.auth-scene .auth-preview {
  padding: 18px;
}

body.auth-scene .auth-preview-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

body.auth-scene .auth-preview-title {
  font-size: 15px;
  font-weight: 700;
  color: #1b2735;
}

body.auth-scene .auth-preview-sub {
  margin-top: 4px;
  font-size: 12px;
  color: #738093;
}

body.auth-scene .auth-preview-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(113, 189, 255, 0.16);
  color: #245d94;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body.auth-scene .auth-preview-chat {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

body.auth-scene .auth-preview-bubble {
  max-width: 92%;
  padding: 14px 16px;
  border-radius: 18px;
  font-size: 13px;
  line-height: 1.55;
  box-shadow: 0 8px 22px rgba(26, 45, 71, 0.06);
}

body.auth-scene .auth-preview-bubble.incoming {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.92);
  color: #2e3848;
  border: 1px solid rgba(89, 98, 112, 0.08);
  border-top-left-radius: 8px;
}

body.auth-scene .auth-preview-bubble.outgoing {
  align-self: flex-end;
  background: linear-gradient(180deg, rgba(232, 244, 255, 0.98) 0%, rgba(219, 238, 255, 0.96) 100%);
  color: #224364;
  border: 1px solid rgba(114, 181, 255, 0.20);
  border-top-right-radius: 8px;
}

body.auth-scene .auth-benefits {
  padding: 18px 18px 16px;
}

body.auth-scene .auth-benefits-title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #738093;
}

body.auth-scene .auth-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

body.auth-scene .auth-list li {
  position: relative;
  padding-left: 20px;
  font-size: 13px;
  line-height: 1.55;
  color: #3f4b5a;
}

body.auth-scene .auth-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, #78bbff 0%, #4d93ff 100%);
  box-shadow: 0 0 0 4px rgba(120, 187, 255, 0.12);
}

body.auth-scene .auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
}

body.auth-scene .auth-card {
  width: 100%;
  max-width: 470px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(249, 251, 253, 0.86) 100%);
}

body.auth-scene .auth-card-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  min-height: 32px;
  margin-bottom: 18px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(115, 186, 255, 0.15);
  color: #2c659a;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}

body.auth-scene .auth-title {
  margin: 0;
  font-size: clamp(30px, 3.3vw, 38px);
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: -0.045em;
  color: #172331;
}

body.auth-scene .auth-sub {
  margin: 12px 0 0;
  font-size: 15px;
  line-height: 1.65;
  color: #677283;
}

body.auth-scene .auth-demo-note {
  margin: 18px 0 22px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(113, 189, 255, 0.14);
  background: linear-gradient(180deg, rgba(239, 247, 255, 0.95) 0%, rgba(231, 242, 253, 0.92) 100%);
  color: #55708e;
  font-size: 13px;
  line-height: 1.6;
}

body.auth-scene .auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

body.auth-scene .auth-card .form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

body.auth-scene .auth-card .form-row {
  margin: 0;
}

body.auth-scene .auth-card .form-row.full {
  grid-column: 1 / -1;
}

body.auth-scene .auth-card .label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #748192;
}

body.auth-scene .auth-card .input {
  width: 100%;
  min-height: 54px;
  padding: 0 16px;
  border-radius: 18px;
  border: 1px solid rgba(89, 98, 112, 0.12);
  background: rgba(255, 255, 255, 0.84);
  color: #1b2430;
  font: 500 15px "Inter", "Plus Jakarta Sans", sans-serif;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

body.auth-scene .auth-card .input::placeholder {
  color: #95a0ae;
}

body.auth-scene .auth-card .input:focus {
  border-color: rgba(89, 148, 219, 0.28);
  background: rgba(255, 255, 255, 0.96);
  box-shadow:
    0 0 0 1px rgba(122, 196, 255, 0.12),
    0 0 0 6px rgba(122, 196, 255, 0.12),
    0 12px 28px rgba(63, 101, 147, 0.12);
  transform: translateY(-1px);
}

body.auth-scene .forgot-link {
  align-self: flex-end;
  margin-top: -4px;
  color: #3a6f9f;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

body.auth-scene .forgot-link:hover,
body.auth-scene .auth-footer .link:hover {
  color: #214f7c;
}

body.auth-scene .btn-primary,
body.auth-scene .btn-google {
  width: 100%;
  min-height: 54px;
  border: 0;
  border-radius: 18px;
  cursor: pointer;
  font-family: "Inter", "Plus Jakarta Sans", sans-serif;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

body.auth-scene .btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  background: linear-gradient(135deg, #1b2740 0%, #24476d 46%, #376ea3 100%);
  color: #f7fbff;
  box-shadow: 0 18px 36px rgba(33, 66, 104, 0.20);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  text-decoration: none;
}

body.auth-scene .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 22px 40px rgba(33, 66, 104, 0.24);
}

body.auth-scene .auth-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 18px 0;
}

body.auth-scene .auth-divider::before,
body.auth-scene .auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(89, 98, 112, 0.12);
}

body.auth-scene .auth-divider span {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: #95a0ae;
}

body.auth-scene .btn-google {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 16px;
  border: 1px solid rgba(89, 98, 112, 0.12);
  background: rgba(255, 255, 255, 0.80);
  color: #253345;
  font-size: 14px;
  font-weight: 700;
}

body.auth-scene .btn-google:hover {
  transform: translateY(-1px);
  border-color: rgba(89, 98, 112, 0.18);
  background: rgba(255, 255, 255, 0.94);
}

body.auth-scene .google-svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

body.auth-scene .auth-footer {
  margin-top: 20px;
  font-size: 14px;
  line-height: 1.6;
  color: #6e7a89;
  text-align: center;
}

body.auth-scene .auth-footer .link {
  color: #295b8d;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

[data-theme="dark"] body.auth-scene::after,
body[data-theme="dark"].auth-scene::after {
  background: radial-gradient(circle, rgba(54, 107, 171, 0.26) 0%, rgba(54, 107, 171, 0.04) 58%, transparent 74%);
}

[data-theme="dark"] body.auth-scene .skip-demo,
[data-theme="dark"] body.auth-scene .prototype-auth-skip,
body[data-theme="dark"].auth-scene .skip-demo,
body[data-theme="dark"].auth-scene .prototype-auth-skip {
  background: rgba(24, 27, 33, 0.88);
  border-color: rgba(255, 255, 255, 0.10);
  color: #eef4fb;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.28);
}

[data-theme="dark"] body.auth-scene .auth-showcase,
[data-theme="dark"] body.auth-scene .auth-card,
body[data-theme="dark"].auth-scene .auth-showcase,
body[data-theme="dark"].auth-scene .auth-card {
  border-color: rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(34, 38, 45, 0.92) 0%, rgba(25, 28, 34, 0.96) 100%);
  box-shadow:
    0 32px 72px rgba(0, 0, 0, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] body.auth-scene .auth-showcase,
body[data-theme="dark"].auth-scene .auth-showcase {
  background:
    radial-gradient(circle at top right, rgba(86, 145, 212, 0.18), transparent 28%),
    linear-gradient(145deg, rgba(29, 34, 41, 0.95) 0%, rgba(20, 23, 29, 0.98) 100%);
}

[data-theme="dark"] body.auth-scene .auth-showcase::after,
[data-theme="dark"] body.auth-scene .auth-preview,
[data-theme="dark"] body.auth-scene .auth-benefits,
[data-theme="dark"] body.auth-scene .auth-stat,
body[data-theme="dark"].auth-scene .auth-showcase::after,
body[data-theme="dark"].auth-scene .auth-preview,
body[data-theme="dark"].auth-scene .auth-benefits,
body[data-theme="dark"].auth-scene .auth-stat {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: none;
}

[data-theme="dark"] body.auth-scene .auth-brand-name,
[data-theme="dark"] body.auth-scene .auth-headline,
[data-theme="dark"] body.auth-scene .auth-preview-title,
[data-theme="dark"] body.auth-scene .auth-stat-value,
[data-theme="dark"] body.auth-scene .auth-title,
body[data-theme="dark"].auth-scene .auth-brand-name,
body[data-theme="dark"].auth-scene .auth-headline,
body[data-theme="dark"].auth-scene .auth-preview-title,
body[data-theme="dark"].auth-scene .auth-stat-value,
body[data-theme="dark"].auth-scene .auth-title {
  color: #f2f5f8;
}

[data-theme="dark"] body.auth-scene .auth-brand-sub,
[data-theme="dark"] body.auth-scene .auth-showcase-sub,
[data-theme="dark"] body.auth-scene .auth-stat-label,
[data-theme="dark"] body.auth-scene .auth-stat-note,
[data-theme="dark"] body.auth-scene .auth-preview-sub,
[data-theme="dark"] body.auth-scene .auth-benefits-title,
[data-theme="dark"] body.auth-scene .auth-list li,
[data-theme="dark"] body.auth-scene .auth-sub,
[data-theme="dark"] body.auth-scene .auth-demo-note,
[data-theme="dark"] body.auth-scene .auth-footer,
body[data-theme="dark"].auth-scene .auth-brand-sub,
body[data-theme="dark"].auth-scene .auth-showcase-sub,
body[data-theme="dark"].auth-scene .auth-stat-label,
body[data-theme="dark"].auth-scene .auth-stat-note,
body[data-theme="dark"].auth-scene .auth-preview-sub,
body[data-theme="dark"].auth-scene .auth-benefits-title,
body[data-theme="dark"].auth-scene .auth-list li,
body[data-theme="dark"].auth-scene .auth-sub,
body[data-theme="dark"].auth-scene .auth-demo-note,
body[data-theme="dark"].auth-scene .auth-footer {
  color: #a7b0bb;
}

[data-theme="dark"] body.auth-scene .auth-brand-mark,
body[data-theme="dark"].auth-scene .auth-brand-mark {
  color: #e7eef7;
}

[data-theme="dark"] body.auth-scene .auth-preview-bubble.incoming,
body[data-theme="dark"].auth-scene .auth-preview-bubble.incoming {
  background: rgba(255, 255, 255, 0.06);
  color: #dbe3ed;
  border-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] body.auth-scene .auth-preview-bubble.outgoing,
body[data-theme="dark"].auth-scene .auth-preview-bubble.outgoing {
  background: linear-gradient(180deg, rgba(48, 76, 107, 0.72) 0%, rgba(34, 56, 82, 0.84) 100%);
  color: #eef5fc;
  border-color: rgba(114, 181, 255, 0.18);
}

[data-theme="dark"] body.auth-scene .auth-card .label,
[data-theme="dark"] body.auth-scene .auth-divider span,
body[data-theme="dark"].auth-scene .auth-card .label,
body[data-theme="dark"].auth-scene .auth-divider span {
  color: #8e97a2;
}

[data-theme="dark"] body.auth-scene .auth-card .input,
[data-theme="dark"] body.auth-scene .btn-google,
body[data-theme="dark"].auth-scene .auth-card .input,
body[data-theme="dark"].auth-scene .btn-google {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
  color: #eef5fc;
}

[data-theme="dark"] body.auth-scene .auth-card .input::placeholder,
body[data-theme="dark"].auth-scene .auth-card .input::placeholder {
  color: #7f8994;
}

[data-theme="dark"] body.auth-scene .auth-card .input:focus,
body[data-theme="dark"].auth-scene .auth-card .input:focus {
  background: rgba(255, 255, 255, 0.08);
  box-shadow:
    0 0 0 1px rgba(122, 196, 255, 0.14),
    0 0 0 6px rgba(122, 196, 255, 0.10),
    0 14px 28px rgba(0, 0, 0, 0.22);
}

[data-theme="dark"] body.auth-scene .btn-primary,
body[data-theme="dark"].auth-scene .btn-primary {
  background: linear-gradient(135deg, #eff5fd 0%, #d5e8ff 52%, #b9d9ff 100%);
  color: #162636;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.20);
}

[data-theme="dark"] body.auth-scene .btn-google,
[data-theme="dark"] body.auth-scene .forgot-link,
[data-theme="dark"] body.auth-scene .auth-footer .link,
body[data-theme="dark"].auth-scene .btn-google,
body[data-theme="dark"].auth-scene .forgot-link,
body[data-theme="dark"].auth-scene .auth-footer .link {
  color: #edf4fb;
}

@keyframes authPageIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1080px) {
  body.auth-scene .auth-layout {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  body.auth-scene .auth-showcase {
    min-height: 0;
  }

  body.auth-scene .auth-headline {
    max-width: 100%;
  }
}

@media (max-width: 760px) {
  body.auth-scene .auth-page {
    padding: 14px;
  }

  body.auth-scene .auth-top-actions {
    top: 12px;
    right: 12px;
  }

  body.auth-scene .skip-demo,
  body.auth-scene .prototype-auth-skip {
    min-height: 38px;
    padding: 0 14px;
    font-size: 11px;
  }

  body.auth-scene .auth-showcase {
    padding: 22px;
  }

  body.auth-scene .auth-stat-grid,
  body.auth-scene .auth-showcase-bottom,
  body.auth-scene .auth-card .form-grid {
    grid-template-columns: 1fr;
  }

  body.auth-scene .auth-card {
    padding: 22px 18px;
    border-radius: 28px;
  }

  body.auth-scene .auth-title {
    font-size: 28px;
  }
}

/* === AUTH DARK AURORA OVERRIDES === */
body.auth-scene {
  background: #060b14;
}

body.auth-scene::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 16% 18%, rgba(62, 120, 255, 0.34), transparent 26%),
    radial-gradient(circle at 78% 18%, rgba(0, 204, 255, 0.18), transparent 20%),
    radial-gradient(circle at 72% 74%, rgba(28, 85, 196, 0.26), transparent 25%),
    radial-gradient(circle at 36% 82%, rgba(0, 148, 255, 0.12), transparent 18%),
    linear-gradient(135deg, #030711 0%, #081120 38%, #06101c 68%, #02050c 100%);
  filter: saturate(112%);
  animation: authAuroraFloat 18s ease-in-out infinite alternate;
}

body.auth-scene::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 24% 24%, rgba(121, 212, 255, 0.14), transparent 14%),
    radial-gradient(circle at 70% 30%, rgba(105, 168, 255, 0.10), transparent 12%),
    linear-gradient(115deg, transparent 16%, rgba(124, 227, 255, 0.06) 42%, transparent 64%);
  mix-blend-mode: screen;
  opacity: 0.95;
  animation: authAuroraPulse 14s ease-in-out infinite alternate;
}

body.auth-scene .auth-layout {
  position: relative;
  z-index: 1;
  gap: 34px;
}

body.auth-scene .auth-showcase {
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding: clamp(20px, 3vw, 30px) clamp(8px, 1vw, 14px) clamp(20px, 3vw, 28px) 0;
}

body.auth-scene .auth-showcase::before,
body.auth-scene .auth-showcase::after {
  display: none;
}

body.auth-scene .auth-card {
  background:
    linear-gradient(180deg, rgba(9, 16, 29, 0.82) 0%, rgba(8, 14, 24, 0.90) 100%);
  border: 1px solid rgba(123, 186, 255, 0.14);
  box-shadow:
    0 30px 90px rgba(1, 6, 15, 0.56),
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    inset 0 0 0 1px rgba(87, 146, 255, 0.04);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
}

body.auth-scene .auth-card::before {
  background:
    linear-gradient(180deg, rgba(150, 214, 255, 0.07) 0%, transparent 18%),
    linear-gradient(120deg, transparent 0%, rgba(109, 182, 255, 0.05) 50%, transparent 74%);
}

body.auth-scene .auth-brand-name,
body.auth-scene .auth-headline,
body.auth-scene .auth-preview-title,
body.auth-scene .auth-stat-value,
body.auth-scene .auth-title {
  color: #f5f9ff;
}

body.auth-scene .auth-brand-sub,
body.auth-scene .auth-showcase-sub,
body.auth-scene .auth-stat-label,
body.auth-scene .auth-stat-note,
body.auth-scene .auth-preview-sub,
body.auth-scene .auth-benefits-title,
body.auth-scene .auth-list li,
body.auth-scene .auth-sub,
body.auth-scene .auth-demo-note,
body.auth-scene .auth-footer {
  color: #97a8be;
}

body.auth-scene .auth-brand-mark {
  color: #d8eaff;
  filter: drop-shadow(0 14px 30px rgba(49, 111, 201, 0.28));
}

body.auth-scene .auth-kicker {
  color: #7bc8ff;
}

body.auth-scene .auth-kicker::before {
  background: linear-gradient(90deg, rgba(123, 200, 255, 0), rgba(123, 200, 255, 0.82));
}

body.auth-scene .auth-stat,
body.auth-scene .auth-preview,
body.auth-scene .auth-benefits {
  border-color: rgba(123, 186, 255, 0.12);
  background:
    linear-gradient(180deg, rgba(10, 18, 31, 0.62) 0%, rgba(7, 13, 23, 0.76) 100%);
  box-shadow:
    0 18px 42px rgba(2, 8, 18, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

body.auth-scene .auth-preview-pill,
body.auth-scene .auth-card-badge {
  background: rgba(106, 191, 255, 0.14);
  color: #9ed8ff;
  border: 1px solid rgba(123, 186, 255, 0.12);
}

body.auth-scene .auth-preview-bubble.incoming {
  background: rgba(255, 255, 255, 0.05);
  color: #e3ebf6;
  border-color: rgba(255, 255, 255, 0.06);
  box-shadow: 0 14px 30px rgba(3, 10, 22, 0.14);
}

body.auth-scene .auth-preview-bubble.outgoing {
  background: linear-gradient(180deg, rgba(18, 67, 122, 0.72) 0%, rgba(10, 52, 97, 0.86) 100%);
  color: #edf6ff;
  border-color: rgba(92, 173, 255, 0.22);
  box-shadow: 0 18px 34px rgba(4, 20, 44, 0.18);
}

body.auth-scene .auth-list li::before {
  background: linear-gradient(135deg, #85d8ff 0%, #4c91ff 100%);
  box-shadow: 0 0 0 4px rgba(94, 181, 255, 0.12);
}

body.auth-scene .auth-card .label,
body.auth-scene .auth-divider span {
  color: #7e90a8;
}

body.auth-scene .auth-card .input,
body.auth-scene .btn-google {
  border-color: rgba(123, 186, 255, 0.12);
  background: rgba(255, 255, 255, 0.045);
  color: #f1f6fc;
}

body.auth-scene .auth-card .input::placeholder {
  color: #7c8da1;
}

body.auth-scene .auth-card .input:focus {
  border-color: rgba(113, 199, 255, 0.26);
  background: rgba(255, 255, 255, 0.07);
  box-shadow:
    0 0 0 1px rgba(118, 199, 255, 0.12),
    0 0 0 6px rgba(76, 140, 255, 0.08),
    0 18px 36px rgba(2, 10, 24, 0.32);
}

body.auth-scene .forgot-link,
body.auth-scene .auth-footer .link,
body.auth-scene .btn-google {
  color: #edf5ff;
}

body.auth-scene .auth-demo-note {
  border-color: rgba(112, 189, 255, 0.10);
  background: linear-gradient(180deg, rgba(12, 28, 49, 0.72) 0%, rgba(10, 22, 39, 0.84) 100%);
}

body.auth-scene .btn-primary {
  background: linear-gradient(135deg, #67cfff 0%, #4d9fff 42%, #2f6bff 100%);
  color: #04111f;
  box-shadow:
    0 18px 34px rgba(28, 107, 206, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

body.auth-scene .btn-primary:hover {
  box-shadow:
    0 24px 40px rgba(28, 107, 206, 0.40),
    inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

body.auth-scene .btn-google:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(130, 194, 255, 0.16);
}

body.auth-scene .skip-demo,
body.auth-scene .prototype-auth-skip {
  background: rgba(8, 15, 28, 0.58);
  border-color: rgba(123, 186, 255, 0.12);
  color: #f4f9ff;
  box-shadow:
    0 18px 42px rgba(1, 7, 18, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

body.auth-scene .skip-demo:hover,
body.auth-scene .prototype-auth-skip:hover {
  background: rgba(11, 20, 36, 0.72);
}

@keyframes authAuroraFloat {
  0% {
    transform: scale(1) translate3d(0, 0, 0);
    filter: saturate(112%) hue-rotate(0deg);
  }
  50% {
    transform: scale(1.04) translate3d(1.4%, -1.8%, 0);
    filter: saturate(118%) hue-rotate(-6deg);
  }
  100% {
    transform: scale(1.08) translate3d(-1.2%, 2%, 0);
    filter: saturate(124%) hue-rotate(6deg);
  }
}

@keyframes authAuroraPulse {
  0% {
    opacity: 0.72;
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    opacity: 0.96;
    transform: translate3d(-1%, 1%, 0) scale(1.03);
  }
  100% {
    opacity: 0.82;
    transform: translate3d(1.5%, -1%, 0) scale(1.07);
  }
}

@media (max-width: 1080px) {
  body.auth-scene .auth-showcase {
    padding-right: 0;
  }
}

/* === AUTH MINIMAL SINGLE-CARD LAYOUT === */
body.auth-scene .auth-layout {
  width: min(520px, calc(100vw - 32px));
  min-height: auto;
  display: block;
}

body.auth-scene .auth-showcase {
  display: none !important;
}

body.auth-scene .auth-panel {
  display: block;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}

body.auth-scene .auth-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

body.auth-scene .auth-brand-top {
  margin: 0;
  justify-content: center;
  gap: 14px;
}

body.auth-scene .auth-brand-top .auth-brand-copy {
  align-items: flex-start;
}

body.auth-scene .auth-brand-top .auth-brand-name {
  font-size: 18px;
  line-height: 1;
  letter-spacing: 0.22em;
}

body.auth-scene .auth-brand-top .auth-brand-sub {
  display: none;
}

body.auth-scene .auth-card {
  width: 100%;
  max-width: 520px;
  padding: 32px 28px 26px;
}

body.auth-scene .auth-card-badge,
body.auth-scene .auth-demo-note {
  display: none;
}

body.auth-scene .auth-title {
  text-align: left;
}

body.auth-scene .auth-sub {
  margin-top: 10px;
  margin-bottom: 6px;
}

body.auth-scene .auth-footer {
  margin-top: 18px;
}

@media (max-width: 760px) {
  body.auth-scene .auth-layout {
    width: min(100%, calc(100vw - 20px));
  }

  body.auth-scene .auth-stack {
    gap: 14px;
  }

  body.auth-scene .auth-brand-top .auth-brand-name {
    font-size: 16px;
    letter-spacing: 0.18em;
  }

  body.auth-scene .auth-card {
    padding: 24px 18px 20px;
  }
}

/* === AUTH FINAL VISUAL FIXES === */
[data-theme="light"] body.auth-scene,
body.auth-scene[data-theme="light"] {
  background:
    radial-gradient(circle at 14% 18%, rgba(74, 132, 255, 0.36) 0%, transparent 18%),
    radial-gradient(circle at 84% 20%, rgba(0, 204, 255, 0.18) 0%, transparent 16%),
    radial-gradient(circle at 70% 78%, rgba(41, 89, 210, 0.28) 0%, transparent 22%),
    radial-gradient(circle at 34% 88%, rgba(0, 153, 255, 0.16) 0%, transparent 18%),
    linear-gradient(135deg, #030812 0%, #07111f 34%, #081425 64%, #03070f 100%) !important;
  color: #f5f9ff !important;
}

[data-theme="light"] body.auth-scene::before,
body.auth-scene[data-theme="light"]::before {
  background:
    radial-gradient(circle at 18% 20%, rgba(68, 126, 255, 0.42), transparent 24%),
    radial-gradient(circle at 82% 18%, rgba(0, 214, 255, 0.22), transparent 20%),
    radial-gradient(circle at 74% 76%, rgba(34, 90, 228, 0.26), transparent 24%),
    radial-gradient(circle at 28% 74%, rgba(82, 196, 255, 0.14), transparent 18%);
  opacity: 1;
}

[data-theme="light"] body.auth-scene::after,
body.auth-scene[data-theme="light"]::after {
  background:
    radial-gradient(circle at 22% 24%, rgba(158, 223, 255, 0.16), transparent 12%),
    radial-gradient(circle at 72% 32%, rgba(122, 190, 255, 0.12), transparent 10%),
    linear-gradient(115deg, transparent 12%, rgba(92, 176, 255, 0.10) 38%, transparent 66%);
  opacity: 0.92;
}

body.auth-scene .auth-title {
  font-size: clamp(22px, 2.6vw, 28px);
  text-align: center;
  line-height: 1.08;
}

body.auth-scene .auth-sub {
  text-align: center;
}
