:root {
  --bg: #f7f8fc; --surface: #ffffff; --surface-2: #f9fafd; --ink: #111127; --ink-2: #33334d; --muted: #5d5d78; --line: #e6e7f0; --line-2: #d6d8e6;
  --brand: #2e2a86; --brand-2: #4a44c4; --brand-ink: #ffffff; --brand-soft: #eeedfb;
  --saffron: #f2a007; --saffron-soft: #fff4dc; --warn-ink: #7a4f00;
  --ok: #128a55; --ok-soft: #e3f5ec; --bad: #c0392b; --bad-soft: #fde9e6;
  --wa: #1fa855; --wa-soft: #e6f7ec; --wa-bubble: #d9fdd3;
  --code-bg: #f3f2fd; --code-ink: #26245c;
  --shadow-sm: 0 1px 2px rgb(17 17 39 / .05);
  --shadow: 0 1px 2px rgb(17 17 39 / .04), 0 6px 20px -10px rgb(17 17 39 / .14);
  --shadow-lg: 0 2px 4px rgb(17 17 39 / .04), 0 24px 48px -24px rgb(46 42 134 / .28);
  --radius: 14px;
  --f-display: "Bricolage Grotesque", "Avenir Next", system-ui, sans-serif;
  --f-body: "IBM Plex Sans", system-ui, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  color-scheme: light;
}

* { box-sizing: border-box }
[hidden] { display: none !important }
html { -webkit-text-size-adjust: 100% }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.6 var(--f-body); min-height: 100vh; -webkit-font-smoothing: antialiased }
h1, h2, h3, h4 { font-family: var(--f-display); margin: 0; line-height: 1.15; text-wrap: balance; letter-spacing: -.015em; color: var(--ink) }
p { margin: 0; text-wrap: pretty }
a { color: var(--brand) }
img, svg { max-width: 100% }
code, .mono { font-family: var(--f-mono); font-size: .86em }
:not(pre) > code { background: var(--code-bg); color: var(--code-ink); padding: .1em .4em; border-radius: 6px }
.muted { color: var(--muted) } .small { font-size: .84rem }
.err { color: var(--bad); min-height: 1.2em; font-size: .88rem } .ok { color: var(--ok); min-height: 1.2em; font-size: .88rem }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap }
.tnum { font-variant-numeric: tabular-nums }

.btn, button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 600 .92rem var(--f-body); padding: 10px 16px; border-radius: 10px; border: 1px solid var(--brand); background: var(--brand); color: var(--brand-ink); cursor: pointer; text-decoration: none; white-space: nowrap; transition: transform .12s, box-shadow .15s, background .15s, border-color .15s }
.btn:hover, button:hover { background: var(--brand-2); border-color: var(--brand-2); box-shadow: 0 8px 18px -10px var(--brand) }
.btn:active, button:active { transform: translateY(1px) }
.btn.ghost, button.ghost { background: var(--surface); color: var(--brand); border-color: var(--line-2) }
.btn.ghost:hover, button.ghost:hover { background: var(--brand-soft); border-color: var(--brand); box-shadow: none }
.btn.wa, button.wa { background: var(--wa); border-color: var(--wa); color: #fff }
.btn.wa:hover, button.wa:hover { background: #17924a; border-color: #17924a; box-shadow: 0 8px 18px -10px var(--wa) }
.btn.lg { padding: 13px 22px; font-size: 1rem; border-radius: 12px }
.btn.sm, button.sm { padding: 6px 11px; font-size: .82rem; border-radius: 8px }
button.danger { background: var(--bad); border-color: var(--bad); color: #fff }
button:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; box-shadow: none; pointer-events: none }
:is(button, .btn, a, input, textarea, select, summary):focus-visible { outline: 2px solid var(--saffron); outline-offset: 2px }

input, textarea, select { font: inherit; width: 100%; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); color: var(--ink); margin-top: 6px; transition: border-color .15s, box-shadow .15s }
input:focus, textarea:focus, select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); outline: none }
input:disabled { background: var(--surface-2); color: var(--muted) }
label { display: block; font-weight: 500; font-size: .9rem; color: var(--ink-2) }
label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400 }
label.check input { width: auto; margin-top: 4px; accent-color: var(--brand); box-shadow: none }
fieldset { border: 0; padding: 0; margin: 0 }
.stack { display: grid; gap: 14px }
.row { display: flex; gap: 10px; align-items: center }
.row.wrap { flex-wrap: wrap }
.spacer { flex: 1 }

.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500 }
.switch input { appearance: none; width: 40px; height: 22px; margin: 0; border-radius: 99px; background: var(--line-2); border: 0; position: relative; cursor: pointer; transition: background .15s; flex: none; box-shadow: none }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / .2); transition: transform .15s }
.switch input:checked { background: var(--ok) }
.switch input:checked::after { transform: translateX(18px) }

.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font: 700 1.25rem var(--f-display); letter-spacing: -.02em }
.brand b { color: var(--brand) }

.pill { display: inline-flex; align-items: center; gap: 6px; font: 600 .7rem var(--f-mono); text-transform: uppercase; letter-spacing: .06em; padding: 4px 10px; border-radius: 99px; background: var(--brand-soft); color: var(--brand); white-space: nowrap }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor }
.pill.connected, .pill.ok, .pill.sent, .pill.delivered { background: var(--ok-soft); color: var(--ok) }
.pill.banned, .pill.logged_out, .pill.bad, .pill.failed { background: var(--bad-soft); color: var(--bad) }
.pill.pending_qr, .pill.reconnecting, .pill.connecting, .pill.warn, .pill.queued, .pill.init { background: var(--saffron-soft); color: var(--warn-ink) }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: grid; gap: 14px; align-content: start; min-width: 0; box-shadow: var(--shadow) }
.card > header { display: flex; justify-content: space-between; align-items: center; gap: 10px }
.card h3 { font-size: 1.02rem }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important } }
