/* Tela de Conversas — "centro de comando". Usa só os tokens do cc.css (claro e escuro). */
body { height: 100vh; height: 100dvh; overflow: hidden; touch-action: manipulation; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
#login { min-height: 100vh; }
#app { display: none; height: 100vh; height: 100dvh; grid-template-columns: 72px minmax(340px, 400px) minmax(0, 1fr) 0; }
#app.has-side { grid-template-columns: 72px minmax(340px, 400px) minmax(0, 1fr) 340px; }
#side { display: none; }
#app.has-side #side { display: flex; }

/* ---------- Trilho lateral ---------- */
.rail { background: var(--sidebar); border-right: 1px solid var(--sidebar-line); display: flex; flex-direction: column; align-items: center; padding: var(--s-4) 0; gap: var(--s-3); }
.rail .logo { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; color: var(--accent-text); background: linear-gradient(135deg, var(--cc-cyan), var(--accent)); box-shadow: 0 6px 22px color-mix(in srgb, var(--accent) 38%, transparent); }
.rail .logo svg { width: 22px; height: 22px; }
.rail .spacer { flex: 1; }
.rail .av { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--sidebar-2); color: var(--sidebar-ink); font-weight: 700; font-size: 13px; border: 1px solid var(--sidebar-line); cursor: pointer; }
.rail button, .rail .railbtn { all: unset; box-sizing: border-box; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: var(--sidebar-text); cursor: pointer; transition: background var(--dur-fast), color var(--dur-fast); }
.rail button:hover, .rail .railbtn:hover { background: var(--sidebar-hover); color: var(--sidebar-strong); }
.rail button:focus-visible, .rail .railbtn:focus-visible { outline: 2px solid var(--cc-cyan); outline-offset: 1px; }
.rail button svg, .rail .railbtn svg { width: 20px; height: 20px; }
.rail .av { width: 38px; height: 38px; }
.rail #pushBtn.on { color: var(--accent); }
.rail #pushBtn:not(.on) { opacity: .75; }

/* ---------- Lista ---------- */
.listpane { background: var(--cc-glass); border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; min-width: 0; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.lp-head { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-5) var(--s-5) var(--s-3); position: relative; }
.lp-title { flex: 1; min-width: 0; }
.lp-head h1 { font-size: var(--fs-xl); letter-spacing: -.02em; }
.lp-head small { display: block; color: var(--muted); font-size: var(--fs-sm); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#palBtn { gap: 8px; border: 1px solid var(--border); background: var(--surface-2); }
#palBtn svg { width: 15px; height: 15px; }
#menuBtn { display: none; width: 40px; height: 40px; padding: 0; border-radius: 50%; place-items: center; background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; font-size: 13px; border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }

.tabs { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 var(--s-4) var(--s-3); }
.tabs .chip { --c: var(--muted); --cs: var(--surface-3); padding: 6px 10px; }
.tabs .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c); flex: none; }
.tabs .cnt { min-width: 20px; padding: 2px 6px; border-radius: 999px; background: var(--cs); color: var(--c); font-size: 11px; font-weight: 800; line-height: 1.3; text-align: center; }
.tabs .cnt:empty { display: none; }
.tabs .chip.on { background: var(--cs); border-color: color-mix(in srgb, var(--c) 55%, transparent); color: var(--text); box-shadow: 0 0 18px color-mix(in srgb, var(--c) 18%, transparent); }
.tabs .chip.on .cnt { background: var(--c); color: var(--surface); }
.t-WAITING { --c: var(--warn); --cs: var(--warn-soft); }
.t-MINE, .t-AGENT { --c: var(--accent-ink); --cs: var(--accent-soft); }
.t-BOT { --c: var(--info); --cs: var(--info-soft); }
.t-CLOSED { --c: var(--faint); --cs: var(--surface-3); }
.t-ALL { --c: var(--text-2); --cs: var(--surface-3); }
.cnt.bump { animation: cc-slide-in var(--dur) var(--ease); }

