/* ============================================================
   MineOS — Mensagens (CCO ↔ Operador) · estilos
   ============================================================ */
.chatwrap { display: grid; grid-template-columns: 320px 1fr; gap: 16px; height: calc(100vh - 64px - 48px); padding: 24px; }

/* ---- lista de conversas ---- */
.chat-list { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); display: flex; flex-direction: column; overflow: hidden; }
.cl-search { display: flex; align-items: center; gap: 9px; padding: 13px 14px; border-bottom: 1px solid var(--border); }
.cl-search svg { width: 16px; color: var(--fg-lo); flex: none; }
.cl-search input { flex: 1; border: none; background: none; outline: none; color: var(--fg); font-family: var(--font-ui); font-size: 13px; }
.cl-items { flex: 1; overflow-y: auto; }
.cl-empty { padding: 24px; text-align: center; color: var(--fg-lo); font-family: var(--font-mono); font-size: 12px; }
.cl-item { display: flex; gap: 11px; padding: 12px 14px; cursor: pointer; border-bottom: 1px solid var(--border-soft); transition: background .12s; }
.cl-item:hover { background: var(--surface-2); }
.cl-item.active { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.cli-av { position: relative; width: 40px; height: 40px; border-radius: 50%; flex: none; background: var(--surface-3); color: var(--fg-mid); display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 800; font-size: 14px; }
.cl-item.active .cli-av { background: var(--accent); color: var(--accent-ink); }
.cli-dot { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--surface); }
.cli-main { min-width: 0; flex: 1; }
.cli-top { display: flex; align-items: center; gap: 8px; }
.cli-name { font-family: var(--font-mono); font-weight: 700; font-size: 13px; color: var(--fg); }
.cli-time { margin-left: auto; font-family: var(--font-mono); font-size: 10px; color: var(--fg-lo); }
.cli-badge { margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 11px; display: flex; align-items: center; justify-content: center; }
.cli-sub { font-size: 11.5px; color: var(--fg-mid); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cli-last { font-size: 12px; color: var(--fg-lo); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cli-last.unread { color: var(--fg); font-weight: 600; }

/* ---- thread ---- */
.chat-thread { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.ct-empty { margin: auto; color: var(--fg-lo); font-family: var(--font-mono); font-size: 13px; }
.ct-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); background: var(--surface-2); flex: none; }
.cth-av { width: 38px; height: 38px; border-radius: 50%; flex: none; background: var(--accent-soft); color: var(--accent-deep); display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 800; font-size: 14px; }
.cth-meta { min-width: 0; }
.cth-name { font-family: var(--font-display); font-weight: 800; font-size: 16px; letter-spacing: -.01em; }
.cth-name .cth-type { font-family: var(--font-ui); font-weight: 600; font-size: 12px; color: var(--fg-lo); }
.cth-sub { font-family: var(--font-mono); font-size: 11px; color: var(--fg-lo); margin-top: 1px; }
.cth-status { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-mono); font-size: 11px; font-weight: 600; color: var(--fg-mid); padding: 5px 11px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); }

.ct-msgs { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.cmsg { display: flex; flex-direction: column; gap: 4px; max-width: 76%; }
.cmsg.out { align-self: flex-end; align-items: flex-end; }
.cmsg.in { align-self: flex-start; align-items: flex-start; }
.cmsg-label { font-family: var(--font-mono); font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--fg-lo); }
.cmsg-bubble { padding: 10px 14px; border-radius: 13px; font-size: 13.5px; font-weight: 500; line-height: 1.45; color: var(--fg); }
.cmsg.out .cmsg-bubble { background: var(--accent); color: var(--accent-ink); border-top-right-radius: 4px; font-weight: 600; }
.cmsg.in .cmsg-bubble { background: var(--surface-2); border: 1px solid var(--border); border-top-left-radius: 4px; }
.cmsg.in .cmsg-bubble[style*="--oc"] { border-left: 3px solid var(--oc); }
.cmsg-time { font-family: var(--font-mono); font-size: 9.5px; color: var(--text-faint); }

