:root {
  --bg: #0b0d14; --bg2: #10131d; --panel: rgba(22, 26, 40, .78); --panel-solid: #161a28; --line: #252b40; --line-2: #313852;
  --text: #e8ebf5; --muted: #8f97b3; --faint: #5d6585;
  --a1: #16c784; --a2: #22d3ee; --grad: linear-gradient(135deg, #16c784, #22d3ee);
  --ok: #34d399; --warn: #fbbf24; --bad: #f87171; --r: 14px; --r-sm: 9px; --gap: 18px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif; --mono: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: radial-gradient(1200px 600px at 10% -10%, rgba(22, 199, 132, .16), transparent 60%),
  radial-gradient(900px 500px at 100% 0%, rgba(34, 211, 238, .10), transparent 60%), var(--bg);
  color: var(--text); font: 15px/1.55 var(--font); min-height: 100vh; }
a { color: #5eead4; text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 10px; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 1.75rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; }
p { margin: 0 0 10px; }
code, .mono { font-family: var(--mono); font-size: .86em; }
code { background: rgba(22, 199, 132, .12); border: 1px solid rgba(22, 199, 132, .25); padding: 1px 6px; border-radius: 6px; word-break: break-all; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.hidden { display: none !important; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: .86rem; } .tiny { font-size: .78rem; }
.ok-text { color: var(--ok); } .bad-text { color: var(--bad); } .warn-text { color: var(--warn); }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* header */
.top { position: sticky; top: 0; z-index: 10; backdrop-filter: blur(14px); background: rgba(11, 13, 20, .72); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 60px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; font-size: 1.1rem; }
.brand:hover { text-decoration: none; }
.logo { width: 28px; height: 28px; border-radius: 9px; background: url(/favicon.svg) center/cover; box-shadow: 0 0 22px rgba(22, 199, 132, .55); }
nav { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
nav a { color: var(--muted); font-weight: 600; }
nav a:hover { color: var(--text); text-decoration: none; }
.who { color: var(--faint); font-size: .85rem; }
.foot { color: var(--faint); font-size: .82rem; padding: 34px 0 40px; border-top: 1px solid var(--line); margin-top: 50px; }

/* surfaces */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; margin-bottom: var(--gap); backdrop-filter: blur(10px); }
.card.glow { border-color: rgba(22, 199, 132, .45); box-shadow: 0 0 0 1px rgba(22, 199, 132, .15), 0 10px 40px rgba(22, 199, 132, .12); }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.card-head h2, .card-head h3 { margin: 0; }
.grid { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid > .card { margin: 0; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); align-items: start; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin: 28px 0 20px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.below { margin-top: 14px; }
.stack > * + * { margin-top: 12px; }

/* controls */
button, .btn { font: inherit; font-weight: 650; border: 1px solid var(--line-2); background: #1b2033; color: var(--text); border-radius: var(--r-sm);
  padding: 9px 15px; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; transition: transform .08s, border-color .15s, background .15s; }
button:hover, .btn:hover { border-color: #47507a; text-decoration: none; }
button:active { transform: translateY(1px); }
button:disabled { opacity: .45; cursor: not-allowed; }
.primary { background: var(--grad); border: none; color: #0b0d14; box-shadow: 0 6px 24px rgba(22, 199, 132, .35); }
.primary:hover { filter: brightness(1.08); }
.danger { background: rgba(248, 113, 113, .12); border-color: rgba(248, 113, 113, .4); color: #fecaca; }
.ghost { background: transparent; }
.sm { padding: 6px 11px; font-size: .86rem; }
input, select, textarea { font: inherit; color: var(--text); background: #0f1320; border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 9px 11px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--a1); box-shadow: 0 0 0 3px rgba(22, 199, 132, .2); }
textarea { min-height: 90px; resize: vertical; font-family: var(--mono); font-size: .88rem; }
input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--a1); }
label.field { display: block; }
label.field > span { display: block; font-size: .8rem; color: var(--muted); font-weight: 600; margin-bottom: 5px; letter-spacing: .02em; }
.form-grid { display: grid; gap: 12px 16px; grid-template-columns: 1fr 1fr; }
.form-grid .wide { grid-column: 1 / -1; }
label.check { display: flex; gap: 9px; align-items: center; cursor: pointer; }
.help { color: var(--faint); font-size: .8rem; margin-top: 4px; }

/* bits */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: .75rem; font-weight: 700; padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--line-2); color: var(--muted); white-space: nowrap; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.online { color: var(--ok); border-color: rgba(52, 211, 153, .35); background: rgba(52, 211, 153, .08); }
.badge.online::before { box-shadow: 0 0 10px var(--ok); animation: pulse 2s infinite; }
.badge.error { color: var(--bad); border-color: rgba(248, 113, 113, .35); background: rgba(248, 113, 113, .08); }
.badge.expired, .badge.unpaid { color: var(--warn); border-color: rgba(251, 191, 36, .35); background: rgba(251, 191, 36, .08); }
.badge.plan { color: #c4b5fd; border-color: rgba(22, 199, 132, .4); background: rgba(22, 199, 132, .1); }
.badge.plan::before, .badge.plain::before { display: none; }
@keyframes pulse { 50% { opacity: .35; } }
.notice { border: 1px solid var(--line-2); border-left: 3px solid var(--a2); background: rgba(34, 211, 238, .06); padding: 11px 14px; border-radius: var(--r-sm); margin-bottom: 14px; }
.notice.bad { border-left-color: var(--bad); background: rgba(248, 113, 113, .07); }
.notice.ok { border-left-color: var(--ok); background: rgba(52, 211, 153, .07); }
.notice.warn { border-left-color: var(--warn); background: rgba(251, 191, 36, .07); }
.notice > :last-child { margin-bottom: 0; }
.error { color: var(--bad); font-size: .88rem; min-height: 1em; margin: 8px 0 0; }
.empty { text-align: center; padding: 50px 20px; color: var(--muted); border: 1px dashed var(--line-2); border-radius: var(--r); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
.kv dt { color: var(--muted); font-size: .86rem; } .kv dd { margin: 0; }
.stat { background: rgba(255, 255, 255, .02); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; }
.stat b { display: block; font-size: 1.4rem; } .stat span { color: var(--muted); font-size: .8rem; }
.stats { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: var(--gap); }

/* bot cards */
.bot-card { cursor: pointer; transition: transform .12s, border-color .12s; }
.bot-card:hover { transform: translateY(-2px); border-color: rgba(22, 199, 132, .5); }
.app-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 1.25rem; font-weight: 800; color: #fff; flex: none; }
.app-discord { background: #5865f2; } .app-telegram { background: #229ed9; } .app-line { background: #06c755; } .app-slack { background: #4a154b; }
.app-whatsapp { background: #25d366; } .app-matrix { background: #0dbd8b; } .app-guilded { background: #f5c400; color: #111; } .app-revolt { background: #ff4655; }
.meter { height: 6px; border-radius: 99px; background: #1d2234; overflow: hidden; margin-top: 10px; }
.meter > i { display: block; height: 100%; background: var(--grad); }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs button { background: none; border: none; border-bottom: 2px solid transparent; border-radius: 0; color: var(--muted); padding: 10px 13px; white-space: nowrap; }
.tabs button.on { color: var(--text); border-bottom-color: var(--a1); }

/* templates */
.tpl { display: flex; flex-direction: column; }
.tpl .icon { font-size: 1.6rem; }
.tpl.locked { opacity: .55; }
.tpl .row:last-child { margin-top: auto; padding-top: 12px; }
.tpl.on { border-color: rgba(52, 211, 153, .45); }

/* rule builder */
.rule { border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin-bottom: 12px; background: rgba(255, 255, 255, .015); }
.rule.off { opacity: .55; }
.rule-head { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 10px; }
.rule-head input.name { max-width: 300px; font-weight: 700; }
.rule .part { border-left: 2px solid var(--line-2); padding-left: 12px; margin: 10px 0; }
.rule .part > .label { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); font-weight: 800; margin-bottom: 6px; }
.rule .part.when { border-left-color: var(--a1); } .rule .part.do { border-left-color: var(--a2); }
.action { display: grid; grid-template-columns: 180px 1fr auto; gap: 8px; align-items: start; margin-bottom: 8px; }
.action .fields { display: grid; gap: 8px; }
.tag { font-size: .7rem; padding: 2px 7px; border-radius: 6px; background: rgba(22, 199, 132, .15); color: #c4b5fd; font-weight: 700; }

/* simulator */
.console { background: #070910; border: 1px solid var(--line); border-radius: var(--r); padding: 14px; min-height: 240px; max-height: 460px; overflow-y: auto; font-family: var(--mono); font-size: .85rem; }
.msg { margin: 8px 0; display: flex; gap: 10px; }
.msg .who { min-width: 64px; color: var(--faint); }
.msg.user .who { color: #a5b4fc; } .msg.bot .who { color: var(--a2); } .msg.sys .who { color: var(--warn); }
.msg .body { white-space: pre-wrap; word-break: break-word; }

/* pricing */
.plan-card { position: relative; display: flex; flex-direction: column; }
.plan-card .price { font-size: 2.2rem; font-weight: 850; letter-spacing: -.03em; }
.plan-card .price small { font-size: .9rem; color: var(--muted); font-weight: 600; }
.plan-card ul { padding-left: 18px; margin: 12px 0; color: var(--muted); }
.plan-card li { margin: 5px 0; }
.plan-card .ribbon { position: absolute; top: 14px; right: 14px; }
.choice { display: flex; gap: 10px; align-items: center; border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 11px 13px; cursor: pointer; }
.choice:has(input:checked) { border-color: var(--a1); background: rgba(22, 199, 132, .08); }
.choice input { width: auto; }
.choices { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }

table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--faint); font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); }
.log-error td { color: #fecaca; } .log-warning td { color: #fde68a; }

/* auth */
.auth { max-width: 420px; margin: 8vh auto; }
.hero-title { font-size: 2.3rem; font-weight: 850; letter-spacing: -.03em; margin-bottom: 8px; }

@media (max-width: 700px) {
  .form-grid { grid-template-columns: 1fr; }
  .action { grid-template-columns: 1fr; }
  .wrap { padding: 0 16px; }
  .hero-title { font-size: 1.8rem; }
  nav { gap: 10px; }
}

/* new apps */
.app-messenger { background: linear-gradient(135deg, #0084ff, #a033ff); } .app-instagram { background: linear-gradient(135deg, #f58529, #dd2a7b 50%, #8134af); }
.app-viber { background: #7360f2; } .app-sms { background: #f22f46; } .app-twitch { background: #9146ff; }
.app-website { background: linear-gradient(135deg, #16c784, #22d3ee); } .app-api { background: #334155; font-family: var(--mono); font-size: .95rem; }
.app-icon.sm { width: 30px; height: 30px; border-radius: 9px; font-size: .9rem; }

/* embed / API code */
.code-box { position: relative; background: #070910; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; margin: 8px 0 12px; }
.code-box pre { margin: 0; white-space: pre-wrap; word-break: break-all; font: .82rem/1.5 var(--mono); color: #c7d2fe; }
.code-box button { position: absolute; top: 8px; right: 8px; }

/* inbox */
.inbox { display: grid; grid-template-columns: 300px 1fr; gap: 16px; min-height: 520px; }
.conv-list { border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); overflow-y: auto; max-height: 640px; }
.conv { display: block; width: 100%; text-align: left; background: none; border: none; border-bottom: 1px solid var(--line); border-radius: 0; padding: 12px 14px; color: var(--text); }
.conv:hover { background: rgba(255, 255, 255, .03); }
.conv.on { background: rgba(22, 199, 132, .1); box-shadow: inset 3px 0 0 var(--a1); }
.conv .preview { color: var(--muted); font-size: .84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv .dot { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--a1); color: #04130c; font-size: .72rem; font-weight: 800; text-align: center; }
.thread { border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); display: flex; flex-direction: column; min-height: 520px; }
.thread-head { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.thread-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; max-height: 520px; }
.bubble { max-width: 75%; padding: 9px 13px; border-radius: 14px; white-space: pre-wrap; word-break: break-word; font-size: .92rem; }
.bubble.visitor { align-self: flex-start; background: #1d2338; border-bottom-left-radius: 4px; }
.bubble.bot { align-self: flex-end; background: rgba(34, 211, 238, .12); border: 1px solid rgba(34, 211, 238, .25); border-bottom-right-radius: 4px; }
.bubble.owner { align-self: flex-end; background: var(--grad); color: #04130c; border-bottom-right-radius: 4px; }
.bubble .meta { display: block; font-size: .7rem; opacity: .7; margin-top: 3px; }
.thread-foot { padding: 12px; border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: flex-end; }
.thread-foot textarea { min-height: 44px; font-family: var(--font); }

/* widget settings */
.swatch { display: flex; gap: 8px; align-items: center; }
.swatch input[type=color] { width: 46px; height: 38px; padding: 2px; }
.leads-table td { vertical-align: top; }
.leads-table .answers { white-space: pre-wrap; font-size: .86rem; }

@media (max-width: 760px) {
  .inbox { grid-template-columns: 1fr; }
  .conv-list { max-height: 260px; }
}

/* terms */
.terms { max-width: 820px; padding-top: 28px; padding-bottom: 40px; }
.terms h2 { margin-top: 26px; }
.terms li { margin: 6px 0; color: var(--text); }
.terms p, .terms li { line-height: 1.6; }