.lp-search { padding: 0 var(--s-4) var(--s-3); }
.lp-search input { border-radius: 999px; padding: 8px 14px; font-size: var(--fs-sm); }
#list { overflow-y: auto; flex: 1; padding: 0 var(--s-2) var(--s-4); min-width: 0; overflow-x: hidden; }

/* item da lista */
.cgroup { min-width: 0; }
.conv { position: relative; display: flex; gap: var(--s-3); align-items: flex-start; padding: 11px 12px 14px; border-radius: 13px; cursor: pointer; min-width: 0; overflow: hidden; border: 1px solid transparent; transition: background var(--dur-fast), border-color var(--dur-fast), box-shadow var(--dur); }
.conv:hover { background: var(--surface-2); }
.conv:focus-visible { box-shadow: var(--ring); }
.conv.sel { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 38%, transparent); box-shadow: 0 0 22px color-mix(in srgb, var(--accent) 12%, transparent); }
.conv.is-new { animation: cc-slide-in .35s var(--ease); }
.conv.urgent { border-color: color-mix(in srgb, var(--danger) 45%, transparent); background: color-mix(in srgb, var(--danger) 6%, transparent); }
.conv.urgent.pulse-crit { animation: cc-pulse 1.8s ease-out infinite; }
.conv .ci { flex: 1; min-width: 0; display: grid; gap: 4px; }
.conv .row { display: flex; gap: 8px; align-items: center; flex-wrap: nowrap; min-width: 0; }
.conv .name { font-weight: 650; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 0 1 auto; min-width: 0; }
.conv .unread-d { flex: none; }
.conv .when { color: var(--faint); font-size: var(--fs-xs); flex: none; margin-left: auto; font-variant-numeric: tabular-nums; }
.conv .last { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 0; min-width: 0; }
.conv.has-unread .last { color: var(--text); font-weight: 600; }
.conv.has-unread .name { color: var(--text); }
.ubadge { flex: none; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; display: inline-grid; place-items: center; background: var(--accent); color: var(--accent-text); font-size: 11px; font-weight: 800; box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 45%, transparent); }
.conv .typing { color: var(--accent-ink); font-size: 13px; font-weight: 600; flex: 1; }
.conv .mini { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; min-width: 0; }
.conv .wait { font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 999px; background: var(--surface-3); color: var(--muted); font-variant-numeric: tabular-nums; }
.conv .wait svg { width: 11px; height: 11px; }
.conv .wait.warn { background: var(--warn-soft); color: var(--warn); } .conv .wait.crit { background: var(--danger-soft); color: var(--danger); }
.conv .sla { position: absolute; left: 12px; right: 12px; bottom: 5px; height: 3px; }
.badge { font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--surface-3); color: var(--muted); white-space: nowrap; text-transform: uppercase; letter-spacing: .03em; flex: none; }
.badge.WAITING { background: var(--warn-soft); color: var(--warn); }
.badge.AGENT { background: var(--accent-soft); color: var(--accent-ink); }
.badge.BOT { background: var(--info-soft); color: var(--info); }
.badge.CLOSED { background: var(--surface-3); color: var(--faint); }
.qtag { flex: none; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--cc-cyan-soft); color: var(--cc-cyan); }
.ttag { flex: none; font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); border: 1px solid var(--border); }
.conv .more { all: unset; flex: none; cursor: pointer; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); }
.conv .more:hover, .conv .more.open { background: var(--accent-soft); color: var(--accent-ink); }
.conv .more:focus-visible { outline: 2px solid var(--cc-cyan); }
.conv .cmeta { color: var(--faint); font: 400 11px var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.csub { margin: 0 0 4px 22px; border-left: 2px solid var(--border); padding-left: 4px; }
.csub .conv { padding: 8px 10px 12px; }

/* "Encerradas": seção compacta no fim */
.closed-sec { margin: var(--s-3) var(--s-2) 0; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.closed-sec > summary { padding: 10px 12px; }
.closed-sec .conv { padding: 7px 10px; border-radius: 9px; }
.closed-sec .conv .avt { width: 30px; height: 30px; font-size: 11px; } .closed-sec .conv .avt .ch { display: none; }
.closed-sec .conv .sla { display: none; }
.empty-list { display: grid; place-items: center; text-align: center; gap: 6px; padding: 48px 24px; color: var(--muted); }
.empty-list svg { width: 40px; height: 40px; color: var(--faint); margin-bottom: 6px; }
.empty-list b { color: var(--text-2); } .empty-list span { font-size: 13px; max-width: 240px; }
.wa-banner { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: 10px; margin: 0 var(--s-4) var(--s-3); background: var(--danger-soft); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent); }
.wa-banner b { display: block; } .wa-banner span { color: var(--text-2); font-size: 13px; }

/* ---------- Área principal ---------- */
main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--chat-bg); position: relative; }
#empty { flex: 1; overflow-y: auto; display: grid; place-items: center; padding: var(--s-8) var(--s-6); }
#empty .hub { width: min(760px, 100%); display: grid; gap: var(--s-4); }
#empty .hub > .big { justify-self: center; width: 72px; height: 72px; border-radius: 22px; display: grid; place-items: center; background: var(--surface); box-shadow: var(--shadow); color: var(--accent); }
#empty .hub > .big svg { width: 34px; height: 34px; }
#empty .hub > b { text-align: center; font-size: 17px; } #empty .hub > span { text-align: center; color: var(--muted); }
#chat { display: none; flex-direction: column; height: 100%; min-height: 0; }

