:root {
  --bg: #0a0a0d;
  --surface: #121216;
  --surface-2: #1a1a20;
  --surface-3: #22222a;
  --ink: #f5f5f7;
  --ink-2: #c2c2cc;
  --muted: #8b8b98;
  --line: #24242c;
  --line-2: #2f2f39;
  --accent: #ff7a1a;
  --accent-2: #ffa149;
  --accent-ink: #1b0c00;
  --accent-soft: rgba(255, 122, 26, .12);
  --glow: 0 8px 28px rgba(255, 122, 26, .35);
  --warn: #ffb547;
  --warn-soft: rgba(255, 181, 71, .12);
  --danger: #ff5c7a;
  --danger-soft: rgba(255, 92, 122, .12);
  --ok: #2fe39a;
  --ok-soft: rgba(47, 227, 154, .12);
  --bubble-out: #005c4b;
  --bubble-in: #202c33;
  --chat-bg: #0b141a;
  --radius: 18px;
  --radius-sm: 11px;
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 10px 30px rgba(0, 0, 0, .35);
  --font: "Space Grotesk", "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.55rem; line-height: 1.3; margin: 0 0 .25rem; font-weight: 700; }
h2 { font-size: 1.05rem; margin: 0 0 .75rem; font-weight: 600; }
p { margin: 0 0 .75rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.25rem 0; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.main { padding-block: 24px 64px; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.ltr, .ltr-inline { direction: ltr; unicode-bidi: isolate; }
.ltr-inline { display: inline-block; }
.inline { display: inline; }
.ok { color: var(--ok); }
.bad { color: var(--danger); }
[hidden] { display: none !important; }

/* top bar */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar-in { display: flex; align-items: center; gap: 18px; min-height: 58px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink); font-size: 1.05rem; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 8px; background: var(--accent);
  position: relative; flex: none;
}
.brand-mark::after {
  content: ""; position: absolute; inset: 7px 6px 9px; border-radius: 6px 6px 6px 2px;
  background: var(--accent-ink);
}
.mainnav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.mainnav a, .tabs a, .filters a {
  color: var(--ink-2); padding: 7px 12px; border-radius: 999px; font-weight: 500; white-space: nowrap;
}
.mainnav a:hover, .tabs a:hover, .filters a:hover { background: var(--surface-2); text-decoration: none; }
.mainnav a.on, .tabs a.on, .filters a.on { background: var(--accent-soft); color: var(--accent); }
.topbar-end { display: flex; align-items: center; gap: 10px; margin-inline-start: auto; }
.langpick { position: relative; }
.langpick summary { cursor: pointer; list-style: none; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: .88rem; }
.langpick summary::-webkit-details-marker { display: none; }
.langmenu {
  position: absolute; inset-inline-end: 0; top: calc(100% + 6px); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow); min-width: 140px; padding: 6px; z-index: 30;
}
.langmenu a { display: block; padding: 7px 10px; border-radius: 6px; color: var(--ink); }
.langmenu a:hover { background: var(--surface-2); text-decoration: none; }

/* device bar */
.devbar { background: var(--surface); border-bottom: 1px solid var(--line); }
.devbar-in { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding-block: 10px; }
.devtitle { display: flex; align-items: center; gap: 8px; }
.tabs { display: flex; gap: 2px; overflow-x: auto; flex: 1; scrollbar-width: none; }

/* layout */
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }
.grid.cards { grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); margin-bottom: 20px; }
.menu-layout { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 860px) { .menu-layout { grid-template-columns: 1fr; } }
.stack { display: grid; gap: 16px; }
.pagehead { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow); min-width: 0;
}
.row { display: flex; gap: 8px; align-items: center; }
.row > input, .row > select { flex: 1; min-width: 0; }
.wrap-row { flex-wrap: wrap; }
.savebar {
  position: sticky; bottom: 0; padding: 12px 0; display: flex; justify-content: flex-end;
  background: linear-gradient(to top, var(--bg) 70%, transparent);
}

/* forms */
.form { display: grid; gap: 14px; }
.form.narrow { max-width: 360px; margin-bottom: 12px; }
label { display: grid; gap: 6px; font-weight: 500; font-size: .92rem; }
input, select, textarea {
  font: inherit; font-weight: 400; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 9px 12px; width: 100%;
}
textarea { resize: vertical; min-height: 70px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--accent); }
input[type="number"] { max-width: 140px; }
input[type="time"] { width: auto; }
.hint { display: block; color: var(--muted); font-size: .84rem; font-weight: 400; margin: 0; }
.switch { display: flex; align-items: center; gap: 10px; font-weight: 500; cursor: pointer; margin: 4px 0 8px; }
.switch input { width: 18px; height: 18px; }
.radios { display: grid; gap: 8px; margin-bottom: 14px; }
.radios label { display: flex; gap: 8px; align-items: center; font-weight: 400; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 600; font-size: .92rem; cursor: pointer;
  padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent); filter: brightness(1.08); }
.btn-danger { color: var(--danger); border-color: var(--danger-soft); background: var(--danger-soft); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 5px 12px; font-size: .84rem; }
.btn-block { width: 100%; }
.btn-link { background: none; border: 0; color: var(--accent); font: inherit; cursor: pointer; padding: 0; }
.icon-btn {
  width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink-2); cursor: pointer; font: inherit;
}
.icon-btn:hover { background: var(--surface-2); }
details > summary { cursor: pointer; }
details > summary.btn { list-style: none; }
details > summary.btn::-webkit-details-marker { display: none; }

