    :root {
      --vermelho:       #dc2626;
      --vermelho-esc:   #b91c1c;
      --vermelho-vinho: #991b1b;
      --vermelho-dark:  #7f1d1d;
      --preto:          #000000;
      --preto-cinza:    #111827;
      --branco:         #ffffff;
      --branco-suave:   rgba(255,255,255,0.86);
      --amarelo:        #facc15;
      --amarelo-claro:  #fde047;
      --amarelo-vivo:   #ffe500;
      --verde-confirma: #16a34a;

      --primary-color:   var(--vermelho-esc);
      --secondary-color: var(--vermelho);
      --third-color:     var(--amarelo);
      --bg-page:         #fff4f4;
      --bg-light:        var(--branco);
      --bg-darker:       #fecaca;
      --text-darker:     #1f2937;

      --text-preto:       #000000;
      --text-escuro:      #1f2937;
      --text-cinza:       #555555;
      --text-cinza-medio: #666666;
      --text-cinza-claro: #888888;
      --borda-cinza:      #cccccc;
      --borda-help:       1px solid #e5e7eb;

      --digit-bg:          #b91c1c;
      --digit-bg-destaque: #b91c1c;
      --digit-bg-current:  var(--vermelho-dark);
      --digit-cor:         var(--branco);
      --digit-cor-destaque: var(--amarelo-vivo);

      --confirma-bg:   var(--verde-confirma);
      --confirma-cor:  var(--branco);

      --btn-acao-primary-bg:    #a40000;
      --btn-acao-primary-cor:   var(--branco);
      --btn-acao-secondary-bg:  var(--branco);
      --btn-acao-secondary-borda: var(--preto-cinza);
      --btn-acao-secondary-cor: var(--preto-cinza);

      --faixa-from: var(--vermelho-vinho);
      --faixa-to:   var(--vermelho);

      --sombra-leve:     0 10px 28px -18px rgba(185, 28, 28, 0.55);
      --sombra-logo:     0 10px 22px -10px rgba(185, 28, 28, 0.55);
      --sombra-campanha: drop-shadow(0 6px 14px -8px rgba(185, 28, 28, 0.55));

      --chip-headline-bg:    rgba(255,255,255,0.16);
      --chip-headline-borda: rgba(255,255,255,0.42);
      --chip-headline-cor:   var(--branco);
      --chip-headline-sombra: 0 1px 2px rgba(0,0,0,0.22);

      --font-sans: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    }
    
    * { box-sizing: border-box; }

    body {
      margin: 0;
      padding: 0;
      min-height: 100vh;
      font-family: var(--font-sans);
      color: var(--text-darker);
      display: flex;
      flex-direction: column;
      justify-content: center;
      background:
        radial-gradient(1400px 700px at 50% -20%, rgba(220, 38, 38, 0.10), transparent 60%),
        var(--bg-page);
      -webkit-font-smoothing: antialiased;
      text-rendering: optimizeLegibility;
      overflow-x: hidden;
    }

    body::before,
    body::after {
      content: "";
      position: fixed;
      inset-inline: 0;
      height: 8px;
      z-index: 50;
      pointer-events: none;
    }
    body::before {
      top: 0;
      background: linear-gradient(90deg,
        var(--preto-cinza) 0%, var(--preto-cinza) 33.33%,
        var(--vermelho) 33.33%, var(--vermelho) 66.66%,
        var(--preto-cinza) 66.66%, var(--preto-cinza) 100%);
    }
    body::after {
      bottom: 0;
      background: linear-gradient(90deg,
        var(--preto-cinza) 0%, var(--preto-cinza) 33.33%,
        var(--vermelho) 33.33%, var(--vermelho) 66.66%,
        var(--preto-cinza) 66.66%, var(--preto-cinza) 100%);
    }

    .app-main {
      width: min(1280px, 100%);
      margin: 0 auto;
      padding: 24px 24px 72px;
      max-width: 100%;
      box-sizing: border-box;
      display: flex;
      flex-direction: column;
      align-items: stretch;
    }

    /* ========== HEADER ========== */
    .page-header {
      position: relative;
      width: 100%;
      display: block;
      margin-bottom: 28px;
      min-height: 0;
      padding: 0;
      overflow: visible;
    }

    .page-header-faixa {
      position: absolute;
      top: 58px;
      left: 0;
      right: 0;
      height: 96px;
      width: 100%;
      background:
        radial-gradient(800px 220px at 0% 50%, rgba(250, 204, 21, 0.22), transparent 55%),
        radial-gradient(700px 200px at 100% 120%, rgba(239, 68, 68, 0.38), transparent 60%),
        linear-gradient(135deg, var(--faixa-from) 0%, var(--faixa-to) 100%);
      box-shadow: var(--sombra-leve);
      z-index: 0;
      pointer-events: none;
      border-radius: 0;
    }

    .page-header-inner {
      position: relative;
      width: min(1280px, 100%);
      margin: 0 auto;
      padding: 0 24px;
      box-sizing: border-box;
      display: grid;
      grid-template-columns: 170px 1fr 130px;
      grid-template-rows: 58px 96px;
      grid-template-areas:
        ".        .        partido"
        "campanha headline partido";
      column-gap: 16px;
      min-height: 0;
      z-index: 1;
    }

    .page-header-logos {
      display: contents;
    }

    .brand-slot {
      position: relative;
      isolation: isolate;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .brand-slot > * {
      position: relative;
      z-index: 2;
    }
    .brand-slot::before {
      content: "";
      position: absolute;
      inset: -4px -2px;
      border-radius: 18px;
      background: rgba(255, 255, 255, 0.86);
      backdrop-filter: blur(3px);
      z-index: 1;
    }

    .brand-left {
      grid-column: 1 / 2;
      grid-row: 1 / 3;
      align-self: end;
      justify-self: start;
      z-index: 3;
      transform: translateY(40px);
      width: 100%;
      max-width: 180px;
    }
    .brand-right {
      grid-column: 3 / 4;
      grid-row: 2 / 3;
      align-self: center;
      justify-self: end;
      z-index: 3;
      transform: none;
      width: 100%;
      max-width: 108px;
    }

    .brand-logo-campaign {
      width: 100%;
      max-width: 180px;
      min-width: 0;
      height: auto;
      display: block;
      filter: drop-shadow(0 6px 14px -8px rgba(59, 7, 100, 0.55));
    }

    .brand-logo-party {
      width: 100%;
      max-width: 108px;
      height: auto;
      aspect-ratio: auto;
      border-radius: 14px;
      overflow: hidden;
      background: var(--branco);
      padding: 8px 10px;
      box-shadow:
        0 0 0 2px var(--branco),
        var(--sombra-logo);
      object-fit: contain;
      object-position: center;
      display: block;
    }

    .page-header-headline {
      grid-column: 2 / 3;
      grid-row: 2 / 3;
      align-self: center;
      justify-self: center;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-direction: column;
      text-align: center;
      pointer-events: none;
      z-index: 2;
      width: 100%;
      padding: 0 8px;
    }
    .page-header-headline h1 {
      position: relative;
      margin: 0;
      padding: 8px 14px;
      border-radius: 999px;
      background: var(--chip-headline-bg);
      border: 1px solid var(--chip-headline-borda);
      backdrop-filter: blur(2px);
      font-size: clamp(14px, 1.8vw, 18px);
      font-weight: 800;
      letter-spacing: 0.2px;
      color: var(--chip-headline-cor);
      text-shadow: var(--chip-headline-sombra);
      line-height: 1.25;
      max-width: 100%;
      white-space: normal;
    }
    .hl-yellow {
      background: linear-gradient(180deg, rgba(250, 204, 21, 0.96) 0%, rgba(253, 224, 71, 0.96) 100%);
      color: var(--vermelho-vinho);
      padding: 2px 10px;
      border-radius: 8px;
      font-weight: 900;
      margin: 0 2px;
      box-decoration-break: clone;
      -webkit-box-decoration-break: clone;
    }

    /* ========== FOOTER (sentinela) ========== */
    .page-footer {
      height: 40px;
      margin-top: 12px;
      width: 100%;
    }

    @media (max-width: 959px) {
      .app-main { padding: 24px 18px 72px; }
      .page-header-inner { padding: 0 18px; }
    }

    @media (max-width: 768px) {
      .page-header {
        grid-template-columns: 130px 1fr 110px;
        grid-template-rows: 46px 88px;
      }
      .page-header-faixa { top: 46px; height: 88px; margin-top: 0; }
      .page-header-inner {
        grid-template-columns: 130px 1fr 110px;
        grid-template-rows: 46px 88px;
        column-gap: 10px;
        padding: 0 14px;
      }
      .brand-left { transform: translateY(12px); max-width: 130px; }
      .brand-right { transform: none; max-width: 96px; }
      .brand-logo-campaign { max-width: 130px; }
      .brand-logo-party { max-width: 96px; }
      .brand-slot::before { inset: -3px -1px; border-radius: 14px; }
      .page-header-headline h1 { font-size: 14px; padding: 6px 10px; }
    }

    @media (max-width: 560px) {
      .app-main { padding: 22px 12px 84px; }
      .page-header { margin-bottom: 24px; }
      .page-header-inner { padding: 0 12px; }
      .page-header-faixa {
        top: 40px;
        height: 82px;
      }
      .page-header-inner {
        grid-template-columns: 108px 1fr 96px;
        grid-template-rows: 40px 82px;
        column-gap: 8px;
      }
      .brand-left { max-width: 108px; transform: translateY(12px); }
      .brand-right { max-width: 90px; transform: none; }
      .brand-logo-campaign { max-width: 108px; }
      .brand-logo-party { max-width: 90px; }
      .page-header-headline { padding: 0 4px; }
      .page-header-headline h1 { font-size: 12px; padding: 5px 8px; }
      .hl-yellow { padding: 2px 6px; border-radius: 8px; }
    }

    @media (max-width: 380px) {
      .page-header-inner {
        grid-template-columns: 94px 1fr 88px;
        grid-template-rows: 36px 78px;
        column-gap: 6px;
      }
      .page-header-faixa { top: 36px; height: 78px; }
      .brand-left { max-width: 94px; transform: translateY(10px); }
      .brand-right { max-width: 84px; transform: none; }
      .brand-logo-campaign { max-width: 94px; }
      .brand-logo-party { max-width: 84px; }
      .page-header-headline h1 { font-size: 11px; padding: 4px 6px; }
    }

    .app-container {
      width: 100%;
      max-width: 440px;
      padding: 15px;
      position: relative;
      align-self: center;
      margin: 0 auto;
    }

    .btn-voltar {
      display: inline-block;
      margin-bottom: 15px;
      color: var(--primary-color);
      text-decoration: none;
      font-size: 13px;
      font-weight: bold;
    }

    .help-block {
      margin-bottom: 22px;
      text-align: center;
    }
    .help-text {
      margin: 0 0 14px;
      padding: 16px;
      background: var(--branco);
      border-radius: 9px;
      border: var(--borda-help);
      font-size: 14px;
      line-height: 1.55;
      font-weight: 500;
      color: var(--text-preto);
    }
    .help-text strong {
      font-weight: 800;
      color: var(--text-preto);
    }
    .help-cta {
      margin: 0;
      font-size: 17px;
      line-height: 1.4;
      font-weight: 700;
      color: var(--text-preto);
    }
    .help-cta .hl-yellow {
      font-size: 18px;
      font-weight: 900;
      background: var(--vermelho);
      color: var(--branco);
    }

    @media (max-width: 560px) {
      .help-text { font-size: 13px; margin-bottom: 12px; padding: 14px; }
      .help-cta { font-size: 15px; }
      .help-cta .hl-yellow { font-size: 16px; }
    }

    @media (max-width: 380px) {
      .help-text { font-size: 12px; line-height: 1.5; margin-bottom: 10px; padding: 12px; }
      .help-cta { font-size: 14px; }
      .help-cta .hl-yellow { font-size: 15px; }
    }

    .export-wrapper {
      width: 100%;
      display: flex;
      justify-content: center;
      overflow: hidden;
    }

    .export-area {
      width: 400px;
      min-height: 620px;
      background-color: var(--bg-light);
      position: relative;
      overflow: visible;
      display: flex;
      flex-direction: column;
      flex-shrink: 0;
      border: 1px solid #ccc;
    }

    @media (max-width: 420px) {
      .export-area {
        transform: scale(0.85);
        transform-origin: top center;
        margin-bottom: -95px;
      }
    }
    @media (max-width: 360px) {
      .export-area {
        transform: scale(0.75);
        margin-bottom: -155px;
      }
    }

    .top-header {
      width: 100%;
      flex-shrink: 0;
    }
    .top-header img { width: 100%; height: auto; display: block; flex-shrink: 0; }

    .legal-vertical {
      position: absolute;
      right: -120px;
      top: 45%;
      transform: rotate(-90deg);
      font-size: 6.5px;
      color: #888;
      width: 290px;
      text-align: center;
      letter-spacing: 0.5px;
    }

    .main-content {
      flex: 1;
      padding: 15px;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      gap: 16px;
      position: relative;
    }

    .candidate-row {
      display: flex;
      gap: 10px;
      align-items: flex-end;
    }

    .photo-box {
      width: 40px;
      height: 55px;
      background: var(--bg-darker);
      display: flex;
      align-items: center;
      justify-content: center;
      overflow: hidden;
      flex-shrink: 0;
    }
    .photo-box img { width: 100%; height: 100%; object-fit: cover; }
    .search-icon { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--primary-color); opacity: 0.5; }

    .info-area {
      flex: 1;
      display: flex;
      flex-direction: column;
      justify-content: flex-end;
    }

    .role-header {
      font-size: 10px;
      font-weight: 900;
      color: var(--text-darker);
      text-transform: uppercase;
      margin-bottom: 4px;
      display: flex;
      align-items: center;
      gap: 4px;
    }
    .role-header .c-nome { color: var(--primary-color); font-size: 10px; }
    .role-header .c-partido { font-weight: normal; font-size: 8px; color: #555; }

    .action-row {
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .digit-container { display: flex; gap: 4px; position: relative; }

    .digit-box {
      width: 34px;
      height: 42px;
      background: var(--digit-bg);
      border-radius: 4px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 26px;
      font-weight: 900;
      color: var(--digit-cor);
      transition: background-color 0.1s;
    }

    .box-destaque { color: var(--digit-cor-destaque); background: var(--digit-bg-destaque); }

    .digit-box.current {
      background: var(--digit-bg-current);
      border: 2px solid var(--amarelo-vivo);
    }

    .hidden-input {
      position: absolute;
      top: 0; left: 0; width: 100%; height: 100%;
      opacity: 0; cursor: pointer; z-index: 10;
    }

    .btn-confirma {
      background: #16a34a;
      color: #fff;
      font-size: 10px;
      font-weight: 900;
      padding: 4px 10px;
      border-radius: 12px;
      letter-spacing: 0.5px;
    }

    .footer-santinho {
      text-align: center;
      font-size: 9px;
      color: var(--text-cinza-medio);
      padding-bottom: 5px;
      background: var(--bg-light);
    }

    .bottom-bar {
      width: 100%;
      margin-top: auto;
      flex-shrink: 0;
    }
    .bottom-bar img { width: 100%; height: auto; display: block; }

    .badge {
      position: absolute;
      bottom: 70px;
      right: 8px;
      width: 110px; 
      height: 110px;
      z-index: 20;
    }
    .badge img {
      width: 100%;
      height: 100%;
      object-fit: contain;
    }

    .btn-acao {
      width: 100%; padding: 15px; border-radius: 8px;
      font-size: 14px; font-weight: 900; cursor: pointer;
      margin-bottom: 10px; text-align: center; border: none;
      text-transform: uppercase; transition: transform 0.1s;
    }
    .btn-acao:active { transform: scale(0.98); }
    .btn-primary { background: var(--btn-acao-primary-bg); color: var(--btn-acao-primary-cor); }
    .btn-secondary { background: var(--btn-acao-secondary-bg); border: 2px solid var(--btn-acao-secondary-borda); color: var(--btn-acao-secondary-cor); }
