/* Botón de la portada cuando la aplicación ya está instalada: deja de ser un
   botón de 'acción' y pasa a ser un indicador, pero SIN pintarse de verde ni de
   naranja: se ve igual que el botón de "Compartir" y lo único que cambia es un
   punto de color junto al texto (verde = guardado todo y arranca sin conexión,
   naranja = todavía faltan archivos). Los colores son los mismos que usa el
   punto del aviso de "Uso sin conexión", para que signifiquen lo mismo. */
.hero-actions .btn .rc-estado-punto {
    display: inline-block;
    width: 10px;
    height: 10px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--border);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, .5);
}
[data-theme="dark"] .hero-actions .btn .rc-estado-punto {
    box-shadow: 0 0 0 2px rgba(0, 0, 0, .45);
}
.hero-actions .btn .rc-estado-punto--ok {
    background: #2f9e5f;
    box-shadow: 0 0 0 2px rgba(47, 158, 95, .28);
}
.hero-actions .btn .rc-estado-punto--aviso {
    background: #d98b1f;
    box-shadow: 0 0 0 2px rgba(217, 139, 31, .28);
}


/* El atributo 'hidden' solo vale si gana en la cascada: '.btn' pone
   'display: inline-flex', y una regla del autor siempre gana a la del
   navegador, así que los botones marcados como ocultos se veían igual. Passaba
   en el aviso de "Uso sin conexión" (el botón de instalar aparecía aun
   estando la app ya instalada) y puede afectar a cualquier otro 'hidden' del
   sitio. */
[hidden] {
    display: none !important;
}

:root {
    --bg: #f6f6f4;
    --surface: #ffffff;
    --surface-2: #efefec;
    --text: #1a1a1a;
    --muted: #66665e;
    --border: #e4e4df;
    --accent: #4e185e;
    --accent-soft: rgba(78, 24, 94, 0.1);
    --accent-text-on: #ffffff;
    --shadow-sm: 0 1px 2px rgba(20, 20, 19, 0.06);
    --shadow-md: 0 8px 24px rgba(20, 20, 19, 0.08);
    --shadow-lg: 0 24px 60px rgba(20, 20, 19, 0.14);
    --r-sm: 12px;
    --r-md: 18px;
    --r-lg: 28px;
    --grid-line: rgba(26, 26, 26, 0.04);
    --glass-bg: color-mix(in srgb, var(--surface) 55%, transparent);
    --glass-strong: color-mix(in srgb, var(--surface) 78%, transparent);
    --scroll-thumb: rgba(26, 26, 26, 0.22);
    --scroll-thumb-hover: rgba(26, 26, 26, 0.4);
    --sb-w: 264px;
    --topbar-h: 68px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-body: 'Open Sans', system-ui, -apple-system, sans-serif;
    --font-display: 'Manufacturing Consent', cursive;
}

[data-theme="dark"] {
    --bg: #101013;
    --surface: #18181c;
    --surface-2: #212127;
    --text: #f1f1f3;
    --muted: #9c9ca6;
    --border: #2a2a31;
    --accent: #d8b4fe;
    --accent-soft: rgba(216, 180, 254, 0.12);
    --accent-text-on: #14141a;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.55);
    --grid-line: rgba(255, 255, 255, 0.05);
    --glass-bg: color-mix(in srgb, var(--surface) 60%, transparent);
    --glass-strong: color-mix(in srgb, var(--surface) 85%, transparent);
    --scroll-thumb: rgba(255, 255, 255, 0.25);
    --scroll-thumb-hover: rgba(255, 255, 255, 0.45);
}

body.sb-collapsed:not(.sb-hover) {
    --sb-w: 72px;
}

@media (min-width: 901px) {
    body {
        padding-left: calc(var(--sb-w) + 40px);
        transition: background-color var(--transition), color var(--transition), padding-left 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.45s ease-out;
    }

    header.topbar {
        display: none;
    }
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    max-width: 100%;
}

body {
    max-width: 100%;
    overflow-x: hidden;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    transition: background-color var(--transition), color var(--transition), opacity 0.45s ease-out;
    padding-top: calc(var(--topbar-h) + 16px);
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 56px 56px;
}

* {
    scrollbar-width: thin;
    scrollbar-color: var(--scroll-thumb) transparent;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--scroll-thumb);
    border-radius: 999px;
    border: 3px solid transparent;
    background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--scroll-thumb-hover);
    border: 3px solid transparent;
    background-clip: padding-box;
}

::-webkit-scrollbar-corner {
    background: transparent;
}

::selection {
    background: var(--accent);
    color: var(--accent-text-on);
}

.display-font {
    font-family: var(--font-display);
    font-weight: 400;
    font-synthesis: none;
    line-height: 1.15;
}

i.ti {
    line-height: 1;
}

button {
    font-family: inherit;
    cursor: pointer;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

.topbar {
    position: fixed;
    top: 14px;
    left: 0;
    right: 0;
    z-index: 2400;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    column-gap: 12px;
    pointer-events: none;
    padding: 0 14px;
}

.menu-btn {
    grid-column: 1;
    display: none;
    pointer-events: auto;
    width: 52px;
    height: 52px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--glass-bg);
    backdrop-filter: blur(18px) saturate(1.4);
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
    color: var(--text);
    font-size: 23px;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: var(--shadow-md);
    transition: background-color var(--transition), transform var(--transition), border-color var(--transition);
}

.menu-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.menu-btn:active {
    transform: scale(0.92);
}

.topbar-search {
    grid-column: 2;
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 11px;
    flex: 1;
    min-width: 0;
    height: 52px;
    padding: 0 20px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--glass-bg);
    backdrop-filter: blur(18px) saturate(1.4);
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
    box-shadow: var(--shadow-md);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.topbar-search:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.topbar-search > i {
    font-size: 19px;
    color: var(--muted);
    flex-shrink: 0;
}

.topbar-search input {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: none;
    outline: none;
    background: transparent;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text);
}

.topbar-search input::placeholder {
    color: var(--muted);
    opacity: 0.8;
}

.search-drop {
    grid-column: 2;
    pointer-events: auto;
    margin-top: 10px;
    background: var(--glass-strong);
    backdrop-filter: blur(22px) saturate(1.4);
    -webkit-backdrop-filter: blur(22px) saturate(1.4);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
    max-height: min(60vh, 480px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 10px;
    display: none;
}

.search-drop.open {
    display: block;
}

.search-empty {
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
    padding: 18px 10px;
}

.theme-icon-moon {
    display: block;
}

.theme-icon-sun {
    display: none;
}

[data-theme="dark"] .theme-icon-moon {
    display: none;
}

[data-theme="dark"] .theme-icon-sun {
    display: block;
}

.drawer-close {
    display: none;
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--glass-bg);
    color: var(--text);
    font-size: 20px;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.drawer-close:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.sb-collapse {
    position: fixed;
    left: calc(18px + var(--sb-w) + 10px);
    top: 14px;
    transform: translateZ(0);
    z-index: 2601;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 48px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--glass-strong);
    backdrop-filter: blur(18px) saturate(1.4);
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
    color: var(--text);
    font-size: 16px;
    box-shadow: var(--shadow-sm);
    transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1), background-color var(--transition), color var(--transition), border-color var(--transition), transform var(--transition);
}

.sb-collapse:hover {
    color: var(--accent);
    border-color: var(--accent);
    transform: translateZ(0) scale(1.05);
}

.sb-collapse .icon-expand {
    display: none;
}

body.sb-collapsed .sb-collapse .icon-collapse {
    display: none;
}

body.sb-collapsed .sb-collapse .icon-expand {
    display: block;
}

