/* ZavioPay - hoja unica.
   Movil primero: esto acaba siendo una app, y lo que se ve en un movil de
   5 pulgadas manda sobre lo que se ve en el monitor del despacho.

   Tema CLARO a proposito: quien va a usar esto no es programador. La gente
   normal tiene el movil en blanco. */

:root {
    --bg:        #FFFFFF;
    --bg-soft:   #FBF9F4;
    --card:      #FFFFFF;
    --line:      #E7E1D4;
    --text:      #1B1710;
    --muted:     #7C7365;

    /* Oro: el oscuro para el texto (se lee), el vivo para brillos y filamentos */
    --gold:      #B8912B;
    --gold-lit:  #E8C558;
    --gold-soft: #FBF3DC;
    --accent:    var(--gold);
    --accent-in: #FFFFFF;

    --danger:    #C0392B;
    --danger-bg: #FDECEA;
    --ok:        #1E7A4C;
    --ok-bg:     #E8F6EE;

    --radius:    16px;
    --tabbar:    62px;
}

* { box-sizing: border-box; }

/* Nada de barras de desplazamiento a la vista, en ningun sitio.
   Se sigue pudiendo desplazar igual: solo se esconde la barra. */
* {
    scrollbar-width: none;          /* Firefox */
    -ms-overflow-style: none;       /* Edge antiguo */
}

*::-webkit-scrollbar {              /* Chrome, Safari, Edge */
    width: 0;
    height: 0;
    display: none;
}

/* El atributo hidden tiene que ganar SIEMPRE.
   Sin esto, cualquier regla nuestra con display:flex/grid lo anula y el
   elemento se ve igual. Costo un pago que no salia: la barra parecia estar
   en modo dinero cuando no lo estaba. */
[hidden] { display: none !important; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    -webkit-text-size-adjust: 100%;
}

a { color: var(--gold); text-decoration: none; }

/* ------------------------------------------------ el filamento
   Dos trazos superpuestos: uno de 2px que es el hilo, y otro de 1px
   desenfocado encima que hace de halo. El degradado apaga los extremos, y
   por eso parece que la luz viaja por el centro en vez de ser una raya. */

.filament { position: relative; }

.filament::before,
.filament::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    pointer-events: none;
}

.filament::before {
    height: 2px;
    background: linear-gradient(90deg,
        rgba(184, 145, 43, 0)   0%,
        rgba(184, 145, 43, .35) 18%,
        var(--gold-lit)         50%,
        rgba(184, 145, 43, .35) 82%,
        rgba(184, 145, 43, 0)   100%);
}

.filament::after {
    height: 1px;
    background: linear-gradient(90deg,
        rgba(232, 197, 88, 0)  10%,
        rgba(232, 197, 88, .9) 50%,
        rgba(232, 197, 88, 0)  90%);
    filter: blur(1.5px);
    /* El halo respira: el hilo parece encendido, no pintado */
    animation: glow 3.4s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% { opacity: .45; }
    50%      { opacity: 1; }
}

/* En la barra de abajo el hilo va arriba; en la de arriba, abajo */
.tabbar.filament::before { top: 0; }
.tabbar.filament::after  { top: 2px; }

.topbar.filament::before { bottom: 0; }
.topbar.filament::after  { bottom: 0; }

/* ------------------------------------------------ estructura */

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: var(--bg);
    position: sticky;
    top: 0;
    z-index: 10;
}

.brand {
    display: flex;
    align-items: center;
    gap: 9px;
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: -0.02em;
    color: var(--text);
}

.brand-mark {
    border-radius: 8px;
    display: block;
    box-shadow: 0 1px 4px rgba(184, 145, 43, .35);
    transition: transform .35s cubic-bezier(.34, 1.56, .64, 1);
}

/* Un guiño al pulsar la marca: gira un pelo y vuelve */
.brand:active .brand-mark { transform: rotate(-8deg) scale(.94); }