/* alerts, badges */
.alert { padding: 11px 14px; border-radius: var(--radius-sm); margin-bottom: 14px; border: 1px solid transparent; }
.alert-success { background: var(--accent-soft); color: var(--accent); }
.alert-error { background: var(--danger-soft); color: var(--danger); }
.alert-warn { background: var(--warn-soft); color: var(--warn); }
.note { background: var(--surface-2); padding: 12px 14px; border-radius: var(--radius-sm); }
.badge {
  display: inline-block; font-size: .76rem; font-weight: 600; padding: 2px 9px; border-radius: 999px;
  background: var(--surface-2); color: var(--ink-2); white-space: nowrap;
}
.badge-ok { background: var(--accent-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-off { background: var(--danger-soft); color: var(--danger); }
.count { opacity: .7; font-size: .8em; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: var(--muted); flex: none; }
.dot-ok { background: var(--ok); box-shadow: 0 0 0 4px var(--accent-soft); }
.dot-warn { background: var(--warn); }
.dot-off { background: var(--danger); }

/* auth */
.auth { max-width: 420px; margin: 32px auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.auth .form { margin: 18px 0; }
.big-icon { font-size: 2.4rem; line-height: 1; margin-bottom: 10px; }
.empty { text-align: center; padding: 40px 16px; }

/* devices */
.devcard { color: var(--ink); display: grid; gap: 6px; transition: border-color .15s; }
.devcard:hover { border-color: var(--accent); text-decoration: none; }
.devcard-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.devcard-meta { display: flex; justify-content: space-between; font-size: .84rem; color: var(--ink-2); margin-top: 6px; }
.addform h2 { margin-bottom: 10px; }
.conn-status { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; font-size: 1.05rem; }
.qr-zone { display: grid; gap: 14px; justify-items: start; }
.qr-box {
  width: 264px; height: 264px; background: #fff; border-radius: var(--radius); border: 1px solid var(--line);
  display: grid; place-items: center; padding: 8px;
}
.qr-box img { width: 100%; height: 100%; object-fit: contain; }
.qr-box img:not([src]) { display: none; }
.steps { margin: 0; padding-inline-start: 20px; color: var(--ink-2); }
.pair { width: 100%; }
.pair .row { margin-top: 10px; max-width: 380px; }
.paircode { font-size: 1.8rem; font-weight: 700; letter-spacing: .2em; margin-top: 10px; color: var(--accent); }
.kv { list-style: none; padding: 0; margin: 0 0 16px; }
.kv li { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); }
.danger { margin-top: 16px; }
.danger summary { color: var(--danger); font-weight: 500; }
.danger p { margin-top: 8px; }

/* hours */
.hours { display: grid; gap: 8px; }
.hours-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.hours-row .switch { min-width: 130px; margin: 0; }

/* menu tree */
.tree { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.tree .tree { margin-top: 10px; padding-inline-start: 22px; border-inline-start: 2px solid var(--line); }
.node { background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px 14px; }
.node-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.node-num {
  min-width: 28px; height: 28px; padding: 0 6px; border-radius: 8px; background: var(--accent); color: var(--accent-ink);
  display: inline-grid; place-items: center; font-weight: 700; font-size: .85rem;
}
.node-label { flex: 1; min-width: 120px; }
.node-tools { display: flex; gap: 4px; }
.node-reply { margin: 8px 0 0; color: var(--ink-2); font-size: .9rem; white-space: pre-line; }
.node-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.node-actions details[open] { flex-basis: 100%; }
.nodeform { margin: 12px 0; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.addroot { margin-top: 16px; }

/* chat preview + simulator */
.phone {
  background: var(--chat-bg); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 8px;
  min-height: 80px; max-height: 420px; overflow-y: auto; margin-bottom: 12px;
}
.bubble {
  max-width: 88%; padding: 8px 12px; border-radius: 10px; white-space: pre-wrap; word-wrap: break-word;
  font-size: .93rem; box-shadow: 0 1px 1px rgba(0,0,0,.08); color: var(--ink);
}
.bubble-out { background: var(--bubble-out); align-self: flex-start; border-start-start-radius: 2px; }
.bubble-in { background: var(--bubble-in); align-self: flex-end; border-start-end-radius: 2px; }
.card > .bubble { margin: 10px 0; }
.bubble-note { align-self: center; font-size: .8rem; color: var(--muted); background: var(--surface); padding: 3px 10px; border-radius: 999px; }
.sim-form { margin-bottom: 6px; }

/* keyword rules */
.rule.is-off { opacity: .65; }
.rule-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.chip { background: var(--accent-soft); color: var(--accent); padding: 2px 10px; border-radius: 999px; font-size: .86rem; font-weight: 500; }
.rule details .form { margin: 12px 0; }
.priority { padding-inline-start: 20px; margin: 0; color: var(--ink-2); }

/* tables & lists */
.tablewrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { text-align: start; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { color: var(--muted); font-weight: 500; font-size: .82rem; }
.table tr.is-out .msgcell { color: var(--ink-2); }
.msgcell { white-space: pre-line; min-width: 220px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.filters { display: flex; gap: 4px; margin-bottom: 16px; flex-wrap: wrap; }

/* users */
.userrow { display: flex; gap: 16px; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; }
.userinfo { display: grid; gap: 2px; }
.userline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.userline > strong { font-size: 1.02rem; }
.useractions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.limitform { display: inline-flex; gap: 6px; align-items: center; }
.limitform label { display: flex; align-items: center; gap: 6px; font-weight: 400; }
.limitform input { width: 70px; padding: 5px 8px; }
.inline-details { position: relative; }
.inline-details[open] > *:not(summary) { margin-top: 8px; }
.inline-details[open] { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }

.install h1 { margin-bottom: 6px; }
.install .card { margin-bottom: 16px; }

@media (max-width: 600px) {
  .main { padding-top: 16px; }
  .card { padding: 16px; }
  h1 { font-size: 1.3rem; }
  .qr-box { width: 230px; height: 230px; }
  .tabs { flex-basis: 100%; }
  .mainnav { order: 3; flex-basis: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 8px; }
}

/* user-written content picks its own direction (Arabic text in an LTR page and vice versa) */
textarea, input:not([dir]):not([type="checkbox"]):not([type="radio"]):not([type="number"]):not([type="time"]),
.bubble, .msgcell, .node-reply, .node-label, .chip, .devtitle strong, .userline strong {
  unicode-bidi: plaintext;
}
.bubble, .msgcell, .node-reply { text-align: start; }

/* campaigns */
.progress { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin: 6px 0; }
.progress.big { height: 12px; margin: 4px 0 14px; }
.progress span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.stats div { background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px; display: grid; gap: 2px; }
.stats strong { font-size: 1.35rem; line-height: 1.2; }
.stats span { color: var(--muted); font-size: .82rem; }
.bignum { font-size: 2rem; font-weight: 700; line-height: 1.2; margin-bottom: 6px; }
.bignum .muted { font-size: 1.1rem; font-weight: 500; }
.optrows { display: grid; gap: 10px; }
.optrow { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; align-items: start; padding: 10px; background: var(--surface-2); border-radius: var(--radius-sm); }
.optrow .node-num { grid-row: span 2; margin-top: 6px; }
.add-optrow { justify-self: start; }
.btnrows .optrow { grid-template-columns: auto 1fr auto; }
.btnrows .optrow textarea { grid-column: 2 / 4; }
.optrow-del { background: none; border: 0; color: var(--muted, #888); font-size: 20px; line-height: 1; padding: 6px 8px; cursor: pointer; border-radius: 8px; }
.optrow-del:hover { color: var(--danger, #ff5a5a); background: rgba(255,90,90,.08); }
.imgrow { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.thumb { width: 96px; height: 96px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.bubble-img { max-width: 88%; border-radius: 10px; align-self: flex-start; display: block; }
.sticky-aside { position: sticky; top: 76px; }
@media (max-width: 860px) { .sticky-aside { position: static; } .stats { grid-template-columns: repeat(2, 1fr); } }
.code { background: var(--surface-2); padding: 10px 12px; border-radius: var(--radius-sm); overflow-x: auto; font-size: .84rem; margin: 0 0 12px; white-space: pre-wrap; word-break: break-all; }
.danger-link { color: var(--danger); margin-top: 8px; }

/* quick send */
.send-layout { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 860px) { .send-layout { grid-template-columns: 1fr; } }
.grid.two-tight { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 14px; margin-bottom: 14px; }
.step { display: grid; gap: 14px; }
.step + .step { border-top: 1px solid var(--line); padding-top: 20px; }
.step-head { display: flex; gap: 12px; align-items: flex-start; }
.step-head h2 { margin: 0; display: flex; gap: 8px; align-items: center; }
.step-num {
  width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font-weight: 700; flex: none;
}
.btnrows { display: grid; gap: 10px; }
.btnrows-head { display: flex; gap: 8px; align-items: center; }
.sendbar { display: flex; gap: 12px; justify-content: space-between; align-items: center; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 16px; }
.sendbar .btn-primary { padding: 11px 28px; }
.tpl-save { flex: 1; max-width: 420px; min-width: 240px; }
.live-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--ok); margin-inline-end: 8px; box-shadow: 0 0 0 4px var(--accent-soft); }
.wa-frame { border-radius: 18px; overflow: hidden; border: 1px solid var(--line); }
.wa-top { background: #0b141a; color: #e9edef; padding: 10px 14px; font-weight: 600; font-size: .9rem; }
.wa-chat { background: #0b141a; border-radius: 0; margin: 0; min-height: 260px; max-height: 560px; }
.wa-msg { background: #1f2c34; color: #e9edef; border-radius: 10px; padding: 6px; max-width: 92%; align-self: flex-start; box-shadow: 0 1px 1px rgba(0,0,0,.3); }
.wa-msg img { display: block; width: 100%; max-height: 300px; object-fit: cover; border-radius: 7px; margin-bottom: 4px; }
.wa-text { padding: 4px 6px 0; white-space: normal; word-wrap: break-word; font-size: .93rem; line-height: 1.5; unicode-bidi: plaintext; text-align: start; }
.wa-text .muted { color: #8696a0; }
.wa-footer { padding: 4px 6px 0; color: #8696a0; font-size: .8rem; unicode-bidi: plaintext; }
.wa-time { text-align: end; color: #8696a0; font-size: .72rem; padding: 2px 6px 2px; direction: ltr; }
.wa-ticks { color: #53bdeb; }
.response { min-height: 52px; margin: 0; font-family: var(--font); font-size: .92rem; }
.response.is-ok { color: var(--ok); }
.response.is-err { color: var(--danger); }

/* subscriptions */
.addcust { margin-bottom: 16px; }
.addcust[open] > summary { margin-bottom: 14px; }
.subline { margin-top: 4px; }
.extend { display: flex; gap: 6px; flex-wrap: wrap; }

.share-switch { flex-basis: 100%; justify-content: flex-end; margin: 0; font-size: .9rem; }

.numstyles { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.numstyles legend { font-weight: 500; font-size: .92rem; margin-bottom: 4px; }
.numstyles .hint { grid-column: 1 / -1; }
.numstyle { display: flex; gap: 8px; align-items: flex-start; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; font-weight: 400; }
.numstyle:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.numstyle-sample { font-size: .88rem; line-height: 1.6; unicode-bidi: plaintext; }

.subcount { font-size: .82rem; padding: 4px 10px; }

/* ================= 515 theme: dark + orange ================= */
body {
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(255, 122, 26, .10), transparent 60%),
    radial-gradient(700px 400px at -10% 110%, rgba(255, 122, 26, .05), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  letter-spacing: -.005em;
}
h1, h2, .brand, .bignum, .hero-num, .stat strong { font-family: "Space Grotesk", "IBM Plex Sans Arabic", sans-serif; letter-spacing: -.02em; }
h1 { font-size: 1.75rem; }
.topbar { background: rgba(10, 10, 13, .78); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom-color: var(--line); }
.devbar { background: rgba(18, 18, 22, .7); border-bottom-color: var(--line); }
.brand-mark { background: linear-gradient(135deg, var(--accent-2), var(--accent)); box-shadow: var(--glow); }
.brand-mark::after { background: #fff; }
.mainnav a, .tabs a, .filters a { color: var(--muted); border: 1px solid transparent; }
.mainnav a:hover, .tabs a:hover, .filters a:hover { background: var(--surface-2); color: var(--ink); }
.mainnav a.on, .tabs a.on, .filters a.on { background: var(--accent-soft); color: var(--accent-2); border-color: rgba(255, 122, 26, .35); }
.langpick summary { border-color: var(--line-2); background: var(--surface); }
.langmenu { background: var(--surface-2); border-color: var(--line-2); }

.card, .auth {
  background: linear-gradient(180deg, #15151a, #111115);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.devcard:hover { border-color: rgba(255, 122, 26, .55); box-shadow: var(--shadow), 0 0 0 1px rgba(255, 122, 26, .2); }

input, select, textarea { background: #0e0e12; border-color: var(--line-2); color: var(--ink); }
input::placeholder, textarea::placeholder { color: #6b6b78; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(255, 122, 26, .7); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }

.btn { background: var(--surface-2); border-color: var(--line-2); color: var(--ink); border-radius: 12px; }
.btn:hover { background: var(--surface-3); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  border-color: transparent; color: #fff; box-shadow: var(--glow);
}
.btn-primary:hover { background: linear-gradient(135deg, #ffb066, #ff8a33); filter: none; }
.btn-danger { background: var(--danger-soft); border-color: rgba(255, 92, 122, .25); color: var(--danger); }
.icon-btn { background: var(--surface-2); border-color: var(--line-2); color: var(--ink-2); }

.badge { background: var(--surface-3); color: var(--ink-2); }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-off { background: var(--danger-soft); color: var(--danger); }
.dot-ok { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft), 0 0 12px rgba(47, 227, 154, .6); }
.alert-success { background: var(--ok-soft); color: var(--ok); border-color: rgba(47, 227, 154, .2); }
.alert-error { border-color: rgba(255, 92, 122, .25); }
.alert-warn { border-color: rgba(255, 181, 71, .25); }
.note, .node, .optrow, .stats div { background: var(--surface-2); }
.node-num, .step-num { background: linear-gradient(135deg, var(--accent-2), var(--accent)); color: #fff; }
.chip { background: var(--accent-soft); color: var(--accent-2); }
.progress { background: var(--surface-3); }
.progress span { background: linear-gradient(90deg, var(--accent), var(--accent-2)); box-shadow: 0 0 12px rgba(255, 122, 26, .5); }
.table th { color: var(--muted); }
.table td, .table th, .kv li, .list li, .hours-row { border-color: var(--line); }
.code { background: #0e0e12; border: 1px solid var(--line); }
.bubble { color: #e9edef; }
.bubble-in { background: var(--bubble-in); }
.bubble-out { background: var(--bubble-out); }
.phone { background: var(--chat-bg); border: 1px solid var(--line); }
.bubble-note { background: var(--surface-2); color: var(--muted); }
.thumb { border-color: var(--line-2); }
a { color: var(--accent-2); }
.btn-link { color: var(--accent-2); }
.savebar { background: linear-gradient(to top, var(--bg) 70%, transparent); }
.numstyle:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }

/* ---------- dashboard hero ---------- */
.hero {
  position: relative; overflow: hidden; margin-bottom: 16px;
  padding: 28px 30px; border-radius: 22px; border: 1px solid #2a2016;
  background:
    radial-gradient(500px 220px at 85% 30%, rgba(255, 122, 26, .22), transparent 70%),
    linear-gradient(180deg, #17130f, #111114);
  box-shadow: var(--shadow);
}
.hero::before {
  content: ""; position: absolute; inset-block: 18px; inset-inline-start: 0; width: 4px; border-radius: 4px;
  background: linear-gradient(180deg, var(--accent-2), var(--accent)); box-shadow: 0 0 18px rgba(255, 122, 26, .8);
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .35;
  background-image: radial-gradient(rgba(255, 255, 255, .22) 1px, transparent 1.2px);
  background-size: 9px 9px;
  mask-image: radial-gradient(420px 200px at 75% 45%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(420px 200px at 75% 45%, #000 30%, transparent 75%);
}
.hero-in { position: relative; z-index: 1; display: flex; gap: 20px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; }
.hero-label { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: .9rem; }
.hero-label::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.hero-num { font-size: clamp(2.6rem, 6vw, 3.6rem); font-weight: 700; line-height: 1.05; margin: 8px 0 6px; }
.hero-num small { font-size: .42em; color: var(--accent-2); font-weight: 600; margin-inline-start: 6px; }
.hero-sub { color: var(--muted); font-size: .9rem; max-width: 460px; margin: 0; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-actions .btn { padding: 12px 20px; }

/* ---------- stats strip ---------- */
.stats-strip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 16px;
  background: linear-gradient(180deg, #15151a, #111115);
}
.stat { padding: 18px 20px; border-inline-end: 1px solid var(--line); display: grid; gap: 4px; }
.stat:last-child { border-inline-end: 0; }
.stat span { color: var(--muted); font-size: .84rem; }
.stat strong { font-size: 1.45rem; font-weight: 700; }
.stat .c-ok { color: var(--ok); } .stat .c-bad { color: var(--danger); } .stat .c-acc { color: var(--accent-2); }

/* ---------- traffic chart ---------- */
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
@media (max-width: 860px) { .dash-grid { grid-template-columns: 1fr; } }
.chart { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; align-items: end; height: 190px; margin-top: 18px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.chart-col { display: flex; flex-direction: column; justify-content: flex-end; height: 100%; gap: 3px; position: relative; }
.chart-bar { border-radius: 7px 7px 2px 2px; min-height: 2px; background: linear-gradient(180deg, var(--accent-2), var(--accent)); box-shadow: 0 0 14px rgba(255, 122, 26, .25); }
.chart-bar.out { background: linear-gradient(180deg, #ffd2a8, #ffb066); opacity: .9; box-shadow: none; }
.chart-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; color: var(--muted); font-size: .76rem; text-align: center; margin-top: 6px; }
.legend { display: flex; gap: 14px; color: var(--muted); font-size: .8rem; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 6px; vertical-align: -1px; background: var(--accent); }
.legend i.out { background: #ffb066; }
.health-num { font-size: 2.4rem; font-weight: 700; color: var(--accent-2); line-height: 1.1; }
.ticks { display: flex; gap: 3px; margin-top: 16px; height: 34px; align-items: stretch; }
.ticks span { flex: 1; border-radius: 3px; background: var(--accent); opacity: .9; }
.ticks span.off { background: var(--surface-3); opacity: 1; }
.devblocks { display: flex; gap: 6px; flex-wrap: wrap; margin: 14px 0 10px; }
.devblocks span { width: 18px; height: 22px; border-radius: 5px; background: var(--accent); box-shadow: 0 0 10px rgba(255, 122, 26, .35); }
.devblocks span.off { background: var(--surface-3); box-shadow: none; }

.features { border: 0; padding: 0; margin: 0; display: grid; gap: 4px; }
.features legend { font-weight: 500; font-size: .92rem; margin-bottom: 4px; }

/* ---------- traffic chart v2 ---------- */
.chart-card h2 { margin: 0; }
.chart-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.legend i.in { background: #5b5b6b; }
.chart2 {
  position: relative; display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; height: 230px; margin-top: 22px;
  background-image: linear-gradient(to top, var(--line) 1px, transparent 1px);
  background-size: 100% 25%;
}
.c2-col { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; }
.c2-bars { flex: 1; width: 100%; display: flex; gap: 4px; align-items: flex-end; justify-content: center; padding-top: 22px; }
.c2-bar {
  position: relative; width: min(18px, 40%); height: max(var(--h), 4px); border-radius: 6px 6px 3px 3px;
  transition: height .6s cubic-bezier(.2, .8, .2, 1);
}
.c2-bar.out { background: linear-gradient(180deg, var(--accent-2), var(--accent)); box-shadow: 0 0 16px rgba(255, 122, 26, .35); }
.c2-bar.in { background: linear-gradient(180deg, #6e6e80, #4a4a58); }
.c2-bar[data-v=""] { opacity: .35; box-shadow: none; }
.c2-bar[data-v]:not([data-v=""])::after {
  content: attr(data-v); position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%);
  font-size: .7rem; font-weight: 600; color: var(--ink-2); white-space: nowrap;
}
.c2-day { font-size: .74rem; color: var(--muted); white-space: nowrap; }
.c2-col.today .c2-day { color: var(--accent-2); font-weight: 600; }
.c2-col.today .c2-bars { background: linear-gradient(180deg, transparent, rgba(255, 122, 26, .06)); border-radius: 10px; }
.c2-empty {
  position: absolute; inset: 0 0 26px; display: grid; place-items: center; color: var(--muted); font-size: .9rem;
}
.big-inline { font-size: 1.4rem; }
.chart-card { display: flex; flex-direction: column; }
.chart-card .chart2 { flex: 1; min-height: 230px; height: auto; }

/* voice note option + preview */
.audiorow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; padding: 12px; background: var(--surface-2); border-radius: var(--radius-sm); }
.audiorow select { width: auto; min-width: 150px; }
.audiorow audio { width: 100%; height: 36px; }
.audiorow .hint { flex-basis: 100%; margin: 0; }
.wa-voice { display: flex; align-items: center; gap: 10px; min-width: 210px; padding: 8px 10px 4px; flex-wrap: wrap; margin-top: 6px; }
.wa-voice-play { color: #8696a0; font-size: 1.1rem; }
.wa-voice-wave { flex: 1; height: 18px; min-width: 110px; background: repeating-linear-gradient(90deg, #8696a0 0 2px, transparent 2px 5px); mask: linear-gradient(180deg, transparent 20%, #000 20% 80%, transparent 80%); -webkit-mask: linear-gradient(180deg, transparent 20%, #000 20% 80%, transparent 80%); opacity: .8; }
.wa-voice-mic { font-size: .95rem; }
.wa-voice .wa-time { flex-basis: 100%; margin-top: -4px; }
.checklist { list-style: none; padding: 0; margin: 8px 0 12px; display: grid; gap: 6px; }
.checklist li { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.optrow-audio { grid-column: 2 / 4; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.chip-toggle { border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 999px; padding: 4px 12px; font: inherit; font-size: .82rem; cursor: pointer; }
.chip-toggle[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: rgba(255, 122, 26, .12); }
.chip-toggle:disabled, .opt-audio-listen:disabled { opacity: .45; cursor: not-allowed; }

/* ===== Enviar (send page) ===== */
.send2 { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); gap: 22px; align-items: start; }
@media (max-width: 920px) { .send2 { grid-template-columns: 1fr; } }
.send2-main { display: grid; gap: 14px; min-width: 0; }
.s2-block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; display: grid; gap: 16px; }
.s2-head { display: flex; gap: 12px; align-items: flex-start; }
.s2-head h2 { margin: 0 0 2px; font-size: 1.05rem; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.s2-head .hint { margin: 0; }
.s2-head .step-num { flex: none; }
.s2-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 14px; }
.s2-field { display: grid; gap: 6px; align-content: start; margin: 0; }
.s2-label { font-size: .84rem; font-weight: 600; color: var(--ink-2); }
.s2-phone { display: flex; align-items: center; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.s2-phone:focus-within { outline: 2px solid var(--accent); outline-offset: -1px; }
.s2-phone > span { padding: 0 4px 0 12px; color: var(--muted); font-weight: 600; }
.s2-phone input { border: 0; background: transparent; padding-inline-start: 4px; letter-spacing: .02em; }
.s2-phone input:focus { outline: none; }
.s2-tpl { display: flex; gap: 8px; align-items: center; }
.s2-tpl select { flex: 1; }

.s2-editor { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); overflow: hidden; }
.s2-editor:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.s2-tools { display: flex; align-items: center; gap: 4px; padding: 6px 8px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.s2-tools button { border: 0; background: transparent; color: var(--ink-2); font: inherit; font-size: .88rem; min-width: 30px; height: 28px; padding: 0 8px; border-radius: 7px; cursor: pointer; }
.s2-tools button:hover { background: var(--surface-3); color: var(--ink); }
.s2-tools button:focus-visible { outline: 2px solid var(--accent); }
.s2-sep { width: 1px; height: 18px; background: var(--line-2); margin: 0 4px; }
.s2-count { margin-inline-start: auto; font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.s2-editor textarea { border: 0; border-radius: 0; min-height: 150px; resize: vertical; background: transparent; }
.s2-editor textarea:focus { outline: none; }

.s2-drop { position: relative; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 12px; border: 1px dashed var(--line-2); border-radius: var(--radius-sm); cursor: pointer; color: var(--muted); font-weight: 400; margin: 0; }
.s2-drop:hover, .s2-drop.is-over { border-color: var(--accent); color: var(--ink); background: var(--accent-soft); }
.s2-drop.has-file { border-style: solid; border-color: var(--accent); color: var(--ink); }
.s2-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.s2-drop-icon { font-size: 1.1rem; }
.s2-drop-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }

.s2-voice { margin: 0; padding: 14px; display: grid; gap: 12px; }
.s2-voice .hint { display: none; }
.s2-voice-opts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.s2-voice-opts select { width: auto; flex: 1 1 160px; }
.s2-toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; margin: 0; }
.s2-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.s2-knob { width: 40px; height: 22px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line-2); position: relative; transition: background .2s; flex: none; }
.s2-knob::after { content: ""; position: absolute; top: 2px; inset-inline-start: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--ink-2); transition: transform .2s, background .2s; }
.s2-toggle input:checked + .s2-knob { background: var(--accent); border-color: var(--accent); }
.s2-toggle input:checked + .s2-knob::after { background: #fff; transform: translateX(18px); }
[dir="rtl"] .s2-toggle input:checked + .s2-knob::after { transform: translateX(-18px); }
.s2-toggle input:focus-visible + .s2-knob { outline: 2px solid var(--accent); outline-offset: 2px; }
.s2-toggle input:disabled + .s2-knob { opacity: .4; }

.s2-bar { position: sticky; bottom: 12px; z-index: 5; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 12px; border-radius: var(--radius); background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(10px); border: 1px solid var(--line-2); box-shadow: 0 12px 30px rgba(0, 0, 0, .35); }
.s2-send { padding: 12px 30px; font-size: 1rem; font-weight: 700; }
.s2-save { flex: 1; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-width: 240px; }
.s2-save input { flex: 1 1 160px; }
.s2-save .share-switch { flex-basis: auto; margin: 0; }

/* phone preview: the memorable part */
.send2-side { position: sticky; top: 76px; display: grid; gap: 14px; }
@media (max-width: 920px) { .send2-side { position: static; } }
.s2-phone-frame { border-radius: 34px; padding: 10px; background: linear-gradient(160deg, #2a2a33, #15151a); border: 1px solid var(--line-2); box-shadow: 0 24px 60px rgba(0, 0, 0, .45); }
.s2-phone-top { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: #202c33; border-radius: 26px 26px 0 0; color: #e9edef; }
.s2-avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: var(--accent-ink); background: linear-gradient(135deg, var(--accent-2), var(--accent)); }
.s2-who { display: grid; line-height: 1.2; }
.s2-who small { color: #8696a0; font-size: .75rem; display: flex; align-items: center; }
.s2-who .live-dot { width: 7px; height: 7px; box-shadow: none; margin-inline-end: 6px; }
.s2-chat { border-radius: 0; min-height: 340px; max-height: 60vh; overflow-y: auto; padding: 16px 12px; border: 0;
  background-color: #0b141a;
  background-image: radial-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px), radial-gradient(rgba(255, 122, 26, .05) 1px, transparent 1px);
  background-size: 22px 22px, 34px 34px; background-position: 0 0, 11px 17px; }
.s2-chat .wa-msg { background: #005c4b; align-self: flex-end; border-start-end-radius: 3px; max-width: 88%; }
.s2-chat .wa-voice { background: #005c4b; }
.s2-chat .wa-time, .s2-chat .wa-footer { color: rgba(233, 237, 239, .62); }
.s2-chat .wa-ticks { color: #53bdeb; }
.s2-phone-input { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 0; padding: 10px 14px; background: #202c33; border-radius: 0 0 26px 26px; color: #8696a0; font-size: .85rem; }
.s2-mic { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; font-size: .9rem; }
.s2-status { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 8px; }
.s2-status .response { margin: 0; }
@media (prefers-reduced-motion: reduce) { .s2-knob, .s2-knob::after { transition: none; } }
.s2-grid > *, .s2-field { min-width: 0; }
.s2-drop { min-width: 0; }
.s2-drop-text { flex: 1; min-width: 0; }
.s2-field #img-clear { justify-self: start; }
.s2-save .share-switch { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; font-size: .88rem; }
.s2-save .share-switch input { margin: 0; }
@media (max-width: 640px) {
  .s2-block { padding: 16px; }
  .s2-bar { position: static; box-shadow: none; }
  .s2-send { width: 100%; }
}

/* ================= v1.11 polish: shell, auth, details ================= */
body.is-app, body.is-auth { min-height: 100vh; display: flex; flex-direction: column; }
.main { flex: 1; width: 100%; }
.sitefoot { border-top: 1px solid var(--line); color: var(--muted); font-size: .82rem; padding: 16px 0 22px; }

/* top bar: user chip + icon logout */
.topbar-end { display: flex; align-items: center; gap: 10px; }
.userchip { display: inline-flex; align-items: center; gap: 8px; padding: 3px 12px 3px 3px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); max-width: 200px; }
[dir="rtl"] .userchip { padding: 3px 3px 3px 12px; }
.userchip-av { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .85rem; color: var(--accent-ink); background: linear-gradient(135deg, var(--accent-2), var(--accent)); flex: none; }
.userchip-name { font-size: .88rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logout-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface); color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.logout-btn:hover { color: var(--danger); border-color: var(--danger); }
.logout-btn:focus-visible, .userchip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[dir="rtl"] .logout-btn svg { transform: scaleX(-1); }
@media (max-width: 760px) { .userchip-name { display: none; } .userchip { padding: 3px; } }

/* form controls: a bit taller and calmer */
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea { min-height: 42px; border-color: var(--line-2); transition: border-color .15s, box-shadow .15s; }
input:hover:not(:focus), select:hover:not(:focus), textarea:hover:not(:focus) { border-color: #3d3d4a; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.btn { transition: background .15s, border-color .15s, transform .1s; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .btn-link:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pagehead { margin-bottom: 18px; }
.pagehead h1 { font-size: 1.9rem; }
.table tbody tr:hover td { background: rgba(255, 255, 255, .015); }

/* ===== auth: split screen with a live chat demo ===== */
body.is-auth .main { padding-block: 28px; display: flex; }
.auth-shell { flex: 1; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); gap: 28px; align-items: stretch; width: 100%; }
.auth-side { display: flex; flex-direction: column; justify-content: center; }
.auth-side .auth { margin: 0 auto; width: 100%; max-width: 440px; padding: 34px; }
.auth-side .auth h1 { font-size: 2rem; margin-bottom: 4px; }
.auth-side .auth .form { gap: 14px; display: grid; margin: 22px 0 18px; }
.auth-side .auth .btn-block { min-height: 48px; font-size: 1rem; font-weight: 700; }
.auth-side .alert { max-width: 440px; margin-inline: auto; width: 100%; }

.auth-show {
  position: relative; overflow: hidden; border-radius: 28px; border: 1px solid var(--line);
  background:
    radial-gradient(520px 360px at 85% 0%, rgba(255, 122, 26, .30), transparent 65%),
    radial-gradient(420px 300px at 0% 100%, rgba(255, 161, 73, .14), transparent 70%),
    radial-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px) 0 0 / 18px 18px,
    #101014;
  display: flex; align-items: center; padding: 44px;
}
.auth-show-in { width: 100%; max-width: 470px; margin: 0 auto; }
.auth-kicker { margin: 0 0 14px; display: inline-flex; align-items: center; gap: 10px; font-family: "Space Grotesk", var(--font); font-weight: 700; font-size: 1rem; color: var(--accent-2); }
.auth-kicker::before { content: ""; width: 22px; height: 22px; border-radius: 7px; background: linear-gradient(135deg, var(--accent-2), var(--accent)); box-shadow: var(--glow); }
.auth-tag { font-size: clamp(1.7rem, 2.8vw, 2.5rem); line-height: 1.15; margin: 0 0 26px; font-weight: 700; color: #fff; text-wrap: balance; }

.demo-chat { display: flex; flex-direction: column; gap: 8px; padding: 18px; border-radius: 22px; background: rgba(11, 20, 26, .86); border: 1px solid rgba(255, 255, 255, .06); box-shadow: 0 30px 60px rgba(0, 0, 0, .45); }
.dm { max-width: 78%; padding: 8px 12px; border-radius: 12px; font-size: .92rem; line-height: 1.45; color: #e9edef; unicode-bidi: plaintext; }
.dm-in { align-self: flex-start; background: #202c33; border-start-start-radius: 3px; }
.dm-out { align-self: flex-end; background: #005c4b; border-start-end-radius: 3px; }
.dm-short { min-width: 38px; text-align: center; }
.dm-voice { display: flex; align-items: center; gap: 10px; min-width: 190px; }
.dm-voice span { color: #e9edef; font-size: .85rem; }
.dm-voice i { flex: 1; height: 16px; background: repeating-linear-gradient(90deg, rgba(233, 237, 239, .75) 0 2px, transparent 2px 5px); -webkit-mask: linear-gradient(180deg, transparent 18%, #000 18% 82%, transparent 82%); mask: linear-gradient(180deg, transparent 18%, #000 18% 82%, transparent 82%); }
.dm-voice small { color: rgba(233, 237, 239, .6); font-size: .72rem; }
/* the one orchestrated moment: the conversation plays once on load */
@media (prefers-reduced-motion: no-preference) {
  .dm { opacity: 0; transform: translateY(8px); animation: dmIn .45s ease forwards; }
  .dm:nth-child(1) { animation-delay: .25s; }
  .dm:nth-child(2) { animation-delay: 1.05s; }
  .dm:nth-child(3) { animation-delay: 1.85s; }
  .dm:nth-child(4) { animation-delay: 2.55s; }
  .dm:nth-child(5) { animation-delay: 3.15s; }
}
@keyframes dmIn { to { opacity: 1; transform: none; } }

.auth-feats { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 10px; }
.auth-feats li { display: flex; gap: 10px; align-items: flex-start; color: var(--ink-2); font-size: .95rem; }
.auth-feats li::before { content: "✓"; flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: .72rem; font-weight: 700; color: var(--accent-ink); background: var(--accent); margin-top: 2px; }

@media (max-width: 900px) {
  .auth-shell { grid-template-columns: 1fr; gap: 18px; }
  .auth-show { padding: 26px 22px; order: 2; }
  .auth-side { order: 1; }
  .auth-side .auth { padding: 26px 20px; }
}
@media (max-width: 520px) { .demo-chat, .auth-feats { display: none; } .auth-tag { margin-bottom: 0; } }
/* forms never stretch their rows when the neighbour card is taller */
.form { align-content: start; }
.numstyles .switch { width: 100%; }
.numstyles .switch span { flex: 1; }
.numstyles > .switch, .numstyles > .hint, .numstyles > legend { grid-column: 1 / -1; }
.grid + .pagehead, .card + .pagehead, .stack + .pagehead { margin-top: 34px; }

/* ===== hub: live status, stat cards and the main tab bar ===== */
.topbar-flex { flex: 1; }
.livestat { display: inline-flex; align-items: center; gap: 8px; font-size: .86rem; color: var(--ink-2); padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); }
.livestat-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.livestat.is-on .livestat-dot { background: var(--ok); box-shadow: 0 0 0 4px rgba(53, 208, 127, .15); }
.livestat-n { color: var(--muted); padding-inline-start: 8px; border-inline-start: 1px solid var(--line-2); }
@media (max-width: 760px) { .livestat-n { display: none; } }

.hub { padding-top: 22px; display: grid; gap: 14px; }
.hub-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.hub-card { position: relative; display: flex; gap: 14px; align-items: center; padding: 18px; border-radius: var(--radius); border: 1px solid var(--line); background: linear-gradient(180deg, #17171c, #121216); overflow: hidden; }
.hub-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--hc); }
.hub-card.c1 { --hc: linear-gradient(90deg, var(--accent), var(--accent-2)); --hi: var(--accent); }
.hub-card.c2 { --hc: linear-gradient(90deg, #1fb874, #35d07f); --hi: #35d07f; }
.hub-card.c3 { --hc: linear-gradient(90deg, #e0a526, #ffd166); --hi: #ffd166; }
.hub-ic { width: 46px; height: 46px; flex: none; border-radius: 13px; display: grid; place-items: center; color: var(--hi); background: color-mix(in srgb, var(--hi) 12%, transparent); border: 1px solid color-mix(in srgb, var(--hi) 26%, transparent); }
.hub-txt { display: grid; min-width: 0; line-height: 1.25; }
.hub-label { font-size: .8rem; color: var(--muted); font-weight: 500; }
.hub-num { font-family: "Space Grotesk", var(--font); font-size: 1.7rem; font-weight: 700; color: #fff; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.hub-txt small { color: var(--muted); font-size: .76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.hub-tabs { display: flex; gap: 6px; padding: 6px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); overflow-x: auto; scrollbar-width: none; }
.hub-tabs::-webkit-scrollbar { display: none; }
.hub-tabs a { flex: 1 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 11px; color: var(--muted); font-weight: 600; font-size: .92rem; white-space: nowrap; transition: background .15s, color .15s; }
.hub-tabs a:hover { color: var(--ink); background: var(--surface-2); text-decoration: none; }
.hub-tabs a.on { color: var(--accent-ink); background: linear-gradient(135deg, var(--accent-2), var(--accent)); box-shadow: 0 8px 22px rgba(255, 122, 26, .28); }
.hub-tabs a svg { flex: none; }
.hub + .devbar { margin-top: 14px; }
@media (max-width: 760px) {
  .hub-cards { grid-template-columns: 1fr 1fr; }
  .hub-card.c3 { grid-column: 1 / -1; }
  .hub-card { padding: 14px; gap: 10px; }
  .hub-ic { width: 38px; height: 38px; }
  .hub-num { font-size: 1.35rem; }
  .hub-tabs a { flex: 0 0 auto; padding: 9px 12px; }
}
.hub, .devbar, .sitefoot, .topbar { width: 100%; }
@media (max-width: 760px) { .topbar .subcount { display: none; } .topbar-in { flex-wrap: nowrap; gap: 10px; } .brand bdi { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } }
@media (max-width: 420px) { .livestat { padding: 5px 9px; } .livestat > :not(.livestat-dot) { display: none; } }
.livestat { white-space: nowrap; }

/* SMS page */
.sms-setup > summary { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; list-style: none; }
.sms-setup > summary::-webkit-details-marker { display: none; }
.sms-setup > summary::after { content: '▾'; margin-inline-start: auto; color: var(--muted); }
.sms-setup[open] > summary::after { content: '▴'; }
.sms-setup > summary h2 { margin: 0; }
.sms-steps { margin: 14px 0 18px; padding-inline-start: 22px; line-height: 1.7; }
.sms-steps li { margin-bottom: 4px; }
.sms-steps a { color: var(--accent); }
#smsCount { font-variant-numeric: tabular-nums; }
.sms-setup { margin-bottom: 18px; }
.sms-drivers { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin: 14px 0 6px; }
.sms-drv { display: flex !important; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.sms-drv:has(input:checked) { border-color: var(--accent); background: rgba(255, 140, 40, .07); }
.sms-drv span { display: flex; flex-direction: column; gap: 2px; }
.sms-drv small { color: var(--muted); font-weight: 400; }
.drv-box { margin-top: 8px; }

/* ===== v1.23 visual refresh ===== */
:root {
  --bg: #090a0f;
  --surface: #13141a;
  --surface-2: #1b1d25;
  --line: #262832;
  --accent: #ff7f1f;
  --accent-2: #ffb24d;
  --glow: 0 10px 34px rgba(255, 127, 31, .32);
}
body {
  background:
    radial-gradient(1100px 520px at 88% -8%, rgba(255, 127, 31, .10), transparent 60%),
    radial-gradient(900px 500px at -5% 0%, rgba(255, 178, 77, .06), transparent 55%),
    var(--bg);
  background-attachment: fixed;
}
.logo515 { display: block; border-radius: 10px; filter: drop-shadow(0 4px 10px rgba(255, 127, 31, .35)); flex: 0 0 auto; }
.brand { gap: 9px; font-size: 1.1rem; letter-spacing: -.01em; }
.brand .brand-mark { display: none; }
.auth-kicker { display: flex; align-items: center; gap: 10px; font-size: 1.15rem; font-weight: 700; color: var(--ink); opacity: 1; }
.auth-kicker .logo515 { width: 34px; height: 34px; }

/* cards & buttons a touch richer */
.card { border-radius: 20px; }
.card, .hub-card { background: linear-gradient(180deg, rgba(255,255,255,.015), transparent 40%), var(--surface); }
.btn-primary { background: linear-gradient(135deg, var(--accent-2), var(--accent)); border: 0; color: #2a1200; font-weight: 700; box-shadow: 0 6px 18px rgba(255,127,31,.28); }
.btn-primary:hover { filter: brightness(1.05); box-shadow: 0 8px 22px rgba(255,127,31,.38); }
.hub-tabs a.on, .tabs a.on { box-shadow: inset 0 0 0 1px rgba(255,127,31,.35); }

/* login card lift */
.auth-side .card, .auth { box-shadow: 0 20px 60px rgba(0,0,0,.45); }