.bottom-bar {
    position: fixed;
    left: 50%;
    transform: translateX(-50%) translateZ(0);
    z-index: 2400;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 4px;
    padding: 6px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: var(--shadow-lg);
}

@supports not (background: color-mix(in srgb, red 50%, blue)) {
    .bottom-bar {
        background: var(--surface);
    }
}

.sym-alt {
    font-family: 'UnifrakturMaguntia', serif;
}

.bb-title {
    min-width: 0;
    text-align: center;
    font-family: var(--font-display);
    font-size: 1.3rem;
    line-height: 1;
    letter-spacing: 0.5px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    user-select: none;
}

.bb-group {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.bb-right {
    justify-content: flex-end;
}

.bb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    height: 48px;
    padding: 0 18px;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: var(--text);
    font-size: 20px;
    text-decoration: none;
    transition: background-color var(--transition), color var(--transition), transform var(--transition);
}

.bb-btn i {
    font-size: 21px;
}

.bb-btn span {
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    line-height: 1;
    opacity: 0.75;
}

.bb-btn:hover {
    background: var(--accent-soft);
    color: var(--accent);
}

.bb-btn:hover span {
    opacity: 1;
}

.bb-btn:active {
    transform: scale(0.95);
}

.bb-btn-search {
    background: var(--glass-bg);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--muted);
}

.bb-btn-search:hover {
    border-color: var(--accent);
}

.backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition), visibility var(--transition);
    z-index: 2500;
}

.sb-hover-lock {
    display: none;
}

.sb-hover-lock .ic-off {
    display: none;
}

body.sb-noexpand .sb-hover-lock .ic-on {
    display: none;
}

body.sb-noexpand .sb-hover-lock .ic-off {
    display: inline-flex;
}

.sidebar {
    position: fixed;
    top: 14px;
    bottom: 14px;
    left: 18px;
    transform: translateZ(0);
    width: var(--sb-w);
    max-height: none;
    background: color-mix(in srgb, var(--surface) 50%, transparent);
    backdrop-filter: blur(30px) saturate(1.6);
    -webkit-backdrop-filter: blur(30px) saturate(1.6);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
    z-index: 2600;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--scroll-thumb) transparent;
    transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1), transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), background-color var(--transition), border-color var(--transition);
}

@supports not (background: color-mix(in srgb, red 50%, blue)) {
    .sidebar {
        background: var(--surface);
    }
}

@media (min-width: 901px) {
    .bottom-bar {
        top: 14px;
        left: calc(var(--sb-w) + 30px + (100vw - var(--sb-w) - 34px) * 0.15);
        width: calc((100vw - var(--sb-w) - 34px) * 0.7);
        transform: translateZ(0);
        transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1), width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .sb-hover-lock {
        position: fixed;
        left: calc(18px + var(--sb-w) + 10px);
        top: 72px;
        transform: translateZ(0);
        z-index: 2601;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 30px;
        height: 40px;
        border: 1px solid var(--border);
        border-radius: 12px;
        background: var(--glass-strong);
        backdrop-filter: blur(20px) saturate(1.6);
        -webkit-backdrop-filter: blur(20px) saturate(1.6);
        color: var(--muted);
        font-size: 15px;
        cursor: pointer;
        transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1), background-color var(--transition), color var(--transition), transform var(--transition);
    }

    .sb-hover-lock:hover {
        color: var(--accent);
        border-color: var(--accent);
        transform: translateZ(0) scale(1.05);
    }

    body.sb-noexpand .sb-hover-lock:hover {
        color: var(--accent);
        border-color: var(--accent);
    }

    .bb-btn-search {
        padding: 0 22px;
    }

    body.sb-collapsed:not(.sb-hover) .sidebar {
        --sb-w: 72px;
        width: var(--sb-w);
    }

    body.sb-collapsed:not(.sb-hover) .nav-link span,
    body.sb-collapsed:not(.sb-hover) .group-toggle span {
        display: none;
    }

    body.sb-collapsed:not(.sb-hover) .group-toggle {
        margin-top: 6px;
        opacity: 0.55;
    }

    body.sb-collapsed:not(.sb-hover) .nav-group,
    body.sb-collapsed:not(.sb-hover) .nav-sep {
        position: relative;
        margin-top: 8px;
    }

    body.sb-collapsed:not(.sb-hover) .nav-group::before,
    body.sb-collapsed:not(.sb-hover) .nav-sep::before {
        content: '';
        display: block;
        height: 1px;
        margin: 0 12px 9px;
        background: var(--border);
        border-radius: 999px;
    }

    body.sb-collapsed:not(.sb-hover) .submenu a {
        font-size: 0;
        justify-content: center;
        padding: 6px 0;
        gap: 0;
        border-radius: 10px;
    }

    body.sb-collapsed:not(.sb-hover) .submenu a i {
        font-size: 18px;
    }

    body.sb-collapsed:not(.sb-hover) .nav-link,
    body.sb-collapsed:not(.sb-hover) .group-toggle {
        justify-content: center;
        padding-inline: 0;
    }

    .sidebar-header {
        display: none;
    }

    .sidebar {
        overflow-y: hidden;
    }

    .sidebar > .nav {
        padding: 12px 10px 16px;
        overflow-y: auto;
        scrollbar-width: none;
    }

    .sidebar > .nav::-webkit-scrollbar {
        display: none;
    }

    .nav-links {
        gap: 3px;
    }

    .nav-link,
    .group-toggle {
        padding: 9px 12px;
        font-size: 0.87rem;
        gap: 11px;
    }

    .group-toggle {
        cursor: default;
    }

    .nav-link i,
    .group-toggle > i:first-of-type {
        font-size: 18px;
    }

    .submenu a {
        padding: 5px 12px 5px 41px;
        font-size: 0.82rem;
    }

    .submenu a:hover {
        padding-left: 45px;
    }
}

.backdrop.active {
    opacity: 1;
    visibility: visible;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 14px 10px;
}

.nav {
    flex: 1;
    padding: 14px 12px 28px;
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-link,
.group-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 11px 14px;
    border: none;
    border-radius: 12px;
    background: transparent;
    color: var(--text);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    text-align: left;
    transition: background-color var(--transition), color var(--transition);
}

.nav-link i,
.group-toggle > i:first-of-type {
    font-size: 19px;
    color: var(--muted);
    transition: color var(--transition);
    flex-shrink: 0;
}

.nav-link span,
.group-toggle span {
    flex: 1;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.group-toggle .chevron {
    font-size: 16px;
    transition: transform var(--transition);
}

.nav-link:hover,
.group-toggle:hover {
    background: var(--accent-soft);
}

.nav-link:hover i,
.group-toggle:hover > i:first-of-type {
    color: var(--accent);
}

.nav-link.active {
    background: var(--accent-soft);
    color: var(--accent);
}

.nav-link.active i {
    color: var(--accent);
}

.nav-group.open > .group-toggle .chevron {
    transform: rotate(180deg);
}

.submenu {
    list-style: none;
    display: block;
}

.submenu a {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 14px 9px 44px;
    margin: 1px 0;
    border-radius: 10px;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: background-color var(--transition), color var(--transition), padding-left var(--transition);
}

.submenu a i {
    font-size: 17px;
    color: var(--muted);
    transition: color var(--transition);
}

.submenu a:hover {
    background: var(--surface-2);
    color: var(--text);
    padding-left: 48px;
}

.submenu a.active {
    background: var(--accent-soft);
    color: var(--accent);
}

.submenu a.active i {
    color: var(--accent);
}

.content {
    margin-left: 0;
    max-width: 1160px;
    padding: clamp(1.5rem, 4vw, 4rem);
    margin-inline: auto;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - var(--topbar-h) - 16px);
}

