:root {
  /* Paleta del logo (moneda RC verde y dorada) sobre fondo gris carbón neutro. Sin azul: no se hereda el
     botón/enlace del tema de Telegram para que la marca se vea igual en todos lados. */
  --bg: var(--tg-theme-bg-color, #121212);
  --bg2: var(--tg-theme-secondary-bg-color, #1c1c1e);
  --text: var(--tg-theme-text-color, #f2f2f2);
  --muted: var(--tg-theme-hint-color, #9a9a9a);
  --text2: #dadada;
  --faint: #6e6e6e;
  --accent: #178a40;          /* verde moneda: botones (texto blanco 4.6:1) */
  --accent-text: #ffffff;
  --accent-soft: rgba(23, 138, 64, 0.18);
  --gold: #e0b54a;            /* dorado "RC": activo, iconos de marca */
  --link: #6fd896;
  --danger: #ef5350;
  --ok: #43a047;
  --warn: #f9a825;
  --radius: 14px;
  --border: rgba(127, 127, 127, 0.18);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  -webkit-tap-highlight-color: transparent;
}

body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }

.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; padding: 24px 0; }

.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px;
  padding-top: calc(12px + env(safe-area-inset-top));
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.update-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 16px; background: rgba(249, 168, 37, 0.15); font-size: 14px; line-height: 1.4;
}
.update-banner .btn { padding: 8px 12px; white-space: nowrap; }
.bloqueada { pointer-events: none; opacity: 0.4; }
.login-espera { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%; line-height: 1.4; text-align: center; }
.logout-btn { display: block; margin: 16px auto 0; color: var(--muted); }
.brand { font-weight: 700; font-size: 15px; }
.saldo-chip {
  border: 1px solid var(--border); background: var(--bg2); color: var(--text);
  border-radius: 999px; padding: 5px 8px; font-size: 12px; font-weight: 600;
  display: inline-flex; gap: 6px; align-items: center; white-space: nowrap;
}
.chip-bono { color: var(--muted); font-weight: 500; }

main { padding: 12px; max-width: 560px; margin: 0 auto; }

body.login-mode .topbar { display: none; }
body.login-mode { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
body.login-mode main {
  min-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  display: flex; align-items: center; justify-content: center;
  padding: calc(20px + env(safe-area-inset-top)) 20px 24px;
}
body.login-mode #view-login { width: 100%; max-width: 400px; }

.login-splash {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; width: 100%;
}
.login-logo {
  width: 112px; height: 112px; object-fit: contain;
  margin-bottom: 16px;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.35));
}
.login-brand {
  margin: 0 0 6px; font-size: 30px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15;
}
.login-subtitle {
  margin: 0 0 28px; font-size: 15px; color: var(--muted); line-height: 1.35;
}
.login-features {
  list-style: none; margin: 0 0 28px; padding: 0;
  display: flex; flex-direction: column; gap: 12px;
  width: 100%; max-width: 280px; text-align: left;
}
.login-features li {
  font-size: 14px; color: var(--text2); line-height: 1.35;
}
.login-widget {
  display: flex; justify-content: center; flex-direction: column; align-items: center;
  width: 100%; margin: 0; min-height: 48px;
}
.login-widget .btn-block { margin-top: 0; }
.login-tg-hint {
  margin: 12px 0 0; font-size: 12px; line-height: 1.4; max-width: 280px;
}
.login-sep { text-align: center; margin: 18px 0 10px; font-size: 13px; width: 100%; }
.login-otp {
  display: flex; flex-direction: column; gap: 8px;
  width: 100%; text-align: left; margin-top: 0;
}
.login-otp .label { margin-top: 0; }
.login-otp .btn-block { margin-top: 4px; }
.login-version {
  margin: 28px 0 0; font-size: 12px; color: var(--faint); letter-spacing: 0.02em;
}

.card {
  background: var(--bg2);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
}
.card-title {
  display: flex; justify-content: space-between; align-items: center;
  font-weight: 700; margin-bottom: 10px;
}
.jug-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(249, 168, 37, 0.18);
  color: var(--warn);
  vertical-align: middle;
}

.label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 6px; }
.label:first-child { margin-top: 0; }

.row { display: flex; gap: 8px; align-items: stretch; }
.row > .input { flex: 1; min-width: 0; }
.row > .btn { flex: 1; }
.row > .btn-secondary:first-child { flex: 0 0 auto; }

.input {
  width: 100%;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  outline: none;
}
.input:focus { border-color: var(--link); }
.select { flex: 0 0 92px !important; }

.btn {
  border: 0; border-radius: 10px; padding: 12px 14px;
  font-size: 15px; font-weight: 600; cursor: pointer;
  text-align: center; text-decoration: none; display: inline-block;
}
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.btn-block { display: block; width: 100%; margin-top: 12px; }
.btn-sm { padding: 6px 12px; font-size: 13px; flex-shrink: 0; }

.retiro-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.retiro-item:last-child { border-bottom: 0; }