/* painel pessoal (estado vazio) */
.hub-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; }
.hub-head h2 { margin: 0; font-size: 26px; letter-spacing: -.03em; } .hub-head p { margin: 4px 0 0; color: var(--muted); }
.hub-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--s-3); }
.hub-card { padding: var(--s-4); display: grid; gap: 6px; align-content: start; position: relative; overflow: hidden; }
.hub-card .v { font-size: 34px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.hub-card .v small { font-size: 14px; font-weight: 600; color: var(--muted); margin-left: 3px; }
.hub-card .s { font-size: var(--fs-sm); color: var(--muted); }
.hub-card .ring { position: absolute; right: var(--s-4); top: var(--s-4); --sz: 52px; --w: 6px; }
.hub-card.warn .v { color: var(--warn); } .hub-card.good .v { color: var(--accent-ink); }
.hub-next { padding: var(--s-5); display: flex; gap: var(--s-4); align-items: center; flex-wrap: wrap; border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); box-shadow: var(--cc-glow); }
.hub-next .info { flex: 1 1 220px; min-width: 0; } .hub-next .info b { display: block; font-size: 17px; } .hub-next .info span { color: var(--muted); font-size: var(--fs-sm); }
.hub-next button { padding: 12px 18px; font-size: 14.5px; }
.hub-tip { text-align: center; color: var(--faint); font-size: var(--fs-sm); }

/* ---------- Cabeçalho da conversa ---------- */
#chatHead { background: var(--cc-glass-strong); padding: var(--s-3) var(--s-5); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; box-shadow: var(--shadow-sm); z-index: 2; }
#chatHead .who { flex: 1 1 160px; min-width: 0; }
#chatHead .who strong, #chatHead .who small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#chatHead .who strong { font-size: var(--fs-lg); }
#chatHead .who small { color: var(--muted); font-size: var(--fs-sm); }
#chatHead .who small.proto { font: 500 11.5px var(--mono); color: var(--accent-ink); }
#cInfo .badge { margin-left: 2px; }
.chips-h { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.slachip { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); font-variant-numeric: tabular-nums; }
.slachip svg { width: 12px; height: 12px; } .slachip.warn { background: var(--warn-soft); color: var(--warn); } .slachip.crit { background: var(--danger-soft); color: var(--danger); }
#back { display: none; }
#cQueue { width: auto; max-width: 190px; flex: 0 1 auto; }
#bDelete { padding: 9px 11px; }
#bPanel[aria-pressed="true"] { color: var(--accent-ink); background: var(--accent-soft); }