.hero {
    position: relative;
    text-align: center;
    padding: clamp(2rem, 6vw, 4.5rem) 0 clamp(2.5rem, 6vw, 4rem);
}

.hero-math {
    position: absolute;
    inset: 0;
    pointer-events: none;
    user-select: none;
}

.hero-math span {
    position: absolute;
    font-family: Georgia, 'Times New Roman', serif;
    font-style: italic;
    font-weight: 700;
    color: var(--muted);
    opacity: 0.14;
    rotate: -10deg;
    animation: mathFloat 9s ease-in-out infinite;
}

[data-theme="dark"] .hero-math span {
    opacity: 0.16;
}

@keyframes mathFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-16px);
    }
}

.hero-math span:nth-child(1) {
    top: -4%;
    left: 7%;
    font-size: 3rem;
    animation-delay: -1s;
}

.hero-math span:nth-child(2) {
    top: 12%;
    right: 8%;
    font-size: 2.6rem;
    rotate: 12deg;
    animation-delay: -3s;
}

.hero-math span:nth-child(3) {
    top: 46%;
    left: 3%;
    font-size: 3.4rem;
    rotate: 8deg;
    animation-duration: 11s;
    animation-delay: -5s;
}

.hero-math span:nth-child(4) {
    top: 58%;
    right: 4%;
    font-size: 3rem;
    rotate: -14deg;
    animation-duration: 10s;
    animation-delay: -2s;
}

.hero-math span:nth-child(5) {
    top: -8%;
    right: 26%;
    font-size: 2.2rem;
    rotate: 6deg;
    animation-duration: 12s;
    animation-delay: -6s;
}

.hero-math span:nth-child(6) {
    top: 30%;
    left: 18%;
    font-size: 2rem;
    rotate: -6deg;
    animation-duration: 8s;
    animation-delay: -4s;
}

.hero-math span:nth-child(7) {
    top: 74%;
    left: 22%;
    font-size: 2.4rem;
    rotate: 10deg;
    animation-duration: 10s;
    animation-delay: -7s;
}

.hero-math span:nth-child(8) {
    top: 80%;
    right: 20%;
    font-size: 2.2rem;
    rotate: -8deg;
    animation-duration: 11s;
    animation-delay: -3s;
}

.hero-math span:nth-child(9) {
    top: 34%;
    right: 17%;
    font-size: 1.8rem;
    rotate: 14deg;
    animation-duration: 9s;
    animation-delay: -8s;
}

@media (max-width: 640px) {
    .hero-title {
        font-size: clamp(4.5rem, 22vw, 7.5rem);
    }

    .hero-title .ht-a,
    .hero-title .ht-b {
        display: block;
    }

    .hero-title .ht-a {
        margin-bottom: -0.08em;
    }

    .hero-kicker {
        white-space: nowrap;
        font-size: clamp(0.55rem, 2.4vw, 0.7rem);
        letter-spacing: 0.6px;
        padding: 0;
    }

    .hero-math span {
        font-size: 1.6rem !important;
        opacity: 0.1;
    }

    .hero-math span:nth-child(3),
    .hero-math span:nth-child(6),
    .hero-math span:nth-child(9) {
        display: none;
    }
}

.hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 26px;
}

.hero-title {
    font-size: clamp(3.2rem, 9vw, 5.5rem);
    margin-bottom: 34px;
    animation: reveal 0.9s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes reveal {
    from {
        opacity: 0;
        transform: translateY(26px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-box {
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: 560px;
    height: 64px;
    margin: 0 auto;
    padding: 0 22px;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 22px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.search-box:hover,
.search-box:focus-visible {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.search-icon {
    font-size: 22px;
    color: var(--muted);
    transition: color var(--transition);
}

.search-box:hover .search-icon {
    color: var(--accent);
}

.rotator-container {
    position: relative;
    height: 30px;
    overflow: hidden;
    flex: 1;
    text-align: left;
}

.rotating-text {
    position: absolute;
    inset: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--muted);
    opacity: 0;
    transform: translateY(26px);
    transition: all 0.5s cubic-bezier(0.76, 0, 0.24, 1);
}

.rotating-text.active {
    opacity: 1;
    transform: translateY(0);
}

.rotating-text.exit {
    opacity: 0;
    transform: translateY(-26px);
}

.search-arrow {
    font-size: 20px;
    color: var(--muted);
    transition: transform var(--transition), color var(--transition);
}

.search-box:hover .search-arrow {
    color: var(--accent);
    transform: translateX(4px);
}

.hero-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 30px;
}

.hero-actions .btn {
    border-radius: 999px;
    background: var(--glass-bg);
    backdrop-filter: blur(16px) saturate(1.4);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    border: 1px solid var(--border);
    color: var(--text);
}

.hero-actions .btn i {
    color: var(--accent);
}

.hero-actions .btn:hover {
    background: var(--glass-strong);
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

@media (max-width: 640px) {
    .hero-actions {
        gap: 10px;
    }

    .hero-actions .btn {
        flex: 1 1 0;
        min-width: 0;
        max-width: 220px;
        height: 46px;
        padding: 0 clamp(12px, 4vw, 18px);
        gap: clamp(6px, 2vw, 8px);
        font-size: clamp(0.72rem, 3.2vw, 0.9rem);
    }

    .hero-actions .btn i {
        font-size: clamp(15px, 4vw, 18px);
    }
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 52px;
    padding: 0 30px;
    border-radius: 16px;
    border: 1.5px solid transparent;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition);
}

.btn i {
    font-size: 19px;
}

.btn-solid {
    background: rgba(0, 0, 0, 0.1);
    color: #000;
    border: 1px solid #000;
}

[data-theme="dark"] .btn-solid {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.85);
    border-color: rgba(255, 255, 255, 0.14);
}

.btn-solid:hover {
    background: #000;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

[data-theme="dark"] .btn-solid:hover {
    background: rgba(255, 255, 255, 0.09);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.26);
}

.btn-ghost {
    background: transparent;
    color: var(--text);
    border-color: var(--border);
}

.btn-ghost:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-soft);
    transform: translateY(-2px);
}

.welcome-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 46px;
    color: var(--muted);
    font-size: 0.95rem;
}

.arrow-icon {
    font-size: 18px;
    animation: bounceDown 2s infinite;
}

@keyframes bounceDown {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-6px);
    }

    60% {
        transform: translateY(-3px);
    }
}

.section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
    gap: clamp(1.2rem, 2.5vw, 2rem);
    padding-top: 1rem;
    scroll-margin-top: calc(var(--topbar-h) + 24px);
}

.card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: var(--glass-strong);
    backdrop-filter: blur(18px) saturate(1.4);
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: clamp(1.8rem, 4vw, 2.6rem) clamp(1.4rem, 3vw, 2rem);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent);
}

.card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 74px;
    height: 74px;
    border-radius: 22px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 36px;
    margin-bottom: 20px;
    transition: transform var(--transition);
}

.card:hover .card-icon {
    transform: scale(1.08) rotate(-4deg);
}

.card h3 {
    font-size: 1.75rem;
    margin-bottom: 16px;
}

.card ul {
    list-style: none;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}

.card ul li {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    font-size: 0.95rem;
    color: var(--muted);
}

.list-check {
    font-size: 14px;
    color: var(--accent);
    flex-shrink: 0;
}

.card-cta {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: auto;
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: var(--accent);
    opacity: 0;
    transform: translateY(6px);
    transition: opacity var(--transition), transform var(--transition);
}

.card:hover .card-cta {
    opacity: 1;
    transform: translateY(0);
}

.feedback-section {
    scroll-margin-top: calc(var(--topbar-h) + 24px);
}

.wrapper-feedback {
    max-width: 560px;
    margin: clamp(3rem, 8vw, 5.5rem) auto 0;
}