.mov-item {
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border);
}
.mov-item:last-child { border-bottom: 0; }
.mov-izq { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mov-ico {
  width: 34px; height: 34px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; flex: none;
}
.mov-ico .ic { width: 16px; height: 16px; margin: 0; }
.mov-ico.in { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.mov-ico.out { background: color-mix(in srgb, var(--danger) 18%, transparent); color: var(--danger); }
.mov-texto { min-width: 0; }
.mov-tipo { font-weight: 700; line-height: 1.25; }
.mov-contra, .mov-meta { color: var(--muted); font-size: 13px; line-height: 1.3; }
.mov-contra { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mov-der { text-align: right; flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.mov-monto { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mov-monto.in { color: var(--ok); }
.mov-monto.out { color: var(--danger); }
.mov-estado { color: var(--muted); font-size: 14px; line-height: 1.4; padding: 8px 0 4px; }

.link-btn { background: none; border: 0; color: var(--link); font-size: 14px; cursor: pointer; padding: 4px; }

.seg { display: flex; gap: 6px; margin-bottom: 8px; }
.seg button {
  flex: 1; padding: 10px 6px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg2); color: var(--text);
  font-size: 14px; font-weight: 600; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.seg button.active { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.seg button:disabled { opacity: 0.45; }
.seg button .estado { font-size: 11px; font-weight: 500; opacity: 0.85; }
.seg-small button { padding: 8px 4px; font-size: 13px; background: var(--bg); }

.horario { font-size: 12px; margin: 0 4px 10px; line-height: 1.5; }
.hint { font-size: 12px; margin-top: 6px; min-height: 16px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 999px;
  background: var(--bg); border: 1px solid var(--border);
  font-weight: 600; font-variant-numeric: tabular-nums;
}
.chip button { background: none; border: 0; color: var(--muted); font-size: 15px; padding: 0; cursor: pointer; }

.ticket-list { list-style: none; margin: 0; padding: 0; }
.ticket-list li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; border-bottom: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}
.ticket-list li:last-child { border-bottom: 0; }
.ticket-list .tipo { color: var(--muted); font-size: 13px; margin-right: 6px; }
.ticket-list .num { font-weight: 700; word-break: break-word; }
.ticket-list .der { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.ticket-list li:not(.ticket-tipo) { gap: 12px; }
.ticket-list li.ticket-tipo { color: var(--muted); font-size: 13px; padding: 10px 0 2px; border-bottom: 0; }
.ticket-list .quitar { background: none; border: 0; color: var(--danger); font-size: 18px; cursor: pointer; padding: 0 2px; }
.ticket-empty { color: var(--muted); padding: 8px 0; }
.ticket-total { font-weight: 700; margin-top: 8px; text-align: right; }

.pendiente-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.pendiente-item:last-child { border-bottom: 0; }
.pendiente-item .meta { font-size: 13px; color: var(--muted); margin-top: 4px; }
.pendiente-item .acciones { display: flex; gap: 8px; margin-top: 8px; }
.pendiente-item .acciones .btn { flex: 1; font-size: 13px; padding: 8px 10px; }

.review-section { margin-bottom: 12px; }
.review-section h4 { margin: 0 0 6px; font-size: 14px; }
.review-line { display: flex; justify-content: space-between; padding: 4px 0; font-variant-numeric: tabular-nums; }
.review-line.bad { color: var(--danger); }
.review-aviso { padding: 6px 0; line-height: 1.4; white-space: pre-line; border-bottom: 1px solid var(--border); }
.review-aviso.warn { color: var(--warn); border-bottom-color: rgba(249, 168, 37, 0.35); }
.review-aviso:last-child { border-bottom: 0; }
.review-saldo { padding: 8px 0; border-top: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.review-saldo:last-child { margin-bottom: 8px; }
.tag { font-size: 11px; padding: 2px 6px; border-radius: 6px; background: rgba(249, 168, 37, 0.2); color: var(--warn); margin-left: 6px; }
/* Panel admin: sin scroll horizontal; pestañas fijas; solo listas con scroll */
body.rc-panel-view {
  overflow-x: hidden;
  max-width: 100vw;
}
body.panel-overlay-open {
  overflow: hidden;
  max-width: 100vw;
}
#view-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  box-sizing: border-box;
  height: calc(
    100dvh - 52px - 72px - env(safe-area-inset-top) - env(safe-area-inset-bottom)
  );
}
#view-panel #panel-seg {
  position: sticky;
  top: 0;
  z-index: 6;
  flex-shrink: 0;
  margin: 0 0 8px;
  padding: 4px 0 8px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  max-width: 100%;
  min-width: 0;
}
#view-panel .panel-body {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.panel-body,
.panel-detalle {
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
  min-width: 0;
}
#panel-detalle:not(.hidden):not(.panel-img-overlay) {
  position: absolute;
  left: 0;
  right: 0;
  top: 48px;
  bottom: 0;
  z-index: 5;
  background: var(--bg);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 0 12px;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.panel-card { margin-bottom: 10px; overflow: hidden; max-width: 100%; min-width: 0; }
.panel-card.panel-card-revisado-dim {
  opacity: 0.78;
  filter: saturate(0.92);
}
.panel-seccion-titulo {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 16px 0 8px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}
.panel-seccion-titulo:first-child {
  border-top: 0;
  margin-top: 0;
  padding-top: 0;
}
.panel-load-more { width: 100%; margin: 8px 0 4px; }
.panel-fail { border-color: rgba(239, 83, 80, 0.55); background: rgba(239, 83, 80, 0.08); }
.panel-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-start;
  min-width: 0;
}
.panel-thumb-wrap {
  flex: 0 1 65%;
  width: 65%;
  max-width: 70%;
  min-width: 0;
  box-sizing: border-box;
  position: relative;
}
.panel-alerta-fraude {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  z-index: 2;
  padding: 6px 8px;
  font-size: 11px;
  line-height: 1.3;
  font-weight: 600;
  color: #fff;
  background: rgba(198, 40, 40, 0.92);
  border-radius: 8px 8px 0 0;
  pointer-events: none;
}
.panel-alerta-fraude.panel-alerta-critica {
  background: rgba(183, 28, 28, 0.96);
  font-size: 12px;
  box-shadow: 0 0 0 2px rgba(255, 82, 82, 0.6);
}
.panel-thumb {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: 240px;
  object-fit: contain;
  object-position: left top;
  border-radius: 8px;
  cursor: pointer;
  background: var(--bg2, #1c1c1e);
}
.panel-comp-side {
  flex: 1 1 140px;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.panel-chat-item {
  width: 100%;
  text-align: left;
  margin-bottom: 8px;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  word-break: break-word;
  overflow-wrap: anywhere;
  font-size: 16px;
  line-height: 1.35;
}
.panel-chat-item strong {
  display: block;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 2px;
}
.panel-chat-preview {
  display: block;
  font-size: 16px;
  line-height: 1.35;
  color: var(--muted);
  font-weight: 400;
}
#panel-msgs {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 0 8px;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
  word-break: break-word;
  overflow-wrap: anywhere;
  box-sizing: border-box;
}
.panel-msg {
  max-width: 100%;
  min-width: 0;
  padding: 8px 11px;
  border-radius: 14px;
  background: var(--bg2, #1c1c1e);
  box-sizing: border-box;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.panel-msg-user {
  align-self: flex-start;
  border-top-left-radius: 4px;
}
.panel-msg-soporte {
  align-self: flex-end;
  background: rgba(23, 138, 64, 0.14);
  border-top-right-radius: 4px;
}
.panel-msg-autor {
  display: block;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 3px;
  color: var(--text2, #dadada);
}
.panel-msg-texto {
  font-size: 17px;
  font-weight: 400;
  line-height: 1.35;
  color: var(--text, #f2f2f2);
  white-space: pre-wrap;
}
.panel-msg-hora {
  display: block;
  font-size: 11px;
  line-height: 1.2;
  color: var(--muted, #9a9a9a);
  margin-top: 5px;
  font-variant-numeric: tabular-nums;
}
.panel-chat-event .panel-msg-hora {
  display: inline;
  margin-top: 0;
  margin-left: 6px;
}
.panel-comp-hora {
  margin-top: 3px;
}
.panel-chat-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.panel-chat-toolbar .btn {
  flex: 1 1 auto;
  min-width: 0;
}
.panel-mbanca-form {
  margin-top: 10px;
  padding: 10px 0 4px;
  border-top: 1px solid var(--border, #333);
}
.panel-mbanca-form.hidden {
  display: none;
}
.panel-mbanca-tit {
  margin: 0 0 8px;
  font-weight: 600;
}
.panel-detalle-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 10px;
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  min-width: 0;
}
.panel-back-btn {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: var(--link, var(--accent));
  font-size: 15px;
  font-weight: 600;
  padding: 6px 4px 6px 0;
  cursor: pointer;
  line-height: 1.2;
}
.panel-detalle-titulo,
#panel-detalle h3 {
  flex: 1 1 auto;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.35;
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#panel-reply.input,
#panel-detalle textarea.input {
  font-size: 17px;
  line-height: 1.35;
  max-width: 100%;
  box-sizing: border-box;
}
.panel-chat-event {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
  margin: 2px 0;
  padding: 4px 8px;
  opacity: 0.85;
  align-self: center;
}
.tag-atendido {
  background: var(--accent-soft, rgba(23, 138, 64, 0.18));
  color: var(--accent, #178a40);
}
.tag-pendiente {
  background: rgba(224, 181, 74, 0.15);
  color: var(--gold, #e0b54a);
}
.panel-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.panel-img-full {
  display: block;
  max-width: min(100%, 100vw);
  width: auto;
  height: auto;
  max-height: min(90vh, 100%);
  object-fit: contain;
  margin: 0 auto;
  border-radius: 12px;
}
.panel-detalle.panel-img-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  margin: 0;
  padding: 12px;
  padding-top: calc(12px + env(safe-area-inset-top));
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  overflow-x: hidden;
  overflow-y: auto;
  max-width: 100vw;
  width: 100vw;
  box-sizing: border-box;
}
.panel-img-overlay .panel-img-full {
  max-width: min(100%, 100vw - 24px);
  max-height: min(90vh, calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 88px));
  flex-shrink: 1;
}
.panel-img-overlay .panel-img-close {
  align-self: center;
  flex-shrink: 0;
  width: min(100%, 320px);
  max-width: 100%;
  z-index: 1;
}
.panel-tag {
  display: inline-block;
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.25;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 8px;
  vertical-align: middle;
}
.panel-chat-item .panel-tag {
  margin-top: 8px;
}
.panel-motivo { color: var(--danger); margin: 4px 0 0; }
.panel-revisado-ok {
  color: var(--accent-text, #fff) !important;
  background: var(--accent, #178a40) !important;
  border-color: var(--accent, #178a40) !important;
  opacity: 1;
  cursor: default;
}

.saldos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.saldo-box { background: var(--bg); border-radius: 12px; padding: 12px; }
.saldo-box .moneda { color: var(--muted); font-size: 12px; }
.saldo-box .valor { font-size: 20px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.saldo-box.bono { grid-column: span 2; }
.saldo-box .nota { font-size: 11px; color: var(--muted); margin-top: 2px; }

.acciones-dinero { margin-bottom: 12px; }
.opciones { display: flex; flex-wrap: wrap; gap: 6px; }
.opciones button {
  padding: 8px 12px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font-size: 14px; font-weight: 600; cursor: pointer;
}
.opciones button.active { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.recarga-datos {
  background: var(--bg); border-radius: 12px; padding: 12px; margin-top: 12px;
  white-space: pre-wrap; line-height: 1.6; word-break: break-word;
}
.copiable {
  display: inline; border: 0; border-radius: 6px; padding: 1px 6px; margin: 0 1px;
  background: rgba(23, 138, 64, 0.18); color: var(--link); cursor: pointer;
  font-family: ui-monospace, Menlo, monospace; font-size: 14px; white-space: normal; word-break: break-all;
}

.check { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); margin-top: 12px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.aviso-ok {
  margin-bottom: 12px; padding: 10px 12px; border-radius: 10px; line-height: 1.5;
  background: rgba(67, 160, 71, 0.15);
}

.jug-loteria { margin-bottom: 14px; }
.jug-loteria h4 { margin: 0 0 6px; }
.jug-tipo { margin: 6px 0 2px; color: var(--muted); font-size: 13px; }
.jug-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 4px 0; font-variant-numeric: tabular-nums; }
.jug-item > span:last-child {
  white-space: nowrap; font-weight: 600;
  display: inline-flex; align-items: center; flex: none;
}
.jug-nums { word-break: break-word; }
.jug-total { text-align: right; font-weight: 700; margin-top: 4px; }
/* Papelera: color danger (no el negro del <button> sin color-scheme dark), icono 22px, pulso 44×44.
   El margen vertical negativo evita que el pulso agrande de más la fila. */
.quitar-btn {
  color: var(--danger);
  background: none; border: 0; padding: 0; margin: -10px -6px -10px 2px;
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; min-height: 44px;
  cursor: pointer; line-height: 1; flex: none; vertical-align: middle;
}
.quitar-btn .ic { width: 22px; height: 22px; }
#quitar-numeros { margin-top: 10px; }
#programar-btn { margin-top: 8px; }
.cal { margin: 4px 0 6px; }
.cal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.cal-mes { font-weight: 700; font-size: 16px; }
.cal-nav { background: none; border: 0; color: var(--link); font-size: 26px; line-height: 1; padding: 0 10px; cursor: pointer; }
.cal-nav:disabled { color: var(--muted); opacity: 0.35; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px 0; text-align: center; }
.cal-sem { font-size: 11px; color: var(--muted); padding-bottom: 4px; }
.cal-dia {
  justify-self: center; width: 38px; height: 38px; border-radius: 50%;
  background: none; border: 0; color: var(--text); font-size: 16px; cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.cal-dia:disabled { color: var(--muted); opacity: 0.4; cursor: default; }
.cal-dia.hoy { color: var(--link); font-weight: 700; }
.cal-dia.rango { background: rgba(23, 138, 64, 0.22); }
.cal-dia.sel { background: var(--accent); color: var(--accent-text); font-weight: 700; }
.prog-fila {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 0; border-top: 1px solid var(--border); font-size: 15px;
}
.prog-fila .opciones { justify-content: flex-end; }
.prog-fila .opciones button { font-size: 13px; padding: 6px 10px; }
.prog-fila .opciones button:disabled { opacity: 0.35; cursor: default; }
.prog-repetir { width: auto; flex: 0 1 auto; padding: 8px 12px; border-radius: 999px; }
.prog-resumen { font-size: 13px; color: var(--muted); margin-top: 6px; line-height: 1.4; }
.prog-resumen.error { color: var(--warn); }
.prog-confirmar { border-radius: 999px; padding: 14px; font-size: 16px; }
.programada { padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.programada:last-child { border-bottom: 0; }

.comprobante-banner { margin-top: 10px; line-height: 1.45; }
.comprobante-progreso { margin-top: 8px; font-weight: 600; }

.alert {
  margin-top: 12px; padding: 10px 12px; border-radius: 10px;
  background: rgba(239, 83, 80, 0.12); color: var(--text); line-height: 1.4;
}
.alert a { color: var(--link); }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; background: var(--bg2);
  border-top: 1px solid rgba(224, 181, 74, 0.22);
  padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  flex: 1; background: none; border: 0; color: var(--muted);
  padding: 8px 0 10px; font-size: 12px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.tab span { display: flex; line-height: 0; }
.tab .ic { width: 22px; height: 22px; margin: 0; }
.tab.active { color: var(--gold); font-weight: 600; }
.tab.active span { background: var(--accent-soft); border-radius: 12px; padding: 3px 14px; margin: -3px 0; }

.toast {
  position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: #222c36; color: #fff; padding: 10px 16px; border-radius: 10px;
  font-size: 14px; z-index: 30; max-width: 90%; text-align: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}
.toast.ok { background: var(--ok); }
.toast.error { background: var(--danger); }
.toast.warn { background: var(--warn); color: #1a1200; text-align: left; }
.toast-multiline { white-space: pre-line; text-align: left; }
.toast-cupo { text-align: left; max-width: min(92vw, 360px); }
.toast-cupo-tit { font-weight: 600; margin-bottom: 4px; }
.toast-cupo-line { font-size: 13px; line-height: 1.35; }
.toast-cupo-pie { margin-top: 6px; opacity: 0.9; font-size: 12px; }

.resultados-hoy {
  margin-top: 16px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg2);
}
.resultados-hoy h4 { margin: 0 0 10px; font-size: 15px; }
.resultado-item {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 12px; padding: 6px 0;
  border-top: 1px solid var(--border);
}
.resultado-item:first-of-type { border-top: 0; }
.resultado-lot { color: var(--muted); font-size: 13px; }
.resultado-num {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: 0.04em;
  font-size: 16px;
}

.soporte-box { margin-top: 12px; }
.soporte-mensajes {
  display: flex; flex-direction: column; gap: 8px;
  max-height: 280px; overflow-y: auto;
  padding: 10px; margin: 8px 0;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
}
.soporte-msg {
  max-width: 88%; padding: 8px 10px; border-radius: 12px;
  font-size: 14px; line-height: 1.35; white-space: pre-wrap; word-break: break-word;
}
.soporte-msg.user {
  align-self: flex-end;
  background: rgba(224, 181, 74, 0.22);
  border-bottom-right-radius: 4px;
}
.soporte-msg.soporte {
  align-self: flex-start;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.soporte-msg .meta {
  display: block; margin-top: 4px; font-size: 11px; color: var(--muted);
}
.soporte-vacio { text-align: center; color: var(--muted); font-size: 13px; padding: 16px 8px; }
.soporte-composer { display: flex; gap: 8px; align-items: flex-end; }
.soporte-composer .input { flex: 1; min-height: 44px; resize: vertical; }
.soporte-composer .btn { flex-shrink: 0; padding: 10px 14px; }

/* --- Perfil, tutorial, cuenta regresiva, top --- */
.topbar-der { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--bg2); color: var(--text); font-weight: 700; font-size: 16px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; padding: 0; flex: none;
}
.icon-btn .ic { width: 16px; height: 16px; margin: 0; }
.cuenta-regresiva {
  margin: -4px 0 12px; padding: 8px 12px; border-radius: 10px; text-align: center;
  background: rgba(23, 138, 64, 0.16); font-weight: 600; font-variant-numeric: tabular-nums;
}
.cuenta-regresiva.urgente { background: rgba(249, 168, 37, 0.18); }
.cuenta-regresiva.cerrado { background: rgba(239, 83, 80, 0.14); }
.seg button .cierra { display: block; font-size: 10px; font-weight: 500; opacity: 0.8; font-variant-numeric: tabular-nums; }
.perfil-nombre { font-size: 17px; font-weight: 600; }
.perfil-nombre-fila { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.perfil-nombre-form { margin-bottom: 10px; }
.perfil-nombre-form .hint.error { color: var(--danger, #e5484d); }
.codigo-ref {
  font-size: 28px; font-weight: 800; letter-spacing: 2px; text-align: center;
  padding: 12px; margin: 6px 0 10px; border-radius: 12px; border: 1px dashed var(--accent);
  background: var(--bg2); user-select: all;
}
.perfil-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.perfil-stats .caja { background: var(--bg2); border-radius: 10px; padding: 8px; text-align: center; }
.perfil-stats .num { font-size: 18px; font-weight: 700; }
.perfil-stats .lbl { font-size: 11px; color: var(--muted); }
.ya-referido { margin: 4px 0; font-weight: 600; }
.top-lista { list-style: none; margin: 0; padding: 0; }
.top-lista li { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); }
.top-lista li:last-child { border-bottom: 0; }
.top-total { margin-top: 10px; font-weight: 700; text-align: center; }
.top-premios { margin-top: 8px; font-size: 13px; color: var(--muted); line-height: 1.5; }
.tour { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 50; }
.tour.sin-foco { background: rgba(0, 0, 0, 0.72); }
.tour-spot {
  position: fixed; border-radius: 14px; pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.72), 0 0 0 3px var(--accent);
  transition: all 0.25s ease;
}
.tour-card {
  position: fixed; left: 12px; right: 12px; max-width: 420px; margin: 0 auto;
  background: var(--bg2); border-radius: 16px; padding: 14px 16px;
  border: 1px solid var(--border); box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  transition: top 0.25s ease;
}
.tour-card::before {
  content: ""; position: absolute; left: var(--flecha-x, 50%); width: 14px; height: 14px;
  background: var(--bg2); transform: translateX(-50%) rotate(45deg); display: none;
}
.tour-card.abajo::before { display: block; top: -7px; border-left: 1px solid var(--border); border-top: 1px solid var(--border); }
.tour-card.arriba::before { display: block; bottom: -7px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.tour-card .row .btn { flex: 1; }
.tutorial-pagos { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; margin-top: 6px; font-size: 14px; }
.tutorial-pagos b { color: var(--warn); }
.tutorial-top { display: flex; justify-content: space-between; align-items: center; }
.tutorial-titulo { font-size: 18px; margin: 6px 0 6px; }
.tutorial-texto { line-height: 1.45; font-size: 14.5px; }
.tutorial-texto p { margin: 4px 0; }
.tutorial-texto ul { padding-left: 18px; margin: 6px 0; }
.tutorial-ejemplo {
  margin: 8px 0; padding: 10px; border-radius: 10px; background: var(--bg);
  font-variant-numeric: tabular-nums; text-align: center; font-size: 22px; font-weight: 800; letter-spacing: 3px;
}
.tutorial-ejemplo .c { color: #f9a825; } .tutorial-ejemplo .f { color: var(--accent); }
.tutorial-ejemplo .sep { display: inline-block; width: 14px; }
.tutorial-puntos { display: flex; justify-content: center; gap: 6px; margin: 10px 0; }
.tutorial-puntos i { width: 8px; height: 8px; border-radius: 50%; background: var(--border); }
.tutorial-puntos i.on { background: var(--accent); }
#perfil-codigo-hint:empty { display: none; }

/* Iconos SVG en línea (sprite Lucide en index.html) */
.ic {
  display: inline-block; flex: none;
  width: 1.15em; height: 1.15em; margin-right: 0.4em;
  vertical-align: -0.2em;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
  overflow: visible;
}
.ic-solo { margin-right: 0; }
.brand { display: flex; align-items: center; }
.brand .ic { color: var(--gold); width: 18px; height: 18px; }
.card-title > span:first-child .ic { color: var(--gold); }
.login-features li .ic { color: var(--gold); }
.ic-ok { color: var(--ok); }
.ic-warn { color: #f5a524; }
.ic-err { color: var(--danger); }
.ic-oro { color: #f5c542; }
.ic-plata { color: #c0c7d1; }
.ic-bronce { color: #d08a4f; }
.punto { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; background: var(--danger); }
.punto.on { background: var(--ok); }

.ref-reglas { margin: 6px 0 0; padding-left: 18px; }
.ref-reglas li { margin: 2px 0; }

/* Centena combinada (prototipo) */
.seg-modo button { display: flex; flex-direction: column; gap: 2px; }
.comb-box { margin-top: 10px; background: var(--bg); border: 1px solid rgba(224,181,74,.45); border-radius: 12px; padding: 10px 12px; }
.comb-head { display: flex; justify-content: space-between; align-items: baseline; }
.comb-head b { color: var(--gold); font-size: 18px; letter-spacing: 2px; }
.comb-perms { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin: 8px 0; }
.comb-perm { text-align: center; padding: 6px 0; border-radius: 8px; background: var(--accent-soft); color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.comb-pago { font-size: 13px; }
.comb-pago b { color: var(--gold); }
.comb-alert { margin-top: 10px; display: flex; flex-direction: column; gap: 4px; }
.comb-sug { font-size: 13px; }
.review-sub { padding: 0 0 6px 2px; }
.premio-ov { position: fixed; inset: 0; background: rgba(0,0,0,.65); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.premio-card { background: var(--bg2); border: 1px solid var(--gold); border-radius: 18px; padding: 22px 18px; text-align: center; width: 100%; }
.premio-card h3 { margin: 6px 0; color: var(--gold); font-size: 22px; }
.premio-res { display: flex; justify-content: center; gap: 8px; margin: 12px 0; }
.premio-res span { width: 46px; height: 46px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; font-size: 22px; display: flex; align-items: center; justify-content: center; }
.premio-monto { font-size: 30px; font-weight: 800; color: var(--gold); margin: 6px 0; }
.push-banner { position: fixed; top: 8px; left: 8px; right: 8px; background: #2c2c2e; color: #fff; border-radius: 16px; padding: 10px 12px; z-index: 60; box-shadow: 0 6px 20px rgba(0,0,0,.5); font-size: 13px; }
.panel-alert-banner {
  margin: 0 0 10px; padding: 10px 12px; border-radius: 12px;
  background: linear-gradient(90deg, rgba(224,181,74,.22), rgba(23,138,64,.15));
  border: 1px solid rgba(224,181,74,.45); font-size: 13px; line-height: 1.4;
}
.panel-alert-banner strong { color: var(--gold); display: block; margin-bottom: 4px; }
.panel-alert-banner button {
  margin-top: 8px; width: 100%; border: 0; border-radius: 10px;
  background: var(--accent); color: #fff; font-weight: 600; padding: 9px;
}
.panel-list-error { color: var(--gold); margin-bottom: 8px; }
.panel-retry { width: 100%; margin-top: 4px; }
.panel-empty { text-align: center; padding: 16px 8px; }
#tab-panel.tab-panel-alert span::after {
  content: " ●"; color: var(--gold); font-size: 10px; vertical-align: super;
}

.premio-por-que { text-align: left; background: var(--bg); border-radius: 12px; padding: 10px 12px; margin: 8px 0; }
.premio-linea { padding: 6px 0; border-top: 1px solid rgba(255,255,255,.06); }
.premio-linea:first-of-type { border-top: 0; }
.prog-resumen { margin: 6px 0 2px; line-height: 1.5; }
.prog-acciones { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.prog-acciones .link-btn { padding: 6px 0; }
.prog-cancelar-todas { color: var(--danger, #e5484d); }
.prog-fechas { margin-top: 4px; }
.pago-actual { margin: 6px 0 4px; padding: 8px 10px; border-radius: 10px; background: rgba(76, 175, 80, .08); border: 1px solid rgba(76, 175, 80, .25); font-size: 13px; line-height: 1.45; }
.top-lista li.top-tu { background: rgba(76, 175, 80, .12); border-radius: 8px; padding: 8px 6px; }
.top-tu-tag { margin-left: 6px; padding: 1px 6px; border-radius: 6px; background: var(--accent, #1e8e3e); color: #fff; font-size: 11px; font-weight: 700; }
.top-tu-linea { position: sticky; bottom: 0; margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: rgba(76, 175, 80, .12); border: 1px solid rgba(76, 175, 80, .3); font-size: 13px; }
.hint-chips { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-top: 4px; }
.hint-chip { white-space: nowrap; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--border); font-size: 11.5px; line-height: 18px; }
.hint-chip b { color: var(--text, #fff); }

/* Tema claro: html[data-theme="light"], o el sistema claro si no se forzó oscuro. */
@media (prefers-color-scheme: light) {
  html:not([data-theme="dark"]) {

    color-scheme: light;
    --bg: var(--tg-theme-bg-color, #f4f5f7);
    --bg2: var(--tg-theme-secondary-bg-color, #ffffff);
    --text: var(--tg-theme-text-color, #16181b);
    --muted: var(--tg-theme-hint-color, #5f6670);
    --text2: #2b2f34;
    --faint: #8a9099;
    --accent: #178a40;
    --accent-text: #ffffff;
    --accent-soft: rgba(23, 138, 64, 0.12);
    --gold: #9a6f00;
    --link: #127a37;
    --danger: #c62828;
    --ok: #2e7d32;
    --warn: #a15c00;
    --border: rgba(20, 24, 28, 0.12);
    --shadow-card: 0 1px 2px rgba(16, 24, 32, 0.06), 0 2px 8px rgba(16, 24, 32, 0.05);

  .card, .saldo-chip { box-shadow: var(--shadow-card); }
  .topbar { background: rgba(244, 245, 247, 0.96); }
  .tabbar {
    background: #ffffff;
    border-top: 1px solid var(--border);
    box-shadow: 0 -2px 10px rgba(16, 24, 32, 0.05);
  }
  .update-banner { background: rgba(249, 168, 37, 0.18); }
  .login-logo { filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.15)); }
  .tag { background: rgba(249, 168, 37, 0.22); color: var(--warn); }
  .review-aviso.warn { border-bottom-color: rgba(161, 92, 0, 0.3); }
  .toast { background: #22272e; color: #fff; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18); }
  .toast.ok { background: var(--ok); color: #ffffff; }
  .toast.error { background: var(--danger); color: #ffffff; }
  .toast.warn { background: #ffe9b8; color: #4a2c00; border: 1px solid #f0c060; }
  .premio-linea { border-top-color: rgba(0, 0, 0, 0.07); }
  .push-banner {
    background: #ffffff;
    color: var(--text);
    border: 1px solid var(--border);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  }
  .tutorial-ejemplo .c { color: #b26a00; }
  .ic-warn { color: #c77700; }
  .ic-oro { color: #c99a06; }
  .ic-plata { color: #8a939e; }
  .ic-bronce { color: #a8642c; }
  .tour-card, .tour .tour-card { box-shadow: 0 10px 40px rgba(0, 0, 0, 0.18); }
  .premio-ov { background: rgba(0, 0, 0, 0.45); }
  .comb-box { border-color: rgba(154, 111, 0, 0.35); }
  .cal-dia.rango { background: rgba(23, 138, 64, 0.14); }
  .top-tu-linea,
  .top-lista li.top-tu { background: rgba(46, 125, 50, 0.08); }
  .pago-actual { background: rgba(46, 125, 50, 0.06); border-color: rgba(46, 125, 50, 0.22); }
  .hint-chip b { color: var(--text); }
  select.input, .input { background: #ffffff; color: var(--text); }
  .input::placeholder { color: #9aa0a8; }

  /* Panel y componentes no en el prototipo base */
  .jug-badge { background: rgba(249, 168, 37, 0.18); }
  .panel-fail {
    border-color: rgba(198, 40, 40, 0.45);
    background: rgba(198, 40, 40, 0.08);
  }
  .panel-alerta-fraude {
    color: #ffffff;
    background: rgba(198, 40, 40, 0.94);
  }
  .panel-alerta-fraude.panel-alerta-critica {
    background: #b71c1c;
    box-shadow: 0 0 0 2px rgba(198, 40, 40, 0.4);
  }
  .panel-msg-soporte { background: rgba(23, 138, 64, 0.1); }
  .tag-pendiente {
    background: rgba(154, 111, 0, 0.12);
    color: var(--gold);
  }
  .panel-alert-banner {
    background: linear-gradient(90deg, rgba(154, 111, 0, 0.12), rgba(23, 138, 64, 0.08));
    border-color: rgba(154, 111, 0, 0.35);
  }
  .copiable { background: rgba(23, 138, 64, 0.1); color: var(--link); }
  .aviso-ok { background: rgba(46, 125, 50, 0.1); }
  .alert { background: rgba(198, 40, 40, 0.08); }
  .soporte-msg.user { background: rgba(154, 111, 0, 0.14); }
  .cuenta-regresiva { background: rgba(23, 138, 64, 0.1); }
  .cuenta-regresiva.urgente { background: rgba(161, 92, 0, 0.12); }
  .cuenta-regresiva.cerrado { background: rgba(198, 40, 40, 0.1); }
  .tour.sin-foco { background: rgba(0, 0, 0, 0.4); }
  .tour-spot {
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.4), 0 0 0 3px var(--accent);
  }
  .top-tu-linea { border-color: rgba(46, 125, 50, 0.25); }
  }
}
html[data-theme="light"] {

    color-scheme: light;
    --bg: var(--tg-theme-bg-color, #f4f5f7);
    --bg2: var(--tg-theme-secondary-bg-color, #ffffff);
    --text: var(--tg-theme-text-color, #16181b);
    --muted: var(--tg-theme-hint-color, #5f6670);
    --text2: #2b2f34;
    --faint: #8a9099;
    --accent: #178a40;
    --accent-text: #ffffff;
    --accent-soft: rgba(23, 138, 64, 0.12);
    --gold: #9a6f00;
    --link: #127a37;
    --danger: #c62828;
    --ok: #2e7d32;
    --warn: #a15c00;
    --border: rgba(20, 24, 28, 0.12);
    --shadow-card: 0 1px 2px rgba(16, 24, 32, 0.06), 0 2px 8px rgba(16, 24, 32, 0.05);

  .card, .saldo-chip { box-shadow: var(--shadow-card); }
  .topbar { background: rgba(244, 245, 247, 0.96); }
  .tabbar {
    background: #ffffff;
    border-top: 1px solid var(--border);
    box-shadow: 0 -2px 10px rgba(16, 24, 32, 0.05);
  }
  .update-banner { background: rgba(249, 168, 37, 0.18); }
  .login-logo { filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.15)); }
  .tag { background: rgba(249, 168, 37, 0.22); color: var(--warn); }
  .review-aviso.warn { border-bottom-color: rgba(161, 92, 0, 0.3); }
  .toast { background: #22272e; color: #fff; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18); }
  .toast.ok { background: var(--ok); color: #ffffff; }
  .toast.error { background: var(--danger); color: #ffffff; }
  .toast.warn { background: #ffe9b8; color: #4a2c00; border: 1px solid #f0c060; }
  .premio-linea { border-top-color: rgba(0, 0, 0, 0.07); }
  .push-banner {
    background: #ffffff;
    color: var(--text);
    border: 1px solid var(--border);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  }
  .tutorial-ejemplo .c { color: #b26a00; }
  .ic-warn { color: #c77700; }
  .ic-oro { color: #c99a06; }
  .ic-plata { color: #8a939e; }
  .ic-bronce { color: #a8642c; }
  .tour-card, .tour .tour-card { box-shadow: 0 10px 40px rgba(0, 0, 0, 0.18); }
  .premio-ov { background: rgba(0, 0, 0, 0.45); }
  .comb-box { border-color: rgba(154, 111, 0, 0.35); }
  .cal-dia.rango { background: rgba(23, 138, 64, 0.14); }
  .top-tu-linea,
  .top-lista li.top-tu { background: rgba(46, 125, 50, 0.08); }
  .pago-actual { background: rgba(46, 125, 50, 0.06); border-color: rgba(46, 125, 50, 0.22); }
  .hint-chip b { color: var(--text); }
  select.input, .input { background: #ffffff; color: var(--text); }
  .input::placeholder { color: #9aa0a8; }

  /* Panel y componentes no en el prototipo base */
  .jug-badge { background: rgba(249, 168, 37, 0.18); }
  .panel-fail {
    border-color: rgba(198, 40, 40, 0.45);
    background: rgba(198, 40, 40, 0.08);
  }
  .panel-alerta-fraude {
    color: #ffffff;
    background: rgba(198, 40, 40, 0.94);
  }
  .panel-alerta-fraude.panel-alerta-critica {
    background: #b71c1c;
    box-shadow: 0 0 0 2px rgba(198, 40, 40, 0.4);
  }
  .panel-msg-soporte { background: rgba(23, 138, 64, 0.1); }
  .tag-pendiente {
    background: rgba(154, 111, 0, 0.12);
    color: var(--gold);
  }
  .panel-alert-banner {
    background: linear-gradient(90deg, rgba(154, 111, 0, 0.12), rgba(23, 138, 64, 0.08));
    border-color: rgba(154, 111, 0, 0.35);
  }
  .copiable { background: rgba(23, 138, 64, 0.1); color: var(--link); }
  .aviso-ok { background: rgba(46, 125, 50, 0.1); }
  .alert { background: rgba(198, 40, 40, 0.08); }
  .soporte-msg.user { background: rgba(154, 111, 0, 0.14); }
  .cuenta-regresiva { background: rgba(23, 138, 64, 0.1); }
  .cuenta-regresiva.urgente { background: rgba(161, 92, 0, 0.12); }
  .cuenta-regresiva.cerrado { background: rgba(198, 40, 40, 0.1); }
  .tour.sin-foco { background: rgba(0, 0, 0, 0.4); }
  .tour-spot {
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.4), 0 0 0 3px var(--accent);
  }
  .top-tu-linea { border-color: rgba(46, 125, 50, 0.25); }
}



/* Selector de tema en Perfil > Ajustes */
.tema-fila {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: 10px 0 4px; padding: 10px 0 2px;
  border-top: 1px solid var(--border);
}
.tema-fila-izq { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.tema-fila-izq .ic { margin: 0; color: var(--gold); width: 20px; height: 20px; }
.tema-opciones { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.tema-opciones button {
  border: 1px solid var(--border); background: var(--bg); color: var(--muted);
  border-radius: 999px; padding: 6px 10px; font-size: 12px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 4px; cursor: pointer;
}
.tema-opciones button .ic { width: 14px; height: 14px; margin: 0; }
.tema-opciones button.active {
  background: var(--accent-soft); color: var(--text); border-color: var(--accent);
}

/* —— Cockpit Duo: dos columnas en ancho; tabbar abajo (el rail del sistema no es usable por web) —— */
html.layout-wide main {
  max-width: none;
  margin: 0;
  padding: 12px 16px;
  padding-left: calc(16px + env(safe-area-inset-left, 0px));
  padding-right: calc(16px + env(safe-area-inset-right, 0px));
}
/* Wrappers: en angosto se apilan como el flujo actual */
.duo-row { display: block; }
.duo-primary, .duo-secondary { min-width: 0; }
html.layout-wide #view-jugar > .duo-row,
html.layout-wide #view-dinero > .duo-row,
html.layout-wide #view-jugadas > .duo-row,
html.layout-wide #view-perfil > .duo-row {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 16px;
  align-items: start;
}
/* Jugar: cuenta-regresiva en DOM tras horario (angosto), columna 2 en wide */
html.layout-wide #view-jugar .duo-primary,
html.layout-wide #view-jugar .duo-secondary {
  display: contents;
}
html.layout-wide #view-jugar #loterias,
html.layout-wide #view-jugar #horario,
html.layout-wide #view-jugar .jugar-form-card {
  grid-column: 1;
}
html.layout-wide #view-jugar #cuenta-regresiva,
html.layout-wide #view-jugar .duo-secondary > * {
  grid-column: 2;
}
/* display:contents en Jugar anula sticky del wrapper; pegar la card del ticket */
html.layout-wide #view-jugar .jugar-ticket-card {
  position: sticky;
  top: calc(12px + env(safe-area-inset-top, 0px));
  align-self: start;
}
html.layout-wide .duo-secondary {
  position: sticky;
  top: calc(12px + env(safe-area-inset-top, 0px));
}
/* Panel admin: lista | detalle lado a lado (overlay imagen sigue fullscreen) */
html.layout-wide #view-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto 1fr;
  height: calc(100dvh - 52px - 72px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
}
html.layout-wide #view-panel #panel-alert-banner {
  grid-column: 1 / -1;
  grid-row: 1;
}
html.layout-wide #view-panel #panel-seg {
  grid-column: 1 / -1;
  grid-row: 2;
}
html.layout-wide #view-panel .panel-body {
  grid-column: 1;
  grid-row: 3;
}
html.layout-wide #panel-detalle:not(.hidden):not(.panel-img-overlay) {
  position: relative;
  left: auto;
  right: auto;
  top: auto;
  bottom: auto;
  grid-column: 2;
  grid-row: 3;
  z-index: 1;
  border-left: 1px solid var(--border);
  padding-left: 12px;
}
/* Unlock page scroll only for split detalle — keep lock when image overlay is open */
html.layout-wide body.panel-overlay-open:not(:has(#panel-detalle.panel-img-overlay)) {
  overflow: auto;
}