@media (hover: hover) {
    .brand:hover .brand-mark { transform: rotate(6deg) scale(1.06); }
}

.wrap {
    max-width: 560px;
    margin: 0 auto;
    padding: 18px 18px calc(var(--tabbar) + 28px);
}

.wrap-narrow { max-width: 420px; padding-bottom: 40px; }

/* ------------------------------------------------ barra inferior */

.tabbar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    min-height: var(--tabbar);
    display: flex;
    background: var(--bg);
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 10;
}

/* Reparto flexible: caben las que haya sin que ninguna se caiga de fila.
   (Antes eran cuatro columnas fijas y la quinta se iba abajo.) */
.tab {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 8px 2px 6px;
    color: var(--muted);
    font-size: 0.7rem;
    text-align: center;
    line-height: 1.15;
    -webkit-tap-highlight-color: transparent;
}

.tab-txt {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color .25s ease, font-weight .2s ease;
}

/* El icono vive dentro de una pastilla que solo se enciende en la activa.
   El rebote de la curva es lo que le da el aire juguetón. */
.tab-ico {
    position: relative;
    width: 40px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: inherit;
    transition: transform .32s cubic-bezier(.34, 1.56, .64, 1),
                color .25s ease;
}

.tab-ico::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--gold-soft), #F6E9C6);
    transform: scale(.4);
    opacity: 0;
    transition: transform .32s cubic-bezier(.34, 1.56, .64, 1), opacity .22s ease;
}

.tab-ico svg {
    position: relative;
    width: 22px;
    height: 22px;
}

.tab.on { color: var(--gold); }
.tab.on .tab-txt { font-weight: 700; }

/* Activa: la pastilla crece hasta su sitio y el icono sube un pelo */
.tab.on .tab-ico { transform: translateY(-2px); color: var(--gold); }
.tab.on .tab-ico::before { transform: scale(1); opacity: 1; }

/* Al pulsar, se hunde. Es el gesto que hace que parezca un boton de verdad */
.tab:active .tab-ico { transform: scale(.86); }

@media (hover: hover) {
    .tab:hover { color: var(--gold); }
    .tab:hover .tab-ico { transform: translateY(-1px); }
}

/* ------------------------------------------------ piezas */

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 1px 2px rgba(27, 23, 16, .04);
}

/* La tarjeta del saldo lleva su propio filamento arriba */
.card-gold {
    background: linear-gradient(180deg, var(--gold-soft), var(--card) 60%);
    border-color: #EFE3C4;
    overflow: hidden;
}

.card-gold.filament::before { top: 0; }
.card-gold.filament::after  { top: 2px; }

.balance-label { color: var(--muted); font-size: 0.9rem; margin: 0 0 6px; }

.balance {
    font-size: 2.6rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin: 0;
    font-variant-numeric: tabular-nums;
}

.handle { color: var(--muted); font-size: 0.9rem; }

/* ------------------------------------------------ formularios */

label { display: block; margin: 14px 0 6px; font-size: 0.9rem; color: var(--muted); }

input[type=text], input[type=email], input[type=password], input[type=tel] {
    width: 100%;
    padding: 13px 14px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--text);
    font-size: 1rem;
}

input:focus {
    outline: 2px solid var(--gold);
    outline-offset: 1px;
    border-color: var(--gold);
}

