  #pub-assinar-screen, #pub-validar-screen { display:none; }
  #pub-assinar-screen, #pub-validar-screen {
    min-height:100vh; font-family:'Poppins',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Arial,sans-serif;
    background:linear-gradient(135deg, #f0f4ff 0%, #e3f2fd 50%, #f0f4ff 100%); color:#1f2937;
  }
  .pub-header { background:rgba(255,255,255,.92); backdrop-filter:blur(6px); border-bottom:1px solid #e5e7eb; padding:14px 22px; display:flex; align-items:center; gap:14px; position:sticky; top:0; z-index:20; box-shadow:0 2px 12px rgba(37,99,235,.06); }
  .pub-logo { height:30px; width:auto; display:block; flex-shrink:0; }
  .pub-header h1 { font-size:16px; margin:0; font-weight:700; color:#111827; }
  .pub-header .pub-sub { font-size:12px; color:#6b7280; margin-top:1px; }
  .pub-wrap { max-width:820px; margin:0 auto; padding:24px 16px 150px; }
  .pub-card { background:#fff; border:1px solid #eef0f4; border-radius:16px; padding:22px; margin-bottom:16px; box-shadow:0 4px 20px rgba(37,99,235,.06); }
  .pub-page-wrap { position:relative; margin:0 auto 18px; border:1px solid #e5e7eb; border-radius:8px; overflow:hidden; box-shadow:0 4px 16px rgba(15,23,42,.08); background:#fff; }
  .pub-page-wrap canvas { display:block; width:100%; height:auto; }
  .pub-page-num { position:absolute; top:-20px; left:0; font-size:12px; color:#9ca3af; }
  .pub-campo { position:absolute; border:2px dashed #2563eb; border-radius:4px; background:rgba(37,99,235,.08);
    display:flex; align-items:center; justify-content:center; font-size:11px; color:#2563eb; font-weight:600; overflow:hidden; box-sizing:border-box; }
  .pub-campo img { width:100%; height:100%; object-fit:contain; }
  .pub-tabs { display:flex; gap:8px; margin-bottom:12px; }
  .pub-tab { flex:1; padding:11px; text-align:center; border-radius:10px; border:1.5px solid #e5e7eb; cursor:pointer; font-size:14px; font-weight:600; color:#4b5563; transition:all .15s; -webkit-tap-highlight-color:transparent; }
  .pub-tab.active { background:#2563eb; color:#fff; border-color:#2563eb; box-shadow:0 4px 12px rgba(37,99,235,.25); }
  .pub-input { width:100%; padding:11px 13px; border:1.5px solid #e5e7eb; border-radius:10px; font-size:14px; margin-bottom:10px; font-family:inherit; transition:all .15s; background:#f9fafb; }
  .pub-input:focus { outline:none; border-color:#2563eb; background:#fff; box-shadow:0 0 0 3px rgba(37,99,235,.1); }
  .pub-input.pub-input-erro { border-color:#dc2626; background:#fef2f2; box-shadow:0 0 0 3px rgba(220,38,38,.08); }
  .pub-erro-campo { display:none; font-size:12px; color:#dc2626; font-weight:600; margin:-6px 0 10px; }
  .pub-erro-campo.pub-erro-campo-show { display:block; }
  .pub-canvas-draw { width:100%; height:180px; border:1.5px dashed #d1d5db; border-radius:10px; touch-action:none; background:#fafbff; }
  .pub-font-pills { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:14px; }
  .pub-font-pill { padding:8px 14px; min-height:44px; box-sizing:border-box; display:inline-flex; align-items:center; border:1.5px solid #e5e7eb; border-radius:10px; cursor:pointer; font-size:19px; color:#374151; background:#fff; transition:all .15s; line-height:1; -webkit-tap-highlight-color:transparent; }
  .pub-font-pill.active { border-color:#2563eb; background:var(--primary-pale,#edf6ff); color:#1d4ed8; box-shadow:0 0 0 3px rgba(37,99,235,.1); }
  .pub-preview-box { margin-top:4px; border:1.5px dashed #c7d2fe; border-radius:12px; padding:14px 16px; background:#fafbff; }
  .pub-preview-label { font-size:11px; font-weight:700; letter-spacing:.04em; text-transform:uppercase; color:#9ca3af; margin-bottom:8px; }
  .pub-preview-area { min-height:64px; display:flex; align-items:center; justify-content:center; }
  .pub-preview-area img { max-height:80px; max-width:100%; }
  .pub-preview-vazio { font-size:12.5px; color:#9ca3af; font-style:italic; }
  .pub-btn { padding:13px 22px; min-height:48px; box-sizing:border-box; border:none; border-radius:10px; background:linear-gradient(135deg,#2563eb,#1d4ed8); color:#fff; font-size:15px; font-weight:700; cursor:pointer; font-family:inherit; box-shadow:0 6px 16px rgba(37,99,235,.28); transition:all .2s; -webkit-tap-highlight-color:transparent; }
  .pub-btn:hover:not(:disabled) { transform:translateY(-1px); box-shadow:0 10px 22px rgba(37,99,235,.35); }
  .pub-btn:disabled { background:#d1d5db; box-shadow:none; cursor:not-allowed; }
  .pub-btn-ghost { background:#fff; color:#4b5563; border:1.5px solid #e5e7eb; box-shadow:none; }
  .pub-btn-ghost:hover:not(:disabled) { border-color:#c7d2fe; background:#f8faff; transform:none; }
  .pub-bar { position:fixed; bottom:0; left:0; right:0; background:rgba(255,255,255,.95); backdrop-filter:blur(6px); border-top:1px solid #e5e7eb; padding:14px 16px calc(14px + env(safe-area-inset-bottom)); display:flex; justify-content:center; gap:10px; z-index:20; }
  .pub-status { text-align:center; padding:60px 20px; }
  .pub-status .emoji { font-size:46px; margin-bottom:12px; }
  .pub-hidden { display:none !important; }
  .pub-hint { font-size:12px; color:#6b7280; margin-top:4px; }
  .pub-steps { display:flex; align-items:flex-start; justify-content:center; gap:0; margin-bottom:20px; }
  .pub-step { display:flex; flex-direction:column; align-items:center; gap:6px; font-size:11px; color:#9ca3af; width:84px; }
  .pub-step-circ { width:28px; height:28px; border-radius:50%; background:#e5e7eb; color:#9ca3af; display:flex; align-items:center; justify-content:center; font-size:12px; font-weight:700; transition:background .2s,color .2s; }
  .pub-step.active .pub-step-circ { background:#2563eb; color:#fff; box-shadow:0 0 0 4px rgba(37,99,235,.15); }
  .pub-step.active .pub-step-txt { color:#111827; font-weight:700; }
  .pub-step.done .pub-step-circ { background:#10b981; color:#fff; }
  .pub-step.done .pub-step-txt { color:#10b981; font-weight:600; }
  .pub-step-sep { width:36px; height:2px; background:#e5e7eb; margin-top:13px; }
  .pub-footer-marca { text-align:center; font-size:11px; color:#9ca3af; margin-top:28px; letter-spacing:.03em; }
  @keyframes pubFadeIn { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:translateY(0); } }
  #pub-etapa-assinar:not(.pub-hidden) { animation:pubFadeIn .25s ease-out; }
  @media (max-width:600px) {
    .pub-header { padding:12px 16px; }
    .pub-logo { height:24px; }
    .pub-card { padding:16px; border-radius:12px; }
    .pub-wrap { padding:16px 12px calc(150px + env(safe-area-inset-bottom)); }
    /* Campos com fonte abaixo de 16px fazem o Safari do iPhone dar zoom
       sozinho ao tocar — deixando a tela pulando toda hora enquanto a
       pessoa preenche os dados no celular. 16px evita esse zoom automático. */
    .pub-input, .pub-tab, .pub-btn, .val-input, .val-btn { font-size:16px; }
    .pub-font-pill { font-size:22px; padding:9px 15px; }
    /* Área de assinar com o dedo maior no celular — mais espaço pra
       desenhar com precisão numa tela pequena. */
    .pub-canvas-draw { height:210px; }
    .pub-preview-area img { max-height:64px; }
  }

  .val-wrap { max-width:560px; margin:0 auto; padding:44px 16px; }
  .val-logo { text-align:center; margin-bottom:24px; }
  .val-logo-img { height:38px; width:auto; display:block; margin:0 auto 10px; }
  .val-logo-txt { font-size:12px; color:#9ca3af; letter-spacing:.06em; text-transform:uppercase; font-weight:600; }
  .val-card { background:#fff; border:1px solid #eef0f4; border-radius:16px; padding:28px; box-shadow:0 4px 24px rgba(37,99,235,.07); }
  .val-busca { display:flex; gap:8px; margin-bottom:4px; }
  .val-input { flex:1; padding:12px 14px; border:1.5px solid #e5e7eb; border-radius:10px; font-size:14px; font-family:inherit; background:#f9fafb; transition:all .15s; }
  .val-input:focus { outline:none; border-color:#2563eb; background:#fff; box-shadow:0 0 0 3px rgba(37,99,235,.1); }
  .val-btn { padding:12px 20px; border:none; border-radius:10px; background:linear-gradient(135deg,#2563eb,#1d4ed8); color:#fff; font-weight:700; cursor:pointer; font-size:14px; font-family:inherit; box-shadow:0 6px 16px rgba(37,99,235,.25); transition:all .2s; }
  .val-btn:hover:not(:disabled) { transform:translateY(-1px); }
  .val-btn:disabled { background:#d1d5db; box-shadow:none; }
  .val-hint { font-size:12px; color:#9ca3af; margin-top:6px; }
  .val-resultado { margin-top:22px; }
  .val-status-linha { display:flex; align-items:center; gap:10px; padding:14px; border-radius:10px; margin-bottom:16px; }
  .val-status-ok { background:#ecfdf5; color:#047857; }
  .val-status-pendente { background:#fffbeb; color:#b45309; }
  .val-status-erro { background:#fef2f2; color:#b91c1c; }
  .val-status-linha .emoji { font-size:22px; }
  .val-linha { display:flex; justify-content:space-between; gap:12px; padding:9px 0; border-bottom:1px solid #f3f4f6; font-size:13.5px; }
  .val-linha:last-child { border-bottom:none; }
  .val-linha .lbl { color:#6b7280; flex-shrink:0; }
  .val-linha .val { text-align:right; word-break:break-all; }
  .val-hash { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size:11px; }
  .val-acoes { display:flex; gap:8px; margin-top:18px; flex-wrap:wrap; }
  .val-acoes a { flex:1; text-align:center; text-decoration:none; padding:13px; min-height:44px; box-sizing:border-box; display:flex; align-items:center; justify-content:center; border-radius:10px; font-size:13.5px; font-weight:700; transition:all .15s; -webkit-tap-highlight-color:transparent; }
  .val-acoes a.primaria { background:linear-gradient(135deg,#2563eb,#1d4ed8); color:#fff; box-shadow:0 6px 16px rgba(37,99,235,.25); }
  .val-acoes a.primaria:hover { transform:translateY(-1px); }
  .val-acoes a.secundaria { background:#f3f4f6; color:#4b5563; }
  .val-hidden { display:none !important; }

  @media (max-width:600px) {
    .val-wrap { padding:28px 14px calc(28px + env(safe-area-inset-bottom)); }
    .val-card { padding:18px; border-radius:12px; }
    /* Numa tela estreita, hash de 64 caracteres ao lado do rótulo fica
       espremido — empilha rótulo em cima do valor, como num recibo. */
    .val-busca { flex-direction:column; }
    .val-linha { flex-direction:column; gap:3px; }
    .val-linha .val { text-align:left; }
  }