.card-comentarios {
    background: var(--glass-strong);
    backdrop-filter: blur(18px) saturate(1.4);
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: clamp(1.8rem, 5vw, 2.8rem) clamp(1.4rem, 4vw, 2.4rem);
    box-shadow: var(--shadow-md);
}

.feedback-title {
    text-align: center;
    margin-bottom: 22px;
}

.feedback-title .title-big {
    display: block;
    font-size: clamp(2rem, 6vw, 2.6rem);
}

.feedback-title .title-small {
    display: block;
    font-family: var(--font-display);
    font-weight: 400;
    font-synthesis: none;
    line-height: 1.1;
    font-size: clamp(1.7rem, 5.5vw, 2.3rem);
    opacity: 0.55;
    margin-top: 4px;
}

.pregunta-pro {
    display: block;
    text-align: center;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 20px;
}

.selector-experiencia {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 28px;
}

@media (min-width: 480px) {
    .selector-experiencia {
        grid-template-columns: repeat(4, 1fr);
    }
}

.chip-option {
    position: relative;
    cursor: pointer;
}

.chip-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.chip-text {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 8px;
    background: var(--surface-2);
    border: 1.5px solid transparent;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted);
    transition: all var(--transition);
}

.chip-option input:checked + .chip-text {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
}

.chip-option input:focus-visible + .chip-text {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.form-group {
    margin-bottom: 22px;
    position: relative;
}

.form-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0 0 8px 16px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    background: var(--surface-2);
    border: 1.5px solid transparent;
    border-radius: 999px;
    padding: 14px 20px;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text);
    resize: vertical;
    transition: all var(--transition);
}

.form-group textarea {
    border-radius: var(--r-md);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--muted);
    opacity: 0.7;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    background: var(--surface);
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.char-counter {
    position: absolute;
    right: 14px;
    bottom: -20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--muted);
}

.char-counter.warning {
    color: #d97706;
    animation: counterPop 0.35s ease-out;
}

@keyframes counterPop {
    50% {
        transform: scale(1.15);
    }
}

.container-boton {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

.btn-submit,
[data-theme="dark"] .btn-submit {
    position: relative;
    overflow: hidden;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    border: 1px solid var(--accent);
}

.btn-submit:hover,
[data-theme="dark"] .btn-submit:hover {
    background: var(--accent);
    color: var(--accent-text-on);
}

.btn-submit.enviando {
    width: 52px;
    padding: 0;
    pointer-events: none;
}

.btn-submit .btn-send-icon {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s;
}

.btn-submit.enviando .btn-send-icon {
    position: absolute;
    transform: scale(0);
    opacity: 0;
}

.btn-submit .check-icon {
    position: absolute;
    transform: scale(0);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s;
}

.btn-submit.enviando .check-icon {
    transform: scale(1);
    opacity: 1;
}

/* Fade de entrada suave entre páginas */
body:not(.page-loaded) {
    opacity: 0;
}

body.page-loaded {
    opacity: 1;
}

.reveal-on-scroll {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.reveal-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}


.footer-global {
    border: 1px solid var(--border);
    position: relative;
    margin-top: clamp(4rem, 10vw, 6rem);
    padding: clamp(2.5rem, 6vw, 4rem) clamp(16px, 3vw, 32px);
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
}

.footer-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 36px;
    text-align: center;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 clamp(20px, 5vw, 56px);
}

@media (min-width: 850px) {
    .footer-wrapper {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        align-items: start;
        text-align: left;
        gap: clamp(32px, 6vw, 72px);
    }

    .footer-center {
        text-align: center;
    }
}

.footer-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

@media (min-width: 850px) {
    .footer-section {
        align-items: flex-start;
    }
}

.footer-h4 {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--muted);
}

.footer-links {
    display: grid;
    grid-template-columns: auto auto;
    gap: 8px 28px;
}

.footer-links a {
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    opacity: 0.85;
    transition: all var(--transition);
}

.footer-links a:hover {
    color: var(--accent);
    opacity: 1;
    transform: translateX(3px);
}

.footer-center .footer-socials {
    justify-content: center;
}

.share-qr {
    display: flex;
    justify-content: center;
    margin-bottom: 22px;
}

.share-qr img {
    width: 180px;
    height: 180px;
    padding: 12px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
}

.share-apps {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 8px;
}

.share-apps a,
.share-apps button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    font-size: 20px;
    text-decoration: none;
    cursor: pointer;
    font-family: inherit;
    transition: all var(--transition);
}

.share-apps a:hover,
.share-apps button:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-text-on);
    transform: translateY(-3px);
}

.share-apps button .ic-done {
    display: none;
}

.share-apps button.copiado .ic-copy {
    display: none;
}

.share-apps button.copiado .ic-done {
    display: inline-block;
}

.footer-pages {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-pages a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.92rem;
    opacity: 0.85;
    transition: all var(--transition);
}

.footer-pages a i {
    color: var(--accent);
    transition: transform var(--transition);
}

.footer-pages a:hover {
    color: var(--accent);
    opacity: 1;
}

.footer-pages a:hover i {
    transform: translateX(3px);
}

.footer-about-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--accent);
    font-weight: 700;
    font-size: 0.92rem;
    text-decoration: none;
    transition: all var(--transition);
}

.footer-about-link:hover i {
    transform: translateX(3px);
}

.footer-email {
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.92rem;
    border-bottom: 1.5px solid transparent;
    transition: border-color var(--transition), color var(--transition);
    overflow-wrap: anywhere;
}

.footer-email:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.footer-socials {
    display: flex;
    gap: 12px;
}

.footer-socials a,
.footer-socials button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    font-size: 19px;
    text-decoration: none;
    cursor: pointer;
    font-family: inherit;
    transition: all var(--transition);
}

.footer-socials a:hover,
.footer-socials button:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-text-on);
    transform: translateY(-4px);
}

.footer-socials button .ic-done {
    display: none;
}

.footer-socials button.copiado .ic-copy {
    display: none;
}

.footer-socials button.copiado .ic-done {
    display: inline-block;
}

.footer-logo-link {
    text-decoration: none;
}

/* Solo para lectores de pantalla: el texto esta en la pagina pero no se ve.
   Se usa para el <h1> de las paginas cuyo titulo visible lo dibuja el
   JavaScript (editor, editor de ecuaciones, conicas y graficadora): asi el
   titulo existe tambien sin ejecutar JS, que es lo que leen Google y las
   tecnologias de asistencia. */
.solo-lector {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.footer-title {
    font-size: clamp(1.8rem, 5vw, 2.6rem);
    color: var(--text);
    transition: color var(--transition), transform var(--transition);
    display: inline-block;
}

.footer-title:hover {
    color: var(--accent);
    transform: scale(1.04);
}

.visitor-counter img {
    filter: grayscale(1);
    opacity: 0.75;
    transition: filter var(--transition), opacity var(--transition);
}

.visitor-counter img:hover {
    filter: grayscale(0);
    opacity: 1;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition), visibility var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
    max-width: 520px;
    width: 100%;
    max-height: min(86vh, 720px);
    overflow-y: auto;
    padding: clamp(1.6rem, 4vw, 2.4rem);
    transform: translateY(20px) scale(0.97);
    transition: transform var(--transition);
}

.modal-overlay.active .modal {
    transform: translateY(0) scale(1);
}

/* El modal de sintaxis lleva una vista previa matematica (KaTeX) junto a cada
   comando, asi que necesita mas ancho que el modal estandar de 520px: con el
   ancho corto las formulas largas sacaban barra de scroll horizontal. */
#modalSintaxis .modal { max-width: 900px; }

@keyframes rcModalFade {
    from { opacity: 0; visibility: hidden; }
    to { opacity: 1; visibility: visible; }
}

