/* ==========================================================================
   Capa de producto sobre Bootstrap 5.3. Tema «Base», estilo Apple/Google: lienzo gris neutro, tarjetas blancas,
   tinta casi negra y un tono de acento (turquesa en la plantilla). Nada de cremas ni papel cálido.
   Cada proyecto cambia su paleta SOLO en los tokens de abajo (skill nuevo-proyecto); los componentes no
   llevan colores sueltos. Claro y oscuro, elegidos a mano o automáticos.
   ========================================================================== */
@property --look-x { syntax: "<number>"; inherits: true; initial-value: 0; }
@property --look-y { syntax: "<number>"; inherits: true; initial-value: 0; }

:root,
[data-bs-theme="light"] {
    --app-font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --app-display: "Roboto Flex", "Plus Jakarta Sans", system-ui, sans-serif;
    --app-canvas: #f5f5f7;
    --app-surface: #ffffff;
    --app-surface-2: #f5f5f7;
    --app-surface-3: #e8e8ed;
    --app-glass: rgba(255, 255, 255, .78);
    --app-glass-strong: rgba(255, 255, 255, .94);
    --app-glass-border: rgba(0, 0, 0, .06);
    --app-ink: #1d1d1f;
    --app-ink-2: #424245;
    --app-muted: #6e6e73;
    --app-line: rgba(0, 0, 0, .08);
    --app-line-strong: rgba(0, 0, 0, .14);
    --app-primary: #1d1d1f;
    --app-on-primary: #ffffff;
    --app-tone: #0f7a6c;
    --app-tone-container: #cdeee6;
    --app-on-tone-container: #08504a;
    --app-tone-soft: rgba(15, 122, 108, .12);
    --app-warn: #b4610e;
    --app-warn-soft: rgba(242, 160, 61, .18);
    --app-danger: #d64545;
    --app-danger-soft: rgba(214, 69, 69, .12);
    --app-focus: rgba(15, 122, 108, .32);
    /* Tarjeta de tinta («lo que toca ahora»): oscura en claro y en oscuro, con el brillo del tono. */
    --app-ink-card: #1d1d1f;
    --app-ink-card-text: #f5f5f7;
    --app-ink-card-glow: rgba(127, 216, 196, .30);
    /* Sombras cortas y suaves (Apple/Google): la profundidad la dan el blanco sobre gris, no la sombra. */
    --app-shadow-sm: 0 1px 2px rgba(0, 0, 0, .05);
    --app-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 28px -14px rgba(0, 0, 0, .14);
    --app-shadow-lg: 0 24px 60px -24px rgba(0, 0, 0, .28);
    --app-radius: 1.25rem;
    --app-dock-height: 4.4rem;
    --app-ease: cubic-bezier(.2, .8, .2, 1);
    /* La cara del asistente */
    --buddy-face: #0f7a6c;
    --buddy-eye: #ffffff;

    --bs-body-font-family: var(--app-font);
    --bs-body-bg: var(--app-canvas);
    --bs-body-color: var(--app-ink);
    --bs-emphasis-color: var(--app-ink);
    --bs-secondary-color: var(--app-muted);
    --bs-tertiary-bg: var(--app-surface-2);
    --bs-border-color: var(--app-line-strong);
    --bs-border-radius: .9rem;
    --bs-border-radius-sm: .65rem;
    --bs-border-radius-lg: 1.2rem;
    --bs-border-radius-xl: 1.5rem;
    --bs-link-color: var(--app-tone);
    --bs-link-color-rgb: 15, 122, 108;
    --bs-link-hover-color: #0a5a50;
    --bs-focus-ring-color: var(--app-focus);
    --bs-primary: var(--app-primary);
    --bs-primary-rgb: 29, 29, 31;
}

[data-bs-theme="dark"] {
    --app-canvas: #0a0a0c;
    --app-surface: #1c1c1e;
    --app-surface-2: #242426;
    --app-surface-3: #2c2c2e;
    --app-glass: rgba(28, 28, 30, .74);
    --app-glass-strong: rgba(28, 28, 30, .94);
    --app-glass-border: rgba(255, 255, 255, .08);
    --app-ink: #f5f5f7;
    --app-ink-2: #d2d2d7;
    --app-muted: #98989d;
    --app-line: rgba(255, 255, 255, .09);
    --app-line-strong: rgba(255, 255, 255, .16);
    --app-primary: #8fe3d2;
    --app-on-primary: #062a25;
    --app-tone: #8fe3d2;
    --app-tone-container: #0e4a43;
    --app-on-tone-container: #c9f3ea;
    --app-tone-soft: rgba(143, 227, 210, .14);
    --app-warn: #f5b45c;
    --app-warn-soft: rgba(245, 180, 92, .14);
    --app-danger: #ff8a8a;
    --app-danger-soft: rgba(255, 138, 138, .13);
    --app-focus: rgba(143, 227, 210, .38);
    --app-ink-card: #242426;
    --app-ink-card-text: #f5f5f7;
    --app-ink-card-glow: rgba(143, 227, 210, .22);
    --app-shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --app-shadow: 0 1px 1px rgba(0, 0, 0, .3), 0 22px 44px -24px rgba(0, 0, 0, .85);
    --app-shadow-lg: 0 40px 90px -30px rgba(0, 0, 0, .9);
    --buddy-face: #8fe3d2;
    --buddy-eye: #062a25;
    --bs-body-bg: var(--app-canvas);
    --bs-body-color: var(--app-ink);
    --bs-emphasis-color: var(--app-ink);
    --bs-secondary-color: var(--app-muted);
    --bs-tertiary-bg: var(--app-surface-2);
    --bs-border-color: var(--app-line-strong);
    --bs-link-color: var(--app-tone);
    --bs-link-color-rgb: 143, 227, 210;
    --bs-link-hover-color: #c9f3ea;
    --bs-primary-rgb: 143, 227, 210;
    color-scheme: dark;
}

/* --------------------------------------------------------------------------
   Lienzo y tipografía
   -------------------------------------------------------------------------- */
