:root { --font: "Figtree", ui-sans-serif, system-ui, sans-serif; --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --blue: #3b82f6; --red: #ef4444; --amber: #f59e0b; --violet: #8b5cf6; --wa-link: #0086c3; }

* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--soft-2); -webkit-font-smoothing: antialiased; font-size: 15px; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
svg { flex: none; }

.shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--line); padding: 20px 14px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; padding: 4px 8px 22px; letter-spacing: -.02em; }
.brand-mark { width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; }
.brand-mark svg { width: 18px; height: 18px; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; font-weight: 500; color: var(--ink-2); font-size: 14.5px; }
.side nav a svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.side nav a:hover { background: var(--soft); }
.side nav a.active { background: var(--green-l); color: var(--green-d); font-weight: 600; }
.side nav a.nav-cta { background: var(--ink); color: #fff; margin: 0 0 10px; font-weight: 600; }
.side nav a.nav-cta:hover { background: #000; }
.side nav a.nav-cta.active { box-shadow: 0 0 0 3px #a7f3d0; }
.mode { margin-top: auto; font-size: 13px; border-radius: 10px; padding: 12px; }
.mode.demo { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.mode.live { background: var(--green-l); border: 1px solid #a7f3d0; color: var(--green-d); }
.mode b { display: block; }

.main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(249,250,251,.92); backdrop-filter: blur(8px); display: flex; align-items: center; gap: 14px; padding: 16px 32px; border-bottom: 1px solid var(--line); }
.topbar h1 { font-size: 22px; margin: 0; letter-spacing: -.02em; flex: 1; }
.top-actions { display: flex; gap: 8px; }
.menu-btn { display: none; }
.view { padding: 28px 32px 80px; max-width: 1400px; }

/* buttons + inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 8px; padding: 9px 16px; font-weight: 600; font-size: 14px; cursor: pointer; background: var(--surface); border-color: var(--line); white-space: nowrap; transition: background .15s, transform .1s; }
.btn:hover { background: var(--soft); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.btn-dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-dark:hover { background: #000; }
.btn-green { background: var(--green); color: #fff; border-color: var(--green); }
.btn-green:hover { background: #059669; }
.btn-danger { color: var(--red); }
.btn-sm { padding: 6px 10px; font-size: 13px; }
.btn-ghost { background: transparent; border-color: transparent; }
.icon-btn { all: unset; cursor: pointer; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; }
.icon-btn:hover { background: var(--soft); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; }

label.f { display: block; margin-bottom: 14px; }
label.f > span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--ink-2); }
label.f small, .hint { display: block; font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.in, select.in, textarea.in { width: 100%; border: 1px solid var(--line-2); background: var(--surface); border-radius: 8px; padding: 9px 12px; outline: none; transition: border-color .15s, box-shadow .15s; }
.in:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(16,185,129,.15); }
textarea.in { min-height: 110px; resize: vertical; line-height: 1.5; }
.in.mono { font-family: var(--mono); font-size: 13px; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.check { display: flex; gap: 10px; align-items: center; cursor: pointer; font-weight: 500; }
.check input { width: 18px; height: 18px; accent-color: var(--green); }
.seg { display: inline-flex; background: var(--soft); border-radius: 10px; padding: 4px; gap: 4px; flex-wrap: wrap; }
.seg button { all: unset; cursor: pointer; padding: 8px 14px; border-radius: 8px; font-weight: 600; font-size: 14px; color: var(--muted); display: inline-flex; gap: 8px; align-items: center; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

/* cards + layout */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; }
.card + .card { margin-top: 18px; }
.card h2 { font-size: 17px; margin: 0 0 4px; }
.card h3 { font-size: 15px; margin: 0 0 12px; }
.card > p.sub { color: var(--muted); margin: 0 0 18px; font-size: 14px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) var(--side, 380px); gap: 24px; align-items: start; }
.sticky { position: sticky; top: 90px; }
.grid-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 22px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; }
.kpi small { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.kpi b { display: block; font-size: 28px; letter-spacing: -.02em; margin-top: 4px; }
.kpi span { font-size: 13px; color: var(--muted); }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty h3 { color: var(--ink); font-size: 18px; margin: 0 0 6px; }
.empty .btn { margin-top: 16px; }

table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
.t th { text-align: left; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--soft-2); white-space: nowrap; }
.t td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tr.click { cursor: pointer; }
.t tr.click:hover td { background: var(--soft-2); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }

.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--soft); color: var(--ink-2); text-transform: capitalize; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.b-green, .b-read, .b-approved, .b-completed { background: var(--green-l); color: var(--green-d); }
.b-blue, .b-delivered, .b-running { background: #eff6ff; color: #1d4ed8; }
.b-sent, .b-scheduled, .b-pending, .b-in_appeal { background: #f5f3ff; color: #6d28d9; }
.b-red, .b-failed, .b-rejected, .b-cancelled, .b-disabled { background: #fef2f2; color: #b91c1c; }
.b-queued, .b-sending, .b-draft, .b-paused { background: #fffbeb; color: #b45309; }
.tag { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .03em; padding: 2px 7px; border-radius: 5px; background: var(--soft); color: var(--muted); text-transform: uppercase; }
.tag.car { background: #f5f3ff; color: #6d28d9; }

.progress { height: 8px; border-radius: 99px; background: var(--soft); overflow: hidden; display: flex; }
.progress i { display: block; height: 100%; }

.err-box { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; border-radius: 10px; padding: 12px 14px; font-size: 14px; margin: 12px 0; }
.err-box ul { margin: 6px 0 0; padding-left: 18px; }
.info-box { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e3a8a; border-radius: 10px; padding: 12px 14px; font-size: 14px; margin: 12px 0; }
.warn-box { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; border-radius: 10px; padding: 12px 14px; font-size: 14px; margin: 12px 0; }
code, .code { font-family: var(--mono); font-size: 12.5px; }
pre.code { background: #0f172a; color: #e2e8f0; padding: 14px; border-radius: 10px; overflow: auto; max-height: 360px; margin: 0; }

/* template builder pieces */
.btn-row { display: grid; grid-template-columns: 150px 1fr 1fr auto; gap: 8px; align-items: start; margin-bottom: 8px; }
.cards-strip { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.cards-strip button { all: unset; cursor: pointer; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); font-weight: 600; font-size: 13px; background: var(--surface); }
.cards-strip button.on { border-color: var(--green); background: var(--green-l); color: var(--green-d); }
.cards-strip button.add { border-style: dashed; color: var(--muted); }
.upload { display: flex; align-items: center; gap: 14px; border: 1.5px dashed var(--line-2); border-radius: 10px; padding: 12px; background: var(--soft-2); }
.upload .thumb { width: 72px; height: 72px; border-radius: 8px; background: #e5e7eb center/cover no-repeat; flex: none; display: grid; place-items: center; color: var(--muted); font-size: 11px; overflow: hidden; }
.upload .thumb video { width: 100%; height: 100%; object-fit: cover; }
.upload input[type=file] { display: none; }
.var-chip { display: inline-flex; gap: 4px; }
.var-chip button { all: unset; cursor: pointer; font-family: var(--mono); font-size: 12px; background: var(--soft); border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; }
.var-chip button:hover { background: #e5e7eb; }
.counter { float: right; font-weight: 500; color: var(--muted); font-size: 12px; }

/* WhatsApp preview */
.phone { width: 340px; max-width: 100%; margin: 0 auto; border-radius: 36px; background: #111; padding: 10px; box-shadow: 0 30px 60px -30px rgba(0,0,0,.45); }
.phone-in { border-radius: 28px; overflow: hidden; background: var(--wa-bg); display: flex; flex-direction: column; height: 640px; }
.phone-head { background: #008069; color: #fff; padding: 34px 14px 10px; display: flex; gap: 10px; align-items: center; font-weight: 600; font-size: 14px; }
.phone-head .av { width: 32px; height: 32px; border-radius: 50%; background: var(--surface); color: #008069; display: grid; place-items: center; font-weight: 800; font-size: 12px; }
.phone-head small { display: block; font-weight: 400; opacity: .8; font-size: 11px; }
.chat { flex: 1; overflow-y: auto; padding: 14px 10px; background-color: var(--wa-bg); background-image: radial-gradient(rgba(0,0,0,.035) 1px, transparent 1px); background-size: 14px 14px; }
.msg { background: var(--wa-in); border-radius: 0 10px 10px 10px; max-width: 92%; box-shadow: 0 1px .5px rgba(0,0,0,.13); font-size: 13.5px; line-height: 1.4; overflow: hidden; }
.msg-media { aspect-ratio: 1.91 / 1; background: var(--line-2) center/cover no-repeat; display: grid; place-items: center; color: #6b7280; font-size: 12px; margin: 4px 4px 0; border-radius: 7px; overflow: hidden; }
.msg-media video { width: 100%; height: 100%; object-fit: cover; }
.msg-doc { margin: 4px 4px 0; border-radius: 7px; background: var(--soft); padding: 12px; display: flex; gap: 8px; align-items: center; font-size: 12px; }
.msg-text { padding: 7px 9px 2px; white-space: pre-wrap; word-wrap: break-word; }
.msg-head { padding: 8px 9px 0; font-weight: 700; }
.msg-foot { padding: 0 9px; color: var(--wa-muted); font-size: 12px; }
.msg-time { text-align: right; color: var(--wa-muted); font-size: 10.5px; padding: 0 8px 5px; }
.msg-btns { border-top: 1px solid var(--wa-line); }
.msg-btns div { color: var(--wa-link); text-align: center; padding: 9px; font-weight: 500; font-size: 13.5px; display: flex; justify-content: center; align-items: center; gap: 6px; }
.msg-btns div + div { border-top: 1px solid var(--wa-line); }
.msg-btns svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }
.var { background: #fef3c7; color: #92400e; border-radius: 3px; padding: 0 2px; font-family: var(--mono); font-size: .9em; }
.carousel { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; margin-top: 6px; padding-bottom: 6px; }
.carousel::-webkit-scrollbar { height: 4px; }
.carousel::-webkit-scrollbar-thumb { background: rgba(0,0,0,.2); border-radius: 4px; }
.ccard { flex: 0 0 82%; scroll-snap-align: start; background: var(--wa-in); border-radius: 10px; box-shadow: 0 1px .5px rgba(0,0,0,.13); overflow: hidden; font-size: 13px; display: flex; flex-direction: column; }
.ccard.on { outline: 2px solid var(--green); }
.ccard .msg-media { margin: 4px; aspect-ratio: 1.6 / 1; }
.ccard .msg-text { flex: 1; padding-bottom: 8px; }

/* campaign wizard */
.steps { display: flex; gap: 6px; margin-bottom: 22px; flex-wrap: wrap; }
.steps button { all: unset; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 8px 14px 8px 8px; border-radius: 999px; font-weight: 600; font-size: 14px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); }
.steps button i { font-style: normal; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); font-size: 12px; }
.steps button.on { color: var(--ink); border-color: var(--ink); }
.steps button.on i { background: var(--primary); color: var(--on-primary); }
.steps button.done i { background: var(--green); color: #fff; }
.tpl-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.tpl-pick button { all: unset; cursor: pointer; border: 1.5px solid var(--line); border-radius: 12px; padding: 14px; background: var(--surface); display: flex; flex-direction: column; gap: 8px; }
.tpl-pick button:hover { border-color: #a7f3d0; }
.tpl-pick button.on { border-color: var(--green); box-shadow: 0 0 0 3px rgba(16,185,129,.15); }
.tpl-pick b { font-size: 14.5px; word-break: break-all; }
.tpl-pick p { margin: 0; color: var(--muted); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.drop { display: block; border: 2px dashed var(--line-2); border-radius: 12px; padding: 28px; text-align: center; background: var(--soft-2); cursor: pointer; transition: border-color .15s, background .15s; }
.drop.over, .drop:hover { border-color: var(--green); background: var(--green-l); }
.drop b { display: block; font-size: 16px; margin-bottom: 4px; }
.drop span { display: block; }
.detect { background: var(--green-l); border: 1px solid #bbf7d0; border-radius: 12px; padding: 12px 14px 2px; margin-bottom: 14px; }
.detect-head { font-size: 14px; margin-bottom: 10px; }
.detect select { font-size: 13px; }
.map-row { display: grid; grid-template-columns: minmax(150px, 220px) 150px 1fr; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.map-row:last-child { border-bottom: 0; }
.map-row .lbl b { display: block; font-size: 14px; }
.map-row .lbl small { color: var(--muted); font-size: 12px; }
.map-group { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 0 2px; }
.in.need { border-color: #ef4444; box-shadow: 0 0 0 3px #fee2e2; }
.req { color: #dc2626; font-weight: 600; }
.mini-upload { display: flex; gap: 8px; align-items: center; }
.mini-upload .in { flex: 1; }
.mini-upload img, .mini-upload .ph { width: 38px; height: 38px; border-radius: 6px; object-fit: cover; background: var(--soft); flex: none; }
.foot-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 22px; flex-wrap: wrap; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 10px; font-weight: 500; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 100; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: #b91c1c; }

.inbox-item { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.inbox-item:last-child { border-bottom: 0; }
.inbox-item .av { width: 38px; height: 38px; border-radius: 50%; background: var(--green-l); color: var(--green-d); display: grid; place-items: center; font-weight: 700; flex: none; }
.inbox-item .body { flex: 1; min-width: 0; }
.inbox-item .meta { font-size: 12.5px; color: var(--muted); }
.spin { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* contact lists */
.contacts-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 22px; align-items: start; }
.group-nav { padding: 14px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 90px; }
.group-nav h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 4px 8px 8px; }
.group-nav button { all: unset; cursor: pointer; display: flex; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 8px; font-size: 14px; font-weight: 500; color: var(--ink-2); overflow-wrap: anywhere; }
.group-nav button span { color: var(--muted); font-size: 12.5px; }
.group-nav button:hover { background: var(--soft); }
.group-nav button.on { background: var(--green-l); color: var(--green-d); font-weight: 600; }
.group-nav button.add { color: var(--muted); border: 1px dashed var(--line); margin-top: 8px; justify-content: center; }
.group-head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.group-head h2 { margin: 0 8px 0 0; font-size: 18px; }
.list-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.list-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; transition: border-color .15s, box-shadow .15s; }
.list-card:hover { border-color: #a7f3d0; box-shadow: 0 4px 14px -8px rgba(0,0,0,.15); }
.list-card .list-name { font-size: 16px; overflow-wrap: anywhere; }
.list-card small { color: var(--muted); font-size: 12.5px; }
.list-nums { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.list-nums b { color: var(--ink); }
.list-actions { display: flex; gap: 8px; margin-top: 4px; }
.list-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.contacts-t .in { padding: 6px 8px; min-width: 110px; }
.contacts-t tr.editing td { background: var(--green-l); }
.col-x { all: unset; cursor: pointer; color: var(--muted); padding: 0 4px; border-radius: 4px; font-size: 14px; }
.col-x:hover { background: #fee2e2; color: var(--red); }
.promo-box { display: grid; grid-template-columns: minmax(150px, 220px) 200px 1fr; gap: 10px; align-items: center; background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px; padding: 12px; margin-bottom: 8px; }
.promo-box small { display: block; color: var(--muted); font-size: 12px; }
@media (max-width: 860px) { .promo-box { grid-template-columns: 1fr; } }
.pick-count { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.pick-count .chips { display: flex; gap: 6px; flex-wrap: wrap; }
.batch-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
label.f > span.batch-every { display: flex; gap: 8px; margin: 0; }
.batch-every input { width: 90px; flex: none; }
dialog.dlg { border: 0; border-radius: 14px; padding: 22px; width: min(440px, calc(100vw - 32px)); box-shadow: 0 30px 80px -20px rgba(0,0,0,.4); }
dialog.dlg::backdrop { background: rgba(17,24,39,.45); }
dialog.dlg h2 { margin: 0 0 16px; font-size: 18px; }
dialog.dlg .foot-actions { margin-top: 8px; justify-content: flex-end; }

/* ---------- Replies: WhatsApp Web style ---------- */
.view.view-chat { padding: 0; max-width: none; overflow: hidden; }
.wa { display: grid; grid-template-columns: minmax(300px, 420px) minmax(0, 1fr); height: 100%; background: var(--surface); border-top: 1px solid var(--wa-line); color: var(--wa-ink); }
.wa-side { display: flex; flex-direction: column; min-height: 0; min-width: 0; border-right: 1px solid var(--wa-line); background: var(--surface); }
.wa-side-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 8px; }
.wa-side-head b { font-size: 22px; letter-spacing: -.01em; }
.wa-icon { all: unset; cursor: pointer; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--wa-icon); flex: none; }
.wa-icon:hover { background: rgba(11,20,26,.06); }
.wa-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; }
.wa-search { margin: 4px 12px 8px; display: flex; align-items: center; gap: 10px; background: var(--wa-panel); border-radius: 8px; padding: 0 12px; height: 38px; }
.wa-search svg { width: 17px; height: 17px; fill: none; stroke: var(--wa-icon); stroke-width: 2; }
.wa-search input { all: unset; flex: 1; font-size: 14px; color: var(--wa-ink); }
.wa-search input::placeholder { color: var(--wa-sub); }
.wa-chips { display: flex; gap: 8px; padding: 2px 12px 10px; overflow-x: auto; scrollbar-width: none; flex: none; }
.wa-chips::-webkit-scrollbar { display: none; }
.wa-chip { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; padding: 6px 12px; border-radius: 999px; background: var(--wa-panel); color: var(--wa-icon); font-size: 14px; font-weight: 500; }
.wa-chip:hover { background: var(--wa-hover2); }
.wa-chip.on { background: var(--wa-out); color: var(--wa-dark); }
.wa-chip i { font-style: normal; font-size: 11.5px; font-weight: 700; background: var(--wa-green); color: #fff; border-radius: 999px; padding: 0 6px; line-height: 18px; }
.wa-chip .x { margin-left: 2px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 15px; line-height: 1; }
.wa-chip .x:hover { background: rgba(0,0,0,.1); }
.wa-chip.add { font-size: 18px; font-weight: 400; padding: 3px 12px; }
.wa-list { flex: 1; overflow-y: auto; min-height: 0; }
.wa-row { all: unset; cursor: pointer; display: flex; align-items: center; gap: 13px; width: 100%; box-sizing: border-box; padding: 0 0 0 13px; }
.wa-row:hover { background: var(--wa-hover); }
.wa-row.on { background: var(--wa-panel); }
.wa-av { border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 16px; flex: none; }
.wa-row-body { flex: 1; min-width: 0; border-bottom: 1px solid var(--wa-line); padding: 12px 15px 12px 0; display: flex; flex-direction: column; gap: 2px; }
.wa-row-top, .wa-row-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wa-row-top b { font-weight: 500; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-row-top small { font-size: 12px; color: var(--wa-sub); flex: none; }
.wa-row-top small.unread { color: #1fa855; font-weight: 600; }
.wa-prev { font-size: 14px; color: var(--wa-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 3px; min-width: 0; }
.wa-badge { font-style: normal; background: #25d366; color: #fff; font-size: 12px; font-weight: 700; min-width: 20px; height: 20px; border-radius: 999px; display: grid; place-items: center; padding: 0 5px; flex: none; }
.wa-none { padding: 40px 24px; text-align: center; color: var(--wa-sub); font-size: 14px; }
.wa-none b { display: block; color: var(--wa-ink); font-size: 16px; margin-bottom: 6px; }

.ticks { display: inline-flex; color: var(--wa-muted); vertical-align: -1px; flex: none; }
.ticks.read { color: #53bdeb; }
.ticks.fail { color: #ef4444; }
.ticks svg { width: 16px; height: 11px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.wa-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--wa-bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' fill='none' stroke='%23000' stroke-opacity='.045' stroke-width='1.5'%3E%3Ccircle cx='20' cy='22' r='7'/%3E%3Cpath d='M70 15l8 8-8 8-8-8z'/%3E%3Cpath d='M100 60c6 0 10 4 10 10s-4 10-10 10'/%3E%3Cpath d='M20 80h16M28 72v16'/%3E%3Cpath d='M60 95q8-10 16 0t16 0'/%3E%3Ccircle cx='95' cy='20' r='3'/%3E%3Cpath d='M40 50l6 3-6 3'/%3E%3C/svg%3E"); }
.wa-empty { margin: auto; text-align: center; max-width: 460px; padding: 30px; color: var(--wa-sub); }
.wa-empty-art { width: 96px; height: 96px; border-radius: 50%; background: var(--wa-chip-on); display: grid; place-items: center; margin: 0 auto 22px; }
.wa-empty-art svg { width: 48px; height: 48px; fill: none; stroke: var(--wa-dark); stroke-width: 1.6; }
.wa-empty h2 { color: var(--wa-ink-2); font-weight: 300; font-size: 30px; margin: 0 0 10px; }
.wa-empty p { font-size: 14px; line-height: 1.6; margin: 0 0 30px; }
.wa-empty small { font-size: 13px; }
.wa-chat-head { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--wa-panel); border-bottom: 1px solid var(--wa-line); flex: none; }
.wa-back { display: none; font-size: 22px; }
.wa-chat-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.wa-chat-title b { font-weight: 500; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-chat-title small { font-size: 13px; color: var(--wa-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-msgs { flex: 1; overflow-y: auto; padding: 12px 6% 16px; display: flex; flex-direction: column; min-height: 0; }
.wa-loading { margin: auto; color: var(--wa-sub); }
.wa-secure { align-self: center; background: var(--wa-secure); color: var(--wa-ink-2); font-size: 12.5px; border-radius: 7.5px; padding: 6px 12px; margin: 4px 0 10px; text-align: center; box-shadow: 0 1px .5px rgba(11,20,26,.13); }
.wa-day { align-self: center; margin: 10px 0 8px; }
.wa-day span { display: inline-block; background: var(--wa-in); color: var(--wa-icon); font-size: 12.5px; padding: 5px 12px; border-radius: 7.5px; box-shadow: 0 1px .5px rgba(11,20,26,.13); }
.wa-line { display: flex; margin-top: 2px; }
.wa-line.first { margin-top: 10px; }
.wa-line.wa-out { justify-content: flex-end; }
.wa-bubble { position: relative; max-width: min(65%, 560px); background: var(--wa-in); border-radius: 7.5px; padding: 6px 8px 8px 9px; font-size: 14.2px; line-height: 19px; color: var(--wa-ink); box-shadow: 0 1px .5px rgba(11,20,26,.13); overflow-wrap: anywhere; }
.wa-line.wa-out .wa-bubble { background: var(--wa-out); }
.wa-line.first.wa-in .wa-bubble { border-top-left-radius: 0; }
.wa-line.first.wa-out .wa-bubble { border-top-right-radius: 0; }
.wa-line.first.wa-in .wa-bubble::before, .wa-line.first.wa-out .wa-bubble::before { content: ""; position: absolute; top: 0; width: 8px; height: 13px; }
.wa-line.first.wa-in .wa-bubble::before { left: -8px; background: linear-gradient(to bottom left, var(--wa-in) 50%, transparent 50%); }
.wa-line.first.wa-out .wa-bubble::before { right: -8px; background: linear-gradient(to bottom right, var(--wa-out) 50%, transparent 50%); }
.wa-text { white-space: pre-wrap; }
.wa-meta { float: right; margin: 7px 0 -6px 12px; font-size: 11px; color: var(--wa-sub); display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.wa-tap { font-size: 12px; color: var(--wa-dark); font-weight: 600; }
.wa-quote { background: rgba(11,20,26,.05); border-left: 4px solid #06cf9c; border-radius: 5px; padding: 5px 8px; margin: 0 -3px 5px; display: flex; flex-direction: column; font-size: 13px; }
.wa-quote b { color: #06cf9c; font-weight: 600; font-size: 12.5px; }
.wa-quote span { color: var(--wa-sub); }
.wa-tpl { max-width: min(78%, 380px); display: flex; flex-direction: column; align-items: flex-end; }
.wa-tpl-label { font-size: 11.5px; color: var(--wa-sub); margin: 0 4px 3px; }
.wa-tpl-label a:hover { text-decoration: underline; }
.wa-tpl .msg { background: var(--wa-out); max-width: 100%; border-radius: 7.5px 0 7.5px 7.5px; }
.wa-tpl .msg-time { display: flex; justify-content: flex-end; align-items: center; gap: 3px; }
.wa-tpl .carousel { width: 100%; }
.wa-fail { color: #b91c1c; font-size: 12.5px; margin-top: 4px; background: #fef2f2; border-radius: 6px; padding: 4px 8px; }
.wa-window { background: #fff8e1; color: #6b5300; font-size: 13px; padding: 8px 16px; border-top: 1px solid #fde68a; }
.wa-compose { display: flex; align-items: flex-end; gap: 8px; padding: 8px 16px 10px; background: var(--wa-panel); flex: none; }
.wa-compose textarea { flex: 1; resize: none; border: 0; outline: none; border-radius: 8px; padding: 10px 12px; font-size: 15px; line-height: 20px; max-height: 140px; background: var(--wa-input); color: var(--wa-ink); }
.wa-send { all: unset; cursor: pointer; width: 42px; height: 42px; border-radius: 50%; background: var(--wa-green); color: #fff; display: grid; place-items: center; flex: none; }
.wa-send:hover { background: var(--wa-dark); }
.wa-send:disabled { opacity: .6; }
.wa-send svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; }

/* focus mode: chats take the whole window, the admin menu is hidden */
.focus-back { display: none; }
body.chat-focus .shell { grid-template-columns: minmax(0, 1fr); }
body.chat-focus .side { display: none; }
body.chat-focus .menu-btn { display: none !important; }
body.chat-focus .topbar { padding: 10px 20px; background: var(--surface); border-bottom-color: var(--line); }
body.chat-focus .topbar h1 { font-size: 18px; }
body.chat-focus .focus-back { display: inline-flex; }

/* collapsible chat list: just the avatars */
.wa-side-tools { display: flex; gap: 2px; }
.wa { transition: grid-template-columns .18s; }
@media (min-width: 861px) {
  .wa.collapsed { grid-template-columns: 76px minmax(0, 1fr); }
  .wa.collapsed .wa-search, .wa.collapsed .wa-chips, .wa.collapsed .wa-row-body, .wa.collapsed .wa-side-head b, .wa.collapsed #waRefresh { display: none; }
  .wa.collapsed .wa-side-head { justify-content: center; padding: 12px 0 6px; }
  .wa.collapsed .wa-row { padding: 8px 0; justify-content: center; }
  .wa.collapsed .wa-av-badge { display: grid; }
}
.wa-av-wrap { position: relative; flex: none; display: grid; }
.wa-av-badge { display: none; position: absolute; top: -3px; right: -4px; font-style: normal; background: #25d366; color: #fff; font-size: 11px; font-weight: 700; min-width: 18px; height: 18px; border-radius: 999px; place-items: center; padding: 0 4px; border: 2px solid var(--surface); }

/* composer */
.wa-main { position: relative; }
.wa-composer { position: relative; flex: none; }
.wa-compose { align-items: flex-end; gap: 4px; padding: 8px 12px 10px; }
.wa-compose[hidden], .wa-rec[hidden], .wa-pop[hidden], .wa-sheet[hidden] { display: none !important; }
.wa-input { flex: 1; display: flex; align-items: flex-end; background: var(--wa-input); border-radius: 8px; min-width: 0; }
.wa-input textarea { background: transparent; }
.wa-input select { all: unset; cursor: pointer; font-size: 11px; font-weight: 700; color: var(--wa-sub); padding: 0 4px; line-height: 40px; align-self: flex-end; }
.wa-dictate.on { color: #fff; background: #ef4444; animation: waPulse 1.2s infinite; }
@keyframes waPulse { 50% { box-shadow: 0 0 0 6px rgba(239,68,68,.2); } }
.wa-send.mic { background: var(--wa-green); }
.wa-pop { position: absolute; bottom: calc(100% + 6px); left: 12px; z-index: 5; background: var(--wa-in); color: var(--wa-ink); border-radius: 14px; box-shadow: 0 6px 30px rgba(11,20,26,.18); padding: 8px; }
.wa-emoji { display: grid; grid-template-columns: repeat(10, 36px); gap: 2px; max-width: calc(100% - 24px); }
.wa-emoji button { all: unset; cursor: pointer; font-size: 22px; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 8px; }
.wa-emoji button:hover { background: var(--wa-panel); }
.wa-attach { left: 52px; display: flex; flex-direction: column; min-width: 210px; }
.wa-attach button { all: unset; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 9px; font-size: 14.5px; color: var(--wa-ink); }
.wa-attach button:hover { background: var(--wa-panel); }
.wa-attach button span { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.wa-attach svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; }
.wa-rec { display: flex; align-items: center; gap: 12px; padding: 8px 16px 10px; background: var(--wa-panel); justify-content: flex-end; font-variant-numeric: tabular-nums; color: var(--wa-ink); }
.wa-rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #ef4444; animation: waBlink 1s infinite; }
@keyframes waBlink { 50% { opacity: .2; } }
.wa-rec-wave { display: flex; align-items: center; gap: 3px; height: 24px; margin-right: 8px; }
.wa-rec-wave i { width: 3px; border-radius: 2px; background: var(--wa-sub); animation: waWave .9s infinite ease-in-out; }
.wa-rec-wave i:nth-child(odd) { animation-delay: .3s; } .wa-rec-wave i:nth-child(3n) { animation-delay: .6s; }
@keyframes waWave { 0%, 100% { height: 5px; } 50% { height: 20px; } }

/* media in bubbles */
.wa-bubble.has-media { padding: 3px 3px 6px; }
.wa-bubble.has-media .wa-text { display: block; padding: 4px 5px 0; }
.wa-bubble.has-media .wa-meta { margin-right: 5px; }
.wa-media { display: block; border-radius: 6px; overflow: hidden; max-width: 330px; }
.wa-media img, video.wa-media { display: block; width: 100%; max-height: 360px; object-fit: cover; background: var(--wa-line); }
.wa-media.sticker img { background: none; max-width: 160px; }
.wa-media.broken { width: 220px; height: 140px; background: var(--wa-line) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='40' fill='none' stroke='%238696a0' stroke-width='1.6'%3E%3Crect x='3' y='3' width='18' height='18' rx='2'/%3E%3Ccircle cx='9' cy='9' r='2'/%3E%3Cpath d='m21 15-5-5L5 21'/%3E%3C/svg%3E") center no-repeat; }
.wa-media.broken img { display: none; }
.wa-audio { display: flex; align-items: center; gap: 8px; padding: 4px 4px 0; }
.wa-audio audio { height: 36px; width: 250px; max-width: 100%; }
.wa-audio-ic { width: 38px; height: 38px; border-radius: 50%; background: #ff7f2a; color: #fff; display: grid; place-items: center; flex: none; }
.wa-audio.voice .wa-audio-ic { background: var(--wa-green); }
.wa-audio-ic svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.wa-doc { display: flex; align-items: center; gap: 10px; background: rgba(11,20,26,.05); border-radius: 6px; padding: 10px; min-width: 240px; color: var(--wa-ink); }
.wa-doc:hover { background: rgba(11,20,26,.08); }
.wa-doc-ic { width: 36px; height: 44px; border-radius: 4px; background: #e2e8f0; color: #475569; font-size: 10px; font-weight: 800; display: grid; place-items: end center; padding-bottom: 6px; box-sizing: border-box; flex: none; }
.wa-doc-name { display: flex; flex-direction: column; min-width: 0; }
.wa-doc-name b { font-weight: 500; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-doc-name small { font-size: 12px; color: var(--wa-sub); }

/* polls */
.wa-bubble-poll { min-width: 280px; }
.wa-poll-q { font-weight: 600; font-size: 15px; margin-bottom: 2px; }
.wa-poll-sub { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--wa-sub); margin-bottom: 8px; }
.wa-poll-sub svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; }
.wa-poll-opt { display: flex; gap: 10px; align-items: center; padding: 6px 0; }
.wa-poll-check { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--wa-muted); display: grid; place-items: center; font-size: 12px; color: #fff; flex: none; box-sizing: border-box; }
.wa-poll-opt.picked .wa-poll-check { background: var(--wa-green); border-color: var(--wa-green); }
.wa-poll-main { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.wa-poll-label { display: flex; justify-content: space-between; gap: 10px; font-size: 14.2px; }
.wa-poll-label b { font-weight: 500; color: var(--wa-sub); }
.wa-poll-bar { height: 6px; border-radius: 3px; background: rgba(11,20,26,.08); overflow: hidden; }
.wa-poll-bar i { display: block; height: 100%; background: var(--wa-green); border-radius: 3px; transition: width .3s; }
.wa-poll-foot { border-top: 1px solid rgba(11,20,26,.08); margin-top: 6px; padding-top: 8px; text-align: center; font-size: 13px; color: var(--wa-dark); }

/* file preview before sending */
.wa-sheet { position: absolute; inset: 0; z-index: 8; background: var(--wa-bg); display: flex; flex-direction: column; }
.wa-sheet header { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--wa-panel); }
.wa-sheet header b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-sheet-big { flex: 1; min-height: 0; display: grid; place-items: center; padding: 20px; }
.wa-sheet-big img, .wa-sheet-big video { max-width: 100%; max-height: 100%; border-radius: 6px; box-shadow: 0 4px 20px rgba(0,0,0,.12); }
.wa-sheet-file { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; color: var(--wa-sub); max-width: 420px; }
.wa-sheet-file svg { width: 72px; height: 72px; fill: none; stroke: var(--wa-muted); stroke-width: 1.2; }
.wa-sheet-file b { color: var(--wa-ink); font-weight: 500; overflow-wrap: anywhere; }
.wa-sheet-bottom { display: grid; grid-template-columns: 1fr auto; gap: 10px 14px; padding: 12px 20px 16px; background: var(--wa-panel); align-items: center; }
.wa-sheet-cap { grid-column: 1 / -1; border: 0; outline: none; border-radius: 8px; padding: 11px 14px; font-size: 15px; background: var(--wa-input); color: var(--wa-ink); }
.wa-sheet-thumbs { display: flex; gap: 8px; overflow-x: auto; justify-content: center; padding: 3px; }
.wa-thumb { all: unset; cursor: pointer; position: relative; width: 52px; height: 52px; border-radius: 8px; background: var(--wa-in); display: grid; place-items: center; flex: none; box-shadow: 0 0 0 1px var(--wa-line); }
.wa-thumb.on { box-shadow: 0 0 0 3px var(--wa-green); }
.wa-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.wa-thumb span { font-size: 11px; font-weight: 800; color: #475569; }
.wa-thumb i { position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; border-radius: 50%; background: var(--wa-icon); color: #fff; font-style: normal; font-size: 13px; line-height: 18px; text-align: center; display: none; }
.wa-thumb:hover i { display: block; }
.wa-thumb.add svg { width: 20px; height: 20px; fill: none; stroke: var(--wa-icon); stroke-width: 2; }
.wa-dropzone { display: none; position: absolute; inset: 60px 14px 14px; z-index: 9; border: 3px dashed var(--wa-green); border-radius: 14px; background: rgba(217,253,211,.85); place-items: center; font-size: 20px; color: var(--wa-dark); font-weight: 600; pointer-events: none; }
.wa-main.dragging .wa-dropzone { display: grid; }
.poll-opt-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.poll-opt-row small { color: var(--muted); font-size: 12px; width: 38px; text-align: right; flex: none; }
.btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; vertical-align: -2px; }

@media (max-width: 860px) {
  body.chat-focus .topbar { padding: 8px 12px; }
  #waCollapse { display: none; }
  .wa-emoji { grid-template-columns: repeat(8, 36px); }
  .wa-input select { display: none; }
  .wa-bubble-poll { min-width: 0; width: 85%; }
}
@media (max-width: 860px) {
  .wa { grid-template-columns: minmax(0, 1fr); }
  .wa-main { display: none; }
  .wa.has-chat .wa-side { display: none; }
  .wa.has-chat .wa-main { display: flex; }
  .wa-back { display: grid; }
  .wa-msgs { padding: 10px 10px 14px; }
  .wa-bubble { max-width: 85%; }
  .wa-tpl { max-width: 92%; }
}

@media (max-width: 1100px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .sticky { position: static; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 50; left: 0; top: 0; width: 270px; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0,0,0,.2); }
  .side.open { transform: none; }
  .menu-btn { display: grid; }
  .topbar { padding: 12px 16px; }
  .topbar h1 { font-size: 18px; }
  .view { padding: 18px 16px 80px; }
  .btn-row { grid-template-columns: 1fr 1fr; }
  .map-row { grid-template-columns: 1fr; gap: 6px; }
  .contacts-layout { grid-template-columns: 1fr; }
  .group-nav { position: static; }
  .top-actions { flex-wrap: wrap; justify-content: flex-end; }
  .card { padding: 16px; }
}

/* =====================================================================
   2026 refresh: tokens, dark mode, new pages (bot, links, team, panel)
   ===================================================================== */
:root {
  color-scheme: light;
  --bg: #f5f6f8; --surface: #ffffff; --surface-2: #fafbfc; --soft: #f1f3f5; --soft-2: #f7f8fa;
  --line: #e5e8ec; --line-2: #d3d8de; --ink: #0f172a; --ink-2: #334155; --muted: #64748b;
  --brand: #0b7a5c; --brand-2: #12b886; --green: #10b981; --green-d: #047857; --green-l: #e9f8f1;
  --primary: #0f172a; --primary-h: #000; --on-primary: #fff;
  --shadow: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.04);
  --shadow-lg: 0 12px 32px -12px rgba(16,24,40,.18);
  --r: 14px;
  --s1: #2a78d6; --s2: #eb6834;
  --info-bg: #eff6ff; --info-line: #bfdbfe; --info-ink: #1e3a8a;
  --warn-bg: #fffbeb; --warn-line: #fde68a; --warn-ink: #92400e;
  --err-bg: #fef2f2; --err-line: #fecaca; --err-ink: #991b1b;
  --wa-bg: #efeae2; --wa-panel: #f0f2f5; --wa-in: #ffffff; --wa-out: #d9fdd3; --wa-ink: #111b21; --wa-ink-2: #41525d; --wa-sub: #667781;
  --wa-line: #e9edef; --wa-icon: #54656f; --wa-muted: #8696a0; --wa-hover: #f5f6f6; --wa-hover2: #e4e7ea; --wa-input: #ffffff; --wa-secure: #ffeecd;
  --wa-green: #00a884; --wa-dark: #008069; --wa-chip-on: #d9fdd3; --wa-pattern: #000;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0d1117; --surface: #161b22; --surface-2: #1a2029; --soft: #212834; --soft-2: #1a2029;
    --line: #29313c; --line-2: #3a4451; --ink: #e6edf3; --ink-2: #c3ccd6; --muted: #8d99a8;
    --green-d: #34d399; --green-l: rgba(16,185,129,.14);
    --primary: #e6edf3; --primary-h: #fff; --on-primary: #0d1117;
    --shadow: 0 1px 2px rgba(0,0,0,.3); --shadow-lg: 0 16px 40px -12px rgba(0,0,0,.6);
    --s1: #3987e5; --s2: #d95926;
    --info-bg: rgba(59,130,246,.12); --info-line: rgba(59,130,246,.3); --info-ink: #bfdbfe;
    --warn-bg: rgba(245,158,11,.12); --warn-line: rgba(245,158,11,.3); --warn-ink: #fcd34d;
    --err-bg: rgba(239,68,68,.12); --err-line: rgba(239,68,68,.32); --err-ink: #fca5a5;
    --wa-bg: #0b141a; --wa-panel: #202c33; --wa-in: #202c33; --wa-out: #005c4b; --wa-ink: #e9edef; --wa-ink-2: #d1d7db; --wa-sub: #8696a0;
    --wa-line: #2a3942; --wa-icon: #aebac1; --wa-muted: #8696a0; --wa-hover: #202c33; --wa-hover2: #2a3942; --wa-input: #2a3942; --wa-secure: #182229;
    --wa-chip-on: #0a332c; --wa-pattern: #fff;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1117; --surface: #161b22; --surface-2: #1a2029; --soft: #212834; --soft-2: #1a2029;
  --line: #29313c; --line-2: #3a4451; --ink: #e6edf3; --ink-2: #c3ccd6; --muted: #8d99a8;
  --green-d: #34d399; --green-l: rgba(16,185,129,.14);
  --primary: #e6edf3; --primary-h: #fff; --on-primary: #0d1117;
  --shadow: 0 1px 2px rgba(0,0,0,.3); --shadow-lg: 0 16px 40px -12px rgba(0,0,0,.6);
  --s1: #3987e5; --s2: #d95926;
  --info-bg: rgba(59,130,246,.12); --info-line: rgba(59,130,246,.3); --info-ink: #bfdbfe;
  --warn-bg: rgba(245,158,11,.12); --warn-line: rgba(245,158,11,.3); --warn-ink: #fcd34d;
  --err-bg: rgba(239,68,68,.12); --err-line: rgba(239,68,68,.32); --err-ink: #fca5a5;
  --wa-bg: #0b141a; --wa-panel: #202c33; --wa-in: #202c33; --wa-out: #005c4b; --wa-ink: #e9edef; --wa-ink-2: #d1d7db; --wa-sub: #8696a0;
  --wa-line: #2a3942; --wa-icon: #aebac1; --wa-muted: #8696a0; --wa-hover: #202c33; --wa-hover2: #2a3942; --wa-input: #2a3942; --wa-secure: #182229;
  --wa-chip-on: #0a332c; --wa-pattern: #fff;
}

body { background: var(--bg); }
::selection { background: rgba(18,184,134,.25); }
.side { background: var(--surface); border-right-color: var(--line); }
.brand-mark { background: linear-gradient(135deg, var(--brand-2), var(--brand)); box-shadow: 0 6px 16px -6px rgba(11,122,92,.6); }
.side nav a { position: relative; }
.side nav a.active { background: var(--green-l); color: var(--green-d); }
.side nav a.active::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand-2); }
.side nav a.nav-cta { background: var(--primary); color: var(--on-primary); box-shadow: var(--shadow); }
.side nav a.nav-cta:hover { background: var(--primary-h); }
.side nav a.nav-cta.active::before { display: none; }
.nav-label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 14px 12px 4px; }
.nav-badge { margin-left: auto; font-style: normal; background: #25d366; color: #fff; font-size: 11.5px; font-weight: 700; border-radius: 999px; padding: 0 7px; line-height: 19px; }
.nav-badge[hidden] { display: none; }
.side { overflow-y: auto; }
.mode { margin-top: auto; }
.mode.demo { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn-ink); }
.mode.live { background: var(--green-l); border-color: rgba(16,185,129,.35); color: var(--green-d); }
.side-foot { border-top: 1px solid var(--line); margin: 12px -14px -20px; padding: 10px 14px 14px; display: flex; flex-direction: column; gap: 8px; }
.side-tools { display: flex; gap: 4px; }
.side-tools .icon-btn { color: var(--muted); }
.side-tools .icon-btn.on { color: var(--green-d); }
.side-tools .icon-btn[hidden] { display: none; }
.icon-btn:hover { background: var(--soft); }
.me { display: flex; align-items: center; gap: 10px; }
.me-av { width: 34px; height: 34px; border-radius: 50%; background: var(--green-l); color: var(--green-d); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.me-name { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.me-name b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-name small { font-size: 12px; color: var(--muted); }

.topbar { background: color-mix(in srgb, var(--bg) 88%, transparent); border-bottom-color: var(--line); }
.btn { background: var(--surface); border-color: var(--line); box-shadow: var(--shadow); }
.btn:hover { background: var(--soft); }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn-dark { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.btn-dark:hover { background: var(--primary-h); }
.btn-green { background: var(--green); color: #fff; border-color: var(--green); }
.btn-block { width: 100%; padding: 11px 16px; }
.in, select.in, textarea.in { background: var(--surface); border-color: var(--line-2); color: var(--ink); }
.in::placeholder { color: var(--muted); opacity: .8; }
.seg { background: var(--soft); }
.seg button.on { background: var(--surface); color: var(--ink); }
.card, .kpi, .table-wrap, .list-card { background: var(--surface); border-color: var(--line); box-shadow: var(--shadow); }
.kpi { position: relative; overflow: hidden; }
.kpi b { font-weight: 750; }
.t th { background: var(--surface-2); border-bottom-color: var(--line); }
.t td { border-bottom-color: var(--line); }
.t tr.click:hover td { background: var(--soft-2); }
.info-box { background: var(--info-bg); border-color: var(--info-line); color: var(--info-ink); }
.warn-box { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn-ink); }
.err-box { background: var(--err-bg); border-color: var(--err-line); color: var(--err-ink); }
.promo-box { background: var(--warn-bg); border-color: var(--warn-line); }
.detect { background: var(--green-l); border-color: rgba(16,185,129,.3); }
dialog.dlg { background: var(--surface); color: var(--ink); }
dialog.dlg-wide { width: min(780px, calc(100vw - 32px)); }
.toast { background: var(--primary); color: var(--on-primary); box-shadow: var(--shadow-lg); }
.f-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--ink-2); }
.mono { font-family: var(--mono); font-size: 13px; }
.muted { color: var(--muted); }
:root[data-theme="dark"] .b-green, :root[data-theme="dark"] .b-read, :root[data-theme="dark"] .b-approved, :root[data-theme="dark"] .b-completed { background: rgba(16,185,129,.15); color: #6ee7b7; }
:root[data-theme="dark"] .b-blue, :root[data-theme="dark"] .b-delivered, :root[data-theme="dark"] .b-running { background: rgba(59,130,246,.16); color: #93c5fd; }
:root[data-theme="dark"] .b-sent, :root[data-theme="dark"] .b-scheduled, :root[data-theme="dark"] .b-pending { background: rgba(139,92,246,.16); color: #c4b5fd; }
:root[data-theme="dark"] .b-red, :root[data-theme="dark"] .b-failed, :root[data-theme="dark"] .b-rejected, :root[data-theme="dark"] .b-cancelled { background: rgba(239,68,68,.15); color: #fca5a5; }
:root[data-theme="dark"] .b-queued, :root[data-theme="dark"] .b-sending, :root[data-theme="dark"] .b-draft, :root[data-theme="dark"] .b-paused { background: rgba(245,158,11,.15); color: #fcd34d; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .b-green, :root:not([data-theme="light"]) .b-read, :root:not([data-theme="light"]) .b-approved, :root:not([data-theme="light"]) .b-completed { background: rgba(16,185,129,.15); color: #6ee7b7; }
  :root:not([data-theme="light"]) .b-blue, :root:not([data-theme="light"]) .b-delivered, :root:not([data-theme="light"]) .b-running { background: rgba(59,130,246,.16); color: #93c5fd; }
  :root:not([data-theme="light"]) .b-sent, :root:not([data-theme="light"]) .b-scheduled, :root:not([data-theme="light"]) .b-pending { background: rgba(139,92,246,.16); color: #c4b5fd; }
  :root:not([data-theme="light"]) .b-red, :root:not([data-theme="light"]) .b-failed, :root:not([data-theme="light"]) .b-rejected, :root:not([data-theme="light"]) .b-cancelled { background: rgba(239,68,68,.15); color: #fca5a5; }
  :root:not([data-theme="light"]) .b-queued, :root:not([data-theme="light"]) .b-sending, :root:not([data-theme="light"]) .b-draft, :root:not([data-theme="light"]) .b-paused { background: rgba(245,158,11,.15); color: #fcd34d; }
}

/* cards with a title row and an action on the right */
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.card-head > div { min-width: 0; }
.card-head .sub { margin-bottom: 0 !important; color: var(--muted); font-size: 14px; margin-top: 2px; }
.card-head h2 { margin: 0; }
.save-bar { display: flex; justify-content: flex-end; margin-top: 16px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 0 0 18px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { all: unset; cursor: pointer; padding: 10px 14px; font-weight: 600; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--ink); border-bottom-color: var(--brand-2); }

/* on / off switch */
.switch { position: relative; display: inline-block; width: 44px; height: 26px; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: var(--line-2); transition: background .15s; pointer-events: none; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .18s; }
.switch input:checked + i { background: var(--brand-2); }
.switch input:checked + i::after { transform: translateX(18px); }
.switch input:focus-visible + i { outline: 2px solid var(--brand-2); outline-offset: 2px; }
.switch.big { width: 56px; height: 32px; }
.switch.big i::after { width: 26px; height: 26px; }
.switch.big input:checked + i::after { transform: translateX(24px); }

/* ---------- overview ---------- */
.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.hero h2 { font-size: 28px; letter-spacing: -.025em; margin: 0 0 4px; }
.hero .sub { color: var(--muted); margin: 0; max-width: 620px; }
.eyebrow { font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--brand-2); margin: 0 0 6px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.qa { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; width: 92px; padding: 12px 6px 10px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 13px; font-weight: 600; color: var(--ink-2); transition: transform .12s, border-color .12s; }
.qa:hover { transform: translateY(-2px); border-color: var(--brand-2); }
.qa span { font-size: 22px; }
.qa i { position: absolute; top: 6px; right: 8px; font-style: normal; background: #25d366; color: #fff; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 0 6px; line-height: 18px; }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; }
.legend[hidden] { display: none; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 3px; border-radius: 2px; }
.chart { position: relative; width: 100%; height: 240px; }
.chart[hidden] { display: none; }
.chart svg { display: block; width: 100%; height: 240px; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .base { stroke: var(--line-2); stroke-width: 1; }
.chart .ax { fill: var(--muted); font-size: 11.5px; font-family: var(--font); }
.chart .ln { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot, .chart .hov { stroke: var(--surface); stroke-width: 2; }
.chart .lbl { fill: var(--ink-2); font-size: 12px; font-weight: 600; font-family: var(--font); }
.chart .lbl-v { fill: var(--muted); font-weight: 500; }
.chart .cross { stroke: var(--line-2); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart [hidden] { display: none; }
.chart-tip { position: absolute; top: 6px; pointer-events: none; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); border-radius: 10px; padding: 8px 10px; font-size: 12.5px; display: flex; flex-direction: column; gap: 3px; min-width: 150px; z-index: 2; }
.chart-tip span { display: flex; align-items: center; gap: 6px; color: var(--ink-2); }
.chart-tip span b { margin-left: auto; color: var(--ink); }
.chart-tip i { width: 8px; height: 8px; border-radius: 50%; }
.attn { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.attn-row { display: grid; grid-template-columns: 34px 1fr; gap: 2px 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--soft-2); border: 1px solid var(--line); font-size: 14px; color: var(--ink-2); transition: border-color .12s; }
.attn-row:hover { border-color: var(--brand-2); }
.attn-row small { grid-column: 2; color: var(--green-d); font-weight: 600; font-size: 12.5px; }
.attn-ic { grid-row: span 2; width: 34px; height: 34px; border-radius: 10px; background: var(--surface); display: grid; place-items: center; font-size: 17px; border: 1px solid var(--line); }
.all-good { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 26px 10px 14px; }
.all-good span { font-size: 30px; }
.all-good small { color: var(--muted); }
.inbox-item { border-bottom-color: var(--line); }

/* ---------- bot page ---------- */
.bot-hero { background: linear-gradient(135deg, var(--surface) 55%, var(--green-l)); }
.bot-hero-top { display: flex; align-items: flex-start; gap: 14px; }
.bot-hero-top > div { flex: 1; min-width: 0; }
.bot-hero-top h2 { font-size: 19px; }
.bot-hero-top .sub { margin: 4px 0 0 !important; }
.bot-ic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 26px; background: var(--soft); flex: none; filter: grayscale(1); opacity: .7; }
.bot-hero.on .bot-ic { background: var(--green-l); filter: none; opacity: 1; }
.bot-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-top: 18px; }
.bot-stats span { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 12.5px; color: var(--muted); display: flex; flex-direction: column; }
.bot-stats b { font-size: 20px; color: var(--ink); }
.bot-split .tabs { margin-top: 22px; }
.courses { display: flex; flex-direction: column; gap: 10px; }
.course { display: flex; align-items: center; gap: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.course.off { opacity: .6; }
.course-thumb { width: 64px; height: 64px; border-radius: 10px; background: var(--soft); display: grid; place-items: center; font-size: 26px; overflow: hidden; flex: none; }
.course-thumb img { width: 100%; height: 100%; object-fit: cover; }
.course-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.course-body > b { font-size: 15px; }
.course-body > small { color: var(--muted); font-size: 13px; }
.course-meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }
.course-actions { display: flex; align-items: center; gap: 4px; flex: none; }
.course-actions .icon-btn:disabled { opacity: .3; cursor: default; }
.course-form { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 20px; }
.course-img { display: grid; place-items: center; text-align: center; aspect-ratio: 1; border: 2px dashed var(--line-2); border-radius: 12px; cursor: pointer; overflow: hidden; color: var(--muted); background: var(--soft-2); }
.course-img:hover { border-color: var(--brand-2); }
.course-img img { width: 100%; height: 100%; object-fit: cover; }
.course-img span { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px; font-size: 13px; }
.course-img svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; }
.days { display: flex; gap: 6px; flex-wrap: wrap; }
.day input { position: absolute; opacity: 0; pointer-events: none; }
.day span { display: inline-block; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 13px; font-weight: 600; cursor: pointer; color: var(--muted); }
.day input:checked + span { background: var(--green-l); border-color: var(--brand-2); color: var(--green-d); }
.day input:focus-visible + span { outline: 2px solid var(--brand-2); }
.kw { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 10px; background: var(--surface-2); }
.kw-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.qr-list { display: flex; flex-direction: column; }
.qr-item { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.qr-item:last-child { border-bottom: 0; }
.qr-item code { background: var(--soft); border-radius: 6px; padding: 3px 8px; justify-self: start; }
.qr-item span { display: flex; flex-direction: column; min-width: 0; }
.qr-item small { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* test phone */
.sim .phone-in { position: relative; }
.sim .phone-head { position: relative; }
.sim-reset { all: unset; cursor: pointer; margin-left: auto; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; }
.sim-reset:hover { background: rgba(255,255,255,.15); }
.sim-reset svg { width: 17px; height: 17px; fill: none; stroke: #fff; stroke-width: 2; }
.sim .chat { display: flex; flex-direction: column; gap: 4px; background-color: var(--wa-bg); }
.sim-line { display: flex; flex-direction: column; max-width: 86%; }
.sim-line.in { align-self: flex-end; }
.sim-line.out { align-self: flex-start; }
.sim-b { background: var(--wa-in); color: var(--wa-ink); border-radius: 8px; padding: 6px 8px 8px; font-size: 13.5px; line-height: 1.4; box-shadow: 0 1px .5px rgba(0,0,0,.13); white-space: pre-wrap; overflow-wrap: anywhere; }
.sim-line.in .sim-b { background: var(--wa-out); }
.sim-b .wa-meta { margin-top: 4px; }
.sim-h { display: block; margin-bottom: 2px; }
.sim-img { display: block; width: calc(100% + 10px); margin: -3px -5px 6px; border-radius: 6px; max-height: 160px; object-fit: cover; }
.sim-btns { display: flex; flex-direction: column; gap: 3px; margin-top: 3px; }
.sim-btn { all: unset; cursor: pointer; box-sizing: border-box; background: var(--wa-in); color: var(--wa-link); text-align: center; border-radius: 8px; padding: 8px; font-size: 13.5px; font-weight: 500; box-shadow: 0 1px .5px rgba(0,0,0,.13); display: flex; justify-content: center; align-items: center; gap: 6px; }
.sim-btn:hover { filter: brightness(.97); }
.sim-btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }
.sim-note { align-self: center; text-align: center; background: var(--wa-secure); color: var(--wa-ink-2); font-size: 11.5px; padding: 4px 10px; border-radius: 8px; margin: 6px 0; max-width: 92%; }
.sim-chips { display: flex; gap: 6px; overflow-x: auto; padding: 6px 8px 0; background: var(--wa-panel); scrollbar-width: none; flex: none; }
.sim-chips::-webkit-scrollbar { display: none; }
.sim-chips button { all: unset; cursor: pointer; white-space: nowrap; background: var(--wa-in); color: var(--wa-ink); border-radius: 999px; padding: 4px 10px; font-size: 12.5px; border: 1px solid var(--wa-line); }
.sim-compose { display: flex; gap: 6px; padding: 6px 8px 10px; background: var(--wa-panel); flex: none; }
.sim-compose input { all: unset; flex: 1; background: var(--wa-input); color: var(--wa-ink); border-radius: 20px; padding: 9px 14px; font-size: 14px; }
.sim-compose .wa-send { width: 38px; height: 38px; }
.sim-sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: 75%; overflow-y: auto; background: var(--wa-in); color: var(--wa-ink); border-radius: 16px 16px 0 0; box-shadow: 0 -10px 30px rgba(0,0,0,.25); z-index: 3; }
.sim-sheet[hidden] { display: none; }
.sim-sheet header { display: flex; align-items: center; gap: 10px; padding: 12px; border-bottom: 1px solid var(--wa-line); position: sticky; top: 0; background: inherit; }
.sim-sheet header button { all: unset; cursor: pointer; display: grid; }
.sim-sheet header svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; }
.sim-row { all: unset; cursor: pointer; box-sizing: border-box; width: 100%; display: grid; grid-template-columns: 1fr 18px; padding: 10px 14px; border-bottom: 1px solid var(--wa-line); gap: 0 10px; }
.sim-row:hover { background: var(--wa-hover); }
.sim-row b { font-weight: 500; font-size: 14px; }
.sim-row small { grid-column: 1; color: var(--wa-sub); font-size: 12.5px; }
.sim-row i { grid-row: 1 / span 2; grid-column: 2; align-self: center; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--wa-muted); box-sizing: border-box; }

/* ---------- links + QR ---------- */
.links { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 520px), 1fr)); gap: 16px; margin-top: 18px; }
.link-card { display: flex; gap: 18px; margin: 0 !important; }
.link-qr { flex: none; width: 168px; height: 168px; border-radius: 12px; overflow: hidden; background: #fff; border: 1px solid var(--line); }
.link-qr svg { display: block; width: 100%; height: 100%; }
.link-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.link-body h3 { margin: 0; }
.link-body .tag { align-self: flex-start; }
.link-msg { margin: 0; color: var(--ink-2); font-size: 14px; }
.link-url { display: flex; gap: 6px; }
.link-url .in { font-size: 12px; padding: 7px 10px; }
.link-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.link-foot > span:last-child { display: flex; gap: 4px; align-items: center; }
.link-stat { font-size: 13px; color: var(--muted); }
.link-stat b { color: var(--ink); font-size: 15px; }

/* ---------- tags ---------- */
.label-pill { --c: #64748b; all: unset; display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; padding: 3px 10px; border-radius: 999px; color: var(--c); background: color-mix(in srgb, var(--c) 13%, transparent); border: 1px solid color-mix(in srgb, var(--c) 30%, transparent); white-space: nowrap; }
.label-pill.sm { font-size: 11px; padding: 1px 7px; }
.label-pill.toggle { cursor: pointer; opacity: .55; }
.label-pill.toggle:hover { opacity: .85; }
.label-pill.toggle.on { opacity: 1; background: var(--c); color: #fff; }
.label-pill.toggle.on::before { content: "✓"; }
.tag-list { display: flex; flex-direction: column; gap: 8px; }
.tag-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.tag-row .label-pill { margin-right: auto; }
.tag-row input[type=color] { width: 34px; height: 30px; padding: 0; border: 1px solid var(--line-2); border-radius: 8px; background: none; cursor: pointer; }

/* ---------- login ---------- */
body.locked .shell { display: none; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(1200px 500px at 10% -10%, rgba(18,184,134,.18), transparent), var(--bg); }
.login-card { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 32px 28px; box-shadow: var(--shadow-lg); }
.login-card h1 { font-size: 22px; margin: 18px 0 4px; letter-spacing: -.02em; }
.login-card p { color: var(--muted); margin: 0 0 20px; font-size: 14px; }
.login-card .g-btn { display: flex; justify-content: center; min-height: 44px; margin-bottom: 4px; }
.login-or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 14px 0 10px; }
.login-or::before, .login-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.brand-mark.big { width: 52px; height: 52px; border-radius: 16px; color: #fff; }
.brand-mark.big svg { width: 28px; height: 28px; }
.err-box[hidden] { display: none; }

/* ---------- chats: dark-aware colours, contact panel, quick replies, AI ---------- */
.wa { background: var(--surface); color: var(--wa-ink); }
.wa-side { background: var(--surface); }
.wa-main { background-color: var(--wa-bg); }
:root[data-theme="dark"] .wa-main { background-image: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .wa-main { background-image: none; } }
.wa-chip.on { background: var(--wa-chip-on); color: var(--wa-green); }
.wa-row-tags { display: flex; gap: 4px; align-items: center; margin-top: 3px; overflow: hidden; }
.wa-row-tags i { --c: #64748b; font-style: normal; font-size: 10.5px; font-weight: 700; padding: 0 6px; border-radius: 4px; line-height: 16px; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); white-space: nowrap; }
.wa-assignee { margin-left: auto; width: 18px; height: 18px; border-radius: 50%; background: var(--soft); color: var(--ink-2); font-size: 9px; display: grid; place-items: center; flex: none; }
.wa-head-tags { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; max-width: 30%; overflow: hidden; max-height: 22px; }
.wa-botpill { all: unset; cursor: pointer; font-size: 12.5px; font-weight: 600; padding: 5px 10px; border-radius: 999px; background: var(--wa-chip-on); color: var(--wa-green); white-space: nowrap; }
.wa-botpill.paused { background: var(--warn-bg); color: var(--warn-ink); }
.wa-botpill[hidden] { display: none; }
.wa-icon.on { background: var(--wa-hover2); color: var(--wa-green); }
.wa { grid-template-columns: minmax(300px, 420px) minmax(0, 1fr) 0; }
.wa.panel-open { grid-template-columns: minmax(280px, 380px) minmax(0, 1fr) minmax(280px, 340px); }
@media (min-width: 861px) { .wa.collapsed.panel-open { grid-template-columns: 76px minmax(0, 1fr) minmax(280px, 340px); } .wa.collapsed { grid-template-columns: 76px minmax(0, 1fr) 0; } }
.wa-panel { display: none; min-width: 0; min-height: 0; flex-direction: column; border-left: 1px solid var(--wa-line); background: var(--wa-panel); }
.wa.panel-open .wa-panel { display: flex; }
.wa-panel > header { display: flex; align-items: center; justify-content: space-between; padding: 12px 10px 12px 18px; background: var(--surface); border-bottom: 1px solid var(--wa-line); }
.wa-panel-body { overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 8px 0; }
.wa-card { background: var(--surface); padding: 14px 18px; display: flex; flex-direction: column; gap: 8px; }
.wa-card h4 { margin: 0; font-size: 13px; font-weight: 600; color: var(--wa-sub); display: flex; justify-content: space-between; }
.wa-card h4 small { font-weight: 400; }
.wa-who { align-items: center; text-align: center; padding: 22px 18px; }
.wa-who > b { font-size: 18px; font-weight: 500; }
.wa-who .mono { color: var(--wa-sub); }
.wa-taglist { display: flex; gap: 6px; flex-wrap: wrap; }
.wa-notes { display: flex; flex-direction: column; gap: 8px; max-height: 260px; overflow-y: auto; }
.wa-note { background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: 10px; padding: 8px 10px; }
.wa-note p { margin: 0 0 4px; font-size: 13.5px; white-space: pre-wrap; color: var(--ink); }
.wa-note small { color: var(--muted); font-size: 11.5px; display: flex; align-items: center; gap: 4px; }
.wa-note-x { all: unset; cursor: pointer; margin-left: auto; padding: 0 4px; border-radius: 4px; }
.wa-note-x:hover { background: var(--soft); }
.wa-note-form { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.wa-note-form textarea { min-height: 0; }
.wa-dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0; font-size: 13.5px; }
.wa-dl dt { color: var(--wa-sub); }
.wa-dl dd { margin: 0; overflow-wrap: anywhere; }
.wa-quick { left: 12px; right: 12px; padding: 4px; max-height: 300px; overflow-y: auto; }
.wa-quick-head { display: flex; justify-content: space-between; font-size: 12px; font-weight: 600; color: var(--wa-sub); padding: 6px 10px; }
.wa-quick-head a { color: var(--wa-green); }
.wa-quick-item { all: unset; cursor: pointer; box-sizing: border-box; width: 100%; display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 10px; align-items: center; padding: 8px 10px; border-radius: 9px; }
.wa-quick-item:hover, .wa-quick-item.on { background: var(--wa-hover2); }
.wa-quick-item code { color: var(--wa-green); font-size: 12.5px; }
.wa-quick-item span { display: flex; flex-direction: column; min-width: 0; }
.wa-quick-item b { font-weight: 500; font-size: 14px; }
.wa-quick-item small { color: var(--wa-sub); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-ai { font-size: 17px; }
.wa-ai.busy { animation: waSpin 1s linear infinite; }
@keyframes waSpin { to { transform: rotate(360deg); } }
.wa-ai-note { display: flex; align-items: center; gap: 8px; background: color-mix(in srgb, #8b5cf6 12%, var(--wa-panel)); color: var(--wa-ink); font-size: 13px; padding: 7px 10px 7px 16px; border-top: 1px solid var(--wa-line); }
.wa-ai-note button { all: unset; cursor: pointer; margin-left: auto; display: grid; }
.wa-ai-note svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.wa-by { display: block; font-size: 11.5px; font-weight: 600; color: var(--wa-green); margin-bottom: 2px; }
.wa-by.bot { color: #8b5cf6; }
.wa-ihead { display: block; margin-bottom: 2px; }
.wa-line.wa-out { flex-direction: column; align-items: flex-end; }
.wa-ibtns { display: flex; flex-direction: column; gap: 2px; margin-top: 2px; min-width: 200px; max-width: min(65%, 560px); }
.wa-ibtns span { background: var(--wa-out); color: var(--wa-link); text-align: center; border-radius: 7.5px; padding: 7px 10px; font-size: 14px; box-shadow: 0 1px .5px rgba(11,20,26,.13); display: flex; justify-content: center; align-items: center; gap: 6px; }
.wa-ibtns svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }
.wa-window { background: var(--warn-bg); color: var(--warn-ink); border-top-color: var(--warn-line); }
.wa-fail { background: var(--err-bg); color: var(--err-ink); }
.wa-av-badge { border-color: var(--surface); }
.msg, .ccard { color: #111b21; }
:root[data-theme="dark"] .msg, :root[data-theme="dark"] .ccard { color: var(--wa-ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .msg, :root:not([data-theme="light"]) .ccard { color: var(--wa-ink); } }
.wa-tpl .msg { background: var(--wa-out); }
.wa-poll-check { border-color: var(--wa-muted); }

@media (max-width: 1200px) { .wa.panel-open { grid-template-columns: minmax(260px, 320px) minmax(0, 1fr) minmax(260px, 300px); } }
@media (max-width: 860px) {
  .wa, .wa.panel-open { grid-template-columns: minmax(0, 1fr); }
  .wa.panel-open .wa-panel { position: absolute; inset: 0; z-index: 12; }
  .wa { position: relative; }
  .wa-head-tags { display: none; }
  .hero h2 { font-size: 22px; }
  .qa { width: 74px; }
  .course { flex-wrap: wrap; }
  .course-actions { width: 100%; justify-content: flex-end; }
  .course-form { grid-template-columns: 1fr; }
  .course-img { aspect-ratio: 16 / 9; }
  .link-card { flex-direction: column; }
  .link-qr { align-self: center; }
  .qr-item { grid-template-columns: 1fr; gap: 4px; }
  .side-foot { margin-bottom: -20px; }
}

/* contact panel: add / edit tags in place */
.wa-tag-acts { display: inline-flex; gap: 10px; }
.wa-linkbtn { all: unset; cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--wa-link); }
.wa-linkbtn:hover { text-decoration: underline; }
.wa-linkbtn:focus-visible, .wa-swatch:focus-visible { outline: 2px solid var(--wa-link); outline-offset: 2px; border-radius: 4px; }
.wa-tag-form { display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1px solid var(--wa-line); border-radius: 10px; }
.wa-swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.wa-swatch { all: unset; cursor: pointer; width: 22px; height: 22px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 2px color-mix(in srgb, #000 12%, transparent); }
.wa-swatch.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--c); }
.wa-tag-form-foot { display: flex; justify-content: flex-end; gap: 6px; }
.wa-tag-edits { display: flex; flex-direction: column; gap: 6px; }
.wa-tag-edit { display: flex; align-items: center; gap: 8px; }
.wa-tag-edit .in { flex: 1; min-width: 0; padding: 6px 10px; }
.wa-tag-edit input[type="color"] { width: 28px; height: 28px; padding: 0; border: none; background: none; cursor: pointer; flex: none; }
.wa-tag-edit .wa-note-x { font-size: 18px; line-height: 1; color: var(--wa-sub); }

/* ---------- chats board (kanban by stage) ---------- */
.wa-board { display: none; }
.wa.mode-board { grid-template-columns: minmax(0, 1fr); }
.wa.mode-board .wa-side { display: none; }
.wa.mode-board .wa-board { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--soft-2); }
.wa.mode-board:not(.has-chat) .wa-main, .wa.mode-board:not(.has-chat) .wa-panel { display: none; }
.wa.mode-board.has-chat { grid-template-columns: minmax(0, 1fr) minmax(380px, 520px); }
.wa.mode-board.has-chat.panel-open { grid-template-columns: minmax(0, 1fr) minmax(360px, 460px) minmax(260px, 320px); }
.wa.mode-board .wa-main { border-left: 1px solid var(--wa-line); }
.wa.mode-board .wa-back { display: grid; }
.wa.mode-board .wa-msgs { padding-left: 4%; padding-right: 4%; }
.wa.mode-board .wa-bubble { max-width: 82%; }
.wa.mode-board .wa-head-tags { display: none; }

.kb-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px 6px; flex: none; }
.kb-title { font-size: 22px; letter-spacing: -.01em; }
.kb-search { flex: 1; max-width: 420px; margin: 0 0 0 auto; background: var(--surface); border: 1px solid var(--line); }
.kb-seg { display: inline-flex; background: var(--soft); border-radius: 9px; padding: 3px; margin-left: 4px; }
.kb-seg button { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--muted); }
.kb-seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); cursor: default; }
.kb-seg button:not(.on):hover { color: var(--ink); }
.kb-seg svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.kb-seg button:focus-visible, .kb-tile:focus-visible, .kb-card:focus-visible, .kb-more:focus-visible, .kb-sub button:focus-visible, .kb-stagepill:focus-visible, .kb-menu button:focus-visible { outline: 2px solid var(--wa-link); outline-offset: 2px; }
.kb-chips { padding: 6px 16px 10px; }

.kb-summary { flex: none; padding: 0 16px 12px; display: flex; flex-direction: column; gap: 8px; }
.kb-tiles { display: grid; grid-template-columns: repeat(6, minmax(120px, 1fr)); gap: 8px; }
.kb-tile { all: unset; cursor: pointer; box-sizing: border-box; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; position: relative; overflow: hidden; transition: border-color .15s, transform .1s; }
.kb-tile::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--c); }
.kb-tile:hover { border-color: color-mix(in srgb, var(--c) 55%, var(--line)); }
.kb-tile:active { transform: scale(.98); }
.kb-tile-name { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kb-tile b { font-size: 26px; line-height: 1.15; font-weight: 700; letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.kb-tile small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kb-tile small.hot { color: #1fa855; font-weight: 600; }
.kb-bar { display: flex; gap: 2px; height: 6px; border-radius: 999px; overflow: hidden; background: var(--soft); }
.kb-bar i { background: var(--c, transparent); min-width: 4px; }
.kb-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; display: inline-block; }

.kb-cols { flex: 1; min-height: 0; display: flex; gap: 12px; padding: 0 16px 16px; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x proximity; }
.kb-col { flex: 0 0 286px; display: flex; flex-direction: column; min-height: 0; background: color-mix(in srgb, var(--c) 6%, var(--soft)); border: 1px solid transparent; border-radius: 14px; scroll-snap-align: start; transition: border-color .15s, background .15s, box-shadow .3s; }
.kb-col.over { border-color: var(--c); background: color-mix(in srgb, var(--c) 14%, var(--soft)); }
.kb-col.flash { animation: kbFlash 1.1s ease-out; }
@keyframes kbFlash { 0% { box-shadow: 0 0 0 3px var(--c); } 100% { box-shadow: 0 0 0 3px transparent; } }
.kb-col-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px 8px; font-size: 14px; }
.kb-col-head b { font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kb-count { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--muted); background: var(--surface); border-radius: 999px; padding: 1px 8px; font-variant-numeric: tabular-nums; }
.kb-sub { display: flex; gap: 4px; padding: 0 10px 6px; }
.kb-sub button { all: unset; cursor: pointer; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; color: var(--muted); display: inline-flex; gap: 5px; align-items: center; }
.kb-sub button i { font-style: normal; font-size: 11px; opacity: .8; }
.kb-sub button:hover { background: var(--surface); }
.kb-sub button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.kb-cards { flex: 1; min-height: 60px; overflow-y: auto; padding: 2px 8px 10px; display: flex; flex-direction: column; gap: 8px; }
.kb-empty { margin: 8px 6px; padding: 18px 12px; border: 1.5px dashed color-mix(in srgb, var(--c) 35%, var(--line)); border-radius: 10px; text-align: center; font-size: 12.5px; color: var(--muted); }
.kb-cols.is-dragging .kb-empty { border-color: var(--c); }

.kb-card { position: relative; flex: none; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; padding: 10px 10px 10px 12px; cursor: grab; display: flex; flex-direction: column; gap: 6px; box-shadow: 0 1px 2px rgba(15,23,42,.04); transition: box-shadow .15s, border-color .15s, opacity .15s; user-select: none; color: var(--wa-ink); }
.kb-card:hover { border-color: color-mix(in srgb, var(--c) 45%, var(--line)); box-shadow: 0 4px 14px rgba(15,23,42,.08); }
.kb-card.on { border-color: var(--c); box-shadow: 0 0 0 1px var(--c); }
.kb-card.unread::before { content: ""; position: absolute; left: -1px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: #25d366; }
.kb-card.dragging { opacity: .4; }
.kb-card:active { cursor: grabbing; }
.kb-card-top { display: flex; align-items: center; gap: 9px; min-width: 0; }
.kb-card-who { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.kb-card-who b { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kb-card-who small { font-size: 11.5px; color: var(--wa-sub); }
.kb-card-who small.unread { color: #1fa855; font-weight: 600; }
.kb-card .wa-av { font-size: 13px; }
.kb-more { all: unset; cursor: pointer; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; color: var(--wa-icon); flex: none; margin: -4px -4px 0 0; }
.kb-more:hover, .kb-more[aria-expanded=true] { background: var(--soft); color: var(--ink); }
.kb-more svg { width: 18px; height: 18px; }
.kb-prev { margin: 0; font-size: 13px; line-height: 1.4; color: var(--wa-sub); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.kb-prev .ticks { vertical-align: -2px; margin-right: 2px; }
.kb-card-foot { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.kb-tag, .kb-rec { --c: #64748b; font-style: normal; font-size: 10.5px; font-weight: 700; padding: 0 6px; border-radius: 4px; line-height: 17px; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); white-space: nowrap; }
.kb-rec { --c: #0d9488; }
.kb-foot-end { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; }
.kb-foot-end .wa-assignee { margin: 0; }
.wa-row-tags .wa-stage-tag::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--c); margin-right: 4px; vertical-align: 1px; }

.kb-stagepill { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 5px 10px; border-radius: 999px; white-space: nowrap; color: var(--wa-ink); background: color-mix(in srgb, var(--c) 14%, transparent); border: 1px solid color-mix(in srgb, var(--c) 35%, transparent); }
.kb-stagepill:hover { background: color-mix(in srgb, var(--c) 22%, transparent); }
.kb-stagepill[hidden] { display: none; }

.kb-menu { position: fixed; z-index: 60; min-width: 250px; max-width: calc(100vw - 16px); background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 36px rgba(15,23,42,.18); padding: 6px; animation: kbMenuIn .12s ease-out; }
@keyframes kbMenuIn { from { opacity: 0; transform: translateY(-4px); } }
.kb-menu-head { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 6px 10px 4px; }
.kb-menu button { all: unset; cursor: pointer; box-sizing: border-box; width: 100%; display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; font-size: 14px; }
.kb-menu button:hover, .kb-menu button:focus-visible { background: var(--soft); }
.kb-menu button[aria-checked=true] { background: color-mix(in srgb, var(--c) 12%, transparent); }
.kb-menu button span { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.kb-menu button b { font-weight: 600; }
.kb-menu button small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kb-menu button em { font-style: normal; font-weight: 700; color: var(--c); width: 14px; text-align: center; }
.kb-menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }
.kb-menu-note { font-size: 12px; color: var(--muted); padding: 6px 10px 2px; }

@media (prefers-reduced-motion: reduce) { .kb-col.flash, .kb-menu { animation: none; } .kb-tile, .kb-card { transition: none; } }
@media (max-width: 1200px) {
  .wa.mode-board { position: relative; }
  .wa.mode-board.has-chat.panel-open { grid-template-columns: minmax(0, 1fr) minmax(340px, 420px); }
  .wa.mode-board.has-chat.panel-open .wa-panel { position: absolute; right: 0; top: 0; bottom: 0; width: 320px; z-index: 12; box-shadow: -8px 0 24px rgba(15,23,42,.12); }
}
@media (max-width: 1100px) { .kb-tiles { display: flex; overflow-x: auto; scrollbar-width: none; } .kb-tile { flex: 0 0 140px; padding: 8px 11px; } .kb-tile b { font-size: 22px; } }
@media (max-width: 860px) {
  .wa.mode-board, .wa.mode-board.has-chat, .wa.mode-board.has-chat.panel-open { grid-template-columns: minmax(0, 1fr); }
  .wa.mode-board.has-chat .wa-board { display: none; }
  .wa.mode-board .wa-main { border-left: 0; }
  .kb-head { flex-wrap: wrap; padding: 10px 12px 4px; }
  .kb-search { order: 3; flex-basis: 100%; max-width: none; margin: 0; }
  .kb-seg span { display: none; }
  .kb-tiles { display: flex; overflow-x: auto; scrollbar-width: none; }
  .kb-tile { flex: 0 0 132px; }
  .kb-summary, .kb-chips { padding-left: 12px; padding-right: 12px; }
  .kb-cols { padding: 0 12px 12px; gap: 10px; scroll-snap-type: x mandatory; }
  .kb-col { flex-basis: min(86vw, 320px); }
}