/* El teclado del movil debe abrirse en numeros para los importes */
input.amount {
    font-size: 1.8rem;
    font-weight: 700;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.btn {
    display: block;
    width: 100%;
    margin-top: 18px;
    padding: 15px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(180deg, var(--gold-lit), var(--gold));
    color: #2A2005;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 1px 0 rgba(255, 255, 255, .5) inset;
}

.btn:active { transform: translateY(1px); }

.btn-ghost {
    background: var(--bg);
    border: 1px solid var(--line);
    color: var(--text);
    box-shadow: none;
}

.linkish {
    background: none;
    border: 0;
    color: var(--muted);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0;
}

/* ------------------------------------------------ avisos */

.flash {
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 16px;
    font-size: 0.94rem;
}

.flash.error { background: var(--danger-bg); border: 1px solid #F2C4BE; color: var(--danger); }
.flash.ok    { background: var(--ok-bg);     border: 1px solid #BFE5D0; color: var(--ok); }
.flash.info  { background: var(--bg-soft);   border: 1px solid var(--line); }

/* ------------------------------------------------ movimientos */

.movs { list-style: none; margin: 0; padding: 0; }

.mov {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 0;
    border-bottom: 1px solid var(--line);
}

.mov:last-child { border-bottom: 0; }

.mov-who { font-weight: 600; }
.mov-when { color: var(--muted); font-size: 0.82rem; }

.mov-amount { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mov-amount.in  { color: var(--ok); }
.mov-amount.out { color: var(--text); }

/* ------------------------------------------------ rejilla de aplicaciones */

.group-title {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin: 0 0 14px;
    font-weight: 600;
}

.appgrid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px 4px;
}

@media (max-width: 340px) {
    .appgrid { grid-template-columns: repeat(3, 1fr); }
}

.appitem {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 10px 2px;
    border-radius: 14px;
    color: var(--text);
    text-align: center;
}

.appitem:active { background: var(--bg-soft); }

/* Al entrar, los iconos aparecen escalonados: da sensacion de que la rejilla
   se monta sola en vez de aparecer de golpe. */
.appgrid .appitem {
    animation: pop-in .38s cubic-bezier(.34, 1.56, .64, 1) both;
}

.appgrid .appitem:nth-child(1) { animation-delay: .02s; }
.appgrid .appitem:nth-child(2) { animation-delay: .06s; }
.appgrid .appitem:nth-child(3) { animation-delay: .10s; }
.appgrid .appitem:nth-child(4) { animation-delay: .14s; }
.appgrid .appitem:nth-child(5) { animation-delay: .18s; }
.appgrid .appitem:nth-child(6) { animation-delay: .22s; }
.appgrid .appitem:nth-child(7) { animation-delay: .26s; }
.appgrid .appitem:nth-child(8) { animation-delay: .30s; }

@keyframes pop-in {
    from { opacity: 0; transform: translateY(8px) scale(.86); }
    to   { opacity: 1; transform: none; }
}

.appicon {
    position: relative;
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    /* La pastilla toma el color de la app, muy rebajado; el trazo va a full */
    background: color-mix(in srgb, var(--tint) 14%, #fff);
    border: 1px solid color-mix(in srgb, var(--tint) 30%, #fff);
    color: var(--tint);
    flex: none;
}

.appicon svg {
    width: 24px;
    height: 24px;
    position: relative;
}

.appicon {
    transition: transform .3s cubic-bezier(.34, 1.56, .64, 1), box-shadow .25s ease;
}

.appitem:active .appicon { transform: scale(.88); }

@media (hover: hover) {
    .appitem:hover .appicon {
        transform: translateY(-3px) rotate(-3deg);
        box-shadow: 0 6px 14px color-mix(in srgb, var(--tint) 28%, transparent);
    }
    .approw:hover .appicon { transform: translateY(-2px); }
}

/* Un destello cruza la pastilla al pasar por encima. Sutil: se nota, no molesta. */
.appicon::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(115deg, transparent 38%, rgba(255,255,255,.85) 50%, transparent 62%);
    transform: translateX(-120%);
    opacity: 0;
    pointer-events: none;
}

@media (hover: hover) {
    .appitem:hover .appicon::after {
        animation: sheen .7s ease forwards;
    }
}

@keyframes sheen {
    from { transform: translateX(-120%); opacity: .9; }
    to   { transform: translateX(120%);  opacity: 0; }
}

/* Marca discreta de "esto sale de la app" */
.appbadge {
    position: absolute;
    right: -4px;
    top: -4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid var(--line);
    color: var(--muted);
    font-size: 10px;
    line-height: 14px;
    text-align: center;
}

.appname {
    font-size: 0.76rem;
    line-height: 1.25;
    color: var(--text);
    /* Dos lineas como mucho: si no cabe, se recorta y no descuadra la rejilla */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.applist { list-style: none; margin: 0; padding: 0; }

.approw {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
    color: var(--text);
}

.applist li:last-child .approw { border-bottom: 0; }

.approw-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.approw .appname { font-size: 0.98rem; font-weight: 600; }

.apptag { color: var(--muted); font-size: 0.83rem; }

.appout { margin-left: auto; color: var(--muted); font-size: 1.1rem; }

/* ------------------------------------------------ social (el chat)
   El modelo viene de IberChat; el aspecto es el de aquí. Nada de verde:
   los mensajes propios van en oro y los del otro en papel. */

.avatar {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    flex: none;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--gold-lit), var(--gold));
    color: #2A2005;
    font-weight: 700;
    font-size: 1.05rem;
}

.badge {
    margin-left: auto;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--gold);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    display: grid;
    place-items: center;
}

.chat-open { display: flex; gap: 10px; }
.chat-open input { flex: 1; }

/* Fila de personas con las que ya mueves dinero */
.peoplerow {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.person { margin: 0; }

.person-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 66px;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    color: var(--text);
    font: inherit;
    transition: transform .28s cubic-bezier(.34, 1.56, .64, 1);
}

.person-btn:active { transform: scale(.92); }

.person-name {
    font-size: 0.72rem;
    line-height: 1.2;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--muted);
}

/* --- cabecera del hilo */

.chat-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 0 14px;
}

