:root {
  --bg: #0d0b14;
  --bg2: #16131f;
  --card: #1d1929;
  --line: #2c2740;
  --txt: #f2f0f7;
  --txt2: #a9a3bd;
  --acento: #7c5cff;
  --acento2: #ff4fa3;
  --ok: #2fd27a;
  --aviso: #ffb020;
  --mal: #ff5b6e;
  --radio: 14px;
  --sombra: 0 10px 30px rgba(0, 0, 0, .35);
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--txt);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; font-size: 16px; line-height: 1.45;
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: inherit; }
img, svg { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
main { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 18px 16px 48px; outline: none; }
h1 { font-size: clamp(26px, 5vw, 40px); line-height: 1.1; margin: 8px 0 12px; letter-spacing: -.5px; }
h2 { font-size: 20px; margin: 28px 0 12px; }
h3 { font-size: 16px; margin: 0 0 6px; }
.sub { color: var(--txt2); margin: 0 0 18px; }
.muted { color: var(--txt2); }
.hidden { display: none !important; }

/* Cabecera */
.top {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; background: rgba(13, 11, 20, .88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.marca { display: flex; align-items: center; gap: 8px; font-weight: 900; letter-spacing: 2px; text-decoration: none; }
.logo-marca { height: 20px; width: auto; }
@media (max-width: 400px) { .logo-marca { height: 18px; } }
/* Firma de ARX abajo a la derecha */
/* izquierda: textos y enlaces; derecha: firma, centrada en altura con el bloque de la izquierda */
.pie .pie-in { display: grid; grid-template-columns: 1fr auto; column-gap: 24px; align-items: center; }
.pie .pie-in > :not(.pie-firma) { grid-column: 1; }
.pie-firma { grid-column: 2; grid-row: 1 / span 3; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; text-decoration: none; }
.pie-firma span { font-size: 11px; color: var(--txt2); letter-spacing: .3px; white-space: nowrap; }
.pie-firma img { height: 18px; width: auto; }
@media (max-width: 640px) {
  .pie .pie-in { grid-template-columns: 1fr; }
  .pie-firma { grid-column: 1; grid-row: auto; align-items: flex-start; margin-top: 12px; }
}
.pie-firma:hover span { color: var(--txt); }
.menu { display: flex; gap: 4px; }
.menu a { text-decoration: none; padding: 8px 10px; border-radius: 10px; color: var(--txt2); font-size: 14px; font-weight: 600; white-space: nowrap; }
.menu a.on, .menu a:hover { color: var(--txt); background: var(--bg2); }
.badge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--acento2); color: #fff; font-size: 11px; text-align: center; }
.rrpp-banner { background: linear-gradient(90deg, var(--acento), var(--acento2)); color: #fff; text-align: center; padding: 8px 16px; font-size: 14px; font-weight: 600; }
.rrpp-banner button { background: none; border: 1px solid #fff; color: #fff; border-radius: 8px; padding: 2px 8px; margin-left: 8px; cursor: pointer; }

/* Botones y formularios */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; cursor: pointer; text-decoration: none;
  background: linear-gradient(135deg, var(--acento), var(--acento2)); color: #fff; font-weight: 700; padding: 11px 18px; border-radius: 12px; min-height: 44px;
}
.btn.sec { background: var(--bg2); border: 1px solid var(--line); }
.btn.peq { padding: 6px 12px; min-height: 34px; font-size: 14px; border-radius: 10px; }
.btn.peligro { background: #3a1620; border: 1px solid #6b2433; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
label { display: block; font-size: 14px; color: var(--txt2); margin-bottom: 4px; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=search], input[type=number], input[type=date], input[type=time], select, textarea {
  width: 100%; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 44px;
}
textarea { min-height: 80px; resize: vertical; }
input[type=file] { width: 100%; max-width: 100%; font-size: 14px; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible { outline: 2px solid var(--acento); outline-offset: 2px; }
.check { display: flex; gap: 10px; align-items: flex-start; color: var(--txt); font-size: 14px; margin: 10px 0; }
.check input { width: 20px; height: 20px; margin-top: 2px; flex: 0 0 auto; }
.campos { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.campo { margin-bottom: 12px; }

/* Rejilla de eventos */
.grid-ev { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.ev-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radio); overflow: hidden; text-decoration: none; display: flex; flex-direction: column; transition: transform .15s; }
.ev-card:hover { transform: translateY(-3px); }
.ev-card .cartel { aspect-ratio: 3/4; background: #000; }
.ev-card .cartel svg, .ev-card .cartel img { width: 100%; height: 100%; object-fit: cover; }
.ev-info { padding: 12px; }
.ev-fecha { font-weight: 800; font-size: 15px; }
.ev-hora { color: var(--txt2); font-size: 14px; margin: 2px 0 6px; }
.ev-tit { font-weight: 800; text-transform: uppercase; font-size: 14px; }
.ev-local { color: var(--txt2); font-size: 13px; margin-top: 4px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 18px; }
.filtros-ev { max-width: 720px; align-items: end; margin-bottom: 8px; }
.filtro-fila { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.filtro-fila .chips { margin: 4px 0 8px; }
.filtro-lab { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--txt2); min-width: 72px; }
.filtro-fila:last-of-type .chips { margin-bottom: 18px; }
.chip { border: 1px solid var(--line); background: var(--bg2); border-radius: 999px; padding: 6px 12px; font-size: 14px; cursor: pointer; }
.chip.on { background: var(--txt); color: var(--bg); border-color: var(--txt); }
.tag { display: inline-block; border: 1px solid var(--line); border-radius: 8px; padding: 3px 8px; font-size: 13px; color: var(--txt2); margin-right: 6px; }
.hero { background: radial-gradient(circle at 20% 0%, rgba(124, 92, 255, .35), transparent 60%), radial-gradient(circle at 90% 30%, rgba(255, 79, 163, .25), transparent 55%), var(--bg2); border: 1px solid var(--line); border-radius: 20px; padding: 28px 22px; margin-bottom: 8px; }
.prom-card { display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radio); padding: 14px; text-decoration: none; max-width: 420px; }

/* Promotora */
.prom-cab { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.logo-kosmos { display: inline-flex; align-items: center; gap: 8px; }
.logo-kosmos b { font-size: 26px; letter-spacing: 5px; }
.cal-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 8px 0 12px; }
.cal-nav h2 { margin: 0; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-dia-sem { text-align: center; font-size: 12px; color: var(--txt2); font-weight: 700; }
.cal-celda { background: var(--bg2); border-radius: 10px; min-height: 64px; padding: 4px; display: flex; flex-direction: column; text-decoration: none; }
.cal-celda .n { font-size: 12px; font-weight: 700; text-align: center; }
.cal-celda .vacio { color: #4b4560; font-size: 10px; text-align: center; margin: auto; }
.cal-celda .mini { flex: 1; border-radius: 6px; overflow: hidden; margin-top: 3px; }
.cal-celda .mini svg, .cal-celda .mini img { width: 100%; height: 100%; object-fit: cover; }
.cal-celda.fuera { opacity: .25; }
.cal-celda.hoy { outline: 1px solid var(--acento); }
@media (min-width: 760px) { .cal-celda { min-height: 150px; } .cal { gap: 10px; } }

/* Evento */
.ev-layout { display: grid; gap: 22px; }
@media (min-width: 860px) { .ev-layout { grid-template-columns: 380px 1fr; align-items: start; } .ev-poster { position: sticky; top: 76px; } }
.ev-poster { border-radius: 16px; overflow: hidden; box-shadow: var(--sombra); background: #000; }
.ev-poster svg, .ev-poster img { width: 100%; }
.ev-datos { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 14px; }
.caja { background: var(--card); border: 1px solid var(--line); border-radius: var(--radio); padding: 16px; margin-bottom: 14px; }
.caja h2 { margin-top: 0; }
.entrada { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.entrada:first-of-type { border-top: 0; }
.entrada .nom { font-weight: 700; }
.entrada .inc { color: var(--txt2); font-size: 13px; }
.entrada .pre { font-weight: 800; font-size: 18px; text-align: right; }
.estado { font-size: 12px; font-weight: 700; border-radius: 6px; padding: 2px 7px; display: inline-block; margin-top: 4px; }
.estado.agotada { background: #3a1620; color: var(--mal); }
.estado.ultimas { background: #3a2a0b; color: var(--aviso); }
.estado.pronto { background: var(--bg2); color: var(--txt2); }
.estado.privada { background: #2a1d4d; color: #c4b5ff; }
.entrada.off .nom, .entrada.off .pre { opacity: .45; }
.cant { display: flex; align-items: center; gap: 6px; grid-column: 1 / -1; justify-content: flex-end; }
.cant button { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg2); cursor: pointer; font-size: 18px; }
.cant output { min-width: 26px; text-align: center; font-weight: 700; }
.resumen { position: sticky; bottom: 0; background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radio); padding: 14px; box-shadow: var(--sombra); }
.resumen .fila { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; color: var(--txt2); }
.resumen .total { color: var(--txt); font-weight: 800; font-size: 18px; margin-top: 6px; }

/* Mis entradas */
.ticket { display: grid; grid-template-columns: 90px 1fr; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radio); padding: 12px; margin-bottom: 12px; }
.ticket .mini { border-radius: 8px; overflow: hidden; }
.codigo { font-family: ui-monospace, Consolas, monospace; font-size: 20px; letter-spacing: 3px; background: #fff; color: #000; display: inline-block; padding: 6px 10px; border-radius: 8px; margin-top: 6px; }

/* Panel */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 8px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radio); padding: 14px; }
.kpi .v { font-size: 24px; font-weight: 800; }
.kpi .l { color: var(--txt2); font-size: 13px; }
.tabla-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radio); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--txt2); font-weight: 600; background: var(--bg2); }
td.num, th.num { text-align: right; }
tr:last-child td { border-bottom: 0; }
.enlace { font-family: ui-monospace, Consolas, monospace; font-size: 13px; color: #c4b5ff; }
.demo-nota { background: #241a3d; border: 1px dashed #5b46a8; color: #d8ceff; border-radius: 12px; padding: 10px 14px; font-size: 14px; margin-bottom: 16px; }
.titular { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px 2px; margin: 0 0 12px; min-width: 0; }
.titular legend { padding: 0 6px; font-weight: 700; font-size: 14px; }
.ticket.con-qr, .ticket { grid-template-columns: 132px 1fr; align-items: start; }
.qr { background: #fff; border-radius: 10px; padding: 8px; width: 132px; height: 132px; display: flex; align-items: center; justify-content: center; }
.qr img, .qr canvas { width: 116px !important; height: 116px !important; }
.qr-no { color: #000; font-weight: 800; }
.logo-club { border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.logo-ini { display: inline-flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--acento), var(--acento2)); color: #fff; font-weight: 900; font-size: 20px; }
.perfil-logo { margin-bottom: 14px; }
.logo-subir { flex-direction: row; gap: 16px; justify-content: flex-start; text-align: left; padding: 14px; }
.demo-nota select { margin: 6px 0; }
.demo-nota { display: flex; flex-direction: column; gap: 2px; }
.puerta { border-color: var(--acento); }
.puerta-res { border-radius: 12px; padding: 12px 14px; margin-top: 4px; line-height: 1.5; }
.puerta-res.bien { background: rgba(47, 210, 122, .14); border: 1px solid var(--ok); }
.puerta-res.mal { background: rgba(255, 91, 110, .14); border: 1px solid var(--mal); }
.label { display: block; font-size: 14px; color: var(--txt2); margin-bottom: 4px; }
.subir { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; cursor: pointer;
  border: 2px dashed var(--acento); background: rgba(124, 92, 255, .08); border-radius: var(--radio); padding: 22px 16px; color: var(--txt); margin: 0; }
.subir:hover { background: rgba(124, 92, 255, .16); }
.subir-t { font-weight: 800; font-size: 17px; }
.subir-s { font-size: 13px; color: var(--txt2); max-width: 420px; }
.subir img { max-height: 220px; border-radius: 10px; margin-top: 8px; }
.oculto-accesible { position: absolute; width: 1px !important; height: 1px; opacity: 0; overflow: hidden; }
.oculto-accesible:focus-visible + *, .subir:focus-within { outline: 2px solid var(--acento); }
.opciones { margin: 4px 0 10px; }
.venta-cab { display: grid; gap: 12px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 700px) { .venta-cab { grid-template-columns: 1fr 300px; } }
.aforo-box { background: var(--bg2); border: 1px solid var(--acento); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.aforo-box label { color: var(--txt); font-weight: 700; margin: 0; }
.opciones .check { margin: 6px 0; }
.graficos { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.barras h3 { margin-bottom: 10px; }
.bfila { display: grid; grid-template-columns: minmax(90px, 38%) 1fr 44px; gap: 8px; align-items: center; margin: 6px 0; font-size: 13px; }
.blab { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--txt2); }
.bpista { background: var(--bg2); border-radius: 6px; height: 14px; overflow: hidden; }
.bbarra { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--acento), var(--acento2)); }
.bval { text-align: right; font-weight: 700; }
.tramos-ed { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 8px; align-items: end; }

/* Pie, cookies, toast */
.pie { border-top: 1px solid var(--line); background: var(--bg2); }
.pie-in { max-width: 1180px; margin: 0 auto; padding: 22px 16px; font-size: 14px; color: var(--txt2); }
.pie nav { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 8px 0; }
.pie a { color: var(--txt2); }
.pie-marca { color: var(--txt); font-weight: 700; margin: 0; }
.pie-demo { font-size: 12px; margin: 8px 0 0; }
.cookies { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 50; max-width: 520px; margin: 0 auto; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; box-shadow: var(--sombra); }
.cookies h2 { margin: 0 0 6px; font-size: 17px; }
.cookies p { font-size: 14px; color: var(--txt2); margin: 0 0 12px; }
.cookies-btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.cookies-prefs label { color: var(--txt); display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; background: var(--txt); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-weight: 600; font-size: 14px; max-width: calc(100% - 32px); }

@media (max-width: 520px) {
  .menu a { padding: 8px 7px; font-size: 13px; }
  .marca span { display: none; }
  .ticket { grid-template-columns: 1fr; }
  .cal-celda .vacio { display: none; }
}

/* ---- FESTES: tipos, calendario de pueblos, mesas ---- */
.tipo-badge { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; padding: 3px 8px; border-radius: 999px;
  background: color-mix(in srgb, var(--c) 22%, transparent); color: var(--c); border: 1px solid color-mix(in srgb, var(--c) 55%, transparent); vertical-align: middle; }
.ev-card .cartel { position: relative; }
.ev-info .tipo-badge { margin-bottom: 6px; }
@media (max-width: 520px) { .grid-ev { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .ev-info { padding: 10px; } .ev-tit { font-size: 13px; } }
.ev-extra { font-size: 13px; font-weight: 700; color: var(--acento); margin-top: 4px; }
.ev-datos .tipo-badge { align-self: center; }
.botones { display: flex; gap: 8px; flex-wrap: wrap; }
.hero h1 { max-width: 760px; }
.chip { display: inline-flex; align-items: center; gap: 6px; }
.chip .punto { width: 9px; height: 9px; border-radius: 50%; background: var(--c); display: inline-block; }
.chip.on .punto { box-shadow: 0 0 0 2px var(--bg); }
.leyenda { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--txt2); margin: -4px 0 10px; }
.leyenda span { display: inline-flex; align-items: center; gap: 6px; }
.leyenda i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
button.cal-celda { border: 0; cursor: pointer; text-align: left; font: inherit; color: inherit; width: 100%; min-width: 0; }
.cal-celda { min-width: 0; }
.cal-celda.con { background: var(--card); border: 1px solid var(--line); }
.cal-celda.con:hover { border-color: var(--acento); }
.cal-celda.sel { outline: 2px solid var(--acento); background: color-mix(in srgb, var(--acento) 14%, var(--card)); }
.cal-celda.pasado { opacity: .5; }
.cal-evs { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; min-width: 0; }
.cal-ev { display: flex; align-items: center; gap: 4px; min-width: 0; font-size: 11px; line-height: 1.2; }
.cal-ev i { flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.cal-ev em { font-style: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cal-mas { font-size: 11px; color: var(--txt2); font-weight: 700; }
@media (max-width: 759px) {
  .cal-celda { min-height: 54px; }
  .cal-evs { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 3px; }
  .cal-ev em { display: none; }
  .cal-ev i { width: 8px; height: 8px; }
  .cal-mas { font-size: 10px; }
}
@media (min-width: 760px) { .cal-celda { min-height: 104px; } .cal-ev { background: color-mix(in srgb, var(--c) 16%, transparent); border-radius: 5px; padding: 2px 4px; } }
.dia-sel { margin-top: 12px; }
.fila-ev { display: grid; grid-template-columns: 54px 1fr; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); text-decoration: none; }
.dia-sel h3 + .fila-ev, .fila-ev:first-child { border-top: 0; }
.fila-ev-c { border-radius: 6px; overflow: hidden; aspect-ratio: 3/4; display: block; background: #000; }
.fila-ev-c svg, .fila-ev-c img { width: 100%; height: 100%; object-fit: cover; }
.fila-ev-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fila-ev-t .tipo-badge { align-self: flex-start; }
.fila-ev:hover b { color: var(--acento); }
.proms { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.proms .prom-card { max-width: none; }
.prom-card h3 { margin: 0; }

/* Mesas */
.mesas { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; margin: 10px 0 4px; }
.mesa { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 6px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg2); cursor: pointer; font-size: 13px; color: var(--txt2); }
.mesa b { font-size: 15px; color: var(--txt); }
.mesa .mesa-est { font-size: 12px; font-weight: 700; margin-top: 2px; }
.mesa.libre { border-color: color-mix(in srgb, var(--ok) 55%, var(--line)); }
.mesa.libre .mesa-est { color: var(--ok); }
.mesa.libre:hover, .mesa.elegida { background: color-mix(in srgb, var(--ok) 14%, var(--bg2)); outline: 2px solid var(--ok); }
.mesa.ocupada { opacity: .45; cursor: not-allowed; }
.mesa.mia { cursor: default; border-color: var(--acento); }
.mesa.mia .mesa-est { color: var(--acento); }
.form-mesa { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 14px; }
.boc-fila { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.boc-fila .nom { font-weight: 700; }
.boc-fila .inc { color: var(--txt2); font-size: 13px; }
.cant button:disabled { opacity: .35; cursor: not-allowed; }
.falta { font-weight: 700; padding: 10px 12px; border-radius: 10px; background: rgba(255, 176, 32, .12); border: 1px solid var(--aviso); color: var(--aviso); margin: 8px 0; }
.falta.ok { background: rgba(47, 210, 122, .12); border-color: var(--ok); color: var(--ok); }
.intol-box { border-color: var(--aviso); }
.intol-box h3 { margin-bottom: 8px; }

/* Avisos */
.aviso { display: grid; grid-template-columns: 76px 1fr; gap: 14px; text-decoration: none; padding: 12px; }
.aviso.nuevo { border-color: var(--acento); box-shadow: 0 0 0 1px var(--acento) inset; }
.aviso-c { border-radius: 8px; overflow: hidden; aspect-ratio: 3/4; background: #000; display: block; }
.aviso-c svg, .aviso-c img { width: 100%; height: 100%; object-fit: cover; }
.aviso-t { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.aviso-cuando { font-weight: 800; }

/* Crear evento */
.seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 4px 0 8px; }
.seg-op { margin: 0; cursor: pointer; }
.seg-op input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg-op span { display: block; text-align: center; padding: 12px 6px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg2); color: var(--txt); font-weight: 800; }
.seg-op input:checked + span { background: color-mix(in srgb, var(--c) 22%, var(--bg2)); border-color: var(--c); color: var(--c); }
.seg-op input:focus-visible + span { outline: 2px solid var(--c); outline-offset: 2px; }
@media (max-width: 420px) { .seg { grid-template-columns: repeat(2, 1fr); } }
.ayuda { font-size: 14px; color: var(--txt); background: var(--bg2); border-left: 3px solid var(--acento); padding: 8px 12px; border-radius: 0 10px 10px 0; margin: 0 0 14px; }
.fila-din { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.fila-din input { flex: 1; }
.fila-din.mesas-ed { align-items: end; }
.fila-din.mesas-ed > div { flex: 1; }
.plegable summary { cursor: pointer; padding: 2px 0; }
.plegable[open] summary { margin-bottom: 10px; }
.graficos h3 { margin: 0 0 8px; }

.aviso-pueblo { border-color: var(--aviso); background: linear-gradient(135deg, rgba(255, 176, 32, .10), transparent 60%), var(--card); }
.aviso-pueblo h3 { font-size: 18px; }
.fila-din.mesas-ed { flex-wrap: wrap; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg2); }
.fila-din.mesas-ed > div { flex: 1 1 130px; }
.tipo-mesa { margin-top: 10px; }
.tipo-mesa .entrada { border-top: 1px solid var(--line); }
input[type=search]::-webkit-search-decoration { -webkit-appearance: none; }

/* Wallet (1.5): saldo grande, estado de pulsera, accesos, QR de pago e historial con iconos */
.wal-cab { position: relative; display: flex; align-items: center; gap: 16px; padding: 22px 18px; border-radius: 22px; border: 1px solid color-mix(in srgb, var(--acento) 60%, var(--line));
  background: radial-gradient(circle at 85% 20%, rgba(255, 79, 163, .35), transparent 55%), radial-gradient(circle at 10% 100%, rgba(124, 92, 255, .45), transparent 60%), var(--bg2); margin-bottom: 12px; }
.wal-ticket { width: 76px; height: 76px; flex: 0 0 auto; filter: drop-shadow(0 6px 18px rgba(124, 92, 255, .5)); }
.wal-v { font-size: clamp(34px, 9vw, 48px); font-weight: 900; line-height: 1.05; font-variant-numeric: tabular-nums; }
.wal-pulsera { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; font-weight: 700; font-size: 15px; }
.wal-pulsera i { width: 10px; height: 10px; border-radius: 50%; }
.wal-pulsera.si { color: var(--ok); } .wal-pulsera.si i { background: var(--ok); }
.wal-pulsera.no { color: var(--mal); } .wal-pulsera.no i { background: var(--mal); }
.wal-beta { position: absolute; top: 12px; right: 12px; font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 999px; background: rgba(0, 0, 0, .35); border: 1px solid var(--line); }
.wal-acc { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.wal-b { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 92px; padding: 10px 4px; border-radius: 16px; border: 1px solid color-mix(in srgb, var(--acento) 45%, var(--line)); background: var(--card); color: var(--txt); cursor: pointer; font-size: 13px; font-weight: 700; text-align: center; }
.wal-b:hover { border-color: var(--acento2); }
.wal-b svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.wal-qr { display: flex; align-items: center; gap: 16px; }
.wal-qr h3 { margin: 0 0 4px; }
.wal-qr .muted { font-size: 14px; margin: 0 0 10px; }
.wal-qr-img { flex: 0 0 auto; background: #fff; border-radius: 14px; padding: 8px; width: 132px; height: 132px; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 3px var(--acento), 0 0 22px rgba(255, 79, 163, .35); }
.wal-qr-img img, .wal-qr-img canvas { width: 116px !important; height: 116px !important; }
.hist { display: flex; flex-direction: column; margin-top: 8px; }
.hist-f { display: grid; grid-template-columns: 36px 1fr auto; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.hist-ico { grid-row: 1 / span 2; font-size: 24px; text-align: center; }
.hist-t { display: flex; flex-direction: column; min-width: 0; }
.hist-t b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-t .muted { font-size: 13px; }
.hist-imp { font-weight: 800; white-space: nowrap; }
.hist-imp.menos { color: var(--acento2); } .hist-imp.mas { color: var(--ok); }
.hist-est { grid-column: 3; font-size: 12px; color: var(--txt2); text-align: right; }
a.wal-b { text-decoration: none; }
@media (max-width: 420px) { .wal-acc { grid-template-columns: repeat(2, 1fr); } .wal-qr { flex-direction: column; text-align: center; } }
/* Transferencias por código (nunca QR) */
.volver { margin: 0 0 6px; } .volver a { text-decoration: none; font-weight: 700; }
.tr-cols { display: grid; grid-template-columns: 1fr 1.3fr; gap: 14px; align-items: start; }
.tr-cols .caja { margin: 0; }
.tr-cols h3 { margin-top: 0; }
.tr-cod { font-size: 38px; font-weight: 900; letter-spacing: .18em; text-align: center; padding: 18px 10px; margin: 6px 0 10px; border-radius: 16px; border: 1px dashed color-mix(in srgb, var(--acento) 60%, var(--line)); background: var(--bg2); font-variant-numeric: tabular-nums; user-select: all; }
.tr-recibir .botones .btn { flex: 1 1 120px; }
.tr-enviar label { text-transform: uppercase; font-size: 12px; font-weight: 800; letter-spacing: .06em; }
.tr-enviar #trDest { text-transform: uppercase; letter-spacing: .12em; font-weight: 800; }
.tr-quien { min-height: 22px; margin-top: 6px; font-size: 14px; }
.tr-si { color: var(--ok); } .tr-no, .tr-err { color: var(--mal); }
.tr-err { margin: 0 0 8px; font-size: 14px; min-height: 0; }
.tr-err:empty { display: none; }
.tr-nota { font-size: 13px; margin: 6px 0 0; }
.tr-btn { width: 100%; min-height: 50px; font-size: 17px; }
.tr-cols + .caja { margin-top: 14px; }
@media (max-width: 760px) { .tr-cols { grid-template-columns: 1fr; } .tr-cod { font-size: 32px; } }
/* QR a pantalla completa y aviso de pago al cliente */
.qr-pantalla { position: fixed; inset: 0; z-index: 90; background: rgba(5, 4, 10, .92); display: flex; align-items: center; justify-content: center; padding: 16px; }
.qr-pantalla-in { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 22px; max-width: 420px; width: 100%; text-align: center; display: flex; flex-direction: column; gap: 10px; }
.qr-pantalla-in > b { font-size: 20px; }
.qr-grande { background: #fff; border-radius: 16px; padding: 14px; margin: 0 auto; display: flex; align-items: center; justify-content: center; }
.pago-items div { display: flex; justify-content: space-between; padding: 4px 0; }
/* Cobro en barra: artículos con [−] cantidad [+] */
.qr-res.cobro { text-align: left; }
.cobro-prods { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin: 8px 0 12px; }
.cobro-p { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg2); text-align: center; }
.cobro-p img { width: 54px; height: 54px; object-fit: contain; background: #fff; border-radius: 10px; padding: 4px; }
.cobro-p .cant { grid-column: auto; justify-content: center; }
.cobro-p .cant button { width: 42px; height: 42px; font-size: 22px; }
/* Escáner: resultado grande y claro (✓ verde / ✕ rojo) */
.qr-res { margin-top: 12px; border-radius: 18px; padding: 22px 18px; text-align: center; border: 2px solid var(--line); background: var(--card); }
.qr-res.si { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, var(--card)); }
.qr-res.no { border-color: var(--mal); background: color-mix(in srgb, var(--mal) 12%, var(--card)); }
.qr-res h2 { margin: 10px 0 8px; font-size: 24px; }
.qr-icono { width: 96px; height: 96px; margin: 0 auto; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 58px; font-weight: 900; color: #fff; }
.qr-icono.si { background: var(--ok); }
.qr-icono.no { background: var(--mal); }
.qr-icono.espera { background: var(--line); }
.qr-det { font-size: 16px; line-height: 1.5; }
.qr-aviso { font-weight: 800; color: var(--aviso); margin: 10px 0 0; }
.qr-btns { justify-content: center; margin-top: 14px; }
.qr-btn { min-height: 52px; font-size: 18px; padding: 12px 22px; margin-top: 14px; }
.qr-btns .qr-btn { margin-top: 0; flex: 1 1 160px; }
/* Cartera: pedidos entregados (historial 15 días) */
.entregados { display: flex; flex-direction: column; }
.entregado { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.ent-ico { font-size: 26px; }
.ent-t { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.ent-t .muted { font-size: 13px; }
.ent-imp { font-weight: 800; color: var(--mal); white-space: nowrap; }
.pu-video { width: 100%; max-width: 420px; border-radius: 12px; background: #000; margin-bottom: 10px; display: block; }
.campos-perfil { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

/* Inicio: saludo personal */
.hola { padding: 18px 0 6px; }
.hola h1 { margin: 2px 0 6px; font-size: clamp(30px, 7vw, 46px); }
.hola-pre { margin: 0; color: var(--txt2); font-size: 14px; text-transform: uppercase; letter-spacing: 1px; }
.hola-nombre { background: linear-gradient(90deg, var(--acento), var(--acento2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.accesos { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin: 14px 0 8px; }
.acceso { display: flex; flex-direction: column; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radio); padding: 14px; text-decoration: none; min-width: 0; }
.acceso:hover { border-color: var(--acento); }
.acceso span { color: var(--txt2); font-size: 13px; }
.lo-tuyo { display: grid; gap: 8px; }
.tuyo { display: flex; gap: 12px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radio); padding: 10px 12px; text-decoration: none; min-width: 0; }
.tuyo > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.tuyo-dia { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 52px; height: 52px; border-radius: 12px; background: var(--bg2); font-size: 12px; text-transform: uppercase; color: var(--txt2); }
.tuyo-dia b { font-size: 20px; color: var(--txt); line-height: 1; }
.cab-sec { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.cab-sec a { font-size: 14px; color: var(--txt2); }
.tipo-badge.priv { --c: var(--txt2); }

/* Monedero */
.saldo { background: radial-gradient(circle at 15% 0%, rgba(124, 92, 255, .35), transparent 60%), radial-gradient(circle at 95% 30%, rgba(255, 79, 163, .28), transparent 55%), var(--bg2); border: 1px solid var(--line); border-radius: 20px; padding: 20px; margin-bottom: 8px; }
.saldo-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding-bottom: 14px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.saldo-av { flex: 0 0 auto; width: 62px; height: 62px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #2a1d4d; border: 1px solid #5b46a8; color: #c4b5ff; font-weight: 800; font-size: 20px; }
.recargas .btn { background: #241d36; border: 1px solid #3a3157; }
.recarga-libre { margin-top: 12px; max-width: 360px; }
.recarga-fila { display: flex; gap: 8px; }
.recarga-fila input { flex: 1; min-width: 0; }
.recargas .btn:hover { background: #2e2545; }
.saldo-lab { font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--txt2); font-weight: 700; }
.saldo-v { font-size: clamp(32px, 8vw, 44px); font-weight: 900; margin: 4px 0; font-variant-numeric: tabular-nums; }
.recargas-tit { margin-top: 14px; font-size: 13px; font-weight: 700; color: var(--txt2); text-transform: uppercase; letter-spacing: .5px; }
/* recargas: siempre 2 columnas (en el móvil, 2 filas de 2) */
.recargas { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; max-width: 420px; }
.recargas .btn { width: 100%; font-size: 17px; }

/* Pedir en barra */
.barra-cab { display: flex; align-items: center; gap: 14px; }
.barra-cab h1 { margin: 6px 0; }
#bBuscar { margin: 4px 0 14px; }
.prods { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; padding-bottom: 84px; }
.prod { display: flex; flex-direction: column; padding: 0; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: var(--card); cursor: pointer; text-align: left; color: var(--txt); }
.prod:hover { border-color: var(--acento); }
.prod-img { position: relative; display: flex; align-items: center; justify-content: center; background: #fff; aspect-ratio: 1.35; }
.prod-img img { width: 62%; height: 80%; object-fit: contain; }
.prod-pre { position: absolute; top: 8px; right: 8px; background: linear-gradient(135deg, var(--acento), var(--acento2)); color: #fff; font-weight: 800; font-size: 13px; padding: 3px 9px; border-radius: 999px; }
.prod-n { position: absolute; top: 8px; left: 8px; min-width: 26px; height: 26px; border-radius: 13px; background: var(--ok); color: #04130b; font-weight: 800; display: flex; align-items: center; justify-content: center; font-size: 13px; }
.prod-nom { padding: 10px 12px; font-weight: 800; background: #15121d; }
.m18 { display: inline-block; background: #f7d9a8; color: #5a3a00; font-size: 11px; font-weight: 800; border-radius: 999px; padding: 1px 7px; vertical-align: middle; }
.barra-pie { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; padding: 12px max(16px, env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); background: rgba(13, 11, 20, .92); border-top: 1px solid var(--line); }
.barra-pie .btn { width: 100%; max-width: 640px; margin: 0 auto; display: flex; }
.barra-total { display: flex; justify-content: space-between; font-size: 22px; font-weight: 900; padding-top: 12px; border-top: 1px solid var(--line); margin-top: 6px; }
.pago-op { display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.pago-op.on { border-color: var(--ok); }
.pago-op.off { opacity: .75; }
.pago-op span { color: var(--txt2); font-size: 14px; }

/* Panel: submenús y artículos de la barra */
.subnav { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.prods-ed { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.prod-ed { background: var(--card); border: 1px solid var(--line); border-radius: var(--radio); padding: 12px; min-width: 0; }
.prod-ed-img { display: flex; flex-direction: column; align-items: center; gap: 6px; background: #fff; border-radius: 12px; padding: 10px; margin: 0 0 10px; cursor: pointer; }
.prod-ed-img img { width: 96px; height: 96px; object-fit: contain; }
.prod-ed-img span { color: #444; font-size: 12px; font-weight: 700; }

/* Cuenta: caja de acceso, iniciar sesión y crear cuenta */
.acceso-caja { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 18px; margin: 14px 0; max-width: 520px; }
.acceso-caja .acceso-tit { font-weight: 800; font-size: 18px; margin: 0 0 4px; }
.acceso-caja .muted { margin: 0 0 14px; font-size: 14px; }
.acceso-caja .botones .btn { flex: 1 1 140px; }
.auth { max-width: 440px; margin: 10px auto 0; }
.auth.auth-ancho { max-width: 640px; }
.auth h1 { margin-bottom: 6px; }
.auth-tit { text-align: center; font-size: clamp(30px, 7vw, 44px); }
.auth-sub { text-align: center; }
.btn-google { width: 100%; min-height: 50px; display: flex; align-items: center; justify-content: center; gap: 12px; background: #fff; color: #1f1f1f; border: 1px solid #dadce0; border-radius: 12px; font-weight: 700; font-size: 16px; cursor: pointer; }
.btn-google:hover { background: #f3f4f6; }
.btn-google svg { flex: 0 0 auto; }
.auth-o { display: flex; align-items: center; gap: 12px; color: var(--txt2); font-size: 13px; margin: 18px 0; }
.auth-o::before, .auth-o::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.auth-btn { width: 100%; margin-top: 4px; }
.enlace-btn { display: block; margin: 12px auto 0; background: none; border: 0; color: var(--txt2); text-decoration: underline; cursor: pointer; font-size: 14px; }
.auth-pie { text-align: center; color: var(--txt2); margin: 16px 0 0; }
.auth-pie a { color: var(--txt); font-weight: 700; }

/* Beta: barra de ejemplos (admins, Noemí y cuentas de prueba) */
.ej-barra { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; background: #241a3d; border: 1px dashed #5b46a8; color: #d8ceff; border-radius: 12px; padding: 8px 12px; margin-bottom: 14px; font-size: 14px; }
.ej-txt { flex: 1 1 auto; }
.ej-como { display: flex; align-items: center; gap: 8px; margin: 0; color: inherit; flex: 1 1 260px; }
.ej-como select { min-height: 36px; padding: 4px 8px; }

/* Listas con buscador y flecha para plegar */
.lb { margin: 28px 0 8px; }
.lb-cab { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.lb-cab h2, .lb-cab h3 { margin: 0; }
.lb-tog { min-width: 40px; font-size: 16px; }
.lb-q { margin-bottom: 10px; max-width: 520px; }
.lb-pie { font-size: 13px; margin: 6px 0 0; }
.caja .lb { margin-top: 16px; }
/* Pantalla de carga al abrir la app */
.splash { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; background: var(--bg); transition: opacity .35s ease; }
.splash.fuera { opacity: 0; pointer-events: none; }
.splash-ticket { width: 132px; height: 132px; filter: drop-shadow(0 10px 30px rgba(124, 92, 255, .45)); animation: latido 1.4s ease-in-out infinite; }
.splash-txt { color: var(--txt2); font-size: 14px; letter-spacing: 1px; }
@keyframes latido { 0%, 100% { transform: scale(1) rotate(-4deg); } 50% { transform: scale(1.06) rotate(-4deg); } }
@media (prefers-reduced-motion: reduce) { .splash-ticket { animation: none; transform: rotate(-4deg); } }

.roles-caja summary { cursor: pointer; }
.roles-caja .tabla-wrap { margin-top: 10px; }
.roles-caja td { white-space: normal; min-width: 120px; }

/* Cabecera del panel del cliente: su logo y su nombre */
.cli-cab { display: flex; align-items: center; gap: 14px; margin: 4px 0 14px; }
.cli-cab h1 { margin: 0 0 2px; }
.cli-cab + .tabs { padding-bottom: 12px; border-bottom: 1px solid var(--line); }

/* Perfil tipo red social */
.avatar { border-radius: 50%; object-fit: cover; flex: 0 0 auto; display: inline-block; }
.avatar-ini { display: inline-flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--acento), var(--acento2)); color: #fff; font-weight: 900; }
.perfil-red { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 6px 0 14px; }
.perfil-red-t { flex: 1 1 180px; min-width: 0; }
.perfil-red-t h2 { margin: 0 0 2px; overflow-wrap: anywhere; }
.perfil-cuentas { display: flex; gap: 16px; margin-top: 8px; color: var(--txt2); font-size: 14px; }
.perfil-cuentas button { background: none; border: 0; color: inherit; padding: 0; cursor: pointer; font-size: 14px; }
.perfil-cuentas b { color: var(--txt); font-size: 16px; }
.perfil-foto { position: relative; cursor: pointer; margin: 0; border-radius: 50%; }
.perfil-foto-t { position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%); background: var(--card); border: 1px solid var(--line); border-radius: 999px; font-size: 11px; padding: 2px 8px; white-space: nowrap; color: var(--txt); }
.perfil-foto:focus-within { outline: 2px solid var(--acento); }
.red-tabs { margin-top: 4px; }
.personas { display: flex; flex-direction: column; }
.persona { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.persona:first-child { border-top: 0; }
.persona-a { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; text-decoration: none; }
.persona-a > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.persona-a b, .persona-a .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.persona-a .muted { font-size: 14px; }
.persona .btn { flex: 0 0 auto; min-width: 104px; }
.btn.btn-seguir { background: #3987e5; }
.hdatos { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px 16px; }
.hdato { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hdato span { font-size: 12px; color: var(--txt2); text-transform: uppercase; letter-spacing: .5px; }
.hdato b { overflow-wrap: anywhere; }
.saldo-der { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.movs { margin: 0 0 14px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.movs h3 { margin: 0 0 8px; }
.priv-caja { background: var(--bg2); border: 1px solid var(--acento); border-radius: 12px; padding: 10px 12px; margin: 14px 0 10px; }
.dnav { display: flex; align-items: center; gap: 10px; margin: 2px 0 6px; }
.dnav .btn { min-width: 40px; font-size: 18px; }

/* Datos (administradores): filtros, gráfica anual y barras */
.dfiltros { display: flex; flex-direction: column; gap: 2px; }
.dfiltros .chips { margin: 2px 0 6px; }
.dfiltros select { width: auto; min-height: 34px; padding: 4px 10px; }
.dgraf { width: 100%; height: auto; display: block; overflow: visible; }
.dgraf .dgrid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 4; }
.dgraf .dbase { stroke: var(--txt2); stroke-width: 1; opacity: .5; }
.dgraf .deje { fill: var(--txt2); font-size: 12px; }
.dgraf .deje.hoy { fill: var(--txt); font-weight: 800; }
.dgraf .dval { fill: var(--txt); font-size: 12px; font-weight: 700; }
@media (max-width: 640px) { .dgraf .deje, .dgraf .dval { font-size: 22px; } }
.dgraf rect { cursor: pointer; }
.dgraf rect:hover { opacity: .85; }
.dbarras .bfila { grid-template-columns: minmax(90px, 34%) 1fr auto; margin: 10px 0; }
.dbarras .bpista { height: 16px; }
.dbarras .bval { min-width: 64px; }
.dtip { position: fixed; z-index: 70; pointer-events: none; background: var(--txt); color: var(--bg); font-size: 13px; font-weight: 700; padding: 6px 10px; border-radius: 8px; box-shadow: var(--sombra); white-space: nowrap; }

/* Iconos del menú: en el ordenador no se ven (va el texto) */
.menu .ico { display: none; width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.menu a { position: relative; }

/* Perfil estilo Instagram: cifras grandes y botones a lo ancho */
.perfil-cuentas button, .perfil-cuentas span { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; }
.perfil-botones { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; margin: 0 0 14px; }
.perfil-botones .btn { min-height: 40px; padding: 8px 12px; }
.perfil-mas { width: 44px; font-size: 20px; }

/* Perfil: barra de arriba con @usuario y el menú ☰ */
.perfil-barra { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 10px; font-size: 20px; }
.btn-menu { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; color: var(--txt); }
.btn-menu:hover { background: var(--bg2); }
.btn-menu svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.punto-aviso { position: absolute; top: 8px; right: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--acento2); }
.perfil-nombre { font-weight: 700; margin-bottom: 6px; }
.perfil-bio { white-space: pre-line; margin: -4px 0 14px; overflow-wrap: anywhere; }
.perfil-gestion { display: flex; flex-wrap: wrap; }
.perfil-gestion .btn { flex: 1 1 120px; }
.notis { display: flex; flex-direction: column; }
/* Perfil de otra persona: menú ⋯ */
.pf-acciones { position: relative; }
.btn-menu svg circle { fill: currentColor; stroke: none; }
button.btn-menu { background: none; border: 0; cursor: pointer; }
.menu-pop { position: absolute; right: 0; top: 48px; z-index: 40; min-width: 250px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 6px; box-shadow: var(--sombra); display: flex; flex-direction: column; }
.menu-pop button { display: flex; align-items: center; gap: 12px; background: none; border: 0; color: var(--txt); text-align: left; padding: 12px; border-radius: 10px; font-size: 15px; cursor: pointer; }
.menu-pop button:hover { background: var(--bg2); }
.menu-pop button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.menu-pop .rojo { color: var(--mal); }
.perfil-botones.dos { grid-template-columns: 1fr 1fr; }
/* Mensajes */
.chats { display: flex; flex-direction: column; }
.chat-fila { display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-bottom: 1px solid var(--line); text-decoration: none; border-radius: 10px; }
.chat-fila:hover { background: var(--bg2); }
.chat-fila.nuevo .muted { color: var(--txt); font-weight: 700; }
.chat-t { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.chat-t b, .chat-t .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-t .muted { font-size: 14px; }
.chat-h { font-size: 12px; color: var(--txt2); flex: 0 0 auto; text-align: right; }
.chat-cab { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.msgs { display: flex; flex-direction: column; gap: 6px; padding: 14px 0; max-height: calc(100vh - 300px); min-height: 220px; overflow-y: auto; }
.msg { align-self: flex-start; max-width: 78%; background: var(--card); border: 1px solid var(--line); border-radius: 18px 18px 18px 6px; padding: 8px 12px; display: flex; flex-direction: column; }
.msg.mio { align-self: flex-end; background: linear-gradient(135deg, var(--acento), var(--acento2)); border: 0; border-radius: 18px 18px 6px 18px; color: #fff; }
.msg-de { font-size: 12px; font-weight: 800; color: var(--txt2); }
.msg-t { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-h { font-size: 11px; opacity: .7; align-self: flex-end; }
.msg-form { display: flex; gap: 8px; position: sticky; bottom: 0; background: var(--bg); padding: 8px 0; }
.msg-form input { flex: 1; min-width: 0; border-radius: 999px; }
.grupo-op { cursor: pointer; }
.grupo-op input { width: 20px; height: 20px; flex: 0 0 auto; }
@media (max-width: 640px) { .msg-form { bottom: 82px; } .msgs { max-height: calc(100vh - 330px); } }
@media (min-width: 641px) { .chats, .chat-cab, .msgs, .msg-form { max-width: 640px; } }
/* interruptores de Ajustes > Alertas */
.interruptor { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; margin: 0; border-bottom: 1px solid var(--line); cursor: pointer; color: var(--txt); }
.interruptor:last-child { border-bottom: 0; }
.interruptor > span { display: flex; flex-direction: column; }
.interruptor .muted { font-size: 13px; }
.interruptor.sub { padding-left: 14px; }
.interruptor.off { opacity: .5; }
.interruptor input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.interruptor i { flex: 0 0 auto; width: 46px; height: 26px; border-radius: 999px; background: var(--line); position: relative; transition: background .2s; }
.interruptor i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s; }
.interruptor input:checked + i { background: linear-gradient(135deg, var(--acento), var(--acento2)); }
.interruptor input:checked + i::after { transform: translateX(20px); }
.interruptor input:focus-visible + i { outline: 2px solid var(--acento); outline-offset: 2px; }
.noti { display: flex; align-items: center; gap: 12px; padding: 12px 8px; border-bottom: 1px solid var(--line); border-radius: 10px; }
.noti.nueva { background: color-mix(in srgb, var(--acento) 12%, transparent); }
.noti .persona-a > span:last-child { white-space: normal; }
.noti .persona-a .muted { font-size: 13px; }
@media (min-width: 641px) { .notis { max-width: 640px; } }
.editar-foto { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 6px 0 16px; }
.enlace-azul { color: #5b9bff; font-weight: 700; cursor: pointer; margin: 0; font-size: 16px; }
@media (min-width: 641px) { .perfil-barra, .perfil-red, .perfil-bio, .perfil-botones, .personas, .red-tit, .menu-lista, .editar-foto, #fEditar { max-width: 640px; } }
.forma-parte { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: -4px 0 14px; font-size: 14px; }
.fp-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg2); text-decoration: none; font-weight: 700; }
.fp-chip .logo-kosmos { gap: 0; }
.fp-chip:hover { border-color: var(--acento); }
@media (min-width: 641px) { .forma-parte { max-width: 640px; } }
.red-cab { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 6px 0 4px; }
.red-cab .red-tit { margin: 0; }
.red-cab input { max-width: 240px; min-height: 38px; padding: 6px 12px; }
@media (min-width: 641px) { .red-cab { max-width: 640px; } }
.nick-est { font-size: 14px; font-weight: 700; margin: -6px 0 8px; min-height: 1.2em; color: var(--txt2); }
.nick-est.bien { color: var(--ok); }
.nick-est.mal { color: var(--mal); }
/* Menú «Configuración y actividad» */
.menu-lista { display: flex; flex-direction: column; }
.menu-sec { margin: 18px 0 4px; font-size: 14px; color: var(--txt2); font-weight: 700; }
.menu-sec:first-child { margin-top: 4px; }
.menu-fila { display: flex; align-items: center; gap: 14px; padding: 14px 6px; border-bottom: 1px solid var(--line); text-decoration: none; }
.menu-fila:hover { background: var(--bg2); }
.menu-ico svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; display: block; }
.menu-txt { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.menu-txt .muted { font-size: 13px; }
.menu-flecha { color: var(--txt2); font-size: 24px; }

img.saldo-av { object-fit: cover; padding: 0; }
.perfil-cuentas button.on b, .perfil-cuentas button.on { color: var(--txt); text-decoration: underline; text-underline-offset: 4px; }
.red-tit { margin: 6px 0 4px; font-size: 18px; }

/* Ordenador: menú lateral a la izquierda, como el de Instagram (logo arriba y opciones con icono y texto) */
@media (min-width: 641px) {
  body { padding-left: 232px; }
  .top { position: fixed; top: 0; left: 0; bottom: 0; width: 232px; z-index: 30; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 0;
    padding: 26px 14px; background: var(--bg); backdrop-filter: none; border-bottom: 0; border-right: 1px solid var(--line); overflow-y: auto; }
  .top .marca { padding: 0 10px 26px; }
  .menu { flex-direction: column; gap: 4px; }
  .menu .ico { display: block; flex: 0 0 auto; }
  .menu a { display: flex; align-items: center; gap: 16px; padding: 12px; border-radius: 12px; font-size: 16px; font-weight: 600; color: var(--txt2); }
  .menu a.on { color: var(--txt); background: var(--bg2); font-weight: 800; }
  .menu a.on .ico { stroke-width: 2.4; }
  .menu a:hover { background: var(--bg2); color: var(--txt); }
  .menu .badge { margin-left: auto; }
  .rrpp-banner { position: sticky; top: 0; z-index: 20; }
  .barra-pie { left: 232px; }
}
/* el ticket con la A: solo en el ordenador, y sirve para plegar o desplegar el menú */
.marca-pc { display: none; }
@media (min-width: 641px) {
  .marca-movil { display: none; }
  /* desplegado: ticket + logo ARKOS Event pequeño; plegado: solo el ticket */
  .top .logo-marca { display: block; height: 15px; width: auto; max-width: 150px; object-fit: contain; }
  body.menu-plegado .top .logo-marca { display: none; }
  .marca-pc { display: block; width: 38px; height: 38px; flex: 0 0 auto; transition: transform .15s; }
  .top .marca { cursor: pointer; padding: 0 6px 24px; }
  .top .marca:hover .marca-pc { transform: rotate(-6deg) scale(1.05); }
  body.menu-plegado { padding-left: 76px; }
  body.menu-plegado .top { width: 76px; padding: 22px 10px; }
  body.menu-plegado .top .marca { padding: 0 0 22px; justify-content: center; }
  body.menu-plegado .menu a { justify-content: center; padding: 12px 0; }
  body.menu-plegado .menu .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  body.menu-plegado .menu .badge { position: absolute; top: 4px; right: 8px; }
  body.menu-plegado .barra-pie { left: 76px; }
}
/* pantallas medianas: el menú lateral solo con iconos */
@media (min-width: 641px) and (max-width: 1000px) {
  body { padding-left: 76px; }
  .top { width: 76px; padding: 22px 10px; }
  .top .marca { padding: 0 0 22px; justify-content: center; }
  .top .marca .logo-marca { display: none; }
  .menu a { justify-content: center; padding: 12px 0; }
  .menu .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .menu .badge { position: absolute; top: 4px; right: 8px; }
}

/* Móvil: barra de iconos flotante abajo, como Instagram */
@media (max-width: 640px) {
  .top { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--bg); }
  .menu { position: fixed; left: max(12px, env(safe-area-inset-left, 0px)); right: max(12px, env(safe-area-inset-right, 0px)); bottom: calc(10px + env(safe-area-inset-bottom, 0px)); z-index: 30; justify-content: space-around; gap: 0;
    background: rgba(22, 19, 31, .94); border: 1px solid var(--line); border-radius: 999px; padding: 6px 8px; box-shadow: 0 8px 28px rgba(0, 0, 0, .5); }
  .menu .ico { display: block; }
  .menu .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .menu a { flex: 1; display: flex; align-items: center; justify-content: center; padding: 9px 0; border-radius: 999px; color: var(--txt2); }
  .menu a.on { color: var(--txt); background: var(--bg2); }
  .menu a.on .ico { stroke-width: 2.3; }
  .menu .badge { position: absolute; top: 3px; right: calc(50% - 20px); }
  body { padding-bottom: 86px; }
  .barra-pie { bottom: 76px; }
  .cookies { bottom: 92px; }
  .marca span { display: inline; }
}

/* ===================== MODO CLARO (Ajustes > Apariencia) =====================
   Paleta de la referencia de Pedro (28/10): fondo crema, tarjetas blancas con borde beige y botones salmón con texto oscuro.
   El oscuro sigue siendo el predeterminado; esto solo se aplica con <html data-tema="claro">. */
html[data-tema="claro"] {
  --bg: #f7f0e6; --bg2: #fbf6ef; --card: #ffffff; --line: #ecdfcd; --txt: #2a211c; --txt2: #7b6c61;
  --acento: #eea89a; --acento2: #c9685a; --ok: #1e9a55; --aviso: #a76a00; --mal: #cf3f4f;
  --sobre: #3b221c; --salmon: linear-gradient(135deg, #f4bcae, #eba293);
  --sombra: 0 8px 24px rgba(120, 90, 60, .12);
  color-scheme: light;
}
html[data-tema="claro"] .top { background: rgba(247, 240, 230, .92); }
html[data-tema="claro"] .logo-marca { filter: drop-shadow(0 0 1px rgba(60, 40, 30, .45)); }
html[data-tema="claro"] .pie-firma img { filter: drop-shadow(0 0 1px rgba(60, 40, 30, .5)); }
html[data-tema="claro"] .btn,
html[data-tema="claro"] .rrpp-banner,
html[data-tema="claro"] .logo-ini,
html[data-tema="claro"] .avatar-ini,
html[data-tema="claro"] .prod-pre,
html[data-tema="claro"] .msg.mio { background: var(--salmon); color: var(--sobre); }
html[data-tema="claro"] .rrpp-banner button { border-color: var(--sobre); color: var(--sobre); }
html[data-tema="claro"] .btn.sec { background: var(--card); color: var(--txt); border: 1px solid var(--line); }
html[data-tema="claro"] .btn.sec:hover { background: var(--bg2); }
html[data-tema="claro"] .btn.peligro { background: #fde4e1; border: 1px solid #f0b3ab; color: #9b2c2c; }
html[data-tema="claro"] .btn.btn-seguir { background: #3987e5; color: #fff; }
html[data-tema="claro"] .caja, html[data-tema="claro"] .ev-card { box-shadow: 0 2px 10px rgba(120, 90, 60, .06); }
html[data-tema="claro"] .cal-celda .vacio { color: #b9ab9f; }
html[data-tema="claro"] .estado.agotada { background: #fde4e1; }
html[data-tema="claro"] .estado.ultimas { background: #fdf0d6; }
html[data-tema="claro"] .estado.privada { background: #f6e4dc; color: #8a4a3c; }
html[data-tema="claro"] .enlace { color: #8a4a3c; }
html[data-tema="claro"] .demo-nota, html[data-tema="claro"] .ej-barra { background: #fbeee8; border-color: #e8b9ab; color: #6b3f35; }
html[data-tema="claro"] .hero,
html[data-tema="claro"] .saldo,
html[data-tema="claro"] .wal-cab { background: radial-gradient(circle at 85% 15%, rgba(238, 168, 154, .45), transparent 55%), radial-gradient(circle at 10% 100%, rgba(244, 212, 190, .7), transparent 60%), var(--card); }
html[data-tema="claro"] .wal-ticket, html[data-tema="claro"] .splash-ticket { filter: drop-shadow(0 6px 14px rgba(150, 100, 80, .25)); }
html[data-tema="claro"] .wal-beta { background: rgba(255, 255, 255, .8); }
html[data-tema="claro"] .wal-b { border-color: var(--line); }
html[data-tema="claro"] .wal-b:hover { border-color: var(--acento); }
html[data-tema="claro"] .wal-qr-img { box-shadow: 0 0 0 3px var(--acento), 0 0 18px rgba(238, 168, 154, .45); }
html[data-tema="claro"] .qr, html[data-tema="claro"] .qr-grande, html[data-tema="claro"] .codigo { border: 1px solid var(--line); }
html[data-tema="claro"] .qr-pantalla { background: rgba(58, 40, 30, .55); }
html[data-tema="claro"] .qr-pantalla-in { box-shadow: var(--sombra); }
html[data-tema="claro"] .qr-icono.espera { background: #d9cbbb; }
html[data-tema="claro"] .saldo-av { background: #f6e4dc; border-color: #e8b9ab; color: #8a4a3c; }
html[data-tema="claro"] .recargas .btn { background: var(--card); border: 1px solid var(--line); color: var(--txt); }
html[data-tema="claro"] .recargas .btn:hover { background: var(--bg2); }
html[data-tema="claro"] .prod-nom { background: var(--card); }
html[data-tema="claro"] .prod-n { color: #fff; }
html[data-tema="claro"] .barra-pie { background: rgba(251, 246, 239, .96); }
html[data-tema="claro"] .subir { background: rgba(238, 168, 154, .1); }
html[data-tema="claro"] .subir:hover { background: rgba(238, 168, 154, .2); }
html[data-tema="claro"] .interruptor i { background: #e3d6c5; }
html[data-tema="claro"] .interruptor input:checked + i { background: var(--salmon); }
html[data-tema="claro"] .enlace-azul { color: #2f6fca; }
html[data-tema="claro"] .tr-cod { border-color: #e8b9ab; }
@media (max-width: 640px) {
  html[data-tema="claro"] .top { background: var(--bg); }
  html[data-tema="claro"] .menu { background: rgba(255, 255, 255, .96); box-shadow: 0 8px 24px rgba(120, 90, 60, .18); }
}
/* elegir modo en Ajustes > Apariencia */
.tema-ops { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; max-width: 640px; }
.tema-op { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px; border-radius: 16px; border: 2px solid var(--line); background: var(--card); color: var(--txt); cursor: pointer; text-align: left; font: inherit; }
.tema-op.on { border-color: var(--acento); box-shadow: 0 0 0 3px color-mix(in srgb, var(--acento) 25%, transparent); }
.tema-op .muted { font-size: 13px; }
.tema-muestra { display: flex; gap: 6px; width: 100%; height: 56px; padding: 8px; border-radius: 12px; margin-bottom: 6px; }
.tema-muestra i { flex: 1; border-radius: 8px; }
.tema-oscuro .tema-muestra { background: #0d0b14; border: 1px solid #2c2740; }
.tema-oscuro .tema-muestra i:nth-child(1) { background: #1d1929; } .tema-oscuro .tema-muestra i:nth-child(2) { background: #7c5cff; } .tema-oscuro .tema-muestra i:nth-child(3) { background: #ff4fa3; }
.tema-claro .tema-muestra { background: #f7f0e6; border: 1px solid #ecdfcd; }
.tema-claro .tema-muestra i:nth-child(1) { background: #fff; border: 1px solid #ecdfcd; } .tema-claro .tema-muestra i:nth-child(2) { background: #eea89a; } .tema-claro .tema-muestra i:nth-child(3) { background: #f4d4be; }
/* ===================== CHATS (Mensajes): lista + conversación + panel del grupo =====================
   Ordenador: tres columnas (lista con buscador y categorías, chat abierto y, si se pide, información del grupo).
   Móvil: la lista o el chat, de uno en uno; la información del grupo ocupa toda la pantalla. */
.chapp svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.chapp .chats, .chapp .chat-cab, .chapp .msgs, .chapp .msg-form { max-width: none; }
.ch-lista, .ch-conv, .ch-info { min-width: 0; }
.ch-cab { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.ch-cab h1 { margin: 0; font-size: 26px; }
.ch-cab .btn svg { width: 16px; height: 16px; }
.ch-busca { display: flex; gap: 8px; margin-bottom: 10px; }
.ch-input { flex: 1; display: flex; align-items: center; gap: 8px; margin: 0; padding: 0 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg2); color: var(--txt2); min-width: 0; }
.ch-input input[type=search] { flex: 1; min-width: 0; border: 0; background: transparent; padding: 11px 0; outline: none; box-shadow: none; }
.ch-input:focus-within { border-color: var(--acento); }
.ch-amigos { flex: 0 0 auto; width: 46px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg2); color: var(--txt2); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.ch-amigos.on, .ch-amigos:hover { color: var(--txt); border-color: var(--acento); }
.ch-cats { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; margin-bottom: 8px; }
.ch-cats::-webkit-scrollbar { display: none; }
.ch-cat { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line); background: transparent; color: var(--txt2); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; position: relative; }
.ch-cat svg { width: 18px; height: 18px; }
.ch-cat.on { color: #fff; background: linear-gradient(135deg, var(--acento), var(--acento2)); border-color: transparent; }
.ch-cat .badge { font-style: normal; }
.ch-cat.on .badge { background: rgba(255, 255, 255, .25); }
.ch-subs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.ch-sub { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg2); color: var(--txt2); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.ch-sub span { opacity: .75; font-weight: 600; }
.ch-sub.on { color: var(--txt); border-color: var(--acento); background: color-mix(in srgb, var(--acento) 18%, var(--bg2)); }
.chapp .chat-fila { width: 100%; background: transparent; border: 0; border-bottom: 1px solid var(--line); font: inherit; color: inherit; text-align: left; cursor: pointer; border-radius: 12px; }
.chapp .chat-fila.on { background: color-mix(in srgb, var(--acento) 18%, var(--card)); }
.chat-tipo { font-size: 12px; color: var(--txt2); }
.chat-fav svg { width: 13px; height: 13px; display: inline-block; vertical-align: -1px; fill: var(--aviso); stroke: var(--aviso); }
.chat-nuevo { display: block; width: 12px; height: 12px; border-radius: 50%; background: var(--acento2); margin: 8px 0 0 auto; }
.chats-sep { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--txt2); margin: 14px 6px 4px; }
.chats-vacio { padding: 18px 6px; }
.ch-vacio { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 40px 20px; height: 100%; color: var(--txt2); }
.ch-vacio svg { width: 54px; height: 54px; stroke-width: 1.3; color: var(--acento); }
.ch-vacio b { color: var(--txt); font-size: 18px; }
.chapp .chat-cab { gap: 8px; padding: 0 0 10px; }
.ch-quien { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; text-decoration: none; }
.ch-ico { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: transparent; border: 0; color: var(--txt2); cursor: pointer; text-decoration: none; font: inherit; font-size: 18px; }
.ch-ico:hover, .ch-ico.on { background: var(--bg2); color: var(--txt); }
.ch-masw { position: relative; }
.ch-menu { position: absolute; right: 0; top: 44px; z-index: 40; min-width: 220px; display: flex; flex-direction: column; padding: 6px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--sombra); }
.ch-menu button, .ch-menu a { background: none; border: 0; color: var(--txt); font: inherit; font-size: 15px; text-align: left; padding: 10px 12px; border-radius: 10px; cursor: pointer; text-decoration: none; }
.ch-menu button:hover, .ch-menu a:hover { background: var(--bg2); }
.ch-aviso { font-size: 14px; color: var(--txt2); background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin: 8px 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.msg-dia { align-self: center; font-size: 12px; color: var(--txt2); background: var(--bg2); padding: 3px 10px; border-radius: 999px; margin: 8px 0 4px; }
.msg-fila { display: flex; align-items: flex-end; gap: 8px; align-self: flex-start; max-width: 85%; }
.msg-fila.mio { align-self: flex-end; }
.msg-fila .msg { max-width: 100%; }
.msg-fila .avatar { flex: 0 0 auto; }
.msg-de { color: var(--acento2); }
.chapp .msg-form { align-items: center; background: transparent; }
.chapp .msg-form input { padding: 12px 16px; }
.ch-enviar { flex: 0 0 auto; width: 48px; height: 48px; border-radius: 50%; border: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; color: #fff; background: linear-gradient(135deg, var(--acento), var(--acento2)); }
.ch-enviar svg { width: 22px; height: 22px; }
/* panel de información del grupo */
.ch-info { position: relative; }
.ch-cerrar { position: absolute; top: 0; right: 0; }
.ch-info-cab { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 8px 0 12px; }
.ch-info-cab h2 { margin: 8px 0 0; font-size: 20px; }
.ch-info-cab p { margin: 0; }
.ch-desc { margin-top: 6px !important; font-size: 14px; }
.ch-info-tit { margin: 16px 0 6px; }
.ch-miembros { display: flex; flex-direction: column; }
.ch-miembro { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.ch-miembro .chat-t { min-width: 120px; }
.ch-admin { font-size: 12px; font-weight: 800; color: var(--ok); }
.ch-m-acc { display: flex; gap: 6px; margin-left: auto; }
.ch-m-acc .btn.peq { min-height: 30px; padding: 4px 10px; font-size: 13px; }
.ch-editar { margin-top: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--bg2); }
.ch-editar summary { cursor: pointer; font-weight: 800; }
.ch-editar[open] summary { margin-bottom: 10px; }
.ch-editar .personas { max-height: 240px; overflow-y: auto; margin-bottom: 10px; }
.ch-check { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 14px; }
.ch-info-pie { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.ch-info-pie .btn { flex: 1 1 140px; }

/* Ordenador y tableta: columnas, cada una con su propio desplazamiento */
@media (min-width: 760px) {
  .chapp { display: grid; grid-template-columns: minmax(300px, 380px) 1fr; gap: 14px; height: calc(100vh - 56px); height: calc(100dvh - 56px); min-height: 520px; }
  .chapp.con-info { grid-template-columns: minmax(300px, 360px) 1fr minmax(280px, 330px); }
  .ch-lista, .ch-conv, .ch-info { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px; display: flex; flex-direction: column; overflow: hidden; }
  .ch-lista .chats { flex: 1; overflow-y: auto; margin: 0 -6px; padding: 0 6px; }
  .ch-conv .msgs { flex: 1; max-height: none; min-height: 0; }
  .ch-info { overflow-y: auto; }
  .ch-atras { display: none; }
  .chapp ~ * { display: none; }
}
@media (min-width: 760px) and (max-width: 1180px) {
  .chapp.con-info { grid-template-columns: minmax(280px, 340px) 1fr; }
  .chapp.con-info .ch-info { position: fixed; top: 16px; right: 16px; bottom: 16px; width: min(360px, calc(100vw - 32px)); z-index: 45; box-shadow: var(--sombra); }
}
@media (min-width: 641px) { main:has(.chapp) { max-width: none; padding-top: 14px; padding-bottom: 14px; } body:has(.chapp) .pie { display: none; } }
/* Móvil: o la lista o el chat */
@media (max-width: 759px) {
  .chapp.con-chat .ch-lista { display: none; }
  .chapp:not(.con-chat) .ch-conv { display: none; }
  .chapp.con-chat .ch-conv { display: flex; flex-direction: column; height: calc(100vh - 190px); height: calc(100dvh - 190px); min-height: 360px; }
  .chapp.con-chat .msgs { flex: 1; max-height: none; min-height: 0; }
  .chapp .ch-info { position: fixed; inset: 0; z-index: 80; background: var(--bg); overflow-y: auto; padding: calc(16px + env(safe-area-inset-top, 0px)) 16px 100px; }
  body:has(.chapp.con-chat) .pie { display: none; }
}
html[data-tema="claro"] .ch-cat.on, html[data-tema="claro"] .ch-enviar { background: var(--salmon); color: var(--sobre); }
html[data-tema="claro"] .msg-de { color: #a0503f; }
/* Buscar: perfiles buscados recientemente */
.recientes-cab { margin: 4px 0 6px; }
@media (min-width: 641px) { .recientes-cab { max-width: 640px; } }
.reciente { display: flex; align-items: center; gap: 4px; }
.reciente .persona { flex: 1; min-width: 0; }
.reciente-x { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; border: 0; background: transparent; color: var(--txt2); cursor: pointer; font-size: 15px; }
.reciente-x:hover { background: var(--bg2); color: var(--txt); }
.recientes-cab button { background: none; border: 0; padding: 4px 0; }
/* QR de pago dentro de la tarjeta del saldo (a la derecha); se pulsa para verlo en grande */
.wal-saldo { min-width: 0; }
.wal-cab .wal-beta { position: static; display: inline-block; margin-left: 10px; vertical-align: middle; }
.wal-qr-cab { margin-left: auto; flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 6px; background: none; border: 0; padding: 0; color: var(--txt); font: inherit; cursor: pointer; }
.wal-qr-cab .wal-qr-img { width: 112px; height: 112px; padding: 6px; }
.wal-qr-cab .wal-qr-img img, .wal-qr-cab .wal-qr-img canvas { width: 100px !important; height: 100px !important; }
.wal-qr-cab:hover .wal-qr-img { transform: scale(1.04); }
.wal-qr-cab .wal-qr-img { transition: transform .15s; }
.wal-qr-txt { font-size: 13px; font-weight: 800; }
@media (max-width: 420px) {
  .wal-cab { gap: 10px; padding: 18px 14px; }
  .wal-cab .wal-ticket { display: none; }
  .wal-qr-cab .wal-qr-img { width: 92px; height: 92px; }
  .wal-qr-cab .wal-qr-img img, .wal-qr-cab .wal-qr-img canvas { width: 80px !important; height: 80px !important; }
}