#banner { padding: 10px 20px; background: var(--warn-soft); color: var(--warn); font-size: 13px; font-weight: 500; display: none; border-bottom: 1px solid color-mix(in srgb, var(--warn) 25%, transparent); }
#handoff { margin: var(--s-3) var(--s-5) 0; padding: var(--s-3) var(--s-4); border-radius: var(--radius); background: var(--cc-cyan-soft); border: 1px solid color-mix(in srgb, var(--cc-cyan) 40%, transparent); display: flex; gap: var(--s-3); align-items: flex-start; }
#handoff svg { width: 18px; height: 18px; color: var(--cc-cyan); flex: none; margin-top: 2px; }
#handoff .t { flex: 1; min-width: 0; font-size: 13.5px; } #handoff .t b { display: block; font-size: var(--fs-xs); letter-spacing: .06em; text-transform: uppercase; color: var(--cc-cyan); margin-bottom: 2px; }
#handoff button { padding: 3px 8px; }

/* ---------- Mensagens ---------- */
#msgs { flex: 1; overflow-y: auto; padding: var(--s-5) 7%; display: flex; flex-direction: column; gap: 6px; background-image: radial-gradient(color-mix(in srgb, var(--text) 5%, transparent) 1px, transparent 1px); background-size: 18px 18px; scroll-behavior: smooth; }
.m { max-width: 68%; padding: 8px 12px 5px; border-radius: 14px; background: var(--bubble-in); color: var(--text); align-self: flex-start; white-space: pre-wrap; overflow-wrap: anywhere; box-shadow: 0 1px 1px rgba(0, 0, 0, .14); border-top-left-radius: 5px; font-size: 14px; animation: cc-slide-in .2s var(--ease); }
.m.out { background: var(--bubble-out); align-self: flex-end; border-top-left-radius: 14px; border-top-right-radius: 5px; }
.m .meta { font-size: 11px; color: var(--muted); text-align: right; margin-top: 3px; display: flex; gap: 4px; justify-content: flex-end; align-items: center; }
.m .meta span:first-child { font-weight: 600; }
.m .failwhy { font-size: 11px; line-height: 1.35; color: var(--danger, #e5484d); text-align: right; margin-top: 2px; overflow-wrap: anywhere; }
.m .opts { margin: 8px -12px -5px; display: flex; flex-direction: column; border-top: 1px solid color-mix(in srgb, var(--text) 10%, transparent); }
.m .opts span { text-align: center; padding: 7px; color: var(--info); font-size: 13px; font-weight: 500; border-bottom: 1px solid color-mix(in srgb, var(--text) 7%, transparent); }
.m .opts span:last-child { border-bottom: 0; }
.m code, .m pre { font-family: var(--mono); font-size: 12.5px; background: color-mix(in srgb, var(--text) 8%, transparent); border-radius: 4px; padding: 1px 4px; }
.m pre { display: block; padding: 6px 8px; margin: 2px 0; white-space: pre-wrap; }
.m .wq { display: block; border-left: 3px solid var(--border-strong); padding-left: 8px; margin: 2px 0; color: var(--text-2); }
.m img { max-width: 280px; border-radius: 8px; display: block; }
.m a { color: var(--info); font-weight: 500; }
.m.failed { box-shadow: 0 0 0 1.5px var(--danger); }
.m .aud { display: grid; gap: 6px; min-width: 220px; } .m audio { width: 100%; max-width: 280px; height: 40px; }
.m .tr { font-size: 13px; font-style: italic; color: var(--text-2); white-space: pre-wrap; }
.m video.vid { max-width: 280px; border-radius: 8px; display: block; }
.note { align-self: center; font-size: 12px; color: var(--muted); background: var(--surface); padding: 4px 12px; border-radius: 8px; box-shadow: var(--shadow-sm); }
#typingBar { padding: 4px var(--s-5); font-size: var(--fs-sm); color: var(--accent-ink); font-weight: 600; min-height: 22px; }

/* ---------- Sugestões da IA e compositor ---------- */
#suggest { display: flex; gap: var(--s-2); flex-wrap: wrap; padding: var(--s-2) var(--s-5) 0; align-items: center; }
#suggest:empty { display: none; }
#suggest .sg-btn { color: var(--cc-cyan); border-color: color-mix(in srgb, var(--cc-cyan) 45%, transparent); background: var(--cc-cyan-soft); }
#suggest .sg-btn svg { width: 14px; height: 14px; }
#suggest .sg-chip { max-width: 100%; white-space: normal; text-align: left; border-radius: 14px; line-height: 1.35; padding: 8px 12px; }
#suggest .sg-sum { flex-basis: 100%; font-size: var(--fs-sm); color: var(--muted); }
#suggest .skeleton { height: 34px; width: 180px; border-radius: 14px; }
#composer { display: flex; gap: 10px; padding: var(--s-3) var(--s-5); background: var(--cc-glass-strong); border-top: 1px solid var(--border); align-items: flex-end; margin-top: var(--s-2); }
#composer textarea { flex: 1; resize: none; max-height: 160px; min-height: 44px; border-radius: 22px; padding: 11px 16px; }
#attach, #mic { border-radius: 50%; width: 44px; height: 44px; padding: 0; }
#sendBtn { border-radius: 22px; height: 44px; padding: 0 18px; }
#recBar { display: none; flex: 1; align-items: center; gap: 12px; min-height: 44px; padding: 0 8px 0 16px; border-radius: 22px; background: var(--surface-2); }
#composer.rec #recBar { display: flex; }
#composer.rec #text, #composer.rec #sendBtn, #composer.rec #attach, #composer.rec #mic { display: none; }
#recBar .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: recPulse 1s ease-in-out infinite; }
#recBar .rl { color: var(--muted); font-size: 13px; flex: 1; }
@keyframes recPulse { 50% { opacity: .25; } }

/* ---------- Painel do cliente ---------- */
.sidepane { flex-direction: column; background: var(--cc-glass); border-left: 1px solid var(--border); overflow-y: auto; min-height: 0; padding: var(--s-5) var(--s-4); gap: var(--s-4); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.sp-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; }
.sp-head strong { font-size: var(--fs-lg); } .sp-head small { color: var(--muted); }
.sp-sec { display: grid; gap: var(--s-2); }
.sp-sec h4 { margin: 0; font: 700 var(--fs-xs)/1 var(--mono); letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.sp-kv { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-2); }
.sp-kv > div { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); }
.sp-kv b { display: block; font-size: 20px; letter-spacing: -.02em; } .sp-kv span { font-size: var(--fs-xs); color: var(--muted); }
.sp-meter { display: flex; align-items: center; gap: var(--s-3); padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); }
.sp-meter .sent { width: 30px; height: 30px; } .sp-meter .sent svg { width: 24px; height: 24px; }
.sp-meter b { display: block; } .sp-meter span { font-size: var(--fs-sm); color: var(--muted); }
.sp-hist { display: grid; gap: 6px; }
.sp-hist button { display: grid; gap: 2px; text-align: left; padding: 9px 11px; width: 100%; white-space: normal; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); box-shadow: none; }
.sp-hist button:hover { border-color: var(--accent); }
.sp-hist .h1 { display: flex; justify-content: space-between; gap: 8px; font-size: var(--fs-sm); font-weight: 700; color: var(--text); }
.sp-hist .h2 { font-size: var(--fs-sm); color: var(--muted); font-weight: 400; line-height: 1.35; }
.sp-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.sp-ai { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--cc-cyan-soft); border: 1px solid color-mix(in srgb, var(--cc-cyan) 35%, transparent); font-size: 13px; line-height: 1.5; }
.sp-close { display: none; }

