/* Atomicamente — Desktop App Shell v1 · 2026
   Só se aplica quando o próprio navegador confirma Window Controls Overlay.
   O conteúdo do site, Android e páginas em abas ficam inalterados. */
:root {
  --atomic-app-brand: #7c3aed;
  --atomic-wco-left: 0px;
  --atomic-wco-right: 155px;
  --atomic-wco-height: 40px;
}
html.atomic-wco-active {
  --atomic-wco-height: max(34px, env(titlebar-area-height, 40px));
}
/* Reutiliza o cabeçalho real: nada de duplicar barras, links ou botões PHP. */
html.atomic-wco-active body header.atomic-wco-header {
  top: 0 !important;
  box-sizing: border-box !important;
  width: 100% !important;
  min-height: var(--atomic-wco-height) !important;
  padding: 2px calc(var(--atomic-wco-right) + 13px) 2px calc(var(--atomic-wco-left) + 15px) !important;
  margin: 0 !important;
  border-bottom: 1px solid rgba(255,255,255,.19) !important;
  background: #7c3aed !important;
  background-image: linear-gradient(110deg,#6d28d9 0%,#7c3aed 55%,#7c3aed 100%) !important;
  color: #fff !important;
  box-shadow: 0 3px 16px rgba(32,11,70,.12) !important;
  -webkit-app-region: drag;
  app-region: drag;
}
/* Cabeçalhos que usam um contentor interno. */
html.atomic-wco-active body header.atomic-wco-header :is(.nav-container,.nav-dash) {
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: none !important;
  min-height: calc(var(--atomic-wco-height) - 4px) !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
}
html.atomic-wco-active body header.atomic-wco-header :is(.marca,.marca-dash,.header-brand,.brand,.offline-brand),
html.atomic-wco-active body header.atomic-wco-header :is(.marca,.marca-dash,.header-brand,.brand,.offline-brand) :is(span,strong,small) {
  color: #fff !important;
}
html.atomic-wco-active body header.atomic-wco-header :is(.marca img,.marca-dash img,.header-brand img) {
  max-height: 27px !important;
  width: auto;
}
html.atomic-wco-active body header.atomic-wco-header .nav-links a {
  color: #f6eaff !important;
}
html.atomic-wco-active body header.atomic-wco-header .nav-links a:hover {
  color: #fff !important;
}
html.atomic-wco-active body header.atomic-wco-header :is(.nav-actions,.header-actions) {
  gap: 7px !important;
}
/* Somente áreas vazias arrastam. Controles, links, menus e botões são clicáveis. */
html.atomic-wco-active body header.atomic-wco-header :is(a,button,input,select,textarea,summary,[role="button"],.nav-actions,.header-actions,.nav-links,.menu-dropdown,.dropdown-content,[contenteditable="true"]) {
  -webkit-app-region: no-drag;
  app-region: no-drag;
}
/* Barra mínima apenas em páginas que não têm cabeçalho (login/cadastro). */
.atomic-wco-fallback {
  display: none;
}
html.atomic-wco-active .atomic-wco-fallback {
  position: fixed;
  z-index: 2147483000;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--atomic-wco-height);
  padding: 0 calc(var(--atomic-wco-right) + 12px) 0 calc(var(--atomic-wco-left) + 14px);
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 9px;
  background: #7c3aed;
  color: #fff;
  font: 700 12px Inter, system-ui, sans-serif;
  letter-spacing: .02em;
  -webkit-app-region: drag;
  app-region: drag;
}
.atomic-wco-fallback img { width: 22px; height:22px; border-radius:5px; }
/* O diálogo de navegação rápida só aparece em janela PWA desktop. */
.atomic-desktop-palette[hidden] { display:none !important; }
.atomic-desktop-palette {
  position: fixed;
  inset: 0;
  z-index: 2147483640;
  display: grid;
  place-items: start center;
  padding: min(14vh,110px) 20px 20px;
  box-sizing: border-box;
  background: rgba(19,13,37,.48);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-family: Inter, system-ui, sans-serif;
}
.atomic-desktop-palette * {box-sizing:border-box;}
.atomic-desktop-palette-panel {
  width: min(100%,540px);
  max-height: min(76vh,620px);
  background: #fff;
  border: 1px solid rgba(124,58,237,.18);
  border-radius: 18px;
  box-shadow: 0 24px 90px rgba(19,12,46,.32);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  color: #172033;
}
.atomic-desktop-palette-search {
  display: flex; align-items:center; gap: 12px; padding: 13px 18px;
  border-bottom:1px solid #eee7f9;
}
.atomic-desktop-palette-search svg { width:20px; height:20px; flex:none; color:#7c3aed; }
.atomic-desktop-palette-input {
  flex:1; min-width:0; border:0; outline:0; font:600 16px Inter,system-ui,sans-serif;
  color:#172033; background:transparent;
}
.atomic-desktop-palette-key { padding:4px 7px; border:1px solid #e4dff0; border-radius:7px; color:#75819a; font-size:11px; }
.atomic-desktop-palette-items { overflow-y:auto; min-height:0; padding:8px; }
.atomic-desktop-palette-item { display:flex; align-items:center; gap:12px; width:100%; border:0; background:transparent; cursor:pointer; border-radius:11px; padding:12px; color:#263449; text-align:left; font:600 14px Inter,system-ui,sans-serif; }
.atomic-desktop-palette-item:hover,.atomic-desktop-palette-item[aria-selected="true"] { background:#f1ebff; color:#6d28d9; }
.atomic-desktop-palette-item-icon { width:34px;height:34px;display:grid;place-items:center; border-radius:9px;background:#f3edff;color:#7c3aed;font-size:19px;flex:none; }
.atomic-desktop-palette-item > small { margin-left:auto;color:#8590a3;font-size:11px;font-weight:500; }
.atomic-desktop-palette-footer { padding:11px 17px; border-top:1px solid #eee7f9; font-size:12px; color:#6b7890; display:flex; justify-content:space-between;gap:15px; }
.atomic-desktop-palette-empty { padding:20px;text-align:center;color:#64748b;font-size:13px; }
@media (max-width: 680px) {
  .atomic-desktop-palette {padding:14px;align-items:start;}
  .atomic-desktop-palette-panel {max-height:80vh;}
}
@media (prefers-reduced-motion: reduce) {
  .atomic-desktop-palette {backdrop-filter:none;-webkit-backdrop-filter:none;}
}

/* Integração específica das duas telas offline, sem mexer na versão mobile. */
html.atomic-wco-active body .offline-shell header.app-header.atomic-wco-header {
  position: fixed !important;
  top: 0 !important; left: 0 !important;
  z-index: 2000 !important;
  height: var(--atomic-wco-height) !important;
  gap: 10px;
  grid-row: auto !important;
  grid-column: auto !important;
}
html.atomic-wco-active body .offline-shell .brand-mark { width: 27px !important; height:27px !important; border-radius:8px !important; }
html.atomic-wco-active body .offline-shell .brand-mark img { width:24px !important; height:24px !important; }
html.atomic-wco-active body .offline-shell .brand-name { font-size:15px !important; white-space:nowrap; }
html.atomic-wco-active body .offline-shell .brand-sub { display:none !important; }
html.atomic-wco-active body .offline-shell .network-pill { padding:5px 9px !important; }
html.atomic-wco-active body .offline-shell .desktop-command-trigger { min-height:27px !important; padding:4px 10px !important; margin-left:auto; }
@media (min-width: 1024px) {
  html.atomic-wco-active body .offline-shell {
    padding-top: calc(var(--atomic-wco-height) + 20px) !important;
    grid-template-rows: minmax(0,1fr) !important;
  }
  html.atomic-wco-active body .offline-shell #main-content,
  html.atomic-wco-active body .offline-shell .offline-nav { grid-row: 1 !important; }
}
html.atomic-wco-active body.atomic-offline-lab .offline-lab-header.atomic-wco-header {
  position: relative !important;
  height: var(--atomic-wco-height) !important;
  min-height: var(--atomic-wco-height) !important;
}
html.atomic-wco-active body.atomic-offline-lab .offline-brand :is(strong,small),
html.atomic-wco-active body.atomic-offline-lab .offline-lab-back,
html.atomic-wco-active body.atomic-offline-lab .offline-status {
  color:#fff !important;
}
@media(min-width:1120px){
  html.atomic-wco-active body.atomic-offline-lab .lab-app {
    height:calc(100dvh - var(--atomic-wco-height) - var(--atomic-lab-note-h,42px)) !important;
  }
}
