@font-face { font-family: 'AHN'; src: url(/fonts/ahn-400.woff2) format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'AHN'; src: url(/fonts/ahn-400i.woff2) format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'AHN'; src: url(/fonts/ahn-600.woff2) format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'AHN'; src: url(/fonts/ahn-700.woff2) format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }

/* Tokens — verde máscara de solda (PCB), cinza de bancada, cor por atendente */
:root {
  --ink: #18212b;
  --ink-2: #4a5664;
  --ink-3: #7b8796;
  --canvas: #e5e9ec;
  --field: #f3f5f7;
  --panel: #ffffff;
  --line: #d3d9df;
  --line-2: #e7ebee;
  --chat-bg: #eef1f3;
  --hover: #f4f6f8;
  --active: #e8f1ed;
  --brand: #0e5e44;
  --brand-2: #0a4a35;
  --brand-soft: #dceee5;
  --out: #d9ede3;
  --in: #ffffff;
  --note: #fff1bd;
  --note-line: #d9b84a;
  --danger: #b42318;
  --warn: #9a4a00;
  --focus: #2f6fed;
  --read: #1d6fd8;
  --font: 'AHN', 'Atkinson Hyperlegible', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --side-w: 360px;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font: 15px/1.45 var(--font); color: var(--ink); background: var(--canvas); -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
a { color: var(--brand); }
svg { display: block; }

/* ---------- botões ---------- */
.btn { height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-2); }
.btn.danger { color: var(--danger); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13.5px; }
.btn.block { width: 100%; height: 42px; }
.btn:disabled { opacity: .55; cursor: default; }
.link { border: 0; background: none; padding: 0; color: var(--brand); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.icon-btn { width: 40px; height: 40px; border-radius: 10px; border: 0; background: none; color: var(--ink-2); display: grid; place-items: center; flex: none; }
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.icon-btn svg { width: 22px; height: 22px; }

/* ---------- login ---------- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(380px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 28px; display: grid; gap: 14px; }
.login-brand { display: flex; gap: 12px; align-items: center; margin-bottom: 6px; }
.login-brand strong { display: block; font-size: 22px; letter-spacing: -0.01em; }
.login-brand span { color: var(--ink-2); font-size: 14px; }
label { display: grid; gap: 5px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
input:not([type=checkbox]):not([type=radio]), select, textarea.field { height: 40px; border: 1px solid var(--line); border-radius: 8px; padding: 0 12px; background: var(--field); font-weight: 400; color: var(--ink); width: 100%; }
textarea.field { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: -1px; background: #fff; }
.form-err { color: var(--danger); font-size: 14px; margin: 0; }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: var(--side-w) 1fr; height: 100dvh; }
.side { display: flex; flex-direction: column; min-height: 0; background: var(--panel); border-right: 1px solid var(--line); }
.main { display: flex; min-width: 0; min-height: 0; background: var(--chat-bg); position: relative; }

.side-head { height: 60px; flex: none; display: flex; align-items: center; justify-content: space-between; padding: 0 10px 0 18px; border-bottom: 1px solid var(--line-2); }
.brand { display: flex; align-items: center; gap: 10px; font-size: 18px; letter-spacing: -0.01em; }
.conn { width: 10px; height: 10px; border-radius: 50%; background: var(--ink-3); }
.conn.ok { background: #1f9d6b; }
.conn.wait { background: #d99a00; }
.conn.bad { background: var(--danger); }
.side-actions { display: flex; align-items: center; gap: 4px; }
.me-btn { height: 36px; border: 1px solid var(--line); background: var(--panel); border-radius: 18px; padding: 0 12px 0 8px; display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; max-width: 160px; }
.me-btn span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--agent, var(--ink-3)); flex: none; }

.dd { position: relative; }
.dd-menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; min-width: 220px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 6px; box-shadow: 0 10px 30px rgba(24, 33, 43, .14); display: grid; }
.dd-menu.right { left: auto; right: 0; }
.dd-menu button { text-align: left; border: 0; background: none; padding: 9px 10px; border-radius: 6px; font-size: 14.5px; display: flex; gap: 10px; align-items: center; }
.dd-menu button:hover { background: var(--hover); }
.dd-menu hr { border: 0; border-top: 1px solid var(--line-2); margin: 4px 2px; }
.dd-menu .muted { color: var(--ink-3); font-size: 13px; padding: 6px 10px 2px; }

.wa-banner { margin: 10px 12px 0; padding: 10px 12px; border-radius: 8px; background: #fff4e0; border: 1px solid #f0cf94; color: #6b3c00; font-size: 14px; display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.wa-banner.bad { background: #fdecea; border-color: #f2b8b2; color: #7a1a12; }

.tabs { display: flex; padding: 6px 8px 0; border-bottom: 1px solid var(--line-2); flex: none; }
.tab { flex: 1; border: 0; background: none; padding: 10px 2px 9px; font-weight: 600; font-size: 13.5px; color: var(--ink-2); border-bottom: 2px solid transparent; display: flex; gap: 6px; justify-content: center; align-items: center; }
.tab:hover { color: var(--ink); }
.tab[aria-selected=true] { color: var(--ink); border-bottom-color: var(--brand); }
.tab .n { font-variant-numeric: tabular-nums; color: var(--ink-3); font-size: 12.5px; }
.tab .n.hot { color: #fff; background: var(--brand); border-radius: 9px; padding: 0 6px; min-width: 18px; line-height: 18px; }

.search { padding: 10px 12px 8px; flex: none; }
.search input { height: 38px; }
.search-msgs { flex: none; max-height: 45%; overflow-y: auto; border-bottom: 1px solid var(--line); background: var(--field); }
.search-msgs .sm-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 14px; font-size: 13px; color: var(--ink-2); font-weight: 600; }
.sm-item { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 14px; border-top: 1px solid var(--line-2); }
.sm-item:hover { background: var(--panel); }
.sm-item b { font-size: 14px; }
.sm-item span { display: block; color: var(--ink-2); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sm-item mark { background: #ffe58a; color: inherit; }

/* lista: faixa colorida = atendente; faixa hachurada = fila (sem dono) */
.chat-list { flex: 1; overflow-y: auto; min-height: 0; }
.ci { position: relative; display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: center; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line-2); background: none; padding: 10px 14px 10px 18px; }
.ci::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--agent, transparent); }
.ci.queue::before { background: repeating-linear-gradient(-45deg, #8a96a5 0 3px, transparent 3px 6px); }
.ci.closed { opacity: .82; }
.ci:hover { background: var(--hover); }
.ci.active { background: var(--active); }
.ci-body { min-width: 0; display: grid; gap: 1px; }
.ci-top, .ci-mid { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; min-width: 0; }
.ci-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ci time { font-size: 12.5px; color: var(--ink-3); flex: none; font-variant-numeric: tabular-nums; }
.ci.unread time { color: var(--brand); font-weight: 600; }
.ci-prev { color: var(--ink-2); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ci-who { font-size: 12.5px; font-weight: 600; color: var(--agent, var(--ink-3)); }
.ci.queue .ci-who { color: var(--ink-3); }
.badge { flex: none; background: var(--brand); color: #fff; border-radius: 10px; font-size: 12px; font-weight: 700; min-width: 20px; height: 20px; padding: 0 6px; display: inline-grid; place-items: center; font-variant-numeric: tabular-nums; }
.avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 15px; background: #dfe5ea; color: var(--ink-2); flex: none; }
.list-empty { padding: 28px 20px; color: var(--ink-2); font-size: 14.5px; display: grid; gap: 12px; justify-items: start; }
.list-more { padding: 12px; text-align: center; color: var(--ink-3); font-size: 13px; }

/* ---------- área da conversa ---------- */
.empty { margin: auto; text-align: center; color: var(--ink-2); display: grid; gap: 12px; justify-items: center; padding: 24px; }
.empty p { margin: 0; font-size: 16px; }
.chat { display: flex; flex-direction: column; flex: 1; min-width: 0; min-height: 0; position: relative; }
.chat-head { height: 64px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 14px 0 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
.chat-head .back { display: none; }
.ch-id { min-width: 0; flex: 1; }
.ch-name { border: 0; background: none; padding: 0; font-weight: 700; font-size: 16.5px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; display: block; }
.ch-name:hover { text-decoration: underline; text-decoration-color: var(--line); }
.ch-sub { color: var(--ink-2); font-size: 13.5px; display: flex; gap: 10px; align-items: baseline; font-variant-numeric: tabular-nums; }
.owner { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; font-size: 13.5px; padding: 5px 11px; border-radius: 999px; background: color-mix(in srgb, var(--agent) 11%, #fff); color: var(--agent); white-space: nowrap; }
.owner i { width: 9px; height: 9px; border-radius: 50%; background: var(--agent); }
.owner.queue { --agent: #5d6977; background: repeating-linear-gradient(-45deg, #eef1f4 0 4px, #e3e8ec 4px 8px); }
.owner.closed { --agent: #5d6977; background: #eef1f4; }
.ch-actions { display: flex; gap: 6px; align-items: center; }
.typing { height: 0; overflow: visible; position: relative; z-index: 2; }
.typing span { position: absolute; left: 16px; top: 6px; font-size: 12.5px; color: var(--ink-2); background: var(--panel); border: 1px solid var(--line-2); padding: 2px 10px; border-radius: 10px; }

.msgs { flex: 1; overflow-y: auto; padding: 14px clamp(12px, 5%, 64px) 12px; display: flex; flex-direction: column; min-height: 0; }
.msgs .loading, .msgs .more { align-self: center; color: var(--ink-3); font-size: 13.5px; padding: 8px; }
.day { align-self: center; margin: 14px 0 6px; position: sticky; top: 0; z-index: 1; }
.day span { display: inline-block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); background: var(--panel); border: 1px solid var(--line-2); padding: 3px 10px; border-radius: 6px; }

.msg { display: flex; align-items: flex-start; gap: 4px; max-width: min(76%, 640px); margin-top: 3px; }
.msg.in { align-self: flex-start; }
.msg.out, .msg.note { align-self: flex-end; flex-direction: row-reverse; }
.msg.flash .bubble { outline: 2px solid var(--focus); }
.bubble { position: relative; padding: 6px 10px 5px; border-radius: 10px; background: var(--in); box-shadow: 0 1px 0 rgba(24, 33, 43, .09); min-width: 86px; overflow-wrap: anywhere; }
.msg.in .bubble { border-top-left-radius: 3px; }
.msg.out .bubble { background: var(--out); border-top-right-radius: 3px; }
.msg.note .bubble { background: var(--note); border: 1px dashed var(--note-line); box-shadow: none; }
.msg.failed .bubble { box-shadow: inset 0 0 0 1px var(--danger); }
.who { font-size: 12.5px; font-weight: 700; margin-bottom: 1px; color: var(--ink-2); display: flex; gap: 6px; align-items: baseline; }
.tag { font-size: 11px; font-weight: 700; color: var(--ink-2); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; }
.txt code { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 13.5px; background: rgba(24, 33, 43, .06); padding: 1px 4px; border-radius: 4px; }
.txt.muted { color: var(--ink-3); font-style: italic; }
.meta { display: flex; justify-content: flex-end; gap: 6px; align-items: center; font-size: 11.5px; color: var(--ink-3); margin-top: 1px; font-variant-numeric: tabular-nums; }
.meta .del { color: var(--danger); }
.tick svg { width: 16px; height: 16px; }
.tick.read { color: var(--read); }
.tick.err { color: var(--danger); font-weight: 700; font-size: 13px; }
.react { position: absolute; bottom: -12px; right: 8px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 10px; padding: 0 5px; font-size: 13px; }
.msg.in .react { right: auto; left: 8px; }
.msg:has(.react) { margin-bottom: 10px; }
.quote { display: block; width: 100%; text-align: left; border: 0; border-left: 3px solid var(--brand); background: rgba(24, 33, 43, .05); border-radius: 4px; padding: 4px 8px; margin: 2px 0 4px; font-size: 13.5px; color: var(--ink-2); max-height: 4.5em; overflow: hidden; }
.media { display: block; max-width: 100%; border-radius: 6px; margin: 2px 0 4px; }
.media img { display: block; max-width: min(320px, 100%); max-height: 360px; border-radius: 6px; }
video.media { max-width: min(360px, 100%); max-height: 360px; background: #000; }
.sticker { width: 140px; height: 140px; object-fit: contain; }
.audio { display: flex; align-items: center; gap: 8px; }
.audio audio { width: min(300px, 62vw); height: 40px; }
.audio .dur { font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.doc { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; background: rgba(24, 33, 43, .05); text-decoration: none; color: var(--ink); margin: 2px 0 4px; min-width: 220px; }
.doc svg { width: 28px; height: 28px; color: var(--ink-2); flex: none; }
.doc b { display: block; font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.doc small { color: var(--ink-3); font-size: 12.5px; }
.loc { display: grid; text-decoration: none; padding: 4px 0; }
.loc small { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.contact-card { display: grid; gap: 6px; }
.contact-card .row { display: flex; gap: 8px; align-items: center; font-variant-numeric: tabular-nums; }
.unavail { color: var(--ink-3); font-style: italic; font-size: 14px; }

/* transcrição: recuo com fio verde, legível como texto corrido */
.tr { margin-top: 6px; padding: 6px 10px 5px; border-left: 3px solid var(--brand); background: rgba(255, 255, 255, .72); border-radius: 0 6px 6px 0; font-size: 14.5px; max-width: 420px; }
.msg.in .tr { background: var(--chat-bg); }
.tr-cap { font-size: 11.5px; color: var(--ink-3); margin-top: 3px; }
.tr.wait { color: var(--ink-2); font-style: italic; border-left-style: dashed; }
.tr.err { color: var(--danger); border-left-color: var(--danger); }
.tr.none { border: 0; background: none; padding: 2px 0 0; }

.sys { align-self: center; margin: 8px 0; display: flex; gap: 8px; align-items: baseline; font-size: 12.5px; color: var(--ink-2); text-align: center; max-width: 80%; }
.sys time { color: var(--ink-3); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.sys.call span { color: var(--warn); font-weight: 600; }

.msg-actions { display: flex; flex-direction: column; gap: 2px; opacity: 0; transition: opacity .12s; padding-top: 2px; }
.msg:hover .msg-actions, .msg:focus-within .msg-actions { opacity: 1; }
.msg-actions button { width: 28px; height: 28px; border: 0; border-radius: 6px; background: transparent; color: var(--ink-3); display: grid; place-items: center; }
.msg-actions button:hover { background: var(--panel); color: var(--ink); }
.msg-actions svg { width: 16px; height: 16px; }

.drop-hint { position: absolute; inset: 64px 0 0; background: rgba(14, 94, 68, .1); border: 2px dashed var(--brand); display: grid; place-items: center; font-weight: 700; color: var(--brand); z-index: 5; pointer-events: none; font-size: 18px; }

/* ---------- compositor ---------- */
.composer { flex: none; background: var(--panel); border-top: 1px solid var(--line); padding: 8px 12px 8px; position: relative; }
.comp-row { display: flex; gap: 6px; align-items: flex-end; }
#text { flex: 1; resize: none; min-height: 42px; max-height: 180px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--field); line-height: 1.4; }
#text:focus { background: #fff; outline: 2px solid var(--focus); outline-offset: -1px; }
.composer.note #text { background: var(--note); border-color: var(--note-line); }
.send { height: 42px; width: 46px; border-radius: 10px; border: 0; background: var(--brand); color: #fff; display: grid; place-items: center; flex: none; }
.send:hover { background: var(--brand-2); }
.send svg { width: 20px; height: 20px; }
.send:disabled { opacity: .6; }
.composer.note .send { background: #8a6d00; }
.comp-opts { display: flex; gap: 18px; align-items: center; font-size: 13px; color: var(--ink-2); padding: 6px 4px 0; flex-wrap: wrap; }
.chk { display: inline-flex; gap: 6px; align-items: center; font-weight: 600; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.chk input { width: 16px; height: 16px; accent-color: var(--brand); margin: 0; }
.hint { margin-left: auto; color: var(--ink-3); }
.owner-bar { display: flex; gap: 10px; align-items: center; justify-content: space-between; font-size: 13.5px; color: var(--ink-2); padding: 2px 4px 8px; }
.owner-bar b { color: var(--agent, var(--ink)); }
.reply-bar, .rec-bar { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 6px 10px; margin-bottom: 8px; border-left: 3px solid var(--brand); background: var(--field); border-radius: 0 8px 8px 0; font-size: 13.5px; color: var(--ink-2); }
.reply-bar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-bar { border-left-color: var(--danger); }
.rec-bar .rec { color: var(--danger); font-weight: 700; font-variant-numeric: tabular-nums; display: flex; gap: 8px; align-items: center; }
.rec-bar .rec i { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .25; } }
.file-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.chip { display: flex; gap: 8px; align-items: center; padding: 4px 6px 4px 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--field); font-size: 13px; max-width: 260px; }
.chip img { width: 36px; height: 36px; object-fit: cover; border-radius: 5px; }
.chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip button { border: 0; background: none; color: var(--ink-3); width: 22px; height: 22px; display: grid; place-items: center; }
.qr-pop { position: absolute; left: 60px; right: 60px; bottom: calc(100% - 4px); background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(24, 33, 43, .14); max-height: 280px; overflow-y: auto; padding: 4px; z-index: 10; }
.qr-item { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 6px; }
.qr-item[aria-selected=true], .qr-item:hover { background: var(--active); }
.qr-item b { font-size: 13.5px; }
.qr-item span { display: block; color: var(--ink-2); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- modal / toast ---------- */
.modal { position: fixed; inset: 0; background: rgba(24, 33, 43, .42); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal-card { background: var(--panel); border-radius: 14px; width: min(560px, 100%); max-height: calc(100dvh - 32px); overflow: auto; box-shadow: 0 24px 60px rgba(24, 33, 43, .25); }
.modal-card.wide { width: min(860px, 100%); }
.modal-card.small { width: min(420px, 100%); }
.m-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px 12px; border-bottom: 1px solid var(--line-2); position: sticky; top: 0; background: var(--panel); z-index: 1; }
.m-head h2 { margin: 0; font-size: 18px; letter-spacing: -0.01em; }
.m-body { padding: 16px 18px 18px; display: grid; gap: 14px; }
.m-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 0 18px 18px; }
.m-tabs { display: flex; gap: 4px; padding: 0 12px; border-bottom: 1px solid var(--line-2); }
.m-tabs button { border: 0; background: none; padding: 10px 10px 9px; font-weight: 600; font-size: 14px; color: var(--ink-2); border-bottom: 2px solid transparent; }
.m-tabs button[aria-selected=true] { color: var(--ink); border-bottom-color: var(--brand); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.muted { color: var(--ink-2); }
.small { font-size: 13.5px; }
.qr-box { display: grid; grid-template-columns: 240px 1fr; gap: 18px; align-items: start; }
.qr-box img { width: 240px; height: 240px; border: 1px solid var(--line); border-radius: 10px; image-rendering: pixelated; }
.qr-box ol { margin: 0; padding-left: 18px; display: grid; gap: 6px; color: var(--ink-2); font-size: 14.5px; }
.status-line { display: flex; gap: 10px; align-items: center; font-weight: 600; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; color: var(--ink-3); font-weight: 600; font-size: 12.5px; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 8px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr.off td { color: var(--ink-3); }
pre.code { margin: 0; background: #17212b; color: #e6edf3; padding: 12px 14px; border-radius: 8px; font: 12.5px/1.5 ui-monospace, 'Cascadia Mono', Consolas, monospace; overflow-x: auto; white-space: pre; }
.token-row { display: flex; gap: 8px; align-items: center; }
.token-row input { font-family: ui-monospace, Consolas, monospace; font-size: 13.5px; }
.qr-list { display: grid; gap: 8px; }
.qr-row { display: grid; grid-template-columns: 120px 1fr auto; gap: 10px; align-items: start; padding: 8px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.qr-row b { overflow: hidden; text-overflow: ellipsis; }
.qr-row div { white-space: pre-wrap; color: var(--ink-2); }

.toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 60; }
.toast { background: #17212b; color: #fff; padding: 10px 14px; border-radius: 8px; font-size: 14px; max-width: 360px; box-shadow: 0 10px 30px rgba(24, 33, 43, .25); }
.toast.err { background: #7a1a12; }

/* ---------- celular ---------- */
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .app.in-chat .side { display: none; }
  .app:not(.in-chat) .main { display: none; }
  .chat-head { height: auto; flex-wrap: wrap; row-gap: 6px; padding: 8px 10px; gap: 8px; }
  .chat-head .back { display: grid; width: 36px; height: 36px; }
  .chat-head .avatar { display: none; }
  .ch-id { flex: 1 1 calc(100% - 50px); }
  .chat-head .owner { margin-left: 44px; }
  .ch-actions { margin-left: auto; }
  .ch-actions .btn { padding: 0 9px; }
  .audio audio { width: min(240px, 58vw); }
  .hint { display: none; }
  .msg { max-width: 88%; }
  .qr-box { grid-template-columns: 1fr; }
  .grid2 { grid-template-columns: 1fr; }
  .owner { padding: 4px 8px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