/* ---------- Paleta de busca (Ctrl+K) e janelas ---------- */
dialog { border: 1px solid var(--border-strong); border-radius: 16px; background: var(--cc-glass-strong); color: var(--text); padding: 20px; width: min(420px, calc(100vw - 32px)); box-shadow: var(--shadow-lg); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
dialog::backdrop { background: rgba(2, 6, 12, .6); backdrop-filter: blur(3px); }
dialog pre { background: var(--surface-2); padding: 10px; border-radius: 8px; white-space: pre-wrap; }
dialog img { margin: 0 auto; display: block; }
#palDlg { width: min(640px, calc(100vw - 24px)); padding: 0; margin-top: 12vh; overflow: hidden; }
.pal-in { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.pal-in svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.pal-in input { border: 0; background: transparent; padding: 4px 0; font-size: 16px; box-shadow: none !important; }
.pal-list { max-height: min(56vh, 460px); overflow-y: auto; padding: 6px; }
.pal-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 12px; border-radius: 10px; text-align: left; border: 0; box-shadow: none; background: transparent; }
.pal-item:hover, .pal-item[aria-selected="true"] { background: var(--accent-soft); }
.pal-item .t { flex: 1; min-width: 0; } .pal-item .t b { display: block; overflow: hidden; text-overflow: ellipsis; color: var(--text); } .pal-item .t span { font-size: var(--fs-sm); color: var(--muted); }
.pal-empty { padding: 28px; text-align: center; color: var(--muted); }
.kbd-list { display: grid; gap: 8px; margin: 0; } .kbd-list > div { display: flex; justify-content: space-between; gap: 12px; align-items: center; } .kbd-list dt { margin: 0; } .kbd-list dd { margin: 0; color: var(--muted); text-align: right; }

.login-help { text-align: center; margin-top: 8px; }
.offline { display: grid; gap: 10px; place-content: center; min-height: 100vh; text-align: center; padding: 24px; }
.acchead { display: flex; gap: 12px; align-items: center; }
.acchead .av { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; flex: none; }
.acchead strong, .acchead small { display: block; overflow-wrap: anywhere; } .acchead small { color: var(--muted); font-size: 12px; }
.accsec { display: grid; gap: 8px; border-top: 1px solid var(--border); padding-top: 12px; }
.accsec h4 { font-size: 13px; }
#accDlg { max-height: calc(100dvh - 32px); overflow-y: auto; }
#updBar { position: fixed; left: 50%; transform: translateX(-50%); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 300; display: flex; gap: 12px; align-items: center; padding: 10px 14px; border-radius: 12px; background: var(--text); color: var(--surface); box-shadow: var(--shadow); font-size: 13.5px; }
.toasts { position: fixed; top: max(16px, env(safe-area-inset-top)); right: 16px; z-index: 310; display: grid; gap: 8px; width: min(340px, calc(100vw - 32px)); }
.toast { display: grid; gap: 2px; text-align: left; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--cc-glass-strong); color: var(--text); box-shadow: var(--shadow-lg); cursor: pointer; animation: cc-slide-in .22s var(--ease); white-space: normal; backdrop-filter: blur(10px); }
.toast span { color: var(--muted); font-size: 12.5px; }

