/* Votaciones de renders — Robson Jacobsen
   Colores y tipografía salen de Marca/05-Tokens/tokens.css.
   Reglas de marca aplicadas: negro de fondo, azul solo en lo que se pulsa,
   oro solo en cifras y datos, Archivo en titulares e Inter en texto,
   ángulos rectos, sin sombras. Botón: azul + blanco, Archivo 700 ≥18px, esquina 4px. */

@font-face { font-family: "Archivo"; font-weight: 700; font-style: normal; font-display: swap; src: url("/fonts/archivo-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Archivo"; font-weight: 800; font-style: normal; font-display: swap; src: url("/fonts/archivo-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 400; font-style: normal; font-display: swap; src: url("/fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-style: normal; font-display: swap; src: url("/fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-style: normal; font-display: swap; src: url("/fonts/inter-latin-600-normal.woff2") format("woff2"); }

:root {
  --negro: #000000;
  --azul: #0080E0;
  --azul-700: #005DA3;
  --azul-800: #004070;
  --azul-900: #002947;
  --azul-400: #2EA2FA;
  --azul-300: #76C1F9;
  --oro: #C7A440;
  --oro-400: #DABF72;
  --oro-300: #EBDBAD;
  --oro-800: #67541E;
  --blanco: #FFFFFF;
  --navy: #1A2E5C;
  --navy-900: #0D1830;
  --navy-700: #142448;
  --navy-400: #2D4680;
  --g900: #151619;
  --g800: #23252A;
  --g700: #383B42;
  --g600: #51545D;
  --g500: #737882;
  --g400: #9EA1A9;
  --g300: #C4C6CA;
  --g200: #E4E5E7;

  --font-titulo: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --font-texto: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;

  --radio-boton: 4px;
  --gutter: 16px;
  --topbar: 64px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --t-fast: 140ms;
  --t-med: 240ms;
}

@media (min-width: 720px) { :root { --gutter: 32px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--negro);
  color: var(--blanco);
  font-family: var(--font-texto);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  min-height: 100dvh;
}
img { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--azul-400); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--azul-400); outline-offset: 2px; }
::selection { background: var(--azul-700); color: var(--blanco); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

h1, h2, h3, h4 { font-family: var(--font-titulo); font-weight: 800; letter-spacing: -0.02em; line-height: 1.12; margin: 0; }
h1 { font-size: 31px; }
h2 { font-size: 25px; }
h3 { font-size: 20px; font-weight: 700; }
@media (min-width: 720px) { h1 { font-size: 39px; } h2 { font-size: 31px; } }
p { margin: 0; }
.muted { color: var(--g400); }
.dato { color: var(--oro); font-family: var(--font-titulo); font-weight: 800; font-variant-numeric: tabular-nums; }
.eyebrow { font-family: var(--font-texto); font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--g400); }

/* ---------- carga inicial ---------- */
.boot-loader { display: flex; gap: 8px; justify-content: center; align-items: center; min-height: 60vh; }
.boot-loader span { width: 12px; height: 12px; background: var(--g700); animation: pulse 900ms var(--ease) infinite; }
.boot-loader span:nth-child(2) { animation-delay: 150ms; }
.boot-loader span:nth-child(3) { animation-delay: 300ms; }
@keyframes pulse { 0%, 100% { background: var(--g700); transform: scaleY(1); } 50% { background: var(--oro); transform: scaleY(1.6); } }
.noscript { padding: 24px; text-align: center; }

/* ---------- botones ---------- */
.btn {
  --btn-bg: transparent;
  --btn-fg: var(--blanco);
  --btn-bd: var(--g700);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 12px 22px;
  border: 1px solid var(--btn-bd); border-radius: var(--radio-boton);
  background: var(--btn-bg); color: var(--btn-fg);
  font-family: var(--font-titulo); font-weight: 700; font-size: 18px; line-height: 1.1; letter-spacing: -0.005em;
  text-decoration: none; white-space: nowrap; user-select: none;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.btn:hover { text-decoration: none; border-color: var(--g500); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn--primary { --btn-bg: var(--azul); --btn-bd: var(--azul); --btn-fg: var(--blanco); }
.btn--primary:hover { --btn-bg: var(--azul-700); --btn-bd: var(--azul-700); }
.btn--block { width: 100%; }
.btn--lg { min-height: 56px; font-size: 20px; padding: 14px 28px; }
/* Botón pequeño: por debajo de 18px el blanco necesita el azul oscuro (regla de marca). */
.btn--sm { min-height: 38px; padding: 8px 14px; font-family: var(--font-texto); font-weight: 600; font-size: 14px; gap: 8px; }
.btn--sm svg { width: 16px; height: 16px; }
.btn--sm.btn--primary { --btn-bg: var(--azul-700); --btn-bd: var(--azul-700); }
.btn--sm.btn--primary:hover { --btn-bg: var(--azul-800); --btn-bd: var(--azul-800); }
.btn--quiet { --btn-bd: transparent; }
.btn--quiet:hover { --btn-bg: var(--g900); border-color: var(--g800); }
.btn--icon { width: 44px; min-height: 44px; padding: 0; }
.btn--icon.btn--sm { width: 38px; min-height: 38px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .42; cursor: not-allowed; transform: none; }
.btn--whatsapp { --btn-bg: #25D366; --btn-bd: #25D366; --btn-fg: #000000; }
.btn--whatsapp:hover { --btn-bg: #1EBE5A; --btn-bd: #1EBE5A; }
.btn .spinner { width: 18px; height: 18px; }

.spinner { display: inline-grid; grid-template-columns: repeat(2, 1fr); gap: 2px; width: 16px; height: 16px; }
.spinner i { background: currentColor; animation: spin-sq 800ms steps(1) infinite; opacity: .25; }
.spinner i:nth-child(1) { animation-delay: 0ms; } .spinner i:nth-child(2) { animation-delay: 200ms; }
.spinner i:nth-child(4) { animation-delay: 400ms; } .spinner i:nth-child(3) { animation-delay: 600ms; }
@keyframes spin-sq { 0%, 24% { opacity: 1; } 25%, 100% { opacity: .25; } }

/* ---------- formularios ---------- */
.field { display: grid; gap: 8px; }
.label { font-weight: 600; font-size: 14px; color: var(--g200); }
.hint { font-size: 13px; color: var(--g400); line-height: 1.5; }
.input, .textarea {
  width: 100%; min-height: 48px; padding: 12px 14px;
  background: var(--g900); border: 1px solid var(--g700); border-radius: var(--radio-boton);
  color: var(--blanco); font-size: 16px; line-height: 1.4;
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--g500); }
.input:hover, .textarea:hover { border-color: var(--g600); }
.input:focus, .textarea:focus { outline: none; border-color: var(--azul); background: #0b0c0e; }
.textarea { min-height: 110px; resize: vertical; }
.input--title {
  font-family: var(--font-titulo); font-weight: 800; letter-spacing: -0.02em; font-size: 28px;
  background: transparent; border-color: transparent; padding: 4px 8px; margin-left: -9px; min-height: 0;
}
.input--title:hover { border-color: var(--g800); background: transparent; }
.input--title:focus { background: var(--g900); }
@media (min-width: 720px) { .input--title { font-size: 34px; } }
.field-error { color: var(--oro-400); font-size: 14px; display: flex; gap: 8px; align-items: flex-start; }
.field-error::before { content: ""; width: 8px; height: 8px; background: var(--oro); margin-top: 7px; flex: none; }

/* Control segmentado */
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border: 1px solid var(--g700); border-radius: var(--radio-boton); overflow: hidden; }
.segmented button {
  background: transparent; border: 0; border-right: 1px solid var(--g700); padding: 11px 12px; min-height: 46px;
  font-weight: 600; font-size: 14px; color: var(--g300);
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.segmented button:last-child { border-right: 0; }
.segmented button:hover { background: var(--g900); color: var(--blanco); }
.segmented button[aria-pressed="true"] { background: var(--azul-700); color: var(--blanco); }
.segmented button[disabled] { cursor: not-allowed; opacity: .5; }

/* Tarjetas de elección (radio) */
.choices { display: grid; gap: 10px; }
.choice {
  display: grid; grid-template-columns: 22px 1fr; gap: 14px; align-items: start; text-align: left;
  padding: 16px; background: transparent; border: 1px solid var(--g700); border-radius: 0;
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.choice:hover { border-color: var(--g500); }
.choice[aria-checked="true"] { border-color: var(--azul); background: rgba(0, 128, 224, .07); }
.choice__mark { width: 22px; height: 22px; border: 2px solid var(--g500); display: grid; place-items: center; margin-top: 1px; }
.choice[aria-checked="true"] .choice__mark { border-color: var(--azul); }
.choice[aria-checked="true"] .choice__mark::after { content: ""; width: 10px; height: 10px; background: var(--azul); }
.choice__title { font-weight: 600; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.choice__text { font-size: 14px; color: var(--g400); margin-top: 2px; line-height: 1.5; }
.tag { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding: 2px 8px; border: 1px solid var(--g600); color: var(--g300); }
.tag--oro { border-color: var(--oro); color: var(--oro); }

/* Interruptor rectangular */
.switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 4px 0; background: none; border: 0; width: 100%; text-align: left; }
.switch__track { position: relative; width: 48px; height: 26px; border: 1px solid var(--g600); background: var(--g900); flex: none; transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease); }
.switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; background: var(--g400); transition: transform var(--t-med) var(--ease), background var(--t-fast) var(--ease); }
.switch[aria-checked="true"] .switch__track { background: var(--azul-700); border-color: var(--azul-700); }
.switch[aria-checked="true"] .switch__track::after { transform: translateX(22px); background: var(--blanco); }

/* Paso numérico */
.stepper { display: inline-flex; align-items: stretch; border: 1px solid var(--g700); border-radius: var(--radio-boton); }
.stepper button { width: 44px; background: none; border: 0; font-size: 20px; color: var(--g200); }
.stepper button:hover { background: var(--g900); }
.stepper output { min-width: 48px; display: grid; place-items: center; border-left: 1px solid var(--g700); border-right: 1px solid var(--g700); font-family: var(--font-titulo); font-weight: 800; font-size: 18px; color: var(--oro); }

/* ---------- barra superior ---------- */
.topbar { position: sticky; top: 0; z-index: 40; height: var(--topbar); background: rgba(0, 0, 0, .92); backdrop-filter: saturate(140%) blur(10px); border-bottom: 1px solid var(--g800); }
.topbar__inner { height: 100%; max-width: 1240px; margin: 0 auto; padding: 0 var(--gutter); display: flex; align-items: center; gap: 16px; }
.topbar__brand { display: flex; align-items: center; gap: 14px; color: var(--blanco); text-decoration: none; min-width: 0; }
.topbar__brand:hover { text-decoration: none; }
.topbar__brand img { height: 24px; width: auto; }
.topbar__brand .iso { display: none; height: 28px; }
.topbar__sep { width: 1px; height: 22px; background: var(--g700); }
.topbar__app { font-family: var(--font-titulo); font-weight: 700; font-size: 15px; color: var(--g300); letter-spacing: 0; }
.topbar__spacer { flex: 1; }
@media (max-width: 560px) {
  .topbar__brand .logo { display: none; }
  .topbar__brand .iso { display: block; }
}

.container { max-width: 1240px; margin: 0 auto; padding: 0 var(--gutter); }
.page { padding: 32px 0 96px; }
@media (min-width: 720px) { .page { padding: 48px 0 120px; } }
.page-head { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: flex-end; justify-content: space-between; margin-bottom: 32px; }
.page-head p { margin-top: 8px; color: var(--g400); max-width: 60ch; }

/* ---------- tarjetas y bloques ---------- */
.card { background: var(--g900); border: 1px solid var(--g800); padding: 24px; }
.card + .card { margin-top: 16px; }
.settings-grid > .card + .card, .share-grid > .card + .card { margin-top: 0; }
.card__head { display: flex; gap: 12px; align-items: baseline; justify-content: space-between; margin-bottom: 18px; }
.card__head h3 { font-size: 18px; }
.block-navy { background: var(--navy); border: 1px solid var(--navy-400); padding: 20px 24px; }

/* ---------- estado ---------- */
.status { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--g300); white-space: nowrap; }
.status::before { content: ""; width: 9px; height: 9px; background: var(--g500); }
.status--abierta { color: var(--blanco); }
.status--abierta::before { background: var(--oro); animation: blink 1.6s steps(2) infinite; }
.status--cerrada { color: var(--g400); }
.status--cerrada::before { background: var(--g600); }
@keyframes blink { 50% { opacity: .35; } }
.live { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--g300); }
.live::before { content: ""; width: 8px; height: 8px; background: var(--oro); animation: blink 1.2s steps(2) infinite; }

/* ---------- autenticación ---------- */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: 1fr; }
@media (min-width: 960px) { .auth { grid-template-columns: 1.1fr 1fr; } }
.auth__art { display: none; position: relative; overflow: hidden; border-right: 1px solid var(--g800); background: var(--negro); }
@media (min-width: 960px) { .auth__art { display: block; } }
.auth__panel { display: flex; flex-direction: column; justify-content: center; padding: 48px var(--gutter); max-width: 480px; width: 100%; margin: 0 auto; }
.auth__panel .logo { height: 26px; width: auto; margin-bottom: 56px; }
.auth__panel h1 { margin-bottom: 10px; }
.auth__panel form { display: grid; gap: 18px; margin-top: 32px; }
.auth__note { margin-top: 24px; font-size: 13px; color: var(--g500); }

/* Composición modular (único recurso gráfico de la marca) */
.modules { position: absolute; inset: 0; }
.modules span { position: absolute; display: block; }

/* ---------- panel: lista de votaciones ---------- */
.polls-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.poll-card {
  display: flex; flex-direction: column; background: var(--g900); border: 1px solid var(--g800); color: var(--blanco); text-decoration: none;
  transition: border-color var(--t-fast) var(--ease), transform var(--t-med) var(--ease);
}
.poll-card:hover { border-color: var(--g600); text-decoration: none; transform: translateY(-2px); }
.poll-card__cover { aspect-ratio: 16 / 10; display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; gap: 2px; background: var(--g800); overflow: hidden; }
.poll-card__cover img { width: 100%; height: 100%; object-fit: cover; }
.poll-card__cover img:first-child { grid-row: span 2; }
.poll-card__cover.n1 img:first-child { grid-column: span 2; }
.poll-card__cover.n2 img:nth-child(2) { grid-row: span 2; }
.poll-card__empty { grid-column: 1 / -1; grid-row: 1 / -1; display: grid; place-items: center; background: var(--g900); color: var(--g600); }
.poll-card__body { padding: 18px 20px 20px; display: grid; gap: 10px; }
.poll-card__title { font-family: var(--font-titulo); font-weight: 700; font-size: 19px; line-height: 1.25; letter-spacing: -0.01em; }
.poll-card__meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; color: var(--g400); }
.poll-card__meta b { color: var(--oro); font-family: var(--font-titulo); font-weight: 800; }

.empty { display: grid; justify-items: center; text-align: center; gap: 16px; padding: 72px 24px; border: 1px dashed var(--g700); }
.empty h2 { font-size: 25px; }
.empty p { color: var(--g400); max-width: 46ch; }
.empty .module-art { width: 132px; height: 88px; position: relative; margin-bottom: 8px; }

/* ---------- editor ---------- */
.editor-head { border-bottom: 1px solid var(--g800); background: var(--negro); }
.editor-head__inner { max-width: 1240px; margin: 0 auto; padding: 24px var(--gutter) 0; }
.editor-head__top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; justify-content: space-between; }
.editor-head__title { flex: 1 1 360px; min-width: 0; display: grid; gap: 6px; }
.editor-head__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; font-size: 14px; color: var(--g400); }
.editor-head__actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.back { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--g400); margin-bottom: 14px; }
.back:hover { color: var(--blanco); text-decoration: none; }
.back svg { width: 16px; height: 16px; }
.saved { font-size: 13px; color: var(--g500); display: inline-flex; gap: 6px; align-items: center; min-width: 90px; }

