:root {
  color-scheme: light;
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --surface-3: #e5e7eb;
  --text: #0f172a;
  --muted: #64748b;
  --line: rgba(148, 163, 184, 0.32);
  --green: #16a34a;
  --green-2: #22c55e;
  --blue: #2563eb;
  --orange: #f97316;
  --purple: #8b5cf6;
  --danger: #ef4444;
  --shadow: 0 22px 50px rgba(15, 23, 42, 0.12);
  --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.08);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --container: 1320px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #07111f;
  --surface: #0f172a;
  --surface-2: #111c2f;
  --surface-3: #1e293b;
  --text: #f8fafc;
  --muted: #a7b2c6;
  --line: rgba(148, 163, 184, 0.22);
  --shadow: 0 22px 50px rgba(0, 0, 0, 0.32);
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.2);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 12% 10%, rgba(34, 197, 94, 0.08), transparent 32%),
    radial-gradient(circle at 72% 3%, rgba(37, 99, 235, 0.08), transparent 34%),
    var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.45;
}

button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

.container {
  width: min(var(--container), calc(100% - 48px));
  margin: 0 auto;
}

.skip-link {
  position: absolute;
  top: -120px;
  left: 18px;
  z-index: 100;
  background: var(--text);
  color: var(--bg);
  padding: 10px 14px;
  border-radius: 10px;
  transition: top .2s ease;
}
.skip-link:focus { top: 18px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}
.header-shell {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
}
.brand img { width: 154px; height: auto; }
.desktop-nav {
  display: flex;
  align-items: center;
  gap: 38px;
  font-weight: 700;
  color: var(--muted);
  font-size: 15px;
}
.desktop-nav a {
  position: relative;
  padding: 28px 0 26px;
}
.desktop-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  border-radius: 99px 99px 0 0;
  transform: scaleX(0);
  background: var(--green);
  transition: transform .2s ease;
}
.desktop-nav a:hover, .desktop-nav a.active { color: var(--green); }
.desktop-nav a:hover::after, .desktop-nav a.active::after { transform: scaleX(1); }
.header-actions { display: flex; align-items: center; gap: 14px; }
.theme-button,
.menu-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  width: 42px;
  height: 42px;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
}
.theme-button span { display: inline-block; transform: translateY(-1px); }
.primary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 12px;
  font-weight: 850;
  cursor: pointer;
  min-height: 46px;
  padding: 0 22px;
  transition: transform .16s ease, box-shadow .16s ease, opacity .16s ease;
}
.primary-button {
  color: white;
  background: linear-gradient(180deg, var(--green-2), var(--green));
  box-shadow: 0 12px 26px rgba(22, 163, 74, .28), inset 0 1px 0 rgba(255,255,255,.32);
}
.primary-button.large { min-height: 54px; padding: 0 28px; }
.ghost-button {
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  color: var(--text);
}
.primary-button:hover,
.ghost-button:hover { transform: translateY(-2px); }
.primary-button:active,
.ghost-button:active { transform: translateY(0); }
.menu-button {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  border-radius: 12px;
}
.menu-button span {
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}
.mobile-menu {
  display: none;
  width: min(680px, calc(100% - 32px));
  margin: 0 auto 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}
.mobile-menu[hidden] { display: none !important; }
.mobile-menu a {
  display: block;
  padding: 14px 18px;
  font-weight: 800;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.mobile-menu a:last-child { border-bottom: 0; }

.hero-section { padding: 34px 0 10px; }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(360px, 1.05fr) minmax(340px, .95fr);
  align-items: center;
  gap: 20px;
}
.hero-copy {
  display: grid;
  grid-template-columns: 9px 1fr;
  gap: 30px;
  align-items: stretch;
  min-height: 230px;
}
.accent-line {
  width: 9px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--green-2), var(--green));
  box-shadow: 0 10px 30px rgba(22, 163, 74, .25);
}
.eyebrow {
  display: inline-flex;
  margin: 0 0 6px;
  color: var(--green);
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: 12px;
}
h1 {
  margin: 0;
  max-width: 700px;
  font-size: clamp(42px, 6vw, 76px);
  line-height: .98;
  letter-spacing: -0.06em;
}
.hero-subtitle {
  margin: 18px 0 0;
  max-width: 620px;
  color: var(--muted);
  font-size: clamp(17px, 2.1vw, 22px);
  font-weight: 550;
}
.hero-cta-row { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 28px; }
.hero-art {
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: var(--radius-xl);
}
.hero-art img {
  width: min(760px, 100%);
  filter: drop-shadow(0 20px 30px rgba(37, 99, 235, .1));
}