.opts-sent { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 3px; justify-content: flex-end; }
.opt-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; border: 1.5px solid color-mix(in srgb, var(--oc) 50%, transparent); color: var(--fg-mid); background: color-mix(in srgb, var(--oc) 9%, transparent); }
.opt-chip svg { width: 12px; color: var(--oc); }
.opt-chip.chosen { border-color: var(--oc); color: var(--fg); background: color-mix(in srgb, var(--oc) 18%, transparent); }
.opts-status { font-family: var(--font-mono); font-size: 10px; color: var(--fg-lo); margin-top: 2px; display: flex; align-items: center; gap: 7px; }

.typing-dots { display: inline-flex; gap: 3px; align-items: center; }
.typing-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--fg-lo); animation: tdot 1s infinite; }
.typing-dots i:nth-child(2){ animation-delay: .15s; } .typing-dots i:nth-child(3){ animation-delay: .3s; }
@keyframes tdot { 0%,60%,100%{ opacity:.3; transform: translateY(0);} 30%{ opacity:1; transform: translateY(-3px);} }
.cmsg-bubble.typing { padding: 12px 14px; }

/* ---- compositor ---- */
.ct-composer { border-top: 1px solid var(--border); background: var(--surface-2); padding: 12px 16px 14px; flex: none; }
.cmp-templates { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.cmp-tpl { font-size: 11.5px; font-weight: 600; color: var(--fg-mid); padding: 5px 11px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); cursor: pointer; }
.cmp-tpl:hover { border-color: var(--accent); color: var(--fg); }
.cmp-text { width: 100%; resize: none; border: 1.5px solid var(--border); border-radius: var(--r-md); background: var(--surface); color: var(--fg); font-family: var(--font-ui); font-size: 14px; padding: 11px 13px; outline: none; }
.cmp-text:focus { border-color: var(--accent); }
.cmp-opts { margin-top: 11px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); padding: 11px 13px; }
.cmp-opts-h { font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--fg-lo); margin-bottom: 10px; }
.cmp-opts-h span { color: var(--text-faint); }
.opt-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.opt-row + .opt-row { border-top: 1px solid var(--border-soft); }
.opt-check { width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--border); background: var(--surface-2); flex: none; cursor: pointer; position: relative; }
.opt-check.on { background: var(--accent); border-color: var(--accent); }
.opt-check.on::after { content:""; position: absolute; left: 5px; top: 1px; width: 5px; height: 10px; border: solid var(--accent-ink); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.opt-row.locked .opt-dot { margin-left: 30px; }
.opt-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.opt-tag { font-family: var(--font-mono); font-size: 10px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--fg-lo); width: 138px; flex: none; }
.opt-input { flex: 1; min-width: 0; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface-2); color: var(--fg); font-size: 13px; font-weight: 600; padding: 7px 10px; outline: none; }
.opt-input:focus { border-color: var(--accent); }
.opt-input:disabled { opacity: .4; }
.opt-row:not(.on):not(.locked) .opt-dot, .opt-row:not(.on):not(.locked) .opt-tag { opacity: .45; }
.opt-min { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.opt-min.disabled { opacity: .4; pointer-events: none; }
.opt-min button { width: 26px; height: 26px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface-2); color: var(--fg); font-size: 15px; cursor: pointer; }
.opt-min button:hover { color: var(--accent); border-color: var(--accent); }
.opt-min span { font-family: var(--font-display); font-weight: 800; font-size: 15px; min-width: 16px; text-align: center; }
.opt-min small { font-family: var(--font-mono); font-size: 9px; color: var(--fg-lo); }
.cmp-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 11px; }
.cmp-hint { font-family: var(--font-mono); font-size: 10.5px; color: var(--fg-lo); }
.cmp-foot .btn { padding: 9px 18px; }

@media (max-width: 720px) {
  .chatwrap { grid-template-columns: 1fr; }
  .chat-list { display: none; }
}