.tabs { display: flex; gap: 4px; margin-top: 22px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative; background: none; border: 0; padding: 12px 14px 14px; font-weight: 600; font-size: 15px; color: var(--g400); white-space: nowrap;
  display: inline-flex; align-items: center; gap: 8px;
}
.tab::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: -1px; height: 3px; background: transparent; transition: background var(--t-fast) var(--ease); }
.tab:hover { color: var(--blanco); }
.tab[aria-selected="true"] { color: var(--blanco); }
.tab[aria-selected="true"]::after { background: var(--azul); }
.tab .count { font-family: var(--font-titulo); font-weight: 800; color: var(--oro); font-size: 14px; }

.editor-body { padding: 32px 0 120px; }
.settings-grid { display: grid; gap: 16px; grid-template-columns: 1fr; max-width: 860px; }
.setting { display: grid; gap: 14px; }
.setting + .setting { margin-top: 26px; padding-top: 26px; border-top: 1px solid var(--g800); }
.setting__head h3 { font-size: 17px; margin-bottom: 4px; }
.setting__head p { font-size: 14px; color: var(--g400); }
.lock-note { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--g300); padding: 12px 14px; border: 1px solid var(--g700); }
.lock-note svg { width: 18px; height: 18px; flex: none; margin-top: 2px; color: var(--oro); }
.inline-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