@keyframes rcModalPop {
    from { transform: translateY(20px) scale(0.97); }
    to { transform: translateY(0) scale(1); }
}

.close-modal {
    position: absolute;
    top: 16px;
    right: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 12px;
    background: var(--surface-2);
    color: var(--text);
    font-size: 18px;
    transition: all var(--transition);
}

.close-modal:hover {
    background: var(--accent);
    color: var(--accent-text-on);
    transform: rotate(90deg);
}

.modal-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    font-size: clamp(2.1rem, 5vw, 2.7rem);
    margin-bottom: 8px;
    padding-right: 40px;
    text-align: center;
}

.modal-title i {
    font-size: 26px;
    color: var(--accent);
}

.modal-desc {
    color: var(--muted);
    font-size: 0.95rem;
    margin-bottom: 24px;
    text-align: center;
}

.modal-section {
    margin-bottom: 20px;
}

.modal-section h3 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-align: center;
}

.modal-section h3 i {
    color: var(--accent);
    font-size: 19px;
}

.modal-section ol {
    margin-left: 20px;
    color: var(--muted);
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.note {
    display: flex;
    align-items: center;
    gap: 9px;
    background: var(--accent-soft);
    color: var(--muted);
    border-radius: var(--r-md);
    padding: 12px 16px;
    font-size: 0.85rem;
    margin: 20px 0;
}

.note i {
    color: var(--accent);
    font-size: 17px;
    flex-shrink: 0;
}

.modal-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 12px 16px;
    border-radius: 14px;
    border: 1px solid transparent;
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.93rem;
    transition: all var(--transition);
}

.search-result-item > i {
    font-size: 20px;
    color: var(--accent);
    flex-shrink: 0;
}

.search-result-item span {
    flex: 1;
}

.search-result-item em {
    font-style: normal;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 1.2px;
    color: var(--muted);
    background: var(--surface-2);
    padding: 4px 9px;
    border-radius: var(--r-sm);
}

.search-result-item:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
}

.modal-search {
    display: flex;
    align-items: center;
    gap: 11px;
    height: 52px;
    padding: 0 20px;
    border: 1.5px solid var(--border);
    border-radius: 999px;
    background: var(--surface-2);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.modal-search:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.modal-search > i {
    font-size: 19px;
    color: var(--muted);
}

.modal-search input {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: none;
    outline: none;
    background: transparent;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text);
}

.modal-search input::placeholder {
    color: var(--muted);
    opacity: 0.8;
}

.modal-results {
    display: block;
    margin-top: 14px;
    padding: 8px;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 1px solid var(--border);
    box-shadow: none;
    max-height: min(42vh, 380px);
}

.modal-actions .btn {
    height: 44px;
    padding: 0 24px;
}

@media (max-width: 1024px) {
    .content {
        padding: clamp(1.2rem, 4vw, 2rem);
    }
}

@media (max-width: 900px) {
    body {
        padding-bottom: 96px;
    }

    .hero-title {
        font-size: clamp(5rem, 21vw, 8.6rem);
    }

    .topbar {
        column-gap: 12px;
    }

    .menu-btn {
        display: inline-flex;
    }

    .drawer-close {
        display: inline-flex;
    }

    .sb-collapse {
        display: none;
    }

.sidebar {
        top: 0;
        left: 0;
        bottom: 0;
        transform: none;
        translate: -110% 0;
        width: min(400px, 94vw);
        max-height: none;
        border-radius: 0 var(--r-lg) var(--r-lg) 0;
        background:
            linear-gradient(180deg, rgba(255,255,255,0.85), rgba(255,255,255,0.65)),
            var(--surface-2);
        -webkit-backdrop-filter: blur(26px) saturate(1.7);
        backdrop-filter: blur(26px) saturate(1.7);
        visibility: hidden;
        transition:
            translate 0.55s cubic-bezier(0.32, 0.72, 0, 1),
            visibility 0s linear 0.55s;
        will-change: translate;
    }

    .sidebar.active {
        translate: 0 0;
        visibility: visible;
        transition: translate 0.55s cubic-bezier(0.32, 0.72, 0, 1);
        box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
    }

[data-theme="dark"] .sidebar {
        background:
            linear-gradient(180deg, rgba(20,20,24,0.88), rgba(17,17,20,0.72)),
            #141418;
    }
    .nav-links > li {
        opacity: 0;
        transform: translateX(-22px);
        transition:
            opacity 0.35s ease,
            transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
    }

    .sidebar.active .nav-links > li {
        opacity: 1;
        transform: none;
    }

    .sidebar.active .nav-links > li:nth-child(1) { transition-delay: 0.10s; }
    .sidebar.active .nav-links > li:nth-child(2) { transition-delay: 0.16s; }
    .sidebar.active .nav-links > li:nth-child(3) { transition-delay: 0.22s; }
    .sidebar.active .nav-links > li:nth-child(4) { transition-delay: 0.28s; }
    .sidebar.active .nav-links > li:nth-child(5) { transition-delay: 0.34s; }
    .sidebar.active .nav-links > li:nth-child(6) { transition-delay: 0.40s; }

    .sidebar-header {
        justify-content: flex-start; padding-left: 18px;
    }

    .nav {
        padding: 16px 14px 30px;
    }

    .nav-links {
        display: flex;
        flex-direction: column;
        gap: 22px;
    }

    .nav-links > li {
        display: block;
    }

    .nav-link {
        flex-direction: row;
        align-items: center;
        gap: 12px;
        height: auto;
        padding: 13px 16px;
        background: var(--surface-2);
        border: 1px solid var(--border);
        border-radius: var(--r-md);
        font-weight: 600;
    }

    .nav-link i {
        font-size: 22px;
        color: var(--accent);
    }

    /* titulo de seccion */
    .group-toggle {
        background: transparent;
        border: none;
        border-radius: 0;
        padding: 0 4px;
        margin-bottom: 10px;
        color: var(--muted);
        font-size: 0.78rem;
        letter-spacing: 1.5px;
    }

    .group-toggle > i:first-of-type {
        font-size: 17px;
        color: var(--accent);
    }

    .group-toggle span {
        flex: none;
    }

    .group-toggle .chevron {
        display: none;
    }

    /* recursos en dos columnas */
    .submenu {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .submenu a {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        gap: 7px;
        padding: 13px 6px;
        margin: 0;
        background: var(--surface-2);
        border: 1px solid var(--border);
        border-radius: var(--r-md);
    }

    .submenu a i {
        font-size: 24px;
        color: var(--accent);
    }

.submenu a:hover {
        padding-left: 6px;
        transform: translateY(-2px);
        background: var(--surface-2);
        border-color: var(--accent);
    }

    .bottom-bar {
        bottom: 14px;
        left: 10px;
        right: 10px;
        transform: translateZ(0);
        width: auto;
        border-radius: 22px;
        max-width: none;
        display: flex;
        gap: 6px;
    }

    .bb-group {
        display: contents;
    }

    .bb-btn {
        flex: 1;
        justify-content: center;
    }

    .bb-title {
        display: none;
    }

    .bb-btn {
        flex-direction: column;
        gap: 3px;
        min-width: 52px;
        height: 54px;
        padding: 6px 8px;
        border-radius: 14px;
    }

    .bb-btn span {
        font-size: 0.58rem;
        letter-spacing: 0.2px;
    }

    .bb-btn-search {
        margin-left: 0;
        padding: 6px 8px;
        background: transparent;
        border-color: var(--border);
    }

    .bb-btn:active {
        transform: scale(0.9);
    }
}

.section-carousel {
    padding: 12px clamp(20px, 6vw, 96px);
}

.carousel-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.carousel-head h2 {
    font-size: clamp(2rem, 4vw, 2.8rem);
}

.carousel-sub {
    color: var(--muted);
    margin-top: 6px;
    font-size: 0.95rem;
}

.carousel-nav {
    display: flex;
    gap: 10px;
}

.carousel-nav button {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 20px;
    cursor: pointer;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.carousel-nav button:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
}

.carousel-nav {
    display: none;
}

.carousel-block {
    margin-bottom: 34px;
}

.carousel-cat {
    font-size: 1.35rem;
    margin-bottom: 14px;
    padding-left: 4px;
}

.carousel-track {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
    gap: 12px;
}

.carousel-set {
    display: contents;
}

.res-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    min-height: 132px;
    padding: 18px 14px 14px;
    background: var(--glass-bg);
    backdrop-filter: blur(18px) saturate(1.4);
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
    border: 1px solid var(--border);
    border-radius: 20px;
    text-decoration: none;
    overflow: hidden;
    transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.res-bg {
    position: absolute;
    left: -12px;
    top: 44%;
    transform: translateY(-50%);
    font-size: 84px;
    line-height: 1;
    color: var(--accent);
    opacity: 0.045;
    pointer-events: none;
    user-select: none;
}

.res-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    box-shadow: var(--shadow-lg);
}

