
:root[data-view="conversas"] .workspace { padding: 0; overflow: hidden; }
:root[data-view="conversas"] .topbar-actions[data-screen] { display: flex !important; gap: 8px; }
:root:not([data-view="conversas"]) .live-dot[data-screen] { display: flex !important; }
:root[data-view="conversas"] .inbox-view[data-screen] { height: 100%; min-height: 0; }
.inbox-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(260px, 322px) minmax(0, 1fr);
  height: 100%;
  min-height: 0;
}
.inbox-grid.with-details { grid-template-columns: minmax(260px, 322px) minmax(0, 1fr) 286px; }
.inbox-list { min-height: 0; display: flex; flex-direction: column; background: var(--card); border-right: 1px solid var(--border); }
.inbox-filters { display: grid; gap: 11px; padding: 16px 15px 12px; border-bottom: 1px solid var(--border); }
.inbox-filter-top, .chat-row-top, .chat-row-subtitle { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.inbox-filter-top h1 { font-size: 25px; }
#inbox-account-count { color: var(--muted); font-size: 11px; text-align: right; }
.chat-filters { display: flex; gap: 6px; }
.chat-filters button {
  min-height: 25px;
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--raised);
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}
.chat-filters button[aria-pressed="true"] { background: var(--selected); border-color: var(--selected); color: var(--accent); }
.chat-list, .thread-scroll, .thread-panel { min-height: 0; overflow: auto; scrollbar-width: thin; }
.chat-list { flex: 1; }
.chat-list-empty { padding: 15px; font-size: 13px; }
.more-chats { margin: 8px 15px 12px; }
.chat-row {
  width: 100%;
  min-height: 73px;
  padding: 11px 15px 11px 16px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--ink);
  text-align: left;
}
.chat-row:hover { background: var(--raised); }
.chat-row:focus-visible { outline-offset: -2px; }
.chat-row[aria-current="true"] { box-shadow: inset 2px 0 var(--accent); background: var(--selected); }
.chat-avatar {
  display: grid;
  flex: none;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--raised);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}
.chat-avatar[data-tone="1"], .chat-avatar[data-tone="3"] { background: var(--selected); color: var(--accent); }
.chat-avatar[data-tone="4"] { color: var(--attention); }
.chat-row-top strong, .chat-preview, .chat-account, .thread-title h2, .thread-title p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-row time { flex: none; color: var(--muted); font-size: 11px; }
.chat-row[aria-current="true"] time { color: var(--accent); }
.chat-row-subtitle { margin-top: 4px; color: var(--muted); font-size: 12px; }
.chat-account { flex: none; max-width: 47%; font-size: 10px; color: var(--muted); }
.thread { min-height: 0; min-width: 0; background: var(--canvas); }
.thread-idle { height: 100%; display: grid; align-content: center; justify-items: center; gap: 8px; padding: 24px; text-align: center; }
.thread-symbol { display: grid; place-items: center; width: 46px; height: 46px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--card); color: var(--muted); }
.thread-symbol .icon { width: 22px; height: 22px; }
.thread-content { height: 100%; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.thread-head, .thread-panel header {
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
}
.thread-title { flex: 1; min-width: 0; }
.thread-title h2 { font-size: 16px; }
.thread-title p { margin-top: 2px; font-size: 12px; }
.thread-source { padding: 4px 8px; border-radius: var(--radius); background: var(--selected); color: var(--accent); font-weight: 650; max-width: 30%; }
.thread-back { display: none; }
.thread-scroll { display: flex; flex-direction: column; align-items: stretch; padding: 18px clamp(12px, 2vw, 24px); }
.older-messages { align-self: center; margin-bottom: 12px; }
.thread-feedback { text-align: center; font-size: 12px; margin: 8px auto; }
.messages-list { display: grid; gap: 11px; margin-top: auto; }
.message-row { display: flex; }
.message-row.mine { justify-content: flex-end; }
.message-bubble {
  display: grid;
  gap: 4px;
  max-width: min(86%, 560px);
  min-width: 0;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--raised);
}
.mine .message-bubble { background: var(--selected); border-color: var(--selected); }
.message-bubble p { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); }
.message-bubble time { justify-self: end; color: var(--muted); font-size: 11px; }
.message-sender { color: var(--accent); font-size: 11px; }
.message-bubble audio, .composer-preview audio { display: block; max-width: 100%; height: 36px; }
.composer { display: grid; gap: 8px; padding: 12px 17px; border-top: 1px solid var(--border); background: var(--card); }
.composer-actions, .composer-preview { display: flex; align-items: center; gap: 7px; }
.composer-preview { justify-content: flex-end; flex-wrap: wrap; }
.composer-actions button { flex: none; }
.composer-actions textarea { flex: 1; min-width: 0; max-height: 130px; resize: vertical; }
.composer-actions output { color: var(--alert); font-size: 12px; font-variant-numeric: tabular-nums; }
#record-audio[data-recording] { color: var(--alert); }
.thread-panel { background: var(--card); border-left: 1px solid var(--border); }
#thread-backdrop { display: none; }
.thread-panel header { justify-content: space-between; padding-inline: 15px; }
.thread-details-body { display: grid; align-content: start; justify-items: start; gap: 13px; padding: 15px; }
.thread-person { display: flex; align-items: center; gap: 9px; width: 100%; }
.thread-person div { min-width: 0; }
.thread-person p { font-size: 12px; overflow-wrap: anywhere; }
.thread-details-body dl { width: 100%; padding-top: 13px; border-top: 1px solid var(--border); }
.thread-details-body dt { font-size: 12px; }
.thread-details-body dd { margin: 3px 0 11px; font-weight: 650; overflow-wrap: anywhere; }

@media (max-width: 1100px) {
  .inbox-grid.with-details { grid-template-columns: minmax(225px, 285px) minmax(0, 1fr); }
  #thread-backdrop { display: block; position: absolute; inset: 0; z-index: 1; background: #0007; }
  .thread-panel { position: absolute; top: 0; right: 0; bottom: 0; z-index: 2; width: min(286px, 100%); box-shadow: -12px 0 28px #0005; }
}
@media (max-width: 900px) {
  .inbox-grid, .inbox-grid.with-details { grid-template-columns: minmax(220px, 275px) minmax(0, 1fr); }
  .thread-head { padding-inline: 12px; }
  .thread-source { display: none; }
}
@media (max-width: 740px) {
  .inbox-grid, .inbox-grid.with-details { display: block; }
  .inbox-list, .thread { height: 100%; }
  .inbox-list { border-right: 0; }
  .inbox-grid:not(.has-thread) .thread, .inbox-grid.has-thread .inbox-list { display: none; }
  .thread-back { display: inline-flex; }
  .thread-head { min-height: 63px; gap: 7px; }
  .thread-head .chat-avatar { width: 36px; height: 36px; }
  .thread-title h2 { font-size: 14px; }
  #thread-details span { display: none; }
  #thread-details { width: 36px; padding: 0; }
  .composer { padding-inline: 8px; }
  .composer-actions { gap: 5px; }
  :root[data-view="conversas"] .breadcrumb > span,
  :root[data-view="conversas"] .breadcrumb > .for-conversas[data-screen] { display: none !important; }
  .topbar-actions button { font-size: 12px; padding-inline: 8px; }
  .topbar-actions .import-label { display: none; }
}