/* Zona de subida */
.dropzone {
  position: relative; display: grid; justify-items: center; gap: 10px; text-align: center; padding: 44px 24px;
  border: 1px dashed var(--g600); background: transparent; width: 100%; color: var(--blanco);
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.dropzone:hover, .dropzone.is-over { border-color: var(--azul); background: rgba(0, 128, 224, .06); }
.dropzone.is-over { border-style: solid; }
.dropzone__icon { width: 52px; height: 52px; display: grid; place-items: center; border: 1px solid var(--g600); margin-bottom: 6px; }
.dropzone__icon svg { width: 26px; height: 26px; }
.dropzone strong { font-family: var(--font-titulo); font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.dropzone span { font-size: 14px; color: var(--g400); }
.dropzone.is-locked { cursor: not-allowed; opacity: .6; }

.uploads { display: grid; gap: 8px; margin-top: 16px; }
.upload { display: grid; grid-template-columns: 48px 1fr auto; gap: 14px; align-items: center; padding: 10px 12px; border: 1px solid var(--g800); background: var(--g900); }
.upload img, .upload__ph { width: 48px; height: 36px; object-fit: cover; background: var(--g800); }
.upload__name { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upload__state { font-size: 13px; color: var(--g400); white-space: nowrap; }
.upload__state.is-error { color: var(--oro-400); }
.upload__state.is-done { color: var(--g300); }
.progress { height: 4px; background: var(--g800); margin-top: 6px; overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; background: var(--azul); transition: width 160ms linear; }

.renders-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin: 32px 0 16px; }
.renders-toolbar h3 { font-size: 18px; }
.rgrid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.rcard { background: var(--g900); border: 1px solid var(--g800); display: flex; flex-direction: column; transition: border-color var(--t-fast) var(--ease), opacity var(--t-fast) var(--ease), transform var(--t-med) var(--ease); }
.rcard:hover { border-color: var(--g700); }
.rcard.is-dragging { opacity: .35; }
.rcard.is-drop-target { border-color: var(--azul); }
.rcard__media { position: relative; aspect-ratio: 4 / 3; background: var(--g800); overflow: hidden; cursor: zoom-in; border: 0; padding: 0; display: block; width: 100%; }
.rcard__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 500ms var(--ease); }
.rcard:hover .rcard__media img { transform: scale(1.03); }
.rcard__num { position: absolute; top: 0; left: 0; background: var(--negro); color: var(--blanco); font-family: var(--font-titulo); font-weight: 800; font-size: 13px; padding: 5px 9px; letter-spacing: .02em; }
.rcard__body { padding: 10px; display: grid; gap: 8px; }
.rcard__title { background: transparent; border: 1px solid transparent; padding: 7px 8px; font-size: 14px; font-weight: 500; min-height: 0; border-radius: var(--radio-boton); }
.rcard__title:hover { border-color: var(--g700); }
.rcard__title:focus { outline: none; border-color: var(--azul); background: var(--negro); }
.rcard__tools { display: flex; justify-content: space-between; align-items: center; }
.rcard__grip { cursor: grab; color: var(--g500); display: inline-flex; padding: 6px; touch-action: none; }
.rcard__grip:active { cursor: grabbing; }
.rcard__grip svg { width: 18px; height: 18px; }

/* Compartir */
.share-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .share-grid { grid-template-columns: 1.4fr 1fr; } }
.linkbox { display: flex; gap: 0; }
.linkbox .input { border-radius: var(--radio-boton) 0 0 var(--radio-boton); font-size: 15px; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.linkbox .btn { border-radius: 0 var(--radio-boton) var(--radio-boton) 0; margin-left: -1px; }
.qr-box { background: var(--blanco); padding: 14px; width: 100%; max-width: 280px; aspect-ratio: 1; }
.qr-box img { width: 100%; height: 100%; image-rendering: pixelated; }
.share-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

/* ---------- resultados ---------- */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--g800); border: 1px solid var(--g800); margin-bottom: 24px; }
@media (min-width: 720px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--negro); padding: 18px 20px; display: grid; gap: 2px; }
.stat__value { font-family: var(--font-titulo); font-weight: 800; font-size: 34px; color: var(--oro); line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat__label { font-size: 13px; color: var(--g400); }

.ranking { display: grid; gap: 8px; }
.rank {
  display: grid; grid-template-columns: 36px 72px minmax(0, 1fr); gap: 14px; align-items: center; padding: 10px 14px 10px 10px;
  background: var(--g900); border: 1px solid var(--g800); position: relative;
  transition: transform 420ms var(--ease), border-color var(--t-fast) var(--ease);
}
.rank.is-top { border-color: var(--oro-800); }
.rank__pos { font-family: var(--font-titulo); font-weight: 800; font-size: 22px; color: var(--oro); text-align: center; font-variant-numeric: tabular-nums; }
.rank__img { width: 72px; height: 54px; object-fit: cover; background: var(--g800); cursor: zoom-in; border: 0; padding: 0; }
.rank__img img { width: 100%; height: 100%; object-fit: cover; }
.rank__main { min-width: 0; display: grid; gap: 7px; }
.rank__line { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; align-items: baseline; }
.rank__title { flex: 1 1 120px; min-width: 0; font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank__num { font-family: var(--font-titulo); font-weight: 800; color: var(--oro); white-space: nowrap; font-variant-numeric: tabular-nums; }
.rank__num small { font-family: var(--font-texto); font-weight: 500; color: var(--g400); font-size: 13px; margin-left: 6px; }
.bar { height: 8px; background: var(--g800); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--oro); width: 0; transition: width 700ms var(--ease); }
@media (min-width: 720px) { .rank { grid-template-columns: 44px 96px minmax(0, 1fr); } .rank__img { width: 96px; height: 72px; } }

.table-wrap { overflow-x: auto; border: 1px solid var(--g800); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--g800); white-space: nowrap; }
.table th { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--g400); background: var(--g900); }
.table tr:last-child td { border-bottom: 0; }
.table td.wrap { white-space: normal; min-width: 220px; }
.table .num { font-family: var(--font-titulo); font-weight: 800; color: var(--oro); }

