/* =============================================================
 *  screens/sidebar.css
 *  Extraído automaticamente de index.php.
 *  NÃO editar manualmente até remover o script de split.
 * ============================================================= */

    /* ── SIDEBAR ── */
    #panel-contacts {
      background: var(--panel);
      border-right: 1px solid var(--border);
      display: flex; flex-direction: column;
      overflow: hidden; height: 100%;
      position: relative;
      --sb-rail-w: 64px;
    }

    /* Coluna lista + vistas (à direita do rail em desktop ≥768px) */
    .sb-main-column {
      display: flex;
      flex-direction: column;
      flex: 1 1 auto;
      min-height: 0;
      min-width: 0;
      overflow: hidden;
    }

    /* Barra vertical de atalhos (só desktop) */
    .sb-rail-desktop {
      display: none;
      flex-direction: column;
      flex-shrink: 0;
      width: var(--sb-rail-w);
      background: var(--surface);
      border-right: 1px solid var(--border);
      overflow: hidden;
    }
    .sb-rail-inner {
      flex: 1;
      display: flex;
      flex-direction: column;
      align-items: center;
      min-height: 0;
      padding: 10px 0 16px;
      gap: 6px;
    }
    .sb-rail-nav {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 8px;
      width: 100%;
      flex-shrink: 0;
    }
    .sb-rail-nav--conta {
      padding-top: 10px;
      margin-top: 2px;
      border-top: 1px solid var(--border);
    }

    /* Atualização manual do .exe: só visível no cliente Electron (electron_shell.js põe zori-electron-shell no <html>). PWA/browser não devem revelar mesmo se alguém remover d-none por engano. */
    html:not(.zori-electron-shell) .sb-zori-electron-only {
      display: none !important;
    }

    /* Bolinha nova versão (.exe Electron) — activada por JS quando remote > instalada */
    .sb-zori-update-entry {
      position: relative;
    }
    html.zori-electron-shell .sb-zori-update-entry.sb-zori-update-badge--on::after {
      content: '';
      position: absolute;
      top: 3px;
      right: 3px;
      width: 8px;
      height: 8px;
      background: #dc2626;
      border-radius: 50%;
      box-shadow: 0 0 0 2px var(--surface, #ffffff);
      pointer-events: none;
      z-index: 4;
    }
    html.zori-electron-shell .sb-bottom-nav-mais-item.sb-zori-update-entry.sb-zori-update-badge--on::after {
      top: 6px;
      right: 10px;
    }

    .sb-rail-spacer {
      flex: 1 1 auto;
      min-height: 24px;
    }

    .sb-rail-ic-svg {
      width: 22px;
      height: 22px;
      display: block;
      flex-shrink: 0;
    }
    .sb-rail-ic-img {
      width: 22px;
      height: 22px;
      display: block;
      flex-shrink: 0;
      object-fit: contain;
      pointer-events: none;
    }
    /* PNG costuma ter padding interno à arte: escala até equiparar ao peso visual dos SVG ~24×24 no viewBox. */
    .sb-rail-desktop .sb-rail-ic-img--novo-grupo {
      width: 30px;
      height: 30px;
    }

    .sb-rail-mini-divider {
      width: 38px;
      height: 1px;
      background: var(--border);
      flex-shrink: 0;
      margin: 2px 0 4px;
    }

    .sb-rail-mode-btn {
      width: 44px;
      height: 44px;
      flex-shrink: 0;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border-radius: 12px;
      border: 1px solid transparent;
      background: transparent;
      cursor: pointer;
      color: var(--text-2);
      transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
      -webkit-tap-highlight-color: transparent;
    }
    .sb-rail-mode-btn:hover {
      background: var(--surface-2);
      color: var(--text);
      border-color: var(--border);
    }
    .sb-rail-mode-btn.is-active {
      color: var(--accent);
      background: var(--accent-soft);
      border-color: #c7d2fe;
    }

    .sb-rail-mode-lbl {
      font-size: 12px;
      font-weight: 800;
      letter-spacing: 0.02em;
      color: inherit;
    }
    #panel-contacts.sidebar-mod-contatos #sidebar-folder-bar {
      display: none !important;
    }

    @media (min-width: 768px) {
      #panel-contacts {
        flex-direction: row;
      }
      .sb-rail-desktop {
        display: flex;
      }
    }

    .sb-header {
      height: var(--header); padding: 0 12px 0 14px;
      display: flex;
      flex-direction: row;
      flex-wrap: nowrap;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      flex-shrink: 0;
      border-bottom: 1px solid var(--border);
    }

    /* Perfil no canto direito — só telefone (desktop usa rail); mesmo traço do ícone rail */
    .sb-header-perfil-acao {
      display: none;
      flex-shrink: 0;
      width: 40px;
      height: 40px;
      padding: 0;
      border-radius: 12px;
      border: 1px solid transparent;
      background: transparent;
      color: var(--text-2);
      cursor: pointer;
      align-items: center;
      justify-content: center;
      -webkit-tap-highlight-color: transparent;
      transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    }
    .sb-header-perfil-svg {
      width: 22px;
      height: 22px;
      display: block;
      flex-shrink: 0;
    }
    .sb-header-perfil-acao:active {
      background: var(--surface-2);
      color: var(--text);
      border-color: var(--border);
    }
    .sb-header-perfil-acao.is-active {
      color: var(--accent);
      background: var(--accent-soft);
      border-color: #c7d2fe;
    }

    .sb-brand {
      display: flex; flex-direction: row; flex-wrap: nowrap;
      align-items: center; gap: 8px; min-width: 0; flex: 1 1 auto;
      font-size: 16px; font-weight: 900; letter-spacing: -.02em;
    }
    .sb-brand-titulo {
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .sb-brand-icon {
      width: 32px; height: 32px; border-radius: 9px;
      background: transparent;
      display: flex; align-items: center; justify-content: center;
      box-shadow: 0 2px 8px var(--accent-glow);
      flex-shrink: 0;
      overflow: hidden;
    }
    .sb-brand-icon img {
      width: 100%;
      height: 100%;
      display: block;
      object-fit: cover;
      object-position: 50% 50%;
      transform: scale(1.2);
      transform-origin: 50% 50%;
      border-radius: 0;
    }
    .sb-brand-icon svg { display: block; }

    /* Mobile: atalhos no rodapé (ícones = SVG do rail desktop; mais baixo que a barra antiga só emoji) */
    .sb-bottom-nav {
      display: none;
      flex-shrink: 0;
      flex-direction: row;
      align-items: center;
      justify-content: space-around;
      gap: 0;
      min-height: calc(56px + var(--zori-safe-bottom));
      padding: 4px 4px calc(5px + var(--zori-safe-bottom));
      border-top: 1px solid var(--border);
      background: var(--panel);
      box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.07);
      box-sizing: border-box;
    }
    .sb-bottom-nav-item {
      flex: 1;
      min-width: 0;
      max-width: none;
      margin: 0 auto;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 3px;
      padding: 3px 2px;
      border: none;
      border-radius: 10px;
      background: transparent;
      font: inherit;
      cursor: pointer;
      color: var(--text-2);
      -webkit-tap-highlight-color: transparent;
      transition: color 0.15s ease, background 0.15s ease;
    }
    .sb-bottom-nav-item:active {
      background: var(--surface-2);
    }
    .sb-bottom-nav-ic {
      display: flex;
      align-items: center;
      justify-content: center;
      line-height: 0;
      font-size: 0;
      flex-shrink: 0;
    }
    .sb-bottom-nav-svg {
      width: 22px;
      height: 22px;
      display: block;
      flex-shrink: 0;
      color: inherit;
    }
    .sb-bottom-nav-ic--png {
      display: flex;
      align-items: center;
      justify-content: center;
      line-height: 0;
      font-size: 0;
    }
    .sb-bottom-nav-img {
      width: 22px;
      height: 22px;
      object-fit: contain;
      pointer-events: none;
      display: block;
    }
    .sb-bottom-nav-img--novo-grupo {
      width: 28px;
      height: 28px;
    }
    .sb-bottom-nav-item:active .sb-bottom-nav-img {
      opacity: 0.92;
    }
    .sb-bottom-nav-item.is-active .sb-bottom-nav-img {
      opacity: 1;
    }
    .sb-bottom-nav-lbl {
      font-size: 10px;
      font-weight: 800;
      letter-spacing: 0.01em;
      line-height: 1.15;
      text-align: center;
      max-width: 100%;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .sb-bottom-nav-item.is-active {
      color: var(--accent);
    }
    .sb-bottom-nav-item.is-active .sb-bottom-nav-lbl {
      color: var(--accent);
    }
    .sb-bottom-nav-more-wrap {
      flex: 1;
      min-width: 0;
      position: relative;
      display: flex;
      align-items: stretch;
      justify-content: center;
    }
    .sb-bottom-nav-more-wrap .sb-bottom-nav-item--mais {
      flex: 1;
      max-width: none;
      margin: 0;
    }
    .sb-bottom-nav-mais-menu {
      position: absolute;
      bottom: calc(100% + 8px);
      right: max(2px, var(--zori-safe-right));
      left: auto;
      min-width: min(216px, calc(100vw - 20px));
      padding: 6px;
      margin: 0;
      border: 1px solid var(--border);
      border-radius: 14px;
      background: var(--panel);
      box-shadow: 0 -6px 28px rgba(15, 23, 42, 0.12);
      z-index: 60;
      box-sizing: border-box;
      list-style: none;
    }
    .sb-bottom-nav-mais-item {
      width: 100%;
      display: flex;
      flex-direction: row;
      align-items: center;
      gap: 10px;
      padding: 11px 12px;
      border: none;
      border-radius: 10px;
      background: transparent;
      font: inherit;
      font-size: 15px;
      font-weight: 600;
      color: var(--text);
      cursor: pointer;
      text-align: left;
      -webkit-tap-highlight-color: transparent;
    }
    .sb-bottom-nav-mais-item:active {
      background: var(--surface-2);
    }
    a.sb-bottom-nav-mais-item {
      text-decoration: none;
      color: inherit;
      box-sizing: border-box;
    }
    .sb-bottom-nav-mais-ic {
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      color: var(--text-2);
    }
    .sb-bottom-nav-mais-ic .sb-bottom-nav-svg {
      width: 20px;
      height: 20px;
    }
    .sb-bottom-nav-mais-txt {
      flex: 1;
      min-width: 0;
    }
    @media (max-width: 767px) {
      .sb-bottom-nav {
        display: flex;
      }
      .sb-debug-log {
        bottom: calc(76px + var(--zori-safe-bottom));
      }
      .sidebar-footer-bar .sidebar-footer-version {
        padding: 4px 10px max(8px, var(--zori-safe-bottom));
        font-size: 10px;
      }
      .sb-header-perfil-acao {
        display: inline-flex;
      }
      /* Lista de conversas: mesmo critério do cabeçalho do chat (responsive.css).
         Em WebView Android, safe-area costuma vir 0; o nativo faz encaixe — aqui cobre PWAs/notch onde o inset existe. */
      .sb-header {
        padding-top: var(--zori-safe-top);
        box-sizing: border-box;
        height: calc(var(--header) + var(--zori-safe-top));
      }
    }
    .btn-icon-sm {
      width: 32px; height: 32px; border-radius: var(--radius-xs);
      background: var(--surface); border: 1px solid var(--border);
      color: var(--text-3); font-size: 15px; cursor: pointer;
      display: flex; align-items: center; justify-content: center;
      transition: all .15s;
    }
    .btn-icon-sm:hover { background: var(--red-soft); color: var(--red); border-color: #fca5a5; }
    .btn-icon-sm.notif-on { color: var(--accent); background: var(--accent-soft); border-color: #c7d2fe; }

    /* Depois de .btn-icon-sm: ícones do rail desktop (override borda/chão) */
    .sb-rail-desktop .sb-acao-rail.btn-icon-sm {
      width: 44px;
      height: 44px;
      border-radius: 12px;
      font-size: 20px;
      line-height: 1;
      border-color: transparent;
      background: transparent;
      color: var(--text-2);
    }
    .sb-rail-desktop .sb-acao-rail.btn-icon-sm:hover,
    .sb-rail-desktop .sb-acao-rail.btn-icon-sm:focus-visible {
      background: var(--surface-2);
      color: var(--text);
      border-color: var(--border);
    }
    .sb-rail-desktop .sb-acao-rail.btn-icon-sm.is-active {
      color: var(--accent);
      background: var(--accent-soft);
      border-color: #c7d2fe;
    }
    /* Link «API» no rail: mesmo aspecto que <button> vizinho */
    .sb-rail-desktop a.sb-acao-rail.btn-icon-sm {
      text-decoration: none;
      color: inherit;
      box-sizing: border-box;
      -webkit-tap-highlight-color: transparent;
    }

    /* Solicitações */
    #requests-wrap { flex-shrink: 0; border-bottom: 1px solid var(--border); display: none; }

    .section-label {
      padding: 12px 16px 6px; font-size: 11px; font-weight: 800;
      text-transform: uppercase; letter-spacing: .06em; color: var(--text-3);
      display: flex; align-items: center; gap: 6px;
    }

    .badge-pill { padding: 1px 7px; border-radius: 10px; font-size: 10px; font-weight: 800; }
    .badge-pill.yellow { background: var(--yellow-soft); color: #92400e; border: 1px solid #fde68a; }

    #requests-list { padding: 0 10px 10px; }

    .req-item {
      display: flex; align-items: center; gap: 10px;
      padding: 9px 10px; border-radius: var(--radius-sm);
      background: var(--yellow-soft); border: 1px solid #fde68a;
      margin-bottom: 6px; animation: fadeUp .2s ease;
    }
    .req-avatar { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; flex-shrink: 0; }
    .req-info  { flex: 1; min-width: 0; }
    .req-name  { font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .req-sub   { font-size: 11px; color: #92400e; font-weight: 600; }
    .req-actions { display: flex; gap: 5px; }

    .btn-accept, .btn-decline {
      height: 28px; padding: 0 12px; border-radius: 20px; border: none;
      font-size: 12px; font-weight: 800; cursor: pointer;
      transition: opacity .15s, transform .1s;
    }
    .btn-accept:active, .btn-decline:active { transform: scale(.93); }
    .btn-accept  { background: var(--green); color: #fff; }
    .btn-decline { background: var(--surface); color: var(--text-2); border: 1px solid var(--border); }
    .btn-accept:hover  { opacity: .85; }
    .btn-decline:hover { background: var(--red-soft); color: var(--red); border-color: #fca5a5; }

    /* Pesquisa conversas / contatos (+ texto nas mensagens) */
    .contact-search-wrap {
      position: relative;
      display: flex; align-items: center;
      margin: 10px 12px 8px;
      flex-shrink: 0;
    }
    .contact-search-ic {
      position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
      font-size: 15px; opacity: .45; pointer-events: none; z-index: 1;
    }
    .contact-search-inp {
      width: 100%; min-width: 0;
      background: #f4f6fd;
      border: 1.5px solid #dde3f5;
      border-radius: 22px;
      padding: 10px 40px 10px 40px;
      font-size: 14px; font-weight: 500;
      color: var(--text); outline: none;
      transition: border-color .2s, box-shadow .2s;
    }
    .contact-search-inp:focus {
      border-color: var(--accent);
      box-shadow: 0 0 0 3px var(--accent-glow);
      background: #fff;
    }
    .contact-search-inp::placeholder { color: #9fa8c8; font-size: 13px; }
    .contact-search-clear {
      position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
      width: 26px; height: 26px; border: none; border-radius: 50%;
      background: #e8ecf8; color: var(--text-2); font-size: 18px; line-height: 1;
      cursor: pointer; display: flex; align-items: center; justify-content: center;
      padding: 0; font-weight: 700;
    }
    .contact-search-clear:hover { background: #dde3f5; color: var(--text); }
    mark.search-hit {
      background: #d9fdd3;
      color: #111b21;
      font-weight: 700;
      padding: 0 1px;
      border-radius: 2px;
    }

    .contact-search-wrap { border-bottom: 1px solid var(--border); padding-bottom: 8px; }

    /* Pastas / filtros da lista de conversas */
    .sidebar-folder-bar {
      display: flex;
      flex-direction: row;
      align-items: flex-start;
      gap: 6px;
      padding: 0 10px 10px;
      flex-shrink: 0;
      border-bottom: 1px solid var(--border);
    }
    .sidebar-folder-pills {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      flex: 1;
      min-width: 0;
      align-items: center;
    }
    .sidebar-folder-pill {
      border: 1px solid var(--border);
      background: var(--surface-2);
      color: var(--text-2);
      font: inherit;
      font-size: 12px;
      font-weight: 700;
      padding: 6px 10px;
      border-radius: 999px;
      cursor: pointer;
      white-space: nowrap;
      transition: background .15s, color .15s, border-color .15s;
    }
    .sidebar-folder-pill:hover {
      background: var(--surface);
      color: var(--text);
    }
    .sidebar-folder-pill.is-active {
      background: var(--list-green, #20a078);
      border-color: transparent;
      color: #fff;
    }
    .sidebar-folder-badge {
      display: inline-block;
      margin-left: 4px;
      padding: 0 5px;
      border-radius: 8px;
      font-size: 11px;
      font-weight: 800;
      background: rgba(255, 255, 255, 0.25);
      vertical-align: middle;
    }
    .sidebar-folder-pill.is-active .sidebar-folder-badge {
      background: rgba(255, 255, 255, 0.35);
    }
    .sidebar-folder-active-custom {
      font: inherit;
      font-size: 12px;
      font-weight: 800;
      padding: 6px 10px;
      border-radius: 999px;
      background: var(--list-green, #20a078);
      color: #fff;
      white-space: nowrap;
      max-width: 140px;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .sidebar-folder-active-custom.d-none { display: none !important; }
    .sidebar-folder-more-wrap {
      position: relative;
      flex-shrink: 0;
      padding-top: 2px;
    }
    .sidebar-folder-more-btn {
      width: 34px;
      height: 34px;
      border-radius: 50%;
      border: 1px solid var(--border);
      background: var(--surface-2);
      color: var(--text-2);
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      padding: 0;
    }
    .sidebar-folder-more-btn:hover {
      background: var(--surface);
      color: var(--text);
    }
    .sidebar-folder-more-btn.is-open {
      border-color: var(--accent);
      color: var(--accent);
    }
    .sidebar-folder-chevron-svg {
      display: block;
      opacity: 0.9;
    }
    .sidebar-folder-more-menu {
      position: absolute;
      top: calc(100% + 6px);
      right: 0;
      z-index: 85;
      min-width: 200px;
      max-width: min(88vw, 260px);
      max-height: min(60vh, 320px);
      overflow-y: auto;
      padding: 6px 0;
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 12px;
      box-shadow: 0 12px 28px rgba(15, 23, 42, 0.15);
    }
    .sidebar-folder-more-menu.d-none { display: none !important; }
    .sidebar-folder-menu-item {
      display: block;
      width: 100%;
      text-align: left;
      padding: 10px 14px;
      border: none;
      background: transparent;
      font: inherit;
      font-size: 14px;
      font-weight: 600;
      color: var(--text);
      cursor: pointer;
    }
    .sidebar-folder-menu-item:hover {
      background: var(--surface-2);
    }
    .sidebar-folder-menu-item--nova,
    .sidebar-folder-menu-item--gerir {
      font-weight: 800;
      color: var(--list-green, #20a078);
    }
    .sidebar-custom-list-footer {
      padding: 12px 14px 16px;
      border-top: 1px solid var(--border);
      flex-shrink: 0;
    }
    .sidebar-custom-list-add-link {
      display: block;
      width: 100%;
      text-align: center;
      padding: 10px 12px;
      border: none;
      border-radius: 10px;
      background: transparent;
      font: inherit;
      font-size: 14px;
      font-weight: 800;
      color: var(--accent, #e11d48);
      cursor: pointer;
      text-decoration: underline;
      text-underline-offset: 3px;
    }
    .sidebar-custom-list-add-link:hover {
      opacity: 0.88;
    }
    #custom-list-name-modal,
    #custom-list-add-modal,
    #custom-list-manage-modal {
      display: none;
      position: fixed;
      inset: 0;
      z-index: 10065;
      background: rgba(15, 18, 40, 0.55);
      align-items: center;
      justify-content: center;
      padding: 16px;
    }
    #custom-list-name-modal.open,
    #custom-list-add-modal.open,
    #custom-list-manage-modal.open {
      display: flex;
    }
    #custom-list-add-list {
      overflow-y: auto;
      flex: 1;
      min-height: 0;
      padding: 8px 0;
      max-height: min(48vh, 360px);
    }
    .forward-modal-foot--split {
      justify-content: flex-end;
      gap: 10px;
    }
    /* Primário = verde marca; secundário neutro (chat.css sobrepõe .btn-forward-send sem isto) */
    #custom-list-name-modal #custom-list-name-ok,
    #custom-list-add-modal #custom-list-add-submit {
      background: var(--list-green, #20a078);
      color: #fff;
      border: none;
    }
    #custom-list-name-modal #custom-list-name-ok:hover:not(:disabled),
    #custom-list-add-modal #custom-list-add-submit:hover:not(:disabled) {
      filter: brightness(1.06);
    }
    #custom-list-name-modal #custom-list-name-ok:disabled,
    #custom-list-add-modal #custom-list-add-submit:disabled {
      opacity: 0.45;
      cursor: not-allowed;
      filter: none;
    }
    #custom-list-name-modal #custom-list-name-cancel {
      background: var(--surface-2);
      color: var(--text-2);
      border: 1px solid var(--border);
    }
    #custom-list-name-modal #custom-list-name-cancel:hover {
      background: var(--surface);
      color: var(--text);
    }

    /* Fechar = secundário (igual Cancelar); evita .btn-forward-send a usar --accent após base.css */
    #custom-list-manage-modal #custom-list-manage-done.btn-forward-send {
      background: var(--surface-2);
      color: var(--text-2);
      border: 1px solid var(--border);
      box-shadow: none;
    }
    #custom-list-manage-modal #custom-list-manage-done.btn-forward-send:hover {
      background: var(--surface);
      color: var(--text);
    }

    .custom-list-manage-body {
      padding: 8px 16px 16px;
      max-height: min(52vh, 400px);
      overflow-y: auto;
      min-height: 80px;
    }
    .custom-list-manage-empty {
      margin: 0;
      padding: 16px 4px;
      font-size: 14px;
      color: var(--text-2);
      text-align: center;
    }
    .custom-list-manage-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 12px 4px;
      border-bottom: 1px solid var(--border);
      font-size: 14px;
    }
    .custom-list-manage-row:last-child {
      border-bottom: none;
    }
    .custom-list-manage-name {
      font-weight: 700;
      color: var(--text);
      min-width: 0;
      flex: 1;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .custom-list-manage-del {
      flex-shrink: 0;
      padding: 8px 14px;
      border-radius: 10px;
      border: 1px solid rgba(32, 160, 120, 0.3);
      background: var(--accent-soft, #e8f7f2);
      color: #b91c1c;
      font: inherit;
      font-size: 13px;
      font-weight: 800;
      cursor: pointer;
    }
    .custom-list-manage-del:hover {
      background: rgba(32, 160, 120, 0.1);
      border-color: rgba(32, 160, 120, 0.45);
    }

    /* Barra fina de sincronização (SyncManager) — sob a pesquisa, cores Zori / verde marca */
    .sync-sidebar-progress {
      flex-shrink: 0;
      padding: 6px 16px 8px;
      margin: 0;
    }
    .sync-sidebar-track {
      height: 3px;
      border-radius: 999px;
      overflow: hidden;
      background: rgba(32, 160, 120, 0.14);
    }
    .sync-sidebar-fill {
      height: 100%;
      width: 0%;
      min-width: 0;
      border-radius: inherit;
      background: linear-gradient(90deg, var(--list-green, #20a078) 0%, var(--green, #10b981) 100%);
      transition: width 0.35s ease;
      box-shadow: 0 0 6px rgba(16, 185, 129, 0.35);
    }

    .sidebar-view-conversas {
      display: flex;
      flex-direction: column;
      flex: 1;
      min-height: 0;
      overflow: hidden;
    }
    .contact-search-wrap--com-voltar {
      align-items: stretch;
      gap: 8px;
    }
    .btn-voltar-arquivados-sidebar {
      flex-shrink: 0;
      width: 38px;
      height: 38px;
      margin-top: 2px;
      align-self: flex-start;
      border-radius: var(--radius-sm);
      border: 1px solid var(--border);
      background: var(--surface);
      color: var(--text-2);
      font-size: 18px;
      line-height: 1;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: background .15s, border-color .15s, color .15s;
    }
    .btn-voltar-arquivados-sidebar:hover {
      background: var(--surface-2);
      color: var(--accent);
      border-color: #c7d2fe;
    }
    .contact-search-field {
      position: relative;
      flex: 1;
      min-width: 0;
      display: flex;
      align-items: center;
    }
    .contact-search-wrap--com-voltar .contact-search-ic {
      left: 14px;
    }
    /* Lista de conversas — tema claro, linhas tipo lista de chats */
    .contacts-label {
      padding: 10px 16px 8px;
      font-size: 15px;
      font-weight: 700;
      color: var(--text);
      flex-shrink: 0;
      letter-spacing: -0.02em;
    }
    #contacts-list {
      flex: 1;
      overflow-y: auto;
      padding: 0 0 8px;
      background: var(--panel);
    }

    .contact-item {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 10px 16px;
      cursor: pointer;
      border: none;
      border-radius: 0;
      margin-bottom: 0;
      transition: background .12s ease;
      border-bottom: 1px solid rgba(17, 24, 39, .06);
      /* Evita seleção de texto (desktop + WebKit mobile; filhos reforçados abaixo). */
      user-select: none;
      -webkit-user-select: none;
      -moz-user-select: none;
      -ms-user-select: none;
      -webkit-touch-callout: none;
      /* pan-y: prioriza scroll vertical na lista; ajuda o WebKit a não “virar” gesto em seleção (Haptic Touch). */
      touch-action: pan-y;
      -webkit-tap-highlight-color: transparent;
    }
    /* iOS/Android: texto em nós filhos (nome, preview, mark da pesquisa) ainda geria seleção nativa. */
    #contacts-list .contact-item * {
      -webkit-user-select: none !important;
      user-select: none !important;
      -webkit-touch-callout: none !important;
    }
    #contacts-list .contact-item img {
      -webkit-user-drag: none;
    }
    .contact-item:last-child { border-bottom: none; }
    .contact-item:hover  { background: var(--list-hover); }
    .contact-item.active { background: var(--list-active); }
    .contact-item.pending { opacity: .72; cursor: default; }
    /* Aba Contatos: só avatar + nome (sem prévia/menu da conversa). */
    .contact-item--contacts-dir .contact-middle {
      justify-content: center;
      gap: 0;
      padding-right: 0;
    }

    .avatar    { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 800; flex-shrink: 0; }
    .avatar-sm { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 800; flex-shrink: 0; }

    .contact-item .contact-avatar {
      width: 52px;
      height: 52px;
      border-radius: 50%;
      flex-shrink: 0;
      object-fit: cover;
      border: 1px solid rgba(17, 24, 39, .08);
    }
    .contact-item .contact-avatar.avatar {
      font-size: 17px;
      border: 1px solid rgba(17, 24, 39, .08);
    }

    .contact-middle {
      flex: 1;
      min-width: 0;
      display: flex;
      flex-direction: column;
      gap: 3px;
      padding-right: 6px;
    }
    .contact-name {
      font-size: 16px;
      font-weight: 600;
      color: #111827;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      letter-spacing: -0.02em;
    }
    .contact-preview {
      font-size: 14px;
      font-weight: 400;
      color: #667781;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      line-height: 1.35;
    }
    .contact-preview.is-unread {
      font-weight: 600;
      color: #3b4a54;
    }

    .contact-meta {
      flex-shrink: 0;
      display: flex;
      flex-direction: column;
      align-items: flex-end;
      justify-content: flex-start;
      gap: 5px;
      /* Largura fixa: hora (“Ontem” vs data) não desloca o alfinete entre linhas. */
      width: 92px;
      min-width: 92px;
      max-width: 92px;
      padding-top: 2px;
      box-sizing: border-box;
    }
    .contact-time {
      font-size: 12px;
      font-weight: 500;
      color: #8696a0;
      font-variant-numeric: tabular-nums;
      white-space: nowrap;
      width: 100%;
      text-align: right;
    }
    .contact-time.has-unread {
      color: var(--list-green);
      font-weight: 600;
    }
    .contact-meta-slot {
      min-height: 22px;
      display: flex;
      align-items: center;
      justify-content: flex-end;
      width: 100%;
    }
    .contact-unread-pill {
      min-width: 22px;
      height: 22px;
      padding: 0 6px;
      border-radius: 11px;
      background: var(--list-green);
      color: #fff;
      font-size: 11px;
      font-weight: 700;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      line-height: 1;
      box-shadow: 0 1px 2px rgba(0, 168, 132, .35);
    }

    .contacts-subsection-label {
      padding: 14px 16px 6px;
      font-size: 11px;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: .06em;
      color: var(--text-3);
    }
    .contact-item--arquivada { opacity: .92; }
    .contact-meta-row {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 4px;
      width: 100%;
      min-height: 22px;
    }
    .contact-pinned-ic {
      font-size: 12px;
      line-height: 1;
      opacity: .85;
      flex-shrink: 0;
      width: 18px;
      text-align: center;
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }
    .contact-chevron {
      display: inline-flex;
      flex-shrink: 0;
      width: 28px;
      height: 28px;
      padding: 0;
      margin: 0;
      border: none;
      border-radius: 8px;
      background: transparent;
      color: var(--text-3);
      cursor: pointer;
      align-items: center;
      justify-content: center;
      -webkit-tap-highlight-color: transparent;
    }
    .contact-chevron:hover { background: var(--surface-2); color: var(--text); }
    .contact-chevron:active { background: var(--surface-2); color: var(--text); }
    .contact-chevron-svg { width: 20px; height: 20px; display: block; }
    /* Fundo escuro (mobile): toque fora fecha o menu sem ativar outra conversa */
    .lista-contatos-menu-backdrop {
      display: none;
      position: fixed;
      inset: 0;
      z-index: 10040;
      background: rgba(15, 18, 40, 0.42);
      -webkit-tap-highlight-color: transparent;
    }
    .lista-contatos-menu-backdrop.is-open {
      display: block;
    }
    @media (min-width: 768px) {
      .lista-contatos-menu-backdrop.is-open {
        display: none !important;
      }
    }

    #lista-contatos-menu.lista-contatos-menu {
      display: none;
      position: fixed;
      z-index: 10050;
      background: var(--panel);
      border: 1px solid var(--border);
      border-radius: 12px;
      box-shadow: 0 8px 28px rgba(15, 18, 40, .18);
      padding: 6px 0;
      min-width: 220px;
      max-width: min(280px, 92vw);
      transform-origin: 0 0;
    }
    #lista-contatos-menu.lista-contatos-menu.open {
      display: block;
      animation: lista-contatos-menu-balao 0.2s ease-out both;
    }
    @keyframes lista-contatos-menu-balao {
      from {
        opacity: 0;
        transform: scale(0.96);
      }
      to {
        opacity: 1;
        transform: scale(1);
      }
    }
    @media (prefers-reduced-motion: reduce) {
      #lista-contatos-menu.lista-contatos-menu.open {
        animation: none;
        opacity: 1;
        transform: none;
      }
    }
    .lista-contatos-menu-item {
      display: block;
      width: 100%;
      text-align: left;
      padding: 11px 14px;
      border: none;
      background: transparent;
      font-size: 14px;
      font-weight: 600;
      color: var(--text);
      cursor: pointer;
      font-family: inherit;
    }
    .lista-contatos-menu-item:hover { background: var(--list-hover); }

    .tag-pending {
      display: inline-flex; align-items: center; gap: 3px;
      font-size: 10px; font-weight: 700; color: #92400e;
      background: var(--yellow-soft); border: 1px solid #fde68a;
      border-radius: 8px; padding: 1px 7px; margin-top: 1px;
    }

    /* Shell antes do primeiro fetch / F5 — não confundir com lista vazia real */
    .contacts-list-placeholder {
      text-align: center;
      padding: 36px 20px 32px;
      color: var(--text-3);
      font-size: 13px;
      font-weight: 700;
      line-height: 1.5;
    }
    .contacts-list-placeholder-ic {
      display: block;
      font-size: 28px;
      margin-bottom: 10px;
      opacity: 0.45;
    }
    .contacts-list-placeholder-txt {
      display: block;
      letter-spacing: 0.01em;
    }
    .no-contacts { text-align: center; padding: 32px 20px; color: var(--text-3); font-size: 13px; font-weight: 600; line-height: 1.8; }
    .no-contacts .no-icon { font-size: 36px; display: block; margin-bottom: 8px; opacity: .5; }


    .sync-sidebar-status {
      flex-shrink: 0;
      padding: 2px 14px 6px;
      text-align: center;
      font-size: 10px;
      font-weight: 600;
      letter-spacing: 0.03em;
      color: rgba(100, 116, 139, 0.52);
      line-height: 1.35;
    }
    .contacts-offline-banner {
      flex-shrink: 0;
      padding: 9px 12px;
      font-size: 12px;
      font-weight: 800;
      text-align: center;
      letter-spacing: 0.02em;
      line-height: 1.35;
      color: #fff;
      background: #b91c1c;
      border-top: 1px solid rgba(0, 0, 0, 0.12);
      box-shadow: 0 -1px 0 rgba(255, 255, 255, 0.06) inset;
    }
    .sidebar-footer-bar {
      flex-shrink: 0;
      position: relative;
      border-top: 1px solid var(--border);
    }
    .sidebar-footer-version {
      flex-shrink: 0;
      padding: 8px 14px 12px;
      border-top: none;
      font-size: 11px;
      font-weight: 600;
      color: var(--text-3);
      text-align: center;
      letter-spacing: 0.02em;
      line-height: 1.4;
    }
    .sb-zori-download-progress {
      position: absolute;
      right: 10px;
      bottom: 6px;
      z-index: 5;
      max-width: 52%;
      padding: 0 0 0 8px;
      font-size: 10px;
      font-weight: 600;
      letter-spacing: 0.02em;
      line-height: 1.3;
      color: var(--accent, #20a078);
      text-align: right;
      pointer-events: none;
    }
    .zori-electron-shell .sb-zori-download-progress:not(.d-none) ~ .sidebar-footer-version {
      padding-right: 38%;
    }
    .sb-debug-log {
      position: absolute;
      left: 10px;
      bottom: 10px;
      z-index: 50;
      font-size: 11px;
      font-weight: 700;
      letter-spacing: .02em;
      padding: 0;
      border: 0;
      background: transparent;
      color: rgba(17,24,39,.38);
      cursor: pointer;
      user-select: none;
    }
    .sb-debug-log:hover { color: rgba(17,24,39,.68); text-decoration: underline; }
    .sb-debug-log:active { color: rgba(17,24,39,.78); }

    /* Assistente «Novo grupo» na sidebar (usa classes de base.css nos cards) */
    .sidebar-view-novo-grupo {
      display: flex;
      flex-direction: column;
      flex: 1;
      min-height: 0;
      overflow: hidden;
      background: var(--panel);
    }
    .gc-wizard-step {
      display: flex;
      flex-direction: column;
      flex: 1;
      min-height: 0;
      overflow: hidden;
    }
    .gc-wizard-toolbar {
      display: flex;
      align-items: flex-start;
      gap: 8px;
      padding: 8px 12px 8px;
      flex-shrink: 0;
      border-bottom: 1px solid var(--border);
      background: var(--panel);
    }
    .gc-wizard-toolbar-text {
      display: flex;
      flex-direction: column;
      gap: 2px;
      min-width: 0;
      padding-top: 2px;
    }
    .gc-wizard-toolbar-text strong { font-size: 14px; font-weight: 800; letter-spacing: -0.02em; }
    .gc-wizard-toolbar-text span { font-size: 11px; font-weight: 600; color: var(--text-2); }
    /* Nova lista (+) no cabeçalho (iframe fica sem o botão duplicado em ?sidebar=1) */
    .gc-wizard-toolbar--transmissao {
      align-items: center;
    }
    .gc-wizard-toolbar--transmissao .gc-wizard-toolbar-text {
      flex: 1;
      min-width: 0;
    }
    .btn-sidebar-transmissao-nova {
      flex-shrink: 0;
      width: 40px;
      height: 40px;
      border-radius: 10px;
      border: 1px solid var(--border, #e2e8f0);
      background: var(--accent, #20a078);
      color: #fff;
      font-size: 22px;
      font-weight: 800;
      line-height: 1;
      cursor: pointer;
      padding: 0;
      margin: 0;
      font-family: inherit;
      box-sizing: border-box;
    }
    .btn-sidebar-transmissao-nova:hover {
      filter: brightness(1.05);
    }
    .btn-sidebar-transmissao-nova:focus-visible {
      outline: 2px solid var(--accent, #20a078);
      outline-offset: 2px;
    }
    .gc-wizard-card {
      flex: 1;
      min-height: 0;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
      margin: 8px 10px 0;
    }
    .gc-wizard-footer {
      flex-shrink: 0;
      margin-top: auto;
    }

    /* Passo «Adicionar membros»: FAB sobre a lista (rodapé versão oculto com .gc-wizard-active) */
    .gc-wizard-step--members .gc-m-body {
      flex: 1;
      min-height: 0;
      position: relative;
      display: flex;
      flex-direction: column;
      padding-bottom: var(--zori-safe-bottom);
    }
    .gc-wizard-card.gc-wizard-card--members {
      margin-bottom: 0;
      padding-bottom: 92px;
    }
    .gc-wizard-fab.gc-wizard-fab--members {
      position: absolute;
      right: 18px;
      bottom: max(12px, var(--zori-safe-bottom));
      left: auto;
      z-index: 8;
      min-height: 48px;
      padding: 14px 24px;
      box-shadow:
        0 8px 28px rgba(15, 23, 42, 0.2),
        0 2px 8px rgba(15, 23, 42, 0.1);
    }
    .gc-wizard-fab.gc-wizard-fab--members:focus-visible {
      outline: 2px solid var(--accent, #20a078);
      outline-offset: 3px;
    }

    #panel-contacts.gc-wizard-active .sidebar-footer-bar {
      display: none !important;
    }

    .gc-p-scroll {
      flex: 1;
      min-height: 0;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
      padding: 6px 10px 10px;
    }

    /* Perfil / configurações, Ajuda e Listas de transmissão (iframes) */
    .sidebar-view-perfil,
    .sidebar-view-desktop-app,
    .sidebar-view-ajuda,
    .sidebar-view-transmissao,
    .sidebar-view-ligacoes {
      display: flex;
      flex-direction: column;
      flex: 1;
      min-height: 0;
      overflow: hidden;
      background: var(--panel);
    }
    .sidebar-perfil-iframe,
    .sidebar-desktop-app-iframe,
    .sidebar-ajuda-iframe,
    .sidebar-transmissao-iframe {
      flex: 1;
      min-height: 0;
      width: 100%;
      border: 0;
      display: block;
      background: linear-gradient(145deg, #dde6ff 0%, #eef1fb 50%, #e8f4ff 100%);
    }
