@font-face { font-family: "Figtree"; font-weight: 400 700; font-display: swap; src: url("../fonts/figtree-latin.woff2") format("woff2"); }
@font-face { font-family: "Outfit"; font-weight: 500 800; font-display: swap; src: url("../fonts/outfit-latin.woff2") format("woff2"); }

:root {
  --bg: #060f1f; --surface: #0c1a30; --surface-2: #13253f; --panel: #091527;
  --line: rgba(140, 185, 255, .12); --text: #eaf2ff; --muted: #8197b6;
  --accent: #38bdf8; --on-accent: #02101f; --danger: #f87171; --warn: #facc15;
  --ease: cubic-bezier(.32, .72, 0, 1);
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  color-scheme: dark;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; display: flex; flex-direction: column; height: 100%; /* no 100dvh: falla en algunos Android con la app instalada */
  background: var(--bg); color: var(--text); font: 500 15px/1.5 "Figtree", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2 { font-family: "Outfit", system-ui, sans-serif; margin: 0; }
[hidden] { display: none !important; }

.top { display: flex; align-items: center; gap: 14px; padding: 12px 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
.logo { width: 64px; }
.who { display: grid; line-height: 1.25; min-width: 0; }
.who strong { font-family: "Outfit", sans-serif; font-size: 17px; }
.who span { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.online { margin-left: auto; font-size: 13px; color: var(--muted); white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.online::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #4ade80; }
.logout { flex: none; color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 700; padding: 8px 12px; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--line); transition: color .2s var(--ease-out), background-color .2s var(--ease-out), transform .2s var(--ease-out); }
.logout:active { transform: scale(.95); transition-duration: .1s; }
@media (hover: hover) and (pointer: fine) { .logout:hover { color: var(--text); background: var(--surface-2); } }

.tabs { display: flex; gap: 4px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--panel); }
.tabs button { flex: 1; border: 0; background: none; color: var(--muted); padding: 10px; border-radius: 10px; font-weight: 600; transition: background-color .2s var(--ease-out), color .2s var(--ease-out), transform .2s var(--ease-out); }
.tabs button:active { transform: scale(.96); transition-duration: .1s; }
.panel:not([hidden]) { animation: fade .2s var(--ease-out); }
@keyframes fade { from { opacity: 0; } }
.tabs button[aria-selected="true"] { background: var(--surface-2); color: var(--text); }
.tabs button { white-space: nowrap; min-height: 44px; }
/* Son 7 pestañas: en pantallas angostas van en dos filas de 4, así se ven todas sin deslizar. */
@media (max-width: 760px) { .tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.count:not(:empty) { margin-left: 4px; font-size: 12px; padding: 1px 7px; border-radius: 999px; background: var(--danger); color: #2a0606; }

.panel { flex: 1; min-height: 0; display: flex; flex-direction: column; width: 100%; max-width: 820px; margin: 0 auto; }

/* Estado del chat (abierto/cerrado) */
.chat-state { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 12px 12px 0; padding: 12px 14px; border-radius: 14px; background: var(--surface); box-shadow: 0 0 0 1px var(--line); transition: background-color .3s var(--ease-out), box-shadow .3s var(--ease-out); }
.chat-state.is-open { background: rgba(74, 222, 128, .06); box-shadow: 0 0 0 1px rgba(74, 222, 128, .25); }
.chat-state.is-open strong::before { animation: online 2.4s var(--ease-out) infinite; }
@keyframes online { from { box-shadow: 0 0 0 0 rgba(74, 222, 128, .5); } to { box-shadow: 0 0 0 7px rgba(74, 222, 128, 0); } }
.cs-btns .btn:not([hidden]) { animation: fade .2s var(--ease-out); }
.chat-state > div:first-child { display: grid; flex: 1; min-width: 180px; line-height: 1.35; }
.chat-state strong { display: flex; align-items: center; gap: 8px; }
.chat-state strong::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.chat-state.is-open strong::before { background: #4ade80; }
.chat-state span { font-size: 13px; color: var(--muted); }
.cs-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.cs-btns .btn { padding: 9px 14px; font-size: 14px; }
.prog .chat-tag { color: #4ade80; font-weight: 600; }

/* Modo cuidado: amarillo cuando está prendido, para que se note de lejos. */
.careful { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 8px 12px 0; padding: 12px 14px; border-radius: 14px; background: var(--surface); box-shadow: 0 0 0 1px var(--line); transition: background-color .3s var(--ease-out), box-shadow .3s var(--ease-out); }
.careful > div { display: grid; flex: 1; min-width: 180px; line-height: 1.35; }
.careful span { font-size: 13px; color: var(--muted); }
.careful .btn { padding: 9px 14px; font-size: 14px; }
.careful.is-on { background: rgba(250, 204, 21, .07); box-shadow: 0 0 0 1px rgba(250, 204, 21, .35); }
.careful.is-on strong { color: var(--warn); }
.btn.warn { background: var(--warn); color: #1a1400; }
.count.wait:not(:empty) { background: var(--warn); color: #1a1400; }

/* Mensajes con acciones */
.msgs { list-style: none; margin: 0; padding: 12px; flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.msg { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: start; padding: 12px 14px; border-radius: 14px; background: var(--surface); box-shadow: 0 0 0 1px var(--line); animation: rise .28s var(--ease-out); }
@keyframes rise { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.msg.is-leaving { animation: leave .2s var(--ease-out) forwards; }
@keyframes leave { to { opacity: 0; transform: scale(.96); filter: blur(3px); } }
.msg.mod { background: rgba(56, 189, 248, .08); }
.meta { display: flex; gap: 8px; align-items: baseline; font-size: 13px; }
.meta b { font-weight: 700; }
.msg.mod .meta b { color: var(--accent); }
.meta time { color: var(--muted); font-size: 12px; }
.text { grid-column: 1; margin: 0; overflow-wrap: anywhere; color: #d4e1f3; }
.acts { grid-column: 2; grid-row: 1 / span 2; display: flex; gap: 6px; align-self: center; }
.acts button { border: 0; border-radius: 10px; padding: 8px 12px; min-height: 36px; font-size: 13px; font-weight: 700; background: var(--surface-2); transition: background-color .2s var(--ease-out), transform .2s var(--ease-out); }
.acts button:active { transform: scale(.94); transition-duration: .1s; }
.acts .del:hover { background: #22324d; }
.acts .ban { background: rgba(248, 113, 113, .14); color: var(--danger); }
.acts .ban:hover { background: rgba(248, 113, 113, .24); }
.acts .approve { background: rgba(74, 222, 128, .16); color: #4ade80; }
.acts .approve:hover { background: rgba(74, 222, 128, .26); }
/* Esperando aprobación: borde amarillo, como el modo cuidado. */
.msg.pending { background: rgba(250, 204, 21, .05); box-shadow: 0 0 0 1px rgba(250, 204, 21, .35); }
.meta i { font-style: normal; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 6px; }
.meta .team, .team-mark { color: var(--accent); background: rgba(56, 189, 248, .12); }
.team-mark { font-size: 12px; padding: 1px 6px; border-radius: 6px; white-space: nowrap; }
/* Auspiciantes */
.sp-upload { position: relative; justify-self: start; margin-top: 10px; cursor: pointer; }
.sp-upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.sp-upload:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.sp-progress { margin: 6px 0 0; font-size: 14px; color: var(--accent); }
.sp-progress:empty { display: none; }
.sp-row img { width: 56px; height: 56px; flex: none; border-radius: 10px; object-fit: cover; background: #fff; }
.sp-row.is-off img { opacity: .4; }
.sp-row div input:not([type="checkbox"]) { width: 100%; font: inherit; font-weight: 700; color: var(--text); background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 4px 6px; margin-left: -6px; }
.sp-row div input:not([type="checkbox"]):hover, .sp-row div input:not([type="checkbox"]):focus { border-color: var(--line); outline: none; background: var(--bg); }
.sp-on { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); cursor: pointer; margin-top: 2px; }
.sp-on input { width: 18px; height: 18px; accent-color: var(--accent); }
.sp-row .sp-acts { display: flex; gap: 6px; flex: none; }
.btn.sm { padding: 8px 12px; min-height: 40px; }
@media (max-width: 520px) { .sp-row { flex-wrap: wrap; } .sp-acts { width: 100%; justify-content: flex-end; } }
.meta .helper, .helper-mark { color: #c6d6ee; background: rgba(255, 255, 255, .08); }
.helper-mark { font-size: 12px; padding: 1px 6px; border-radius: 6px; white-space: nowrap; }
.meta .wait { color: var(--warn); background: rgba(250, 204, 21, .12); }
.hint.small { font-size: 12px; margin-top: 10px; }
.empty { color: var(--muted); text-align: center; padding: 40px 16px; }

.say { display: flex; gap: 8px; align-items: center; padding: 12px; border-top: 1px solid var(--line); background: var(--panel); padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
.say .as { font-size: 12px; color: var(--muted); white-space: nowrap; }
.say .as b { color: var(--accent); }
.say input { flex: 1; min-width: 0; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; outline: none; }
.say input:focus { border-color: var(--accent); }

.btn { border: 0; border-radius: 12px; padding: 11px 18px; font-weight: 700; background: var(--accent); color: var(--on-accent); transition: transform .2s var(--ease-out), filter .2s var(--ease-out), opacity .2s var(--ease-out); }
.btn:active { transform: scale(.97); transition-duration: .1s; }
@media (hover: hover) and (pointer: fine) { .btn:not(:disabled):hover, .acts button:hover { filter: brightness(1.12); } }
.btn.ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.btn.danger { background: var(--danger); color: #2a0606; }

/* Bloqueados */
.hint { color: var(--muted); font-size: 14px; margin: 16px 16px 0; }
.bans { list-style: none; margin: 0; padding: 12px; display: grid; gap: 8px; overflow-y: auto; }
.ban-row { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
.ban-row div { display: grid; min-width: 0; flex: 1; }
.ban-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ban-row span { font-size: 13px; color: var(--muted); }

/* Programación */
.panel.scroll { overflow-y: auto; }
/* En las pestañas que bajan enteras, nada se achica: las listas de Equipo y Auspiciantes crecen con lo que tienen.
   Con su propia barra, el flex las apretaba en una franja finita abajo de todo (23/10/2026). */
.panel.scroll > * { flex-shrink: 0; }
.panel.scroll > .bans { overflow-y: visible; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 16px 12px 4px; }
.bar .hint { margin: 0; }
.programs { list-style: none; margin: 0; padding: 12px; display: grid; gap: 8px; }
.prog { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
.prog img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; flex: none; background: var(--surface-2); }
.prog div { display: grid; min-width: 0; flex: 1; line-height: 1.35; }
.prog strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prog span { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prog .when { color: var(--accent); font-weight: 600; }

/* Formularios */
.card { margin: 16px 12px; padding: 20px; border-radius: 18px; background: var(--surface); box-shadow: 0 0 0 1px var(--line); display: grid; gap: 6px; }
.card h2 { font-size: 20px; }
.hint.flush { margin: 0 0 8px; }
.field-label { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; color: var(--muted); margin-top: 10px; }
.chars { font-weight: 500; }
.zc-estado { margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); color: var(--muted); font-weight: 600; overflow-wrap: anywhere; }
.zc-estado.on { color: var(--text); box-shadow: inset 0 0 0 1px var(--accent); }
/* Atajos del zócalo: cada frase es un botón (un toque y sale al aire) con su ✕ para borrarla.
   El que está en pantalla queda marcado con el borde y el punto celeste. */
.zc-titulo { margin-top: 14px; }
.zc-titulo .hint { margin: 0; font-weight: 500; }
.zc-atajos { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.zc-atajos li { display: flex; max-width: 100%; border-radius: 12px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .2s var(--ease-out); }
.zc-atajos li.hint { background: none; box-shadow: none; }
.zc-atajos li:has([aria-pressed="true"]) { box-shadow: inset 0 0 0 2px var(--accent); }
.zc-atajo { flex: 1; min-width: 0; min-height: 44px; padding: 10px 4px 10px 14px; border: 0; border-radius: 12px 0 0 12px; background: none;
  color: var(--text); font: inherit; font-weight: 600; text-align: left; overflow-wrap: anywhere; transition: transform .16s var(--ease-out), color .2s var(--ease-out); }
.zc-atajo:active { transform: scale(.97); transition-duration: .1s; }
.zc-atajo[aria-pressed="true"] { color: var(--accent); }
.zc-atajo[aria-pressed="true"]::before { content: "● "; }
.zc-borrar { flex: none; width: 42px; border: 0; border-radius: 0 12px 12px 0; background: none; color: var(--muted); font-size: 14px; transition: color .2s var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .zc-atajo:hover { color: var(--accent); } .zc-borrar:hover { color: var(--danger); } }
.zc-guardar { margin-right: auto; }
.card input, .card textarea, .editor input:not([type="checkbox"]):not([type="file"]) {
  width: 100%; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line);
  border-radius: 12px; padding: 11px 14px; outline: none; transition: border-color .2s; color-scheme: dark;
}
.card textarea { resize: vertical; }
.card input:focus, .card textarea:focus, .editor input:focus { border-color: var(--accent); }
.switch, .check-inline { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-weight: 600; cursor: pointer; }
.switch input, .check-inline input { width: 20px; height: 20px; accent-color: var(--accent); }
.check-inline { font-size: 14px; font-weight: 500; margin-top: 8px; }
/* Equipo o ayudante: textos de varias líneas, el circulito arriba y siempre del mismo tamaño. */
.check-inline.role { align-items: flex-start; margin-top: 12px; line-height: 1.6; }
.check-inline.role input { flex: none; margin: 2px 0 0; }

.editor { width: min(560px, calc(100vw - 24px)); max-height: calc(100svh - 24px); border: 0; border-radius: 20px; padding: 22px; background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--line), 0 30px 80px -20px rgba(0, 0, 0, .6); }
.editor::backdrop { background: rgba(3, 10, 22, .7); }
/* Ventanas (editor y confirmación): entran creciendo apenas y salen más rápido. */
.editor, .confirm, .editor::backdrop, .confirm::backdrop { transition: opacity .25s var(--ease-out), transform .25s var(--ease-out), overlay .25s allow-discrete, display .25s allow-discrete; }
.editor:not([open]), .confirm:not([open]) { opacity: 0; transform: translateY(6px) scale(.97); transition-duration: .18s; }
.editor:not([open])::backdrop, .confirm:not([open])::backdrop { opacity: 0; }
@starting-style {
  .editor[open], .confirm[open] { opacity: 0; transform: translateY(14px) scale(.96); }
  .editor[open]::backdrop, .confirm[open]::backdrop { opacity: 0; }
}
.days span:active { transform: scale(.94); }
.form-error:not(:empty) { animation: shake .3s var(--ease-out); }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(3px); } }
.editor h2 { font-size: 21px; margin-bottom: 4px; }
.days { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.days label { cursor: pointer; }
.days input { position: absolute; opacity: 0; pointer-events: none; }
.days span { display: block; padding: 9px 12px; border-radius: 10px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); font-weight: 600; font-size: 14px; color: var(--muted); transition: all .2s; }
.days input:checked + span { background: var(--accent); color: var(--on-accent); box-shadow: none; }
.days input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.times { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.photo { display: grid; gap: 10px; margin-top: 4px; }
.photo-preview { aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); display: grid; place-items: center; color: var(--muted); font-size: 14px; text-align: center; padding: 0; }
.photo-preview img, .photo-preview canvas { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.file { position: relative; overflow: hidden; display: inline-flex; align-items: center; cursor: pointer; }
.file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.form-error { color: var(--danger); font-weight: 600; min-height: 1.4em; margin: 12px 0 0; }
.actions.spread { align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.btn.danger-ghost { background: transparent; color: var(--danger); box-shadow: inset 0 0 0 1px rgba(248, 113, 113, .35); }
.btn:disabled { opacity: .5; cursor: progress; }

/* Tema que suena */
.now-row { display: grid; gap: 2px; padding: 10px 0; border-top: 1px solid var(--line); }
.now-row span { font-size: 12px; font-weight: 600; color: var(--muted); }
.now-row strong { overflow-wrap: anywhere; }
.now-row strong.muted { color: var(--muted); font-weight: 500; font-style: italic; }

.denied { max-width: 460px; margin: 15vh auto 0; padding: 24px; text-align: center; }
.denied p { color: var(--muted); }

.confirm { width: min(420px, calc(100vw - 32px)); border: 0; border-radius: 20px; padding: 24px; background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--line), 0 30px 80px -20px rgba(0, 0, 0, .6); }
.confirm::backdrop { background: rgba(3, 10, 22, .7); }
.confirm h2 { font-size: 20px; }
.confirm p { color: var(--muted); margin: 10px 0 20px; }
.actions { display: flex; justify-content: flex-end; gap: 8px; }

.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); padding: 10px 16px; border-radius: 12px; background: var(--surface-2); box-shadow: 0 0 0 1px var(--line), 0 8px 8px -6px rgba(0, 0, 0, .5); font-weight: 600; font-size: 14px; max-width: calc(100vw - 32px); transition: opacity .25s var(--ease-out), transform .25s var(--ease-out), display .25s allow-discrete; }
@starting-style { .toast { opacity: 0; transform: translateX(-50%) translateY(10px) scale(.96); } }
.toast[hidden] { display: none !important; opacity: 0; transform: translateX(-50%) translateY(6px); }
.toast.err { color: var(--danger); }

@media (max-width: 560px) {
  .tabs { gap: 2px; padding: 6px; }
  .tabs button { padding: 9px 4px; font-size: 13px; }
  .say .as { display: none; }
  .prog .btn { padding: 9px 12px; }
  .msg { grid-template-columns: 1fr; }
  .acts { grid-column: 1; grid-row: auto; justify-content: flex-end; margin-top: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .msg, .panel:not([hidden]) { animation: fade .2s ease-out both !important; }
  .editor, .confirm, .toast { transform: none !important; }
}