.section-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 40px 0 16px; }
.section-title h3 { font-size: 18px; }

/* ---------- toasts y diálogos ---------- */
.toasts { position: fixed; z-index: 100; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; width: min(92vw, 440px); pointer-events: none; }
.page-vote .toasts { bottom: 104px; }
.toast {
  pointer-events: auto; display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px;
  background: var(--g900); border: 1px solid var(--g700); color: var(--blanco); font-size: 15px; line-height: 1.45;
  animation: toast-in var(--t-med) var(--ease);
}
.toast::before { content: ""; width: 4px; align-self: stretch; background: var(--azul); flex: none; margin: -2px 0; }
.toast--error::before { background: var(--oro); }
.toast.is-leaving { animation: toast-out 180ms var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }

.modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: end center; background: rgba(0, 0, 0, .78); animation: fade-in var(--t-med) var(--ease); padding: 0; }
@media (min-width: 640px) { .modal { place-items: center; padding: 24px; } }
.modal__panel {
  width: 100%; max-width: 520px; max-height: 92vh; overflow: auto; background: var(--g900); border: 1px solid var(--g700);
  padding: 28px 24px 24px; animation: sheet-in 300ms var(--ease);
}
@media (min-width: 640px) { .modal__panel { padding: 32px; animation: pop-in 240ms var(--ease); } }
.modal__panel h2 { font-size: 25px; margin-bottom: 8px; }
.modal__panel > p { color: var(--g400); }
.modal__body { margin-top: 22px; display: grid; gap: 18px; }
.modal__actions { margin-top: 26px; display: flex; flex-wrap: wrap-reverse; gap: 10px; justify-content: flex-end; }
.modal__actions .btn { flex: 1 1 auto; }
@media (min-width: 640px) { .modal__actions .btn { flex: 0 0 auto; } }
.modal.is-leaving { animation: fade-out 180ms var(--ease) forwards; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes sheet-in { from { transform: translateY(40px); opacity: 0; } }
@keyframes pop-in { from { transform: translateY(8px) scale(.985); opacity: 0; } }

/* ---------- página de voto ---------- */
.vote-top { border-bottom: 1px solid var(--g800); }
.vote-top__inner { max-width: 1240px; margin: 0 auto; padding: 14px var(--gutter); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.vote-top img { height: 22px; width: auto; }
.preview-banner { background: var(--navy); border-bottom: 1px solid var(--navy-400); text-align: center; padding: 10px var(--gutter); font-size: 14px; }

.hero { padding: 36px 0 28px; }
@media (min-width: 720px) { .hero { padding: 56px 0 36px; } }
.hero h1 { font-size: 34px; max-width: 22ch; }
@media (min-width: 720px) { .hero h1 { font-size: 49px; } }
.hero__desc { margin-top: 14px; font-size: 17px; color: var(--g300); max-width: 62ch; white-space: pre-line; }
.hero__meta { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; font-size: 15px; color: var(--g400); }
.hero__meta .dato { font-size: 17px; }

.instruction { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 20px; }
.instruction__text { display: flex; gap: 12px; align-items: center; font-family: var(--font-titulo); font-weight: 700; font-size: 18px; letter-spacing: -0.01em; }
.instruction__text::before { content: ""; width: 12px; height: 12px; background: var(--azul); flex: none; }
.instruction__hint { font-size: 14px; color: var(--g400); }

.vgrid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); padding-bottom: 140px; }
@media (min-width: 720px) { .vgrid { gap: 20px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); } }
.vcard { position: relative; background: var(--g900); border: 1px solid var(--g800); display: flex; flex-direction: column; transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease); animation: rise 420ms var(--ease) both; }
.vcard::after { content: ""; position: absolute; inset: -1px; border: 3px solid transparent; pointer-events: none; transition: border-color var(--t-fast) var(--ease); }
.vcard.is-selected::after { border-color: var(--azul); }
.vcard.is-selected { background: #071524; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
.vcard__media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--g800); border: 0; padding: 0; cursor: zoom-in; width: 100%; display: block; }
.vcard__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 600ms var(--ease), opacity 400ms var(--ease); opacity: 0; }
.vcard__media img.is-loaded { opacity: 1; }
@media (hover: hover) { .vcard:hover .vcard__media img { transform: scale(1.035); } }
.vcard__num { position: absolute; top: 0; left: 0; background: var(--negro); font-family: var(--font-titulo); font-weight: 800; font-size: 12px; padding: 5px 8px; }
.vcard__zoom { position: absolute; right: 8px; bottom: 8px; width: 32px; height: 32px; display: grid; place-items: center; background: rgba(0, 0, 0, .7); color: var(--blanco); }
.vcard__zoom svg { width: 16px; height: 16px; }
.vcard__check { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; display: grid; place-items: center; background: var(--azul); color: var(--blanco); transform: scale(.4); opacity: 0; transition: transform var(--t-med) var(--ease), opacity var(--t-fast) var(--ease); }
.vcard__check svg { width: 18px; height: 18px; }
.vcard.is-selected .vcard__check { transform: none; opacity: 1; }
.vcard__body { padding: 10px 10px 12px; display: grid; gap: 10px; flex: 1; align-content: space-between; }
@media (min-width: 720px) { .vcard__body { padding: 14px; } }
.vcard__title { font-weight: 600; font-size: 14px; line-height: 1.35; }
@media (min-width: 720px) { .vcard__title { font-size: 16px; } }
.pick {
  width: 100%; min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: transparent; border: 1px solid var(--g600); border-radius: var(--radio-boton); color: var(--blanco);
  font-weight: 600; font-size: 14px; transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.pick:hover { border-color: var(--g400); }
.pick svg { width: 16px; height: 16px; }
.pick[aria-pressed="true"] { background: var(--azul-700); border-color: var(--azul-700); }
.pick[disabled] { opacity: .45; cursor: not-allowed; }

/* Estrellas 1–5. Las estrellas llenas muestran la puntuación (un dato), por eso van en oro. */
.stars-field { display: grid; gap: 4px; justify-items: center; width: 100%; }
/* Cinco columnas que se reparten el ancho: caben siempre, también en tarjetas estrechas de móvil. */
.stars { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; width: 100%; max-width: 230px; }
.stars button {
  width: 100%; height: 40px; padding: 0; display: grid; place-items: center;
  background: none; border: 0; color: var(--g600); border-radius: 0;
  transition: color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.stars button svg { width: min(26px, 88%); height: auto; aspect-ratio: 1; }
.stars button.is-on { color: var(--oro); }
.stars button.is-on svg { fill: var(--oro); }
.stars.is-hovering button { color: var(--g600); }
.stars.is-hovering button svg { fill: none; }
.stars.is-hovering button.is-hover { color: var(--oro-400); }
.stars.is-hovering button.is-hover svg { fill: var(--oro-400); }
.stars button:active { transform: scale(.88); }
.stars__label { font-size: 12px; color: var(--g400); font-variant-numeric: tabular-nums; }
@media (min-width: 720px) { .stars button { height: 44px; } .stars button svg { width: min(30px, 88%); } }
.vcard__score {
  position: absolute; top: 8px; right: 8px; padding: 4px 8px; background: var(--oro); color: var(--negro);
  font-family: var(--font-titulo); font-weight: 800; font-size: 13px; transform: scale(.5); opacity: 0;
  transition: transform var(--t-med) var(--ease), opacity var(--t-fast) var(--ease);
}
.vcard.is-rated .vcard__score { transform: none; opacity: 1; }
.vcard.is-missing::after { border-color: var(--oro-400); border-style: dashed; }
.lb-rate { display: grid; gap: 10px; justify-items: center; }
.lb-rate .stars { max-width: 300px; }
.lb-rate .stars button { height: 56px; }
.lb-rate .stars button svg { width: min(42px, 88%); }
.lb-rate .stars__label { font-size: 14px; }
.lb-rate__hint { font-size: 13px; color: var(--g400); }

/* Barra de acción fija */
.actionbar { position: fixed; z-index: 50; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, .94); backdrop-filter: blur(10px); border-top: 1px solid var(--g800); padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom)); transform: translateY(0); transition: transform var(--t-med) var(--ease); }
.actionbar.is-hidden { transform: translateY(110%); }
.actionbar__inner { max-width: 1240px; margin: 0 auto; display: flex; align-items: center; gap: 16px; justify-content: space-between; }
.actionbar__status { min-width: 0; display: grid; }
.actionbar__count { font-family: var(--font-titulo); font-weight: 800; font-size: 18px; }
.actionbar__count b { color: var(--oro); }
.actionbar__sub { font-size: 13px; color: var(--g400); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.actionbar .btn { flex: none; }
.minibar { height: 3px; background: var(--g800); margin-top: 8px; width: 160px; max-width: 100%; }
.minibar > i { display: block; height: 100%; background: var(--oro); width: 0; transition: width 300ms var(--ease); }

/* Confirmación */
.summary { display: grid; gap: 8px; max-height: 40vh; overflow: auto; }
.summary__item { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; padding: 8px; border: 1px solid var(--g800); background: var(--negro); }
.summary__item img { width: 64px; height: 48px; object-fit: cover; }
.summary__item span { font-size: 14px; font-weight: 600; }
.summary__item b { font-family: var(--font-titulo); font-weight: 800; color: var(--oro); }
.note { display: flex; gap: 10px; font-size: 13px; color: var(--g400); }
.note svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }

