/* Ferramentas globais: WhatsApp ativo e conta do operador. */
.app{grid-template-rows:64px minmax(0,1fr)}
.side{grid-column:1;grid-row:1 / 3}
.topbar{grid-column:2;grid-row:1;display:flex;align-items:center;gap:12px;position:sticky;top:0;z-index:30;height:64px;padding:0 36px;background:var(--surface);border-bottom:1px solid var(--line)}
#view{grid-column:2;grid-row:2}
.topbar>.menu-btn,.topbar>.brand-logo.mini{display:none}
.shell-context{font-size:12px;font-weight:500;color:var(--muted)}
.shell-tools{display:flex;align-items:center;gap:16px;margin-left:auto;min-width:0}
.shell-dropdown{position:relative;min-width:0}
.shell-dropdown>summary{list-style:none;cursor:pointer}
.shell-dropdown>summary::-webkit-details-marker{display:none}
.shell-account{display:flex;align-items:center;gap:10px;min-height:48px;max-width:320px;padding:5px 10px;border-radius:var(--r);color:var(--ink-2)}
.shell-account:hover,.shell-user:hover,.shell-dropdown[open]>summary{background:var(--surface-2)}
.shell-account-icon{display:flex;color:var(--muted)}
.shell-account-copy{display:flex;flex-direction:column;min-width:0;line-height:1.45}
#topAccName{font-size:13px;font-weight:650;color:var(--ink);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#topAccPhone{font-size:11px;color:var(--muted);font-variant-numeric:tabular-nums;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.shell-chevron{display:flex;color:var(--muted)}
.shell-chevron .i{width:14px;height:14px}
.shell-dropdown[open] .shell-chevron{transform:rotate(180deg)}
.shell-user{display:flex;align-items:center;justify-content:center;gap:7px;min-width:52px;min-height:44px;border-radius:var(--r);padding:4px}
.shell-user-avatar{display:grid;place-items:center;width:32px;height:32px;flex:none;border-radius:50%;background:var(--leaf-50);color:var(--leaf-600);font-weight:700;font-size:12px;box-shadow:inset 0 0 0 1px var(--line)}
.shell-tools>#userDropdown{border-left:1px solid var(--line);padding-left:16px}
.shell-panel{position:absolute;right:0;top:calc(100% + 10px);width:340px;max-width:calc(100vw - 24px);max-height:calc(100dvh - 90px);overflow-y:auto;overscroll-behavior:contain;padding:8px;border:1px solid var(--line);border-radius:var(--r-lg);background:var(--surface);box-shadow:var(--sh-pop)}
.shell-panel-heading{display:grid;gap:3px;padding:10px 10px 14px;font-size:13px;font-weight:650}
.shell-panel-heading>span{font-size:12px;color:var(--muted);font-weight:400}
.shell-panel .acc-bar{display:flex;flex-direction:column;flex-wrap:nowrap;align-items:stretch;gap:4px;padding:0}
.shell-panel .acc-bar::before{display:none}
.shell-panel .acc-pill{border:0;border-radius:var(--r-sm);background:transparent;flex:none}
.shell-panel .acc-pill.on{background:var(--leaf-50);box-shadow:none}
.shell-panel .acc-main{flex:1;max-width:none;min-width:0;min-height:54px;padding:8px 10px;gap:10px;text-align:left}
.shell-panel .acc-main:hover,.shell-panel .acc-menu:hover{background:var(--surface-2)}
.shell-number-copy{display:grid;min-width:0;gap:2px;flex:1}
.shell-number-copy small{font-size:11px;font-weight:400;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.shell-panel .acc-menu{padding:0;min-width:44px;min-height:44px;justify-content:center;border-radius:var(--r-sm)}
.shell-panel .acc-add{justify-content:flex-start;min-height:44px;border:0;border-radius:var(--r-sm);padding:10px;gap:10px;font-size:12px;color:var(--leaf-600)}
.shell-connection{display:flex;align-items:center;gap:10px;padding:12px 10px 8px;margin-top:8px;border-top:1px solid var(--line-2);text-decoration:none;color:var(--ink-2)}
.shell-connection>span:last-child{display:grid;gap:3px;min-width:0}
.shell-connection b{font-size:12px;font-weight:600}
.shell-connection .txt{font-size:11px;color:var(--muted);overflow-wrap:anywhere}
.shell-user-panel{width:268px;padding:8px}
.shell-user-panel .me-who{padding:10px 10px 14px;border-bottom:1px solid var(--line-2);gap:3px;overflow-wrap:anywhere}
.shell-user-panel .me-actions{display:flex;flex-direction:column;gap:2px;padding-top:6px}
.shell-user-panel .me-actions .btn{justify-content:flex-start;min-height:44px;border:0;padding:10px;font-size:12px}
.shell-user-panel [data-me-out]{color:var(--red)}
.app:has(.conversation-view){grid-template-rows:64px minmax(0,1fr)}
main.conversation-view{height:100%;min-height:0}
@media(max-width:820px){
  .app{grid-template-rows:64px minmax(0,1fr)}
  .topbar{grid-column:1;padding:0 12px;gap:8px}
  #view{grid-column:1}
  .topbar>.menu-btn{display:grid}
  .topbar>.brand-logo.mini{display:block}
  .shell-context{display:none}
  .shell-tools{gap:6px;flex:1;justify-content:flex-end}
  .shell-tools>#userDropdown{padding-left:6px}
  .shell-account{max-width:260px;gap:8px;padding:5px 6px}
  .shell-account-icon{display:none}
  .shell-panel{position:fixed;top:72px;right:12px;max-height:calc(100dvh - 88px)}
  .side{grid-column:auto;grid-row:auto}
}
@media(max-width:420px){
  .topbar{padding:0 8px;gap:4px}
  .topbar>.brand-logo.mini{display:none}
  .shell-account{max-width:calc(100vw - 128px)}
}
@media(max-width:650px){.app:has(.inbox.chat-open){grid-template-rows:minmax(0,1fr)}.app:has(.inbox.chat-open) #view{grid-row:1}}

/* Fila ao vivo: resumo persistente e detalhes sem sair da tela. */
.shell-queue{--queue-success:#17805A;--queue-success-bg:#EAF7F0;--queue-warning:#805D0D;--queue-warning-bg:#FFF6DF}
.shell-queue-trigger{position:relative;display:flex;align-items:center;gap:10px;min-height:48px;max-width:224px;padding:6px 10px;border:1px solid transparent;border-radius:var(--r);overflow:hidden}
.shell-queue-trigger:hover,.shell-queue[open]>.shell-queue-trigger{background:var(--surface-2)}
.shell-queue-symbol{position:relative;display:grid;place-items:center;width:32px;height:32px;flex:none;border-radius:10px;background:var(--surface-2);color:var(--muted)}
.shell-queue-symbol>span[data-icon]{display:flex}
.shell-queue-count{position:absolute;top:-4px;right:-5px;min-width:17px;height:17px;padding:0 4px;border-radius:20px;background:var(--leaf-600);color:var(--surface);box-shadow:0 0 0 2px var(--surface);font-size:10px;font-weight:700;display:grid;place-items:center}
.shell-queue-copy{display:grid;gap:1px;min-width:0;line-height:1.45}
.shell-queue-copy b{font-size:12px;font-weight:650;white-space:nowrap}
#queueSummary{font-size:11px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-variant-numeric:tabular-nums}
.shell-queue[data-state=active] .shell-queue-symbol{background:var(--leaf-50);color:var(--leaf-600)}
.shell-queue[data-state=active] .shell-queue-trigger{border-color:var(--line);background:var(--surface-2)}
.shell-queue[data-state=active] .shell-queue-trigger::after{content:"";position:absolute;bottom:0;left:0;height:2px;width:var(--queue-progress,0%);background:var(--leaf-600);transition:width .35s ease}
.shell-queue[data-state=review] .shell-queue-symbol{background:var(--queue-warning-bg);color:var(--queue-warning)}
.shell-queue[data-state=review] .shell-queue-count{background:var(--queue-warning)}
.shell-queue-panel{width:380px;padding:16px}
.shell-queue-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px}
.shell-queue-heading h2{font-size:15px;letter-spacing:-.02em;margin:0 0 4px;font-weight:700}
.shell-queue-heading .icon-btn{width:36px;height:36px}
.shell-queue-realtime{display:flex;align-items:center;gap:6px;color:var(--muted);font-size:11px}
.shell-queue-realtime::before{content:"";width:6px;height:6px;flex:none;border-radius:50%;background:var(--muted)}
.shell-queue:not([data-state=offline]) .shell-queue-realtime::before{background:var(--queue-success);box-shadow:0 0 0 3px var(--queue-success-bg)}
.shell-queue-empty{padding:24px 14px;text-align:center;font-size:13px;color:var(--muted);line-height:1.7;background:var(--surface-2);border:1px dashed var(--line);border-radius:var(--r);margin:0}
.shell-queue-list{display:grid;gap:10px}
.shell-queue-card{padding:14px;border:1px solid var(--line);border-radius:var(--r);min-width:0}
.shell-queue-card-head{display:flex;justify-content:space-between;align-items:center;gap:12px;font-size:11px;font-weight:600;color:var(--muted);font-variant-numeric:tabular-nums}
.shell-queue-card-head [data-job-status]{display:inline-flex;align-items:center;gap:5px}
.shell-queue-card[data-status=running] [data-job-status]{color:var(--leaf-600)}
.shell-queue-card[data-status=done] [data-job-status]{color:var(--queue-success)}
.shell-queue-card[data-status=review] [data-job-status],.shell-queue-card[data-status=partial] [data-job-status]{color:var(--queue-warning)}
.shell-queue-card[data-status=error] [data-job-status],.shell-queue-stats .has-failures{color:var(--red)}
.shell-queue-job{display:block;width:100%;border:0;background:none;padding:8px 0 12px;cursor:pointer;text-align:left;font-size:13px;font-weight:650;line-height:1.5;overflow-wrap:anywhere;color:var(--ink)}
.shell-queue-job:hover{color:var(--leaf-600);text-decoration:underline;text-underline-offset:3px}
.shell-queue-progress{appearance:none;border:0 solid;overflow:clip;display:block;width:100%;height:5px;border-radius:20px;background:var(--line-2);--queue-fill:var(--leaf-600)}
.shell-queue-progress::-webkit-progress-bar{background:transparent}
.shell-queue-progress::-webkit-progress-value{border-radius:20px;background:var(--queue-fill);transition:inline-size .35s ease}
.shell-queue-progress::-moz-progress-bar{border-radius:20px;background:var(--queue-fill);transition:inline-size .35s ease}
.shell-queue-card[data-status=done] .shell-queue-progress{--queue-fill:var(--queue-success)}
.shell-queue-card[data-status=review] .shell-queue-progress,.shell-queue-card[data-status=partial] .shell-queue-progress{--queue-fill:var(--queue-warning)}
.shell-queue[data-state=offline] .shell-queue-progress{--queue-fill:var(--muted)}
.shell-queue-stats{display:flex;flex-wrap:wrap;gap:6px 14px;margin-top:10px;color:var(--muted);font-size:10px;font-variant-numeric:tabular-nums}
.shell-queue-stats b{font-size:12px;font-weight:650;color:var(--ink-2)}
.shell-queue-stats .has-failures b{color:inherit}
.shell-queue-wait{font-size:11px;color:var(--muted);margin:10px 0 0;line-height:1.5}
.shell-queue-history{display:flex;align-items:center;gap:8px;margin-top:14px;padding:12px 2px 0;border-top:1px solid var(--line-2);font-size:12px;font-weight:600;text-decoration:none;color:var(--leaf-600);min-height:44px}
.shell-queue-history>span:last-child{margin-left:auto}
@media(max-width:1150px){.shell-context{display:none}.topbar{padding-right:20px;padding-left:20px}.shell-tools{gap:8px}}
@media(max-width:820px){
  .topbar{padding:0 8px;gap:4px}
  .shell-queue-trigger{padding:6px;min-width:44px;justify-content:center;overflow:visible}
  .shell-queue-copy,.shell-queue-trigger>.shell-chevron,.topbar>.brand-logo.mini{display:none}
  .shell-queue[data-state=active] .shell-queue-trigger::after{left:6px;max-width:calc(100% - 12px)}
  .shell-account{max-width:calc(100vw - 184px)}
  .shell-tools{gap:4px}
  .shell-queue-heading .icon-btn{width:44px;height:44px}
}
@media(prefers-reduced-motion:reduce){.shell-queue-trigger::after,.shell-queue-progress::-webkit-progress-value{transition:none}.shell-queue-progress::-moz-progress-bar{transition:none}}