.res-math {
    position: relative;
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 1.35rem;
    color: var(--text);
}

.res-math-sm {
    font-size: 0.82rem;
}

.res-svg {
    width: 118px;
    height: auto;
    color: #000000;
}

.res-svg text {
    font-family: Georgia, 'Times New Roman', serif;
    font-style: italic;
    font-size: 11px;
    fill: currentColor;
}

[data-theme="dark"] .res-svg {
    color: #ffffff;
}

.res-foot {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.res-name {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    font-weight: 700;
    font-size: 0.88rem;
    letter-spacing: 0.2px;
    color: var(--accent);
}

.res-foot > i {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.res-card:hover .res-foot > i {
    color: var(--accent);
    transform: translateX(3px);
}
.res-card-svg .res-svg {
    width: 132px;
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}



.res-card-svg .res-math {
    min-height: 74px;
}

.res-desc {
    display: block;
    width: 100%;
    border-top: 1px solid var(--border);
    padding-top: 8px;
    font-size: 0.7rem;
    font-weight: 500;
    line-height: 1.45;
    color: var(--muted);
    text-align: left;
}

.res-card-svg:hover .res-svg {
    transform: scale(1.07);
}

@media (prefers-reduced-motion: reduce) {
    .carousel-set {
        animation: none;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}


.modal-title i {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-soft);
    border-radius: 14px;
    font-size: 22px;
}



.modal-section {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 16px 18px 14px;
}

.modal-section ol li::marker {
    color: var(--accent);
    font-weight: 700;
}

.search-result-item {
    box-shadow: inset 3px 0 0 transparent;
}

.search-result-item:hover {
    box-shadow: inset 3px 0 0 var(--accent);
    transform: translateX(4px);
}

.share-qr img {
    outline: 2px dashed var(--border);
    outline-offset: 6px;
}
@keyframes nameSlide {
    0%, 20% { transform: translateX(0); }
    50%, 80% { transform: translateX(var(--slide-x, -30px)); }
    100% { transform: translateX(0); }
}

.res-name.slide {
    animation: nameSlide 5.5s ease-in-out infinite;
}
.span-full {
    grid-column: 1 / -1;
}
/* ===== Feedback: pills e inputs ===== */
.card-comentarios .chip-text {
    background: var(--surface-2);
    border: 1px solid var(--border);
}
.card-comentarios .form-group input,
.card-comentarios .form-group textarea {
    background: var(--surface-2);
    border: 1px solid var(--border);
}
[data-theme="dark"] .card-comentarios .chip-text,
[data-theme="dark"] .card-comentarios .form-group input,
[data-theme="dark"] .card-comentarios .form-group textarea {
    background: var(--surface-2);
    border: 1px solid rgba(255, 255, 255, 0.10);
}
/* ===== Sidebar movil: pills EFEFEC sin sombra ===== */
@media (max-width: 900px) {
    .submenu a,
    .nav-link {
        background: #EFEFEC;
    }
    [data-theme="dark"] .submenu a,
    [data-theme="dark"] .nav-link {
        background: var(--surface-2);
    }
}
/* ============================================================ */
/* Paginas de contenido (auto / formulario) - plantilla comun    */
/* ============================================================ */
.page-head {
    text-align: center;
    padding: clamp(2rem, 6vw, 4rem) 0 clamp(1.2rem, 3vw, 2rem);
    position: relative;
}
.page-head h1 {
    font-size: clamp(2.4rem, 7vw, 4.2rem);
    color: var(--text);
    margin-bottom: .6rem;
}
.page-head p {
    max-width: 720px;
    margin: 0 auto;
    color: var(--muted);
    font-size: .95rem;
    line-height: 1.7;
}
/* Acordeon (Acerca de) */
.acc-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 860px;
    margin: 0 auto clamp(3rem, 8vw, 5rem);
}
.acc-item {
    background: var(--glass-bg);
    backdrop-filter: blur(12px) saturate(1.3);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
    transition: box-shadow var(--transition), border-color var(--transition);
}
.acc-item.open {
    border-color: var(--accent);
    box-shadow: var(--shadow-lg);
}
.acc-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 22px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--text);
    text-align: left;
}
.acc-btn:hover { color: var(--accent); }
.acc-btn .ti {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform .35s cubic-bezier(.32,.72,0,1);
}
.acc-item.open .acc-btn .ti { transform: rotate(45deg); }
.acc-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height .45s cubic-bezier(.32,.72,0,1);
}
.acc-panel-inner {
    padding: 4px 22px 22px;
    border-top: 1px solid var(--border);
    margin: 0 22px;
    padding-left: 0;
    padding-right: 0;
}
.acc-panel-inner p {
    margin: 0 0 13px;
    font-size: .92rem;
    line-height: 1.75;
    color: var(--muted);
}
.acc-panel-inner p:last-child { margin-bottom: 0; }
.acc-panel-inner b { color: var(--text); }
.acc-panel-inner a { color: var(--accent); font-weight: 600; }
.note-box {
    background: var(--accent-soft);
    border-radius: var(--r-md);
    padding: 14px 18px;
    margin-top: 14px;
}
.note-box .note-title {
    display: block;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
    font-size: .85rem;
}
.note-box p { margin: 0; font-size: .84rem; }
.final-thanks { font-style: italic; color: var(--text); }

/* Aviso de uso sin conexión (PWA) de autor.html.
   Todo lo que se pinta aquí lo rellena js/offline-status.js: el punto de
   estado, la barra de progreso, la lista de lo que hay guardado y los botones. */
