/* Elozi: central operacional. Carregar após os estilos dos componentes. */
.message-entry{display:contents}
.inbox-copilot{flex-shrink:0;background:#fff;border-top:1px solid var(--line);max-height:36%;overflow:auto}
.inbox-copilot>summary{display:flex;align-items:center;gap:8px;padding:12px 18px;cursor:pointer;font-size:11px;font-weight:700;color:#406589;list-style:none}
.inbox-copilot>summary::after{content:'⌄';margin-left:auto;font-size:16px}
.inbox-copilot[open]>summary::after{content:'⌃'}
.inbox-copilot>summary span{font-weight:400;color:#7a8fa1;font-size:10px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.inbox-copilot>summary:focus-visible{outline:2px solid var(--accent);outline-offset:-3px}
.inbox-copilot #copilot-runs{max-height:none;overflow:visible}
.new-message-indicator{position:absolute;bottom:230px;align-self:center;z-index:3;border:1px solid #c7d6ed;background:#fff;color:var(--accent);padding:9px 14px;border-radius:20px;box-shadow:0 3px 15px #19314916;font-size:11px;display:flex;gap:7px;align-items:center}
.new-message-indicator[hidden]{display:none}
.chat-pane{position:relative}
.file-dragover{outline:2px dashed var(--accent);background:#edf3ff!important}
.voice-recorder{display:flex;align-items:center;gap:10px;margin:0;font-size:11px;color:#5f778d}
.voice-recorder button{min-height:38px}
.voice-recorder-status{display:flex;align-items:center;gap:8px;color:#5f778d}
.voice-recorder[data-voice-state="idle"] .voice-recorder-status{display:none}
.voice-recorder[data-voice-state="recording"] .voice-recorder-status{color:#a44247}
.composer-tools{flex-wrap:wrap}
.inbox-content .composer-area textarea{min-height:35px;max-height:110px}
.inbox-content .composer-area{padding:11px 14px}
.inbox-content .composer-note{font-size:9px}
.voice-recorder-timer{font-variant-numeric:tabular-nums}
.voice-recorder-controls{display:flex;align-items:center;gap:12px}
.voice-recorder[data-voice-state="recording"]{background:#fff3f1;border:1px solid #f4d7d2;padding:8px 10px;border-radius:9px}
@media(max-width:760px){.inbox-copilot{max-height:35%}.inbox-copilot>summary{padding:12px}.inbox-copilot>summary span{font-size:9px}.voice-recorder{flex-wrap:wrap;gap:8px}.voice-recorder button{min-height:44px}.new-message-indicator{bottom:205px}}

:root {
  --sidebar: 232px;
  --canvas: #f4f7fa;
  --ink: #193149;
  --muted: #607589;
  --line: #dfe7ee;
  --navy: #132b44;
  --mint: #94e7c7;
  --radius: 14px;
  --surface-shadow: 0 3px 14px #19314905;
}

/* Estrutura e navegação */
.app-shell { background: var(--canvas); }
.sidebar {
  width: var(--sidebar);
  padding: 24px 15px 0;
  border-right: 1px solid #0e2238;
  background: var(--navy);
}
.sidebar .wordmark { padding-inline: 9px; font-size: 26px; letter-spacing: -1px; }
.sidebar .wordmark small { font-size: 9px; letter-spacing: 1.5px; color: #b3c6d8; }
.sidebar .brand-logo { width: 38px; height: 38px; border-radius: 11px; }
.workspace-card {
  gap: 11px;
  margin: 23px 3px 20px;
  padding: 12px 11px;
  border: 1px solid #d3e1ee24;
  border-radius: 10px;
  background: #e6f0f808;
}
.workspace-card > div:last-child { min-width: 0; }
.workspace-card strong { font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.workspace-card small { font-size: 10px; line-height: 1.6; }
.workspace-card .avatar { width: 34px; height: 34px; }
.sidebar nav { padding: 0 0 12px; scrollbar-gutter: stable; }
.nav-group { margin-bottom: 19px; }
.nav-group:last-child { margin-bottom: 0; }
.sidebar nav .nav-label,
.sidebar > .nav-label {
  margin: 0 12px 8px;
  font-size: 9px;
  line-height: 1.5;
  letter-spacing: 1.5px;
  color: #9cb5cc;
}
.nav-item {
  min-height: 39px;
  margin-block: 2px;
  padding: 9px 12px;
  gap: 11px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.5;
  font-weight: 500;
  color: #c5d5e3;
  transition: background-color 120ms ease, color 120ms ease;
}
.nav-item .icon { width: 17px; height: 17px; color: #99b2c9; flex-shrink: 0; }
.nav-item > span:first-of-type { min-width: 0; }
.nav-item:hover { color: #fff; background: #e2edf80c; }
.nav-item.active { color: #fff; background: #d4e6f411; box-shadow: inset 3px 0 0 var(--mint); }
.nav-item.active .icon { color: var(--mint); }
.nav-count { margin-left: auto; border-radius: 5px; font-size: 10px; padding: 2px 7px; }
.sidebar-status {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 11px 12px;
  font-size: 10px;
  line-height: 1.6;
  color: #a9c0d4;
}
.sidebar-status .status-dot { width: 6px; height: 6px; background: var(--mint); }
.profile { padding: 14px 3px 17px; gap: 8px; border-top-color: #b6cadb23; }
.profile-open { gap: 10px; }
.profile strong { font-size: 12px; line-height: 1.5; }
.profile small { font-size: 10px; color: #a9c0d4; }
.profile .icon-button { min-width: 34px; min-height: 36px; width: 34px; height: 36px; }
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 19;
  background: #091b2f66;
  border: 0;
  padding: 0;
}

/* Contexto de trabalho: empresa e disponibilidade permanecem explícitas. */
.topbar {
  min-height: 79px;
  height: auto;
  padding: 13px 30px;
  gap: 18px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.breadcrumb { gap: 9px; font-size: 12px; white-space: nowrap; }
.breadcrumb > span { color: var(--muted); }
.breadcrumb strong { color: var(--ink); font-size: 13px; font-weight: 700; }
.breadcrumb .icon { width: 13px; height: 13px; }
.topbar-controls { gap: 10px; flex-wrap: wrap; align-items: center; }
.topbar-field { display: grid; gap: 4px; min-width: 0; margin: 0; }
.topbar-field > span,
.topbar-field > label {
  margin: 0 0 0 1px;
  font-size: 9px;
  line-height: 1.35;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: #647a8f;
  font-weight: 650;
}
.topbar-controls select {
  min-height: 34px;
  max-width: 185px;
  padding: 6px 27px 6px 10px;
  border-radius: 7px;
  border-color: #dce5ec;
  background: #f8fafc;
  font-size: 11px;
  font-weight: 600;
  color: #314c65;
}
.topbar-field #presence-select { max-width: 160px; }
.topbar-account {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-left: 1px solid var(--line);
  background: transparent;
  padding: 4px 0 4px 12px;
  margin-left: 2px;
  color: var(--ink);
  gap: 10px;
  cursor: pointer;
}
.topbar-account .avatar { width: 36px; height: 36px; font-size: 11px; border-radius: 50%; }
.topbar-account > span:not(.avatar) { text-align: left; font-size: 11px; }
.topbar-account strong { display: block; font-size: 12px; }
.topbar-account small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.local-tag { font-size: 10px; gap: 6px; white-space: nowrap; }
.sandbox-banner { min-height: 34px; padding: 8px 30px; font-size: 10px; line-height: 1.6; }
.sandbox-banner .build { margin-left: auto; flex-shrink: 0; }

/* Identités : la photo ne remplace les initiales qu'une fois chargée. */
.avatar { position: relative; overflow: hidden; border-radius: 50%; letter-spacing: .1px; }
.avatar-initials { display: inline-flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.avatar:not(.has-photo) img { visibility: hidden; }
.avatar.has-photo .avatar-initials { visibility: hidden; }
.brand-logo { overflow: hidden; }
.brand-logo img { width: 100%; height: 100%; object-fit: contain; }
.sidebar-status .text-button { margin-left: auto; min-height: 24px; height: 24px; font-size: 10px; color: #a9c0d4; }
.context-close { display: none; }
.brand-photo-row { display: flex; align-items: center; gap: 18px; padding: 0 0 24px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.brand-photo-row .profile-photo { width: 72px; height: 72px; border-radius: 16px; background: #edf3fa; color: #3157d5; flex-shrink: 0; }
.brand-photo-row .avatar img, .brand-preview .avatar img { object-fit: contain; }
.brand-photo-row strong { font-size: 14px; }
.brand-photo-row p { font-size: 12px; line-height: 1.7; margin: 5px 0 10px; color: var(--muted); }
.brand-photo-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.brand-photo-actions .file-picker { position: relative; margin: 0; overflow: hidden; cursor: pointer; }
.file-picker input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: pointer; }
.file-picker:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
.brand-photo-row small { display: block; font-size: 11px; line-height: 1.6; margin-top: 8px; color: var(--muted); }
.brand-preview .avatar.preview-mark { border-radius: 8px; }
.channel-avatar { width: 40px; height: 40px; background: #e3f3ee; color: #347968; font-size: 12px; flex-shrink: 0; }
@media (max-width: 1280px) { .conversation-context { position: relative; } .context-close { display: inline-flex; position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; } .conversation-context > .eyebrow { display: block; padding-right: 38px; } }
@media (max-width: 760px) { .sidebar-status .text-button { min-height: 44px; height: 44px; } .brand-photo-row { align-items: flex-start; gap: 12px; } .brand-photo-row .profile-photo { width: 58px; height: 58px; } }
.avatar-channel {
  position: absolute;
  right: -2px;
  bottom: -2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #e8f5ee;
  color: #277b57;
}
.avatar-channel .icon { width: 10px; height: 10px; }
.avatar:has(.avatar-channel) { overflow: visible; }
.profile .avatar, .workspace-card .avatar.navy { border-radius: 10px; }

/* Surfaces et typographie communes */
.content { padding: 30px; max-width: 1600px; }
.page-heading { align-items: center; gap: 22px; margin-bottom: 27px; }
.page-heading .eyebrow { display: block; margin-bottom: 8px; font-size: 10px; letter-spacing: 1.7px; color: #607b92; }
.page-heading h1 { font-size: clamp(27px, 2.1vw, 34px); letter-spacing: -1.15px; font-weight: 750; line-height: 1.25; }
.page-heading p { font-size: 13px; color: var(--muted); line-height: 1.75; margin-top: 9px; }
.heading-actions { flex-shrink: 0; }
.button { min-height: 41px; font-size: 12px; border-radius: 8px; padding: 10px 15px; letter-spacing: 0; }
.button.primary { box-shadow: 0 2px 5px #3157d51a; }
.button.primary:hover { box-shadow: 0 4px 10px #3157d524; }
.text-button { font-size: 12px; min-height: 38px; line-height: 1.5; }
.icon-button { min-width: 37px; min-height: 37px; border-radius: 8px; }
.badge { font-size: 10px; line-height: 1.5; border-radius: 5px; padding: 4px 7px; }
.panel { border-radius: 14px; border-color: var(--line); box-shadow: var(--surface-shadow); }
.panel-heading { padding: 23px 24px 21px; gap: 14px; }
.panel-heading h2 { font-size: 17px; letter-spacing: -.5px; }
.panel-heading p { font-size: 12px; line-height: 1.7; margin-top: 5px; }
.panel-foot { font-size: 11px; line-height: 1.65; padding: 13px 24px; }
.table-scroll th { font-size: 10px; font-weight: 650; letter-spacing: .5px; }
.table-scroll td { font-size: 12px; padding-top: 18px; padding-bottom: 18px; }
.table-identity { gap: 12px; }
.table-identity .avatar { width: 39px; height: 39px; font-size: 12px; }
.table-identity strong { font-size: 13px; line-height: 1.6; }
.table-identity small { font-size: 11px; line-height: 1.6; }
.cell-detail { font-size: 11px; line-height: 1.6; }
.table-scroll tbody tr:hover { background: #f8fbfd; }
.crm-toolbar { gap: 16px; padding: 20px 24px; }
.crm-toolbar .search-field { margin: 0; }
.crm-toolbar .checkbox-label { font-size: 12px; }
.crm-toolbar select, #billing-status { min-height: 44px; padding: 8px 30px 8px 12px; border: 1px solid var(--line); border-radius: 9px; color: var(--navy); background: var(--surface,#fff); font: inherit; }
.account-grid { align-items: start; }
.account-security table { min-width: 0; width: 100%; }
.account-security td, .account-security th { padding: 10px 8px; overflow-wrap: anywhere; }
.account-security .panel-heading { flex-wrap: wrap; gap: 12px; }
.support-banner { display: flex; gap: 10px; align-items: center; padding: 8px 24px; background: #fff5db; color: #715521; font-size: 12px; }
.support-banner span { flex: 1; }
.support-banner .button { min-height: 36px; white-space: nowrap; }
.settings-card fieldset { min-width: 0; }
.contact-labels .badge { font-size: 10px; }
.row-actions { gap: 11px; }
.row-actions .text-button { font-size: 11px; }

/* Visão geral e canais */
.metrics { gap: 18px; margin-bottom: 24px; }
.metric { position: relative; padding: 22px; min-height: 151px; border-radius: 13px; background: #fff; box-shadow: var(--surface-shadow); }
.metric-top { font-size: 12px; color: #577085; line-height: 1.55; }
.metric-icon { width: 35px; height: 35px; border-radius: 10px; }
.metric-value { margin-top: 12px; font-size: 39px; line-height: 1.15; font-weight: 700; letter-spacing: -1.7px; font-variant-numeric: tabular-nums; }
.metric-detail { font-size: 11px; margin-top: 8px; line-height: 1.6; }
.overview-grid { grid-template-columns: minmax(0, 1.6fr) minmax(290px, 1fr); gap: 24px; margin-bottom: 24px; }
.bar-row { gap: 15px; }
.bar-label { font-size: 12px; }
.bar-label small { font-size: 10px; line-height: 1.5; }
.bar-track { height: 6px; border-radius: 6px; background: #edf2f7; }
.bar-fill { border-radius: 6px; }
.agent-highlight { border-radius: 14px; padding: 28px; background: var(--navy); }
.agent-highlight h2 { margin-top: 23px; font-size: 26px; line-height: 1.3; font-weight: 650; letter-spacing: -.8px; }
.agent-highlight p { font-size: 12px; line-height: 1.8; color: #b9cede; }
.agent-highlight .provider-stack { margin-block: 21px; }
.agent-highlight .integration-note { font-size: 10px; line-height: 1.6; color: #b9cede; }
.bottom-note { font-size: 11px; line-height: 1.7; margin-top: 22px; }
.channel-actions { gap: 15px; flex-wrap: wrap; }
.channel-icon { width: 36px; height: 36px; border-radius: 10px; }
.section-title { font-size: 18px; letter-spacing: -.5px; margin-block: 29px 18px; }
.capability-grid { gap: 18px; }
.capability { padding: 23px; border-radius: 13px; border-color: var(--line); box-shadow: var(--surface-shadow); }
.capability h3 { font-size: 15px; line-height: 1.5; letter-spacing: -.3px; }
.capability p { font-size: 12px; line-height: 1.8; color: var(--muted); }
.agent-card > p, .tenant-card > p { font-size: 12px; line-height: 1.8; }

/* L'espace de conversation occupe la hauteur disponible en desktop. */
.app-shell[data-view="inbox"] .main-shell { display: flex; flex-direction: column; height: 100dvh; min-height: 670px; }
.app-shell[data-view="inbox"] .topbar,
.app-shell[data-view="inbox"] .sandbox-banner { flex-shrink: 0; }
.app-shell[data-view="inbox"] .inbox-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 20px 25px 24px;
}
.inbox-heading, .inbox-content > .page-heading { flex-shrink: 0; margin-bottom: 17px; }
.inbox-content > .page-heading { margin-bottom: 14px; align-items: center; }
.inbox-content > .page-heading .eyebrow, .inbox-content > .page-heading p { display: none; }
.inbox-heading .eyebrow, .inbox-content > .page-heading .eyebrow { margin-bottom: 5px; font-size: 9px; }
.inbox-heading h1, .inbox-content > .page-heading h1 { font-size: 25px; letter-spacing: -.75px; line-height: 1.3; }
.inbox-heading p, .inbox-content > .page-heading p { font-size: 12px; margin-top: 5px; }
.inbox-workspace {
  position: relative;
  grid-template-columns: 300px minmax(0, 1fr) 265px;
  grid-template-rows: minmax(0, 1fr);
  flex: 1;
  min-height: 420px;
  height: auto;
  max-height: none;
  border-radius: 13px;
  border-color: #dbe5ee;
  box-shadow: 0 4px 18px #19314906;
}
.inbox-workspace.context-collapsed { grid-template-columns: 300px minmax(0, 1fr); }
.inbox-workspace.context-collapsed .conversation-context { display: none; }
.conversation-list { display: flex; flex-direction: column; min-height: 0; background: #fbfcfe; }
.list-title { padding: 20px 18px 16px; flex-shrink: 0; }
.list-title h2 { font-size: 14px; font-weight: 750; letter-spacing: -.25px; }
.search-field { padding: 9px 10px; margin: 0 15px 11px; border-radius: 8px; background: #fff; }
.search-field .icon { color: #6c869c; width: 16px; height: 16px; }
.search-field input { padding: 2px; font-size: 12px; color: var(--ink); }
.search-field:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.conversation-list > .search-field,
.conversation-list > select,
.conversation-list > .inbox-tabs { flex-shrink: 0; }
.conversation-list > select { font-size: 11px; min-height: 36px; border-radius: 7px; color: #416079; }
.conversation-list > #conversation-status-filter { margin-top: 8px; }
.inbox-tabs { gap: 3px; padding: 3px; margin: 14px 15px 11px; background: #edf2f7; border-radius: 8px; }
.inbox-tabs button { min-height: 32px; font-size: 11px; border-radius: 6px; color: #597187; }
.inbox-tabs button.selected { background: #fff; color: var(--accent); box-shadow: 0 1px 4px #19314912; font-weight: 700; }
#conversation-items { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.conversation-item { min-height: 100px; padding: 17px 16px; gap: 12px; background: transparent; border-bottom-color: #e7eef4; }
.conversation-item.selected { padding-left: 13px; background: #eaf1fb; }
.conversation-item:hover { background: #f0f5fb; }
.conversation-item .avatar { width: 40px; height: 40px; font-size: 12px; border-radius: 50%; margin-top: 1px; }
.conversation-name { font-size: 13px; line-height: 1.55; font-weight: 700; color: #29465f; gap: 8px; }
.conversation-name small { flex-shrink: 0; font-size: 10px; line-height: 1.5; color: #637f95; }
.conversation-last { font-size: 12px; color: #617a90; line-height: 1.65; margin-top: 4px; }
.conversation-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; font-size: 10px; line-height: 1.5; margin-top: 7px; color: #607c92; }
.conversation-tags > span:first-child { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-tags .badge { font-size: 9px; padding: 2px 5px; }
.unread-dot { width: 6px; height: 6px; flex-shrink: 0; }
.chat-pane { min-height: 0; background: #f6f9fc; }
.chat-header { padding: 17px 20px; gap: 13px; min-height: 79px; flex-shrink: 0; }
.chat-header .avatar { width: 42px; height: 42px; font-size: 13px; }
.chat-header > div { min-width: 0; }
.chat-header h2 { font-size: 15px; line-height: 1.5; letter-spacing: -.3px; overflow-wrap: anywhere; }
.chat-header small { margin-top: 4px; font-size: 11px; line-height: 1.5; color: #647e94; }
.chat-header .badge { font-size: 10px; }
.chat-header [data-action="toggle-context"] { flex-shrink: 0; }
.chat-scope { flex-shrink: 0; line-height: 1.7; font-size: 10px; padding: 9px 20px; background: #f2f6fa; color: #637f95; }
.messages { min-height: 100px; max-height: none; padding: 25px 24px; gap: 17px; background: #f6f9fc; overscroll-behavior: contain; }
.inbox-content .handoff-banner { padding: 10px 12px; min-height: 42px; margin-bottom: 10px; }
.inbox-content .handoff-banner > span { font-size: 11px; }
.inbox-content .handoff-banner .text-button { min-height: 28px; font-size: 11px; }
.message { font-size: 13px; line-height: 1.75; padding: 12px 15px; max-width: 84%; border-radius: 12px; box-shadow: 0 1px 3px #19314905; }
.message.incoming { background: #fff; border-color: #dfe8ef; color: #35516a; }
.message.outgoing { background: #e4f0eb; border-color: #d2e7dc; color: #315e4c; }
.message small, .message.incoming small { font-size: 10px; line-height: 1.5; margin-top: 7px; }
.composer-area { flex-shrink: 0; padding: 14px 17px 15px; background: #fff; }
.composer-area form { border-color: #dbe5ee; padding: 12px; border-radius: 10px; background: #fff; }
.composer-area form:focus-within { border-color: #92abe5; box-shadow: 0 0 0 3px #3157d50b; }
.composer-area textarea { font-size: 13px; line-height: 1.8; min-height: 52px; color: #31516c; }
.composer-area textarea::placeholder { color: #8095a8; }
.composer-footer { gap: 11px; align-items: center; }
.composer-footer .button { min-height: 37px; padding: 8px 12px; font-size: 11px; }
.composer-footer .text-button { font-size: 11px; }
.composer-footer .icon { width: 15px; height: 15px; }
.composer-note { font-size: 10px; line-height: 1.7; }
.handoff-banner { line-height: 1.7; font-size: 11px; gap: 12px; padding: 11px 12px; border-radius: 8px; }
.copilot-card { max-height: 165px; margin: 0 17px 13px; flex-shrink: 0; padding: 13px 15px; }
.copilot-card p { font-size: 12px; }
.conversation-context { display: block; min-height: 0; padding: 23px 20px; font-size: 12px; overflow-y: auto; overscroll-behavior: contain; }
.conversation-context > .eyebrow { font-size: 9px; line-height: 1.5; color: #6b8295; }
.context-person { display: block; padding: 21px 0; }
.context-person .avatar { width: 64px; height: 64px; border-radius: 50%; font-size: 21px; }
.context-person h3 { font-size: 14px; line-height: 1.6; margin-top: 13px; overflow-wrap: anywhere; }
.context-person p { font-size: 11px; line-height: 1.7; margin-top: 4px; }
.conversation-context .context-section { padding-block: 20px; border-bottom: 1px solid #e5ecf2; }
.context-title { font-size: 11px; color: #617c92; line-height: 1.6; }
.context-section p { font-size: 12px; line-height: 1.75; }
.context-section .attendant-name { font-size: 13px; color: #294c67; }
.context-section .button { font-size: 11px; min-height: 37px; border-radius: 7px; padding: 8px 10px; }
.context-section form { display: block; }
.context-section label { font-size: 11px; line-height: 1.7; }
.context-section form input, .context-section form select, .context-section > select { font-size: 11px; min-height: 36px; }
.context-version { font-size: 10px; line-height: 1.7; margin-top: 20px; }
.context-version p { font-size: 10px; line-height: 1.7; }

/* Estados vazios e retorno das ações: orientação útil em cada contexto. */
.empty { font-size: 12px; line-height: 1.8; color: #6b8398; padding: 35px 23px; }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 42px 27px; gap: 11px; min-height: 240px; color: var(--muted); }
.empty-symbol { display: inline-flex; align-items: center; justify-content: center; width: 58px; height: 58px; border-radius: 18px; margin-bottom: 7px; color: #6480a1; background: #eaf0f7; border: 1px solid #e0e8f1; }
.empty-symbol .icon { width: 25px; height: 25px; }
.empty-state h2, .empty-state h3 { font-size: 16px; line-height: 1.55; letter-spacing: -.35px; color: #375570; margin: 0; }
.empty-state p { font-size: 12px; line-height: 1.8; max-width: 310px; margin: 0; }
.empty-state .button { margin-top: 8px; }
.chat-pane > .empty-state { flex: 1; }
.conversation-list .empty-state { min-height: 220px; padding-inline: 23px; }
.crm-empty { padding: 42px 24px; }
.crm-empty h3 { font-size: 16px; line-height: 1.5; }
.crm-empty p { font-size: 12px; line-height: 1.8; }

/* Clavier et mouvement */
.app-shell button:focus-visible,
.app-shell a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.sidebar button:focus-visible,
.sidebar a:focus-visible { outline-color: var(--mint); }
.app-shell button:disabled { cursor: not-allowed; }
.topbar-account:focus-visible { border-radius: 8px; }

@media (min-width: 1550px) {
  :root { --sidebar: 245px; }
  .content { padding: 38px 40px; }
  .topbar { padding-inline: 40px; }
  .sandbox-banner { padding-inline: 40px; }
  .app-shell[data-view="inbox"] .inbox-content { padding: 23px 30px 28px; }
  .inbox-workspace { grid-template-columns: 325px minmax(0, 1fr) 290px; }
  .inbox-workspace.context-collapsed { grid-template-columns: 325px minmax(0, 1fr); }
  .conversation-context { padding-inline: 24px; }
}

@media (min-width: 761px) and (max-width: 1280px) {
  :root { --sidebar: 213px; }
  .sidebar { padding-inline: 12px; }
  .topbar { padding-inline: 23px; gap: 14px; }
  .topbar-controls { gap: 8px; }
  .topbar-controls select { max-width: 152px; font-size: 10px; padding-right: 22px; }
  .topbar-account > span:not(.avatar) { display: none; }
  .content { padding-inline: 24px; }
  .overview-grid { gap: 20px; grid-template-columns: minmax(0, 1.3fr) minmax(260px, 1fr); }
  .metric { padding: 19px 17px; }
  .metric-top { font-size: 11px; }
  .metric-value { font-size: 35px; }
  .app-shell[data-view="inbox"] .inbox-content { padding-inline: 20px; }
  .inbox-workspace, .inbox-workspace.context-collapsed { grid-template-columns: 270px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
  .conversation-context {
    display: block;
    position: absolute;
    inset: 0 0 0 auto;
    z-index: 5;
    grid-column: auto;
    width: min(300px, 80%);
    border-left: 1px solid var(--line);
    border-top: 0;
    box-shadow: -8px 0 22px #19314912;
    background: #fff;
  }
  .context-person { display: block; }
  .conversation-context .context-section { padding-block: 20px; }
  .context-section form { display: block; }
  .messages { padding-inline: 18px; }
  .chat-header { padding-inline: 17px; }
  .chat-header .badge { max-width: 105px; text-align: center; font-size: 9px; }
}

@media (min-width: 761px) and (max-width: 1020px) {
  .topbar { align-items: flex-start; flex-wrap: wrap; }
  .breadcrumb { min-height: 33px; }
  .topbar-controls { margin-left: auto; }
  .topbar-controls .local-tag { display: none; }
  .overview-grid { grid-template-columns: 1fr; }
  .agent-highlight { display: grid; grid-template-columns: 1fr 1fr; column-gap: 25px; align-items: center; }
  .agent-highlight .agent-top { grid-column: 1 / -1; }
  .agent-highlight h2 { margin-top: 18px; }
  .agent-highlight .provider-stack { margin-block: 12px; }
  .agent-highlight > p { margin: 18px 0 0; }
  .agent-highlight .button { justify-self: start; }
  .agent-highlight .integration-note { margin-left: 0; }
  .inbox-workspace, .inbox-workspace.context-collapsed { grid-template-columns: 240px minmax(0, 1fr); }
  .conversation-item { padding-inline: 12px; gap: 9px; }
  .conversation-item.selected { padding-left: 9px; }
  .conversation-item .avatar { width: 35px; height: 35px; }
  .conversation-name { font-size: 12px; }
  .conversation-name small { font-size: 9px; }
  .chat-header { gap: 9px; padding-inline: 13px; flex-wrap: wrap; }
  .chat-header h2 { font-size: 14px; }
  .chat-header .avatar { width: 37px; height: 37px; }
  .chat-header .badge { font-size: 9px; }
  .composer-footer { flex-wrap: wrap; }
  .message { max-width: 90%; }
}

@media (max-width: 760px) {
  :root { --sidebar: 0px; }
  .sidebar { width: 246px; padding: 25px 15px 0; box-shadow: 15px 0 45px #132b4429; }
  .sidebar.mobile-open ~ .sidebar-overlay,
  .sidebar-overlay.open { display: block; }
  .sidebar .nav-item { min-height: 44px; padding-block: 11px; }
  .sidebar .profile .icon-button { min-width: 40px; min-height: 44px; }
  .topbar { min-height: 65px; padding: 15px 17px; gap: 12px; }
  .breadcrumb { gap: 8px; font-size: 11px; }
  .breadcrumb strong { font-size: 12px; }
  .breadcrumb .mobile-menu .icon { width: 18px; height: 18px; }
  .topbar-controls { display: flex; width: 100%; gap: 8px; justify-content: flex-start; margin-left: 0; align-items: flex-end; }
  .topbar-field { flex: 1 1 135px; min-width: 0; }
  .topbar-field > span, .topbar-field > label { font-size: 9px; }
  .topbar-controls select, .topbar-controls #workspace-select { width: 100%; max-width: none; font-size: 12px; min-height: 44px; flex: none; }
  .topbar-field #presence-select { max-width: none; }
  .topbar-controls .local-tag { display: none; }
  .topbar-account { padding: 3px 0 3px 9px; min-height: 44px; }
  .topbar-account > span:not(.avatar) { display: none; }
  .topbar-account .avatar { width: 34px; height: 34px; }
  .sandbox-banner { min-height: 34px; padding: 8px 17px; gap: 8px; font-size: 10px; }
  .sandbox-banner > span:not(.build) { min-width: 0; }
  .content { padding: 25px 17px 30px; }
  .page-heading { align-items: flex-start; gap: 16px; margin-bottom: 23px; }
  .page-heading h1 { font-size: 27px; }
  .page-heading p { font-size: 12px; }
  .heading-actions { flex-wrap: wrap; width: 100%; gap: 9px; }
  .button, .icon-button, .text-button { min-height: 44px; }
  .metrics { gap: 12px; margin-bottom: 20px; }
  .metric { padding: 17px 15px; min-height: 145px; }
  .metric-top { font-size: 11px; align-items: flex-start; gap: 8px; }
  .metric-icon { width: 29px; height: 29px; flex-shrink: 0; border-radius: 8px; }
  .metric-value { font-size: 33px; margin-top: 10px; }
  .metric-detail { font-size: 10px; line-height: 1.6; }
  .overview-grid { grid-template-columns: 1fr; gap: 19px; margin-bottom: 20px; }
  .panel-heading { padding: 21px 19px; align-items: flex-start; }
  .panel-heading h2 { font-size: 16px; line-height: 1.6; }
  .panel-heading p { font-size: 11px; }
  .panel-foot { padding: 13px 19px; font-size: 10px; }
  .agent-highlight { display: block; padding: 25px; }
  .agent-highlight h2 { font-size: 25px; }
  .agent-highlight p { font-size: 12px; }
  .agent-highlight .integration-note { display: block; margin: 12px 0 0; }
  .capability-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .capability { padding: 18px 15px; }
  .capability h3 { font-size: 13px; }
  .capability p { font-size: 11px; min-height: 0; }
  .crm-toolbar { padding: 18px; gap: 12px; }
  .table-scroll td { padding-block: 16px; }
  .app-shell[data-view="inbox"] .main-shell { height: auto; min-height: 100dvh; }
  .app-shell[data-view="inbox"] .inbox-content { display: block; padding: 21px 14px 27px; }
  .inbox-heading, .inbox-content > .page-heading { margin-bottom: 18px; padding-inline: 3px; }
  .inbox-heading h1, .inbox-content > .page-heading h1 { font-size: 24px; }
  .inbox-heading p, .inbox-content > .page-heading p { font-size: 11px; }
  .inbox-workspace, .inbox-workspace.context-collapsed { display: flex; flex-direction: column; height: auto; min-height: 0; max-height: none; border-radius: 12px; }
  .conversation-list { display: block; overflow-y: visible; }
  .list-title { padding: 18px 17px 14px; }
  .conversation-list > select { min-height: 44px; font-size: 12px; }
  .search-field { padding: 11px; }
  .search-field input { font-size: 16px; }
  .inbox-tabs { margin-top: 13px; margin-bottom: 8px; }
  .inbox-tabs button { min-height: 41px; font-size: 11px; }
  #conversation-items { display: flex; min-height: 0; max-height: 134px; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x proximity; padding-bottom: 3px; }
  .conversation-item { flex: 0 0 265px; width: 265px; min-width: 265px; min-height: 113px; padding: 16px 14px; gap: 11px; border-right: 1px solid #e4ecf3; scroll-snap-align: start; }
  .conversation-item.selected { padding-left: 14px; border-bottom: 3px solid var(--accent); }
  .conversation-item .avatar { width: 37px; height: 37px; }
  .conversation-name { font-size: 12px; }
  .conversation-last { font-size: 11px; }
  .conversation-tags { font-size: 9px; }
  .chat-pane { min-height: 550px; }
  .chat-header { gap: 10px; padding: 17px 16px; flex-wrap: wrap; }
  .chat-header > div { flex: 1; min-width: 135px; }
  .chat-header h2 { font-size: 14px; }
  .chat-header small { font-size: 10px; }
  .chat-header .avatar { width: 39px; height: 39px; }
  .chat-header .badge { font-size: 9px; }
  .chat-scope { padding-inline: 16px; font-size: 9px; }
  .messages { min-height: 270px; max-height: 460px; padding: 22px 16px; gap: 15px; }
  .message { max-width: 90%; font-size: 13px; padding: 11px 13px; }
  .composer-area { padding: 13px 14px 15px; }
  .composer-area textarea { font-size: 16px; line-height: 1.6; }
  .composer-footer { gap: 8px; flex-wrap: wrap; }
  .composer-footer .button, .composer-footer .text-button { min-height: 44px; font-size: 11px; }
  .handoff-banner { flex-wrap: wrap; padding: 12px; }
  .conversation-context { display: block; position: static; inset: auto; width: 100%; min-height: 0; grid-column: auto; padding: 23px 20px; border-left: 0; border-top: 1px solid var(--line); box-shadow: none; }
  .context-person { display: block; }
  .context-section form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .context-section form label { margin: 0; }
  .context-section form label:nth-child(3), .context-section form .button, .context-section form .form-error { grid-column: 1 / -1; }
  .context-section form input, .context-section form select, .context-section > select { min-height: 44px; font-size: 16px; }
  .context-section .button { min-height: 44px; }
  .empty-state { min-height: 260px; padding: 35px 25px; }
  .conversation-list .empty-state { min-width: 100%; min-height: 120px; padding: 18px 20px; gap: 7px; }
  .conversation-list .empty-state .empty-symbol { display: none; }
}

@media (max-width: 400px) {
  .topbar-controls { gap: 8px; }
  .topbar-field { flex-basis: 120px; }
  .metric { padding: 16px 12px; }
  .metric-top { font-size: 10px; }
  .metric-icon { width: 25px; height: 25px; }
  .capability-grid { grid-template-columns: 1fr; }
  .context-section form { display: block; }
  .context-section form label { margin-bottom: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .nav-item, .sidebar, .button, .icon-button { transition: none; }
  #conversation-items { scroll-behavior: auto; scroll-snap-type: none; }
}

/* A caixa móvel alterna lista e conversa, mantendo o compositor visível. */
.mobile-inbox-back { display: none; }
@media (max-width: 760px) {
  .app-shell[data-view="inbox"] .main-shell { height: 100dvh; min-height: 0; }
  .app-shell[data-view="inbox"] { height: 100dvh; overflow: hidden; }
  .topbar { position: relative; }
  .topbar-controls { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr) 38px; align-items: end; gap: 8px; }
  .topbar-controls .topbar-field { width: auto; min-width: 0; max-width: none; }
  .topbar-controls .topbar-field:has(#workspace-select) { grid-column: 1 / -1; }
  .topbar-controls .topbar-field select { width: 100%; min-width: 0; }
  .topbar-controls .topbar-account { position: absolute; top: 12px; right: 15px; margin: 0; }
  .topbar-controls > .icon-button { align-self: end; height: 40px; width: 38px; margin: 0; }
  .app-shell[data-view="inbox"] .inbox-content { display: flex; min-height: 0; padding: 12px 14px 14px; }
  .inbox-content > .page-heading { display: flex; flex-direction: row; gap: 10px; align-items: center; margin-bottom: 12px; }
  .inbox-content > .page-heading h1 { font-size: 20px; }
  .inbox-content > .page-heading .heading-actions { margin: 0; }
  .inbox-content > .page-heading .button { min-height: 38px; font-size: 11px; padding: 8px 10px; }
  .inbox-workspace, .inbox-workspace.context-collapsed { display: flex; flex-direction: column; flex: 1; min-height: 0; height: auto; overflow: hidden; }
  .inbox-workspace .conversation-list { display: flex; flex: 1; min-height: 0; border: 0; max-height: none; padding: 0; }
  .inbox-workspace #conversation-items { display: block; flex: 1; min-height: 0; max-height: none; overflow-x: hidden; overflow-y: auto; white-space: normal; scroll-snap-type: none; }
  .inbox-workspace .conversation-item { display: flex; width: 100%; min-width: 0; min-height: 94px; margin: 0; padding: 14px 15px; border-right: 0; border-bottom: 1px solid #e7eef4; }
  .inbox-workspace .conversation-item.selected { padding-left: 12px; border-left: 3px solid var(--accent); }
  .inbox-workspace .chat-pane { display: none; }
  .inbox-workspace .conversation-context { display: none; }
  .inbox-workspace.mobile-chat .conversation-list { display: none; }
  .inbox-workspace.mobile-chat .chat-pane { display: flex; flex-direction: column; flex: 1; width: 100%; min-width: 0; min-height: 0; }
  .mobile-inbox-back { display: inline-flex; width: 34px; height: 42px; min-width: 34px; }
  .mobile-inbox-back .icon { transform: rotate(180deg); }
  .inbox-workspace .chat-header { padding: 12px; gap: 8px; min-height: 72px; }
  .inbox-workspace .chat-header h2 { font-size: 13px; }
  .inbox-workspace .chat-header small { font-size: 10px; }
  .inbox-workspace .chat-header .badge { display: none; }
  .inbox-workspace .chat-header .avatar { width: 36px; height: 36px; flex-shrink: 0; }
  .inbox-workspace .messages { flex: 1; min-height: 60px; padding: 18px 14px; }
  .inbox-workspace .message { max-width: 94%; font-size: 12px; }
  .inbox-workspace .composer-area { padding: 10px; }
  .inbox-workspace .composer-note { font-size: 9px; line-height: 1.6; }
  .inbox-workspace:not(.context-collapsed).mobile-chat .conversation-context { display: block; position: absolute; inset: 0; width: 100%; max-height: 100%; padding: 22px; z-index: 8; border: 0; background: #fff; overflow-y: auto; }
  .conversation-context > .eyebrow { display: block; padding-right: 44px; }
  .conversation-context .context-close { top: 10px; right: 10px; }
}
