/* =========================================================
   ShifuStream — sistema visual (azul · blanco · rojo)
   ========================================================= */
@import url('https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700;800&family=Geist+Mono:wght@500;600;700&display=swap');

:root {
  --bg: #f4f6fa;
  --bg-2: #f8fafd;
  --surface: #ffffff;
  --surface-2: #f1f5fc;
  --hover: #edf2fb;
  --border: #e2e8f1;
  --border-2: #d2dbe8;
  --text: #0e1a33;
  --text-2: #36465f;
  --muted: #6a7890;
  --navy: #0b1f44;
  --navy-2: #12295a;
  --accent: #1d4ed8;
  --accent-2: #173fae;
  --accent-soft: rgba(29, 78, 216, .08);
  --red: #d62839;
  --red-soft: rgba(214, 40, 57, .08);
  --r: 10px;
  --r-lg: 16px;
  --ease: cubic-bezier(.22, .8, .24, 1);
  --spring: cubic-bezier(.34, 1.4, .64, 1);
  --sans: 'Geist', 'Segoe UI', system-ui, sans-serif;
  --mono: 'Geist Mono', Consolas, monospace;
  --shadow: 0 1px 2px rgba(14, 26, 51, .04), 0 10px 28px -14px rgba(14, 26, 51, .14);
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font: 400 14px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.in { animation: fadeup .6s var(--ease) both; animation-delay: var(--d, 0s); }
@keyframes fadeup { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* Franja superior animada azul · blanco · rojo */
.flagbar {
  position: fixed; top: 0; left: 0; right: 0; height: 4px; z-index: 20;
  background: linear-gradient(90deg, var(--navy), var(--accent), #fff, var(--red), var(--navy), var(--accent));
  background-size: 300% 100%; animation: flag 10s linear infinite;
}
@keyframes flag { to { background-position: 300% 0; } }

/* Logo con pulso suave */
.logo-img { display: block; border-radius: 24%; background: #000; object-fit: cover; }
picture { display: contents; }
.logo-pulse { position: relative; display: inline-grid; place-items: center; }
.logo-pulse .logo-img { position: relative; z-index: 1; box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 14px 34px -10px rgba(214,40,57,.55), 0 8px 18px -8px rgba(11,31,68,.45); }
.logo-pulse::before, .logo-pulse::after { content: ''; position: absolute; inset: 0; border-radius: 26%; border: 2px solid var(--accent); animation: ring 3.2s var(--ease) infinite; opacity: 0; }
.logo-pulse::after { border-color: var(--red); animation-delay: 1.6s; }
@keyframes ring { 0% { transform: scale(.94); opacity: .6; } 100% { transform: scale(1.35); opacity: 0; } }
/* Logo grande de la portada: flota y aparece con un giro suave */
.logo-pulse.big { animation: logoin 1s var(--spring) both, levitar 5s ease-in-out 1s infinite; }
.logo-pulse.big .logo-img { width: 150px; height: 150px; }
.logo-pulse.mid .logo-img { width: 104px; height: 104px; }
@keyframes logoin { from { opacity: 0; transform: scale(.6) rotate(-8deg); } to { opacity: 1; transform: none; } }
@keyframes levitar { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* =========================================================
   PÁGINA PÚBLICA
   ========================================================= */
body.pub { background: #fff; overflow-x: hidden; }

.bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.orb { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .5; animation: float 22s ease-in-out infinite alternate; }
.o1 { width: 520px; height: 520px; background: radial-gradient(circle, rgba(29,78,216,.55), transparent 65%); top: -180px; left: -140px; }
.o2 { width: 460px; height: 460px; background: radial-gradient(circle, rgba(214,40,57,.40), transparent 65%); bottom: -160px; right: -120px; animation-duration: 26s; animation-delay: -6s; }
.o3 { width: 360px; height: 360px; background: radial-gradient(circle, rgba(11,31,68,.30), transparent 65%); top: 40%; left: 60%; animation-duration: 30s; animation-delay: -12s; opacity: .35; }
@keyframes float {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, 40px) scale(1.1); }
  100% { transform: translate(-40px, 70px) scale(.95); }
}
.dots { position: absolute; inset: 0; background-image: radial-gradient(rgba(11,31,68,.12) 1px, transparent 1.2px); background-size: 26px 26px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 75%); -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 75%); }
.tri { position: absolute; width: 46px; height: 46px; fill: none; stroke-width: 2.2; stroke-linejoin: round; opacity: .55; animation: drift 18s ease-in-out infinite; }
.t1 { stroke: var(--accent); top: 16%; left: 9%; }
.t2 { stroke: var(--red); top: 22%; right: 10%; width: 34px; height: 34px; animation-delay: -5s; animation-duration: 22s; }
.t3 { stroke: var(--navy); bottom: 18%; left: 13%; width: 30px; height: 30px; animation-delay: -9s; animation-duration: 20s; opacity: .35; }
.t4 { stroke: var(--accent); bottom: 12%; right: 16%; width: 54px; height: 54px; animation-delay: -13s; animation-duration: 26s; opacity: .3; }
@keyframes drift {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(18px, -26px) rotate(40deg); }
  66% { transform: translate(-14px, 16px) rotate(-25deg); }
}

.pub-wrap { position: relative; z-index: 1; width: min(620px, 100% - 32px); margin: 0 auto; padding: 56px 0 72px; }
.pub-brand { display: flex; align-items: center; justify-content: center; margin-bottom: 26px; }
.pub-brand b { font-size: 20px; font-weight: 700; letter-spacing: -.02em; color: var(--navy); }

.pub-title { margin: 0; text-align: center; font-size: clamp(36px, 7vw, 56px); font-weight: 800; letter-spacing: -.045em; line-height: 1.02; color: var(--navy); }
.pub-title .w { display: inline-block; animation: wordin .8s var(--spring) both; animation-delay: var(--d); }
@keyframes wordin { from { opacity: 0; transform: translateY(22px) scale(.96); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
.pub-title .hl { position: relative; color: var(--accent); }
.pub-title .hl::after {
  content: ''; position: absolute; left: 2%; right: 2%; bottom: .02em; height: .14em; border-radius: 4px; z-index: -1;
  background: var(--red); opacity: .9; transform-origin: left; transform: scaleX(0); animation: underline .7s var(--ease) .9s forwards;
}
@keyframes underline { to { transform: scaleX(1); } }
.pub-sub { margin: 14px 0 30px; text-align: center; color: var(--muted); font-size: 16px; }

.pub-card {
  position: relative; padding: 26px; border-radius: 22px; background: rgba(255,255,255,.88);
  border: 1px solid var(--border); overflow: hidden;
  box-shadow: 0 1px 2px rgba(14,26,51,.04), 0 30px 60px -28px rgba(11,31,68,.28);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.pub-card::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: linear-gradient(90deg, var(--accent) 0 60%, var(--red) 60%); }
.big-label { display: block; margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--text-2); letter-spacing: .01em; }
.big-field { position: relative; margin-bottom: 20px; }
.big-field > svg:first-child { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; transition: color .2s; }
.big-field:focus-within > svg:first-child { color: var(--accent); }
.big-input {
  width: 100%; height: 62px; padding: 0 18px 0 52px; border-radius: 14px;
  background: #fff; border: 1.5px solid var(--border-2); outline: none;
  font-size: 18px; font-weight: 500; color: var(--text);
  transition: border-color .2s, box-shadow .25s, transform .2s;
}
.big-input::placeholder { color: #a3adbd; font-weight: 400; }
.big-input:hover { border-color: #b9c5d8; }
.big-input:focus { border-color: var(--accent); box-shadow: 0 0 0 5px rgba(29,78,216,.12); }
.big-field.is-select .big-input { appearance: none; padding-right: 48px; cursor: pointer; font-size: 16px; }
.big-field.is-select select:invalid { color: #a3adbd; }
.big-field.is-select option, .big-field.is-select optgroup { color: var(--text); }
.big-field .chev { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; transition: transform .3s var(--ease), color .2s; }
.big-field.is-select:focus-within .chev { color: var(--accent); transform: translateY(-50%) rotate(180deg); }

.big-btn {
  position: relative; overflow: hidden; width: 100%; height: 60px; margin-top: 6px; border: 0; border-radius: 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: linear-gradient(135deg, var(--accent), var(--navy-2)); color: #fff; font-size: 17px; font-weight: 700;
  box-shadow: 0 12px 26px -12px rgba(29,78,216,.7); transition: transform .25s var(--spring), box-shadow .25s;
}
.big-btn::after {
  content: ''; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.35), transparent); transform: skewX(-20deg);
  animation: shine 3.5s ease-in-out 1.6s infinite;
}
@keyframes shine { 0% { left: -60%; } 40%, 100% { left: 130%; } }
.big-btn:hover { transform: translateY(-2px); box-shadow: 0 18px 32px -14px rgba(29,78,216,.75); }
.big-btn:active { transform: translateY(0) scale(.99); }
.big-btn .lbl-ico { transition: transform .3s var(--ease); }
.big-btn:hover .lbl-ico { transform: translateX(4px); }
.big-btn .spin { display: none; }
.big-btn.loading { pointer-events: none; }
.big-btn.loading .spin { display: inline-block; }
.big-btn.loading .lbl-ico { display: none; }

/* barra de progreso tricolor mientras busca */
.progress { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; opacity: 0; transition: opacity .2s;
  background: linear-gradient(90deg, transparent, var(--accent), var(--red), transparent); background-size: 50% 100%; background-repeat: no-repeat; }
.pub-card:has(.loading) .progress { opacity: 1; animation: scan 1.1s linear infinite; }
@keyframes scan { from { background-position: -50% 0; } to { background-position: 150% 0; } }

/* Resultados */
.results { margin-top: 30px; }
.results-title { margin: 0 0 12px; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.mails { display: grid; gap: 12px; }
.mail {
  position: relative; padding: 18px 20px; border-radius: var(--r-lg); background: #fff; border: 1px solid var(--border);
  box-shadow: var(--shadow); overflow: hidden;
  animation: cardin .7s var(--spring) both; animation-delay: calc(var(--i) * 110ms + .15s);
}
.mail::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c, var(--accent)); }
@keyframes cardin { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }
.mail-top { display: flex; align-items: center; gap: 12px; }
.mail-top .meta { min-width: 0; flex: 1; }
.mail-top .meta b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-top .meta span { display: block; color: var(--muted); font-size: 12.5px; }
.pill { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 11px; font-weight: 700; background: var(--red-soft); color: var(--red); flex: none; }
.pill .blink { width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--red); animation: blink 1.2s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .2; } }
.mail-code { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--border-2); }
.digits { display: flex; gap: 6px; cursor: pointer; background: none; border: 0; padding: 0; }
.digits .d {
  width: 42px; height: 54px; display: grid; place-items: center; border-radius: 10px;
  background: linear-gradient(180deg, #fff, var(--surface-2)); border: 1.5px solid var(--border-2);
  font: 700 26px/1 var(--mono); color: var(--navy);
  animation: flip .55s var(--spring) both; animation-delay: calc(var(--i) * 110ms + var(--j) * 60ms + .45s);
  transition: border-color .2s, color .2s, transform .2s;
}
.digits:hover .d { border-color: var(--accent); color: var(--accent); }
.digits.copied .d { border-color: var(--accent); background: var(--accent); color: #fff; animation: pop .45s var(--spring) both; animation-delay: calc(var(--j) * 40ms); }
@keyframes flip { from { opacity: 0; transform: rotateX(90deg) translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes pop { 50% { transform: translateY(-6px); } }
.mail-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.copy-hint { font-size: 12px; color: var(--muted); margin-top: 6px; }

.noresult { display: flex; gap: 14px; align-items: flex-start; padding: 18px 20px; border-radius: var(--r-lg); background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow); }
.noresult .nr-ico { flex: none; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: var(--red-soft); color: var(--red); }
.noresult b { display: block; font-size: 15px; }
.noresult p { margin: 2px 0 0; color: var(--muted); }

/* =========================================================
   COMPONENTES COMPARTIDOS
   ========================================================= */
.svc-ico { flex: none; width: 26px; height: 26px; border-radius: 7px; display: inline-grid; place-items: center; font: 700 11px/1 var(--sans); font-style: normal; color: #fff; background: var(--navy); }
.svc-ico.lg { width: 38px; height: 38px; border-radius: 10px; font-size: 13px; }
.svc-ico.netflix { background: var(--red); }
.svc-ico.disney { background: var(--accent); }
.svc-ico.prime { background: var(--navy); }
.svc-ico.hbomax { background: linear-gradient(135deg, var(--navy), var(--accent)); }
.svc-ico.paramount { background: var(--accent-2); }
.svc-ico.crunchyroll { background: linear-gradient(135deg, var(--red), #a51d2c); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.card-head h2 { margin: 0; font-size: 14px; font-weight: 600; }
.card-head span { color: var(--muted); font-size: 12.5px; }
.section-gap { margin-top: 20px; }

.label { display: block; margin-bottom: 6px; font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.input-wrap { position: relative; }
.input, .select { width: 100%; height: 40px; padding: 0 12px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--border-2); outline: none; transition: border-color .15s, box-shadow .15s; }
.input::placeholder { color: #98a3b5; }
.input:hover, .select:hover { border-color: #b9c5d8; }
.input:focus, .select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.select { appearance: none; padding-right: 32px; cursor: pointer;
  background: var(--surface) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236a7890' stroke-width='2.5'><path d='m6 9 6 6 6-6'/></svg>") no-repeat right 12px center; }
.input.has-ico { padding-left: 36px; }
.input-wrap > .lead { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-wrap > .trail { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }
.grid-form { display: grid; gap: 16px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: var(--r); border: 1px solid transparent; cursor: pointer;
  background: var(--accent); color: #fff; font-weight: 600; white-space: nowrap; transition: background .15s, border-color .15s, transform .1s, box-shadow .15s; }
.btn:hover { background: var(--accent-2); box-shadow: 0 6px 16px -6px rgba(29,78,216,.45); }
.btn:active { transform: translateY(1px); }
.btn.secondary { background: var(--surface); color: var(--text); border-color: var(--border-2); }
.btn.secondary:hover { background: var(--hover); border-color: #b9c5d8; box-shadow: none; }
.btn.danger { background: var(--red); }
.btn.danger:hover { background: #b81f2f; box-shadow: 0 6px 16px -6px rgba(214,40,57,.45); }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn.loading { opacity: .8; pointer-events: none; }
.spin { display: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: rot .7s linear infinite; }
.btn.loading .spin { display: inline-block; }
@keyframes rot { to { transform: rotate(360deg); } }

.iconbtn { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: none; border: 1px solid transparent; color: var(--muted); cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.iconbtn:hover { background: var(--hover); color: var(--text); border-color: var(--border-2); }
.iconbtn.del:hover { color: var(--red); background: var(--red-soft); border-color: transparent; }

.alert { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: var(--r); background: var(--red-soft); border: 1px solid rgba(214,40,57,.25); color: #a51d2c; font-size: 13px; }
.shake { animation: shake .4s var(--ease); }
@keyframes shake { 25%,75% { transform: translateX(-6px); } 50% { transform: translateX(6px); } }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; visibility: hidden; }
.modal.open { visibility: visible; }
.modal .scrim { position: absolute; inset: 0; background: rgba(11,31,68,.42); opacity: 0; transition: opacity .2s; }
.modal.open .scrim { opacity: 1; }
.modal .sheet { position: relative; width: min(820px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--r-lg); overflow: hidden;
  box-shadow: 0 24px 64px -12px rgba(11,31,68,.35); opacity: 0; transform: translateY(10px) scale(.98); transition: opacity .2s, transform .3s var(--spring); }
.modal.open .sheet { opacity: 1; transform: none; }
.modal.sm .sheet { width: min(440px, 100%); }
.sheet header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.sheet header h3 { margin: 0; font-size: 15px; font-weight: 600; }
.sheet header p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.sheet .body { padding: 20px; overflow: auto; }
.sheet footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--bg-2); }
.sheet iframe { display: block; width: 100%; height: 62vh; border: 1px solid var(--border); border-radius: var(--r); background: #fff; }

/* Toast */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: grid; gap: 8px; max-width: calc(100% - 40px); }
.toast { display: flex; align-items: center; gap: 10px; min-width: 260px; max-width: 400px; padding: 12px 14px; border-radius: var(--r); background: #fff; border: 1px solid var(--border-2);
  box-shadow: 0 16px 40px -12px rgba(11,31,68,.3); font-size: 13.5px; cursor: pointer; animation: toastin .35s var(--spring) both; }
.toast .dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.toast.err .dot { background: var(--red); }
.toast.out { animation: toastout .2s ease forwards; }
@keyframes toastin { from { opacity: 0; transform: translateY(10px); } }
@keyframes toastout { to { opacity: 0; transform: translateY(10px); } }

/* =========================================================
   ADMINISTRACIÓN
   ========================================================= */
body.adm { padding-top: 4px; }
.auth { min-height: calc(100vh - 4px); display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(700px 360px at 15% -10%, rgba(29,78,216,.10), transparent 70%), radial-gradient(600px 320px at 100% 110%, rgba(214,40,57,.07), transparent 70%), var(--bg); }
.auth-box { width: min(380px, 100%); }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-bottom: 24px; text-align: center; }
.auth-brand h1 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.02em; color: var(--navy); }
.auth-brand p { margin: 2px 0 0; color: var(--muted); }
.auth-box .card { border-top: 3px solid var(--accent); }

.adm-top { position: sticky; top: 4px; z-index: 10; background: var(--navy); color: #fff; }
.adm-top-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: min(1000px, 100% - 32px); margin: 0 auto; height: 62px; }
.adm-brand { display: flex; align-items: center; gap: 10px; }
.adm-brand .logo-img { border-radius: 10px; box-shadow: 0 0 0 1px rgba(255,255,255,.15); }
.adm-brand b { display: block; font-size: 15px; font-weight: 700; }
.adm-brand small { display: block; font-size: 11.5px; color: rgba(255,255,255,.6); }
.adm-actions { display: flex; gap: 8px; }
.adm-actions form { margin: 0; }
.adm-top .btn.secondary { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.18); }
.adm-top .btn.secondary:hover { background: rgba(255,255,255,.16); }
.adm-wrap { width: min(1000px, 100% - 32px); margin: 0 auto; padding: 30px 0 60px; }

.page-head { margin-bottom: 20px; }
.page-head h1 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.02em; color: var(--navy); }
.page-head p { margin: 6px 0 0; color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px 0 7px; border-radius: 999px; border: 1.5px solid var(--border-2); background: #fff; font-weight: 500; transition: all .2s var(--ease); }
.chip:hover span { border-color: #b9c5d8; background: var(--surface-2); }
.chip input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.chip .svc-ico { transition: transform .35s var(--spring); }
.chip input:checked + span .svc-ico { transform: scale(1.1) rotate(-6deg); }

.form-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--bg-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.form-foot .note { color: var(--muted); font-size: 12.5px; }

.toolbar { display: grid; grid-template-columns: 1fr 240px auto; gap: 8px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; padding: 10px 20px; font-size: 12px; font-weight: 500; color: var(--muted); background: var(--bg-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px 20px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr { animation: fadeup .45s var(--ease) both; animation-delay: calc(var(--i) * 30ms + .1s); transition: background .15s; }
.table tbody tr:hover { background: var(--bg-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .right { text-align: right; width: 60px; }
.table .date { color: var(--muted); font-size: 13px; white-space: nowrap; }
.mailcell { display: flex; align-items: center; gap: 10px; font-weight: 500; word-break: break-all; }
.avatar { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--accent); background: var(--accent-soft); border: 1px solid rgba(29,78,216,.18); }
.tag { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; white-space: nowrap; }
.tag .svc-ico { width: 22px; height: 22px; font-size: 10px; border-radius: 6px; }

.empty { padding: 44px 20px; text-align: center; color: var(--muted); }
.empty .ico { width: 44px; height: 44px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.empty b { display: block; color: var(--text); font-weight: 600; margin-bottom: 4px; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12.5px; }
.pager nav { display: flex; gap: 4px; }
.pager a { min-width: 30px; height: 30px; padding: 0 8px; display: grid; place-items: center; border-radius: 7px; border: 1px solid var(--border); color: var(--text-2); }
.pager a:hover { background: var(--hover); }
.pager a.on { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }

/* Conexión con Gmail */
.gm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.estado { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.estado i { width: 8px; height: 8px; border-radius: 50%; background: var(--border-2); }
.estado.ok { color: #15803d; } .estado.ok i { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.18); animation: blink 2s ease-in-out infinite; }
.estado.err { color: var(--red); } .estado.err i { background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.ayuda { border: 1px solid var(--border); border-radius: var(--r); background: var(--bg-2); padding: 10px 14px; }
.ayuda summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.ayuda ol { margin: 10px 0 2px; padding-left: 20px; color: var(--text-2); line-height: 1.7; }

/* Pestañas del panel */
.tabs { display: flex; gap: 4px; padding: 4px; margin-bottom: 24px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); width: fit-content; max-width: 100%; overflow-x: auto; }
.tabs a { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 16px; border-radius: 8px; font-weight: 600; color: var(--muted); white-space: nowrap; transition: background .15s, color .15s; }
.tabs a:hover { color: var(--text); background: var(--hover); }
.tabs a.on { background: var(--accent); color: #fff; }
.tabs i { font-style: normal; font-size: 11.5px; font-weight: 600; min-width: 20px; padding: 1px 6px; border-radius: 999px; text-align: center; background: var(--surface-2); color: var(--text-2); }
.tabs a.on i { background: rgba(255,255,255,.2); color: #fff; }
.tabs i.dot { min-width: 0; width: 8px; height: 8px; padding: 0; }
.tabs i.dot.ok { background: #22c55e; } .tabs i.dot.err { background: var(--red); }

/* Usuarios */
.toolbar.filtros { grid-template-columns: 1fr 200px 200px auto; }
.cell-form { margin: 0; }
.table .select { height: 34px; min-width: 150px; font-size: 13px; }
.inline-form { display: flex; gap: 8px; }
.inline-form .input { flex: 1; }
.count-link { color: var(--text-2); white-space: nowrap; }
.count-link b { color: var(--text); }
.count-link span { color: var(--muted); font-size: 12.5px; }
.count-link:hover, .count-link:hover b { color: var(--accent); }

/* Correos agrupados por usuario */
.list-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 28px 0 12px; }
.list-head h2 { margin: 0; font-size: 16px; font-weight: 700; }
.list-head span { color: var(--muted); font-size: 12.5px; }
.list-actions { display: flex; gap: 6px; }
.card.toolbar { border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.grupos { display: grid; gap: 10px; }
.grupo { overflow: hidden; scroll-margin-top: 16px; }
.grupo summary { display: flex; align-items: center; gap: 12px; padding: 14px 18px; cursor: pointer; list-style: none; user-select: none; transition: background .15s; }
.grupo summary::-webkit-details-marker { display: none; }
.grupo summary:hover { background: var(--hover); }
.grupo .g-name { flex: 1; min-width: 0; }
.grupo .g-name b { display: block; font-size: 15px; font-weight: 600; }
.grupo .g-name small { color: var(--muted); font-size: 12.5px; }
.grupo .g-plats { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.grupo .g-plats .svc-ico { width: 24px; height: 24px; font-size: 10px; border-radius: 6px; }
.grupo .chev { flex: none; color: var(--muted); transition: transform .25s var(--ease); }
.grupo[open] .chev { transform: rotate(180deg); }
.grupo[open] summary { border-bottom: 1px solid var(--border); }
.grupo.sin .avatar { color: var(--muted); background: var(--surface-2); border-color: var(--border-2); }
.g-body { animation: fadeup .3s var(--ease) both; }
.g-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 170px; align-items: center; gap: 12px; padding: 10px 18px; border-bottom: 1px solid var(--border); }
.g-row:last-child { border-bottom: 0; }
.g-row:hover { background: var(--bg-2); }
.g-row .select { height: 34px; font-size: 13px; }
.avatar.sm { width: 26px; height: 26px; font-size: 11px; }
.g-tags { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.ptag { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 4px 0 4px; border: 1px solid var(--border-2); border-radius: 999px; background: var(--surface-2); font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.ptag .svc-ico { width: 22px; height: 22px; font-size: 9.5px; border-radius: 50%; }
.ptag button { width: 22px; height: 22px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; font-size: 11px; }
.ptag button:hover { background: var(--red-soft); color: var(--red); }
.g-empty { padding: 16px 18px; color: var(--muted); font-size: 13px; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .pub-wrap { padding-top: 40px; }
  .logo-pulse.big .logo-img { width: 120px; height: 120px; }
  .t1, .t2 { display: none; }
  .pub-card { padding: 20px; border-radius: 18px; }
  .big-input { height: 56px; font-size: 16px; }
  .digits .d { width: 36px; height: 48px; font-size: 22px; }
  .toolbar, .toolbar.filtros, .gm-grid { grid-template-columns: 1fr; }
  .form-foot { flex-direction: column; align-items: stretch; }
  .adm-brand small, .adm-actions a { display: none; }
  .table .date { display: none; }
  .inline-form { flex-direction: column; }
  .list-head { flex-direction: column; align-items: stretch; }
  .g-row { grid-template-columns: 1fr; gap: 8px; }
  .g-tags { justify-content: flex-start; }
  .grupo .g-plats { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
