@font-face { font-family: "DM Sans"; font-weight: 400; src: url("./dm-sans-400.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "DM Sans"; font-weight: 500; src: url("./dm-sans-500.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "DM Sans"; font-weight: 700; src: url("./dm-sans-700.woff2") format("woff2"); font-display: swap; }
:root {
  color-scheme: light;
  --bg: #efefec; --card: #fff; --sunk: #f4f4f1; --line: #ddded8; --strong: #83837c;
  --ink: #181918; --sub: #595c56; --accent: #c0392b; --active: #f3eee8;
  --incoming: #f0f3ee; --out: #f4f3f1; --human: #f4e9da; --human-ink: #694a21;
  --shadow: 0 2px 5px #25252008;
}
:root.dark {
  color-scheme: dark;
  --bg: #0d0d0d; --card: #191919; --sunk: #242423; --line: #363633; --strong: #73736c;
  --ink: #f0ede8; --sub: #b3b3ac; --active: #332b27; --incoming: #232e27; --out: #292928;
  --human: #392e20; --human-ink: #efcd99; --shadow: none;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--bg); font: 15px/1.45 "DM Sans", Arial, sans-serif; }
h1, h2, h3, p, dl, dd { margin: 0; }
h1 { font-size: 32px; line-height: 1.16; letter-spacing: -1.3px; }
h2 { font-size: 19px; letter-spacing: -.5px; }
h3 { display: flex; align-items: center; gap: 8px; font-size: 15px; }
button, select, input, textarea { font: inherit; color: inherit; }
button, select, input, textarea, .input { border: 1px solid var(--strong); border-radius: 7px; background: var(--sunk); }
button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 6px 14px; cursor: pointer; font-size: 13px; font-weight: 700; }
button:hover, summary:hover { filter: brightness(.94); }
button:disabled { cursor: default; opacity: .6; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.icon { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linejoin: round; stroke-linecap: round; }
.symbols { position: absolute; width: 0; height: 0; overflow: hidden; }
#inbox { display: flex; flex-direction: column; height: 100dvh; }
.top, .brand, .nav-label, .tools, .tools > span, .title, .between, .threadhead, .meta, .tags, footer, .mobilebar { display: flex; align-items: center; }
.top { padding: 16px 24px 0; gap: 12px; }
.brand, .nav-label, .tools { height: 48px; border: 1px solid var(--line); border-radius: 24px; background: var(--card); box-shadow: var(--shadow); }
.signature { font-weight: 700; letter-spacing: 2px; }
.signature::before { content: ""; display: inline-block; width: 10px; height: 10px; background: var(--accent); margin-right: 8px; }
.brand { padding: 0 18px; font-size: 14px; flex-shrink: 0; }
.nav-label { gap: 8px; padding: 0 19px; font-size: 13px; font-weight: 700; }
.tools { margin-left: auto; padding: 3px 5px 3px 15px; gap: 4px; }
.tools > span { gap: 6px; font-size: 12px; color: var(--sub); padding-right: 10px; }
.tools button { border: 0; border-radius: 24px; }
.mobile-preview, .mobilebar, #fechar-painel { display: none; }
.title { justify-content: space-between; padding: 24px 26px 22px; }
.primary { background: var(--ink); color: var(--card); border: 0; }
.panes { flex: 1; min-height: 0; display: grid; grid-template-columns: 320px minmax(0,1fr) 280px; gap: 16px; padding: 0 24px 20px; }
.card, .form-card { min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.queue, .detail, #ticket { display: flex; flex-direction: column; min-height: 0; }
#ticket { flex: 1; }
.qhead, .pad, .group { padding: 20px 16px; }
.between { justify-content: space-between; gap: 8px; }
#count { display: grid; place-items: center; min-width: 25px; height: 25px; font-size: 12px; font-weight: 700; background: var(--sunk); border-radius: 16px; }
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 14px; }
.filters select { min-width: 0; height: 34px; padding: 0 5px; border-color: var(--line); font-size: 12px; font-weight: 700; cursor: pointer; }
.tickets, .history, .control { overflow: auto; scrollbar-width: thin; scrollbar-color: var(--strong) var(--card); }
.tickets { padding: 0 8px 8px; }
.row { display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 14px 10px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: var(--card); text-align: left; font-weight: 400; }
.row[aria-current=true] { background: var(--active); border-radius: 8px; box-shadow: inset 3px 0 var(--ink); border-color: transparent; }
.avatar { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; background: var(--sunk); color: var(--sub); font-size: 12px; font-weight: 700; }
.hero, .row[aria-current=true] .avatar { background: var(--ink); color: var(--card); }
.row-copy { min-width: 0; flex: 1; }
.row-copy strong { font-size: 15px; overflow-wrap: anywhere; }
.rid { float: right; margin-left: 4px; color: var(--sub); font: 11px/22px Consolas, monospace; }
.preview { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--sub); margin: 2px 0 6px; font-size: 13px; }
.meta, .tags, .source, #mute { gap: 5px; font-size: 12px; color: var(--sub); }
.meta .icon, .tags .icon, .source .icon, .message strong .icon { width: 14px; height: 14px; }
.ranks { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.rank, .badge { display: inline-block; border-radius: 16px; background: var(--sunk); padding: 2px 7px; font-size: 11px; }
.rank.hot, .badge[data-status=humano] { background: var(--human); color: var(--human-ink); }
.threadhead { gap: 12px; padding: 15px 20px; border-bottom: 1px solid var(--line); }
.threadhead h2 { font-size: 20px; overflow-wrap: anywhere; }
.hero { width: 42px; height: 42px; font-size: 15px; }
.meta { margin-top: 2px; flex-wrap: wrap; }
.badge { padding: 4px 10px; font-size: 12px; font-weight: 700; margin-left: auto; }
.history { flex: 1; min-height: 0; padding: 16px 20px; }
#eventos-pendentes { border-top: 1px solid var(--line); color: var(--sub); font-size: 13px; padding: 0 16px; }
#eventos-pendentes summary { cursor: pointer; padding: 8px 0; }
#eventos-pendentes ul { max-height: 15dvh; overflow: auto; overflow-wrap: anywhere; margin: 0 0 8px; padding-left: 20px; }
.message { display: flex; flex-direction: column; align-items: flex-start; max-width: 82%; width: fit-content; margin-bottom: 12px; }
.message:last-child { margin-bottom: 0; }
.message.out { margin-left: auto; align-items: flex-end; }
.message strong { display: inline-flex; align-items: center; gap: 4px; color: var(--sub); font-size: 11.5px; margin-bottom: 4px; }
.bubble { padding: 9px 12px; border-radius: 10px 10px 10px 3px; background: var(--incoming); white-space: pre-wrap; overflow-wrap: anywhere; }
.out .bubble { background: var(--out); border-radius: 10px 10px 3px 10px; }
.source { display: flex; align-items: flex-start; border-top: 1px solid var(--line); margin-top: 8px; padding-top: 7px; }
.source .icon { margin-top: 2px; }
.compose { padding: 12px 16px 16px; border-top: 1px solid var(--line); }
.compose label { font-size: 13px; font-weight: 700; }
.input { display: flex; align-items: center; gap: 6px; margin-top: 8px; padding: 6px 6px 6px 12px; }
.input textarea { flex: 1; min-width: 0; padding: 6px 0; border: none; resize: vertical; max-height: 22dvh; }
.send { color: white; background: var(--accent); border: 0; }
#panel-slot { min-height: 0; }
.control { height: 100%; }
.kicker, .form-head .signature { font-size: 10px; letter-spacing: 1.6px; font-weight: 700; color: var(--sub); }
.group, .pad { border-bottom: 1px solid var(--line); }
.group:last-child { border: 0; }
.group p, .form-head p { color: var(--sub); margin: 7px 0 14px; font-size: 13.5px; }
.group button { width: 100%; margin: 3px 0; justify-content: flex-start; border-color: var(--line); }
.group dl { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 4px 12px; margin-top: 8px; font-size: 12px; }
dt { color: var(--sub); }
dd { overflow-wrap: anywhere; }
summary { cursor: pointer; font-size: 13px; font-weight: 700; padding: 8px 0; }
#outros-tickets button { font-size: 12px; }
.empty { padding: 18px; color: var(--sub); font-size: 14px; }
.detail > .empty { margin: auto; }
#login { min-height: 100dvh; display: grid; place-items: center; padding: 16px; }
.form-card { display: grid; gap: 16px; padding: 24px; width: min(100%,460px); }
.form-head { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.form-head h1, .form-head h2 { font-size: 24px; margin-top: 5px; letter-spacing: -.5px; }
.form-head p { margin-bottom: 0; }
.form-card label { display: grid; gap: 6px; font-size: 13px; font-weight: 700; }
.form-card input, .form-card select, .form-card textarea { width: 100%; min-height: 44px; padding: 10px 12px; font-size: 15px; font-weight: 400; }
.form-card textarea { resize: vertical; }
.form-card button { min-height: 44px; }
.password { position: relative; margin-top: -10px; }
.password input { padding-right: 48px; }
.password button { position: absolute; inset: 1px 1px 1px auto; min-height: 0; border: 0; }
.error { color: var(--human-ink); background: var(--human); padding: 8px; }
.error:empty { display: none; }
.notice { margin: 0 24px 8px; padding: 8px; background: var(--human); color: var(--human-ink); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
dialog { padding: 0; border: 0; background: transparent; color: var(--ink); width: min(460px, calc(100% - 32px)); max-height: calc(100dvh - 32px); border-radius: 14px; }
dialog::backdrop { background: #12121166; }
#origem { display: grid; gap: 16px; }
footer { justify-content: flex-end; gap: 8px; }
#progresso { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); padding: 6px 14px; border-radius: 20px; color: var(--card); background: var(--ink); font-size: 13px; z-index: 5; }
@media (max-width: 1279px) {
  .panes { grid-template-columns: 280px minmax(0,1fr); }
  #panel-slot { display: none; }
  .mobilebar { display: flex; justify-content: flex-end; padding: 4px 12px; border-bottom: 1px solid var(--line); }
  .mobilebar button { min-height: 44px; border: 0; background: none; }
  #voltar { display: none; }
  #folha { width: min(420px,calc(100% - 16px)); margin: auto 8px 8px auto; }
  #folha .control { max-height: calc(100dvh - 32px); }
  #folha .pad { position: sticky; top: 0; z-index: 1; background: var(--card); }
  #fechar-painel { display: inline-flex; min-width: 44px; min-height: 44px; font-size: 20px; }
}
@media (max-width: 1023px) {
  .top { padding: 9px 12px 0; gap: 6px; }
  .nav-label, .tools > span, #sair span, .detail, #inbox[data-detail=true] .queue, #inbox[data-detail=true] .title { display: none; }
  .brand { height: 46px; font-size: 11px; letter-spacing: 1.4px; padding: 0 12px; }
  .signature::before { width: 8px; height: 8px; }
  .tools { padding: 1px; height: 48px; }
  .tools button { min-width: 44px; min-height: 44px; padding: 0; }
  .mobile-preview { display: inline; font-size: 11px; color: var(--sub); }
  .title { padding: 12px; }
  .title h1 { font-size: 28px; }
  .panes { display: flex; padding: 10px 8px 8px; }
  .queue, .detail { width: 100%; }
  #inbox[data-detail=true] .detail, #voltar { display: flex; }
  .mobilebar { justify-content: space-between; padding: 0 8px; }
  .mobilebar button { padding: 0 4px; }
  .threadhead { padding: 10px 12px; }
  .threadhead h2 { font-size: 18px; }
  .history { padding: 12px; }
  .message { max-width: 89%; margin-bottom: 10px; }
  .compose { padding: 10px; }
  .send, .group button, .filters select, .title button, summary { min-height: 44px; }
  #folha { width: min(100% - 16px, 570px); margin: auto auto 8px; }
  .pad { padding: 10px 16px; }
}

/* Navegação e ajustes usam as mesmas superfícies da fila. */
.sections, #queue-tools, .config-actions, .composer-tools, .inline-tools, .message-actions {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
}
.sections { background: var(--card); border: 1px solid var(--line); border-radius: 23px; padding: 3px; }
.sections button { border: 0; background: transparent; border-radius: 20px; }
.sections button[aria-current=page], .sections button[aria-pressed=true] { background: var(--sunk); }
.settings { flex: 1; min-height: 0; overflow-y: auto; padding: 0 24px 32px; }
.settings .sections { width: fit-content; margin-bottom: 12px; }
.settings .form-card { width: min(100%, 720px); }
.settings .form-card > p, .settings small, .model-info, #config-feedback, #delivery-feedback { color: var(--sub); font-size: 13px; }
.settings small { font-weight: 400; }
#pair-qr { display: block; width: min(100%, 340px); height: auto; background: white; image-rendering: pixelated; }
#qr-validade, .pair-control p { font-size: 13px; color: var(--sub); margin: 8px 0; }
.pair-control { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 14px; }
.pair-control h3 { margin: 0; font-size: 15px; }
.pair-credit { display: block; margin-top: 18px; }
.pair-credit a { color: inherit; text-underline-offset: 2px; }
.model-info { display: flex; gap: 12px; }
.settings output:not(:empty) { display: block; margin: 12px 0; }
.composer-tools { margin-top: 6px; }
.composer-tools button, .file-button, .inline-tools button, .message-actions button, .message-actions summary {
  border: 1px solid var(--line); color: var(--sub); background: var(--card); border-radius: 7px;
  min-height: 28px; font-size: 12px; padding: 3px 8px; font-weight: 500; cursor: pointer;
}
.file-button { position: relative; overflow: hidden; }
.file-button input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.file-button:focus-within { outline: 2px solid var(--ink); }
.message-actions { align-items: flex-start; margin-top: 4px; }
.message-actions summary { display: inline-flex; align-items: center; }
.inline-tools, .reaction, #audio-draft { margin-top: 5px; }
.message .delivery, .reaction { color: var(--sub); font-size: 11px; }
.quote-preview, .bubble blockquote { margin: 5px 0; border-left: 3px solid var(--strong); padding: 5px 8px; background: var(--sunk); color: var(--sub); font-size: 13px; }
.quote-preview { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.quote-preview button { min-height: 28px; }
.bubble img { display: block; max-width: min(100%,320px); max-height: 240px; object-fit: contain; }
.bubble audio, #audio-preview { display: block; max-width: 100%; width: 260px; }
.bubble a { display: block; color: var(--ink); }
.message { min-width: 0; }
.bubble { max-width: 100%; }
#file-name, #delivery-feedback { overflow-wrap: anywhere; }
#delivery-feedback:not(:empty) { display: block; margin-top: 6px; }
@media(max-width:1023px) {
  #inbox .top { flex-wrap: wrap; }
  .top .sections { order: 1; width: 100%; }
  .top .sections button { flex: 1; min-height: 44px; }
  #inbox:not([data-page=conversas]) .title { display: flex; }
  .settings { padding: 0 10px 18px; }
  .settings .form-card { padding: 16px; }
  .title { flex-wrap: wrap; gap: 6px; }
  .compose { max-height: 46dvh; overflow: auto; }
  .composer-tools button, .file-button, .inline-tools button, .message-actions button, .message-actions summary { min-height: 40px; }
  .file-button { display: inline-flex; align-items: center; }
}

