:root{
    --brand:#3A8FE0; --brand2:#2E77C9; --ink:#0d1424;
    --bg:#eef1f6; --card:#ffffff; --linha:#e6eaf0; --txt:#1a2230; --mut:#6b7686;
  }
  *{ box-sizing:border-box; }
  html,body{ height:100%; }
  /* BLINDAGEM MOBILE (anti-"tela arrastando"): impede que QUALQUER elemento que estoure a largura
     estique o layout viewport do celular. Sem isso, um overflow fora do <main> esticava a largura e os
     popups position:fixed (confirmação "Excluir", modais) eram centralizados nessa largura esticada →
     caíam pela metade pra fora da direita, o botão de confirmar ficava inalcançável e a tela deslizava
     sem parar na horizontal. overflow-x:clip trava sem criar scroll e sem quebrar o position:sticky da
     barra de controles (fallback hidden em navegadores antigos que não suportam clip). */
  html{ overflow-x:clip; overscroll-behavior-x:none; }
  @supports not (overflow:clip){ html{ overflow-x:hidden; } }
  body{ margin:0; font-family:'Inter','Segoe UI',system-ui,Arial,sans-serif; color:var(--txt); background:var(--bg);
    display:flex; flex-direction:column; overflow:hidden; overscroll-behavior-x:none; -webkit-font-smoothing:antialiased; text-rendering:optimizeLegibility; }
  /* modal/confirmação SEMPRE dentro da viewport, com folga nas bordas; e enquanto um overlay está aberto,
     o conteúdo atrás não rola/arrasta (reforço contra o arrasto infinito). */
  .overlay{ padding:16px; box-sizing:border-box; }
  .cmodal, .overlay .modal{ max-width:calc(100vw - 32px); }
  body:has(.overlay.on) main{ overflow:hidden; touch-action:none; }
  /* ANTI-FLASH: até o 1º render (devices já carregados) o painel fica oculto e aparece só um
     spinner neutro. Elimina o "flash" de "0 device(s)"/tabela vazia que piscava no boot.
     html.pronto é setado pelo renderer no 1º render; um failsafe libera após 10s de qualquer jeito. */
  #bootSpin{ position:fixed; inset:0; display:none; align-items:center; justify-content:center; background:var(--bg); z-index:30; }
  html.bootvis:not(.pronto) #bootSpin{ display:flex; }   /* 14/11 ANTI-FLASH: spinner só aparece se o boot passar de ~400ms — load rápido (cache/master) nunca vê a tela de carregamento */
  #bootSpin i{ display:block; width:30px; height:30px; border-radius:50%; border:3px solid rgba(120,135,160,.25); border-top-color:#2E7DD1; animation:bootspin .7s linear infinite; }
  @keyframes bootspin{ to{ transform:rotate(360deg); } }
  html.pronto #bootSpin{ display:none; }
  html:not(.pronto) #contador, html:not(.pronto) main{ visibility:hidden; }
  html.pronto main{ animation:dn5fade .18s ease-out; }   /* conteúdo entra suave, sem corte seco do spinner */
  @keyframes dn5fade{ from{ opacity:0 } to{ opacity:1 } }
  button,input,select,textarea{ font-family:inherit; }

  /* Top bar (barra de titulo + marca) */
  header{ background:linear-gradient(180deg,#0f1830,#0b1120); color:#fff; display:flex; align-items:center; gap:12px;
    flex-wrap:wrap; row-gap:8px; min-height:52px; flex-shrink:0; padding:7px 18px; box-sizing:border-box; -webkit-app-region: drag; box-shadow:0 2px 10px #0003; }
  header .logo{ height:36px; display:block; flex:0 0 auto; max-width:150px; object-fit:contain; object-position:left center; }
  header #btnApps{ margin-left:auto; }
  #vencHostMob{ display:none; }   /* host da barra de validade — só aparece no mobile (chip fica no header no desktop) */
  header button{ background:#ffffff14; color:#fff; border:1px solid #ffffff2e; padding:8px 13px; border-radius:8px;
    cursor:pointer; font-size:13px; font-weight:500; -webkit-app-region: no-drag; transition:.15s; }
  header button:hover{ background:#ffffff26; border-color:#ffffff55; }
  header button svg{ width:17px; height:17px; display:block; }
  header #btnApps{ display:inline-flex; align-items:center; gap:7px; }
  header #btnSairApp:hover{ color:#ff5a4d; background:#e2483d1f; border-color:#e2483d66; }
  /* botão "Painel Admin" (só admin): azul destacado no header; no celular vira só o ícone da seta */
  header #btnPainelAdmin{ display:inline-flex; align-items:center; gap:7px; font-weight:700;
    background:linear-gradient(180deg,#3A8FE0,#2E77C9); color:#fff; border:none; box-shadow:0 3px 10px rgba(47,125,209,.4); }
  header #btnPainelAdmin:hover{ filter:brightness(1.07); background:linear-gradient(180deg,#3A8FE0,#2E77C9); border:none; }
  header #btnPainelAdmin svg{ width:18px; height:18px; }
  .btn-indicar{ width:100%; display:flex; align-items:center; justify-content:center; gap:9px;
    padding:14px 18px; border:none; border-radius:12px; cursor:pointer; font-family:inherit;
    font-size:14.5px; font-weight:700; letter-spacing:.2px; color:#fff;
    background:linear-gradient(135deg,#4C9AF5 0%,#2E77C9 55%,#1E5FA8 100%);
    box-shadow:0 6px 18px rgba(46,119,201,.35);
    transition:transform .12s ease, box-shadow .12s ease, filter .12s ease; }
  .btn-indicar:hover{ transform:translateY(-1px); filter:brightness(1.07); box-shadow:0 9px 24px rgba(46,119,201,.48); }
  .btn-indicar:active{ transform:translateY(0); box-shadow:0 5px 14px rgba(46,119,201,.35); }
  .btn-indicar .gift{ font-size:16px; }
  .ac-inp{ width:100%; padding:11px 12px; border:1px solid var(--linha); border-radius:9px; font-size:14px; background:var(--card); color:var(--ink); }
  body.dark .ac-inp{ background:#0f1722; }
  .ac-inp:focus{ outline:none; border-color:var(--brand); box-shadow:0 0 0 3px #3a8fe022; }
  /* campo com lápis (telefone editável) */
  .ac-field{ position:relative; }
  .ac-field .ac-inp{ padding-right:44px; }
  .ac-edit{ position:absolute; right:6px; top:50%; transform:translateY(-50%); width:32px; height:32px; -webkit-app-region:no-drag;
    display:inline-flex; align-items:center; justify-content:center; border:none; background:transparent; color:var(--mut,#7d8ba0);
    cursor:pointer; border-radius:8px; transition:all .13s; }
  .ac-edit:hover{ background:var(--card2,#eef1f6); color:var(--brand); }
  .ac-edit svg{ width:16px; height:16px; }
  body.dark .ac-edit:hover{ background:#0c1219; }
  .ac-inp.editando{ border-color:var(--brand); box-shadow:0 0 0 3px #3a8fe022; }
  /* botão alterar senha */
  .ac-senha{ width:100%; display:inline-flex; align-items:center; justify-content:center; gap:8px; padding:11px; border-radius:10px;
    border:1.5px solid var(--linha); background:var(--card); color:var(--txt); font-weight:600; font-size:13.5px; cursor:pointer; transition:all .13s; }
  .ac-senha:hover{ border-color:var(--brand); color:var(--brand); background:#f5f9fe; }
  .ac-senha svg{ width:16px; height:16px; }
  body.dark .ac-senha{ background:#0c1219; }
  body.dark .ac-senha:hover{ background:#111a25; }
  /* linha de envio do chat */
  .chat-send{ display:flex; gap:8px; margin-top:10px; }
  .chat-send .ac-inp{ flex:1; }
  #chatEnviar{ display:inline-flex; align-items:center; gap:6px; padding:0 16px; white-space:nowrap; }
  #chatEnviar svg{ width:15px; height:15px; }
  .ac-inp[readonly]{ opacity:.7; cursor:default; }
  /* o X de fechar é injetado no canto sup. direito do modal (sticky); reserva espaço p/ não cobrir os chips */
  #ovApps .apps-head{ padding-right:44px; }
  .apps-count{ font-size:12px; font-weight:800; color:#2E77C9; background:rgba(46,119,201,.12); border:1px solid rgba(46,119,201,.25); border-radius:999px; padding:3px 10px; white-space:nowrap; }
  body.dark .apps-count{ color:#7fb3f0; background:rgba(46,119,201,.18); border-color:rgba(46,119,201,.35); }
  @media(max-width:560px){ #ovApps .apps-head{ padding-right:0; } #ovApps .apps-filtro{ width:100%; justify-content:space-between; } }
  .apps-filtro{ display:inline-flex; gap:4px; background:var(--card2,#eef1f6); border:1px solid var(--linha); border-radius:10px; padding:3px; }
  body.dark .apps-filtro{ background:#0f1722; }
  .apps-filtro .af{ border:none; background:transparent; color:var(--mut,#7d8ba0); font-size:12.5px; font-weight:600; padding:6px 12px; border-radius:8px; cursor:pointer; transition:all .12s; }
  .apps-filtro .af:hover{ color:var(--ink); }
  .apps-filtro .af.on{ background:#2E77C9; color:#fff; box-shadow:0 2px 6px rgba(46,119,201,.35); }
  /* chat */
  .chat-b{ max-width:80%; padding:9px 12px; border-radius:12px; font-size:13.5px; line-height:1.4; word-break:break-word; }
  .chat-b.eu{ align-self:flex-end; background:linear-gradient(180deg,#3A8FE0,#2E77C9); color:#fff; border-bottom-right-radius:4px; }
  .chat-b.adm{ align-self:flex-start; background:var(--card,#fff); border:1px solid var(--linha); color:var(--ink); border-bottom-left-radius:4px; }
  body.dark .chat-b.adm{ background:#182230; }
  .chat-vazio{ color:var(--mut,#7d8ba0); font-size:13px; text-align:center; margin:auto; }
  /* chip de validade no topo */
  #vencChip{ -webkit-app-region:no-drag; display:none; align-items:center; cursor:pointer; border:none;
    padding:7px 14px; border-radius:99px; font-size:12.5px; font-weight:700; transition:transform .12s, filter .12s; }
  #vencChip:hover{ filter:brightness(1.1); }
  #vencChip .vc-status{ display:inline-flex; align-items:center; gap:8px; white-space:nowrap; }
  #vencChip .vc-col{ display:inline-flex; flex-direction:row; align-items:center; flex-wrap:nowrap; gap:10px; line-height:1.1; }
  #vencChip .vc-plano{ font-size:8.5px; font-weight:800; letter-spacing:.6px; text-transform:uppercase; padding:2px 8px; border-radius:99px; background:color-mix(in srgb, currentColor 16%, transparent); flex:0 0 auto; }
  /* chip VIP — brilhante (glint tipo lâmina) + coroa */
  #vencChip.vip-chip{ background:linear-gradient(120deg,#4b2e8f,#8b5cf6 45%,#c9abff 52%,#8b5cf6 60%,#4b2e8f) !important; color:#fff !important; border:1px solid rgba(201,171,255,.55) !important; position:relative; overflow:hidden; box-shadow:0 3px 14px rgba(139,92,246,.4); }
  #vencChip.vip-chip::after{ content:""; position:absolute; top:0; left:-70%; width:55%; height:100%; background:linear-gradient(100deg,transparent,rgba(255,255,255,.7),transparent); transform:skewX(-20deg); animation:vipShine 3.6s ease-in-out infinite; pointer-events:none; }
  @keyframes vipShine{ 0%{left:-70%} 62%{left:150%} 100%{left:150%} }
  #vencChip.vip-chip .vc-status{ gap:7px; }
  #vencChip .vc-crown{ font-size:14px; line-height:1; filter:drop-shadow(0 1px 2px rgba(0,0,0,.35)); }
  #vencChip .vc-vip{ font-size:14px; font-weight:900; letter-spacing:1.2px; }
  #vencChip .vc-vip-sub{ font-size:8.5px; font-weight:800; text-transform:uppercase; letter-spacing:.6px; padding:1.5px 8px; border-radius:99px; background:rgba(255,255,255,.2); }
  #vencChip .vc-dot{ width:7px; height:7px; border-radius:50%; background:var(--dot,#2E7DD1); box-shadow:0 0 0 3px color-mix(in srgb, var(--dot,#2E7DD1) 28%, transparent); animation:vcPulse 2s ease-in-out infinite; }
  @keyframes vcPulse{ 0%,100%{ box-shadow:0 0 0 2px color-mix(in srgb, var(--dot,#2E7DD1) 30%, transparent); } 50%{ box-shadow:0 0 0 5px color-mix(in srgb, var(--dot,#2E7DD1) 10%, transparent); } }
  header .sino{ position:relative; padding:8px 12px; display:inline-flex; align-items:center; justify-content:center; gap:7px; white-space:nowrap; }
  .badge{ position:absolute; top:-5px; right:-5px; min-width:17px; height:17px; background:#e11d2a; border-radius:9px; color:#fff;
    font-size:10px; font-weight:700; display:none; align-items:center; justify-content:center; padding:0 4px; box-shadow:0 0 0 2px #0b1120; }
  .badge.on{ display:flex; }
  .rec-rel{ position:relative; }
  .rbadge{ display:none; position:absolute; top:-6px; right:-6px; min-width:17px; height:17px; background:#e11d2a; border-radius:9px;
    color:#fff; font-size:10px; font-weight:800; align-items:center; justify-content:center; padding:0 4px; box-shadow:0 0 0 2px var(--card,#fff); }
  .rbadge.on{ display:inline-flex; }
  .mr-item{ border:1px solid var(--linha); border-radius:10px; padding:11px 13px; margin-bottom:10px; background:var(--card2,transparent); }
  .mr-item.novo-dec{ border-color:color-mix(in srgb, var(--dot,#2E7DD1) 55%, var(--linha)); box-shadow:0 0 0 2px color-mix(in srgb, var(--dot,#2E7DD1) 14%, transparent); }
  .mr-top{ display:flex; align-items:center; justify-content:space-between; gap:10px; }
  .mr-nome{ font-weight:800; font-size:15px; }
  .mr-quando{ font-size:12px; color:var(--mut); white-space:nowrap; }
  .mr-site{ font-size:12px; color:var(--mut); margin-top:3px; word-break:break-all; }
  .mr-motivo{ font-size:12.5px; color:var(--tx,inherit); margin-top:6px; line-height:1.45; background:rgba(226,72,61,.10); border:1px solid rgba(226,72,61,.22); border-radius:8px; padding:7px 10px; word-break:break-word; }
  .mr-motivo b{ color:#e2483d; font-weight:700; }
  .mr-st{ font-size:11px; font-weight:800; padding:3px 9px; border-radius:99px; white-space:nowrap; }
  .mr-st.pend{ background:rgba(240,176,74,.18); color:#d98a00; }
  .mr-st.ok{ background:rgba(46,160,96,.18); color:#2ea060; }
  .mr-st.no{ background:rgba(226,72,61,.18); color:#e2483d; }
  .mr-vazio{ text-align:center; color:var(--mut); padding:22px; font-size:14px; }
  .patch.rec-aviso{ cursor:pointer; }
  .patch.rec-aviso .ver{ color:var(--dot,#2E7DD1); }
  /* cada novidade vira um cartão */
  .patch{ padding:13px 15px; margin-bottom:11px; border:1px solid var(--linha,#e6eaf0); border-radius:13px; background:var(--card2,#f8fafc); box-shadow:0 2px 8px rgba(10,20,40,.04); }
  body.dark .patch{ background:#0f1722; }
  .patch:last-child{ margin-bottom:0; }
  .patch-top{ display:flex; align-items:center; flex-wrap:wrap; gap:8px; }
  .patch .ver{ font-weight:800; color:var(--ink); font-size:14px; }
  .patch .data{ color:var(--mut); font-size:11.5px; margin-left:auto; font-variant-numeric:tabular-nums; white-space:nowrap; }
  .patch-tag{ font-size:9.5px; font-weight:800; text-transform:uppercase; letter-spacing:.5px; color:#2E7DD1; background:color-mix(in srgb,#2E7DD1 15%,transparent); border-radius:99px; padding:2.5px 9px; }
  .patch ul{ margin:9px 0 0; padding-left:18px; }
  .patch li{ font-size:13px; color:#33405a; margin:4px 0; line-height:1.45; }
  body.dark .patch li{ color:#c4cdda; }
  /* ===== TEMA ESCURO ===== */
  body.dark{ --bg:#0f141c; --card:#161d28; --linha:#28323f; --txt:#e6ebf2; --mut:#8b98aa; --ink:#f0f5fb; }
  body.dark th{ background:#1a2230; color:#8b98aa; }
  body.dark tbody tr{ border-bottom-color:#222b37; }
  body.dark tbody tr:hover{ background:#1b2531; }
  body.dark td .mac{ color:#aeb9c9; }
  body.dark .toolbar input#busca,
  body.dark .toolbar select,
  body.dark .toolbar .tbtn,
  body.dark .campo input,
  body.dark .campo select{ background:#111825; color:#e6ebf2; border-color:#28323f; }
  input.locked{ background:#eef1f6 !important; color:#1a2230 !important; cursor:not-allowed; }
  body.dark input.locked{ background:#0b1119 !important; color:#e6ebf2 !important; cursor:not-allowed; }
  body.dark .toolbar .tbtn:hover{ background:#1b2531; border-color:#3a4757; }
  body.dark .cmodal{ background:#161d28; }
  body.dark .cmodal p, body.dark .modal p{ color:#c4cdda; }
  body.dark .btn-sec{ background:#243040; color:#dfe6ef; }
  body.dark .btn-sec:hover{ background:#2c3a4d; }
  body.dark .log{ background:#111825; border-color:#28323f; }
  body.dark .patch{ border-bottom-color:#222b37; }
  body.dark .patch li, body.dark .patch .ver{ color:#c4cdda; }
  body.dark .vazio{ color:#8b98aa; }
  body.dark .dnslist label:hover{ background:#1b2531; }
  .ver-label{ color:rgba(255,255,255,.45); font-size:11px; font-weight:600; letter-spacing:.3px; align-self:center; margin-left:2px; white-space:nowrap; }
  body.dark .ver-label{ color:rgba(255,255,255,.45); }
  /* seletor de plano + crédito + indicação no modal de pagamento */
  .pg-plano-info{ background:rgba(46,125,209,.07); border:1px solid rgba(46,125,209,.2); border-radius:12px; padding:12px 14px; margin-bottom:14px; }
  .pg-plano-badge{ display:inline-block; font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:.5px; color:#2E7DD1; background:rgba(46,125,209,.14); border-radius:99px; padding:3px 11px; margin-bottom:9px; }
  body.dark .pg-plano-badge{ color:#7db0ff; }
  .pg-feats{ margin:0; padding:0; list-style:none; display:flex; flex-direction:column; gap:7px; }
  .pg-feats li{ position:relative; padding-left:22px; font-size:12.5px; line-height:1.35; color:var(--txt,var(--ink)); }
  .pg-feats li::before{ content:"✓"; position:absolute; left:0; top:0; color:#2ea060; font-weight:800; }
  #pagBtn{ background:linear-gradient(180deg,#3A8FE0,#2E7DD1) !important; border:none !important; border-radius:13px !important; padding:15px !important; font-size:15px !important; font-weight:800 !important; letter-spacing:.2px; box-shadow:0 7px 20px rgba(46,125,209,.42); transition:transform .14s ease, box-shadow .14s ease, filter .14s ease; position:relative; overflow:hidden; }
  #pagBtn:hover{ transform:translateY(-2px); box-shadow:0 12px 28px rgba(46,125,209,.52); filter:brightness(1.06); }
  #pagBtn:active{ transform:translateY(0); box-shadow:0 5px 14px rgba(46,125,209,.4); }
  #pagBtn svg{ opacity:.95; }
  #pagBtn::after{ content:""; position:absolute; top:0; left:-60%; width:45%; height:100%; background:linear-gradient(100deg,transparent,rgba(255,255,255,.35),transparent); transform:skewX(-20deg); animation:pagShine 4.5s ease-in-out infinite; pointer-events:none; }
  @keyframes pagShine{ 0%{left:-60%} 50%{left:150%} 100%{left:150%} }
  .pg-planos{ display:flex; gap:10px; margin-bottom:12px; }
  .pg-plano{ flex:1; position:relative; border:1.5px solid var(--linha); background:var(--card); border-radius:12px; padding:13px 10px 11px; cursor:pointer; text-align:center; font-family:inherit; transition:all .13s; }
  .pg-plano:hover{ border-color:#9cc3ea; }
  .pg-plano.on{ border-color:var(--brand,#2E7DD1); background:#f2f8ff; box-shadow:0 0 0 1px var(--brand,#2E7DD1) inset; }
  body.dark .pg-plano.on{ background:#10203a; }
  .pg-pl-nome{ display:block; font-size:11px; font-weight:800; color:var(--mut); text-transform:uppercase; letter-spacing:.4px; }
  .pg-pl-preco{ display:block; font-size:22px; font-weight:800; color:var(--txt,var(--ink)); line-height:1.1; margin-top:3px; }
  .pg-pl-obs{ display:block; font-size:11px; color:var(--mut); margin-top:1px; }
  .pg-pl-tag{ position:absolute; top:-9px; left:50%; transform:translateX(-50%); background:#2ea060; color:#fff; font-size:9.5px; font-weight:800; padding:2px 8px; border-radius:99px; white-space:nowrap; text-transform:uppercase; letter-spacing:.3px; }
  .pg-credito{ background:rgba(46,160,96,.1); border:1px solid rgba(46,160,96,.32); color:#1f8a4c; border-radius:10px; padding:9px 12px; font-size:12.5px; font-weight:600; margin-bottom:12px; text-align:center; }
  body.dark .pg-credito{ color:#5fd58c; }
  .pg-indica{ display:flex; align-items:center; justify-content:center; gap:7px; margin-top:12px; width:100%; background:none; border:1px dashed var(--linha); border-radius:10px; padding:10px; cursor:pointer; font-family:inherit; font-size:12.5px; color:var(--brand,#2E7DD1); font-weight:700; transition:background .13s; }
  .pg-indica:hover{ background:#f2f8ff; } body.dark .pg-indica:hover{ background:#10203a; }
  .pg-indica svg{ width:15px; height:15px; }
  /* botão secundário: cartão / outras formas */
  .pg-cartao{ width:100%; margin-top:9px; background:none; border:1px solid var(--linha); color:var(--mut,#7d8ba0); border-radius:11px; padding:11px; font-family:inherit; font-size:12.5px; font-weight:600; cursor:pointer; transition:all .13s; }
  .pg-cartao:hover{ border-color:#9cc3ea; color:var(--brand,#2E7DD1); background:#f5f9fe; }
  body.dark .pg-cartao:hover{ background:#10203a; }
  /* ===== painel PIX in-app ===== */
  .pg-pix{ margin-top:14px; border:1px solid var(--linha); border-radius:14px; padding:14px; background:var(--card2,#f7fafe); text-align:center; }
  body.dark .pg-pix{ background:#0f1722; }
  .pg-pix-top{ display:flex; align-items:center; justify-content:center; gap:10px; margin-bottom:10px; }
  .pg-pix-v{ font-size:22px; font-weight:800; color:var(--txt,var(--ink)); font-variant-numeric:tabular-nums; }
  .pg-pix-plano{ font-size:10.5px; font-weight:800; text-transform:uppercase; letter-spacing:.5px; color:#2E7DD1; background:rgba(46,125,209,.14); border-radius:99px; padding:3px 10px; }
  .pg-pix-qr{ background:#fff; border-radius:12px; padding:12px; display:inline-block; box-shadow:0 2px 10px rgba(10,20,40,.08); }
  .pg-pix-qr img{ display:block; width:200px; height:200px; max-width:60vw; max-height:60vw; image-rendering:pixelated; }
  .pg-pix-copia{ display:flex; gap:7px; margin-top:12px; }
  .pg-pix-copia input{ flex:1; min-width:0; padding:10px 11px; border:1px solid var(--linha); border-radius:9px; font-size:11.5px; font-family:'Cascadia Code',Consolas,monospace; background:var(--card,#fff); color:var(--txt,var(--ink)); }
  body.dark .pg-pix-copia input{ background:#0b1119; }
  #pixCopiar{ flex:0 0 auto; border:none; border-radius:9px; background:var(--brand,#2E7DD1); color:#fff; font-weight:700; font-size:12.5px; padding:0 15px; cursor:pointer; transition:filter .12s; }
  #pixCopiar:hover{ filter:brightness(1.08); }
  #pixCopiar.ok{ background:#16a34a; }
  .pg-pix-status{ display:flex; align-items:center; justify-content:center; gap:8px; margin-top:13px; font-size:13px; font-weight:700; color:#d98a00; }
  .pg-pix-status .pix-dot{ width:9px; height:9px; border-radius:50%; background:#f0b04a; animation:pulse 1s ease-in-out infinite; }
  .pg-pix-status.ok{ color:#16a34a; } .pg-pix-status.ok .pix-dot{ background:#16a34a; animation:none; }
  .pg-pix-nota{ font-size:11px; color:var(--mut,#7d8ba0); margin-top:10px; line-height:1.5; }
  .copy-label{ flex-shrink:0; text-align:center; font-size:10px; color:var(--mut); opacity:.6; padding:5px 10px calc(5px + env(safe-area-inset-bottom,0px)); background:var(--bg); border-top:1px solid var(--linha); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

  .topbar{ height:3px; width:100%; background:transparent; overflow:hidden; flex-shrink:0; }
  .topbar.on{ background:#d7e3f3; }
  .topbar span{ display:block; height:100%; border-radius:2px; background:#2E77C9; width:40%; transform:translateX(-100%); transition:width .3s ease; }
  /* modo indeterminado (ação única): anima varrendo */
  .topbar.on.indet span{ width:40%; animation:barLoad 1.1s ease-in-out infinite; }
  /* modo determinado (%): a largura mostra o progresso real */
  .topbar.on.det span{ transform:none; animation:none; }
  @keyframes barLoad{ 0%{transform:translateX(-100%)} 50%{transform:translateX(160%)} 100%{transform:translateX(260%)} }
  body.dark .topbar.on{ background:#1b2b40; }
  .prog-chip{ position:fixed; top:58px; right:16px; z-index:70; display:none; align-items:center; gap:6px;
    background:#0f1830; color:#fff; font-size:12px; font-weight:600; padding:5px 11px; border-radius:999px; box-shadow:0 6px 18px #0004; }
  .prog-chip.on{ display:inline-flex; }
  .prog-chip .dot{ width:8px; height:8px; border-radius:50%; background:#5FB0FF; animation:pulse 1s ease-in-out infinite; }
  @keyframes pulse{ 0%,100%{opacity:.4} 50%{opacity:1} }
  body.dark .prog-chip{ background:#1b2531; }
  .controls{ flex-shrink:0; padding:16px 18px 4px; }
  main{ padding:12px 18px 18px; flex:1 1 auto; overflow:auto; }
  .barra{ font-weight:600; color:var(--mut); margin-bottom:10px; font-size:13px; }
  /* ---- resumo em chips (contador) ---- */
  #contador{ display:block; margin-bottom:12px; }
  .chip-c{ display:inline-flex; align-items:center; gap:6px; font-size:12.5px; font-weight:700; padding:5px 11px;
    border-radius:99px; border:1px solid var(--linha); background:var(--card); color:var(--txt); line-height:1; }
  .chip-c svg{ width:14px; height:14px; opacity:.9; }
  .chip-c .dot{ width:7px; height:7px; border-radius:50%; background:currentColor; }
  .chip-c.venc{ color:#c07600; background:rgba(192,118,0,.1); border-color:rgba(192,118,0,.3); }
  .chip-c.exp{ color:#d32f3a; background:rgba(211,47,58,.1); border-color:rgba(211,47,58,.3); }
  .chip-c.upd{ color:#2E77C9; background:rgba(46,119,201,.1); border-color:rgba(46,119,201,.3); }
  .chip-c.upd .dot{ animation:pulseDot 1s ease-in-out infinite; }
  @keyframes pulseDot{ 0%,100%{ opacity:.3; } 50%{ opacity:1; } }
  body.dark .chip-c.venc{ color:#f0b04a; }
  body.dark .chip-c.exp{ color:#ff7a86; }
  body.dark .chip-c.upd{ color:#7db6f0; }
  .chip-c.total{ cursor:pointer; user-select:none; }
  .chip-c.total:hover{ border-color:var(--azul,#2E77C9); }
  .chip-c.venc, .chip-c.exp{ cursor:pointer; user-select:none; transition:box-shadow .12s, transform .12s; }
  .chip-c.venc:hover, .chip-c.exp:hover{ transform:translateY(-1px); }
  .chip-c.on{ box-shadow:0 0 0 2px currentColor inset; }
  .chip-c.total .caret{ width:12px; height:12px; opacity:.6; margin-left:1px; }
  /* ---- resumo em CARDS (maiores) ---- */
  .sum-cards{ display:grid; grid-template-columns:repeat(4,1fr); gap:11px; margin-bottom:4px; }
  .sum-card{ display:flex; align-items:center; gap:11px; background:var(--card,#fff); border:1px solid var(--linha,#e2e8f0); border-radius:13px; padding:12px 14px; position:relative; overflow:hidden; cursor:pointer; transition:transform .12s, box-shadow .12s, border-color .12s; }
  .sum-card::before{ content:""; position:absolute; left:0; top:0; bottom:0; width:3px; background:var(--sc,#cbd5e1); }
  .sum-card:hover{ transform:translateY(-2px); box-shadow:0 7px 20px rgba(16,24,40,.10); border-color:color-mix(in srgb,var(--sc,#cbd5e1) 45%,var(--linha,#e2e8f0)); }
  .sum-card.on{ box-shadow:0 0 0 2px var(--sc,#2E77C9) inset; border-color:transparent; }
  .sum-ic{ width:38px; height:38px; border-radius:11px; display:flex; align-items:center; justify-content:center; background:color-mix(in srgb,var(--sc,#64748b) 18%,transparent); color:var(--sc,#64748b); flex:0 0 auto; }
  .sum-ic svg{ width:20px; height:20px; }
  .sum-main{ min-width:0; }
  .sum-v{ font-size:24px; font-weight:800; line-height:1; color:var(--sc,#1a2230); font-variant-numeric:tabular-nums; display:flex; align-items:center; gap:5px; }
  .sum-v .caret{ width:13px; height:13px; opacity:.55; }
  .sum-l{ font-size:11.5px; color:var(--mut,#64748b); margin-top:4px; font-weight:600; }
  .sum-sub{ font-size:10.5px; color:var(--azul,#2E77C9); margin-top:2px; font-weight:600; }
  .sum-card.total{ --sc:#2E77C9; }
  .sum-card.emdia{ --sc:#2ea36a; }
  .sum-card.venc{ --sc:#d98a00; }
  .sum-card.exp{ --sc:#e2483d; }
  /* "Vencendo" graduado por proximidade: acende só quando há algo vencendo e escala com o risco */
  .sum-card.venc-ameno{ background:color-mix(in srgb,var(--sc) 9%, var(--card,#fff)); border-color:color-mix(in srgb,var(--sc) 38%, var(--linha,#e2e8f0)); }
  .sum-card.venc-urgente{ background:color-mix(in srgb,var(--sc) 15%, var(--card,#fff)); border-color:color-mix(in srgb,var(--sc) 55%, var(--linha,#e2e8f0)); }
  .sum-card.venc-critico{ --sc:#e2483d; background:color-mix(in srgb,#e2483d 15%, var(--card,#fff)); border-color:color-mix(in srgb,#e2483d 55%, var(--linha,#e2e8f0)); }
  .sum-card.venc-urgente .sum-ic, .sum-card.venc-critico .sum-ic{ animation:vencPulse 1.5s ease-in-out infinite; }
  @keyframes vencPulse{ 0%,100%{ box-shadow:0 0 0 0 color-mix(in srgb,var(--sc) 50%, transparent); } 55%{ box-shadow:0 0 0 8px color-mix(in srgb,var(--sc) 0%, transparent); } }
  .sum-card.venc-ameno .sum-sub, .sum-card.venc-urgente .sum-sub, .sum-card.venc-critico .sum-sub{ color:var(--sc); font-weight:800; }
  @media (prefers-reduced-motion: reduce){ .sum-card .sum-ic{ animation:none !important; } }
  @media (max-width:760px){
    /* no celular os 4 números viram uma FAIXA compacta de 4 colunas (antes 2x2 ocupava ~190px).
       Sem ícone, número colorido em cima e rótulo embaixo — economiza muito espaço no topo. */
    .sum-cards{ grid-template-columns:repeat(4,1fr); gap:6px; }
    .sum-card{ flex-direction:row; align-items:center; justify-content:flex-start; gap:4px;
      padding:7px 5px; border-radius:11px; text-align:left; }
    .sum-card::before{ width:100%; height:3px; top:0; bottom:auto; left:0; }  /* barra de cor no topo */
    .sum-ic{ display:flex; width:23px; height:23px; border-radius:7px; }       /* ícone de volta, compacto */
    .sum-ic svg{ width:13px; height:13px; }
    .sum-main{ min-width:0; }
    .sum-v{ font-size:18px; justify-content:flex-start; gap:2px; }
    .sum-v .caret{ width:10px; height:10px; }
    .sum-l{ font-size:8.5px; line-height:1.1; letter-spacing:-.1px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
    .sum-sub{ display:none; }
  }
  /* popover: contagem por app */
  .pop-apps{ position:absolute; z-index:1000; background:var(--card,#fff); color:var(--txt,#1a2230);
    border:1px solid var(--linha,#e2e8f0); border-radius:12px; box-shadow:0 12px 32px rgba(0,0,0,.18);
    padding:10px; min-width:236px; max-height:60vh; overflow:auto; }
  .pop-apps-tit{ font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.4px; color:var(--mut,#98a2b3); padding:2px 4px 8px; }
  .pop-apps-row{ display:flex; align-items:center; justify-content:space-between; gap:12px; padding:5px 4px; }
  .pop-apps-row[data-app]{ flex-direction:column; align-items:stretch; gap:6px; border-radius:8px; cursor:pointer; transition:background .12s; }
  .pop-apps-row[data-app]:hover{ background:color-mix(in srgb,var(--azul,#2E77C9) 8%,transparent); }
  .pop-apps-row.on{ background:color-mix(in srgb,var(--azul,#2E77C9) 14%,transparent); box-shadow:0 0 0 1.5px var(--azul,#2E77C9) inset; }
  .pa-todos{ cursor:pointer; border-radius:8px; border:1px dashed var(--linha,#cbd5e1); padding:8px 10px; margin-bottom:6px; transition:background .12s; }
  .pa-todos:hover{ background:color-mix(in srgb,var(--azul,#2E77C9) 8%,transparent); }
  .pa-todos-lbl{ display:flex; align-items:center; gap:7px; font-weight:700; font-size:12.5px; color:var(--azul,#2E77C9); }
  .pa-todos-lbl::before{ content:"↺"; font-size:14px; line-height:1; }
  .pa-top{ display:flex; align-items:center; justify-content:space-between; gap:10px; }
  .pa-bar{ height:5px; border-radius:99px; background:rgba(120,135,160,.18); overflow:hidden; }
  .pa-fill{ height:100%; width:0; border-radius:99px; transition:width .45s cubic-bezier(.2,.8,.2,1); }
  .pa-pct{ font-size:10px; color:var(--mut,#98a2b3); margin-left:6px; font-weight:600; }
  .pop-apps-n{ font-weight:700; font-variant-numeric:tabular-nums; font-size:13px; }
  .pop-apps-tot{ display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:10px; padding:11px 13px; border-radius:10px; background:color-mix(in srgb,var(--azul,#2E7DD1) 9%,transparent); border:1px solid color-mix(in srgb,var(--azul,#2E7DD1) 24%,transparent); }
  .pop-apps-tot span:first-child{ font-size:11px; font-weight:700; letter-spacing:.5px; text-transform:uppercase; color:var(--mut,#6b7787); }
  .pop-apps-tot .pop-apps-n{ font-size:15px; color:var(--azul,#2E7DD1); }
  .controls .btn-massa{ margin-bottom:12px; }

  /* ---- card (slim) de listas perto de vencer (cliente responsável) ---- */
  #avisoVenc{ margin:0 0 10px; }
  /* aviso automático de "app fora do ar" (provedor do app), dirigido pelo canário */
  #statusAviso{ margin:0 0 10px; }
  .aviso-fora{ display:flex; gap:10px; align-items:flex-start; background:#fff6e5; border:1px solid #f0c060;
    border-radius:12px; padding:11px 13px; color:#7a5b10; font-size:13px; line-height:1.45; }
  body.dark .aviso-fora{ background:#2a2410; border-color:#5a4a1a; color:#e8cf8a; }
  .aviso-fora .af-ic{ font-size:16px; flex:0 0 auto; line-height:1.3; }
  .aviso-fora .af-tx{ min-width:0; }
  .aviso-fora b{ color:inherit; }
  .av-card{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; border-radius:10px; border:1px solid #f2c98a; background:#fff8ec; padding:7px 11px; }
  .av-ic{ width:22px; height:22px; border-radius:6px; display:flex; align-items:center; justify-content:center; background:#f6a823; color:#fff; flex:0 0 auto; }
  .av-ic svg{ width:13px; height:13px; }
  .av-lead{ font-weight:700; font-size:12px; color:#8a5a12; }
  .av-item{ display:inline-flex; align-items:center; gap:5px; font-size:11.5px; font-weight:600; padding:2px 8px; border-radius:999px; background:#fff; border:1px solid #f2c98a; color:#8a5a12; }
  .av-item .d{ font-variant-numeric:tabular-nums; opacity:.8; }
  body.dark .av-card{ border-color:#5a4320; background:#241f10; }
  body.dark .av-lead{ color:#f0c060; }
  body.dark .av-item{ background:#201c12; border-color:#5a4320; color:#f0c060; }
  /* popup diário de vencimento */
  #ovVenc .vp-lista{ display:flex; flex-direction:column; gap:8px; max-height:46vh; overflow:auto; margin:4px 0 2px; }
  #ovVenc .vp-row{ display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px 12px; border-radius:10px; border:1px solid var(--linha,#e9e2d2); background:var(--card,#fff); }
  #ovVenc .vp-row.exp{ border-color:#f0a9a9; background:#fff5f5; }
  body.dark #ovVenc .vp-row.exp{ border-color:#6a2a2a; background:#241212; }
  #ovVenc .vp-nome{ font-weight:700; font-size:13px; }
  #ovVenc .vp-meta{ font-size:11.5px; color:var(--mut,#98a2b3); margin-top:2px; }
  #ovVenc .vp-dias{ font-size:12px; font-weight:800; white-space:nowrap; font-variant-numeric:tabular-nums; }

  .card{ background:var(--card); border:1px solid var(--linha); border-radius:14px; overflow:hidden; box-shadow:0 6px 20px #0b112010; }
  /* ---- histórico de trocas (moderno) ---- */
  #histLista{ max-height:56vh; overflow:auto; margin:2px 0 4px; padding-right:4px; }
  .hist-item{ display:flex; gap:13px; padding:15px 2px; border-bottom:1px solid var(--linha); }
  .hist-item:last-child{ border-bottom:none; }
  .hist-dot{ flex:0 0 auto; width:36px; height:36px; border-radius:50%; display:flex; align-items:center; justify-content:center;
    background:linear-gradient(180deg,#3A8FE0,#2E77C9); color:#fff; box-shadow:0 3px 9px rgba(46,119,201,.4); }
  .hist-dot svg{ width:18px; height:18px; }
  .hist-body{ flex:1; min-width:0; }
  .hist-top{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
  .hist-when{ font-weight:700; font-size:13px; color:var(--txt); }
  .hist-badge{ font-size:11px; font-weight:700; padding:2px 9px; border-radius:99px;
    background:rgba(46,119,201,.12); color:#2E77C9; border:1px solid rgba(46,119,201,.3); }
  body.dark .hist-badge{ color:#7db6f0; background:rgba(46,119,201,.2); border-color:rgba(46,119,201,.45); }
  .hist-flow{ display:flex; align-items:center; gap:8px; margin-top:8px; flex-wrap:wrap; }
  .hist-dns{ font-family:'Cascadia Code',Consolas,monospace; font-size:12px; padding:3px 9px; border-radius:7px;
    max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .hist-old{ background:var(--bg); border:1px solid var(--linha); color:var(--mut); text-decoration:line-through; opacity:.85; }
  .hist-new{ background:rgba(46,163,106,.12); border:1px solid rgba(46,163,106,.32); color:#2ea36a; font-weight:600; }
  body.dark .hist-new{ color:#5fd39a; background:rgba(46,163,106,.16); }
  .hist-arrow{ color:var(--mut); font-weight:700; }
  .hist-rev{ margin-top:10px; display:inline-flex; align-items:center; gap:6px; font-size:12px; font-weight:600;
    padding:6px 12px; border-radius:8px; background:transparent; border:1px solid var(--linha); color:var(--mut); cursor:pointer; transition:all .13s; }
  .hist-rev svg{ width:14px; height:14px; }
  .hist-rev:hover{ border-color:#e2483d; color:#e2483d; background:rgba(226,72,61,.07); }
  .hist-vazio{ color:var(--mut); font-size:13px; text-align:center; padding:28px 0; }
  table{ width:100%; border-collapse:collapse; table-layout:auto; }
  th,td{ text-align:center; padding:9px 8px; font-size:12.5px; vertical-align:middle; word-break:break-word; }
  th{ background:#f7f9fc; color:var(--mut); font-weight:600; text-transform:uppercase; letter-spacing:.4px; font-size:11px; border-bottom:1px solid var(--linha); text-align:center;
    position:sticky; top:0; z-index:3; box-shadow:0 1px 0 var(--linha); }
  th.sortable{ cursor:pointer; user-select:none; white-space:nowrap; transition:color .12s; }
  th.sortable:hover{ color:var(--azul,#2E77C9); }
  th .sort-ind{ font-size:8px; margin-left:3px; opacity:.6; }
  th.sorted{ color:var(--azul,#2E77C9); }
  th.sorted .sort-ind{ opacity:1; }
  tbody tr{ border-bottom:1px solid #f0f2f6; transition:background .12s; }
  tbody tr:last-child{ border-bottom:none; }
  tbody tr:hover{ background:#f7fafe; }
  td .mac{ font-family:'Cascadia Code',Consolas,monospace; color:#33405a; }
  .app-tag{ display:inline-block; box-sizing:border-box; min-width:122px; text-align:center; white-space:nowrap; font-size:11px; font-weight:700; color:#fff; background:#6b7686; padding:4px 10px; border-radius:6px; letter-spacing:.2px; }
  .app-ibopro{ background:#E11D2A; }  /* IBO PRO: vermelho vivo */
  .app-ibo{ background:#6B0F1A; }     /* IBO PLAYER: grená mais escuro (separa do IBO PRO berrante) */
  .app-bob{ background:#1e63c9; }     /* BOB: azul */
  .app-cr7{ background:linear-gradient(120deg,#1F8A4C 0%,#9B2433 100%); color:#fff; }     /* CR7 Player: degradê verde -> vinho (marca nova, tom mais claro) */
  .app-quick{ background:#D97706; }   /* Quick Player: laranja (mais escuro p/ contraste do texto branco) */
  .app-vu{ background:#7C3AED; }      /* VU Player Pro: roxo (logo) */
  .app-gtv{ background:#0b0b0b; color:#FF2E2E; }  /* GTV Player: preto + letras vermelhas (logo) */
  .app-sw4{ background:linear-gradient(135deg,#8A1FB0,#E6B325,#1FC7E0); color:#fff; }  /* SW4 TV: gradiente roxo→dourado→ciano (neon do logo) */
  .app-vivo{ background:linear-gradient(90deg,#3DB54A,#8BD442); color:#fff; } /* VIVO Player: gradiente verde→lima (cor da marca; distinto do SW4 teal e do CR7 escuro) */
  .app-iptvplayer{ background:linear-gradient(135deg,#19D3C5 0%,#2E8BE0 45%,#B23CC6 100%); color:#fff; } /* IPTV PLAYER: gradiente teal→azul→roxo (logo) */
  .app-iptv4k{ background:linear-gradient(120deg,#070A12 0%,#123A86 60%,#3DE4FF 100%); color:#fff; } /* IPTV4K: quase-preto→ciano elétrico (distinto do FUNPLAY por valor) */
  .app-ott{ background:linear-gradient(120deg,#FFFFFF 0%,#F1E6FF 45%,#B6FF3C 100%); color:#6B21A8; border:1px solid rgba(107,33,168,.28); } /* OTTPLAYER: branco→lilás clarinho→verde neon, letra roxa */
  .app-vizzion{ background:linear-gradient(120deg,#1E66E6 0%,#0A2A6B 52%,#05070D 100%); color:#fff; } /* VIZZION PLAY: azul→preto */
  .app-brasil{ background:linear-gradient(120deg,#1E66E6 0%,#009C3B 52%,#E8C400 100%); color:#fff; text-shadow:0 1px 2px rgba(0,0,0,.4); } /* BRASIL IPTV: azul→verde→amarelo (bandeira) */
  .app-focox{ background:linear-gradient(120deg,#2A6FE6 0%,#5B6B82 55%,#1E293B 100%); color:#fff; text-shadow:0 1px 2px rgba(0,0,0,.4); } /* FOCOXPLAY: azul→cinza (logo) */
  .app-capplayer{ background:linear-gradient(120deg,#B01DB2 0%,#7A2A80 52%,#4E0A54 100%); color:#fff; text-shadow:0 1px 2px rgba(0,0,0,.4); } /* CAPPLAYER: magenta→roxo profundo (degradê da logo) */
  .app-duplecast{ background:linear-gradient(120deg,#0E7490 0%,#155E75 55%,#083344 100%); color:#fff; text-shadow:0 1px 2px rgba(0,0,0,.4); } /* DUPLECAST: ciano profundo */
  .app-quickpro{ background:linear-gradient(135deg,#1A2E1A 0%,#3E7D2E 50%,#9BC53D 100%); color:#fff; } /* QUICKPRO: gradiente verde-escuro→verde→lima (3 cores da marca: fundo verde escuro + lima do "Pro" + texto branco) */
  .app-funplay{ background:linear-gradient(135deg,#0A2A6B 0%,#1E6BE6 50%,#22D3EE 100%); color:#fff; } /* FUNPLAY: gradiente azul-marinho→azul royal→ciano (3 cores da marca) */
  .app-ph{ display:inline-flex; align-items:center; justify-content:center; gap:7px; box-sizing:border-box; min-width:122px;
    font-size:12px; font-weight:600; letter-spacing:.2px; color:var(--azul,#2E77C9);
    background:color-mix(in srgb,var(--azul,#2E77C9) 9%,transparent);
    border:1px dashed color-mix(in srgb,var(--azul,#2E77C9) 40%,transparent);
    padding:4px 12px; border-radius:7px; }
  .app-ph::before{ content:''; width:7px; height:7px; border-radius:50%; flex:0 0 auto;
    background:var(--azul,#2E77C9); box-shadow:0 0 0 3px color-mix(in srgb,var(--azul,#2E77C9) 22%,transparent); }
  .status{ display:inline-block; font-size:11px; font-weight:600; padding:3px 9px; border-radius:6px; }
  .status.active{ color:#137333; background:#e6f4ea; }
  .status.trial{ color:#c2410c; background:#ffe4cc; }
  .status.off{ color:#8a94a6; background:#eef1f5; }
  .status.lim{ color:#8a5a00; background:#fde7c7; }
  .status.expired{ color:#d32f2f; background:#fdecec; }
  body.dark .status.expired{ color:#ff7a7a; background:#3a1a1a; }
  /* toolbar */
  .toolbar{ display:flex; align-items:center; gap:9px; margin-bottom:16px; flex-wrap:wrap; }
  .toolbar input#busca, .toolbar select, .toolbar button{ height:40px; box-sizing:border-box; }  /* alturas uniformes dos controles (respiro/alinhamento) */
  .toolbar input#busca{ flex:1; min-width:180px; padding:9px 12px; border:1px solid var(--linha); border-radius:9px; font-size:13px; background:#fff; outline:none; }
  .toolbar input#busca:focus{ border-color:var(--brand); box-shadow:0 0 0 3px #3a8fe022; }
  .toolbar select{ padding:9px 10px; border:1px solid var(--linha); border-radius:9px; font-size:13px; background:#fff; }
  .toolbar .tbtn{ background:#fff; border:1px solid var(--linha); color:#33405a; padding:9px 12px; border-radius:9px; cursor:pointer; font-size:13px; font-weight:500; }
  .toolbar .tbtn:hover{ background:#f2f5f9; border-color:#cfd6e0; }
  #btnMassa{ background:#2E77C9 !important; color:#fff !important; border:none !important; font-weight:600; }
  #btnMassa:hover{ background:#2668b0 !important; color:#fff !important; }
  #btnNovo.tbtn{ background:#eaf2fb; border-color:#cfe0f3; color:#1e5aa8; font-weight:600; }
  body.dark #btnNovo.tbtn{ background:#16324f; border-color:#245089; color:#8fc0ff; }
  /* títulos dos modais na cor do botão que os abre (+ Aparelho=azul, + Lista=verde) */
  #devTitulo{ color:#1e5aa8; }
  body.dark #devTitulo{ color:#8fc0ff; }
  #alTitulo{ color:#157a46; }
  body.dark #alTitulo{ color:#7fe0a6; }
  #btnAddLista.tbtn{ background:#eafaf1; border-color:#bfe8cf; color:#157a46; font-weight:600; }
  #btnAddLista.tbtn:hover{ background:#dcf4e6; border-color:#a5ddb9; }
  body.dark #btnAddLista.tbtn{ background:#123a2a; border-color:#1f6b45; color:#7fe0a6; }
  /* ===== card Adicionar/Substituir lista ===== */
  #ovAddLista .modal{ max-width:480px; }
  #ovAddLista select, #ovAddLista input{ width:100%; box-sizing:border-box; }
  .al-dev-ctx{ display:flex; flex-direction:column; background:#f7fafd; border:1px solid #e3ebf4; border-radius:13px; margin:0 0 16px; overflow:hidden; box-shadow:0 1px 2px rgba(22,50,79,.04); }
  .al-dev-ctx-top{ display:flex; align-items:center; flex-wrap:wrap; gap:12px; padding:14px 16px 13px; }
  #alDevCtxApp{ font-size:12px; }
  .al-dev-ctx-mac{ font-size:17px; font-weight:800; color:#15324e; font-family:ui-monospace,Menlo,Consolas,monospace; letter-spacing:.04em; }
  .al-dev-ctx-lock{ font-size:11px; font-weight:600; color:#6b7a8d; display:flex; align-items:center; gap:6px; padding:8px 16px; background:#eef3f9; border-top:1px solid #e6edf5; letter-spacing:.01em; }
  .al-dev-ctx-lock::before{ content:'🔒'; font-size:12px; line-height:1; }
  body.dark .al-dev-ctx{ background:#121d2b; border-color:#223349; box-shadow:none; }
  body.dark .al-dev-ctx-mac{ color:#eaf2fb; }
  body.dark .al-dev-ctx-lock{ background:#0f1824; color:#8aa0b8; border-top-color:#223349; }
  #ovAddLista .al-acoes{ display:flex; align-items:stretch; justify-content:center; gap:10px; flex-wrap:wrap; margin-top:6px; }
  #ovAddLista .al-acoes button{ height:44px; padding:0 18px; border:none; border-radius:10px; font-size:13.5px; font-weight:700; cursor:pointer; display:inline-flex; align-items:center; justify-content:center; gap:7px; line-height:1; transition:filter .15s, background .15s, box-shadow .15s; }
  #ovAddLista #alAdicionar{ min-width:168px; box-shadow:0 2px 6px #2e7dd133; }
  #ovAddLista #alAdicionar:hover{ filter:brightness(1.06); }
  #ovAddLista #alSubstBox{ align-items:stretch; gap:8px; }
  #ovAddLista #alSubstBox[style*="flex"]{ display:flex; }
  #ovAddLista #alSubstSel{ width:auto; min-width:150px; max-width:210px; height:44px; box-sizing:border-box; padding:0 36px 0 13px; border:1px solid var(--linha); border-radius:10px; font-size:13.5px; font-weight:600; color:#33405a; background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 13px center; -webkit-appearance:none; -moz-appearance:none; appearance:none; cursor:pointer; outline:none; transition:border-color .15s, box-shadow .15s; }
  #ovAddLista #alSubstSel:focus{ border-color:var(--brand); box-shadow:0 0 0 3px #3a8fe022; }
  #ovAddLista #alSubstituir{ min-width:140px; background:#eceff4; color:#33405a; }
  #ovAddLista #alSubstituir:hover{ background:#e2e6ee; }
  body.dark #ovAddLista #alSubstSel{ background-color:#111825; color:#e6ebf2; border-color:#28323f; }
  body.dark #ovAddLista #alSubstituir{ background:#243040; color:#dfe6ef; }
  body.dark #ovAddLista #alSubstituir:hover{ background:#2b3a4e; }
  @media(max-width:480px){
    #ovAddLista .al-acoes{ flex-direction:column; align-items:stretch; }
    #ovAddLista #alAdicionar{ width:100%; min-width:0; }
    #ovAddLista #alSubstBox{ width:100%; flex-wrap:nowrap; }
    #ovAddLista #alSubstSel{ flex:1 1 auto; max-width:none; min-width:0; }
    #ovAddLista #alSubstituir{ flex:0 0 auto; }
  }
  .al-lista{ display:flex; align-items:flex-start; gap:10px; border:1px solid var(--linha); border-left:3px solid #2E77C9; border-radius:11px; padding:11px 13px; margin-bottom:8px; background:#fafbfc; }
  body.dark .al-lista{ background:#141b24; border-color:#2a3542; border-left-color:#3a8fe0; }
  .al-lista .al-ic{ font-size:16px; line-height:1.3; flex:0 0 auto; }
  .al-lista .al-info{ flex:1 1 auto; min-width:0; }
  .al-lista .al-nome{ font-weight:700; font-size:13.5px; display:flex; align-items:center; gap:7px; flex-wrap:wrap; }
  .al-lista .al-url{ font-size:11.5px; color:#78859a; margin-top:4px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .al-badge{ font-size:10.5px; font-weight:700; padding:2px 8px; border-radius:999px; letter-spacing:.3px; white-space:nowrap; }
  .al-badge.prot{ background:#e7f3ff; color:#1565c0; }
  .al-badge.div{ background:#fff3e0; color:#c25e00; }
  body.dark .al-badge.prot{ background:#15335a; color:#7db6ff; }
  body.dark .al-badge.div{ background:#4a3410; color:#ffbf73; }
  /* ações por lista (renomear / excluir) */
  .al-lista .al-acoes{ flex:0 0 auto; display:flex; gap:6px; align-items:flex-start; }
  .al-mini{ cursor:pointer; border:1px solid var(--linha); background:#fff; border-radius:8px; padding:4px 7px; font-size:12.5px; line-height:1; color:#5b6472; transition:background .12s,border-color .12s; }
  .al-mini:hover{ background:#f0f4f8; }
  .al-mini.al-del:hover{ background:#fdecea; border-color:#f3b4ad; color:#c0392b; }
  body.dark .al-mini{ background:#1a222c; border-color:#2a3542; color:#9fb0c4; }
  body.dark .al-mini:hover{ background:#223040; }
  body.dark .al-mini.al-del:hover{ background:#3a1b18; border-color:#7a2f27; color:#ff8f82; }
  .al-ren-row{ display:flex; gap:6px; align-items:center; margin-top:2px; width:100%; }
  .al-ren-inp{ flex:1 1 auto; min-width:0; font-size:13px; padding:5px 8px; border:1px solid #2E77C9; border-radius:8px; background:#fff; color:inherit; }
  body.dark .al-ren-inp{ background:#0f1620; border-color:#3a8fe0; }
  /* aviso vira card de alerta (fundo suave + borda + ícone), centralizado e simétrico */
  #alMsg:empty{ display:none; }
  #alMsg.ok, #alMsg.err, #alMsg.info{ display:flex; align-items:flex-start; justify-content:center; gap:8px; max-width:440px; margin-left:auto; margin-right:auto; padding:11px 14px; border-radius:12px; font-weight:600; line-height:1.45; border:1px solid transparent; text-align:left; }
  #alMsg.ok::before, #alMsg.err::before, #alMsg.info::before{ flex:0 0 auto; font-weight:900; font-size:14px; line-height:1.4; }
  #alMsg.ok{ color:#0f6b3d; background:#e9f8f0; border-color:#bfe8d1; } #alMsg.ok::before{ content:'✓'; }
  #alMsg.err{ color:#c0392b; background:#fdecea; border-color:#f3c3bd; } #alMsg.err::before{ content:'!'; display:inline-flex; align-items:center; justify-content:center; width:18px; height:18px; border-radius:50%; background:#c0392b; color:#fff; font-size:12px; }
  #alMsg.info{ color:#2b5f96; background:#eaf2fc; border-color:#cfe0f7; } #alMsg.info::before{ content:'i'; display:inline-flex; align-items:center; justify-content:center; width:18px; height:18px; border-radius:50%; background:#2b5f96; color:#fff; font-size:12px; font-style:italic; }
  body.dark #alMsg.ok{ background:#0e2a1c; border-color:#1c5236; color:#7fe0ab; } body.dark #alMsg.err{ background:#2c1413; border-color:#5a2521; color:#f2a79f; } body.dark #alMsg.info{ background:#10212f; border-color:#244763; color:#9ecbf2; }
  /* botão "Detectar app automaticamente" — sólido, centralizado, com hover */
  #alDetectar{ margin:12px auto 0 !important; display:flex; align-items:center; justify-content:center; gap:8px; font-weight:700; font-size:13px; padding:10px 18px; border-radius:12px; background:#2E77C9 !important; color:#fff !important; border:none !important; cursor:pointer; box-shadow:0 2px 8px rgba(46,119,201,.28); transition:background .15s, transform .05s, box-shadow .15s; }
  #alDetectar:hover{ background:#2662a8 !important; box-shadow:0 4px 12px rgba(46,119,201,.35); }
  #alDetectar:active{ transform:translateY(1px); }
  /* menu "Mais" */
  .mais-wrap{ position:relative; }
  .mais-menu{ position:absolute; right:0; top:calc(100% + 8px); background:var(--card); border:1px solid var(--linha);
    border-radius:14px; box-shadow:0 18px 48px #00000026; padding:8px; display:none; flex-direction:column; min-width:224px; z-index:30; }
  @keyframes maisIn{ from{ opacity:0; transform:translateY(-8px) scale(.98); } to{ opacity:1; transform:none; } }
  .mais-menu.on{ display:flex; animation:maisIn .15s cubic-bezier(.2,.8,.2,1); transform-origin:top right; }
  .mais-menu button{ background:transparent; border:none; text-align:left; padding:11px 12px; border-radius:10px;
    cursor:pointer; font-size:13.5px; font-weight:500; color:var(--ink); width:100%; display:flex; align-items:center; gap:12px;
    transition:background .12s ease, color .12s ease; }
  .mais-menu button svg{ width:18px; height:18px; color:#2E77C9; flex-shrink:0; transition:transform .12s ease; }
  .mais-menu button:hover{ background:#eef4fb; }
  .mais-menu button:hover svg{ transform:scale(1.12); }
  .mais-menu .sep{ height:1px; background:var(--linha); margin:6px 10px; }
  body.dark .mais-menu button{ color:#e7edf5; } body.dark .mais-menu button:hover{ background:#1b2531; }
  body.dark .mais-menu button svg{ color:#5FB0FF; }
  /* toasts + confirmação modernos */
  .toastwrap{ position:fixed; top:62px; right:18px; z-index:80; display:flex; flex-direction:column; gap:8px; }
  .toast{ min-width:240px; max-width:380px; padding:12px 14px; border-radius:11px; color:#fff; font-size:13px;
    box-shadow:0 10px 30px #0005; display:flex; gap:10px; align-items:flex-start; animation:tin .18s ease; }
  @keyframes tin{ from{opacity:0; transform:translateY(-8px)} to{opacity:1;transform:none} }
  .toast.info{ background:#2E77C9 } .toast.success{ background:#158043 } .toast.error{ background:#c02236 }
  .toast .tx{ white-space:pre-line; line-height:1.35 }
  .cmodal{ background:#fff; border-radius:16px; width:min(470px,92vw); padding:24px; box-shadow:0 24px 70px #000a; }
  .cmodal h3{ margin:0 0 10px; font-size:18px; color:var(--ink); }
  .cmodal p{ margin:0 0 18px; font-size:14px; color:#33405a; white-space:pre-line; line-height:1.45; }
  .pill{ display:inline-block; padding:4px 11px; border-radius:999px; font-size:12px; font-weight:600; }
  .acoes{ text-align:right; white-space:nowrap; }
  /* todos os controles da linha têm a MESMA caixa (30x30) e o MESMO gap — simetria */
  .acoes-wrap{ display:inline-flex; align-items:center; justify-content:flex-end; gap:6px; }
  .acoes .act, .acoes .lockst{ width:30px; height:30px; box-sizing:border-box; display:inline-flex; align-items:center; justify-content:center; padding:0; border-radius:8px; }
  .acoes .act{ border:none; background:transparent; cursor:pointer; color:#6b7686; opacity:.5; transition:opacity .12s, background .12s, color .12s; }
  tbody tr:hover .acoes .act{ opacity:1; }                     /* ações ganham destaque no hover da linha */
  .acoes .act:hover{ opacity:1; background:#eef1f6; color:#2E77C9; }
  body.dark .acoes .act:hover{ background:#1b2531; }
  .acoes .act svg, .acoes .lockst svg{ width:17px; height:17px; display:block; }
  .acoes .act-verif{ color:#2E77C9; opacity:.8; }              /* Verificar (lupa) = AZUL (ação de leitura/consulta) */
  .acoes .act-verif:hover{ background:#e8f1fc; color:#1f63ad; }
  body.dark .acoes .act-verif:hover{ background:#122034; }
  .acoes .act-sep{ flex:0 0 auto; align-self:center; width:1px; height:16px; background:#e4e8ef; margin:0 3px; }
  body.dark .acoes .act-sep{ background:#2a3647; }
  #mNovaSrv:disabled{ background:#eef2f7; -webkit-text-fill-color:#445060; color:#445060; opacity:1; cursor:default; border-color:#e2e8f0; }
  body.dark #mNovaSrv:disabled{ background:#141c27; -webkit-text-fill-color:#aab4c0; color:#aab4c0; border-color:#273243; }
  /* Card "atual" do modal Trocar DNS do aparelho — servidor/DNS em destaque */
  .swap-atual{ display:flex; gap:10px; margin-top:10px; }
  .swap-atual-cel{ flex:1; min-width:0; background:#f1f6fc; border:1px solid #d7e3f3; border-left:3px solid #2E77C9; border-radius:9px; padding:8px 11px; display:flex; flex-direction:column; gap:3px; }
  .swap-atual-rot{ font-size:10.5px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:#6b7a8d; }
  .swap-atual-srv{ font-size:15px; font-weight:800; color:#1f63ad; line-height:1.15; word-break:break-word; }
  .swap-atual-dns{ font-size:13.5px; font-weight:700; color:#16324f; font-family:ui-monospace,Menlo,Consolas,monospace; line-height:1.15; word-break:break-all; }
  body.dark .swap-atual-cel{ background:#132032; border-color:#24364e; border-left-color:#4b8fd6; }
  body.dark .swap-atual-rot{ color:#8aa0b8; }
  body.dark .swap-atual-srv{ color:#7fb4ec; }
  body.dark .swap-atual-dns{ color:#d7e6f7; }
  @media(max-width:460px){ .swap-atual{ flex-direction:column; gap:7px; } }
  /* Listas no aparelho (modal Editar device) */
  .dev-listas{ display:flex; flex-direction:column; gap:7px; }
  .dev-listas:not(:empty){ margin-bottom:8px; }
  .dev-lista{ background:#f7f9fc; border:1px solid #e2e8f0; border-left:3px solid #2E77C9; border-radius:9px; padding:8px 11px; display:flex; flex-direction:column; gap:4px; }
  .dev-lista-top{ display:flex; align-items:flex-start; justify-content:space-between; gap:8px; }
  .dev-lista-acoes{ display:flex; gap:6px; flex-shrink:0; }
  .dev-lista-btn{ display:inline-flex; align-items:center; justify-content:center; gap:4px; height:30px; padding:0 12px; border:1px solid transparent; border-radius:8px; font-size:11.5px; font-weight:700; cursor:pointer; line-height:1; background:transparent; transition:background .12s,color .12s,border-color .12s,box-shadow .12s; }
  .dev-lista-btn.troca{ color:#1f63ad; border-color:#cfe0f3; background:#eef5fd; }
  .dev-lista-btn.troca:hover{ background:#2E77C9; border-color:#2E77C9; color:#fff; box-shadow:0 2px 8px rgba(46,119,201,.25); }
  .dev-lista-btn.del{ color:#c0362c; border-color:#f1d2cf; background:#fdeeec; width:30px; padding:0; font-size:14px; }
  .dev-lista-btn.del:hover{ background:#dc2626; border-color:#dc2626; color:#fff; box-shadow:0 2px 8px rgba(220,38,38,.25); }
  .dev-lista-nome{ font-size:13px; font-weight:800; color:#16324f; word-break:break-word; line-height:1.25; }
  .dev-lista-dns{ font-size:12px; font-weight:600; color:#4a5a6b; font-family:ui-monospace,Menlo,Consolas,monospace; word-break:break-all; line-height:1.2; }
  .dev-lista-tags{ display:flex; gap:6px; align-items:center; flex-wrap:wrap; margin-top:1px; }
  .dev-lista-tag{ font-size:10.5px; font-weight:700; padding:1px 8px; border-radius:999px; white-space:nowrap; }
  .dev-lista-tag.prot{ background:#e7f6ec; color:#1b7a3d; }
  .dev-lista-tag.des{ background:#fdeaea; color:#c0362c; }
  .dev-lista-tag.pindif{ background:#fff3dc; color:#9a6a00; }
  .dev-lista-btn.del.bloq{ color:#9a6a00; border-color:#f0dca8; background:#fff6e4; cursor:help; }
  .dev-lista-btn.del.bloq:hover{ background:#f3d892; border-color:#e6c76a; color:#6b4a00; box-shadow:none; }
  body.dark .dev-lista-tag.pindif{ background:#3a2e12; color:#e3b55a; }
  body.dark .dev-lista-btn.del.bloq{ color:#e3b55a; border-color:#4a3a18; background:#2a2010; }
  body.dark .dev-lista-btn.del.bloq:hover{ background:#4a3a18; border-color:#5a4720; color:#f0cd78; }
  .dev-listas-msg{ font-size:12px; color:#6b7a8d; padding:3px 2px; line-height:1.4; }
  /* rodapé de ações das listas — pílulas centralizadas (Atualizar + Adicionar) */
  .dev-listas-foot{ display:flex; gap:10px; justify-content:center; flex-wrap:wrap; }
  .dev-listas-load, .dev-listas-add{ padding:9px 18px; border-radius:999px; border:1px solid transparent; font-size:12.5px; font-weight:700; cursor:pointer; transition:background .14s,color .14s,border-color .14s,box-shadow .14s; }
  .dev-listas-load{ border-color:#cfe0f3; background:#eef5fd; color:#1f63ad; }
  .dev-listas-load:hover:not(:disabled){ background:#2E77C9; border-color:#2E77C9; color:#fff; box-shadow:0 2px 10px rgba(46,119,201,.28); }
  .dev-listas-load:disabled{ opacity:.65; cursor:default; }
  .dev-listas-add{ border-color:#c3e8cf; background:#e9f7ee; color:#15803d; }
  .dev-listas-add:hover{ background:#15924f; border-color:#15924f; color:#fff; box-shadow:0 2px 10px rgba(21,146,79,.28); }
  body.dark .dev-listas-load{ background:#122034; border-color:#28436a; color:#7fb4ec; }
  body.dark .dev-listas-load:hover:not(:disabled){ background:#2E77C9; border-color:#2E77C9; color:#fff; box-shadow:none; }
  body.dark .dev-listas-add{ background:#102a1a; border-color:#1f5236; color:#5fcf84; }
  body.dark .dev-listas-add:hover{ background:#15924f; border-color:#15924f; color:#fff; box-shadow:none; }
  body.dark .dev-lista-btn.troca{ color:#7fb4ec; border-color:#28436a; background:#122034; }
  body.dark .dev-lista-btn.troca:hover{ background:#2E77C9; border-color:#2E77C9; color:#fff; }
  body.dark .dev-lista-btn.del{ color:#e78a82; border-color:#4a2522; background:#2a1513; }
  body.dark .dev-lista-btn.del:hover{ background:#dc2626; border-color:#dc2626; color:#fff; }
  body.dark .dev-lista{ background:#131c28; border-color:#24364e; border-left-color:#4b8fd6; }
  body.dark .dev-lista-nome{ color:#dce7f3; }
  body.dark .dev-lista-dns{ color:#9db0c4; }
  body.dark .dev-lista-tag.prot{ background:#13331f; color:#5fcf84; }
  body.dark .dev-lista-tag.des{ background:#331616; color:#e78a82; }
  body.dark .dev-listas-msg{ color:#8aa0b8; }
  .acoes .act-add{ color:#15924f; opacity:.8; }                /* + = enviar lista (VERDE = adicionar; distinto da lupa azul) */
  .acoes .act-add:hover{ background:#e7f6ec; color:#0f7d41; }
  body.dark .acoes .act-add:hover{ background:#10231a; }
  .acoes .act-swap{ color:#9b6ff0; opacity:.78; }              /* ⇄ = trocar DNS só deste aparelho (lilás) */
  .acoes .act-swap:hover{ background:#f0eaff; color:#7c4de0; }
  body.dark .acoes .act-swap:hover{ background:#221a33; }
  .acoes .act-transfer{ color:#0e9f8e; opacity:.78; }          /* ⇆ = transferir cliente final (verde-água, só colaborador) */
  .acoes .act-transfer:hover{ background:#e6f7f4; color:#0b7d70; }
  body.dark .acoes .act-transfer:hover{ background:#10231f; }
  .acoes .act[data-edit]{ color:#d97706; opacity:.78; }               /* editar = ÂMBAR (cor fixa) */
  .acoes .act[data-edit]:hover{ color:#b45309; background:#fff6e5; }
  body.dark .acoes .act[data-edit]:hover{ color:#f0b04a; background:#2a2310; }
  .acoes .act-del{ color:#dc2626; opacity:.76; }                      /* excluir = VERMELHO (cor fixa) */
  .acoes .act-del:hover{ color:#b91c1c; background:#fdecec; }
  body.dark .acoes .act-del:hover{ background:#2a1718; }
  .acoes .lockst{ opacity:1; cursor:default; }                 /* status só leitura */
  tbody tr:hover .acoes .lockst{ opacity:1; }
  .acoes .lock-on{ color:#16a34a; }                  /* protegida (verde) */
  .acoes .lock-warn{ color:#e2483d; }                /* deveria estar protegida e não está */
  .acoes .lock-na{ color:#c3cad4; }                  /* app sem cadeado ainda (neutro) */
  body.dark .acoes .lock-na{ color:#3a4656; }
  .acoes .lock-diverge{ color:#e2483d; animation:lockDivPulse 1.6s ease-in-out infinite; } /* PIN divergente (alerta) */
  @keyframes lockDivPulse{ 0%,100%{ opacity:1; } 50%{ opacity:.45; } }
  /* cadeado como INDICADOR de status (na coluna Status, não é botão) */
  .lockst{ display:inline-flex; align-items:center; vertical-align:middle; margin-left:7px; }
  .lockst svg{ width:15px; height:15px; display:block; }
  .lock-on{ color:#16a34a; }                          /* protegida com o SEU PIN (verde) */
  .lock-warn{ color:#e2483d; }                        /* sem proteção (deveria ter) */
  .lock-na{ color:#c3cad4; }                          /* app sem cadeado ainda (neutro) */
  body.dark .lock-na{ color:#3a4656; }
  .lock-diverge{ color:#e2483d; animation:lockDivPulse 1.6s ease-in-out infinite; }  /* PIN diferente (alerta) */
  .vazio{ text-align:center; color:var(--mut); padding:48px 20px; }
  /* estado vazio com CTA (cliente novo) — guia e centraliza */
  .vazio-cta{ display:flex; flex-direction:column; align-items:center; justify-content:center; gap:12px; padding:56px 24px; min-height:320px; }
  /* item 4: centraliza o estado vazio no espaço disponível do main (sem vão solto embaixo) */
  main:has(.vazio-cta){ display:flex; flex-direction:column; justify-content:center; }
  .vazio-cta .vz-ic{ flex:0 0 auto; }
  .vazio-cta .vz-ic svg{ flex:0 0 auto; max-width:34px; max-height:34px; }
  .vazio-cta .vz-ic{ width:66px; height:66px; border-radius:18px; display:flex; align-items:center; justify-content:center; background:#eaf2fb; color:#2E77C9; }
  body.dark .vazio-cta .vz-ic{ background:#16324f; color:#8fc0ff; }
  .vazio-cta .vz-ic svg{ width:33px; height:33px; }
  .vazio-cta .vz-tit{ font-size:17px; font-weight:800; color:var(--ink,var(--txt)); }
  .vazio-cta .vz-sub{ font-size:13px; color:var(--mut); max-width:320px; line-height:1.5; }
  .vazio-cta .vz-btn{ margin-top:6px; display:inline-flex; align-items:center; gap:8px; background:#2E77C9; color:#fff; border:none; border-radius:12px; padding:14px 22px; font-size:15px; font-weight:700; cursor:pointer; box-shadow:0 4px 14px rgba(46,119,201,.4); transition:.15s; }
  .vazio-cta .vz-btn:hover{ background:#2668b0; transform:translateY(-1px); }
  .vazio-cta .vz-btn svg{ width:18px; height:18px; }
  /* contexto sem devices: +Aparelho vira primário azul; "Trocar DNS em massa" fica apagado (não funciona sem device) */
  body.sem-devices #btnMassa.tbtn-massa{ background:#eef2f7 !important; color:#5b6472 !important; border:1px solid var(--linha,#e2e8f0) !important; box-shadow:none !important; }
  body.sem-devices #btnMassa.tbtn-massa:hover{ background:#e3e9f1 !important; color:#5b6472 !important; }
  body.dark.sem-devices #btnMassa.tbtn-massa{ background:#1a2332 !important; color:#93a1b5 !important; border-color:#2a3444 !important; }
  /* com servidor, mas sem device → "+ Aparelho" é o primário */
  body.sem-devices:not(.sem-servidores) #btnNovo.tbtn{ background:#2E77C9 !important; color:#fff !important; border:none !important; font-weight:700; box-shadow:0 3px 10px rgba(46,119,201,.35); }
  body.sem-devices:not(.sem-servidores) #btnNovo.tbtn:hover{ background:#2668b0 !important; }
  /* sem servidor → "Servidores" é o 1º passo (primário azul) */
  body.sem-servidores #btnServidores.tbtn-serv{ background:#2E77C9 !important; color:#fff !important; border:none !important; box-shadow:0 3px 10px rgba(46,119,201,.35); }
  body.sem-servidores #btnServidores.tbtn-serv svg{ color:#fff; }
  body.sem-servidores #btnServidores.tbtn-serv:hover{ background:#2668b0 !important; color:#fff !important; }

  .rodape{ flex-shrink:0; padding:14px 18px 18px; background:var(--bg); border-top:1px solid var(--linha); }
  .btn-massa{ width:100%; padding:16px; border:none; border-radius:12px; color:#fff; font-size:15px; font-weight:700; letter-spacing:.3px;
    cursor:pointer; background:linear-gradient(180deg,var(--brand),var(--brand2)); box-shadow:0 8px 20px #2e77c94d; transition:.15s; }
  .btn-massa:hover{ filter:brightness(1.06); transform:translateY(-1px); }

  /* modal */
  .overlay{ position:fixed; inset:0; background:#0b112088; backdrop-filter:blur(2px); display:none; align-items:center; justify-content:center; z-index:20; overscroll-behavior:contain; -webkit-overflow-scrolling:touch; }
  .overlay.on{ display:flex; animation:ovFade .16s ease; }
  .overlay.on .modal{ animation:modalIn .22s cubic-bezier(.2,.8,.2,1); }
  @keyframes ovFade{ from{ opacity:0; } to{ opacity:1; } }
  @keyframes modalIn{ from{ opacity:0; transform:translateY(10px) scale(.97); } to{ opacity:1; transform:none; } }
  @media (prefers-reduced-motion:reduce){ .overlay.on, .overlay.on .modal{ animation:none; } }
  body.modal-open, html.modal-open{ overflow:hidden; }
  .modal{ background:var(--card); border-radius:16px; width:min(680px,92vw); max-height:88vh; overflow:auto; padding:22px; box-shadow:0 20px 60px #0009; overscroll-behavior:contain; transform-origin:center; }
  .modal h2{ margin:0 0 14px; font-size:18px; color:var(--ink); }
  /* X de fechar fixo no topo do modal (fica grudado mesmo rolando) */
  .ov-x{ position:sticky; top:0; z-index:12; display:flex; align-items:center; justify-content:center;
    width:34px; height:34px; margin:-4px 0 -30px auto; border:none; border-radius:9px; cursor:pointer;
    background:var(--card2,#eef1f6); color:var(--mut,#6b7686); font-size:20px; line-height:1; transition:background .13s, color .13s; -webkit-app-region:no-drag; }
  .ov-x:hover{ background:#e2483d; color:#fff; }
  body.dark .ov-x{ background:#1b2531; color:#9aa6b6; }
  body.dark .ov-x:hover{ background:#e2483d; color:#fff; }
  .campo{ display:block; margin:10px 0; }
  .campo label{ display:block; font-size:10.5px; color:var(--mut); margin-bottom:6px; font-weight:800; letter-spacing:.06em; text-transform:uppercase; }
  .campo label span[style*="9aa4b2"]{ text-transform:none; letter-spacing:0; font-weight:600; font-size:11px; opacity:.9; }
  .campo label span[style*="e2483d"]{ font-size:13px; }
  .campo input,.campo select{ width:100%; padding:11px; border:1px solid var(--linha); border-radius:9px; font-size:14px; background:#fff; outline:none; transition:.15s; }
  .campo input:focus,.campo select:focus{ border-color:var(--brand); box-shadow:0 0 0 3px #3a8fe022; }
  /* ===== Testar DNS — lista de servidores ===== */
  #srvListaHead{ display:none; align-items:center; justify-content:space-between; gap:10px; margin-top:14px; margin-bottom:2px; }
  #srvListaHead .lbl{ font-size:11px; font-weight:800; letter-spacing:.7px; text-transform:uppercase; color:#9aa7bd; }
  #srvTestarTodas{ display:inline-flex; align-items:center; gap:6px; white-space:nowrap; font-size:12.5px; font-weight:700;
    color:#2E77C9; background:#eef5fd; border:1px solid #d3e4f7; border-radius:10px; padding:7px 12px; cursor:pointer; transition:.12s; }
  #srvTestarTodas:hover{ background:#e2eefb; }
  #srvTestarTodas:disabled{ opacity:.6; cursor:progress; }
  body.dark #srvTestarTodas{ color:#8fc0f5; background:#16263c; border-color:#24405f; }
  #sTestarDns{ display:inline-flex; align-items:center; gap:6px; white-space:nowrap; font-size:13px; font-weight:700;
    color:#2E77C9; background:#eef5fd; border:1px solid #d3e4f7; border-radius:10px; padding:0 16px; cursor:pointer; transition:.12s; }
  #sTestarDns svg{ width:12px; height:12px; }
  #sTestarDns:hover{ background:#e2eefb; }
  body.dark #sTestarDns{ color:#8fc0f5; background:#16263c; border-color:#24405f; }
  .linkbtn{ display:inline-flex; align-items:center; gap:4px; margin-top:10px; background:none; border:none; color:#2E77C9; font-size:12.5px; font-weight:700; cursor:pointer; padding:3px 0; }
  .linkbtn:hover{ text-decoration:underline; }
  #srvLista{ max-height:216px; overflow:auto; margin-top:6px; }

  /* cada servidor é um CARD (antes eram linhas achatadas com borda embaixo): separação clara, bolinha + nome
     em destaque, DNS monospace. Mesmo visual em light e dark. */
  #srvLista{ display:flex; flex-direction:column; gap:9px; margin-top:2px; }
  .srv-row{ display:flex; align-items:flex-start; gap:10px; padding:13px 14px; background:#f7f9fc; border:1px solid #e8edf4; border-radius:12px; }
  body.dark .srv-row{ background:#121a26; border-color:#232e3d; }
  .srv-info{ min-width:0; flex:1; }
  .srv-name{ font-weight:800; font-size:14px; color:var(--ink); display:flex; align-items:center; gap:7px; }
  .srv-name::before{ content:""; width:7px; height:7px; border-radius:50%; background:#2E77C9; flex:none; box-shadow:0 0 0 3px rgba(46,119,201,.15); }
  .srv-dns{ font-size:12px; color:#7c8798; word-break:break-all; margin-top:7px; font-family:ui-monospace,"SF Mono",Menlo,Consolas,monospace; }
  body.dark .srv-dns{ color:#9aa7bb; }
  .srv-alt{ font-size:11.5px; color:#9aa4b4; word-break:break-all; }
  .srv-line{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-top:7px; }
  .srv-line .srv-dns, .srv-line .srv-alt{ min-width:0; margin-top:0; }
  .srv-line .srv-saude{ padding:3px 9px; font-size:10.5px; }
  .srv-actions{ display:inline-flex; align-items:center; gap:2px; flex:0 0 auto; }
  .srv-ico{ display:inline-grid; place-items:center; width:30px; height:30px; border:none; background:transparent;
    color:#9aa7bd; border-radius:8px; cursor:pointer; transition:.12s; }
  .srv-ico svg{ width:16px; height:16px; }
  .srv-ico:hover{ background:#f0f3f8; color:#5b6b85; }
  .srv-ico.del:hover{ background:#fdecec; color:#C01E24; }
  body.dark .srv-ico:hover{ background:#1b2531; color:#cfe0ff; }

  /* selo de saúde (clicável) */
  .srv-saude{ display:inline-flex; align-items:center; gap:5px; white-space:nowrap; font-size:11.5px; font-weight:800;
    letter-spacing:.2px; border:1px solid; border-radius:999px; padding:5px 11px; cursor:pointer; flex:0 0 auto;
    transition:filter .12s, transform .05s; user-select:none; }
  .srv-saude svg{ width:11px; height:11px; }
  .srv-saude:hover{ filter:brightness(.97); }
  .srv-saude:active{ transform:scale(.97); }
  .srv-saude.checando{ opacity:.65; cursor:progress; }
  .srv-saude.idle{ color:#2E77C9; background:#eef5fd; border-color:#d3e4f7; }
  body.dark .srv-saude.idle{ color:#8fc0f5; background:#16263c; border-color:#24405f; }
  .dnslist{ border:1px solid var(--linha); border-radius:10px; max-height:220px; overflow:auto; margin:8px 0; }
  .dnslist label{ display:flex; align-items:center; gap:8px; padding:11px 12px; border-bottom:1px solid var(--linha); cursor:pointer; font-size:13px; }
  .dnslist label:last-child{ border-bottom:none; }
  .dnslist label:hover{ background:#f7fafe; }
  .dnslist .qtd{ margin-left:auto; color:var(--mut); font-size:12px; }
  .modal-acoes{ display:flex; gap:8px; justify-content:flex-end; margin-top:16px; }
  .modal-acoes button{ padding:11px 16px; border-radius:9px; border:none; cursor:pointer; font-size:14px; font-weight:600; }
  /* seletor "atualizar por app" */
  .atual-app-op{ display:flex; align-items:center; justify-content:space-between; gap:10px; width:100%; padding:11px 13px; border:1px solid var(--linha); border-radius:11px; background:var(--card); cursor:pointer; font-family:inherit; transition:border-color .12s, background .12s; }
  .atual-app-op:hover{ border-color:var(--brand,#2E7DD1); background:#f5f9fe; }
  body.dark .atual-app-op:hover{ background:#10203a; }
  .atual-app-n{ font-size:12px; font-weight:700; color:var(--mut); white-space:nowrap; }
  .btn-primario{ background:linear-gradient(180deg,var(--brand),var(--brand2)); color:#fff; }
  .btn-primario:hover{ filter:brightness(1.06); }
  .btn-sec{ background:#eceff4; color:#33405a; }
  .btn-sec:hover{ background:#e2e6ee; }
  .log{ border:1px solid var(--linha); border-radius:10px; background:#fafbfd; max-height:300px; overflow:auto; margin-top:10px; }
  .log .item{ display:flex; gap:8px; padding:9px 12px; border-bottom:1px solid #eef1f5; font-size:13px; }
  .ok{ color:#137333; } .falha{ color:#b06000; }
  progress{ width:100%; height:12px; border-radius:6px; overflow:hidden; }
  .apps-tab{ width:100%; border-collapse:collapse; margin-top:4px; }
  .apps-tab th{ font-size:11px; text-transform:uppercase; letter-spacing:.5px; color:var(--mut); font-weight:700; padding:6px 8px; text-align:center; border-bottom:1px solid #e3e8ef; }
  .apps-tab td{ padding:6px 8px; text-align:center; font-size:13px; border-bottom:1px solid #eef1f5; }
  /* lista de apps: 10 por página (paginado por setinhas); o modal é coluna flex -> legenda e rodapé sempre visíveis */
  #ovApps .modal{ display:flex; flex-direction:column; }
  #ovApps .apps-scroll{ flex:0 1 auto; min-height:0; }
  .apps-scroll{ max-height:min(70vh,500px); overflow-y:auto; margin-top:4px; }
  .apps-scroll .apps-tab{ margin-top:0; }
  .apps-tab thead th{ position:sticky; top:0; z-index:2; background:var(--card); }
  .apps-scroll::-webkit-scrollbar{ width:10px; }
  .apps-scroll::-webkit-scrollbar-thumb{ background:#c3ccd8; border-radius:6px; border:2px solid transparent; background-clip:content-box; }
  .apps-scroll::-webkit-scrollbar-thumb:hover{ background:#9aa7b8; background-clip:content-box; }
  body.dark .apps-scroll::-webkit-scrollbar-thumb{ background:#3a475c; background-clip:content-box; }
  .apps-scroll{ scrollbar-width:thin; scrollbar-color:#c3ccd8 transparent; }
  .val-prot{ font-size:12px; color:var(--mut); white-space:nowrap; cursor:help; }
  .apps-tab .tag{ display:inline-block; box-sizing:border-box; min-width:134px; text-align:center; background:#334155; color:#fff; font-size:11.5px; font-weight:800; padding:5px 11px; border-radius:7px; letter-spacing:.2px; }
  body.dark .apps-tab .tag{ background:#3a475c; }
  .md{ display:inline-block; font-size:11.5px; font-weight:700; padding:4px 10px; border-radius:999px; }
  .md.auto{ background:#dcfce7; color:#15803d; }
  .md.manual{ background:#fee2e2; color:#b91c1c; }
  .md.cap-sim{ background:#dbeafe; color:#1d4ed8; }
  .md.cap-nao{ background:#e8eef7; color:#3b5578; }
  body.dark .md.auto{ background:#0f2e1c; color:#4ade80; }
  body.dark .md.cap-sim{ background:#132b52; color:#7db0ff; }
  body.dark .md.manual{ background:#3a1618; color:#f87171; }
  .cap{ display:inline-flex; align-items:center; gap:5px; font-size:11.5px; font-weight:600; padding:4px 10px; border-radius:999px; }
  .cap.cap-none{ background:transparent; color:var(--mut,#98a2b3); font-weight:500; }
  .cap.cap-tap{ background:#f1f5f9; color:#475569; border:1px solid #e2e8f0; }
  body.dark .cap.cap-tap{ background:#1a2536; color:#a9bad2; border-color:#2a3444; }
  .cap.cap-auto{ background:#dcfce7; color:#15803d; }
  body.dark .cap.cap-auto{ background:#0f2e1c; color:#4ade80; }
  /* ===== Tour guiado (onboarding) ===== */
  body.tour-lock{ overflow:hidden; }
  .tour-ov{ position:fixed; inset:0; z-index:9000; display:none; }
  .tour-hole{ position:fixed; border-radius:12px; box-shadow:0 0 0 9999px rgba(6,11,20,.72); transition:all .28s cubic-bezier(.4,0,.2,1); pointer-events:none;
    outline:2px solid #5FB0FF; outline-offset:2px; }
  .tour-tip{ position:fixed; width:320px; max-width:calc(100vw - 24px); background:var(--card,#fff); color:var(--ink,#1a2130); border:1px solid var(--linha,#e3e8ef);
    border-radius:16px; padding:18px 18px 16px; box-shadow:0 20px 60px rgba(0,0,0,.4); pointer-events:auto; transition:left .28s cubic-bezier(.4,0,.2,1), top .28s cubic-bezier(.4,0,.2,1); }
  body.dark .tour-tip{ background:#141c28; border-color:#2a3648; }
  .tour-x{ position:absolute; top:10px; right:10px; width:26px; height:26px; border:none; background:transparent; color:var(--mut,#98a2b3); font-size:14px; cursor:pointer; border-radius:7px; }
  .tour-x:hover{ background:var(--card2,#eef1f6); color:var(--ink); }
  body.dark .tour-x:hover{ background:#0f1722; }
  .tour-head{ display:flex; align-items:center; gap:10px; margin:0 24px 8px 0; }
  .tour-ic{ font-size:22px; line-height:1; flex:0 0 auto; }
  .tour-head h3{ margin:0; font-size:16px; font-weight:800; letter-spacing:.2px; }
  .tour-txt{ margin:0 0 14px; font-size:13.5px; line-height:1.55; color:var(--mut,#5b6675); }
  body.dark .tour-txt{ color:#aab7c8; }
  .tour-dots{ display:flex; align-items:center; gap:6px; margin-bottom:14px; }
  .tour-dot{ width:6px; height:6px; border-radius:50%; background:var(--linha,#d7dee8); transition:all .2s; }
  .tour-dot.on{ background:#2E77C9; width:18px; border-radius:99px; }
  .tour-cont{ margin-left:auto; font-size:11.5px; font-weight:700; color:var(--mut,#98a2b3); }
  .tour-acoes{ display:flex; align-items:center; justify-content:space-between; gap:10px; }
  .tour-nav{ display:flex; align-items:center; gap:8px; }
  .tour-b{ border:none; border-radius:10px; padding:9px 14px; font-size:13px; font-weight:700; cursor:pointer; font-family:inherit; transition:all .13s; }
  .tour-b.pri{ background:linear-gradient(180deg,#3A8FE0,#2E77C9); color:#fff; box-shadow:0 4px 12px rgba(46,119,201,.35); }
  .tour-b.pri:hover{ filter:brightness(1.07); transform:translateY(-1px); }
  .tour-b.sec{ background:transparent; color:var(--mut,#7d8ba0); }
  .tour-b.sec:hover{ color:var(--ink); background:var(--card2,#eef1f6); }
  body.dark .tour-b.sec:hover{ background:#0f1722; }
  .tour-hint{ margin:-4px 0 12px; font-size:12px; font-weight:600; color:#2E77C9; background:rgba(46,119,201,.1); border:1px solid rgba(46,119,201,.22); border-radius:9px; padding:8px 10px; }
  body.dark .tour-hint{ color:#7db0ff; background:rgba(46,119,201,.14); border-color:rgba(46,119,201,.3); }
  /* menu da lâmpada (guias) */
  .ajuda-menu{ position:fixed; z-index:9100; width:270px; background:var(--card,#fff); border:1px solid var(--linha,#e3e8ef); border-radius:14px; padding:8px; box-shadow:0 18px 50px rgba(0,0,0,.35); }
  body.dark .ajuda-menu{ background:#141c28; border-color:#2a3648; }
  .ajuda-tit{ font-size:11px; text-transform:uppercase; letter-spacing:.6px; font-weight:800; color:var(--mut,#98a2b3); padding:6px 8px 8px; }
  .ajuda-menu button{ width:100%; display:flex; align-items:center; gap:11px; text-align:left; border:none; background:transparent; cursor:pointer; padding:10px; border-radius:10px; color:var(--ink); transition:background .12s; font-family:inherit; }
  .ajuda-menu button:hover{ background:var(--card2,#f2f6fb); }
  body.dark .ajuda-menu button:hover{ background:#0f1722; }
  .ajuda-menu .am-ic{ font-size:20px; flex:0 0 auto; }
  .ajuda-menu button span span, .ajuda-menu button > span:last-child{ display:flex; flex-direction:column; }
  .ajuda-menu b{ font-size:13.5px; font-weight:700; }
  .ajuda-menu small{ font-size:11.5px; color:var(--mut,#98a2b3); margin-top:1px; }
  /* lista de indicações */
  /* ===== Indique e ganhe: código em destaque + botões ===== */
  .ind-codewrap{ margin-top:6px; }
  .ind-code-input{ width:100%; box-sizing:border-box; padding:16px 12px; border:2px dashed var(--linha); border-radius:14px; font-size:30px; font-weight:800; letter-spacing:7px; text-align:center; background:rgba(46,125,209,.05); color:inherit; }
  body.dark .ind-code-input{ background:rgba(46,125,209,.1); }
  .ind-btns{ display:flex; flex-direction:column; gap:9px; margin-top:12px; }
  .ind-cta{ width:100%; box-sizing:border-box; display:flex; align-items:center; justify-content:center; gap:9px; padding:13px 14px; border-radius:12px; font-size:14.5px; font-weight:700; cursor:pointer; border:none; }
  button.btn-primario.ind-cta{ background:#2E7DD1; color:#fff; }
  button.btn-primario.ind-cta:hover{ background:#2668b0; }
  .ind-wpp{ background:#25D366; color:#073b1e; }
  .ind-wpp:hover{ background:#1fbe5a; }
  .ind-resumo{ display:flex; gap:10px; margin:16px 0 10px; }
  .ind-kpi{ flex:1; border:1px solid var(--linha,#e3e8ef); border-radius:12px; padding:10px 12px; text-align:center; }
  body.dark .ind-kpi{ background:#0f1722; }
  .ind-kpi b{ display:block; font-size:22px; font-weight:800; line-height:1.1; }
  .ind-kpi span{ font-size:11px; color:var(--mut,#98a2b3); text-transform:uppercase; letter-spacing:.4px; font-weight:700; }
  .ind-kpi.ok b{ color:#15803d; } .ind-kpi.pend b{ color:#c98a00; }
  body.dark .ind-kpi.ok b{ color:#4ade80; } body.dark .ind-kpi.pend b{ color:#f0b04a; }
  .ind-lista{ max-height:190px; overflow:auto; margin-bottom:4px; }
  .ind-row{ display:flex; align-items:center; gap:10px; padding:9px 4px; border-bottom:1px solid var(--linha,#eef1f5); font-size:13px; }
  body.dark .ind-row{ border-color:#222b39; }
  .ind-row:last-child{ border-bottom:none; }
  .ind-nome{ flex:1; font-weight:600; color:var(--ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .ind-data{ font-size:11.5px; color:var(--mut,#98a2b3); }
  .ind-tag{ font-size:11px; font-weight:700; padding:3px 9px; border-radius:99px; white-space:nowrap; }
  .ind-tag.pend{ background:#fff3d6; color:#c98a00; } .ind-tag.ok{ background:#dcfce7; color:#15803d; }
  body.dark .ind-tag.pend{ background:#33280f; color:#f0b04a; } body.dark .ind-tag.ok{ background:#0f2e1c; color:#4ade80; }
  .ind-vazio{ text-align:center; color:var(--mut,#98a2b3); font-size:13px; padding:16px 8px; }
  /* modal PIN obrigatório */
  .pin-ic{ width:56px; height:56px; margin:0 auto 12px; border-radius:16px; display:flex; align-items:center; justify-content:center; font-size:26px;
    background:linear-gradient(135deg,#3A8FE0,#2E77C9); color:#fff; box-shadow:0 8px 22px rgba(46,119,201,.4); }
  .pin-erro{ min-height:16px; margin-top:8px; font-size:12.5px; color:#e2483d; font-weight:600; }
  #ovPinSetup .modal{ text-align:center; }
  #ovPinSetup .cfg-lbl, #ovPinSetup .ac-inp{ text-align:left; }
  #ovPinSetup .ac-inp{ letter-spacing:4px; font-size:18px; font-weight:700; text-align:center; }
  .pin-nota{ text-align:left; margin:0 0 16px; font-size:12.5px; line-height:1.5; color:#1f5a9e;
    background:rgba(46,119,201,.1); border:1px solid rgba(46,119,201,.22); border-radius:10px; padding:10px 12px; }
  .pin-nota b{ color:#174b85; }
  body.dark .pin-nota{ color:#9cc4f5; background:rgba(46,119,201,.14); border-color:rgba(46,119,201,.3); }
  body.dark .pin-nota b{ color:#c3ddff; }
  /* botão Rever tutorial (Configurações) */
  .cfg-rever{ width:100%; display:inline-flex; align-items:center; justify-content:center; gap:9px; padding:11px; border-radius:10px;
    border:1.5px solid var(--linha); background:var(--card); color:var(--txt,var(--ink)); font-weight:600; font-size:13.5px; cursor:pointer; transition:all .13s; font-family:inherit; }
  .cfg-rever:hover{ border-color:var(--brand,#2E7DD1); color:var(--brand,#2E7DD1); background:#f5f9fe; }
  body.dark .cfg-rever{ background:#0c1219; }
  body.dark .cfg-rever:hover{ background:#111a25; }
  .cfg-rever svg{ width:16px; height:16px; }
  /* ===== Dúvidas (chat cliente <-> admin) ===== */
  .duv-badge{ display:inline-flex; align-items:center; justify-content:center; min-width:18px; height:18px; padding:0 5px; border-radius:99px; background:#e2483d; color:#fff; font-size:11px; font-weight:800; }
  .duv-modal{ display:flex; flex-direction:column; max-width:560px; width:100%; max-height:86vh; }
  .duv-head{ display:flex; align-items:center; justify-content:space-between; gap:10px; }
  .duv-title{ display:flex; align-items:center; gap:10px; min-width:0; }
  .duv-cod{ font-size:12px; font-weight:800; color:var(--brand,#2E7DD1); background:rgba(46,125,209,.12); border-radius:99px; padding:3px 9px; white-space:nowrap; }
  .duv-sel{ max-width:48%; font-size:12px; padding:6px 8px; border-radius:8px; border:1px solid var(--linha); background:var(--card); color:var(--txt,var(--ink)); font-family:inherit; }
  .duv-stat{ font-size:12px; font-weight:700; margin:10px 0 0; padding:6px 10px; border-radius:8px; text-align:center; }
  .duv-stat.enviado{ background:rgba(47,125,201,.12); color:#2E7DD1; }
  .duv-stat.visualizado{ background:rgba(240,176,74,.14); color:#a86e12; }
  .duv-stat.respondido{ background:rgba(46,160,96,.14); color:#1f8a4c; }
  body.dark .duv-stat.visualizado{ color:#f0b04a; } body.dark .duv-stat.respondido{ color:#5fd58c; }
  /* ===== FAQ dentro de Dúvidas ===== */
  .duv-faq{ margin-top:10px; border:1px solid var(--linha); border-radius:12px; background:#f7f9fc; overflow:hidden; }
  body.dark .duv-faq{ background:#121a24; }
  .duv-faq>summary{ list-style:none; cursor:pointer; padding:11px 14px; font-weight:700; font-size:13.5px; color:#2E7DD1; display:flex; align-items:center; gap:8px; user-select:none; }
  .duv-faq>summary::-webkit-details-marker{ display:none; }
  .duv-faq>summary::after{ content:'▾'; margin-left:auto; transition:transform .2s; color:#8a97a8; }
  .duv-faq[open]>summary::after{ transform:rotate(180deg); }
  .duv-faq-hint{ font-weight:500; font-size:11.5px; color:#8a97a8; }
  .duv-faq[open] .duv-faq-hint{ display:none; }
  .duv-faq-body{ max-height:52vh; overflow-y:auto; padding:2px 10px 10px; }
  .duv-faq-body::-webkit-scrollbar{ width:6px; } .duv-faq-body::-webkit-scrollbar-thumb{ background:rgba(140,151,168,.35); border-radius:3px; }
  /* na entrada (FAQ visível) o thread não reserva espaço nem mostra prompt redundante */
  .duv-thread--faq{ min-height:0 !important; max-height:0 !important; padding:0 !important; margin:0 !important; overflow:hidden !important; }
  .duv-faq-item{ border-top:1px solid var(--linha); }
  .duv-faq-item>summary{ list-style:none; cursor:pointer; padding:10px 6px; font-size:13px; font-weight:600; color:var(--ink,#1b2430); display:flex; align-items:center; gap:8px; }
  .duv-faq-item>summary::-webkit-details-marker{ display:none; }
  .duv-faq-item>summary::before{ content:'＋'; color:#2E7DD1; font-weight:800; width:14px; display:inline-block; }
  .duv-faq-item[open]>summary::before{ content:'－'; }
  body.dark .duv-faq-item>summary{ color:#dce5f0; }
  .duv-faq-ans{ padding:2px 6px 12px 28px; font-size:12.5px; line-height:1.5; color:#55606e; }
  body.dark .duv-faq-ans{ color:#9fb0c2; }
  .duv-faq-rodape{ padding:10px 6px 2px; font-size:12px; color:#8a97a8; text-align:center; }
  .duv-thread{ flex:1; overflow-y:auto; min-height:200px; max-height:46vh; display:flex; flex-direction:column; gap:8px; padding:14px 4px; margin-top:10px; }
  .duv-thread--empty{ min-height:120px; justify-content:center; }
  .duv-vazio{ margin:auto; color:var(--mut); font-size:13px; text-align:center; padding:10px 20px; line-height:1.5; display:flex; flex-direction:column; align-items:center; gap:6px; }
  .duv-vazio-ic{ font-size:30px; line-height:1; opacity:.9; }
  .duv-vazio b{ color:var(--ink,#1b2430); font-size:14px; }
  body.dark .duv-vazio b{ color:#dce5f0; }
  .duv-vazio span{ max-width:300px; }
  .duv-msg{ max-width:80%; padding:9px 12px; border-radius:14px; font-size:13.5px; line-height:1.45; word-wrap:break-word; white-space:pre-wrap; }
  .duv-msg .duv-hora{ display:block; font-size:10.5px; opacity:.6; margin-top:4px; }
  .duv-msg.cli{ align-self:flex-end; background:var(--brand,#2E7DD1); color:#fff; border-bottom-right-radius:5px; }
  .duv-msg.adm{ align-self:flex-start; background:var(--card2,#eef1f6); color:var(--txt,var(--ink)); border-bottom-left-radius:5px; }
  body.dark .duv-msg.adm{ background:#1a2431; }
  .duv-daysep{ align-self:center; font-size:11px; color:var(--mut); background:var(--card2,#eef1f6); padding:2px 10px; border-radius:99px; margin:4px 0; }
  body.dark .duv-daysep{ background:#1a2431; }
  .duv-composer{ display:flex; gap:8px; align-items:flex-end; margin-top:10px; }
  .duv-composer textarea{ flex:1; resize:none; max-height:120px; padding:10px 12px; border-radius:11px; border:1.5px solid var(--linha); background:var(--card); color:var(--txt,var(--ink)); font-family:inherit; font-size:13.5px; line-height:1.4; }
  .duv-composer textarea:focus{ outline:none; border-color:var(--brand,#2E7DD1); }
  .duv-attach{ flex:0 0 auto; width:42px; height:42px; border:none; border-radius:11px; cursor:pointer; display:flex; align-items:center; justify-content:center; background:rgba(120,135,160,.14); color:var(--mut,#6b7686); transition:background .13s,color .13s; }
  .duv-attach:hover{ background:rgba(46,119,201,.15); color:var(--brand,#2E7DD1); }
  .duv-attach svg{ width:19px; height:19px; }
  .duv-attach:disabled{ opacity:.5; cursor:default; }
  .duv-msg img.chat-img{ display:block; max-width:210px; max-height:230px; border-radius:10px; margin:3px 0; cursor:pointer; background:rgba(0,0,0,.15); }
  .duv-send{ flex:none; width:42px; height:42px; border-radius:11px; border:none; background:var(--brand,#2E7DD1); color:#fff; cursor:pointer; display:inline-flex; align-items:center; justify-content:center; transition:filter .13s; }
  .duv-send:hover{ filter:brightness(1.08); } .duv-send:disabled{ opacity:.5; cursor:default; }
  .duv-send svg{ width:18px; height:18px; }
  .duv-fechado{ display:flex; flex-direction:column; gap:12px; align-items:center; text-align:center; margin-top:12px; padding:16px; border:1px solid var(--linha); background:#f7f9fc; border-radius:14px; font-size:13px; color:var(--mut); }
  body.dark .duv-fechado{ background:#121a24; }
  #duvNova{ display:inline-flex; align-items:center; justify-content:center; gap:8px; padding:12px 22px; border:none; border-radius:11px; background:#2E7DD1; color:#fff; font-size:14px; font-weight:700; cursor:pointer; }
  #duvNova:hover{ background:#2668b0; }
  /* botão Servidores na toolbar (passo inicial do cliente) */
  #btnServidores.tbtn-serv{ display:inline-flex; align-items:center; gap:7px; }
  #btnServidores.tbtn-serv svg{ width:15px; height:15px; }
  .apps-leg{ font-size:12px; color:var(--mut); margin-top:8px; line-height:1.45; }
  .apps-pager{ display:flex; align-items:center; justify-content:center; gap:14px; margin-top:10px; }
  .apps-nav{ width:34px; height:34px; border:1px solid var(--linha); background:var(--card); border-radius:9px; font-size:19px; line-height:1; color:var(--ink,#334155); cursor:pointer; display:flex; align-items:center; justify-content:center; transition:all .12s; }
  .apps-nav:hover:not(:disabled){ background:#2E77C9; color:#fff; border-color:#2E77C9; }
  .apps-nav:disabled{ opacity:.35; cursor:default; }
  .apps-pg{ font-size:12.5px; font-weight:700; color:var(--mut); min-width:50px; text-align:center; font-variant-numeric:tabular-nums; }
  /* Configurações em seções */
  .cfg-sec{ border-top:1px solid var(--linha); padding:16px 0; }
  .cfg-sec:first-of-type{ border-top:none; padding-top:4px; }
  .cfg-sec h3{ margin:0 0 10px; font-size:13px; font-weight:700; color:var(--ink); text-transform:uppercase; letter-spacing:.4px; }
  .cfg-lbl{ display:block; font-size:13px; font-weight:600; margin-bottom:6px; color:var(--ink); }
  .cfg-hint{ font-size:12px; color:var(--mut); margin:6px 0 0; line-height:1.45; }
  .pin-wrap{ position:relative; }
  .cfg-sec input#cfgPin{ width:100%; padding:11px 40px 11px 12px; border:1px solid var(--linha); border-radius:9px; font-size:14px; background:#fff; }
  body.dark .cfg-sec input#cfgPin{ background:#0c1219; color:#fff; }
  .eye-btn{ position:absolute; right:6px; top:50%; transform:translateY(-50%); background:transparent; border:none; cursor:pointer;
    padding:6px; color:var(--mut); display:flex; align-items:center; }
  .eye-btn svg{ width:18px; height:18px; display:block; }
  .lang-grid{ display:grid; grid-template-columns:repeat(4,1fr); gap:8px; }
  .lang-op{ display:flex; align-items:center; justify-content:center; gap:8px; padding:9px 12px; border:1.5px solid var(--linha); border-radius:10px;
    cursor:pointer; font-size:13px; font-weight:600; color:var(--ink); background:#fff; transition:.15s; }
  .lang-op:hover{ border-color:#bcd0ea; }
  .lang-op.on{ border-color:var(--brand); background:#eaf2fb; }
  .lang-op svg{ width:24px; height:16px; border-radius:2px; display:block; box-shadow:0 0 0 1px #0002; }
  body.dark .lang-op{ background:#0c1219; color:#e7edf5; } body.dark .lang-op.on{ background:#16324f; }
  .rank-row{ display:flex; align-items:center; gap:10px; padding:8px 0; border-bottom:1px solid var(--linha); font-size:13px; }
  .rank-row:last-child{ border-bottom:none; }
  .rank-pos{ width:22px; height:22px; border-radius:50%; background:#eef1f6; color:#33405a; font-weight:800; font-size:12px;
    display:flex; align-items:center; justify-content:center; flex-shrink:0; }
  .rank-bar{ flex:1; height:8px; background:#eef1f6; border-radius:99px; overflow:hidden; }
  .rank-bar i{ display:block; height:100%; background:var(--brand); border-radius:99px; }
  .rank-n{ color:var(--mut); font-size:12px; min-width:54px; text-align:right; }
  body.dark .rank-pos, body.dark .rank-bar{ background:#1b2531; }
  .lock{ font-size:11px; vertical-align:middle; }
  /* dropdown de app colorido */
  .app-dd{ position:relative; }
  .app-dd-btn{ width:100%; text-align:left; padding:9px 12px; border:1px solid var(--linha); border-radius:9px; background:#fff;
    cursor:pointer; font-size:14px; display:flex; align-items:center; gap:8px; }
  .app-dd-btn::after{ content:'▾'; margin-left:auto; color:var(--mut); }
  body.dark .app-dd-btn{ background:#0c1219; }
  .app-dd-menu{ position:absolute; left:0; right:0; top:calc(100% + 5px); background:var(--card); border:1px solid var(--linha);
    border-radius:10px; box-shadow:0 14px 40px #0004; padding:6px; display:none; flex-direction:column; gap:4px; z-index:40; }
  .app-dd-menu.on{ display:flex; }
  .app-dd-menu .opt{ display:flex; align-items:center; padding:7px 8px; border-radius:8px; cursor:pointer; }
  .app-dd-menu .opt:hover{ background:#f2f5f9; }
  body.dark .app-dd-menu .opt:hover{ background:#1b2531; }
  /* busca (lupa) + rolagem no dropdown de app */
  .app-dd-search{ display:flex; align-items:center; gap:6px; padding:2px 6px 6px; }
  .app-dd-search svg{ width:15px; height:15px; color:var(--mut); flex:none; }
  .app-dd-search input{ width:100%; min-width:0; border:1px solid var(--linha); border-radius:8px; padding:7px 9px; font-size:13.5px; background:#fff; color:inherit; outline:none; }
  .app-dd-search input:focus{ border-color:var(--pri,#2E6BE6); }
  body.dark .app-dd-search input{ background:#0c1219; }
  .app-dd-opts{ display:flex; flex-direction:column; gap:4px; max-height:280px; overflow-y:auto; }
  /* barra de rolagem no tema do app */
  ::-webkit-scrollbar{ width:12px; height:12px; }
  ::-webkit-scrollbar-track{ background:transparent; }
  ::-webkit-scrollbar-thumb{ background:#c7cfdb; border-radius:8px; border:3px solid transparent; background-clip:padding-box; }
  ::-webkit-scrollbar-thumb:hover{ background:#aeb8c8; }
  body.dark ::-webkit-scrollbar-thumb{ background:#2b3646; border:3px solid transparent; background-clip:padding-box; }
  body.dark ::-webkit-scrollbar-thumb:hover{ background:#3a4757; }
  body.dark .apps-tab th{ border-color:#2a3444; } body.dark .apps-tab td{ border-color:#222b39; }