.chat-back {
    font-size: 1.4rem;
    color: var(--muted);
    line-height: 1;
    padding: 4px 6px 4px 0;
}

.chat-balance {
    margin-left: auto;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--gold);
    white-space: nowrap;
}

/* --- los mensajes */

.chat {
    display: flex;
    flex-direction: column;
    gap: 8px;
    /* Alto fijo con desplazamiento propio: la barra de escribir no se mueve */
    height: calc(100dvh - var(--tabbar) - 230px);
    min-height: 220px;
    overflow-y: auto;
    padding: 14px;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.msg {
    max-width: 78%;
    padding: 9px 13px;
    border-radius: 16px;
    font-size: 0.95rem;
    line-height: 1.35;
    word-wrap: break-word;
    animation: msg-in .26s ease both;
}

@keyframes msg-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
}

.msg.mine {
    align-self: flex-end;
    background: linear-gradient(180deg, var(--gold-lit), var(--gold));
    color: #2A2005;
    border-bottom-right-radius: 5px;
}

.msg.theirs {
    align-self: flex-start;
    background: #fff;
    border: 1px solid var(--line);
    border-bottom-left-radius: 5px;
}

/* Un mensaje que es dinero se lee de un vistazo: la cifra manda */
.msg-money {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 16px;
    min-width: 170px;
}

.msg-tag { font-size: 0.72rem; text-transform: uppercase; letter-spacing: .06em; opacity: .75; }
.msg-amount { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.msg-note { font-size: 0.85rem; opacity: .8; }

.msg-pay {
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 10px;
    background: var(--gold);
    color: #fff;
    text-align: center;
    font-weight: 700;
    font-size: 0.88rem;
}

.msg.mine .msg-pay { background: #2A2005; }

.msg-done { margin-top: 6px; font-size: 0.78rem; opacity: .7; }

/* Pago retenido: se puede echar atras mientras dure la cuenta */
.msg-cancel { margin: 8px 0 0; }

.msg-undo {
    width: 100%;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid rgba(42, 32, 5, .35);
    background: rgba(255, 255, 255, .55);
    color: #2A2005;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    font-variant-numeric: tabular-nums;
}

.msg.theirs .msg-undo { border-color: var(--line); background: var(--bg-soft); color: var(--text); }

/* Mientras esta en el aire, la burbuja late despacio: se ve que aun no ha llegado */
.msg-money:has(.msg-cancel) { animation: msg-in .26s ease both, held-pulse 1.6s ease-in-out infinite; }

@keyframes held-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(184, 145, 43, .45); }
    50%      { box-shadow: 0 0 0 6px rgba(184, 145, 43, 0); }
}