html { background: var(--app-canvas); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
/* Lienzo liso, sin manchas de color: el gris del fondo y el blanco de las tarjetas hacen el trabajo. */
body { min-height: 100dvh; background: var(--app-canvas); color: var(--app-ink); font-family: var(--app-font); letter-spacing: -.01em; line-height: 1.5; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
::selection { background: var(--app-tone-container); color: var(--app-on-tone-container); }
/* Títulos en Roboto Flex ancha y compacta (como dieta y viajes). Pesos: 400 para texto y 600-800 para jerarquía. */
h1, h2, h3, h4, h5, .h1, .h2, .h3, .h4, .h5 { color: var(--app-ink); font-family: var(--app-display); font-weight: 750; letter-spacing: -.02em; font-variation-settings: "wdth" 112, "opsz" 48; text-wrap: balance; }
h1 em, h2 em { font-style: normal; color: var(--app-tone); }
strong, b { font-weight: 700; }
.text-secondary, .text-muted { color: var(--app-muted) !important; }
a { text-underline-offset: .18em; }
kbd { padding: .1rem .4rem; border-radius: .4rem; color: var(--app-muted); background: var(--app-surface-3); font-family: var(--app-font); font-size: .75rem; }
.skip-link { position: fixed; left: 1rem; top: -4rem; z-index: 3000; padding: .6rem 1rem; border-radius: 999px; background: var(--app-primary); color: var(--app-on-primary); font-weight: 700; }
.skip-link:focus { top: 1rem; }
:focus-visible { outline: 3px solid var(--app-focus); outline-offset: 2px; }
@view-transition { navigation: auto; }

/* --------------------------------------------------------------------------
   Bootstrap a medida
   -------------------------------------------------------------------------- */
.btn { --bs-btn-font-weight: 650; --bs-btn-border-radius: 999px; --bs-btn-padding-x: 1.05rem; --bs-btn-padding-y: .55rem; display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 2.75rem; transition: transform .15s var(--app-ease), background-color .15s ease, border-color .15s ease; }
.btn:active { transform: scale(.97); }
.btn-sm { --bs-btn-padding-x: .8rem; --bs-btn-padding-y: .35rem; --bs-btn-font-size: .84rem; min-height: 2.25rem; }
.btn-primary {
    --bs-btn-bg: var(--app-primary); --bs-btn-border-color: var(--app-primary); --bs-btn-color: var(--app-on-primary);
    --bs-btn-hover-bg: color-mix(in srgb, var(--app-primary) 86%, #fff); --bs-btn-hover-border-color: var(--bs-btn-hover-bg); --bs-btn-hover-color: var(--app-on-primary);
    --bs-btn-active-bg: var(--app-primary); --bs-btn-active-border-color: var(--app-primary); --bs-btn-active-color: var(--app-on-primary);
    --bs-btn-disabled-bg: var(--app-primary); --bs-btn-disabled-border-color: var(--app-primary); --bs-btn-disabled-color: var(--app-on-primary);
}
.btn-tone { --bs-btn-bg: var(--app-tone); --bs-btn-border-color: var(--app-tone); --bs-btn-color: var(--app-on-primary); --bs-btn-hover-bg: color-mix(in srgb, var(--app-tone) 85%, #000); --bs-btn-hover-color: var(--app-on-primary); --bs-btn-active-bg: var(--app-tone); --bs-btn-active-color: var(--app-on-primary); }
[data-bs-theme="light"] .btn-tone { --bs-btn-color: #fff; --bs-btn-hover-color: #fff; --bs-btn-active-color: #fff; }
.btn-light {
    --bs-btn-bg: var(--app-glass-strong); --bs-btn-border-color: var(--app-line-strong); --bs-btn-color: var(--app-ink);
    --bs-btn-hover-bg: var(--app-surface); --bs-btn-hover-border-color: var(--app-ink); --bs-btn-hover-color: var(--app-ink);
    --bs-btn-active-bg: var(--app-surface-3); --bs-btn-active-border-color: var(--app-ink); --bs-btn-active-color: var(--app-ink);
}
.btn-outline-primary { --bs-btn-color: var(--app-ink); --bs-btn-border-color: var(--app-line-strong); --bs-btn-hover-bg: var(--app-primary); --bs-btn-hover-border-color: var(--app-primary); --bs-btn-hover-color: var(--app-on-primary); }
.btn-outline-danger { --bs-btn-color: var(--app-danger); --bs-btn-border-color: color-mix(in srgb, var(--app-danger) 40%, transparent); --bs-btn-hover-bg: var(--app-danger); --bs-btn-hover-border-color: var(--app-danger); --bs-btn-hover-color: #fff; }
.btn-link { color: var(--app-tone); font-weight: 650; text-decoration: none; }
.btn-icon-sm { width: 2.3rem; height: 2.3rem; min-height: 0; padding: 0; border: 0; border-radius: 50%; color: var(--app-muted); background: transparent; }
.btn-icon-sm:hover { color: var(--app-ink); background: var(--app-surface-3); }
.form-control, .form-select { border-color: var(--app-line-strong); background-color: var(--app-surface); color: var(--app-ink); }
.form-control:focus, .form-select:focus { border-color: var(--app-tone); box-shadow: 0 0 0 .22rem var(--app-focus); background-color: var(--app-surface); color: var(--app-ink); }
.form-control::placeholder { color: var(--app-muted); opacity: .8; }
.form-control:disabled, .form-select:disabled { background-color: var(--app-surface-2); color: var(--app-muted); }
.form-floating > label { color: var(--app-muted); }
.form-floating > .form-control:focus ~ label::after, .form-floating > .form-control:not(:placeholder-shown) ~ label::after { background: transparent; }
.form-check-input:checked { background-color: var(--app-tone); border-color: var(--app-tone); }
.card {
    --bs-card-bg: var(--app-surface); --bs-card-border-color: var(--app-glass-border); --bs-card-color: var(--app-ink);
    border-radius: var(--app-radius); box-shadow: var(--app-shadow);
    backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3);
}
.card-title { display: flex; align-items: center; gap: .5rem; font-size: 1.15rem; margin-bottom: .9rem; }
.modal-content { background: var(--app-surface); border: 1px solid var(--app-line); border-radius: 1.6rem; color: var(--app-ink); box-shadow: var(--app-shadow-lg); }
.modal-header, .modal-footer { border-color: var(--app-line); }
.modal-backdrop { --bs-backdrop-opacity: .45; }
.offcanvas { --bs-offcanvas-bg: var(--app-surface); --bs-offcanvas-color: var(--app-ink); }
.alert { border-radius: 1rem; }
.password-toggle-wrap { position: relative; }
.password-toggle { position: absolute; top: 50%; right: .55rem; z-index: 5; width: 2.2rem; height: 2.2rem; transform: translateY(-50%); display: grid; place-items: center; border: 0; border-radius: 50%; color: var(--app-muted); background: transparent; }
.password-toggle:hover { color: var(--app-ink); background: var(--app-surface-3); }
.password-toggle-input { padding-right: 3rem !important; }

/* --------------------------------------------------------------------------
   Estructura: raíl lateral flotante (escritorio) y dock inferior con el asistente en el centro (móvil)
   -------------------------------------------------------------------------- */
.app-shell { min-height: 100dvh; }
.app-main { min-width: 0; overflow-x: clip; }
.app-main:focus { outline: 0; }
.app-brand { display: inline-flex; align-items: center; gap: .65rem; color: var(--app-ink); text-decoration: none; }
.app-brand .brand-word { font-family: var(--app-display); font-variation-settings: "wdth" 118, "opsz" 48; font-weight: 800; font-size: 1.2rem; letter-spacing: -.04em; }
.app-sidebar { position: fixed; z-index: 1020; display: flex; flex-direction: column; gap: 1.1rem; padding: 1.2rem .9rem 1rem; background: var(--app-glass); border: 1px solid var(--app-glass-border); box-shadow: var(--app-shadow); backdrop-filter: blur(24px) saturate(1.5); -webkit-backdrop-filter: blur(24px) saturate(1.5); }
.app-sidebar .app-brand { padding: 0 .3rem; }
.sidebar-assistant { display: flex; align-items: center; gap: .7rem; width: 100%; padding: .55rem .7rem; border: 1px solid var(--app-line); border-radius: 1.2rem; color: var(--app-ink); background: var(--app-glass-strong); text-align: left; transition: box-shadow .2s ease, transform .2s var(--app-ease); }
.sidebar-assistant:hover { box-shadow: 0 0 0 4px var(--app-tone-soft); transform: translateY(-1px); }
.sidebar-assistant strong, .sidebar-assistant small { display: block; line-height: 1.2; }
.sidebar-assistant small { color: var(--app-muted); font-size: .76rem; }
.sidebar-assistant kbd { margin-left: auto; }
.app-sidebar .nav-link { display: flex; align-items: center; gap: .75rem; padding: .62rem .85rem; border-radius: 999px; color: var(--app-ink-2); font-weight: 650; font-size: .95rem; }
.app-sidebar .nav-link i { font-size: 1.08rem; color: var(--app-muted); }
.app-sidebar .nav-link:hover { color: var(--app-ink); background: var(--app-surface-3); }
.app-sidebar .nav-link.active { color: var(--app-on-primary); background: var(--app-primary); }
.app-sidebar .nav-link.active i { color: inherit; }
.sidebar-section-label { margin: .5rem .85rem -.1rem; color: var(--app-muted); font-size: .68rem; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; }
.sidebar-user { margin-top: auto; display: flex; align-items: center; gap: .55rem; padding: .5rem .4rem .5rem .6rem; border: 1px solid var(--app-line); border-radius: 1.2rem; background: var(--app-glass-strong); }
.sidebar-user__copy { min-width: 0; flex: 1 1 auto; color: var(--app-ink); text-decoration: none; }
.sidebar-user__copy strong, .sidebar-user__copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user__copy strong { font-size: .88rem; }
.sidebar-user__copy small { color: var(--app-muted); font-size: .72rem; }
.avatar { width: 2.3rem; height: 2.3rem; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; color: #ffffff; background: linear-gradient(180deg, #a1a1a6, #7c7c80); font-weight: 700; font-size: .88rem; }
.mobile-profile { display: none; }
.app-dock { display: none; }
@media (min-width: 992px) {
    .app-sidebar { inset: .9rem auto .9rem .9rem; width: 250px; border-radius: 1.9rem; overflow-y: auto; }
    .app-main { margin-left: calc(250px + .9rem); }
    /* Pantallas grandes con escalado de Windows (≈1530×700): algo más de información por pantalla. */
    html { font-size: 15px; }
}
@media (max-width: 991.98px) {
    .app-sidebar { display: none !important; }
    .app-main { padding-bottom: calc(var(--app-dock-height) + env(safe-area-inset-bottom, 0px) + 2rem); }
    .mobile-profile { position: absolute; top: calc(.85rem + env(safe-area-inset-top, 0px)); right: .9rem; z-index: 1025; display: grid; width: 2.6rem; height: 2.6rem; border: 2px solid var(--app-glass-border); box-shadow: var(--app-shadow); }
    .app-dock {
        position: fixed; left: 50%; bottom: calc(.7rem + env(safe-area-inset-bottom, 0px)); z-index: 1030;
        display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: center;
        width: min(28rem, calc(100vw - 1.4rem)); height: var(--app-dock-height); padding: .35rem;
        transform: translateX(-50%); border: 1px solid var(--app-glass-border); border-radius: 1.6rem;
        background: var(--app-glass-strong); box-shadow: var(--app-shadow-lg);
        backdrop-filter: blur(26px) saturate(1.7); -webkit-backdrop-filter: blur(26px) saturate(1.7);
    }
    .app-dock__item { position: relative; height: 100%; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem; border-radius: 1.2rem; color: var(--app-muted); font-size: .66rem; font-weight: 700; text-decoration: none; }
    .app-dock__item i { font-size: 1.22rem; line-height: 1; }
    .app-dock__item.active { color: var(--app-ink); background: var(--app-surface-3); }
}
.app-dock__orb { justify-self: center; width: 4.6rem; height: 3.7rem; padding: 0; border: 0; background: transparent; overflow: visible; }
.app-dock__orb .buddy { font-size: 3.5rem; margin-top: -1.7rem; box-shadow: 0 0 0 4px var(--app-canvas), 0 .25em .5em -.2em var(--buddy-face); animation: buddy-breathe 4.5s ease-in-out infinite; }
.app-dock__orb:active .buddy { scale: .94; }

/* --------------------------------------------------------------------------
   Cabeceras y contenido. En móvil las acciones de cabecera van a una segunda fila (nunca estrechan el título).
   -------------------------------------------------------------------------- */
.app-page-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; padding: 2.2rem 2.25rem .8rem; }
.app-page-header h1 { margin: 0; font-size: clamp(2rem, 4.2vw, 3rem); line-height: 1.02; letter-spacing: -.05em; font-variation-settings: "wdth" 125, "opsz" 96; }
.header-title-row { min-width: 0; flex: 1 1 26rem; }
.header-title-row > p:not(.eyebrow) { max-width: 44rem; margin: .55rem 0 0; color: var(--app-muted); }
.app-header-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.eyebrow { display: inline-flex; align-items: center; gap: .45rem; margin-bottom: .5rem; color: var(--app-ink-2); font-size: .7rem; font-weight: 750; letter-spacing: .16em; text-transform: uppercase; }
.eyebrow::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: var(--app-tone); box-shadow: 0 0 0 3px var(--app-tone-soft); }
.app-content { max-width: 1240px; padding: 1rem 2.25rem 2.5rem; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin: 1.6rem 0 .7rem; }
.section-head h2 { margin: 0; font-size: 1.25rem; }
.section-head a { font-size: .88rem; font-weight: 650; text-decoration: none; }
@media (max-width: 991.98px) {
    .app-page-header { padding: calc(1.4rem + env(safe-area-inset-top, 0px)) 1.1rem .5rem; flex-direction: column; align-items: stretch; }
    .app-page-header .header-title-row { flex: 0 0 auto; padding-right: 3.2rem; }
    .app-header-actions .btn { flex: 1 1 auto; }
    .app-content { padding: .8rem 1.1rem 1.5rem; }
}

/* Esperas y vacíos */
.skeleton { display: block; border-radius: var(--app-radius); background: linear-gradient(100deg, var(--app-surface-2) 30%, var(--app-surface-3) 50%, var(--app-surface-2) 70%); background-size: 300% 100%; animation: shimmer 1.4s ease-in-out infinite; }
.skeleton--line { height: 2.4rem; width: min(26rem, 80%); border-radius: .8rem; }
.skeleton--focus { height: 11rem; }
.skeleton--row { height: 3.6rem; border-radius: 1rem; list-style: none; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.empty-state { display: grid; justify-items: center; gap: .6rem; padding: 2.6rem 1.5rem; text-align: center; border: 1.5px dashed var(--app-line-strong); border-radius: var(--app-radius); background: var(--app-glass); list-style: none; }
.empty-state h2 { margin: .3rem 0 0; font-size: 1.4rem; }
.empty-state p { max-width: 30rem; margin: 0; color: var(--app-muted); }

/* Listas densas: una fila por elemento, la fila entera actúa y el resto de acciones en su «⋯» */
.row-list { display: grid; gap: 3px; margin: 0; padding: 0; list-style: none; }
.row-item { display: flex; align-items: center; gap: .75rem; min-height: 3.6rem; padding: .45rem .5rem .45rem .7rem; border-radius: .55rem; background: var(--app-glass-strong); }
.row-item:first-child { border-top-left-radius: 1.2rem; border-top-right-radius: 1.2rem; }
.row-item:last-child { border-bottom-left-radius: 1.2rem; border-bottom-right-radius: 1.2rem; }
.row-item__check { width: 2rem; height: 2rem; flex: 0 0 auto; display: grid; place-items: center; border: 2px solid var(--app-line-strong); border-radius: 50%; color: transparent; background: transparent; transition: all .2s var(--app-ease); }
.row-item__check:hover { border-color: var(--app-tone); color: var(--app-tone); }
.row-item.is-done .row-item__check { border-color: var(--app-tone); color: var(--app-on-primary); background: var(--app-tone); }
.row-item.is-done .row-item__copy strong { color: var(--app-muted); text-decoration: line-through; }
.row-item.is-overdue .row-item__copy small { color: var(--app-warn); font-weight: 700; }
.row-item__copy { min-width: 0; flex: 1 1 auto; display: grid; padding: 0; border: 0; background: transparent; color: var(--app-ink); text-align: left; }
.row-item__copy strong { font-weight: 650; overflow-wrap: anywhere; }
.row-item__copy small { color: var(--app-muted); font-size: .8rem; }
.row-item__more { width: 2.3rem; height: 2.3rem; flex: 0 0 auto; display: grid; place-items: center; border: 0; border-radius: 50%; color: var(--app-muted); background: transparent; }
.row-item__more:hover { color: var(--app-ink); background: var(--app-surface-3); }
.row-empty { padding: .9rem 1rem; border-radius: 1.2rem; color: var(--app-muted); background: var(--app-glass); list-style: none; }
.quick-add { display: flex; align-items: center; gap: .6rem; padding: .4rem .45rem .4rem 1.1rem; border: 1px solid var(--app-line-strong); border-radius: 999px; background: var(--app-surface); box-shadow: var(--app-shadow-sm); }
.quick-add:focus-within { border-color: var(--app-tone); box-shadow: 0 0 0 4px var(--app-focus); }
.quick-add > i { color: var(--app-muted); }
.quick-add__input { flex: 1 1 auto; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--app-ink); font-size: 1rem; }
.done-list { margin-top: 1.4rem; }
.done-list summary { margin-bottom: .6rem; color: var(--app-ink-2); font-weight: 700; cursor: pointer; }

/* --------------------------------------------------------------------------
   Hoy: saludo, titular, la tarjeta de «lo que toca ahora», preguntas de un toque y lo próximo
   -------------------------------------------------------------------------- */
.hoy { padding: 2.2rem 2.25rem 2.5rem; max-width: 1240px; }
.hoy-hero { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; margin-bottom: 1.4rem; }
.hoy-hero__greeting { margin: 0; color: var(--app-ink-2); font-weight: 650; }
.hoy-hero__headline { margin: .2rem 0 0; font-size: clamp(2rem, 4.6vw, 3.3rem); line-height: 1.04; letter-spacing: -.05em; font-variation-settings: "wdth" 125, "opsz" 96; }
.hoy-hero__headline strong { color: var(--app-tone); font-weight: inherit; }
.hoy-hero__subline { margin: .6rem 0 0; max-width: 40rem; color: var(--app-muted); font-size: 1.05rem; }
.hoy-hero__buddy { flex: 0 0 auto; padding: 0; border: 0; background: transparent; }
.hoy-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 1.6rem; align-items: start; }
.hoy-side .section-head { margin-top: 0; }
.hoy-questions { display: grid; gap: .6rem; margin-top: .9rem; }
.hoy-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 1rem; }
@media (max-width: 991.98px) {
    .hoy { padding: calc(1.4rem + env(safe-area-inset-top, 0px)) 1.1rem 1.5rem; }
    .hoy-hero { padding-right: 3rem; align-items: flex-start; }
    .hoy-hero__buddy { display: none; }
    .hoy-grid { grid-template-columns: 1fr; gap: 1.2rem; }
}
.focus-card {
    position: relative; overflow: hidden; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1rem 1.1rem; padding: 1.4rem;
    border-radius: 1.8rem; color: var(--app-ink-card-text); background: var(--app-ink-card); box-shadow: var(--app-shadow-lg); isolation: isolate;
}
.focus-card::before { content: ""; position: absolute; inset: -40% -20% auto auto; width: 70%; height: 140%; z-index: -1; background: radial-gradient(closest-side, var(--app-ink-card-glow), transparent); }
.focus-card[data-tone="warn"] { --app-ink-card-glow: rgba(245, 180, 92, .35); }
.focus-card__icon { width: 3rem; height: 3rem; display: grid; place-items: center; border-radius: 1rem; font-size: 1.35rem; color: var(--app-ink-card); background: #8fe3d2; }
.focus-card[data-tone="warn"] .focus-card__icon { background: #f5b45c; }
.focus-card__copy small { display: block; opacity: .75; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.focus-card__copy h2 { margin: .2rem 0 0; color: inherit; font-size: clamp(1.4rem, 2.6vw, 1.9rem); letter-spacing: -.03em; overflow-wrap: anywhere; }
.focus-card__copy p { margin: .3rem 0 0; opacity: .8; }
.focus-card__actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .5rem; }
.focus-card .btn-primary { --bs-btn-bg: #8fe3d2; --bs-btn-border-color: #8fe3d2; --bs-btn-color: #062a25; --bs-btn-hover-bg: #b5efe3; --bs-btn-hover-border-color: #b5efe3; --bs-btn-hover-color: #062a25; --bs-btn-active-bg: #8fe3d2; --bs-btn-active-color: #062a25; }
.focus-card .btn-light { --bs-btn-bg: rgba(255, 255, 255, .1); --bs-btn-border-color: rgba(255, 255, 255, .2); --bs-btn-color: inherit; --bs-btn-hover-bg: rgba(255, 255, 255, .18); --bs-btn-hover-color: inherit; --bs-btn-hover-border-color: rgba(255, 255, 255, .35); }
.question { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .3rem .8rem; padding: .95rem 2.8rem .95rem 1rem; border: 1px solid var(--app-line); border-radius: 1.3rem; background: var(--app-glass-strong); box-shadow: var(--app-shadow-sm); }
.question__icon { grid-row: span 2; width: 2.3rem; height: 2.3rem; display: grid; place-items: center; border-radius: .85rem; color: var(--app-on-tone-container); background: var(--app-tone-container); }
.question[data-tone="warn"] .question__icon { color: var(--app-warn); background: var(--app-warn-soft); }
.question[data-tone="calm"] .question__icon { color: var(--app-ink-2); background: var(--app-surface-3); }
.question p { margin: 0; align-self: center; }
.question__actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.question__close { position: absolute; top: .5rem; right: .5rem; width: 2rem; height: 2rem; display: grid; place-items: center; border: 0; border-radius: 50%; color: var(--app-muted); background: transparent; }
.question__close:hover { color: var(--app-ink); background: var(--app-surface-3); }

/* --------------------------------------------------------------------------
   La cara del asistente: un cuadradito redondeado con ojos y boca que cambian con el ánimo.
   Se dimensiona con font-size (todo en em). Cada proyecto puede cambiar su personaje (skill nuevo-proyecto).
   -------------------------------------------------------------------------- */
.buddy { position: relative; display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; gap: .12em; width: 1em; height: 1em; padding-bottom: .1em; border-radius: .34em; background: var(--buddy-face); font-size: 2.4rem; line-height: 1; vertical-align: middle; box-shadow: 0 0 .4em color-mix(in srgb, var(--buddy-face) 38%, transparent); transition: background-color .45s ease, rotate .35s ease, scale .2s ease; }
.buddy__eye { width: .12em; height: .27em; border: 0 solid var(--buddy-eye); border-radius: .06em; background: var(--buddy-eye); translate: calc(var(--look-x) * .03em) calc(var(--look-y) * .025em); transition: translate .22s ease, scale .16s ease, rotate .3s ease, width .3s ease, height .3s ease, border-radius .3s ease, background-color .45s ease; }
.buddy__mouth { position: absolute; left: 50%; bottom: .17em; width: .22em; height: .07em; margin-left: -.11em; border-bottom: .045em solid var(--buddy-eye); border-radius: 0 0 .12em .12em; transition: all .3s var(--app-ease); }
.buddy.is-blink .buddy__eye { scale: 1 .1; }
.buddy.is-hop { animation: buddy-hop .7s cubic-bezier(.3, 1.4, .5, 1); }
.buddy[data-mood="happy"] .buddy__eye { width: .18em; height: .1em; border-width: .06em .06em 0; border-radius: .1em .1em 0 0; background: transparent; }
.buddy[data-mood="happy"] .buddy__mouth { width: .3em; height: .12em; margin-left: -.15em; }
.buddy[data-mood="worried"] { --buddy-face: var(--app-warn); }
.buddy[data-mood="worried"] .buddy__eye { height: .2em; }
.buddy[data-mood="worried"] .buddy__eye:first-of-type { rotate: -20deg; }
.buddy[data-mood="worried"] .buddy__eye:last-of-type { rotate: 20deg; }
.buddy[data-mood="worried"] .buddy__mouth { border-bottom: 0; border-top: .045em solid var(--buddy-eye); border-radius: .12em .12em 0 0; }
.buddy[data-mood="sleepy"] { --buddy-face: var(--app-surface-3); --buddy-eye: var(--app-muted); box-shadow: none; }
.buddy[data-mood="sleepy"] .buddy__eye { width: .15em; height: .045em; }
.buddy[data-mood="thinking"] .buddy__eye { translate: .04em -.05em; }
.buddy[data-mood="thinking"] .buddy__eye:last-of-type { height: .19em; }
.buddy[data-mood="thinking"] .buddy__mouth { width: .12em; margin-left: -.02em; }
.buddy[data-mood="thinking"] { animation: buddy-think 1.6s ease-in-out infinite; }
.buddy[data-mood="listening"] { animation: buddy-listen 1.3s ease-out infinite; }
.buddy[data-mood="listening"] .buddy__mouth { width: .12em; height: .12em; margin-left: -.06em; border: .045em solid var(--buddy-eye); border-radius: 50%; }
.buddy[data-mood="confused"] { rotate: -9deg; }
.buddy[data-mood="confused"] .buddy__eye:first-of-type { scale: 1 .6; }
@keyframes buddy-hop { 30% { translate: 0 -.16em; scale: .96 1.05; } 58% { translate: 0 0; scale: 1.07 .92; } 78% { scale: .98 1.02; } }
@keyframes buddy-breathe { 50% { scale: 1.04; } }
@keyframes buddy-think { 50% { rotate: 4deg; } }
@keyframes buddy-listen { from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--buddy-face) 50%, transparent); } to { box-shadow: 0 0 0 .24em transparent; } }
.buddy--xs { font-size: 1.1rem; box-shadow: none; }
.buddy--sm { font-size: 1.9rem; }
.buddy--md { font-size: 2.5rem; }
.buddy--lg { font-size: 3.4rem; }
.buddy--xl { font-size: 4.8rem; }

/* --------------------------------------------------------------------------
   Hoja del asistente y propuestas
   -------------------------------------------------------------------------- */
.sheet-grip { position: absolute; top: .6rem; left: 50%; width: 2.6rem; height: .3rem; margin-left: -1.3rem; border-radius: 999px; background: var(--app-line-strong); }
.assistant-sheet.offcanvas-bottom { height: auto; max-height: 92dvh; display: flex; flex-direction: column; border-radius: 2rem 2rem 0 0; padding-bottom: env(safe-area-inset-bottom); }
@media (min-width: 992px) { .assistant-sheet.offcanvas-bottom { left: calc(50% - 22rem + 130px); right: auto; width: 44rem; max-width: calc(100vw - 2rem); } }
.assistant-sheet__head { display: flex; align-items: center; gap: .9rem; padding: 1.5rem 1.4rem .5rem; }
.assistant-sheet__title { min-width: 0; flex: 1; }
.assistant-sheet__title h2 { margin: 0; font-size: 1.5rem; }
.assistant-sheet__title p { margin: .1rem 0 0; color: var(--app-muted); font-size: .88rem; }
.assistant-context { display: flex; align-items: center; gap: .5rem; margin: 0 1.4rem .5rem; padding: .45rem .75rem; border-radius: 999px; background: var(--app-tone-soft); color: var(--app-on-tone-container); font-size: .82rem; font-weight: 650; }
[data-bs-theme="dark"] .assistant-context { color: var(--app-tone); }
.assistant-log { display: flex; flex-direction: column; gap: .9rem; min-height: 0; flex: 1 1 auto; overflow-y: auto; padding: 0 1.4rem; }
.assistant-log:empty { display: none; }
.assistant-turn { display: flex; flex-direction: column; gap: .55rem; animation: toast-in .3s var(--app-ease); }
.assistant-msg { max-width: 90%; margin: 0; padding: .7rem .95rem; border-radius: 1.2rem; font-size: .96rem; line-height: 1.45; }
.assistant-msg p { margin: 0; }
.assistant-msg--user { align-self: flex-end; color: var(--app-on-primary); background: var(--app-primary); border-bottom-right-radius: .35rem; overflow-wrap: anywhere; }
.assistant-msg--bot { align-self: flex-start; max-width: 100%; color: var(--app-ink); background: var(--app-surface); border: 1px solid var(--app-line); border-bottom-left-radius: .35rem; box-shadow: var(--app-shadow-sm); }
.assistant-msg--bot strong { font-weight: 750; background: linear-gradient(transparent 62%, var(--app-warn-soft) 0); }
.assistant-msg__actions, .assistant-msg__choices { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .7rem; }
.assistant-thinking { display: inline-flex; gap: .3rem; padding: .85rem 1rem; }
.assistant-thinking span { width: .45rem; height: .45rem; border-radius: 50%; background: var(--app-muted); animation: thinking-dot 1s infinite ease-in-out; }
.assistant-thinking span:nth-child(2) { animation-delay: .15s; }
.assistant-thinking span:nth-child(3) { animation-delay: .3s; }
@keyframes thinking-dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.assistant-chips { display: flex; flex-wrap: wrap; gap: .4rem; padding: .8rem 1.4rem .2rem; }
.assistant-chip { padding: .45rem .85rem; border: 1px solid var(--app-line-strong); border-radius: 999px; color: var(--app-ink-2); background: var(--app-surface); font-size: .85rem; font-weight: 650; }
.assistant-chip:hover { border-color: var(--app-ink); color: var(--app-ink); }
.assistant-composer { display: flex; align-items: center; gap: .4rem; margin: .7rem 1.4rem .9rem; padding: .35rem .35rem .35rem 1.1rem; border: 1px solid var(--app-line-strong); border-radius: 999px; background: var(--app-surface); box-shadow: var(--app-shadow-sm); }
.assistant-composer:focus-within { border-color: var(--app-tone); box-shadow: 0 0 0 4px var(--app-focus); }
.assistant-composer__input { flex: 1 1 auto; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--app-ink); font-size: 1rem; }
.assistant-composer__input:focus-visible { outline: 0; }
.assistant-composer__mic, .assistant-composer__send { width: 2.6rem; height: 2.6rem; flex: 0 0 auto; display: grid; place-items: center; border: 0; border-radius: 50%; font-size: 1.1rem; }
.assistant-composer__mic { color: var(--app-ink-2); background: var(--app-surface-3); }
.assistant-composer__mic.is-listening { color: #fff; background: var(--app-danger); }
.assistant-composer__send { color: var(--app-on-primary); background: var(--app-primary); }
.proposals { display: grid; gap: .5rem; margin-top: .8rem; }
.proposal { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .75rem; padding: .7rem .75rem; border: 1px solid var(--app-line); border-radius: 1.1rem; background: var(--app-surface-2); }
.proposal__icon { width: 2.3rem; height: 2.3rem; display: grid; place-items: center; border-radius: .85rem; color: var(--app-on-tone-container); background: var(--app-tone-container); }
.proposal h3 { margin: 0; font-family: var(--app-font); font-size: .96rem; font-weight: 700; letter-spacing: -.01em; overflow-wrap: anywhere; }
.proposal__meta { margin: .05rem 0 0; color: var(--app-muted); font-size: .8rem; }
.proposal__actions { display: flex; flex-wrap: wrap; gap: .35rem; justify-content: flex-end; }
.proposal__done { color: var(--app-tone); font-size: .85rem; font-weight: 700; white-space: nowrap; }
.proposal.is-applied { opacity: .75; }
@media (max-width: 575.98px) { .proposal { grid-template-columns: auto minmax(0, 1fr); } .proposal__actions { grid-column: 2; justify-content: flex-start; } }

/* --------------------------------------------------------------------------
   Avisos con «Deshacer», diálogos y hojas de acciones
   -------------------------------------------------------------------------- */
.app-toast-region { position: fixed; left: 50%; bottom: 1.4rem; z-index: 1090; display: grid; gap: .5rem; width: min(26rem, calc(100vw - 2rem)); transform: translateX(-50%); pointer-events: none; }
@media (max-width: 991.98px) { .app-toast-region { bottom: calc(var(--app-dock-height) + env(safe-area-inset-bottom, 0px) + 1.5rem); } }
.app-toast-region.is-top { top: calc(1rem + env(safe-area-inset-top, 0px)); bottom: auto; z-index: 2100; }
.app-toast { display: flex; align-items: center; gap: .7rem; padding: .75rem .8rem .75rem 1rem; border-radius: 1.1rem; color: #f5f5f7; background: #1d1d1f; box-shadow: var(--app-shadow-lg); font-size: .92rem; font-weight: 600; pointer-events: auto; animation: toast-in .3s var(--app-ease); }
[data-bs-theme="dark"] .app-toast { background: #2c2c2e; }
.app-toast > i { color: #8fe3d2; font-size: 1.1rem; }
.app-toast[data-tone="error"] > i { color: #ff8a8a; }
.app-toast span { flex: 1; min-width: 0; }
.app-toast button { flex: 0 0 auto; border: 0; border-radius: 999px; padding: .45rem .85rem; color: #062a25; background: #8fe3d2; font-weight: 750; font-size: .86rem; }
.app-toast.is-leaving { animation: toast-out .25s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }
.app-dialog .modal-content { text-align: center; }
.app-dialog .modal-body { padding: 1.8rem 1.6rem 1rem; }
.app-dialog__icon { width: 3.4rem; height: 3.4rem; margin: 0 auto 1rem; display: grid; place-items: center; border-radius: 1.2rem; font-size: 1.5rem; color: var(--app-ink); background: var(--app-surface-3); }
.app-dialog.is-danger .app-dialog__icon { color: var(--app-danger); background: var(--app-danger-soft); }
.app-dialog h2 { font-size: 1.3rem; margin: 0 0 .4rem; }
.app-dialog p { color: var(--app-muted); margin: 0; }
.app-dialog .modal-footer { justify-content: center; border: 0; padding-top: 0; }
.app-dialog.is-danger .btn-primary { --bs-btn-bg: var(--app-danger); --bs-btn-border-color: var(--app-danger); --bs-btn-color: #fff; --bs-btn-hover-bg: #b93737; --bs-btn-hover-border-color: #b93737; --bs-btn-hover-color: #fff; }
.invite-link { display: flex; gap: .4rem; margin-top: .9rem; }
.invite-link .form-control { min-width: 0; font-size: .82rem; }
.app-sheet.offcanvas-bottom { height: auto; max-height: 86dvh; border-radius: 2rem 2rem 0 0; padding-bottom: calc(.8rem + env(safe-area-inset-bottom)); }
@media (min-width: 768px) { .app-sheet.offcanvas-bottom { left: 50%; right: auto; width: 30rem; transform: translate(-50%, 100%); } .app-sheet.offcanvas-bottom.show, .app-sheet.offcanvas-bottom.showing { transform: translate(-50%, 0); } }
.app-sheet__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.5rem 1.4rem .6rem; }
.app-sheet__head h2 { margin: 0; font-size: 1.3rem; overflow-wrap: anywhere; }
.app-sheet__head p { margin: .1rem 0 0; color: var(--app-muted); font-size: .88rem; }
.app-sheet__list { display: grid; gap: 3px; padding: .3rem 1rem 0; overflow-y: auto; }
.app-sheet__item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .9rem; align-items: center; padding: .8rem 1rem; border: 0; border-radius: .5rem; color: var(--app-ink); background: var(--app-surface-2); text-align: left; text-decoration: none; font: inherit; }
.app-sheet__item:first-child { border-top-left-radius: 1.3rem; border-top-right-radius: 1.3rem; }
.app-sheet__item:last-child { border-bottom-left-radius: 1.3rem; border-bottom-right-radius: 1.3rem; }
.app-sheet__item:hover { color: var(--app-ink); background: var(--app-surface-3); }
.app-sheet__item > .bi:first-child { width: 2.3rem; height: 2.3rem; display: grid; place-items: center; border-radius: .9rem; color: var(--app-on-tone-container); background: var(--app-tone-container); font-size: 1.05rem; }
.app-sheet__item strong { display: block; font-weight: 650; }
.app-sheet__item small { display: block; color: var(--app-muted); font-size: .8rem; }
.app-sheet__chevron { color: var(--app-muted); }
.app-sheet__item.is-danger { color: var(--app-danger); }
.app-sheet__item.is-danger > .bi:first-child { color: var(--app-danger); background: var(--app-danger-soft); }

/* --------------------------------------------------------------------------
   Acceso
   -------------------------------------------------------------------------- */
.auth-shell { min-height: 100dvh; display: grid; place-items: center; padding: 2rem 1.1rem; }
.auth-panel { width: min(64rem, 100%); display: grid; grid-template-columns: 1.1fr .9fr; gap: 3rem; align-items: center; }
.auth-intro h1 { margin: 1.3rem 0 1rem; font-size: clamp(2.6rem, 6.5vw, 4.4rem); line-height: .96; letter-spacing: -.06em; font-variation-settings: "wdth" 125, "opsz" 96; }
.auth-intro > p { max-width: 30rem; color: var(--app-ink-2); font-size: 1.12rem; }
.auth-feature-list { display: grid; gap: .65rem; margin: 1.6rem 0 0; padding: 0; list-style: none; }
.auth-feature-list li { display: flex; align-items: center; gap: .75rem; color: var(--app-ink-2); font-weight: 600; }
.auth-feature-list > li > i { width: 2.2rem; height: 2.2rem; flex: 0 0 auto; display: grid; place-items: center; border-radius: .8rem; color: var(--app-tone); background: var(--app-glass-strong); border: 1px solid var(--app-line); }
.auth-card { border-radius: 2rem; background: var(--app-glass-strong); }
.auth-guide-link { display: flex; align-items: center; gap: .8rem; margin-top: 1.2rem; padding: .8rem 1rem; border: 1px solid var(--app-line); border-radius: 1.2rem; background: var(--app-surface); color: var(--app-ink); text-decoration: none; }
.auth-guide-link > i:first-child { font-size: 1.3rem; color: var(--app-tone); }
.auth-guide-link span { flex: 1; }
.auth-guide-link strong, .auth-guide-link small { display: block; }
.auth-guide-link small { color: var(--app-muted); }
@media (max-width: 991.98px) { .auth-panel { grid-template-columns: 1fr; gap: 1.6rem; } .auth-feature-list { display: none; } }
.public-shell .app-main { margin-left: 0; padding-bottom: 2rem; }

/* Cuenta y guía */
.cuenta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: 1rem; align-items: start; }
.theme-choice { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .25rem; padding: .25rem; border-radius: 1.1rem; background: var(--app-surface-3); }
.theme-choice button { display: grid; justify-items: center; gap: .2rem; padding: .6rem .4rem; border: 0; border-radius: .9rem; color: var(--app-muted); background: transparent; font-weight: 700; font-size: .86rem; }
.theme-choice button i { font-size: 1.2rem; }
html[data-theme-mode="light"] .theme-choice [data-theme-set="light"],
html[data-theme-mode="dark"] .theme-choice [data-theme-set="dark"],
html[data-theme-mode="auto"] .theme-choice [data-theme-set="auto"] { color: var(--app-ink); background: var(--app-surface); box-shadow: var(--app-shadow-sm); }
.app-version { display: flex; align-items: center; gap: .8rem; padding: .7rem .85rem; border-radius: 1rem; background: var(--app-surface-2); }
.app-version > span { flex: 1; min-width: 0; display: grid; }
.app-version small { color: var(--app-muted); font-size: .8rem; }
.guide-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 991.98px) { .guide-steps { grid-template-columns: 1fr; } }
.guide-step__icon { width: 3rem; height: 3rem; display: grid; place-items: center; margin-bottom: .8rem; border-radius: 1rem; color: var(--app-on-tone-container); background: var(--app-tone-container); font-size: 1.4rem; }
.guide-examples { padding-left: 1.1rem; color: var(--app-ink-2); font-weight: 600; }

/* --------------------------------------------------------------------------
   Torneo: reloj, mesas, clasificación, hoja de anotar y formularios
   -------------------------------------------------------------------------- */
.trophy { color: var(--app-warn); }
.reloj { position: relative; overflow: hidden; isolation: isolate; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .5rem 1rem; margin-top: 1rem; padding: 1rem 1.15rem; border-radius: 1.5rem; color: var(--app-ink-card-text); background: var(--app-ink-card); box-shadow: var(--app-shadow-lg); }
.hoy-main > #hoyFocus:empty + #hoyClock .reloj { margin-top: 0; }
.reloj::before { content: ""; position: absolute; inset: -60% -10% auto auto; width: 60%; height: 200%; z-index: -1; background: radial-gradient(closest-side, var(--app-ink-card-glow), transparent); }
.reloj__time { font-family: var(--app-display); font-variation-settings: "wdth" 125, "opsz" 96; font-size: 2.6rem; font-weight: 800; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.reloj__copy small { display: block; opacity: .7; font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.reloj__copy span { font-size: .9rem; opacity: .85; }
.reloj__actions { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: flex-end; }
.reloj__bar { grid-column: 1 / -1; height: .35rem; border-radius: 999px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.reloj__bar i { display: block; height: 100%; border-radius: inherit; background: #8fe3d2; transition: width 1s linear; }
.reloj .btn-primary { --bs-btn-bg: #8fe3d2; --bs-btn-border-color: #8fe3d2; --bs-btn-color: #062a25; --bs-btn-hover-bg: #b5efe3; --bs-btn-hover-border-color: #b5efe3; --bs-btn-hover-color: #062a25; }
.reloj .btn-light { --bs-btn-bg: rgba(255, 255, 255, .1); --bs-btn-border-color: rgba(255, 255, 255, .2); --bs-btn-color: inherit; --bs-btn-hover-bg: rgba(255, 255, 255, .18); --bs-btn-hover-color: inherit; --bs-btn-hover-border-color: rgba(255, 255, 255, .35); }
.reloj[data-tone="warn"] { --app-ink-card-glow: rgba(245, 180, 92, .38); }
.reloj[data-tone="warn"] .reloj__bar i { background: #f5b45c; }
.reloj[data-tone="danger"] .reloj__time, .reloj[data-tone="over"] .reloj__time { color: #ff8a8a; }
.reloj[data-tone="danger"] .reloj__bar i { background: #ff8a8a; }
.reloj[data-tone="over"] { --app-ink-card-glow: rgba(255, 107, 107, .4); }
@media (max-width: 575.98px) { .reloj { grid-template-columns: auto minmax(0, 1fr); } .reloj__actions { grid-column: 1 / -1; justify-content: flex-start; } }

.mesa-row { display: flex; align-items: center; gap: .75rem; min-height: 3.9rem; padding: .5rem .55rem .5rem .6rem; border-radius: .55rem; background: var(--app-glass-strong); }
.row-list > .mesa-row:first-child { border-top-left-radius: 1.2rem; border-top-right-radius: 1.2rem; }
.row-list > .mesa-row:last-child { border-bottom-left-radius: 1.2rem; border-bottom-right-radius: 1.2rem; }
.mesa-num { width: 2.5rem; height: 2.5rem; flex: 0 0 auto; display: grid; place-items: center; border-radius: .8rem; font-family: var(--app-display); font-variation-settings: "wdth" 118; font-weight: 800; font-size: 1.1rem; color: var(--app-ink); background: var(--app-surface-3); }
.mesa-row.is-done .mesa-num { color: var(--app-on-tone-container); background: var(--app-tone-container); }
.mesa-row.is-warn .mesa-num, .mesa-row.is-reported .mesa-num { color: var(--app-warn); background: var(--app-warn-soft); }
.mesa-row.is-reported .mesa-copy small { color: var(--app-warn); font-weight: 700; }
.mesa-row.is-bye { opacity: .75; }
.mesa-copy { min-width: 0; flex: 1 1 auto; display: grid; }
.mesa-copy strong { font-weight: 650; font-size: .95rem; }
.mesa-copy small { color: var(--app-muted); font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mesa-score { font-family: var(--app-display); font-variation-settings: "wdth" 112; font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--app-ink-2); }
.mesa-score b { color: var(--app-tone); font-weight: inherit; }
.mesa-edit { display: inline-flex; align-items: center; gap: .55rem; padding: .35rem .6rem; border: 0; border-radius: 999px; background: transparent; color: var(--app-muted); }
.mesa-edit:hover { background: var(--app-surface-3); color: var(--app-ink); }
.badge-group { display: inline-block; margin-left: .3rem; padding: 0 .4rem; border-radius: .4rem; font-size: .7rem; font-weight: 800; color: var(--app-ink-2); background: var(--app-surface-3); }
.done-sum { display: flex; align-items: center; gap: .6rem; margin: .6rem 0 0; padding: .8rem 1rem; border-radius: 1.2rem; background: var(--app-glass); color: var(--app-ink-2); font-weight: 650; font-size: .92rem; }
.done-sum i { color: var(--app-tone); }
.prov { display: inline-flex; align-items: center; gap: .35rem; margin: 0; color: var(--app-warn); font-size: .8rem; font-weight: 700; }
.group-title { margin: .4rem 0 .5rem; font-size: 1rem; color: var(--app-ink-2); }

.clasif { width: 100%; border-collapse: separate; border-spacing: 0 3px; font-size: .9rem; }
.clasif th { padding: 0 .6rem .2rem; color: var(--app-muted); font-size: .68rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; text-align: right; }
.clasif th:nth-child(2), .clasif td:nth-child(2) { text-align: left; }
.clasif td { padding: .55rem .6rem; background: var(--app-glass-strong); text-align: right; font-variant-numeric: tabular-nums; }
.clasif td:first-child { width: 2.4rem; border-radius: .7rem 0 0 .7rem; font-weight: 800; text-align: center; }
.clasif td:last-child { border-radius: 0 .7rem .7rem 0; }
.clasif td small { display: block; color: var(--app-muted); font-size: .74rem; }
.clasif tr.top td:first-child { color: var(--app-tone); }

.seg { display: inline-flex; flex-wrap: wrap; gap: .25rem; margin: 0 0 1.2rem; padding: .25rem; border-radius: 999px; background: var(--app-surface-3); }
.seg button { padding: .5rem 1rem; border: 0; border-radius: 999px; background: transparent; color: var(--app-ink-2); font-weight: 700; font-size: .9rem; }
.seg button.on { background: var(--app-surface); color: var(--app-ink); box-shadow: var(--app-shadow-sm); }
@media (max-width: 575.98px) { .seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; } .seg button { padding: .5rem .3rem; font-size: .84rem; } }
.pair-quick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(0, .8fr) auto; gap: .5rem; align-items: center; margin-bottom: 1rem; padding: .6rem; border: 1px solid var(--app-line); border-radius: 1.3rem; background: var(--app-surface); box-shadow: var(--app-shadow-sm); }
@media (max-width: 767.98px) { .pair-quick { grid-template-columns: 1fr 1fr; } .pair-quick .btn-primary { grid-column: 1 / -1; } .pair-quick #pqz { grid-column: 1 / -1; } }

/* Preparar partida: parejas que se tocan para intercambiarlas */
.prep-options { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin-bottom: 1rem; }
.prep-switch { display: flex; align-items: center; gap: .7rem; padding: .55rem .9rem; border: 1px solid var(--app-line); border-radius: 1.1rem; background: var(--app-surface); cursor: pointer; }
.prep-switch input { width: 1.2rem; height: 1.2rem; accent-color: var(--app-tone); }
.prep-switch strong { display: block; font-size: .92rem; }
.prep-switch small { display: block; color: var(--app-muted); font-size: .78rem; }
.prep-warn, .prep-note { display: flex; align-items: center; gap: .45rem; margin: 0; font-size: .86rem; font-weight: 650; }
.prep-warn { color: var(--app-warn); }
.prep-note { color: var(--app-ink-2); }
.prep-row { display: flex; align-items: center; gap: .6rem; min-height: 4rem; padding: .45rem .55rem; border-radius: .55rem; background: var(--app-glass-strong); }
.prep-list > .prep-row:first-child { border-top-left-radius: 1.2rem; border-top-right-radius: 1.2rem; }
.prep-list > .prep-row:last-child { border-bottom-left-radius: 1.2rem; border-bottom-right-radius: 1.2rem; }
.prep-row.is-warn .mesa-num { color: var(--app-warn); background: var(--app-warn-soft); }
.prep-pair { min-width: 0; flex: 1 1 0; display: grid; padding: .45rem .7rem; border: 2px solid transparent; border-radius: .9rem; background: var(--app-surface-2); color: var(--app-ink); text-align: left; transition: border-color .15s ease, background-color .15s ease; }
.prep-pair:hover { border-color: var(--app-line-strong); }
.prep-pair strong { font-size: .92rem; font-weight: 700; }
.prep-pair small { color: var(--app-muted); font-size: .76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prep-pair.is-selected { border-color: var(--app-tone); background: var(--app-tone-soft); }
.prep-row.is-bye .prep-pair { flex: 0 1 50%; }
.prep-vs { flex: 0 0 auto; color: var(--app-muted); font-size: .78rem; font-weight: 650; }
.prep-flag { flex: 0 0 auto; color: var(--app-warn); }
.badge-draft { display: inline-flex; align-items: center; gap: .3rem; padding: .1rem .55rem; border-radius: 999px; color: var(--app-warn); background: var(--app-warn-soft); font-size: .76rem; font-weight: 750; }
.row-item.is-withdrawn .row-item__copy strong { color: var(--app-muted); text-decoration: line-through; }
.row-item.is-withdrawn .mesa-num { opacity: .5; }
@media (max-width: 575.98px) { .prep-row { flex-wrap: wrap; } .prep-row .mesa-num { width: 2.1rem; height: 2.1rem; } .prep-pair { flex-basis: calc(50% - 2.5rem); } .prep-row:not(.is-bye) .prep-vs { display: none; } }

.result-dialog .modal-body h2, .result-sheet h2 { margin: 0; font-size: 1.5rem; }
.result-dialog .sub { margin: .2rem 0 1rem; color: var(--app-muted); font-size: .88rem; }
.duelo { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.lado { display: grid; gap: .55rem; align-content: start; padding: .8rem; border: 2px solid transparent; border-radius: 1.2rem; background: var(--app-surface-2); transition: border-color .2s ease, background-color .2s ease; }
.lado.is-win { border-color: var(--app-tone); background: var(--app-tone-soft); }
.lado__who { font-weight: 750; font-size: .95rem; }
.lado__who small { display: block; color: var(--app-muted); font-weight: 400; font-size: .76rem; line-height: 1.3; }
.lado.is-win .lado__who::after { content: " · gana"; color: var(--app-tone); }
.num span { display: block; color: var(--app-muted); font-size: .7rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.num .form-control { margin-top: .15rem; padding: .35rem .7rem; font-family: var(--app-display); font-variation-settings: "wdth" 118; font-size: 1.7rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.result-note { display: flex; gap: .5rem; align-items: flex-start; margin: .9rem 0; color: var(--app-ink-2); font-size: .88rem; }
.result-note i { color: var(--app-tone); margin-top: .1rem; }
.result-note.is-warn { padding: .7rem .8rem; border-radius: 1rem; background: var(--app-warn-soft); }
.result-note.is-warn i { color: var(--app-warn); }

.app-form .form-grid-2, .app-form .form-grid-3, .app-form .form-grid-4 { display: grid; gap: .6rem; }
.app-form .form-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.app-form .form-grid-3 { grid-template-columns: 1.1fr .8fr 1.5fr; }
.app-form .form-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 575.98px) { .app-form .form-grid-3, .app-form .form-grid-4 { grid-template-columns: 1fr 1fr; } .app-form .form-grid-3 > :last-child { grid-column: 1 / -1; } }
.form-hint { margin: -.3rem 0 0; color: var(--app-muted); font-size: .8rem; }
.form-block { margin: 0; padding: .9rem 1rem; border: 1px solid var(--app-line); border-radius: 1.1rem; background: var(--app-surface-2); }
.form-block legend, .form-block summary { float: none; width: auto; margin: 0 0 .5rem; padding: 0; font-size: .95rem; font-weight: 750; cursor: pointer; }
details.form-block:not([open]) summary { margin: 0; }
.choice { display: flex; gap: .7rem; align-items: flex-start; padding: .55rem .2rem; cursor: pointer; }
.choice input { margin-top: .3rem; accent-color: var(--app-tone); }
.choice strong { display: block; font-weight: 700; font-size: .92rem; }
.choice small { display: block; color: var(--app-muted); font-size: .8rem; }

/* Listas de torneos (gestión y parte pública) */
.t-row { display: flex; align-items: center; gap: .8rem; min-height: 4.2rem; padding: .55rem .7rem; border-radius: .55rem; background: var(--app-glass-strong); color: var(--app-ink); text-decoration: none; }
.t-row:hover { color: var(--app-ink); background: var(--app-surface); }
.row-list > li:first-child > .t-row { border-top-left-radius: 1.2rem; border-top-right-radius: 1.2rem; }
.row-list > li:last-child > .t-row { border-bottom-left-radius: 1.2rem; border-bottom-right-radius: 1.2rem; }
.date { width: 3rem; flex: 0 0 auto; display: grid; justify-items: center; padding: .3rem 0; border-radius: .85rem; line-height: 1.05; color: var(--app-on-tone-container); background: var(--app-tone-container); }
.date small { font-size: .62rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.date b { font-family: var(--app-display); font-variation-settings: "wdth" 118; font-size: 1.3rem; font-weight: 800; }
.date.is-past { color: var(--app-ink-2); background: var(--app-surface-3); }
.date.is-live { color: #fff; background: var(--app-danger); }
.t-copy { min-width: 0; flex: 1 1 auto; display: grid; }
.t-copy strong { font-weight: 700; }
.t-copy small { color: var(--app-muted); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chev { color: var(--app-muted); }
.badge-hl { padding: .05rem .45rem; border-radius: .4rem; background: var(--app-tone-soft); color: var(--app-tone); font-weight: 800; }

/* --------------------------------------------------------------------------
   Parte pública (sin cuenta): portada, torneo, buscador y QR de la mesa
   -------------------------------------------------------------------------- */
.pub-shell { max-width: 1240px; margin: 0 auto; }
.pub-bar { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: calc(1rem + env(safe-area-inset-top, 0px)) 1.1rem .4rem; }
.pub-bar .brand-word { font-size: 1.05rem; line-height: 1.1; }
.pub-bar .brand-word small { display: block; color: var(--app-muted); font-family: var(--app-font); font-size: .72rem; font-weight: 650; letter-spacing: 0; }
.pub { padding: .8rem 1.1rem 3rem; }
.pub h1 { margin: .2rem 0 .4rem; font-size: clamp(2rem, 4.6vw, 3rem); line-height: 1.04; letter-spacing: -.05em; font-variation-settings: "wdth" 125, "opsz" 96; }
.pub h1 strong { color: var(--app-tone); font-weight: inherit; }
.pub .lead { margin: .4rem 0 1rem; color: var(--app-muted); font-size: 1.02rem; }
.pub-grid { display: grid; gap: 1rem 2rem; }
@media (min-width: 992px) { .pub-bar { padding: 1.3rem 2.2rem .4rem; } .pub { padding: 1rem 2.2rem 3rem; } .pub-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: start; } .pub-grid > :last-child > .section-head:first-child { margin-top: 0; } }
.live { position: relative; overflow: hidden; isolation: isolate; display: grid; gap: .8rem; margin: 0 0 1rem; padding: 1.1rem 1.15rem; border-radius: 1.6rem; color: var(--app-ink-card-text); background: var(--app-ink-card); box-shadow: var(--app-shadow-lg); text-decoration: none; }
.live:hover { color: var(--app-ink-card-text); }
.live::before { content: ""; position: absolute; inset: -60% -15% auto auto; width: 70%; height: 200%; z-index: -1; background: radial-gradient(closest-side, var(--app-ink-card-glow), transparent); }
.live--static { margin-top: .8rem; }
.live__top { display: flex; align-items: center; gap: .5rem; font-size: .74rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; opacity: .85; }
.live__dot { width: .55rem; height: .55rem; border-radius: 50%; background: #ff6b6b; box-shadow: 0 0 0 4px rgba(255, 107, 107, .25); animation: buddy-breathe 2s ease-in-out infinite; }
.live__row { display: flex; align-items: center; justify-content: space-between; gap: .8rem; }
.live__name { display: block; font-family: var(--app-display); font-variation-settings: "wdth" 118; font-size: 1.5rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.live__meta { display: block; margin-top: .2rem; opacity: .78; font-size: .9rem; }
.live__time { font-family: var(--app-display); font-variation-settings: "wdth" 125, "opsz" 96; font-size: 2.1rem; font-weight: 800; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; color: #8fe3d2; }
.live__time[data-tone="warn"] { color: #f5b45c; }
.live__time[data-tone="danger"], .live__time[data-tone="over"] { color: #ff8a8a; }
.live__actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.live .btn-primary { --bs-btn-bg: #8fe3d2; --bs-btn-border-color: #8fe3d2; --bs-btn-color: #062a25; }
.live .btn-light { --bs-btn-bg: rgba(255, 255, 255, .1); --bs-btn-border-color: rgba(255, 255, 255, .2); --bs-btn-color: inherit; --bs-btn-hover-bg: rgba(255, 255, 255, .18); --bs-btn-hover-color: inherit; }
.search { display: flex; align-items: center; gap: .6rem; margin: 1rem 0 0; padding: .3rem .4rem .3rem 1rem; border: 1px solid var(--app-line-strong); border-radius: 999px; background: var(--app-surface); color: var(--app-muted); box-shadow: var(--app-shadow-sm); }
.search:focus-within, .search--on { border-color: var(--app-tone); box-shadow: 0 0 0 4px var(--app-focus); }
.search input { flex: 1; min-width: 0; padding: .5rem 0; border: 0; outline: 0; background: transparent; color: var(--app-ink); font-size: 1rem; }
.tabs { display: flex; flex-wrap: wrap; gap: .3rem; margin: 1.2rem 0 1rem; }
.tabs a { padding: .45rem .9rem; border-radius: 999px; color: var(--app-ink-2); font-weight: 700; font-size: .88rem; text-decoration: none; }
.tabs a:hover { background: var(--app-surface-3); color: var(--app-ink); }
.tabs a.on { color: var(--app-on-primary); background: var(--app-primary); }
.donde { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr)); gap: .45rem; }
.donde > div { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .7rem .9rem; border-radius: 1rem; background: var(--app-glass-strong); }
.donde span { font-weight: 700; }
.donde small { display: block; color: var(--app-muted); font-weight: 400; font-size: .76rem; }
.donde b { font-family: var(--app-display); font-variation-settings: "wdth" 118; font-size: 1.15rem; font-weight: 800; color: var(--app-tone); white-space: nowrap; }
.podio { display: grid; grid-template-columns: 1fr 1.15fr 1fr; align-items: end; gap: .45rem; max-width: 36rem; margin: 1rem 0 .4rem; }
.podio > div { display: grid; justify-items: center; gap: .2rem; padding: .7rem .4rem; border: 1px solid var(--app-line); border-radius: 1.1rem 1.1rem .5rem .5rem; background: var(--app-surface); text-align: center; }
.podio b { font-family: var(--app-display); font-variation-settings: "wdth" 125; font-size: 1.6rem; font-weight: 800; line-height: 1; }
.podio strong { font-size: .85rem; }
.podio small { color: var(--app-muted); font-size: .72rem; line-height: 1.25; }
.podio .p1 { min-height: 8.2rem; border-color: transparent; background: var(--app-tone-container); }
.podio .p1 b, .podio .p1 strong, .podio .p1 small { color: var(--app-on-tone-container); }
.podio .p2 { min-height: 6.8rem; }
.podio .p3 { min-height: 6rem; }
.stat3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; margin: 0 0 .8rem; }
.stat3 > div { padding: .7rem; border: 1px solid var(--app-line); border-radius: 1rem; background: var(--app-surface); }
.stat3 b { display: block; font-family: var(--app-display); font-variation-settings: "wdth" 118; font-size: 1.5rem; font-weight: 800; line-height: 1.1; }
.stat3 small { color: var(--app-muted); font-size: .76rem; }
.pub .result-sheet { max-width: 34rem; margin-top: 1rem; }

/* Pantalla de sala: siempre oscura, para la tele o el proyector */
.sala-page { --sala-bg: #0a0a0c; --sala-card: #1c1c1e; --sala-ink: #f5f5f7; --sala-muted: #98989d; --sala-tone: #8fe3d2; background: var(--sala-bg); }
.sala { min-height: 100dvh; display: grid; grid-template-columns: minmax(18rem, 28rem) minmax(0, 1fr); grid-template-rows: auto 1fr; gap: 1.6rem 2.4rem; padding: 2rem 2.4rem; color: var(--sala-ink); background: var(--sala-bg); font-size: clamp(15px, 1.15vw, 22px); }
.sala h1, .sala h2 { color: var(--sala-ink); }
.sala__head { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; }
.sala__head h1 { margin: 0; font-size: 2.6em; letter-spacing: -.05em; font-variation-settings: "wdth" 125, "opsz" 96; }
.sala__head p { margin: 0; color: var(--sala-muted); font-size: 1.1em; }
.sala__clock { display: grid; align-content: start; gap: 1rem; }
.sala__time { padding: 1.4rem; border-radius: 1.8rem; background: var(--sala-card); text-align: center; }
.sala__digits { display: block; font-family: var(--app-display); font-variation-settings: "wdth" 125, "opsz" 144; font-size: 6.5em; font-weight: 800; letter-spacing: -.05em; line-height: 1; font-variant-numeric: tabular-nums; color: var(--sala-tone); }
.sala__digits[data-tone="warn"] { color: #f5b45c; }
.sala__digits[data-tone="danger"], .sala__digits[data-tone="over"] { color: #ff8a8a; }
.sala__time small { color: var(--sala-muted); font-size: 1em; }
.sala section h2 { margin: 0 0 .9rem; font-size: 1.4em; }
.sala section h2 small { color: var(--sala-muted); font-weight: 400; font-size: .7em; }
.sala__mesas { display: grid; grid-template-columns: repeat(auto-fill, minmax(10em, 1fr)); gap: .5em .8em; }
.sala__mesas > div { display: flex; justify-content: space-between; padding: .55em .9em; border-radius: .9em; background: var(--sala-card); font-size: 1.15em; }
.sala__mesas span { color: var(--sala-muted); }
.sala__mesas b { color: var(--sala-tone); }
.sala .clasif td { background: var(--sala-card); color: var(--sala-ink); font-size: 1.05em; }
.sala .clasif th, .sala .clasif td small { color: var(--sala-muted); }
.sala .clasif tr.top td:first-child { color: var(--sala-tone); }
@media (max-width: 991.98px) { .sala { grid-template-columns: 1fr; padding: 1.2rem; } }

/* --------------------------------------------------------------------------
   Impresos (imprimir.php): actas con QR, distribución de mesas, clasificación y acreditaciones
   -------------------------------------------------------------------------- */
/* Sin tamaño de papel fijo: así el navegador deja elegir vertical u horizontal. Cada hoja lleva 2 actas: en vertical,
   una encima de otra; en horizontal, una al lado de otra y más altas (con más filas de manos). */
.print-page { margin: 0; background: #fff; color: #1d1d1f; }
.acta-page { display: flex; flex-direction: column; align-items: center; gap: 4mm; padding: 6mm 0; }
.print-bar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem 1.2rem; background: #f5f5f7; border-bottom: 1px solid rgba(0, 0, 0, .1); }
.print-bar a { color: #1d1d1f; text-decoration: none; font-weight: 650; }
.print-bar button { padding: .5rem 1.1rem; border: 0; border-radius: 999px; color: #fff; background: #1d1d1f; font-weight: 700; }
.print-empty { padding: 2rem; text-align: center; color: #6e6e73; }
.acta { box-sizing: border-box; flex: 0 0 auto; width: 190mm; height: 129mm; overflow: hidden; margin: 0; padding: 5mm 6mm; display: grid; grid-template-rows: auto 1fr auto; gap: 3mm; border: .4mm solid #1d1d1f; border-radius: 3mm; break-inside: avoid; font-size: 9pt; }
.acta__head { display: grid; grid-template-columns: 1fr auto auto auto; gap: 6mm; align-items: end; padding-bottom: 2mm; border-bottom: .3mm solid #1d1d1f; }
.acta__head small { display: block; color: #6e6e73; font-size: 7pt; text-transform: uppercase; letter-spacing: .08em; }
.acta__head strong { font-size: 12pt; }
.acta__mesa strong { font-family: var(--app-display); font-size: 22pt; line-height: 1; }
.acta__body { display: grid; grid-template-columns: 1fr 1fr; gap: 6mm; min-height: 0; }
.acta__pair { display: grid; grid-template-rows: auto 1fr auto; gap: 2mm; min-height: 0; }
.acta__who strong { display: block; font-size: 11pt; }
.acta__who span { display: block; line-height: 1.25; }
.acta__who small { color: #6e6e73; }
.acta__grid { width: 100%; border-collapse: collapse; font-size: 7pt; line-height: 1; }
.acta__grid th { padding: .6mm 1mm; border-bottom: .3mm solid #1d1d1f; text-align: center; font-weight: 700; }
.acta__grid td { box-sizing: border-box; height: 3.4mm; padding: 0; border: .2mm solid #c7c7cc; text-align: center; }
.acta__grid td:first-child { width: 9mm; color: #6e6e73; }
.acta__grid tr.is-extra { display: none; }
.acta__total { display: grid; grid-template-columns: auto 1fr auto 1fr; gap: 2mm; align-items: end; font-weight: 700; }
.acta__total i { height: 6mm; border-bottom: .4mm solid #1d1d1f; }
.acta__sign { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4mm; }
.acta__sign span { padding-top: 5mm; border-bottom: .3mm solid #1d1d1f; color: #6e6e73; font-size: 7pt; }
.acta__qr { width: 20mm; text-align: center; }
.acta__qr > div svg { display: block; width: 17mm; height: 17mm; margin: 0 auto; }
.is-landscape .acta__qr > div svg { width: 20mm; height: 20mm; }
.acta__qr small { display: block; margin-top: .5mm; font-size: 5.5pt; line-height: 1.15; color: #424245; }
.print-sheet { max-width: 190mm; margin: 8mm auto; }
.print-sheet h1 { font-size: 20pt; margin: 0; letter-spacing: -.03em; }
.print-sheet h2 { font-size: 13pt; margin: 6mm 0 2mm; }
.print-sub { color: #6e6e73; margin: 1mm 0 5mm; }
.print-mesas { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2mm 4mm; }
.print-mesas > div { display: flex; justify-content: space-between; padding: 2mm 3mm; border: .3mm solid #c7c7cc; border-radius: 2mm; font-size: 12pt; }
.print-mesas b { font-weight: 800; }
.clasif--print td { background: #fff; border-bottom: .2mm solid #e5e5ea; border-radius: 0 !important; padding: 1.5mm 2mm; }
.print-cards { display: grid; grid-template-columns: repeat(2, 90mm); justify-content: center; gap: 4mm; margin: 6mm auto; }
.acred { height: 55mm; display: grid; align-content: center; justify-items: center; gap: 1mm; padding: 4mm; border: .4mm dashed #8e8e93; border-radius: 3mm; text-align: center; break-inside: avoid; }
.acred small { color: #6e6e73; font-size: 7pt; letter-spacing: .1em; text-transform: uppercase; }
.acred strong { font-size: 12pt; }
.acred b { margin-top: 2mm; font-family: var(--app-display); font-size: 18pt; }
.acred em { font-style: normal; font-size: 13pt; font-weight: 700; }
/* Horizontal (se elige en la barra de imprimir.php, que también fija el papel): dos actas una al lado de otra. */
.is-landscape .acta-page { flex-direction: row; align-items: flex-start; justify-content: center; }
.is-landscape .acta { width: 138mm; height: 188mm; }
.is-landscape .acta__body { gap: 4mm; }
.is-landscape .acta__grid tr.is-extra { display: table-row; }
.is-landscape .acta__grid td { height: 5mm; }
.print-orient { display: inline-flex; gap: .2rem; padding: .2rem; border-radius: 999px; background: #e8e8ed; }
.print-orient button { padding: .35rem .8rem; border: 0; border-radius: 999px; background: transparent; color: #424245; font-weight: 700; }
.print-orient button.on { background: #fff; color: #1d1d1f; box-shadow: 0 1px 2px rgba(0, 0, 0, .1); }
.print-bar__actions { display: flex; align-items: center; gap: .6rem; }
@page { margin: 6mm; }
@media print {
    .print-bar { display: none; }
    .acta-page { padding: 0; }
    .acta-page + .acta-page { break-before: page; }
    .print-cards { margin: 0 auto; }
}

/* --------------------------------------------------------------------------
   Accesibilidad transversal: movimiento reducido, alto contraste y colores forzados
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto !important; }
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media (prefers-contrast: more) {
    :root { --app-muted: #45525c; --app-line: rgba(19, 32, 43, .3); --app-line-strong: rgba(19, 32, 43, .5); }
    .card, .row-item, .question, .proposal { border: 1px solid var(--app-line-strong); }
}
@media (forced-colors: active) {
    .card, .btn, .form-control, .row-item, .question, .proposal, .focus-card { border: 1px solid CanvasText; }
    .buddy { forced-color-adjust: none; }
}