/* Estado final: voto hecho / cerrada */
.done { padding: 40px 0 64px; display: grid; gap: 18px; justify-items: start; }
@media (min-width: 720px) { .done { padding: 64px 0 80px; } }
.done__mark { width: 72px; height: 72px; display: grid; place-items: center; background: var(--azul); color: var(--blanco); animation: pop-mark 520ms var(--ease); }
.done__mark svg { width: 36px; height: 36px; }
.done__mark--neutral { background: var(--g800); color: var(--g300); }
@keyframes pop-mark { 0% { transform: scale(.4); opacity: 0; } 60% { transform: scale(1.08); opacity: 1; } 100% { transform: none; } }
.done h1 { font-size: 34px; }
@media (min-width: 720px) { .done h1 { font-size: 49px; } }
.done p { color: var(--g300); font-size: 17px; max-width: 58ch; }
.your-vote { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.your-vote figure { margin: 0; width: 150px; }
.your-vote img { width: 150px; height: 112px; object-fit: cover; border: 1px solid var(--g700); }
.your-vote figcaption { font-size: 12px; color: var(--g400); margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.your-vote figcaption b { color: var(--oro); font-family: var(--font-titulo); }
.results-block { padding-bottom: 80px; }

/* ---------- visor (lightbox) ---------- */
.lb { position: fixed; inset: 0; z-index: 80; background: rgba(0, 0, 0, .96); display: grid; grid-template-rows: auto 1fr auto; animation: fade-in 200ms var(--ease); touch-action: pan-y; }
.lb.is-leaving { animation: fade-out 160ms var(--ease) forwards; }
.lb__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px var(--gutter); }
.lb__count { font-family: var(--font-titulo); font-weight: 800; color: var(--oro); font-size: 15px; font-variant-numeric: tabular-nums; }
.lb__title { font-weight: 600; font-size: 15px; flex: 1; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb__stage { position: relative; overflow: hidden; display: grid; place-items: center; user-select: none; }
.lb__img { max-width: calc(100vw - 2 * var(--gutter)); max-height: 100%; object-fit: contain; transition: transform 260ms var(--ease), opacity 200ms var(--ease); will-change: transform; }
.lb__img.is-swiping { transition: none; }
.lb__nav { position: absolute; top: 50%; transform: translateY(-50%); width: 52px; height: 52px; display: grid; place-items: center; background: rgba(0, 0, 0, .6); border: 1px solid var(--g700); color: var(--blanco); }
.lb__nav:hover { background: var(--g900); border-color: var(--g500); }
.lb__nav svg { width: 22px; height: 22px; }
.lb__nav--prev { left: var(--gutter); }
.lb__nav--next { right: var(--gutter); }
@media (hover: none) { .lb__nav { display: none; } }
.lb__bottom { padding: 12px var(--gutter) calc(16px + env(safe-area-inset-bottom)); display: flex; justify-content: center; }
.lb__bottom > * { width: 100%; max-width: 420px; }

/* ---------- proyector ---------- */
.page-projector { overflow: hidden; }
.proj { height: 100vh; height: 100dvh; display: grid; grid-template-columns: minmax(320px, 34vw) 1fr; }
.proj__left { border-right: 1px solid var(--g800); padding: 4vh 3vw; display: flex; flex-direction: column; justify-content: center; gap: 3vh; }
.proj__left h2 { font-size: clamp(28px, 3.2vw, 56px); }
.proj__qr { background: var(--blanco); padding: 1.4vw; width: 100%; max-width: 30vw; aspect-ratio: 1; }
.proj__qr img { width: 100%; height: 100%; image-rendering: pixelated; }
.proj__url { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: clamp(14px, 1.3vw, 22px); color: var(--g300); word-break: break-all; }
.proj__right { padding: 4vh 3vw; display: flex; flex-direction: column; min-height: 0; }
.proj__title { font-size: clamp(28px, 3vw, 54px); margin-bottom: 1vh; }
.proj__meta { display: flex; gap: 3vw; align-items: baseline; margin-bottom: 3vh; color: var(--g400); font-size: clamp(14px, 1.2vw, 20px); }
.proj__meta .dato { font-size: clamp(32px, 4vw, 72px); line-height: 1; }
.proj__list { display: grid; gap: 1.2vh; overflow: hidden; }
.proj .rank { grid-template-columns: 4vw 9vw minmax(0, 1fr); padding: 1vh 1.2vw 1vh 1vh; gap: 1.4vw; }
.proj .rank__img { width: 9vw; height: 6.75vw; max-height: 11vh; }
.proj .rank__pos { font-size: clamp(20px, 2.2vw, 42px); }
.proj .rank__title { font-size: clamp(15px, 1.4vw, 26px); }
.proj .rank__num { font-size: clamp(16px, 1.6vw, 30px); }
.proj .bar { height: 1.1vh; min-height: 6px; }
.proj__hidden { flex: 1; display: grid; place-content: center; text-align: center; gap: 2vh; }
.proj__hidden .dato { font-size: clamp(80px, 14vw, 240px); line-height: 1; }
.proj__controls { position: fixed; right: 20px; bottom: 20px; display: flex; gap: 8px; opacity: 0; transition: opacity var(--t-med) var(--ease); }
.proj.show-controls .proj__controls { opacity: 1; }
@media (max-width: 900px) {
  .proj { grid-template-columns: 1fr; grid-template-rows: auto 1fr; height: auto; min-height: 100vh; }
  .page-projector { overflow: auto; }
  .proj__left { border-right: 0; border-bottom: 1px solid var(--g800); align-items: center; text-align: center; }
  .proj__qr { max-width: 260px; }
  .proj .rank { grid-template-columns: 36px 72px minmax(0, 1fr); gap: 12px; }
  .proj .rank__img { width: 72px; height: 54px; }
}

/* ---------- página de mensaje ---------- */
.page-message { display: grid; place-items: center; min-height: 100vh; min-height: 100dvh; padding: 24px; }
.message { max-width: 520px; display: grid; gap: 18px; justify-items: start; }
.message .brand-mark img { height: 24px; width: auto; margin-bottom: 40px; }
.message__module { display: flex; gap: 6px; }
.message__module span { width: 18px; height: 18px; background: var(--g700); }
.message__module span:first-child { background: var(--oro); width: 54px; }
.message__code { font-family: var(--font-titulo); font-weight: 800; color: var(--oro); font-size: 15px; letter-spacing: .06em; }
.message__title { font-size: 34px; }
.message__text { color: var(--g300); font-size: 17px; }

/* ---------- utilidades ---------- */
.stack { display: grid; gap: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}