/* Un pago que se echo atras se queda tachado, no desaparece */
.msg-void { opacity: .6; }
.msg-void .msg-amount { text-decoration: line-through; }

.msg-system {
    align-self: center;
    font-size: 0.78rem;
    color: var(--muted);
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 4px 12px;
}

/* Quien habla, en los grupos. En un hilo de dos sobra: ya se sabe quien es. */
.msg-from {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: .02em;
    color: var(--muted);
    margin-bottom: 2px;
}

/* A quien va el dinero dentro de un grupo. Va pegado al importe a proposito:
   se lee "pagar 10 EUR a Ana" de un vistazo, sin buscar el dato en otro sitio. */
.chat-to {
    width: auto;
    margin: 0;
    max-width: 42%;
    font-size: 0.86rem;
}

.typing {
    margin: 8px 2px 0;
    font-size: 0.82rem;
    color: var(--muted);
    font-style: italic;
}

/* --- barra de escribir */

.chat-bar {
    position: sticky;
    bottom: calc(var(--tabbar) + 6px);
    margin-top: 12px;
    background: var(--bg);
    padding-top: 6px;
}

.chat-row { display: flex; align-items: center; gap: 8px; }

.chat-row input[type=text] { flex: 1; padding: 12px 14px; }

.chat-act {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    flex: none;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--bg);
    color: var(--muted);
    cursor: pointer;
    transition: transform .28s cubic-bezier(.34, 1.56, .64, 1), color .2s, border-color .2s;
}

.chat-act svg { width: 20px; height: 20px; }
.chat-act:active { transform: scale(.88); }

@media (hover: hover) {
    .chat-act:hover { color: var(--gold); border-color: #EFE3C4; }
}

/* En modo dinero la barra se tiñe: no se paga por accidente creyendo que se escribe */
.chat-bar.is-money .chat-row input[type=text] { border-color: var(--gold); }
.chat-bar.is-money .chat-act { color: var(--gold); border-color: #EFE3C4; }

.chat-money {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    padding: 10px 12px;
    background: var(--gold-soft);
    border: 1px solid #EFE3C4;
    border-radius: 12px;
    animation: msg-in .22s ease both;
}

.chat-money .amount { font-size: 1.3rem; margin: 0; }

.chat-send {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    flex: none;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--gold-lit), var(--gold));
    color: #2A2005;
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform .28s cubic-bezier(.34, 1.56, .64, 1);
}

.chat-send:active { transform: scale(.9); }

/* En modo dinero el boton crece y dice lo que va a hacer: "Pagar 10,00 €" */
.chat-send.wide {
    width: auto;
    min-width: 118px;
    padding: 0 18px;
    border-radius: 14px;
    font-size: 0.95rem;
    font-weight: 700;
}

/* El boton de pagar o pedir se queda encendido mientras ese modo esta puesto */
.chat-act.on {
    color: #2A2005;
    border-color: var(--gold);
    background: linear-gradient(180deg, var(--gold-lit), var(--gold));
}

.chat-hint {
    margin: 8px 2px 0;
    font-size: 0.8rem;
    color: var(--muted);
}

/* Aviso de mensajes sin leer sobre el icono de la barra de abajo */
.tab-dot {
    position: absolute;
    top: -2px;
    right: 4px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 17px;
    text-align: center;
    border: 2px solid var(--bg);
}

/* ------------------------------------------------ avisos y peticiones */