/* ---------- Telas médias e celular ---------- */
@media (max-width: 1280px) {
  #app { grid-template-columns: 64px minmax(300px, 340px) minmax(0, 1fr) 0; }
  #app.has-side { grid-template-columns: 64px minmax(300px, 340px) minmax(0, 1fr) 0; }
  #app.has-side #side { position: fixed; right: 0; top: 0; bottom: 0; width: min(360px, 92vw); z-index: 80; box-shadow: var(--shadow-lg); background: var(--cc-glass-strong); }
  .sp-close { display: inline-flex; align-self: flex-end; }
  #chatHead .lbl { display: none; } #chatHead button { padding: 9px 11px; }
}
@media (max-width: 900px) {
  #app, #app.has-side { grid-template-columns: 1fr; }
  .rail { display: none !important; }
  #app.open .listpane { display: none; } #app:not(.open) main { display: none; }
  #back { display: inline-flex; } #menuBtn { display: grid; } .lp-head .lp-title { padding-right: 0; } #palBtn kbd { display: none; }
  #sendBtn .lbl { display: none; } #sendBtn { width: 44px; padding: 0; border-radius: 50%; }
  .m { max-width: 88%; } #msgs { padding: 14px; } #chatHead { padding: 10px 12px; } #composer { padding: 10px 12px max(10px, env(safe-area-inset-bottom)); }
  .lp-head { padding-top: max(18px, env(safe-area-inset-top)); }
  #suggest { padding: var(--s-2) 12px 0; }
  input, textarea, select { font-size: 16px; }
  #empty { padding: var(--s-5) var(--s-4); }
}

