/* Pagos · The Web Tailors — versión amigable para los dueños
   Hueso claro, tinta negra de traje y el vino de corbata solo para lo que se toca; lo elegido va en negro. Sin rosas.
   Cada socio tiene su color sólido (Germán vino, Abraham petróleo, Rivero miel) para leer rápido de quién es cada parte.
   Plus Jakarta Sans en todo: redonda, clara y con trazo firme (en la PC de Germán las letras finas se pixelean).
   Primero el celular (390 px); desde 960 px, columna principal + lateral de 384 px. */

:root {
  color-scheme: light;
  --fondo: #f4f2ee;
  --fondo-2: #e9e6e0;
  --tarjeta: #ffffff;
  --tinta: #18181b;
  --tinta-2: #48484f;
  --suave: #66666e;
  --linea: #e4e1db;
  --linea-2: #d2cec6;
  --vino: #8a1c2e;
  --vino-oscuro: #6e0f1f;
  --arena: #ece8e1;
  --ok: #137a52; --ok-bg: #ddf3e9;
  --ojo: #8a5600; --ojo-bg: #fff0d2;
  --malo: #a3172e; --malo-bg: #f9ebe8;
  --neutro-bg: #efece7;
  /* los socios */
  --german: #8a1c2e; --abraham: #1e6f75; --rivero: #95590a;

  --sombra: 0 1px 2px rgba(24, 24, 27, 0.06), 0 10px 28px -12px rgba(24, 24, 27, 0.16);
  --sombra-alta: 0 2px 4px rgba(24, 24, 27, 0.06), 0 18px 40px -14px rgba(24, 24, 27, 0.22);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --fs-titulo: 28px; --fs-card: 17px; --fs-body: 15px; --fs-small: 13px;
  --radio: 20px; --radio-chico: 12px;
  --control-h: 44px;
  --pad: 16px;
  --barra: 68px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-rebote: cubic-bezier(0.34, 1.56, 0.64, 1);
}
@media (min-width: 960px) { :root { --pad: 32px; --fs-titulo: 32px; --fs-body: 14.5px; --control-h: 40px; } }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scrollbar-color: var(--linea-2) var(--fondo); scrollbar-width: thin; }
body { margin: 0; min-height: 100dvh; background: var(--fondo); color: var(--tinta); font: 500 var(--fs-body)/1.5 var(--font); -webkit-font-smoothing: antialiased; caret-color: var(--vino); }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: var(--vino-oscuro); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { display: block; }
[hidden] { display: none !important; }
::selection { background: var(--tinta); color: #fff; }
:focus-visible { outline: 3px solid rgba(24, 24, 27, 0.4); outline-offset: 2px; border-radius: 8px; }
.num { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.suave { color: var(--suave); }
.chico { font-size: var(--fs-small); line-height: 18px; }
.l-cuerpo { fill: var(--tinta); } .l-pantalla { fill: var(--fondo); } .l-acento { fill: var(--vino); }

/* ---------- marco ---------- */
.cabeza { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 10px var(--pad); background: rgba(244, 242, 238, 0.95); border-bottom: 1px solid var(--linea); }
@media (min-width: 960px) { .cabeza { backdrop-filter: saturate(1.4) blur(12px); padding-block: 12px; } }
.marca { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--tinta); text-decoration: none; }
.marca svg { width: 36px; height: 27px; flex: none; }
.marca strong { display: block; font-size: 17px; font-weight: 800; letter-spacing: -0.01em; line-height: 1.1; }
.marca span span { display: block; color: var(--suave); font-size: 11.5px; font-weight: 600; line-height: 14px; }
.cabeza .yo { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.yo-quien { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.yo-quien b { font-weight: 700; }
@media (max-width: 420px) { .yo-quien b { display: none; } }

.avatar { flex: none; display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; font-size: 13px; font-weight: 800; background: var(--neutro-bg); color: var(--tinta-2); }
.avatar.grande { width: 40px; height: 40px; font-size: 15px; }
.avatar[data-socio="german"] { background: var(--german); color: #fff; }
.avatar[data-socio="abraham"] { background: var(--abraham); color: #fff; }
.avatar[data-socio="rivero"] { background: var(--rivero); color: #fff; }

.navegacion { position: fixed; z-index: 20; inset: auto 0 0 0; display: grid; grid-template-columns: repeat(5, 1fr); height: calc(var(--barra) + env(safe-area-inset-bottom)); padding: 6px 6px env(safe-area-inset-bottom); background: rgba(255, 255, 255, 0.97); border-top: 1px solid var(--linea); box-shadow: 0 -8px 24px -16px rgba(24, 24, 27, 0.2); }
.navegacion a { display: grid; justify-items: center; align-content: center; gap: 3px; margin: 2px; border-radius: 16px; color: var(--suave); font-size: 11.5px; font-weight: 700; line-height: 14px; text-decoration: none; position: relative; transition: color 160ms ease, background-color 160ms ease; }
.navegacion svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; transition: transform 220ms var(--ease-rebote); }
.navegacion a[aria-current="page"] { color: #fff; background: var(--tinta); }
.navegacion a[aria-current="page"] svg { transform: translateY(-1px) scale(1.06); }
.navegacion .punto { position: absolute; top: 6px; left: calc(50% + 7px); width: 9px; height: 9px; border-radius: 50%; background: var(--vino); box-shadow: 0 0 0 2px #fff; }

.lienzo { padding: 22px var(--pad) calc(var(--barra) + 36px + env(safe-area-inset-bottom)); max-width: 1320px; margin: 0 auto; }
.vista-cabeza { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 16px; margin-bottom: 18px; }
.vista-cabeza h1 { font-size: var(--fs-titulo); font-weight: 800; line-height: 1.12; letter-spacing: -0.025em; text-wrap: balance; }
.vista-cabeza p { color: var(--tinta-2); margin-top: 4px; max-width: 60ch; }
.rejilla { display: grid; gap: 16px; }
.columna { display: grid; gap: 16px; align-content: start; min-width: 0; }

@media (min-width: 960px) {
  .navegacion { position: static; display: flex; gap: 4px; height: auto; padding: 0; margin-left: 28px; background: none; border: 0; box-shadow: none; }
  .navegacion a { display: flex; gap: 8px; margin: 0; padding: 9px 14px; border-radius: 999px; font-size: 14px; }
  .navegacion svg { width: 18px; height: 18px; }
  .navegacion .punto { top: 5px; left: 26px; }
  .lienzo { padding-top: 32px; padding-bottom: 56px; }
  .rejilla.dos { grid-template-columns: minmax(0, 1fr) 384px; gap: 24px; }
  .rejilla.dos > .columna { gap: 24px; }
}

/* ---------- tarjetas ---------- */
.panel { position: relative; min-width: 0; padding: 18px; border-radius: var(--radio); background: var(--tarjeta); box-shadow: var(--sombra); }
@media (min-width: 960px) { .panel { padding: 22px 24px 24px; } }
.panel-cabeza { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin-bottom: 12px; }
.panel-cabeza h2 { font-size: var(--fs-card); font-weight: 800; letter-spacing: -0.01em; line-height: 1.3; }
.panel-cabeza .meta { color: var(--suave); font-size: var(--fs-small); font-weight: 600; }

/* ---------- botones y campos ---------- */
.boton { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--control-h); padding: 0 18px; border: 1.5px solid var(--linea-2); border-radius: 999px; background: var(--tarjeta); color: var(--tinta); font-weight: 700; font-size: 14px; text-decoration: none; white-space: nowrap; transition: transform 160ms var(--ease-out), background-color 160ms ease, border-color 160ms ease; }
.boton:active { transform: scale(0.96); }
.boton.primario { background: var(--vino); border-color: var(--vino); color: #fff; box-shadow: 0 6px 16px -6px rgba(110, 15, 31, 0.5); }
.boton.fantasma { border-color: transparent; background: transparent; color: var(--tinta-2); padding: 0 10px; min-height: 34px; font-weight: 600; }
.boton.chico { min-height: 36px; padding: 0 14px; font-size: 13px; }
.boton.peligro { color: var(--malo); border-color: rgba(180, 35, 58, 0.35); }
.boton.ancho { width: 100%; }
.boton.grande { min-height: 52px; font-size: 16px; border-radius: 16px; }
.boton svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.boton[disabled] { opacity: 0.55; cursor: progress; }
@media (hover: hover) and (pointer: fine) {
  .boton:hover { border-color: var(--tinta-2); }
  .boton.primario:hover { background: var(--vino-oscuro); border-color: var(--vino-oscuro); }
  .boton.fantasma:hover { color: var(--tinta); background: var(--neutro-bg); }
  .navegacion a:hover { color: var(--tinta); }
  .navegacion a[aria-current="page"]:hover { color: #fff; }
}
@media (prefers-reduced-motion: reduce) { .boton, .boton:active, .navegacion svg { transition: none; transform: none !important; } }

.campo { width: 100%; min-height: var(--control-h); padding: 9px 14px; border: 1.5px solid var(--linea-2); border-radius: var(--radio-chico); background: #fff; color: var(--tinta); font-size: 16px; font-weight: 500; transition: border-color 160ms ease, box-shadow 160ms ease; }
.campo::placeholder { color: #85858c; }
.campo:focus { outline: none; border-color: var(--tinta); box-shadow: 0 0 0 4px rgba(24, 24, 27, 0.1); }
select.campo { appearance: none; padding-right: 36px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2348484f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 12px center / 18px; }
textarea.campo { min-height: 80px; resize: vertical; line-height: 1.45; }
.etiqueta { display: grid; gap: 6px; color: var(--suave); font-size: var(--fs-small); font-weight: 600; }
.etiqueta > span { color: var(--tinta); font-size: 14px; font-weight: 700; }
.filas-form { display: grid; gap: 14px; }
.dos-campos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tres-campos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.error { color: var(--malo); font-size: 14px; font-weight: 600; }
.error:empty { display: none; }
.ayuda { color: var(--suave); font-size: var(--fs-small); line-height: 19px; }

.opciones { display: flex; flex-wrap: wrap; gap: 8px; }
.opcion { position: relative; }
.opcion input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.opcion span { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border: 1.5px solid var(--linea-2); border-radius: 999px; background: var(--tarjeta); font-size: 14px; font-weight: 700; transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 220ms var(--ease-rebote); }
.opcion input:checked + span { background: var(--tinta); border-color: var(--tinta); color: #fff; transform: scale(1.03); }
.opcion input:focus-visible + span { outline: 3px solid rgba(24, 24, 27, 0.4); outline-offset: 2px; }

/* ---------- píldoras de estado ---------- */
.pildora { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 11px; border-radius: 999px; background: var(--neutro-bg); color: var(--tinta-2); font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.pildora::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pildora.ok { background: var(--ok-bg); color: var(--ok); }
.pildora.malo { background: var(--malo-bg); color: var(--malo); }
.pildora.ojo { background: var(--ojo-bg); color: var(--ojo); }
.pildora.apagado { color: var(--suave); }

/* ---------- avisos ---------- */
.avisos { display: grid; gap: 10px; margin-bottom: 16px; }
.aviso { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--ojo-bg); color: var(--tinta); }
.aviso.malo { background: #fff; box-shadow: inset 0 0 0 1.5px rgba(163, 23, 46, 0.3); }
.aviso p { flex: 1; min-width: 0; }
.aviso b { font-weight: 800; }
.aviso-icono { width: 36px; height: 36px; flex: none; padding: 8px; border-radius: 50%; background: #fff; fill: none; stroke: var(--ojo); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.aviso.malo .aviso-icono { stroke: var(--malo); }

/* ---------- portada del mes ---------- */
.portada { display: grid; gap: 14px; padding: 20px; border-radius: 24px; background: var(--tinta); color: #fff; box-shadow: var(--sombra-alta); overflow: hidden; position: relative; isolation: isolate; }
.portada::after { content: ""; position: absolute; z-index: -1; right: -70px; top: -90px; width: 240px; height: 240px; border-radius: 50%; background: var(--vino); }
.portada::before { content: ""; position: absolute; z-index: -1; right: -36px; bottom: -44px; width: 120px; height: 120px; border-radius: 50%; background: #fff; opacity: 0.05; }
@media (max-width: 719px) { .portada::after { width: 150px; height: 150px; right: -62px; top: -66px; } }
.portada-etiqueta { color: #d9d6d0; font-size: 14px; font-weight: 700; }
.portada-total { margin-top: 4px; font-size: 44px; font-weight: 800; letter-spacing: -0.035em; line-height: 1; font-variant-numeric: tabular-nums; }
.portada-total small { font-size: 0.42em; font-weight: 700; letter-spacing: 0; color: #d9d6d0; margin-left: 4px; }
.portada-tu { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 16px; background: rgba(255, 255, 255, 0.1); font-size: 14px; color: #ecebe7; }
.portada-tu b { color: #fff; font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.portada-partes { display: flex; flex-wrap: wrap; gap: 8px; }
.portada-partes span { display: inline-flex; align-items: baseline; gap: 6px; padding: 7px 11px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); color: #dedbd5; font-size: 12.5px; font-weight: 600; }
.portada-partes b { color: #fff; font-weight: 800; font-variant-numeric: tabular-nums; }
@media (min-width: 720px) {
  .portada { grid-template-columns: 1.2fr 1fr; align-items: end; padding: 28px 30px; }
  .portada-total { font-size: 56px; }
  .portada-partes { grid-column: 1 / -1; }
}

/* ---------- listas de filas ---------- */
.filas > li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 14px 0; border-top: 1px solid var(--linea); }
.filas > li:first-child { border-top: 0; padding-top: 4px; }
.fila-titulo { display: block; font-weight: 700; color: var(--tinta); overflow-wrap: anywhere; }
.fila-sub { display: block; color: var(--suave); font-size: var(--fs-small); line-height: 19px; }
.fila-dato { text-align: right; font-size: 16px; font-weight: 800; color: var(--tinta); white-space: nowrap; font-variant-numeric: tabular-nums; }
.fila-dato small { display: block; color: var(--suave); font-size: 12px; font-weight: 600; }
.fila-pie { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.fila-pie .acciones { margin-left: auto; display: flex; flex-wrap: wrap; gap: 6px; }
.vacio { padding: 12px 0; color: var(--suave); }
.urgente .fila-titulo { color: var(--malo); }
.filas > li.urgente { margin: 0 -10px; padding-left: 10px; padding-right: 10px; border-radius: 14px; background: #fff; box-shadow: inset 0 0 0 1.5px rgba(163, 23, 46, 0.28); border-top-color: transparent; }
.filas > li.urgente + li { border-top-color: transparent; }
.fila-socio { display: flex; align-items: center; gap: 10px; }
.partes { display: flex; flex-wrap: wrap; gap: 6px; }
.partes > span { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 3px 3px; border-radius: 999px; background: var(--neutro-bg); font-size: 12.5px; font-weight: 600; color: var(--tinta-2); }
.partes > span .avatar { width: 22px; height: 22px; font-size: 10.5px; }
.partes b { color: var(--tinta); font-weight: 800; font-variant-numeric: tabular-nums; }
.partes .tu { box-shadow: inset 0 0 0 1.5px var(--tinta); background: #fff; }

.dia-cabeza { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 8px; padding: 18px 0 6px; color: var(--suave); font-size: var(--fs-small); font-weight: 600; }
.dia-cabeza:first-child { padding-top: 0; }
.dia-cabeza b { color: var(--tinta); font-size: 15px; font-weight: 800; }
.dia-cabeza span { white-space: nowrap; }
.dia-cabeza b::first-letter { text-transform: uppercase; }
.dia-cabeza.urgente-dia b { color: var(--malo); }

.grupo + .grupo { margin-top: 16px; }
.grupo > .panel-cabeza .total { font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.pausado .fila-titulo, .quitado .fila-titulo { color: var(--suave); }
.quitado .fila-titulo { text-decoration: line-through; text-decoration-color: rgba(117, 99, 106, 0.5); }

.pestanas { display: inline-flex; align-items: center; padding: 4px; border-radius: 999px; background: var(--tarjeta); box-shadow: var(--sombra); }
.pestanas button { min-height: 36px; padding: 0 16px; border: 0; border-radius: 999px; background: none; color: var(--tinta-2); font-size: 14px; font-weight: 700; transition: background-color 160ms ease, color 160ms ease; }
.pestanas button[aria-selected="true"] { background: var(--tinta); color: #fff; }
.pestanas button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pestanas .mes-ant, .pestanas .mes-sig { display: inline-grid; place-items: center; padding: 0 10px; }
.pestanas .mes-nombre { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; font-size: 14px; font-weight: 800; white-space: nowrap; }
.pestanas .mes-nombre::first-letter { text-transform: uppercase; }

.interruptor { display: inline-flex; align-items: center; gap: 10px; color: var(--tinta-2); font-size: 14px; font-weight: 700; cursor: pointer; }
.interruptor input { appearance: none; width: 44px; height: 26px; margin: 0; border-radius: 999px; background: var(--linea-2); position: relative; cursor: pointer; transition: background-color 200ms ease; }
.interruptor input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(24, 24, 27, 0.25); transition: transform 260ms var(--ease-rebote); }
.interruptor input:checked { background: var(--tinta); }
.interruptor input:checked::after { transform: translateX(18px); }

/* ---------- mi parte (wallet) ---------- */
.wallet { background: #fff; }
.wallet-cabeza { margin: 2px 0 16px; }
.wallet-nota { color: var(--tinta-2); font-size: 14px; font-weight: 700; }
.wallet-saldo { margin: 2px 0 12px; color: var(--tinta); font-size: 38px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.wallet-saldo.listo { color: var(--ok); }
.barra { position: relative; height: 14px; border-radius: 999px; background: var(--fondo-2); overflow: hidden; }
.barra i { position: absolute; inset: 0; border-radius: inherit; background: var(--vino); transform-origin: left center; transform: scaleX(var(--avance, 0)); transition: transform 700ms var(--ease-out); }
.barra.completa i { background: var(--ok); }
.barra-pie { display: flex; justify-content: space-between; margin-top: 6px; color: var(--suave); font-size: 12.5px; font-weight: 700; }
@media (prefers-reduced-motion: reduce) { .barra i { transition: none; } }
.datos { display: grid; margin: 4px 0 16px; }
.datos div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--linea); }
.datos dt { color: var(--tinta-2); font-weight: 600; }
.datos dd { font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cuenta-destino { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: var(--fondo); font-size: 13.5px; color: var(--tinta-2); }
.cuenta-destino b { color: var(--tinta); }
.cuenta-destino svg { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--tinta-2); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cuenta-destino.falta { background: var(--ojo-bg); }
.cuenta-destino.falta svg { stroke: var(--ojo); }
.privado { display: inline-flex; align-items: center; gap: 6px; }
.privado svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.motivo { grid-column: 1 / -1; color: var(--tinta-2); font-size: var(--fs-small); line-height: 19px; }
.motivo.malo { color: var(--malo); }
.motivo.ok { color: var(--ok); }
.revisando-barra { grid-column: 1 / -1; height: 4px; border-radius: 4px; background: linear-gradient(90deg, transparent, var(--rivero), transparent) 0 0 / 40% 100% no-repeat, var(--ojo-bg); animation: barrido 1.4s linear infinite; }
@keyframes barrido { from { background-position: -40% 0, 0 0; } to { background-position: 140% 0, 0 0; } }
@media (prefers-reduced-motion: reduce) { .revisando-barra { animation: none; background: var(--ojo-bg); } }

/* ---------- ventanas ---------- */
dialog.ventana { width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 0; border-radius: 24px; background: var(--tarjeta); color: var(--tinta); box-shadow: 0 30px 80px -20px rgba(24, 24, 27, 0.45); overflow: auto; opacity: 1; transform: none; transition: opacity 220ms var(--ease-out), transform 260ms var(--ease-out), overlay 220ms allow-discrete, display 220ms allow-discrete; }
dialog.ventana[open] { @starting-style { opacity: 0; transform: scale(0.95) translateY(8px); } }
dialog.ventana::backdrop { background: rgba(24, 24, 27, 0.38); }
@media (prefers-reduced-motion: reduce) { dialog.ventana { transition: opacity 150ms ease; } dialog.ventana[open] { @starting-style { opacity: 0; transform: none; } } }
@media (max-width: 559px) { dialog.ventana { margin: auto 0 0; width: 100vw; max-width: 100vw; border-radius: 24px 24px 0 0; max-height: 92dvh; } dialog.ventana[open] { @starting-style { opacity: 0; transform: translateY(40px); } } }
.ventana-cabeza { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 14px; background: var(--tarjeta); border-bottom: 1px solid var(--linea); }
.ventana-cabeza h2 { font-size: 19px; font-weight: 800; letter-spacing: -0.01em; }
.ventana-cuerpo { padding: 18px 20px 22px; }
.ventana-pie { display: flex; flex-wrap: wrap-reverse; justify-content: flex-end; gap: 10px; margin-top: 18px; }
@media (max-width: 559px) { .ventana-pie .boton { flex: 1; min-height: 50px; } .ventana-cuerpo { padding-bottom: calc(22px + env(safe-area-inset-bottom)); } }
.cerrar { width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--neutro-bg); color: var(--tinta-2); }
.cerrar svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

.subir { position: relative; display: grid; place-items: center; gap: 8px; min-height: 140px; padding: 18px; border: 2px dashed var(--linea-2); border-radius: 18px; background: var(--fondo); text-align: center; color: var(--tinta-2); font-size: 14px; cursor: pointer; transition: border-color 160ms ease, background-color 160ms ease; }
.subir input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.subir svg { width: 44px; height: 44px; padding: 10px; border-radius: 50%; background: var(--arena); fill: none; stroke: var(--vino); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.subir b { color: var(--tinta); font-weight: 800; }
.subir:focus-within, .subir:hover { border-color: var(--tinta); }
.subir.con-imagen { padding: 8px; background: #fff; }
.subir img { max-width: 100%; max-height: 260px; border-radius: 12px; }
.nota-privada { display: flex; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--fondo); color: var(--tinta-2); font-size: var(--fs-small); line-height: 19px; }
.nota-privada svg { width: 16px; height: 16px; flex: none; margin-top: 1px; fill: none; stroke: var(--tinta-2); stroke-width: 1.8; }
.ver-captura img { display: block; max-width: 100%; margin: 0 auto; border-radius: 12px; }

/* ---------- aviso flotante (abajo, fuera de la zona de lectura) ---------- */
.toast { position: fixed; z-index: 60; left: 50%; bottom: calc(var(--barra) + 18px + env(safe-area-inset-bottom)); display: inline-flex; align-items: center; gap: 8px; max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: 999px; background: var(--tinta); color: #fff; font-size: 14px; font-weight: 700; box-shadow: 0 14px 34px -12px rgba(24, 24, 27, 0.6); transform: translateX(-50%); transition: opacity 220ms var(--ease-out), transform 260ms var(--ease-rebote); }
.toast::before { content: ""; width: 18px; height: 18px; flex: none; border-radius: 50%; background: var(--ok) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center / 12px no-repeat; }
.toast.malo::before { background: var(--malo) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M12 7v6M12 17h.01'/%3E%3C/svg%3E") center / 12px no-repeat; }
.toast[hidden] { display: inline-flex !important; opacity: 0; transform: translate(-50%, 16px) scale(0.96); pointer-events: none; }
@media (min-width: 960px) { .toast { bottom: 28px; } }
@media (prefers-reduced-motion: reduce) { .toast, .toast[hidden] { transition: opacity 150ms ease; transform: translateX(-50%); } }

/* confeti de botones de sastre e hilos al terminar algo importante (lo pone app.js; nunca con movimiento reducido) */
.confeti { position: fixed; z-index: 70; left: 0; top: 0; width: 12px; height: 12px; border-radius: 50%; pointer-events: none; background: var(--c, var(--vino)); }
.confeti.boton-sastre { background: radial-gradient(circle at 36% 36%, #fff 0 1.1px, transparent 1.5px), radial-gradient(circle at 64% 36%, #fff 0 1.1px, transparent 1.5px), radial-gradient(circle at 36% 64%, #fff 0 1.1px, transparent 1.5px), radial-gradient(circle at 64% 64%, #fff 0 1.1px, transparent 1.5px), var(--c, var(--vino)); }
.confeti.hilo { width: 16px; height: 3px; border-radius: 2px; }

/* ---------- ajustes ---------- */
.historial li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--linea); font-size: 14px; }
.historial li:first-child { border-top: 0; }
.historial time { color: var(--suave); white-space: nowrap; font-size: var(--fs-small); }

/* ---------- chat de cambios ---------- */
.columna-chat { order: -1; }
@media (min-width: 960px) { .columna-chat { order: 0; position: sticky; top: 92px; } }
.chat-para { color: var(--tinta-2); font-size: 14px; line-height: 21px; margin-bottom: 12px; }
.chat-para b { color: var(--tinta); }
.chat-form { display: grid; gap: 8px; }
.chat-form textarea { min-height: 72px; border-radius: 16px; }
.chat-ejemplos { display: flex; flex-wrap: wrap; gap: 6px; }
.chat-ejemplos .boton { min-height: 32px; padding: 0 12px; font-size: 12.5px; background: var(--fondo); border: 0; color: var(--tinta-2); }
.chat-enviar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.chat-mensajes { display: grid; gap: 14px; margin-top: 16px; max-height: 70vh; overflow: auto; overscroll-behavior: contain; padding-right: 2px; }
@media (max-width: 959px) { .chat-mensajes { max-height: none; } }
.chat-mensajes > li { display: grid; gap: 6px; }
.chat-quien { display: flex; align-items: center; gap: 8px; color: var(--suave); font-size: 12.5px; font-weight: 600; }
.chat-quien b { color: var(--tinta); font-weight: 800; }
.chat-quien time { margin-left: auto; }
.chat-texto { justify-self: start; max-width: 92%; padding: 10px 14px; border-radius: 4px 18px 18px 18px; background: var(--arena); color: var(--tinta); font-weight: 600; overflow-wrap: anywhere; }
.chat-respuesta { justify-self: start; max-width: 92%; padding: 10px 14px; border-radius: 18px 18px 18px 4px; background: #fff; box-shadow: inset 0 0 0 1.5px var(--linea); color: var(--tinta-2); font-size: 14px; }
.chat-propuestas { display: grid; gap: 6px; padding: 10px 12px; border-radius: 14px; background: #fff; box-shadow: inset 0 0 0 1.5px var(--linea); font-size: 14px; font-weight: 600; }
.chat-propuestas li { display: flex; gap: 8px; align-items: baseline; }
.chat-propuestas li::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--tinta); transform: translateY(-1px); }
.chat-propuestas li.fallo { color: var(--malo); }
.chat-acciones { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* ---------- entrar ---------- */
body.entrar { display: grid; place-items: center; padding: 24px 16px; background: var(--fondo); }
.entrar-caja { width: min(420px, 100%); display: grid; gap: 12px; justify-items: center; text-align: center; }
.entrar-caja .logo { width: 72px; height: 54px; margin-bottom: 4px; }
.entrar-caja h1 { font-size: 32px; font-weight: 800; letter-spacing: -0.03em; }
.entrar-caja > p { color: var(--tinta-2); max-width: 34ch; }
.entrar-form { width: 100%; display: grid; gap: 16px; text-align: left; margin-top: 8px; }
.entrar-form fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }
.entrar-form legend { margin-bottom: 8px; color: var(--tinta); font-size: 15px; font-weight: 800; }
.personas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.personas .opcion span { width: 100%; justify-content: center; min-height: 48px; }
.demo { padding: 12px 14px; border-radius: 14px; background: var(--ojo-bg); color: var(--ojo); font-size: 13px; font-weight: 600; line-height: 19px; }

/* ---------- utilidades (sin estilos en línea: la CSP no los deja) ---------- */
.sprite { position: absolute; }
.mt { margin-top: 16px; }
@media (min-width: 960px) { .mt { margin-top: 24px; } }
.mt-chico { margin-top: 12px; }
.sin-margen { margin: 0; }
.sin-borde { border: 0; margin: 0; padding: 0; }
.leyenda { color: var(--tinta); font-size: 14px; font-weight: 700; margin-bottom: 6px; padding: 0; }

/* pasos para ponerla en el celular */
.pasos { display: grid; gap: 10px; counter-reset: paso; }
.pasos li { position: relative; padding-left: 38px; color: var(--tinta-2); font-size: 14px; line-height: 21px; counter-increment: paso; }
.pasos li::before { content: counter(paso); position: absolute; left: 0; top: -2px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--tinta); color: #fff; font-size: 13px; font-weight: 800; }
.pasos b { color: var(--tinta); }