/* Barra de aviso al entrar al monedero: algo te reclama, y se pulsa */
.notice {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    margin-bottom: 16px;
    border-radius: var(--radius);
    background: var(--gold-soft);
    border: 1px solid #EFE3C4;
    color: var(--text);
    font-weight: 600;
    font-size: 0.94rem;
    animation: msg-in .3s ease both;
}

.notice-dot {
    display: grid;
    place-items: center;
    min-width: 26px;
    height: 26px;
    padding: 0 7px;
    flex: none;
    border-radius: 999px;
    background: var(--gold);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
}

.notice-go { margin-left: auto; color: var(--muted); font-size: 1.3rem; line-height: 1; }

.notice:active { transform: scale(.99); }

/* Fila de una peticion: importe y botones debajo, que en movil no caben al lado */
.reqrow { align-items: flex-start; }

.reqactions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    flex: none;
}

.btn-mini {
    padding: 7px 14px;
    border-radius: 10px;
    background: linear-gradient(180deg, var(--gold-lit), var(--gold));
    color: #2A2005;
    font-weight: 700;
    font-size: 0.85rem;
    white-space: nowrap;
    transition: transform .28s cubic-bezier(.34, 1.56, .64, 1);
}

.btn-mini:active { transform: scale(.93); }

/* ------------------------------------------------ cuenta */

.profile-head {
    display: flex;
    align-items: center;
    gap: 14px;
}

/* Barra de cuanto llevas gastado del limite del dia */
.meter {
    height: 8px;
    border-radius: 999px;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    overflow: hidden;
}

.meter span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--gold-lit), var(--gold));
    /* Crece al entrar: se lee de un vistazo que es una medida, no un adorno */
    animation: meter-fill .7s cubic-bezier(.22, 1, .36, 1) both;
}

@keyframes meter-fill {
    from { transform: scaleX(0); transform-origin: left; }
    to   { transform: scaleX(1); transform-origin: left; }
}

.pill {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--gold-soft);
    border: 1px solid #EFE3C4;
    color: var(--gold);
    font-size: 0.7rem;
    font-weight: 700;
    vertical-align: middle;
}

.linkish.danger { color: var(--danger); font-weight: 600; }

/* Acceso a la cuenta en la barra de arriba */
.topbar-user {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 1px solid var(--line);
    color: var(--muted);
    background: var(--bg);
    transition: transform .3s cubic-bezier(.34, 1.56, .64, 1),
                color .2s ease, border-color .2s ease;
}

.topbar-user svg { width: 20px; height: 20px; }