/* ---- refinamento (2ª rodada) ---- */
#empty .hub { width: min(900px, 100%); }
.hub-grid { grid-template-columns: repeat(auto-fit, minmax(136px, 1fr)); }
.hub-card .ring { top: auto; bottom: var(--s-4); right: var(--s-4); --sz: 46px; --w: 5px; }
.tabs .chip { padding: 6px 9px; font-size: 12px; }
#chatHead { row-gap: var(--s-2); }
.chips-h { order: 10; flex: 1 0 100%; padding-left: 56px; }
.chips-h:empty { display: none; }
#app.has-side #chatHead .lbl, #chatHead #bTag .lbl, #chatHead #bBot .lbl, #chatHead #bClose .lbl { display: none; }
#chatHead button { padding: 9px 11px; }
#chatHead #bAssign .lbl { display: inline; }

/* ---- nova conversa ---- */
.st-preview { white-space: pre-wrap; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border-strong); font-size: 14px; line-height: 1.45; }
#startDlg #stMsg { flex: 1 1 100%; }
#startDlg select { width: 100%; }

/* ---- menu no celular (folha com os itens da barra lateral, que some em tela pequena) ---- */
dialog.mobmenu { margin: auto 0 0; width: 100%; max-width: none; border-radius: 18px 18px 0 0; padding: 12px 12px max(12px, env(safe-area-inset-bottom)); }
.mm-list { display: grid; gap: 4px; }
.mm-item { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 14px; min-height: 48px; padding: 0 12px; border-radius: 12px; color: var(--text); font-size: 16px; font-weight: 600; cursor: pointer; }
.mm-item:hover, .mm-item:active { background: var(--surface-2); }
.mm-item:focus-visible { outline: 2px solid var(--cc-cyan); outline-offset: 1px; }
.mm-item.danger { color: var(--danger, #e5484d); }
.mm-ic { width: 28px; height: 28px; display: grid; place-items: center; flex: none; font-size: 15px; font-weight: 700; }
.mm-ic svg { width: 22px; height: 22px; }
.mm-close { width: 100%; margin-top: 8px; min-height: 44px; }

/* ---- equipe e ausências ---- */
#teamBtn { position: relative; }
.rdot { position: absolute; top: 6px; right: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 2px var(--bg-2, var(--bg)); }
.team-warn { padding: 10px 12px; border-radius: 10px; background: var(--warn-soft); color: var(--warn); font-size: 13px; font-weight: 500; }
.team-list { display: grid; gap: 8px; max-height: 50vh; overflow: auto; }
.team-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--line, rgba(128,128,128,.25)); border-radius: 10px; }
.team-row.off { opacity: .85; border-style: dashed; }
.team-who { flex: 1 1 160px; min-width: 0; display: grid; }
.team-who small { color: var(--text-2); }
.team-row select { width: auto; min-width: 110px; }

