/* Kvizer admin — light, airy, violet */
:root {
  --p: #5b3df5; --p2: #4a2ce0; --p3: #7b5cff; --ps: #f0edff; --ps2: #e4ddff;
  --grad: linear-gradient(135deg, #7b5cff 0%, #5b3df5 55%, #4a2ce0 100%);
  --bg: #f6f6fb; --card: #fff; --tx: #15132b; --tx2: #3a3852; --mut: #7a7891; --line: #ececf3; --line2: #dedde9;
  --ok: #10a36b; --oks: #e5f7ef; --bad: #e5484d; --bads: #fdecec; --warn: #d9822b; --warns: #fff3e4; --info: #2f7cf6; --infos: #e8f1ff;
  --r: 16px; --r2: 12px;
  --sh: 0 1px 2px rgba(21, 19, 43, .04), 0 8px 24px -12px rgba(21, 19, 43, .10);
  --sh2: 0 24px 60px -24px rgba(60, 40, 160, .35);
  --side: 236px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--tx); font: 14px/1.5 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--p); text-decoration: none; }
a:hover { color: var(--p2); }
h1 { font-size: 26px; line-height: 1.2; margin: 0; letter-spacing: -.02em; font-weight: 800; }
h2 { font-size: 18px; margin: 0 0 8px; letter-spacing: -.01em; }
h3 { font-size: 16px; margin: 0 0 14px; font-weight: 800; letter-spacing: -.01em; }
h4 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--mut); margin: 16px 0 8px; display: flex; align-items: center; gap: 8px; }
h4:first-child { margin-top: 0; }
.ic { flex: none; display: block; }
input, select, textarea, button { font: inherit; color: inherit; }
input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=range]), select, textarea {
  width: 100%; border: 1px solid var(--line2); background: #fff; border-radius: 10px; padding: 9px 12px; outline: none; transition: border-color .15s, box-shadow .15s;
}
select { appearance: none; padding-right: 32px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%237a7891' stroke-width='2' stroke-linecap='round' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 11px center; }
input:focus, select:focus, textarea:focus { border-color: var(--p); box-shadow: 0 0 0 4px rgba(91, 61, 245, .12); }
textarea { resize: vertical; }
input[type=checkbox], input[type=radio] { accent-color: var(--p); width: 16px; height: 16px; cursor: pointer; }
.muted { color: var(--mut); } .small { font-size: 12.5px; } .mono { font-family: ui-monospace, Menlo, monospace; } .warn { color: var(--warn); font-weight: 700; } .r { text-align: right; } .bad { color: var(--bad); }
hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border-radius: 11px; border: 1px solid var(--line2); background: #fff; cursor: pointer; font-weight: 700; white-space: nowrap; color: var(--tx); transition: all .15s; line-height: 1.3; }
.btn:hover { border-color: var(--p); color: var(--p); }
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 8px 18px -8px rgba(91, 61, 245, .7); }
.btn.primary:hover { filter: brightness(1.08); color: #fff; }
.btn.soft { background: var(--ps); border-color: transparent; color: var(--p); }
.btn.white { background: #fff; border-color: #fff; color: var(--p); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { padding: 6px 11px; font-size: 12.5px; border-radius: 9px; gap: 6px; }
.btn.wide { width: 100%; }
.btn.danger, button.danger { color: var(--bad); }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--mut); cursor: pointer; }
.icon-btn:hover { color: var(--p); border-color: var(--ps2); }
.pill { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 99px; background: var(--p); color: #fff; font-size: 11px; font-weight: 800; line-height: 20px; text-align: center; }

/* ---------- app shell ---------- */
.app { display: flex; min-height: 100vh; }
.side { width: var(--side); flex: none; background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; padding: 20px 14px; position: sticky; top: 0; height: 100vh; z-index: 40; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 22px; letter-spacing: -.03em; color: var(--tx); padding: 0 8px 18px; }
.brand:hover { color: var(--tx); }
.nav { display: grid; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 11px; color: var(--tx2); font-weight: 600; position: relative; }
.nav a .ic { color: var(--mut); }
.nav a:hover { background: var(--bg); color: var(--tx); }
.nav a.on { background: var(--ps); color: var(--p); font-weight: 700; }
.nav a.on .ic { color: var(--p); }
.nav a.on::before { content: ''; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--p); }
.nav .pill { margin-left: auto; }
.promo { margin-top: auto; background: var(--grad); color: #fff; border-radius: 16px; padding: 16px; display: grid; gap: 6px; box-shadow: var(--sh2); position: relative; overflow: hidden; }
.promo::after { content: ''; position: absolute; right: -30px; top: -30px; width: 100px; height: 100px; border-radius: 50%; background: rgba(255, 255, 255, .12); }
.promo b { font-size: 15px; }
.promo span { font-size: 12px; opacity: .85; line-height: 1.4; margin-bottom: 6px; }
.me { display: flex; align-items: center; gap: 10px; padding: 12px 6px 0; border-top: 1px solid var(--line); margin-top: 10px; }
.ava { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, #8fb0ff, #6d7cff); color: #fff; display: grid; place-items: center; font-weight: 800; flex: none; }
.me-t { min-width: 0; flex: 1; line-height: 1.25; }
.me-t b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-t small { color: var(--mut); font-size: 12px; }
.main { flex: 1; min-width: 0; }
.wrap { max-width: 1320px; margin: 0 auto; padding: 28px 32px 48px; }
main.full { padding: 0; }
.burger { display: none; }
@media (max-width: 960px) {
  .side { position: fixed; left: 0; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 60px rgba(0, 0, 0, .2); }
  .side.open { transform: none; }
  .burger { display: block; position: fixed; left: 12px; bottom: 12px; z-index: 50; width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--grad); color: #fff; font-size: 20px; box-shadow: var(--sh2); }
  .wrap { padding: 18px 16px 80px; }
}

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; }
.crumb { display: inline-flex; align-items: center; gap: 6px; color: var(--mut); font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row2, .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 14px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.cols.c21 { grid-template-columns: 1.6fr 1fr; }
.box { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; box-shadow: var(--sh); margin-bottom: 20px; }
.cols > .box { margin-bottom: 0; }
.box-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 16px; }
.box-h h3 { margin: 0; }
form.inline { display: inline; }
@media (max-width: 1100px) { .cols, .cols.c21 { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .row2, .grid2, .grid3 { grid-template-columns: 1fr; } }

.alert { padding: 12px 16px; border-radius: 12px; margin-bottom: 18px; font-weight: 600; }
.alert.ok { background: var(--oks); color: var(--ok); }
.alert.err { background: var(--bads); color: var(--bad); }
.alert.warn { background: var(--warns); color: var(--warn); }

/* forms */
.form { display: grid; gap: 14px; }
.form label, label.f { display: grid; gap: 6px; font-weight: 700; font-size: 13px; }
label.f > span { color: var(--tx2); font-size: 12.5px; font-weight: 600; }
.chk { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; cursor: pointer; }
.hint { color: var(--mut); font-size: 12.5px; margin: 0 0 10px; line-height: 1.5; }
.hint li { margin-bottom: 3px; }
.out { background: #17152b; color: #cbf5dd; padding: 12px 14px; border-radius: 10px; font-size: 12.5px; white-space: pre-wrap; margin: 0; }
.toggle { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-weight: 700; font-size: 13px; }
.toggle input { display: none; }
.toggle i { width: 38px; height: 22px; border-radius: 99px; background: var(--line2); position: relative; transition: background .2s; flex: none; }
.toggle i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.toggle input:checked + i { background: var(--p); }
.toggle input:checked + i::after { transform: translateX(16px); }

/* auth */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; background: #fff; }
.auth-art { background: var(--grad); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-art::before, .auth-art::after { content: ''; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .08); }
.auth-art::before { width: 420px; height: 420px; right: -140px; top: -120px; }
.auth-art::after { width: 300px; height: 300px; left: -100px; bottom: -120px; }
.auth-art h2 { font-size: 40px; line-height: 1.1; letter-spacing: -.03em; margin: 0 0 14px; max-width: 460px; position: relative; }
.auth-art p { opacity: .85; max-width: 420px; font-size: 16px; position: relative; }
.auth-stats { display: flex; gap: 36px; position: relative; }
.auth-stats b { display: block; font-size: 30px; letter-spacing: -.02em; }
.auth-stats span { opacity: .8; font-size: 13px; }
.auth-side { display: grid; place-items: center; padding: 24px; }
.auth-card { width: 100%; max-width: 400px; display: grid; gap: 16px; }
.auth-card h1 { margin-bottom: 4px; }
.auth-card .brand { padding: 0 0 18px; }
.auth.single { grid-template-columns: 1fr; background: radial-gradient(circle at 15% 10%, #ece7ff, var(--bg) 50%); }
.auth.single .auth-card { background: #fff; border-radius: 22px; padding: 34px; box-shadow: var(--sh2); max-width: 460px; }
@media (max-width: 900px) { .auth { grid-template-columns: 1fr; } .auth-art { display: none; } }

/* empty */
.empty { text-align: center; padding: 70px 20px; background: #fff; border: 1.5px dashed var(--line2); border-radius: var(--r); }
.empty-ico { width: 64px; height: 64px; border-radius: 18px; background: var(--ps); color: var(--p); display: grid; place-items: center; margin: 0 auto 14px; }
.empty p { max-width: 440px; margin: 0 auto 18px; }

/* KPI cards */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.kpis.k5 { grid-template-columns: repeat(5, 1fr); }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--sh); display: flex; gap: 14px; align-items: flex-start; }
.kpi-ic { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; flex: none; }
.kpi-ic.c1 { background: var(--ps); color: var(--p); } .kpi-ic.c2 { background: var(--infos); color: var(--info); } .kpi-ic.c3 { background: var(--oks); color: var(--ok); } .kpi-ic.c4 { background: #fdeefe; color: #c03fd0; } .kpi-ic.c5 { background: var(--warns); color: var(--warn); }
.kpi span { color: var(--mut); font-size: 12.5px; font-weight: 600; }
.kpi b { display: block; font-size: 26px; letter-spacing: -.03em; line-height: 1.2; margin: 2px 0; }
.kpi small { font-size: 12px; font-weight: 700; color: var(--mut); }
.up { color: var(--ok) !important; } .down { color: var(--bad) !important; }
@media (max-width: 1100px) { .kpis, .kpis.k5 { grid-template-columns: 1fr 1fr; } }

/* quiz cards */
.qgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.qcard { background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--sh); display: flex; flex-direction: column; overflow: hidden; transition: transform .15s, box-shadow .15s; }
.qcard:hover { transform: translateY(-2px); box-shadow: 0 18px 40px -20px rgba(40, 30, 120, .35); }
.qcard-cover { height: 110px; position: relative; display: flex; align-items: flex-end; padding: 14px 16px; background: var(--c, var(--p)); background-image: radial-gradient(circle at 85% 20%, rgba(255, 255, 255, .28), transparent 45%), linear-gradient(135deg, rgba(255, 255, 255, .15), rgba(0, 0, 0, .1)); color: #fff; }
.qcard-cover .emoji { position: absolute; right: 18px; top: 16px; font-size: 40px; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .2)); }
.qcard-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.qcard-top { display: flex; justify-content: space-between; align-items: center; }
.qcard-name { font-size: 16px; font-weight: 800; color: var(--tx); line-height: 1.3; }
.status { border: 0; cursor: pointer; border-radius: 99px; padding: 4px 11px; font-size: 12px; font-weight: 800; }
.status.active { background: rgba(255, 255, 255, .95); color: var(--ok); }
.status.active::before { content: '● '; }
.status.draft { background: rgba(255, 255, 255, .85); color: var(--mut); }
.qstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; padding: 14px; background: var(--bg); border-radius: 12px; }
.qstats b { display: block; font-size: 19px; letter-spacing: -.02em; }
.qstats span { color: var(--mut); font-size: 12px; }
.qcard-actions { display: flex; gap: 8px; margin-top: auto; }
.qcard-actions .btn { flex: 1; }

/* dropdown */
details.menu { position: relative; }
details.menu > summary { list-style: none; cursor: pointer; }
details.menu > summary::-webkit-details-marker { display: none; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 20px 44px -14px rgba(0, 0, 0, .25); padding: 6px; min-width: 210px; z-index: 30; display: grid; }
.menu-pop.form { min-width: 320px; padding: 16px; }
.menu-pop > a, .menu-pop button:not(.btn) { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 9px 10px; border: 0; background: none; border-radius: 8px; cursor: pointer; color: var(--tx); font-weight: 600; }
.menu-pop > a:hover, .menu-pop button:not(.btn):hover { background: var(--bg); }
.menu-pop .ic { color: var(--mut); }

/* modal */
dialog.modal { border: 0; border-radius: 20px; padding: 28px; width: min(720px, 94vw); box-shadow: 0 30px 80px rgba(0, 0, 0, .3); }
dialog.modal::backdrop { background: rgba(21, 19, 43, .45); backdrop-filter: blur(2px); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }

/* templates gallery */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.chip { border: 1px solid var(--line2); background: #fff; padding: 7px 14px; border-radius: 99px; font-weight: 700; font-size: 13px; cursor: pointer; color: var(--tx2); }
.chip.on { background: var(--p); border-color: var(--p); color: #fff; }
.tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.tcard { background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: var(--sh); display: flex; flex-direction: column; text-align: left; cursor: pointer; padding: 0; transition: transform .15s, box-shadow .15s; }
.tcard:hover { transform: translateY(-3px); box-shadow: 0 18px 40px -20px rgba(40, 30, 120, .4); }
.tcard-img { height: 130px; display: grid; place-items: center; font-size: 54px; background: var(--c); background-image: radial-gradient(circle at 80% 15%, rgba(255, 255, 255, .35), transparent 50%); }
.tcard-b { padding: 12px 14px 14px; }
.tcard-b b { display: block; font-size: 14px; }
.tcard-b small { color: var(--mut); font-size: 12px; }
.tcard.sel { outline: 3px solid var(--p); outline-offset: -1px; }
.tpl-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tpl-pick .tcard-img { height: 76px; font-size: 34px; }
.tpl-pick input { position: absolute; opacity: 0; pointer-events: none; }
.tpl-pick input:checked + .tcard { outline: 3px solid var(--p); outline-offset: -1px; }

/* filters & table */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.toolbar select, .toolbar input { width: auto !important; min-width: 150px; }
.toolbar .search { flex: 1; min-width: 220px; position: relative; }
.toolbar .search input { width: 100% !important; padding-left: 38px !important; }
.toolbar .search .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--mut); }
.page-head .row input, .page-head .row select { width: auto !important; }
.tbl-wrap { background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh); overflow: hidden; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; color: var(--mut); font-weight: 700; font-size: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); background: #fbfbfe; white-space: nowrap; }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl th.r, .tbl td.r { text-align: right; }
.tbl .w1 { width: 1%; white-space: nowrap; }
.tbl tbody tr.lrow { cursor: pointer; transition: background .1s; }
.tbl tbody tr.lrow:hover { background: #fafaff; }
.tbl tbody tr.lrow.open { background: var(--ps); }
.tbl .who b { display: block; }
.tbl .who small, .tbl .sub { display: block; color: var(--mut); font-size: 12px; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl .phone { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tag { display: inline-block; font-style: normal; font-size: 10.5px; font-weight: 800; padding: 1px 7px; border-radius: 6px; margin-left: 4px; vertical-align: 1px; }
.tag.g { background: #e8f0fe; color: #1a5fd0; } .tag.f { background: #eef0ff; color: #4058e8; }
.st-pill { appearance: none; border: 0; border-radius: 99px; padding: 5px 26px 5px 12px !important; font-size: 12px; font-weight: 800; cursor: pointer; width: auto !important; background-position: right 8px center !important; background-size: 10px !important; }
.sp-new { background-color: var(--ps) !important; color: var(--p); } .sp-work { background-color: var(--warns) !important; color: var(--warn); } .sp-done { background-color: var(--oks) !important; color: var(--ok); } .sp-fail { background-color: #f1f1f5 !important; color: var(--mut); } .sp-spam { background-color: var(--bads) !important; color: var(--bad); }
.ldetail td { background: #fcfbff; padding: 0 !important; }
.lead-body { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; padding: 18px 22px 22px; }
.answers { margin: 0; display: grid; gap: 6px; }
.answers dt { color: var(--mut); font-size: 12.5px; }
.answers dd { margin: 0 0 6px; font-weight: 700; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 5px 12px; margin: 0; font-size: 13px; }
.kv dt { color: var(--mut); } .kv dd { margin: 0; word-break: break-all; }
.ilog { list-style: none; padding: 0; margin: 0; font-size: 12.5px; display: grid; gap: 5px; }
.ilog li { padding: 6px 10px; border-radius: 8px; background: var(--bg); word-break: break-word; }
.ilog li.ok { background: var(--oks); } .ilog li.bad { background: var(--bads); }
.bulk { display: none; align-items: center; gap: 10px; padding: 10px 14px; background: var(--ps); border-bottom: 1px solid var(--ps2); font-weight: 700; font-size: 13px; color: var(--p); }
.bulk.on { display: flex; }
.bulk select { width: auto !important; padding-top: 5px; padding-bottom: 5px; }
.pager { display: flex; gap: 4px; justify-content: center; margin-top: 18px; }
.pager a, .pager span { padding: 7px 12px; border-radius: 9px; background: #fff; border: 1px solid var(--line); font-weight: 700; color: var(--tx2); }
.pager a.on { background: var(--p); color: #fff; border-color: var(--p); }
@media (max-width: 900px) {
  .tbl-wrap { overflow-x: auto; }
  .lead-body { grid-template-columns: 1fr; }
  .tbl .hide-m { display: none; }
}

/* charts */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { font-size: 11px; fill: var(--mut); font-family: inherit; }
.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--mut); font-weight: 600; align-items: center; }
.legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.donut-wrap { display: flex; align-items: center; gap: 22px; }
.donut { position: relative; width: 170px; height: 170px; flex: none; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut-c { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.donut-c b { font-size: 28px; letter-spacing: -.03em; display: block; line-height: 1; }
.donut-c span { font-size: 12px; color: var(--mut); }
.src-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; flex: 1; min-width: 0; }
.src-list li { display: grid; grid-template-columns: 10px 1fr auto; gap: 8px; align-items: center; font-size: 13px; }
.src-list i { width: 10px; height: 10px; border-radius: 50%; }
.src-list b { font-variant-numeric: tabular-nums; }
.src-list small { color: var(--mut); display: block; font-size: 11.5px; }

/* funnel */
.funnel { display: grid; gap: 8px; }
.fn-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) 48px; gap: 12px; align-items: center; font-size: 13px; }
.fn-l { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.fn-bar { position: relative; height: 28px; background: var(--bg); border-radius: 8px; overflow: hidden; }
.fn-bar i { position: absolute; inset: 0 auto 0 0; background: var(--grad); border-radius: 8px; }
.fn-bar span { position: relative; padding-left: 10px; line-height: 28px; font-weight: 800; font-size: 12px; color: #fff; text-shadow: 0 0 4px rgba(40, 20, 120, .5); }
.fn-drop { font-size: 12px; font-weight: 800; color: var(--mut); text-align: right; }
.fn-drop.bad { color: var(--bad); }

/* settings tabs */
.ptabs { display: flex; gap: 4px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 5px; margin-bottom: 20px; width: fit-content; box-shadow: var(--sh); }
.ptabs a { padding: 8px 16px; border-radius: 10px; font-weight: 700; color: var(--tx2); display: flex; gap: 8px; align-items: center; }
.ptabs a.on { background: var(--ps); color: var(--p); }
.int-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.int { border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; gap: 12px; align-items: flex-start; background: #fff; }
.int-logo { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-weight: 900; font-size: 15px; color: #fff; flex: none; }
.int b { display: block; }
.int small { color: var(--mut); font-size: 12.5px; line-height: 1.45; display: block; }
.int .on-badge { display: inline-block; margin-top: 6px; font-size: 11px; font-weight: 800; color: var(--ok); background: var(--oks); padding: 2px 8px; border-radius: 99px; }

/* ================= editor ================= */
.ed { display: flex; flex-direction: column; height: 100vh; }
.ed-bar { display: flex; align-items: center; gap: 14px; padding: 12px 24px; background: #fff; border-bottom: 1px solid var(--line); }
.ed-back { color: var(--mut); display: grid; place-items: center; }
.ed-title { display: flex; flex-direction: column; min-width: 0; }
.ed-title small { color: var(--mut); font-size: 12px; font-weight: 600; display: flex; gap: 8px; align-items: center; }
#ed-state { font-size: 11px; padding: 1px 8px; border-radius: 99px; background: var(--oks); color: var(--ok); font-weight: 800; }
#ed-state.warn { background: var(--warns); color: var(--warn); }
.ed-name { max-width: 340px; font-weight: 800; font-size: 17px; border-color: transparent !important; background: transparent !important; padding: 2px 6px !important; margin-left: -6px; letter-spacing: -.01em; }
.ed-name:hover, .ed-name:focus { border-color: var(--line2) !important; background: #fff !important; }
.ed-bar-r { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.stepper { display: flex; gap: 6px; padding: 12px 24px; background: #fff; border-bottom: 1px solid var(--line); overflow-x: auto; }
.stepper button { display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 7px 16px 7px 8px; border-radius: 99px; font-weight: 700; color: var(--tx2); cursor: pointer; white-space: nowrap; }
.stepper button i { width: 26px; height: 26px; border-radius: 50%; background: var(--bg); color: var(--mut); display: grid; place-items: center; font-style: normal; font-size: 12.5px; font-weight: 800; }
.stepper button.on { background: var(--ps); color: var(--p); }
.stepper button.on i { background: var(--p); color: #fff; }
.ed-body { flex: 1; display: grid; grid-template-columns: 280px minmax(400px, 1fr) 420px; min-height: 0; }
.ed-steps, .ed-main, .ed-prev { min-height: 0; overflow: auto; }
.ed-steps { background: #fff; border-right: 1px solid var(--line); padding: 18px 14px; display: flex; flex-direction: column; gap: 6px; }
.ed-h { font-size: 13.5px; color: var(--tx); font-weight: 800; padding: 0 6px 6px; display: flex; justify-content: space-between; align-items: center; }
.ed-h small { color: var(--mut); font-weight: 600; }
.st { display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid transparent; border-radius: 12px; cursor: pointer; position: relative; }
.st:hover { background: var(--bg); }
.st.on { background: var(--ps); border-color: var(--ps2); }
.st.drag { opacity: .4; } .st.over { box-shadow: inset 0 2px 0 var(--p); }
.st-i { width: 30px; height: 30px; border-radius: 9px; background: var(--bg); color: var(--mut); display: grid; place-items: center; position: relative; }
.st.on .st-i { background: #fff; color: var(--p); }
.st-i em { position: absolute; top: -5px; left: -5px; min-width: 16px; height: 16px; border-radius: 8px; background: var(--tx); color: #fff; font-style: normal; font-size: 10px; font-weight: 800; display: grid; place-items: center; padding: 0 3px; }
.st.on .st-i em { background: var(--p); }
.st-t { min-width: 0; }
.st-t b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-t small { display: block; color: var(--mut); font-size: 11.5px; }
.st-a { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); display: none; gap: 2px; }
.st:hover .st-a { display: flex; }
.st-a button { border: 0; background: #fff; width: 24px; height: 24px; border-radius: 7px; cursor: pointer; font-size: 12px; color: var(--mut); box-shadow: 0 0 0 1px var(--line); }
.st-a button:hover { color: var(--p); }
.palette { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); display: grid; gap: 2px; }
.palette button { display: flex; gap: 12px; align-items: center; border: 0; background: none; padding: 8px 10px; border-radius: 10px; cursor: pointer; font-weight: 600; text-align: left; color: var(--tx2); font-size: 13px; }
.palette button .ic { color: var(--p); }
.palette button:hover { background: var(--ps); color: var(--p); }
.palette button:hover::after { content: '+'; margin-left: auto; font-weight: 800; }
.ed-main { background: var(--bg); padding: 22px 24px 60px; }
.ed-panel { display: grid; gap: 14px; align-content: start; max-width: 760px; margin: 0 auto; }
.ptype { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.ptype b { display: flex; align-items: center; gap: 10px; font-size: 18px; letter-spacing: -.01em; }
.ptype b .ic { color: var(--p); }
.sec { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: grid; gap: 12px; box-shadow: var(--sh); }
.sec-h { font-weight: 800; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.sec-h .ic { color: var(--p); }
.sec .hint { margin: 0; }
.w-90 { width: 90px; }
.opts { display: grid; gap: 8px; }
.opt-h { display: none; }
.opt { display: grid; grid-template-columns: 54px 64px 76px minmax(0, 1fr) auto; grid-template-areas: "img lbl lbl lbl act" "img emo sc nx nx"; gap: 6px 8px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: #fcfcff; }
.opt > .opt-img { grid-area: img; width: 54px; height: 54px; align-self: start; }
.opt > input[data-b$=".label"] { grid-area: lbl; font-weight: 700; }
.opt > input[data-b$=".icon"] { grid-area: emo; }
.opt > input[data-b$=".score"] { grid-area: sc; }
.opt > select { grid-area: nx; }
.opt > .opt-a { grid-area: act; }
.opt input.c { font-size: 12.5px; }
.opt input.c { text-align: center; padding-left: 4px; padding-right: 4px; }
.opt select { font-size: 12.5px; padding: 8px 26px 8px 8px; }
.opt-img { width: 46px; height: 46px; border-radius: 10px; border: 1.5px dashed var(--line2); background: var(--bg); cursor: pointer; padding: 0; overflow: hidden; display: grid; place-items: center; color: var(--mut); }
.opt-img:hover { border-color: var(--p); color: var(--p); }
.opt-img img { width: 100%; height: 100%; object-fit: cover; }
.opt-img b { font-size: 22px; }
.opt-a { display: flex; gap: 2px; }
.opt-a button { border: 0; background: none; cursor: pointer; color: var(--mut); padding: 4px 6px; border-radius: 6px; }
.opt-a button:hover { background: var(--bg); color: var(--bad); }
.color { display: flex; gap: 8px; }
.color input[type=color] { width: 42px; height: 40px; border: 1px solid var(--line2); border-radius: 10px; padding: 3px; background: #fff; cursor: pointer; flex: none; }
.img-f { display: flex; gap: 8px; align-items: center; }
.img-f img, .img-ph { width: 42px; height: 42px; border-radius: 10px; object-fit: cover; flex: none; background: var(--bg); display: grid; place-items: center; color: var(--mut); }
.palettes { display: flex; gap: 10px; flex-wrap: wrap; }
.palettes button { width: 60px; height: 40px; border-radius: 11px; border: 1px solid var(--line2); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 4px; }
.palettes i { width: 15px; height: 15px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(0, 0, 0, .1); }
.code { display: flex; gap: 8px; align-items: flex-start; }
.code textarea { font: 12px/1.5 ui-monospace, Menlo, monospace; background: #fafafe; }
.ed-prev { background: #fff; display: flex; flex-direction: column; border-left: 1px solid var(--line); }
.ed-prev-bar { display: flex; align-items: center; gap: 8px; padding: 18px 20px 10px; }
.ed-prev-bar .ed-h { padding: 0; margin-right: auto; }
.seg { display: flex; background: var(--bg); border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: none; padding: 5px 9px; border-radius: 8px; cursor: pointer; color: var(--mut); display: grid; place-items: center; }
.seg button.on { background: #fff; color: var(--p); box-shadow: var(--sh); }
.ed-frame-wrap { flex: 1; padding: 6px 20px 20px; display: flex; justify-content: center; align-items: flex-start; min-height: 0; }
.device { width: 100%; height: 100%; max-height: 780px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: #fff; }
.ed-frame-wrap.mob .device { width: 340px; max-width: 100%; height: min(100%, 700px); border-radius: 44px; border: 10px solid #1b1a2b; box-shadow: 0 0 0 2px #3a3950, 0 30px 60px -20px rgba(20, 15, 60, .45); position: relative; }
.ed-frame-wrap.mob .device::before { content: ''; position: absolute; top: 8px; left: 50%; transform: translateX(-50%); width: 90px; height: 22px; background: #1b1a2b; border-radius: 12px; z-index: 2; }
.device iframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.ed-frame-wrap.mob .device iframe { padding-top: 28px; background: var(--bg); }
@media (max-width: 1350px) { .ed-body { grid-template-columns: 250px 1fr 360px; } }
@media (max-width: 1150px) { .ed-body { grid-template-columns: 240px 1fr; } .ed-prev { display: none; } }
@media (max-width: 760px) { .ed { height: auto; } .ed-body { grid-template-columns: 1fr; } .ed-steps { border-right: 0; border-bottom: 1px solid var(--line); } .ed-bar { flex-wrap: wrap; padding: 12px 16px; } .opt { grid-template-areas: "img lbl lbl act" "img emo sc sc" "nx nx nx nx"; grid-template-columns: 54px 64px 1fr auto; } }
.auth-art .mark { box-shadow: 0 0 0 2px rgba(255, 255, 255, .45); border-radius: 9px; }

.qlink { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 7px 8px 7px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fafaff; color: var(--mut); }
.qlink a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 13px; }
.qcopy { border: 0; background: #fff; box-shadow: 0 0 0 1px var(--line); width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; cursor: pointer; color: var(--mut); flex: none; }
.qcopy:hover, .qcopy.copied { color: var(--p); box-shadow: 0 0 0 1px var(--ps2); }

.bots { display: grid; gap: 12px; }
.bot { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: grid; gap: 10px; background: #fcfcff; }
.tg-out { font-size: 12.5px; color: var(--tx2); }
.tg-out:empty { display: none; }
.tg-out .chip { margin: 4px 4px 0 0; font-size: 12px; padding: 5px 10px; }

/* layout pickers */
.layouts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.layouts.l2 { grid-template-columns: repeat(2, 1fr); }
.lay { border: 1.5px solid var(--line2); background: #fff; border-radius: 12px; padding: 10px; text-align: left; cursor: pointer; display: grid; gap: 2px; transition: all .15s; }
.lay:hover { border-color: var(--p); }
.lay.on { border-color: var(--p); background: var(--ps); box-shadow: 0 0 0 3px rgba(91, 61, 245, .12); }
.lay b { font-size: 13px; } .lay small { color: var(--mut); font-size: 11.5px; line-height: 1.3; }
.lay i { display: block; height: 58px; border-radius: 8px; margin-bottom: 6px; background: #f1f0f8; position: relative; overflow: hidden; }
.lay i::before, .lay i::after { content: ''; position: absolute; }
.lay-split::before { left: 8px; top: 12px; width: 40%; height: 6px; border-radius: 3px; background: #c9c2f5; box-shadow: 0 10px 0 #c9c2f5, 0 22px 0 -1px #dedbea, 0 34px 0 0 var(--p); }
.lay-split::after { right: 0; top: 0; bottom: 0; width: 44%; background: linear-gradient(135deg, #8bc79a, #3f7d55); }
.lay-benefits::before { left: 8px; top: 12px; width: 40%; height: 6px; border-radius: 3px; background: #c9c2f5; box-shadow: 0 10px 0 #dedbea, 0 18px 0 #dedbea, 0 32px 0 var(--p); }
.lay-benefits::after { right: 10px; top: 8px; width: 30%; height: 60%; border-radius: 5px; background: linear-gradient(135deg, #8bc79a, #3f7d55); transform: rotate(4deg); box-shadow: -14px 14px 0 -2px #6ba57d; }
.lay-cover { background: linear-gradient(90deg, #fff 30%, rgba(255, 255, 255, 0) 70%), linear-gradient(135deg, #8bc79a, #2f5e40) !important; }
.lay-cover::before { left: 8px; top: 16px; width: 44%; height: 7px; border-radius: 3px; background: #c9c2f5; box-shadow: 0 12px 0 #dedbea, 0 26px 0 var(--p); }
.lay-cover::after { right: 8px; bottom: 6px; width: 40%; height: 10px; border-radius: 3px; background: rgba(255, 255, 255, .85); }
.lay-form-simple::before { left: 20%; right: 20%; top: 10px; height: 7px; border-radius: 3px; background: #dedbea; box-shadow: 0 12px 0 #dedbea, 0 24px 0 #dedbea, 0 38px 0 var(--p); }
.lay-form-image::before { left: 6px; top: 6px; bottom: 6px; width: 34%; border-radius: 5px; background: linear-gradient(135deg, #8bc79a, #3f7d55); }
.lay-form-image::after { left: 46%; right: 10px; top: 10px; height: 7px; border-radius: 3px; background: #dedbea; box-shadow: 0 12px 0 #dedbea, 0 24px 0 #dedbea, 0 38px 0 var(--p); }
.lay-thanks-light::before { left: 50%; top: 10px; width: 22px; height: 22px; margin-left: -11px; border-radius: 50%; background: #22c55e; }
.lay-thanks-light::after { left: 30%; right: 30%; top: 40px; height: 7px; border-radius: 3px; background: var(--p); }
.lay-thanks-dark { background: linear-gradient(rgba(10, 20, 15, .6), rgba(10, 20, 15, .85)), linear-gradient(135deg, #8bc79a, #2f5e40) !important; }
.lay-thanks-dark::before { left: 50%; top: 10px; width: 18px; height: 18px; margin-left: -11px; border-radius: 50%; border: 2px solid #fff; }
.lay-thanks-dark::after { left: 30%; right: 30%; top: 40px; height: 7px; border-radius: 3px; background: #fff; }