.rc-offline {
    margin-top: 16px;
    padding: 18px;
    border: 1.5px solid var(--border);
    border-radius: var(--r-md);
    background: var(--bg-soft, transparent);
}
.rc-offline-cabecera {
    display: flex;
    align-items: center;
    gap: 10px;
}
.rc-offline-punto {
    width: 11px;
    height: 11px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--border);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 0%, transparent);
}
.rc-offline-punto--ok { background: #2f9e5f; box-shadow: 0 0 0 4px rgba(47, 158, 95, .16); }
.rc-offline-punto--aviso { background: #d98b1f; box-shadow: 0 0 0 4px rgba(217, 139, 31, .16); }
.rc-offline-texto { font-weight: 600; font-size: .92rem; }
.rc-offline-barra {
    height: 7px;
    margin: 14px 0 4px;
    border-radius: 99px;
    background: var(--border);
    overflow: hidden;
}
.rc-offline-barra > span {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: var(--accent);
    transition: width .25s ease;
}
.rc-offline-lista {
    list-style: none;
    margin: 14px 0 0;
    padding: 0;
    display: grid;
    gap: 8px;
}
.rc-offline-lista li {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: .86rem;
    color: var(--text);
}
.rc-offline-lista i { font-size: 17px; }
.rc-offline-lista .rc-ok { color: #2f9e5f; }
.rc-offline-lista .rc-pendiente { color: #d98b1f; }
.rc-offline-acciones {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 18px;
}
.rc-offline-acciones .btn { height: 46px; font-size: .88rem; padding: 0 22px; }
.rc-offline-acciones .btn[disabled] { opacity: .6; cursor: progress; transform: none; }
.rc-offline-pie {
    margin: 14px 0 0;
    font-size: .8rem;
    color: var(--text-soft, var(--text));
    opacity: .85;
}
.rc-offline-pie:empty { display: none; }
.license-line img { max-width: 1em; max-height: 1em; margin-left: .2em; vertical-align: middle; }
/* Formularios */
.docs-wrap { max-width: 1100px; margin: 0 auto clamp(3rem, 8vw, 5rem); }
.docs-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.doc-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px) saturate(1.3);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.doc-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent);
}
.doc-title {
    font-family: var(--font-display);
    font-weight: 400;
    font-synthesis: none;
    font-size: 1.5rem;
    margin: 0 0 14px;
    text-align: center;
    color: var(--text);
}
.iframe-container {
    width: 100%;
    height: 350px;
    border-radius: var(--r-md);
    overflow: hidden;
    border: 1px solid var(--border);
    background: #fff;
    margin-bottom: 14px;
}
.iframe-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    transform: scale(0.95);
    transform-origin: center top;
}

/* Boton de "Ver vista previa" (formulario.html). Sustituye al iframe hasta que
   se pulsa: la caja mantiene el alto de 350 px para que la tarjeta no cambie
   de tamaño al cargar la vista previa. */
.preview-btn {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0;
    background: transparent;
    border: 0;
    cursor: pointer;
    color: var(--muted);
    font-family: inherit;
    font-size: .85rem;
    transition: color .18s ease, background-color .18s ease;
}
.preview-btn i {
    font-size: 1.7rem;
    line-height: 1;
}
.preview-btn:hover,
.preview-btn:focus-visible {
    color: var(--text);
    background: rgba(127, 127, 127, .07);
}
[data-theme="dark"] .preview-btn:hover,
[data-theme="dark"] .preview-btn:focus-visible {
    background: rgba(255, 255, 255, .05);
}
[data-theme="dark"] .iframe-container { border-color: rgba(255, 255, 255, 0.12); opacity: .9; }
.doc-desc {
    font-size: .8rem;
    color: var(--muted);
    text-align: center;
    margin-bottom: 16px;
    line-height: 1.55;
    flex-grow: 1;
}
.doc-btn {
    align-self: center;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    font-size: .78rem;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: .5px;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid var(--accent);
    border-radius: 999px;
    transition: all var(--transition);
}
.doc-btn:hover {
    background: var(--accent);
    color: var(--accent-text-on);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(79, 70, 229, .3);
}
@media (max-width: 1100px) {
    .docs-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 680px) {
    .docs-grid { grid-template-columns: 1fr; }
}
/* ===== Topbar: sin buscador en movil ===== */
@media (max-width: 900px) {
    .topbar-search { display: none; }
}
/* ============================================================
   MODALES — opciones con switch (compartido: simbolos + circulo)
   ============================================================ */
.config-modal-content {
    padding: 6px 0 14px;
}

.config-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 13px 0;
    border-bottom: 1px solid var(--border);
}

.config-option:last-child {
    border-bottom: none;
}

.config-label {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.config-title {
    font-weight: 600;
    font-size: 15px;
    color: var(--text);
}

.config-desc {
    font-size: 12px;
    color: var(--muted);
}

.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: var(--surface-2);
    border: 1px solid var(--border);
    transition: .25s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 17px;
    width: 17px;
    left: 3px;
    bottom: 2.5px;
    background-color: var(--muted);
    transition: .25s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--accent-soft);
    border-color: var(--accent);
}

input:checked + .slider:before {
    transform: translateX(21px);
    background-color: var(--accent);
}

.modal-primary-btn {
    width: 100%;
    background: var(--accent-soft);
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 999px;
    padding: 14px;
    font-family: inherit;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all .25s ease;
}

.modal-primary-btn:hover {
    background: var(--accent);
    color: var(--accent-text-on);
    transform: translateY(-1px);
}

.modal-primary-btn:active {
    transform: scale(.98);
}

/* ====== Chip de sintaxis (popover de ayuda junto a Variable) ====== */
.rc-var-row { display: flex; gap: 8px; align-items: stretch; justify-content: space-between; }
.rc-var-row .eq-select-wrap, .rc-var-row .drv-select-wrap, .rc-var-row .int-select-wrap { flex: 1 1 auto; }
.rc-var-row .eq-field-select, .rc-var-row .drv-field-select, .rc-var-row .int-field-select { width: 100%; font-weight: 500; text-align: left; }
.rc-sintaxis-chip {
    width: 46px; height: 46px; align-self: center; flex: none;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--border); border-radius: 50%; background: var(--surface-2);
    color: var(--muted); font-size: 1.15rem; font-weight: 700; cursor: pointer;
    transition: background .2s, color .2s, border-color .2s;
}
.rc-sintaxis-chip:hover { color: var(--text); border-color: var(--accent); background: var(--surface); }
.rc-sintaxis-titulo { font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.rc-sintaxis-item { display: flex; align-items: baseline; gap: 10px; padding: 3px 0; font-size: .82rem; }
.rc-sintaxis-sym { flex: none; min-width: 92px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .8rem; color: var(--text); }
.rc-sintaxis-desc { color: var(--muted); }
.rc-sintaxis-nota { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border); font-size: .78rem; color: var(--muted); }
.modal-sintaxis-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 22px; margin: 4px 0 10px; }
.modal-sintaxis-grid .rc-sintaxis-sym { min-width: 0; }
.modal-sintaxis-list { list-style: none; margin: 4px 0 14px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.modal-sintaxis-list .rc-sintaxis-item { display: flex; align-items: center; gap: 13px; padding: 12px 16px; border-radius: 14px; border: 1px solid transparent; color: var(--text); font-weight: 600; font-size: .93rem; transition: all var(--transition); }
.modal-sintaxis-list .rc-sintaxis-item > i { font-size: 20px; color: var(--accent); flex-shrink: 0; }
.modal-sintaxis-list .rc-sintaxis-sym { flex: 1 1 auto; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; font-weight: 600; color: var(--text); }
.modal-sintaxis-list .rc-sintaxis-desc { flex-shrink: 0; font-style: normal; font-size: .62rem; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); background: var(--surface-2); padding: 4px 9px; border-radius: var(--r-sm); white-space: nowrap; }
.modal-sintaxis-list .rc-sintaxis-item:hover { background: var(--accent-soft); border-color: var(--accent); }
/* Vista previa en notacion matematica (la dibuja MathLive desde
   js/components.js a partir del atributo data-tex de cada fila). */