/* ---- menu lateral expansível (botão no topo; escolha lembrada neste navegador) ---- */
.rail #railToggle svg { transition: transform .2s ease; }
@media (min-width: 901px) {
  #app { transition: grid-template-columns .2s ease; }
  #app.rail-open { grid-template-columns: 216px minmax(300px, 400px) minmax(0, 1fr) 0; }
  #app.rail-open.has-side { grid-template-columns: 216px minmax(300px, 400px) minmax(0, 1fr) 340px; }
  #app.rail-open .rail { align-items: stretch; padding: var(--s-4) var(--s-3); }
  #app.rail-open .rail .logo { align-self: flex-start; }
  #app.rail-open .rail button, #app.rail-open .rail .railbtn { width: auto; display: flex; align-items: center; justify-content: flex-start; gap: 12px; padding: 0 12px; }
  #app.rail-open .rail button::after, #app.rail-open .rail .railbtn::after { content: attr(data-label); font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #app.rail-open .rail svg { flex: none; }
  #app.rail-open .rail .av { border-radius: 12px; font-size: 13px; }
  #app.rail-open .rail #railToggle svg { transform: rotate(180deg); }
  #app.rail-open .rail .rdot { top: 10px; left: 28px; right: auto; }
}
@media (max-width: 900px) { #railToggle { display: none !important; } }
@media (prefers-reduced-motion: reduce) { #app, .rail #railToggle svg { transition: none; } }

/* ---- celular: compacta o que ocupava espaço além do devido (cabeçalho, filtros, avisos e campo de mensagem) ---- */
@media (max-width: 900px) {
  /* lista: filtros numa única linha que rola de lado (antes eram 2 linhas) */
  .lp-head { padding: max(12px, env(safe-area-inset-top)) 12px 6px; gap: 10px; }
  .lp-head h1 { font-size: 20px; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding: 0 12px 8px; gap: 6px; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs .chip { flex: none; padding: 5px 10px; font-size: 13px; }
  .lp-search { padding: 0 12px 8px; }
  #list { padding: 0 6px var(--s-3); }
  .conv { padding: 8px 10px 11px; gap: 10px; }

  /* conversa: cabeçalho mais baixo (avatar e botões menores) */
  #chatHead { padding: 6px 10px; gap: 4px 8px; }
  #chatHead #back { padding: 6px 8px; min-height: 34px; }
  #chatHead .avt { width: 36px; height: 36px; font-size: 12px; }
  #chatHead .who { flex: 1 1 calc(100% - 100px); } /* o nome ocupa a linha de cima; os botões vão para a de baixo */
  #chatHead #bPanel { margin-left: auto; }
  #chatHead .who strong { font-size: 15px; line-height: 1.25; }
  #chatHead .who small { font-size: 12px; line-height: 1.3; }
  #chatHead .who small.proto { font-size: 10.5px; }
  #chatHead button, #chatHead select { min-height: 34px; padding: 6px 9px; font-size: 13px; }
  .chips-h { padding-left: 44px; }

  /* mensagens, sugestões e campo de mensagem */
  #msgs { padding: 10px 8px; }
  #suggest { padding: 4px 10px 0; gap: 6px; }
  #suggest .sg-btn { padding: 5px 10px; font-size: 13px; min-height: 30px; }
  #composer { gap: 6px; padding: 6px 8px max(6px, env(safe-area-inset-bottom)); margin-top: 4px; }
  #attach, #mic { width: 40px; height: 40px; flex: none; }
  #composer textarea { min-height: 40px; padding: 9px 14px; border-radius: 20px; }
  #sendBtn { width: 42px; height: 42px; flex: none; }
}
@media (max-width: 900px) {
  .m { font-size: 15px; line-height: 1.38; padding: 7px 10px 4px; }
  .m .meta { margin-top: 2px; }
  .m .opts { margin: 6px -10px -4px; }
}