.topbar-user.on,
.topbar-user:active { color: var(--gold); border-color: #EFE3C4; background: var(--gold-soft); }

.topbar-user:active { transform: scale(.9); }

@media (hover: hover) {
    .topbar-user:hover { color: var(--gold); border-color: #EFE3C4; transform: translateY(-1px); }
}

/* ------------------------------------------------ muelle lateral de acciones
   Cuadraditos en el borde derecho. Al tocar uno se despliegan sus opciones,
   y abrir otro cierra el anterior: nunca hay dos abiertos a la vez. */

.dock {
    position: fixed;
    right: 12px;
    bottom: calc(var(--tabbar) + 18px + env(safe-area-inset-bottom));
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.dock-group {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.dock-btn {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 15px;
    border: 1px solid var(--line);
    background: var(--bg);
    color: var(--tint);
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(27, 23, 16, .12);
    transition: transform .32s cubic-bezier(.34, 1.56, .64, 1), border-color .2s;
}

.dock-btn svg { width: 22px; height: 22px; }

.dock-btn:active { transform: scale(.88); }

/* El abierto se gira un pelo y se marca: se ve cual esta desplegado */
.dock-group.open .dock-btn {
    transform: rotate(-8deg) scale(1.06);
    border-color: color-mix(in srgb, var(--tint) 45%, #fff);
    background: color-mix(in srgb, var(--tint) 12%, #fff);
}

.dock-items {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.dock-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--bg);
    border: 1px solid var(--line);
    color: var(--text);
    font-size: 0.86rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(27, 23, 16, .12);
    animation: dock-in .3s cubic-bezier(.34, 1.56, .64, 1) both;
}

/* Salen en cascada de abajo arriba, como si brotaran del cuadradito */
.dock-items .dock-item:nth-child(1) { animation-delay: .00s; }
.dock-items .dock-item:nth-child(2) { animation-delay: .05s; }
.dock-items .dock-item:nth-child(3) { animation-delay: .10s; }
.dock-items .dock-item:nth-child(4) { animation-delay: .15s; }

@keyframes dock-in {
    from { opacity: 0; transform: translateX(14px) scale(.86); }
    to   { opacity: 1; transform: none; }
}

.dock-item-ico { display: grid; place-items: center; color: var(--muted); }
.dock-item-ico svg { width: 17px; height: 17px; }

.dock-item:active { transform: scale(.95); }

/* ------------------------------------------------ escaner */

.scanbox {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background: #000;
    aspect-ratio: 1 / 1;
}

.scanbox video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Marco con la linea que recorre: da el punto de mira sin tapar la imagen */
.scanframe {
    position: absolute;
    inset: 14%;
    border: 2px solid rgba(255, 255, 255, .85);
    border-radius: 18px;
    box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .35);
    overflow: hidden;
}

.scanframe span {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold-lit), transparent);
    animation: scanline 2.4s ease-in-out infinite;
}

@keyframes scanline {
    0%, 100% { top: 4%; }
    50%      { top: 96%; }
}

/* ------------------------------------------------ pago por sonido
   No se oye nada, asi que toda la señal de que "esta pasando algo" tiene que
   ser visual: de ahi las ondas. */

.ear {
    position: relative;
    width: 160px;
    height: 160px;
    margin: 10px auto 0;
    display: grid;
    place-items: center;
}

.ear-core {
    width: 54px;
    height: 54px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--gold-lit), var(--gold));
    box-shadow: 0 4px 16px rgba(184, 145, 43, .45);
    transition: transform .12s ease-out;
}

.ear-ring {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    border: 2px solid var(--gold);
    opacity: 0;
}

/* Solo laten cuando de verdad se esta escuchando */
.ear.on .ear-ring { animation: ripple 2.4s ease-out infinite; }
.ear.on .ear-ring:nth-child(2) { animation-delay: .8s; }
.ear.on .ear-ring:nth-child(3) { animation-delay: 1.6s; }

@keyframes ripple {
    0%   { transform: scale(.34); opacity: .75; }
    100% { transform: scale(1);   opacity: 0; }
}

/* Emisor: tres barras que suben y bajan, como un altavoz */
.emit { margin-top: 16px; text-align: center; }

.emit-wave {
    display: inline-block;
    width: 6px;
    height: 26px;
    margin: 0 3px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--gold-lit), var(--gold));
    animation: emit-bar .9s ease-in-out infinite;
}

.emit-wave:nth-child(2) { animation-delay: .15s; }
.emit-wave:nth-child(3) { animation-delay: .3s; }

@keyframes emit-bar {
    0%, 100% { transform: scaleY(.4); }
    50%      { transform: scaleY(1.4); }
}

/* ------------------------------------------------ QR */

.qr-box {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px;
    display: grid;
    place-items: center;
}

.qr-box img { width: 100%; max-width: 280px; height: auto; display: block; }

.qr-amount { text-align: center; font-size: 2rem; font-weight: 700; margin: 4px 0 2px; }
.qr-note   { text-align: center; color: var(--muted); font-size: 0.88rem; }

.countdown { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--gold); }

/* ------------------------------------------------ portada */

.hero { text-align: center; padding: 40px 0 24px; }
.hero h1 { font-size: 2.2rem; letter-spacing: -0.03em; margin: 0 0 10px; }
.hero p { color: var(--muted); margin: 0 0 26px; }

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}