.main-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(360px, .7fr);
  gap: 28px;
  align-items: start;
  padding-top: 18px;
}
.left-column { min-width: 0; }
.right-column { display: grid; gap: 20px; position: sticky; top: 98px; }

.voting-machine {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(330px, .84fr);
  gap: 26px;
  padding: 28px;
  border: 1px solid color-mix(in srgb, var(--line) 80%, white 20%);
  border-radius: 32px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.64), rgba(255,255,255,.18)),
    linear-gradient(180deg, var(--surface), var(--surface-2));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.78);
}
[data-theme="dark"] .voting-machine {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  box-shadow: var(--shadow);
}
.machine-screen {
  border: 2px solid color-mix(in srgb, #94a3b8 55%, transparent);
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(180deg, #f8fafc, #ffffff);
  color: #0f172a;
  min-height: 360px;
  box-shadow: inset 0 2px 10px rgba(15, 23, 42, .13);
}
.screen-topline {
  text-align: center;
  border-bottom: 1px solid #cbd5e1;
  background: linear-gradient(180deg, #f3f4f6, #e5e7eb);
  position: relative;
  padding: 13px 12px 12px;
}
.screen-topline::after {
  content: "";
  position: absolute;
  height: 7px;
  width: 58%;
  left: 0;
  bottom: -4px;
  background: var(--green);
  border-radius: 0 99px 99px 0;
}
.screen-topline span {
  display: block;
  font-size: 13px;
  font-weight: 850;
  letter-spacing: .02em;
}
.screen-topline strong {
  display: block;
  margin-top: 1px;
  font-size: clamp(23px, 2.4vw, 32px);
  line-height: 1;
  letter-spacing: -0.02em;
}
.screen-body {
  display: grid;
  grid-template-columns: minmax(132px, 38%) 1fr;
  gap: 24px;
  padding: 40px 28px 25px;
  align-items: center;
}
.candidate-photo {
  aspect-ratio: 1 / 1.18;
  min-width: 128px;
  border-radius: 18px;
  background: linear-gradient(180deg, #f3f4f6, #d1d5db);
  display: grid;
  place-items: center;
  border: 1px solid #e5e7eb;
  overflow: hidden;
}
.candidate-photo span,
.candidate-photo span::before {
  display: block;
  content: "";
  background: #9ca3af;
}
.candidate-photo span {
  width: 68%;
  height: 38%;
  border-radius: 50% 50% 10% 10%;
  position: relative;
  transform: translateY(40%);
}
.candidate-photo span::before {
  position: absolute;
  width: 55%;
  aspect-ratio: 1;
  border-radius: 50%;
  left: 50%;
  top: -70%;
  transform: translateX(-50%);
}
.candidate-photo.has-image {
  background: white;
  border-color: #dbeafe;
}
.candidate-photo.has-image img { width: 100%; height: 100%; object-fit: cover; }
.candidate-info { display: grid; gap: 10px; }
.info-block span {
  display: block;
  font-size: 12px;
  font-weight: 950;
  color: #334155;
}
.info-block strong {
  display: block;
  margin-top: 1px;
  font-size: clamp(18px, 2.2vw, 26px);
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.info-block .typed-number {
  color: var(--green);
  font-size: clamp(38px, 4vw, 56px);
  line-height: .96;
}
.screen-help {
  margin: 0;
  background: #f3f4f6;
  border-top: 1px solid #e5e7eb;
  padding: 12px 16px;
  text-align: center;
  color: #374151;
  font-size: 14px;
  font-weight: 650;
}
.screen-help.success { color: #166534; }
.screen-help.warning { color: #9a3412; }
.screen-help.error { color: #b91c1c; }
.screen-body.locked-vote {
  grid-template-columns: minmax(132px, 38%) 1fr;
  align-items: center;
  padding-top: 28px;
}
.vote-thanks {
  grid-column: 1 / -1;
  justify-self: center;
  width: min(100%, 430px);
  margin-bottom: 2px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(22, 163, 74, .12);
  border: 1px solid rgba(22, 163, 74, .22);
  color: #166534;
  font-size: clamp(15px, 2vw, 20px);
  font-weight: 950;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: .045em;
}
.screen-body.fim-mode {
  grid-template-columns: 1fr;
  min-height: 288px;
  place-items: center;
  padding: 42px 18px;
}
.end-text {
  font-size: clamp(68px, 10vw, 128px);
  font-weight: 950;
  letter-spacing: .15em;
  color: #0f172a;
  animation: popIn .35s ease both;
}
@keyframes popIn { from { transform: scale(.94); opacity: .3; } to { transform: scale(1); opacity: 1; } }

.machine-keypad {
  background:
    radial-gradient(circle at 35% 10%, rgba(255,255,255,.13), transparent 24%),
    linear-gradient(180deg, #252a31, #0c1117);
  border-radius: 22px;
  padding: 24px;
  display: grid;
  grid-template-columns: repeat(3, minmax(74px, 1fr));
  gap: 14px;
  align-content: center;
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 16px 26px rgba(0,0,0,.26);
  min-height: 360px;
}
.machine-keypad button {
  border: 0;
  min-height: 54px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 900;
  transition: transform .08s ease, box-shadow .08s ease, filter .12s ease;
  user-select: none;
}
.num-key {
  color: #f8fafc;
  font-size: 25px;
  background: linear-gradient(180deg, #343b45, #171c24);
  box-shadow: 0 7px 0 #070a0f, 0 12px 18px rgba(0,0,0,.44), inset 0 1px 0 rgba(255,255,255,.16);
  text-shadow: 0 2px 0 rgba(0,0,0,.3);
}
.action-key {
  color: #111827;
  font-size: clamp(12px, 1.25vw, 16px);
  min-height: 60px !important;
  box-shadow: 0 7px 0 rgba(0,0,0,.35), 0 12px 18px rgba(0,0,0,.32), inset 0 1px 0 rgba(255,255,255,.38);
}
.action-key::after {
  content: "••••";
  display: block;
  font-size: 10px;
  letter-spacing: 2px;
  opacity: .33;
  margin-top: 1px;
}
.branco { background: linear-gradient(180deg, #ffffff, #dbe1e8); }
.corrige { background: linear-gradient(180deg, #fbbf24, #f97316); }
.confirma { background: linear-gradient(180deg, #34d46d, #16a34a); color: #052e16; }
.machine-keypad button:hover { filter: brightness(1.04); }
.machine-keypad button:active {
  transform: translateY(5px);
  box-shadow: 0 2px 0 rgba(0,0,0,.38), 0 7px 12px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.18);
}

.machine-keypad.is-locked {
  position: relative;
}
.machine-keypad.is-locked::after {
  content: "VOTO REGISTRADO";
  position: absolute;
  inset: auto 14px 14px 14px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, .82);
  color: #dcfce7;
  text-align: center;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .08em;
  pointer-events: none;
}
.machine-keypad button:disabled,
.machine-keypad button[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: .46;
  filter: grayscale(.22);
  transform: none !important;
  box-shadow: 0 4px 0 rgba(0,0,0,.28), 0 8px 12px rgba(0,0,0,.24), inset 0 1px 0 rgba(255,255,255,.16);
}

.results-card,
.share-card,
.info-card,
.disclaimer-card {
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}
.results-card,
.share-card { padding: 24px; }
.card-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.results-card h2,
.share-card h2 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.035em;
}
.results-card p,
.share-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-weight: 650;
}
.results-card p strong { color: var(--blue); }
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  color: var(--green);
  font-weight: 900;
  margin-top: 4px;
}
.live-badge i {
  display: block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green-2);
  box-shadow: 0 0 0 6px rgba(34,197,94,.12);
}
.results-list { display: grid; gap: 18px; }
.result-row {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 14px;
  align-items: center;
}
.result-row img {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-2);
  box-shadow: 0 0 0 4px var(--surface-2);
}
.result-name {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-weight: 900;
  font-size: 17px;
}
.result-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--bar) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--bar) 28%, transparent);
  color: var(--bar, var(--green));
  font-size: 13px;
  font-weight: 950;
  line-height: 1;
}
.result-party { color: var(--muted); font-size: 13px; font-weight: 750; }
.progress-track {
  height: 9px;
  background: var(--surface-2);
  border-radius: 999px;
  margin-top: 8px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: var(--w, 0%);
  background: var(--bar, var(--green));
  border-radius: inherit;
  transition: width .35s ease;
}
.result-percent {
  text-align: right;
  font-weight: 950;
  font-size: 28px;
  line-height: 1;
  color: var(--bar, var(--green));
}
.result-votes {
  color: var(--muted);
  font-weight: 650;
  margin-top: 4px;
  white-space: nowrap;
}
.full-results {
  width: 100%;
  margin-top: 20px;
  min-height: 46px;
  border: 0;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 900;
  cursor: pointer;
}

.trust-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 20px;
}
.info-card {
  padding: 20px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.info-card h3 { margin: 0 0 8px; font-size: 17px; letter-spacing: -.02em; }
.info-card p { margin: 0; color: var(--muted); font-size: 14px; font-weight: 620; }
.info-card ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; color: var(--muted); font-size: 14px; font-weight: 680; }
.info-card li::before { content: "✓"; color: var(--green); font-weight: 950; margin-right: 7px; }
.icon-pill {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 23px;
  font-weight: 900;
}
.icon-pill.shield { color: var(--green); background: rgba(34,197,94,.12); }
.icon-pill.people { color: var(--blue); background: rgba(37,99,235,.1); }
.icon-pill.chart { color: var(--purple); background: rgba(139,92,246,.12); }

.share-buttons {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-top: 20px;
}
.share {
  min-height: 54px;
  border: 0;
  border-radius: 13px;
  color: white;
  font-size: 25px;
  font-weight: 950;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}
.whatsapp { background: #19b65a; }
.facebook { background: #2563ab; font-family: Georgia, serif; font-size: 30px; }
.x { background: #050505; }
.linkedin { background: #0a76b7; font-size: 20px; }
.link { background: #e5e7eb; color: #111827; }
.copy-field {
  margin-top: 16px;
  width: 100%;
  border: 0;
  min-height: 48px;
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(34,197,94,.1), rgba(34,197,94,.05));
  color: var(--green);
  font-weight: 950;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  cursor: pointer;
}
.copy-field strong { margin-left: auto; margin-right: 14px; }
.copy-field span { margin-left: auto; }

.disclaimer-card {
  margin-top: 28px;
  margin-bottom: 38px;
  padding: 24px;
  text-align: center;
  background: linear-gradient(180deg, rgba(37,99,235,.09), rgba(37,99,235,.04));
}
.info-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: -6px auto 8px;
  border: 2px solid var(--blue);
  color: var(--blue);
  font-weight: 950;
}
.disclaimer-card p { margin: 4px auto; max-width: 980px; color: var(--muted); }
.disclaimer-card p strong { color: var(--text); font-size: 18px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(28px);
  opacity: 0;
  pointer-events: none;
  background: #0f172a;
  color: #fff;
  padding: 13px 18px;
  border-radius: 999px;
  font-weight: 850;
  box-shadow: 0 18px 36px rgba(0,0,0,.28);
  transition: opacity .2s ease, transform .2s ease;
  z-index: 100;
  max-width: calc(100% - 32px);
  text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 1180px) {
  .main-layout { grid-template-columns: 1fr; }
  .right-column { position: static; grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  .container { width: min(100% - 28px, var(--container)); }
  .desktop-nav, .theme-button { display: none; }
  .menu-button { display: flex; }

  /* No mobile, as opções ficam fechadas dentro do botão de menu. */
  .site-header { overflow: visible; }
  .mobile-menu {
    display: block;
    position: absolute;
    top: calc(100% + 8px);
    right: 14px;
    width: min(310px, calc(100% - 28px));
    margin: 0;
    z-index: 80;
    border-radius: 18px;
  }
  .mobile-menu a { padding: 16px 18px; }

  .brand img { width: 132px; }
  .header-shell { min-height: 72px; }
  .primary-button { min-height: 44px; padding: 0 16px; font-size: 14px; }
  .hero-grid { grid-template-columns: 1fr; gap: 10px; }
  .hero-copy { grid-template-columns: 7px 1fr; gap: 18px; min-height: 0; }
  .hero-art { min-height: 150px; margin-top: -18px; }
  .hero-art img { width: 108%; }
  .hero-cta-row { display: none; }

  /* Ordem mobile solicitada: título + PNG, candidatos/resultados, urna, cards, compartilhar. */
  .main-layout {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding-top: 8px;
  }
  .left-column,
  .right-column {
    display: contents;
    min-width: 0;
    position: static;
  }
  .results-card { order: 1; }
  .voting-machine { order: 2; }
  .trust-grid { order: 3; }
  .share-card { order: 4; }

  .voting-machine { grid-template-columns: minmax(0, 1fr) minmax(230px, .82fr); gap: 12px; padding: 16px; border-radius: 22px; }
  .machine-screen { min-height: 285px; border-radius: 14px; }
  .screen-topline { padding: 10px 8px; }
  .screen-topline span { font-size: 11px; }
  .screen-topline strong { font-size: 21px; }
  .screen-body { gap: 12px; padding: 32px 12px 18px; grid-template-columns: minmax(98px, 38%) 1fr; }
  .candidate-photo { min-width: 96px; border-radius: 13px; }
  .info-block span { font-size: 10px; }
  .info-block strong { font-size: 16px; }
  .info-block .typed-number { font-size: 36px; }
  .screen-help { padding: 9px 8px; font-size: 12px; }
  .machine-keypad { min-height: 285px; grid-template-columns: repeat(3, minmax(48px, 1fr)); gap: 10px; padding: 14px; border-radius: 16px; }
  .machine-keypad button { min-height: 42px; border-radius: 9px; }
  .num-key { font-size: 20px; box-shadow: 0 5px 0 #070a0f, 0 8px 12px rgba(0,0,0,.36); }
  .action-key { min-height: 48px !important; font-size: 11px; }
  .trust-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 0; }
  .info-card { padding: 14px; flex-direction: column; gap: 9px; }
  .icon-pill { width: 38px; height: 38px; border-radius: 12px; font-size: 18px; }
}

@media (max-width: 640px) {
  body { font-size: 15px; }
  .container { width: min(100% - 20px, var(--container)); }
  .header-actions { gap: 8px; }
  .site-header { border-bottom-color: rgba(148,163,184,.22); }
  .hero-section { padding-top: 20px; }
  .hero-art { margin-top: -8px; }
  h1 { font-size: clamp(36px, 10vw, 48px); letter-spacing: -0.055em; }
  .hero-subtitle { font-size: 16px; margin-top: 12px; }
  .eyebrow { display: none; }
  .main-layout { padding-top: 8px; gap: 18px; }
  .voting-machine { grid-template-columns: 1.02fr .98fr; gap: 8px; padding: 10px; border-radius: 20px; }
  .machine-screen { min-height: 238px; }
  .screen-topline::after { width: 70%; height: 5px; }
  .screen-topline strong { font-size: 16px; }
  .screen-body { grid-template-columns: 80px 1fr; gap: 9px; padding: 24px 9px 12px; }
  .candidate-photo { min-width: 76px; border-radius: 12px; }
  .candidate-info { gap: 5px; }
  .info-block span { font-size: 8.5px; }
  .info-block strong { font-size: 13px; }
  .info-block .typed-number { font-size: 28px; }
  .screen-help { font-size: 10px; }
  .machine-keypad { min-height: 238px; gap: 8px; padding: 10px; }
  .machine-keypad button { min-height: 34px; }
  .num-key { font-size: 16px; }
  .action-key { min-height: 38px !important; font-size: 9px; border-radius: 8px; }
  .action-key::after { content: ""; }
  .results-card, .share-card { padding: 16px; border-radius: 18px; }
  .results-card h2, .share-card h2 { font-size: 20px; }
  .result-row { grid-template-columns: 44px 1fr auto; gap: 11px; }
  .result-row img { width: 44px; height: 44px; }
  .result-name { font-size: 15px; }
  .result-percent { font-size: 23px; }
  .result-votes { font-size: 13px; }
  .trust-grid { grid-template-columns: 1fr; }
  .info-card { flex-direction: row; }
  .share { min-height: 46px; font-size: 22px; }
  .disclaimer-card { padding: 18px; margin-bottom: 22px; }
  .disclaimer-card p strong { font-size: 15px; }
}

@media (max-width: 430px) {
  .brand img { width: 122px; }
  .primary-button { font-size: 13px; padding: 0 12px; }
  .hero-art { min-height: 115px; }
  .voting-machine { grid-template-columns: 1fr; }
  .machine-keypad { min-height: 0; grid-template-columns: repeat(3, 1fr); }
  .machine-keypad button { min-height: 43px; }
  .action-key { min-height: 48px !important; font-size: 10px; }
  .screen-body { grid-template-columns: 92px 1fr; }
  .candidate-photo { min-width: 88px; }
}

/* ============================================================
   PATCH MOBILE — urna mais larga e respirando melhor
   Motivo: em telas pequenas a urna estava ficando estreita,
   principalmente por causa do layout em colunas. Agora, no
   mobile, a urna ocupa praticamente toda a largura útil da tela
   e empilha tela + teclado em uma coluna larga.
   ============================================================ */

@media (max-width: 900px) {
  .main-layout {
    align-items: stretch;
    overflow-x: visible;
  }

  .voting-machine,
  .results-card,
  .trust-grid,
  .share-card {
    width: 100%;
    max-width: 100%;
    align-self: stretch;
  }
}

@media (max-width: 640px) {
  .voting-machine {
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100vw - 20px);
    max-width: 560px;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px;
    border-radius: 22px;
    overflow: visible;
  }

  .machine-screen,
  .machine-keypad {
    width: 100%;
    min-width: 0;
  }

  .machine-screen {
    min-height: 300px;
  }

  .screen-topline {
    padding: 12px 10px;
  }

  .screen-topline strong {
    font-size: 22px;
  }

  .screen-body {
    grid-template-columns: minmax(104px, 34%) minmax(0, 1fr);
    gap: 14px;
    padding: 30px 14px 16px;
  }

  .candidate-photo {
    min-width: 0;
    width: 100%;
    max-width: 126px;
    justify-self: center;
  }

  .candidate-info {
    min-width: 0;
  }

  .info-block strong {
    overflow-wrap: anywhere;
  }

  .screen-help {
    font-size: 12px;
    padding: 10px 8px;
  }

  .machine-keypad {
    min-height: 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 14px;
    border-radius: 18px;
  }

  .machine-keypad button {
    min-height: 52px;
  }

  .num-key {
    font-size: 22px;
  }

  .action-key {
    min-height: 56px !important;
    font-size: 11px;
    border-radius: 10px;
  }

  .action-key::after {
    content: "••";
    display: block;
    font-size: 8px;
    letter-spacing: 2px;
    opacity: .28;
    margin-top: 1px;
  }
}

@media (max-width: 430px) {
  .voting-machine {
    width: calc(100vw - 16px);
    padding: 12px;
  }

  .machine-screen {
    min-height: 292px;
  }

  .screen-body {
    grid-template-columns: minmax(96px, 34%) minmax(0, 1fr);
    gap: 12px;
    padding: 28px 12px 14px;
  }

  .candidate-photo {
    max-width: 112px;
  }

  .info-block span {
    font-size: 9px;
  }

  .info-block strong {
    font-size: 14px;
  }

  .info-block .typed-number {
    font-size: 30px;
  }

  .machine-keypad {
    padding: 12px;
    gap: 10px;
  }

  .machine-keypad button {
    min-height: 50px;
  }

  .action-key {
    min-height: 54px !important;
    font-size: 10.5px;
  }
}

@media (max-width: 360px) {
  .voting-machine {
    width: calc(100vw - 12px);
    padding: 10px;
  }

  .screen-body {
    grid-template-columns: 86px minmax(0, 1fr);
    gap: 10px;
    padding-inline: 10px;
  }

  .candidate-photo {
    max-width: 96px;
  }

  .machine-keypad {
    padding: 10px;
    gap: 8px;
  }

  .machine-keypad button {
    min-height: 46px;
  }

  .action-key {
    min-height: 50px !important;
    font-size: 9.5px;
  }
}

@media (max-width: 640px) {
  .screen-body.locked-vote {
    grid-template-columns: minmax(104px, 34%) minmax(0, 1fr);
    padding-top: 22px;
  }
  .vote-thanks {
    padding: 8px 10px;
    font-size: 13px;
    letter-spacing: .035em;
  }
  .machine-keypad.is-locked::after {
    inset: auto 12px 12px 12px;
    font-size: 10px;
    padding: 7px 8px;
  }
  .result-name { gap: 6px; }
  .result-number {
    min-width: 30px;
    height: 21px;
    padding: 0 7px;
    font-size: 12px;
  }
}

@media (max-width: 430px) {
  .screen-body.locked-vote {
    grid-template-columns: minmax(96px, 34%) minmax(0, 1fr);
  }
  .vote-thanks {
    font-size: 12px;
  }
}

/* ============================================================
   PATCH AUTH GOOGLE + MOBILE MENU 3 PONTOS
   ============================================================ */

.menu-button {
  flex-direction: column;
  gap: 4px;
}
.menu-button span {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: currentColor;
}

.mobile-login {
  width: calc(100% - 28px);
  margin: 12px 14px 14px;
  min-height: 46px;
  border: 0;
  border-radius: 12px;
  color: white;
  background: linear-gradient(180deg, var(--green-2), var(--green));
  font-weight: 900;
  cursor: pointer;
}

.primary-button.is-authenticated,
.mobile-login.is-authenticated {
  background: linear-gradient(180deg, #38bdf8, #2563eb);
  box-shadow: 0 12px 26px rgba(37, 99, 235, .22), inset 0 1px 0 rgba(255,255,255,.28);
}

body.modal-open {
  overflow: hidden;
}

.login-modal[hidden] {
  display: none !important;
}

.login-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 22px;
}

.login-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .58);
  backdrop-filter: blur(8px);
}

.login-dialog {
  position: relative;
  z-index: 1;
  width: min(430px, 100%);
  border-radius: 28px;
  background: color-mix(in srgb, var(--surface) 98%, transparent);
  border: 1px solid var(--line);
  box-shadow: 0 28px 70px rgba(0, 0, 0, .28);
  padding: 32px 26px 26px;
  text-align: center;
  animation: loginPop .2s ease both;
}

@keyframes loginPop {
  from { transform: translateY(10px) scale(.98); opacity: .35; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.login-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  font-size: 25px;
  line-height: 1;
}

.login-icon {
  width: 58px;
  height: 58px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  color: white;
  font-size: 28px;
  font-weight: 950;
  background: linear-gradient(180deg, var(--green-2), var(--green));
  box-shadow: 0 16px 30px rgba(22, 163, 74, .28);
}

.login-dialog h2 {
  margin: 0;
  font-size: clamp(26px, 5vw, 34px);
  letter-spacing: -.04em;
}

.login-dialog p {
  margin: 10px auto 0;
  color: var(--muted);
  font-weight: 650;
  max-width: 330px;
}

.google-button-box {
  min-height: 52px;
  display: grid;
  place-items: center;
  margin: 24px auto 0;
}

.google-button-box.needs-config {
  padding: 14px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--orange) 12%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--orange) 25%, transparent);
}

.google-button-box.needs-config p {
  margin: 0;
  color: #9a3412;
  font-weight: 800;
  max-width: 320px;
}

.login-note {
  min-height: 22px;
  font-size: 13px;
}

@media (max-width: 640px) {
  .login-modal {
    align-items: end;
    padding: 14px;
  }

  .login-dialog {
    width: 100%;
    border-radius: 24px;
    padding: 30px 18px 22px;
  }
}
