@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("./assets/fonts/manrope-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("./assets/fonts/manrope-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-subtle: #f1f2f7;
  --sidebar: #f3f1fb;
  --ink: #171822;
  --muted: #696b78;
  --faint: #747685;
  --line: #e5e6ec;
  --line-strong: #d7d8e0;
  --accent: #6658e8;
  --accent-dark: #5245c8;
  --accent-soft: #ece9ff;
  --success: #16875d;
  --success-soft: #e7f6f0;
  --warning: #b16a13;
  --warning-soft: #fff3df;
  --danger: #c84646;
  --danger-soft: #feeeee;
  --shadow: 0 10px 30px rgba(38, 38, 60, 0.08);
  --radius: 14px;
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink); }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
button, select { cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid rgba(102, 88, 232, .24); outline-offset: 2px; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }
button:disabled { cursor: not-allowed; opacity: .52; }

.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 50% 8%, #eeebff 0, var(--bg) 34%); }
.auth-card { width: min(420px, 100%); display: grid; gap: 16px; padding: 32px; border: 1px solid var(--line); border-radius: var(--radius); background: white; box-shadow: var(--shadow); }
.auth-card .brand-mark { margin-bottom: 2px; }
.auth-card h1, .auth-card p { margin: 0; }
.auth-card h1 { font-size: 25px; letter-spacing: -.025em; }
.auth-card > p { color: var(--muted); font-size: 13px; line-height: 1.6; }
.auth-eyebrow { color: var(--accent-dark); font-size: 11px; font-weight: 760; letter-spacing: .05em; text-transform: uppercase; }
.auth-card label > span, .meta-form label > span, .endpoint-list label > span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 11px; font-weight: 700; }
.auth-card input, .meta-form input { width: 100%; min-height: 42px; padding: 9px 11px; outline: none; }
.auth-card input:focus, .meta-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(102,88,232,.1); }
.form-error { min-height: 18px; color: var(--danger) !important; font-weight: 650; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 40; width: 248px; display: flex; flex-direction: column; padding: 22px 14px 18px; background: var(--sidebar); border-right: 1px solid rgba(101, 92, 157, .12); }
.brand-row { display: flex; align-items: center; gap: 11px; padding: 0 8px 22px; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; color: white; background: var(--accent); box-shadow: 0 6px 16px rgba(82, 69, 200, .24); }
.brand-mark svg { width: 23px; height: 23px; stroke-width: 2; }
.brand-row strong { display: block; font-size: 15px; letter-spacing: -.01em; }
.brand-row span { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.sidebar-close { display: none; margin-left: auto; }
.primary-nav { display: grid; gap: 4px; }
.nav-item { width: 100%; height: 43px; display: flex; align-items: center; gap: 12px; padding: 0 12px; border: 0; border-radius: 11px; color: #555566; background: transparent; font-size: 14px; font-weight: 580; text-align: left; transition: background .16s ease-out, color .16s ease-out; }
.nav-item svg { width: 19px; height: 19px; }
.nav-item:hover { color: var(--ink); background: rgba(255,255,255,.56); }
.nav-item.active { color: var(--accent-dark); background: white; box-shadow: 0 4px 18px rgba(55, 49, 94, .06); }
.nav-count { min-width: 23px; height: 20px; display: grid; place-items: center; margin-left: auto; padding: 0 6px; border-radius: 999px; color: var(--accent-dark); background: var(--accent-soft); font-size: 11px; }
.account-rail { margin-top: 28px; }
.rail-heading { display: flex; justify-content: space-between; padding: 0 12px 9px; color: var(--faint); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.sidebar-account { width: 100%; display: grid; grid-template-columns: 32px 1fr 8px; align-items: center; gap: 10px; padding: 9px 10px; border: 0; border-radius: 11px; color: var(--ink); background: transparent; text-align: left; transition: background .16s ease-out; }
.sidebar-account:hover, .sidebar-account.active { background: rgba(255,255,255,.72); }
.sidebar-account-copy { min-width: 0; }
.sidebar-account strong, .sidebar-account small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-account strong { font-size: 12px; font-weight: 650; }
.sidebar-account small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.account-state { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px rgba(22,135,93,.1); }
.account-state.warning { background: #d9912a; box-shadow: 0 0 0 3px rgba(217,145,42,.12); }
.avatar { display: grid; place-items: center; flex: 0 0 auto; border-radius: 10px; color: white; font-size: 11px; font-weight: 760; }
.sidebar-account .avatar { width: 32px; height: 32px; }
.avatar-violet { background: #7567e8; }
.avatar-coral { background: #e67269; }
.avatar-blue { background: #4584cc; }
.avatar-green { background: #319170; }
.preview-note { display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 12px; border-radius: 12px; background: rgba(255,255,255,.68); }
.preview-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; color: var(--success); background: var(--success-soft); }
.preview-icon svg { width: 17px; height: 17px; }
.preview-note strong, .preview-note span { display: block; }
.preview-note strong { font-size: 11px; }
.preview-note span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.rail-empty { padding: 12px; color: var(--muted); font-size: 11px; line-height: 1.5; }

.main-area { min-height: 100vh; margin-left: 248px; }
.topbar { position: sticky; top: 0; z-index: 30; height: 72px; display: flex; align-items: center; gap: 11px; padding: 0 32px; border-bottom: 1px solid var(--line); background: rgba(246,247,251,.94); backdrop-filter: blur(12px); }
.topbar-spacer { flex: 1; }
.icon-button { width: 38px; height: 38px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 10px; color: #666878; background: transparent; transition: color .16s ease-out, background .16s ease-out; }
.icon-button:hover { color: var(--ink); background: var(--surface-subtle); }
.menu-button { display: none; }
.account-switcher { display: flex; align-items: center; gap: 10px; padding: 5px 9px 5px 5px; border: 0; border-radius: 12px; background: transparent; text-align: left; }
.account-switcher:hover { background: var(--surface-subtle); }
.account-switcher .avatar { width: 36px; height: 36px; }
.account-switcher > svg { width: 16px; height: 16px; color: var(--faint); }
.account-switcher-copy strong, .account-switcher-copy small { display: block; }
.account-switcher-copy strong { font-size: 12px; }
.account-switcher-copy small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.account-menu { position: fixed; z-index: 80; top: 62px; left: 278px; width: 270px; padding: 7px; border: 1px solid var(--line); border-radius: 13px; background: white; box-shadow: var(--shadow); opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity .16s ease-out, transform .16s ease-out, visibility .16s; }
.account-menu.open { opacity: 1; visibility: visible; transform: translateY(0); }
.account-menu .sidebar-account { grid-template-columns: 34px 1fr 18px; }
.account-menu .sidebar-account.selected::after { content: "✓"; justify-self: center; color: var(--accent); font-size: 13px; font-weight: 760; }
.demo-badge { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 10px; border-radius: 999px; color: #53645d; background: #e9f3ee; font-size: 11px; font-weight: 650; white-space: nowrap; }
.demo-badge > span { width: 7px; height: 7px; border-radius: 50%; background: var(--success); }
.demo-badge.muted { color: var(--muted); background: var(--surface-subtle); }
.demo-badge.muted > span { background: var(--faint); }
.user-avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: white; background: #272936; font-size: 12px; font-weight: 700; }

.view { display: none; padding: 34px 32px 60px; }
.view.active { display: block; animation: view-in .18s ease-out; }
@keyframes view-in { from { opacity: .45; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 28px; max-width: 1440px; margin: 0 auto 28px; }
.page-heading.compact { align-items: center; margin-bottom: 24px; }
.page-heading h1 { margin: 0; font-size: 26px; line-height: 1.2; letter-spacing: -.025em; }
.page-heading p { max-width: 70ch; margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.heading-actions { display: flex; gap: 9px; }
.primary-button, .secondary-button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 15px; border-radius: 11px; font-size: 12px; font-weight: 700; transition: background .16s ease-out, transform .16s ease-out, border-color .16s ease-out; }
.primary-button { border: 1px solid var(--accent); color: white; background: var(--accent); box-shadow: 0 6px 16px rgba(82,69,200,.18); }
.primary-button:hover { background: var(--accent-dark); }
.primary-button:active, .secondary-button:active { transform: translateY(1px); }
.secondary-button { border: 1px solid var(--line-strong); color: #4c4e5b; background: white; }
.secondary-button:hover { border-color: #c8c9d2; background: #fafafd; }
.primary-button svg, .secondary-button svg { width: 17px; height: 17px; }
.primary-button.wide { width: 100%; }
.text-button { display: inline-flex; align-items: center; gap: 4px; padding: 3px; border: 0; color: var(--accent-dark); background: transparent; font-size: 11px; font-weight: 700; }
.text-button:hover { text-decoration: underline; }
.text-button svg { width: 14px; height: 14px; }

.system-banner { max-width: 1440px; min-height: 64px; display: flex; align-items: center; gap: 13px; margin: 0 auto 18px; padding: 12px 16px; border-radius: var(--radius); background: #edf7f2; }
.status-orb { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: rgba(22,135,93,.12); }
.status-orb span { width: 10px; height: 10px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px rgba(22,135,93,.1); }
.system-banner strong, .system-banner p { display: block; }
.system-banner strong { color: #245b48; font-size: 12px; }
.system-banner p { margin: 3px 0 0; color: #577366; font-size: 11px; }
.system-banner .text-button { margin-left: auto; color: #315f4f; }
.metric-ledger { max-width: 1440px; display: grid; grid-template-columns: repeat(4, 1fr); margin: 0 auto 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 5px 18px rgba(36,36,54,.035); }
.metric { min-width: 0; padding: 21px 22px 19px; }
.metric + .metric { border-left: 1px solid var(--line); }
.metric > span, .metric > strong, .metric > small { display: block; }
.metric > span { color: var(--muted); font-size: 11px; }
.metric > strong { margin-top: 8px; font-size: 25px; letter-spacing: -.02em; }
.metric > small { margin-top: 7px; color: var(--muted); font-size: 11px; }
.metric > small.positive { color: var(--success); }

.overview-grid { max-width: 1440px; display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, .75fr); gap: 18px; margin: 0 auto; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 5px 18px rgba(36,36,54,.035); }
.panel-header { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.panel-header h2, .panel-header p { margin: 0; }
.panel-header h2 { font-size: 14px; letter-spacing: -.01em; }
.panel-header p { margin-top: 4px; color: var(--muted); font-size: 11px; }
.accounts-table-row { display: grid; grid-template-columns: minmax(190px, 1.2fr) minmax(100px, .7fr) minmax(90px, .55fr) 90px 22px; align-items: center; gap: 14px; min-height: 70px; padding: 10px 18px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .16s ease-out; }
.accounts-table-row:last-child { border-bottom: 0; }
.accounts-table-row:hover { background: #fafafd; }
.table-account { display: flex; align-items: center; min-width: 0; gap: 11px; }
.table-account .avatar { width: 38px; height: 38px; }
.table-account strong, .table-account small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-account strong { font-size: 11px; }
.table-account small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.table-value { min-width: 0; }
.table-value strong, .table-value span { display: block; }
.table-value strong { font-size: 11px; }
.table-value span { margin-top: 4px; color: var(--muted); font-size: 11px; }
.mini-bar { width: 76px; height: 4px; margin-top: 7px; overflow: hidden; border-radius: 4px; background: var(--surface-subtle); }
.mini-bar span { height: 100%; border-radius: 4px; background: var(--accent); }
.row-arrow { width: 16px; height: 16px; color: var(--faint); }
.status-pill { display: inline-flex; align-items: center; justify-content: center; width: fit-content; min-height: 24px; padding: 0 9px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.status-pill.success { color: var(--success); background: var(--success-soft); }
.status-pill.warning { color: var(--warning); background: var(--warning-soft); }
.status-pill.neutral { color: #656674; background: var(--surface-subtle); }
.activity-list { padding: 4px 18px 10px; }
.activity-item { display: grid; grid-template-columns: 30px 1fr auto; gap: 11px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.activity-item:last-child { border-bottom: 0; }
.activity-symbol { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; color: var(--success); background: var(--success-soft); }
.activity-symbol.waiting { color: var(--warning); background: var(--warning-soft); }
.activity-symbol.warning { color: var(--danger); background: var(--danger-soft); }
.activity-symbol svg { width: 15px; height: 15px; }
.activity-copy strong, .activity-copy span { display: block; }
.activity-copy strong { font-size: 12px; line-height: 1.4; }
.activity-copy span { margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.activity-time { color: var(--faint); font-size: 11px; white-space: nowrap; }

.campaign-layout { max-width: 1440px; display: grid; grid-template-columns: minmax(590px, 1.2fr) minmax(390px, .8fr); gap: 18px; margin: 0 auto; align-items: start; }
.campaign-list-panel { overflow: hidden; }
.table-toolbar { display: flex; gap: 10px; padding: 15px; border-bottom: 1px solid var(--line); }
.search-field { min-height: 38px; display: flex; align-items: center; flex: 1; gap: 8px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 10px; color: var(--faint); background: white; }
.search-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(102,88,232,.1); }
.search-field svg { width: 17px; height: 17px; }
.search-field input { width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 11px; }
select, input, textarea { border: 1px solid var(--line-strong); border-radius: 10px; color: var(--ink); background: white; }
.table-toolbar select { min-width: 138px; padding: 0 10px; font-size: 11px; }
.campaign-table-header, .campaign-row { display: grid; grid-template-columns: minmax(150px, 1.25fr) minmax(110px, .8fr) 82px 88px 28px; align-items: center; gap: 13px; }
.campaign-table-header { min-height: 36px; padding: 0 16px; color: var(--faint); background: #fafafd; font-size: 11px; font-weight: 700; }
.campaign-row { min-height: 76px; padding: 10px 16px; border-top: 1px solid var(--line); transition: background .16s ease-out; }
.campaign-row:first-child { border-top: 0; }
.campaign-row:hover, .campaign-row.selected { background: #faf9ff; }
.campaign-name strong, .campaign-name small, .campaign-flow strong, .campaign-flow small, .campaign-result strong, .campaign-result small { display: block; }
.campaign-name strong { font-size: 11px; }
.campaign-open-button { min-width: 0; padding: 0; border: 0; color: inherit; background: transparent; text-align: left; cursor: pointer; }
.campaign-open-button:focus-visible { border-radius: 6px; }
.campaign-name small, .campaign-flow small, .campaign-result small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.campaign-flow strong, .campaign-result strong { font-size: 11px; }
.keyword { display: inline-block; max-width: 120px; overflow: hidden; padding: 3px 6px; border-radius: 6px; color: var(--accent-dark); background: var(--accent-soft); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.switch { position: relative; display: inline-flex; width: 36px; height: 21px; flex: 0 0 auto; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch span { width: 100%; height: 100%; border-radius: 999px; background: #cacbd4; transition: background .18s ease-out; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 15px; height: 15px; border-radius: 50%; background: white; box-shadow: 0 2px 5px rgba(0,0,0,.14); transition: transform .18s ease-out; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(15px); }
.switch input:focus-visible + span { outline: 3px solid rgba(102,88,232,.24); outline-offset: 2px; }
.row-menu { width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 8px; color: var(--muted); background: transparent; }
.row-menu:hover { background: var(--surface-subtle); }
.row-menu svg { width: 16px; height: 16px; }
.empty-state { padding: 54px 20px; text-align: center; }
.empty-state svg { width: 34px; height: 34px; color: var(--faint); }
.empty-state h3 { margin: 12px 0 0; font-size: 13px; }
.empty-state p { margin: 6px 0 0; color: var(--muted); font-size: 11px; }

.editor-panel { position: sticky; top: 90px; min-height: 430px; border: 1px solid var(--line); border-radius: var(--radius); background: white; box-shadow: 0 5px 18px rgba(36,36,54,.035); }
.editor-empty { display: grid; justify-items: center; padding: 70px 38px; text-align: center; }
.editor-empty-mark { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 13px; color: var(--accent); background: var(--accent-soft); }
.editor-empty h2 { margin: 16px 0 0; font-size: 14px; }
.editor-empty p { max-width: 34ch; margin: 7px 0 18px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.editor-header { min-height: 72px; display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.editor-label { display: block; color: var(--faint); font-size: 11px; }
.editor-header h2 { max-width: 320px; margin: 4px 0 0; overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.form-stack { display: grid; gap: 14px; padding: 18px; }
.form-stack label > span { display: block; margin-bottom: 6px; color: #4f5160; font-size: 11px; font-weight: 700; }
.form-stack input, .form-stack textarea, .form-stack select { width: 100%; min-height: 40px; padding: 9px 10px; font-size: 11px; outline: none; transition: border-color .16s ease-out, box-shadow .16s ease-out; }
.form-stack textarea { resize: vertical; line-height: 1.45; }
.form-stack input:focus, .form-stack textarea:focus, .form-stack select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(102,88,232,.1); }
.form-stack label > small { display: block; margin-top: 5px; color: var(--faint); font-size: 11px; }
.field-row { display: grid; grid-template-columns: 1fr 1.2fr; gap: 10px; }
.gate-setting { display: grid; grid-template-columns: 34px 1fr 36px; align-items: center; gap: 11px; margin: 0 18px 18px; padding: 12px; border-radius: 12px; background: #f5f3ff; }
.gate-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: var(--accent); background: white; }
.gate-icon svg { width: 17px; height: 17px; }
.gate-setting strong, .gate-setting span { display: block; }
.gate-setting strong { font-size: 11px; }
.gate-setting > div > span { margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.editor-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--line); }
.editor-actions .danger-link { margin: 0 auto 0 0; }

.log-panel { max-width: 1100px; margin: 0 auto; overflow: hidden; }
.log-filters { display: flex; flex-wrap: wrap; gap: 7px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.filter-chip { min-height: 30px; padding: 0 11px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: white; font-size: 11px; font-weight: 700; }
.filter-chip:hover, .filter-chip.active { color: var(--accent-dark); border-color: #d8d2ff; background: var(--accent-soft); }
#full-activity { padding: 4px 20px 12px; }
#full-activity .activity-item { grid-template-columns: 34px minmax(0, 1fr) minmax(110px, .3fr) auto; align-items: center; }
.log-account { color: var(--muted); font-size: 11px; }
.settings-grid { max-width: 1100px; display: grid; gap: 18px; margin: 0 auto; }
.settings-section { padding: 20px; }
.settings-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.settings-heading h2, .settings-heading p { margin: 0; }
.settings-heading h2 { font-size: 14px; }
.settings-heading p { margin-top: 5px; color: var(--muted); font-size: 11px; }
.setting-row { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); }
.setting-row strong, .setting-row span { display: block; }
.setting-row strong { font-size: 11px; }
.setting-row > div > span { margin-top: 4px; color: var(--muted); font-size: 11px; }
.settings-account { min-height: 62px; display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 11px; border-bottom: 1px solid var(--line); }
.settings-account .avatar { width: 34px; height: 34px; }
.settings-account strong, .settings-account small { display: block; }
.settings-account strong { font-size: 11px; }
.settings-account small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.empty-setting { display: grid; gap: 5px; padding: 22px 0 4px; color: var(--muted); }
.empty-setting strong { color: var(--ink); font-size: 12px; }
.empty-setting span { font-size: 11px; line-height: 1.5; }
.meta-form { display: grid; grid-template-columns: 1fr 1fr auto; align-items: end; gap: 12px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.meta-form button { white-space: nowrap; }
.endpoint-list { display: grid; gap: 12px; padding-top: 18px; }
.endpoint-list output { display: block; overflow-wrap: anywhere; padding: 10px 11px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: #fafafd; font-size: 11px; line-height: 1.45; cursor: copy; }
.danger-link { margin-top: 18px; padding: 0; border: 0; color: var(--danger); background: transparent; font-size: 11px; font-weight: 700; }
.danger-link:hover { text-decoration: underline; }

.tester { position: fixed; z-index: 100; inset: 0 0 0 auto; width: min(780px, 100%); display: flex; flex-direction: column; border-left: 1px solid var(--line); background: white; box-shadow: -18px 0 50px rgba(29,29,47,.16); transform: translateX(102%); transition: transform .24s cubic-bezier(.2,.8,.2,1); }
.tester.open { transform: translateX(0); }
.tester-header { min-height: 76px; display: flex; align-items: center; justify-content: space-between; padding: 14px 22px; border-bottom: 1px solid var(--line); }
.tester-header span { display: block; color: var(--faint); font-size: 11px; }
.tester-header h2 { margin: 4px 0 0; font-size: 15px; }
.tester-body { min-height: 0; display: grid; grid-template-columns: 280px minmax(330px, 1fr); flex: 1; overflow: auto; }
.test-controls { padding: 26px 22px; border-right: 1px solid var(--line); background: #fafafd; }
.test-controls > p { margin: 0 0 18px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.follower-choice { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: white; cursor: pointer; }
.follower-choice:has(input:checked) { border-color: #bdb5ff; background: #f6f4ff; }
.follower-choice input { margin-top: 2px; accent-color: var(--accent); }
.follower-choice strong, .follower-choice small { display: block; }
.follower-choice strong { font-size: 11px; }
.follower-choice small { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.test-controls .primary-button { margin-top: 14px; }
.test-status { display: flex; align-items: center; gap: 10px; margin-top: 16px; padding: 10px 0; }
.test-status > span { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); box-shadow: 0 0 0 4px rgba(146,148,162,.12); }
.test-status.running > span { background: var(--warning); box-shadow: 0 0 0 4px rgba(177,106,19,.12); animation: pulse 1s ease-in-out infinite; }
.test-status.done > span { background: var(--success); box-shadow: 0 0 0 4px rgba(22,135,93,.12); }
@keyframes pulse { 50% { opacity: .35; } }
.test-status strong, .test-status small { display: block; }
.test-status strong { font-size: 11px; }
.test-status small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.phone-shell { width: min(330px, calc(100% - 44px)); height: 650px; align-self: center; justify-self: center; display: flex; flex-direction: column; margin: 28px 22px; overflow: hidden; border: 7px solid #22232a; border-radius: 34px; background: white; box-shadow: 0 16px 36px rgba(35,35,50,.17); }
.phone-top { height: 31px; display: flex; align-items: center; justify-content: space-between; padding: 0 18px; color: #25262d; font-size: 11px; font-weight: 700; }
.chat-header { min-height: 58px; display: flex; align-items: center; gap: 9px; padding: 8px 12px; border-top: 1px solid #f1f1f4; border-bottom: 1px solid #ececf0; }
.chat-header .avatar { width: 34px; height: 34px; }
.chat-header div { min-width: 0; flex: 1; }
.chat-header strong, .chat-header small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-header strong { font-size: 11px; }
.chat-header small { margin-top: 3px; color: #858793; font-size: 7px; }
.chat-header > svg { width: 18px; height: 18px; color: #585a66; }
.chat-body { min-height: 0; display: flex; flex-direction: column; flex: 1; gap: 8px; overflow-y: auto; padding: 14px 10px; background: #fbfbfd; }
.chat-placeholder { margin: auto; color: #a2a4ad; text-align: center; }
.chat-placeholder svg { width: 28px; height: 28px; }
.chat-placeholder p { margin: 8px 0 0; font-size: 11px; }
.bubble { max-width: 82%; padding: 8px 10px; border-radius: 14px; font-size: 11px; line-height: 1.45; animation: bubble-in .2s ease-out; }
@keyframes bubble-in { from { opacity: 0; transform: translateY(5px); } }
.bubble.incoming { align-self: flex-start; border-bottom-left-radius: 4px; background: #ececf1; }
.bubble.outgoing { align-self: flex-end; border-bottom-right-radius: 4px; color: white; background: var(--accent); }
.bubble.system { align-self: center; padding: 5px 9px; color: #6f7180; background: #f0f0f4; font-size: 7px; }
.bubble a { display: block; margin-top: 6px; color: inherit; font-weight: 700; }
.chat-input { height: 48px; display: flex; align-items: center; justify-content: space-between; margin: 0 9px 9px; padding: 0 12px; border: 1px solid #e4e4e8; border-radius: 999px; color: #777985; font-size: 11px; }
.chat-input svg { width: 16px; height: 16px; }

.toast-region { position: fixed; z-index: 150; right: 22px; bottom: 22px; display: grid; gap: 8px; }
.toast { min-width: 260px; max-width: 360px; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; color: white; background: #282a34; box-shadow: var(--shadow); font-size: 11px; animation: toast-in .2s ease-out; }
.toast svg { width: 16px; height: 16px; color: #89e2be; }
.toast.warning svg { color: #ffd08a; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.sidebar-scrim { display: none; }

@media (max-width: 1180px) {
  .metric-ledger { grid-template-columns: 1fr 1fr; }
  .metric:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); }
  .metric:nth-child(4) { border-top: 1px solid var(--line); }
  .overview-grid { grid-template-columns: 1fr; }
  .campaign-layout { grid-template-columns: 1fr; }
  .editor-panel { position: static; }
}

@media (max-width: 900px) {
  .sidebar { transform: translateX(-102%); transition: transform .2s ease-out; box-shadow: 18px 0 40px rgba(29,29,47,.15); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close, .menu-button { display: grid; }
  .sidebar-scrim { position: fixed; z-index: 35; inset: 0; display: block; background: rgba(22,23,33,.28); opacity: 0; visibility: hidden; transition: opacity .2s ease-out, visibility .2s; }
  .sidebar-scrim.open { opacity: 1; visibility: visible; }
  .main-area { margin-left: 0; }
  .account-menu { left: 72px; }
  .accounts-table-row { grid-template-columns: minmax(180px, 1fr) minmax(90px, .6fr) 86px 20px; }
  .accounts-table-row .conversion-cell { display: none; }
}

@media (max-width: 760px) {
  .auth-shell { padding: 14px; }
  .auth-card { padding: 24px 20px; }
  .topbar { height: 64px; padding: 0 14px; }
  .topbar > .icon-button:not(.menu-button) { display: none; }
  .account-switcher { min-width: 0; padding: 3px; }
  .account-switcher-copy { display: block; min-width: 0; max-width: 112px; }
  .account-switcher-copy strong, .account-switcher-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .account-switcher-copy strong { font-size: 11px; }
  .account-switcher-copy small { font-size: 11px; }
  .account-switcher > svg { display: none; }
  .topbar .demo-badge { height: 24px; padding: 0 7px; font-size: 11px; }
  .account-menu { top: 58px; left: 58px; width: calc(100vw - 72px); }
  .view { padding: 24px 14px 44px; }
  .page-heading, .page-heading.compact { align-items: stretch; flex-direction: column; gap: 16px; margin-bottom: 20px; }
  .page-heading h1 { font-size: 22px; }
  .heading-actions { width: 100%; }
  .heading-actions > button { flex: 1; }
  .system-banner { align-items: flex-start; }
  .system-banner .text-button { display: none; }
  .metric-ledger { grid-template-columns: 1fr 1fr; }
  .metric { padding: 17px 15px; }
  .metric > strong { font-size: 21px; }
  .accounts-table-row { grid-template-columns: minmax(160px, 1fr) 82px 18px; min-height: 64px; padding: 8px 13px; }
  .accounts-table-row .campaign-count-cell, .accounts-table-row .conversion-cell { display: none; }
  .panel-header { padding: 14px; }
  .panel-header .text-button { display: none; }
  .table-toolbar { flex-direction: column; }
  .table-toolbar select { min-height: 38px; }
  .campaign-table-header { display: none; }
  .campaign-row { grid-template-columns: minmax(140px, 1fr) 80px 29px; gap: 8px; }
  .campaign-row .campaign-flow, .campaign-row .campaign-result { display: none; }
  .campaign-row .status-pill { justify-self: start; }
  .field-row { grid-template-columns: 1fr; }
  .tester-body { grid-template-columns: 1fr; }
  .test-controls { border-right: 0; border-bottom: 1px solid var(--line); }
  .phone-shell { height: 580px; margin-top: 22px; }
  #full-activity .activity-item { grid-template-columns: 30px 1fr auto; }
  #full-activity .log-account { display: none; }
  .settings-heading { flex-direction: column; }
  .meta-form { grid-template-columns: 1fr; }
  .toast-region { right: 12px; bottom: 12px; left: 12px; }
  .toast { min-width: 0; width: 100%; }
}

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