.modal-sintaxis-list .rc-sintaxis-preview {
    flex: 0 1 auto;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 3px 10px 5px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-2);
    font-size: .95rem;
    line-height: 1.25;
}
.rc-sintaxis-cat { margin-top: 8px; padding-bottom: 4px; border-bottom: 1px dashed var(--border); font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.rc-sintaxis-cat:first-child { margin-top: 0; }
@media (max-width: 560px) {
    .modal-sintaxis-grid { grid-template-columns: 1fr; }
    .modal-sintaxis-list .rc-sintaxis-item { flex-wrap: wrap; gap: 10px; padding: 11px 14px; }
    .modal-sintaxis-list .rc-sintaxis-desc { margin-left: auto; }
    /* En movil la vista previa pasa a ocupar toda la fila para que el comando
       no quede enANO ni la etiqueta se monte encima. */
    .modal-sintaxis-list .rc-sintaxis-preview { order: 3; flex: 1 0 100%; }
}


@media (max-width: 900px) {
    .content.home { padding-left: 12px; padding-right: 12px; }
    .content.home .section-carousel { padding-left: 0; padding-right: 0; }
}

/* ============ TOAST UNIFICADO (ecuaciones / derivadas / integrales) ============ */
.toast-copiado {
    position: fixed; bottom: 26px; left: 50%;
    display: flex; align-items: center; gap: 10px;
    max-width: min(92vw, 420px);
    padding: 9px 18px 9px 9px;
    border-radius: 14px;
    background: var(--glass-strong);
    border: 1px solid var(--border);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--text);
    font-size: 0.85rem; font-weight: 600;
    opacity: 0; pointer-events: none; z-index: 99999;
    transform: translateX(-50%) translateY(14px) scale(0.96);
    transition: opacity 0.22s ease, transform 0.3s cubic-bezier(0.34, 1.4, 0.5, 1);
}
.toast-copiado.show { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
.toast-copiado .toast-icono {
    width: 30px; height: 30px; flex: none;
    display: flex; align-items: center; justify-content: center;
    border-radius: 10px; font-size: 16px;
    background: var(--accent-soft); color: var(--accent);
}
.toast-copiado .toast-texto { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toast-copiado.toast-ok .toast-icono { background: rgba(46, 160, 67, 0.16); color: #2e9e4f; }
[data-theme="dark"] .toast-copiado.toast-ok .toast-icono { background: rgba(110, 231, 160, 0.14); color: #6ee7a0; }
.toast-copiado.toast-error .toast-icono { background: rgba(220, 38, 38, 0.14); color: #dc2626; }
[data-theme="dark"] .toast-copiado.toast-error .toast-icono { background: rgba(248, 113, 113, 0.14); color: #f87171; }
.toast-copiado.toast-info .toast-icono { background: var(--accent-soft); color: var(--accent); }
/* No quedar debajo del teclado virtual de MathLive cuando esta abierto */
body.mathlive-keyboard-open .toast-copiado { bottom: calc(var(--mathlive-keyboard-height, 0px) + 20px); }

/* ============ ACCIONES DEL VISOR (triangulos / vectores; mismo estilo que integrales) ============ */
/* Base duplicada de css/integrales.css (.eq-preview-actions / .eq-prev-btn) porque integrales.css
   solo se carga en integrales.html; asi la barra es identica en triangulos y vectores. */
.eq-preview-actions {
    display: flex; align-items: center; justify-content: flex-end; gap: 4px;
    margin: 0 0 22px;
}
.eq-prev-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 9px;
    padding: 9px 15px; border-radius: 999px;
    border: 1px solid var(--border); background: transparent;
    color: var(--text); cursor: pointer; font-family: inherit; font-size: .82rem; font-weight: 700;
    transition: all .3s cubic-bezier(0.4, 0, 0.2, 1);
}
.eq-prev-btn i { flex-shrink: 0; font-size: 1.05rem; }
.eq-prev-btn:hover { background: var(--surface-2); border-color: var(--accent-soft); transform: translateY(-2px); }
.eq-prev-btn:active { transform: translateY(0); }
.eq-prev-btn .eq-prev-label { display: none; }
@media (min-width: 768px) {
    .eq-prev-btn .eq-prev-label { display: inline; }
}
/* En triangulos: barra propia arriba de la tarjeta; se ocultan los botones circulares viejos */
.tri-card .eq-preview-actions { margin: 0 0 18px; }
.tri-card .ref-box .icon-mini { display: none; }
/* En vectores: la barra vive dentro de .vec-card-head, sin margen extra */
.vec-card-head .eq-preview-actions { margin: 0; }

/* ============================================================
   AVISO DE COOKIES (Google Analytics)
   Se apoya en la misma piel que los toasts: mismo cristal, mismo
   borde, misma sombra. Es un toast mas, solo que este espera una
   respuesta en vez de salir solo.
   ============================================================ */

.toast-consent {
    position: fixed; bottom: 26px; left: 50%;
    z-index: 99999;
    display: flex; align-items: center; gap: 12px;
    width: max-content; max-width: min(94vw, 660px);
    padding: 10px 12px 10px 10px;
    border-radius: 14px;
    background: var(--glass-strong);
    border: 1px solid var(--border);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    color: var(--text);
    font-size: 0.85rem; font-weight: 600;
    opacity: 0; pointer-events: none;
    transform: translateX(-50%) translateY(14px) scale(0.96);
    transition: opacity 0.22s ease, transform 0.3s cubic-bezier(0.34, 1.4, 0.5, 1);
}
.toast-consent.show {
    opacity: 1;
    /* Sin esto el aviso se ve pero NO SE PUEDE PULSAR: el elemento sigue
       ignorando los clics y los botones no hacian nada. */
    pointer-events: auto;
    transform: translateX(-50%) translateY(0) scale(1);
}

/* Mientras el aviso esta en pantalla el toast de "copiado" se sube, para que
   no se pisen los dos abajo. */
body.rc-consent-visible .toast-copiado { bottom: 104px; }

.toast-consent .toast-icono {
    width: 30px; height: 30px; flex: none;
    display: flex; align-items: center; justify-content: center;
    border-radius: 10px; font-size: 16px;
    background: var(--accent-soft); color: var(--accent);
}
.toast-consent .rc-consent-txt { flex: 1 1 auto; font-weight: 500; line-height: 1.35; }
.toast-consent .rc-consent-txt a { color: var(--accent); font-weight: 600; }
.toast-consent .rc-btn {
    flex: none;
    font: inherit; font-size: 0.8rem; font-weight: 600;
    padding: 7px 14px; border-radius: 10px; cursor: pointer;
    border: 1px solid var(--border);
    background: transparent; color: var(--text);
    transition: background 0.15s ease, border-color 0.15s ease;
}
.toast-consent .rc-btn:hover { background: var(--accent-soft); }
.toast-consent .rc-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.toast-consent .rc-btn-aceptar {
    background: var(--accent); border-color: var(--accent); color: var(--accent-text-on);
}
.toast-consent .rc-btn-aceptar:hover { filter: brightness(1.08); background: var(--accent); }

@media (max-width: 640px) {
    .toast-consent {
        /* En movil la barra de navegacion va ABAJO (68 px + 14 de margen):
           el aviso se coloca encima para no taparla. En escritorio la barra va
           arriba, asi que el aviso puede bajarse a su sitio de siempre. */
        bottom: 94px; max-width: calc(100vw - 24px);
        flex-wrap: wrap; row-gap: 10px; padding: 12px;
        font-size: 0.82rem;
    }
    .toast-consent .rc-consent-txt { flex: 1 1 calc(100% - 44px); }
    .toast-consent .rc-btn { flex: 1 1 0; }
    body.rc-consent-visible .toast-copiado { bottom: 236px; }
}

/* Boton "cambiar mi decision" dentro de la politica de cookies (autor.html) */
.rc-btn-revisar-cookies {
    font: inherit; font-size: 0.85rem; font-weight: 600;
    padding: 8px 16px; border-radius: 10px; cursor: pointer;
    border: 1px solid var(--border);
    background: transparent; color: var(--text);
    transition: background 0.15s ease, border-color 0.15s ease;
}
.rc-btn-revisar-cookies:hover { background: var(--accent-soft); border-color: var(--accent); }
.rc-btn-revisar-cookies:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
