:root {
    --deep-blue: #003B73;
    --medium-blue: #0A66C2;
    --warm-yellow: #FFC107;
    --soft-yellow: #FFF7D6;
    --light-bg: #F8FAFC;
    --dark-text: #1F2937;
    --muted-text: #5B677A;
    --white: #FFFFFF;
    --border: #D8E2F0;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--light-bg);
    color: var(--dark-text);
    line-height: 1.65;
}

body.high-contrast {
    --deep-blue: #000000;
    --medium-blue: #111827;
    --warm-yellow: #FFD400;
    --soft-yellow: #111827;
    --light-bg: #000000;
    --dark-text: #FFFFFF;
    --muted-text: #F3F4F6;
    --white: #000000;
    --border: #FFD400;
    background: #000000;
    color: #FFFFFF;
}

body.high-contrast h1,
body.high-contrast .logo,
body.high-contrast .nav-menu a,
body.high-contrast .nav-menu .nav-link,
body.high-contrast .section-title h2,
body.high-contrast .card h3,
body.high-contrast .card h4,
body.high-contrast .card-icon,
body.high-contrast .visual-placeholder,
body.high-contrast .tool-card h3,
body.high-contrast .tool-icon,
body.high-contrast .step h3,
body.high-contrast .activity-content h3,
body.high-contrast .start-option,
body.high-contrast .checklist-panel h2,
body.high-contrast .tag,
body.high-contrast .pill,
body.high-contrast .pill i {
    color: #FFFFFF;
}

body.high-contrast .btn-primary {
    background: #111827;
    color: #FFD400;
}

body.high-contrast .logo-mark {
    filter: brightness(1.2) contrast(1.5);
}

body.high-contrast .step-number {
    background: #111827;
    color: #FFD400;
    border-color: #FFD400;
}

body.high-contrast footer,
body.high-contrast .start-panel {
    background: #000000;
}

body.high-contrast .visual-placeholder {
    background: #111827;
}

body.high-contrast .check-item span {
    color: #FFFFFF;
}

body.high-contrast header .nav-menu a[href*="ingresar"] {
    color: #FFD400 !important;
    border: 2px solid #FFD400;
    border-radius: 8px;
}

body[data-font-size="1"] { font-size: 80%; }
body[data-font-size="2"] { font-size: 90%; }
body[data-font-size="3"] { font-size: 100%; }
body[data-font-size="4"] { font-size: 115%; }
body[data-font-size="5"] { font-size: 130%; }
body[data-font-size="6"] { font-size: 150%; }

a, button { transition: 0.2s ease; }

a:focus, button:focus, input:focus {
    outline: 3px solid var(--warm-yellow);
    outline-offset: 3px;
}

body.underline-links a:not(.btn):not(.logo) {
    text-decoration: underline !important;
    text-decoration-thickness: 0.13em !important;
    text-underline-offset: 0.18em;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.checklist-actions { display: flex; flex-wrap: wrap; gap: 0.65rem; margin-top: 1rem; }
.checklist-progress { font-weight: 700; margin-top: 0.8rem; }
.btn-quiet { background: transparent; border: 2px solid currentColor; color: var(--deep-blue); }
.logout-form { margin: 0; }
.logout-form button { width: 100%; display: flex; align-items: center; gap: 0.5rem; padding: 0.65rem 0.9rem; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.empty-state { text-align: center; max-width: 680px; margin: 0 auto; padding: 3rem; background: #fff; border: 1px solid var(--border); border-radius: 24px; }
.empty-state svg { width: 48px; height: 48px; color: var(--deep-blue); margin: 0 auto 1rem; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media print {
    .topbar, header, footer, .hero, #discapacidad, #repositorio, #guia, #actividades, .checklist-actions { display: none !important; }
    #checklist { display: block !important; padding: 0; }
    .checklist-panel { box-shadow: none; border: 0; }
}

.skip-link {
    position: absolute;
    top: -60px;
    left: 1rem;
    background: var(--warm-yellow);
    color: var(--deep-blue);
    padding: 0.75rem 1rem;
    border-radius: 0 0 0.75rem 0.75rem;
    font-weight: 700;
    z-index: 999;
}

.skip-link:focus { top: 0; }

.container-page {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.topbar {
    background: var(--deep-blue);
    color: white;
    font-size: 0.9rem;
    padding: 0.45rem 0;
}

.topbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.accessibility-tools {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.accessibility-tools button {
    border: 1px solid rgba(255,255,255,0.7);
    background: transparent;
    color: white;
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    cursor: pointer;
    font-weight: 600;
}

.accessibility-tools button:hover {
    background: var(--warm-yellow);
    color: var(--deep-blue);
}

header {
    background: white;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 4px 16px rgba(0, 59, 115, 0.08);
}

body.high-contrast header { background: #000; }

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    min-height: 82px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--deep-blue);
    text-decoration: none;
    font-weight: 800;
    font-size: 1.25rem;
    line-height: 1.1;
    min-width: 240px;
}

.logo-mark {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    flex: 0 0 auto;
    object-fit: contain;
}

.nav-menu {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.3rem;
    flex: 1;
}

.nav-menu a {
    color: var(--deep-blue);
    text-decoration: none;
    font-weight: 650;
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
    font-size: 0.95rem;
}

.nav-menu a:hover, .nav-menu a[aria-current="page"] {
    background: var(--soft-yellow);
    color: var(--deep-blue);
}

.nav-menu .nav-link {
    color: var(--deep-blue);
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-weight: 650;
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    text-decoration: none;
    white-space: nowrap;
}

.nav-menu .nav-link:hover,
.nav-item-has-submenu.current > .nav-link {
    background: var(--soft-yellow);
    color: var(--deep-blue);
}

.nav-item-has-submenu {
    position: relative;
}

.submenu-arrow {
    transition: transform 0.2s ease;
}

.submenu-toggle[aria-expanded="true"] .submenu-arrow {
    transform: rotate(180deg);
}

.submenu {
    display: none;
}

@media (min-width: 1051px) {
    .nav-item-has-submenu:hover .submenu,
    .nav-item-has-submenu:focus-within .submenu {
        display: flex;
    }

    .nav-item-has-submenu > .submenu {
        position: absolute;
        top: 100%;
        left: 50%;
        transform: translateX(-50%);
        background: white;
        border: 1px solid var(--border);
        border-radius: 12px;
        padding: 0.5rem;
        min-width: 200px;
        box-shadow: 0 10px 30px rgba(0,59,115,0.12);
        flex-direction: column;
        gap: 0.25rem;
        z-index: 50;
    }

    .nav-item-has-submenu > .submenu a {
        white-space: nowrap;
        padding: 0.65rem 1rem;
        font-size: 0.9rem;
    }

    body.high-contrast .nav-item-has-submenu > .submenu {
        background: #000;
        border-color: #FFD400;
    }

    body.high-contrast .submenu a {
        color: #FFFFFF;
    }
}

.nav-item-has-submenu.open .submenu {
    display: flex;
}

/* ── User dropdown menu (logged-in user) ── */
.dropdown-user {
    position: relative;
    display: inline-block;
}

.dropdown-user-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.75rem;
    background: #EAF4FF;
    border: none;
    border-radius: 8px;
    color: var(--deep-blue);
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    font-family: inherit;
}

.dropdown-user-btn:hover {
    background: var(--soft-yellow);
}

.dropdown-user-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 6px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.5rem;
    min-width: 210px;
    box-shadow: 0 10px 30px rgba(0,59,115,0.12);
    z-index: 50;
}

.dropdown-user-menu.open {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.dropdown-user-menu a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1rem;
    color: var(--dark-text);
    text-decoration: none;
    font-size: 0.9rem;
    border-radius: 8px;
    white-space: nowrap;
}

.dropdown-user-menu a:hover {
    background: var(--soft-yellow);
    color: var(--deep-blue);
}

.dropdown-user-menu a:last-child {
    color: #DC2626;
}

.dropdown-user-menu a:last-child:hover {
    background: #FEE2E2;
    color: #DC2626;
}

.dropdown-user-btn[aria-expanded="true"] .submenu-arrow {
    transform: rotate(180deg);
}

body.high-contrast .dropdown-user-btn {
    background: #000;
    color: #FFD400;
    border: 2px solid #FFD400;
    border-radius: 8px;
}

body.high-contrast .dropdown-user-btn:hover {
    background: #111827;
}

body.high-contrast .dropdown-user-menu {
    background: #000;
    border-color: #FFD400;
}

body.high-contrast .dropdown-user-menu a {
    color: #FFF;
}

body.high-contrast .dropdown-user-menu a:hover {
    background: #111827;
    color: #FFD400;
}

body.high-contrast .dropdown-user-menu a:last-child {
    color: #FFD400;
}

body.high-contrast .dropdown-user-menu a:last-child:hover {
    background: #111827;
    color: #FFD400;
}

@media (max-width: 1050px) {
    .nav-menu .dropdown-user {
        width: 100%;
    }

    .dropdown-user-btn {
        width: 100%;
        padding: 1rem 1.25rem;
        font-size: 1.1rem;
        border-radius: 14px;
        background: transparent;
        border-bottom: 1px solid var(--border);
        justify-content: space-between;
    }

    .dropdown-user-btn:hover {
        background: transparent;
    }

    .nav-menu.active .dropdown-user-btn {
        display: flex;
    }

    .dropdown-user-menu {
        position: static;
        box-shadow: none;
        border: none;
        border-radius: 0;
        padding: 0;
        padding-left: 1rem;
        background: transparent;
        min-width: auto;
        margin-top: 0;
    }

    .dropdown-user-menu a {
        padding: 0.8rem 1.25rem;
        font-size: 0.95rem;
        border-bottom: 1px solid var(--border);
        border-radius: 0;
    }

    .dropdown-user-menu a:last-child {
        border-bottom: none;
    }

    .dropdown-user-btn[aria-expanded="true"] .submenu-arrow {
        transform: none;
    }

    body.high-contrast .dropdown-user-btn {
        background: transparent;
        border: none;
        border-bottom: 1px solid #FFD400;
        color: #FFF;
        border-radius: 0;
    }

    body.high-contrast .nav-menu.active .dropdown-user-btn {
        border-bottom-color: #FFD400;
    }
}

.search-button {
    border: 2px solid var(--deep-blue);
    color: var(--deep-blue);
    background: white;
    border-radius: 999px;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    cursor: pointer;
}

body.high-contrast .search-button { background: #000; color: #fff; border-color: #FFD400; }

.hero {
    background:
        radial-gradient(circle at left top, rgba(10,102,194,0.13), transparent 35%),
        linear-gradient(135deg, #FFFFFF 0%, #F8FAFC 58%, #EAF4FF 100%);
    padding: 4.5rem 0 3.5rem;
}

body.high-contrast .hero { background: #000; }

.hero-grid {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 3rem;
    align-items: center;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: var(--warm-yellow);
    color: var(--deep-blue);
    border-radius: 999px;
    padding: 0.45rem 0.95rem;
    font-size: 0.9rem;
    font-weight: 800;
    width: fit-content;
    margin-bottom: 1.2rem;
}

h1 {
    font-size: clamp(2.25rem, 5vw, 4.2rem);
    line-height: 1.05;
    margin: 0 0 1.2rem;
    color: var(--deep-blue);
    letter-spacing: -0.04em;
}

.hero p {
    font-size: 1.18rem;
    color: var(--muted-text);
    margin: 0 0 1.6rem;
    max-width: 710px;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.btn {
    border: 0;
    border-radius: 14px;
    padding: 0.95rem 1.25rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    text-decoration: none;
    cursor: pointer;
    min-height: 48px;
}

.btn-primary {
    background: var(--deep-blue);
    color: white;
    box-shadow: 0 10px 24px rgba(0, 59, 115, 0.18);
}

.btn-primary:hover { background: var(--medium-blue); transform: translateY(-2px); }

.btn-secondary {
    background: var(--warm-yellow);
    color: var(--deep-blue);
    box-shadow: 0 10px 24px rgba(255, 193, 7, 0.24);
}

.btn-secondary:hover { filter: brightness(0.97); transform: translateY(-2px); }

.hero-note {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    color: var(--muted-text);
    font-size: 0.98rem;
    max-width: 650px;
}

.hero-visual {
    position: relative;
}

.visual-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 30px;
    padding: 1rem;
    box-shadow: 0 24px 55px rgba(0,59,115,0.15);
    overflow: hidden;
}

body.high-contrast .visual-card { background: #000; border-color: #FFD400; }

.visual-placeholder {
    min-height: 390px;
    border-radius: 22px;
    background:
        linear-gradient(rgba(0,59,115,0.1), rgba(0,59,115,0.1)),
        linear-gradient(135deg, #DCEEFF, #FFF4C2);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    color: var(--deep-blue);
}

.visual-placeholder i { margin-bottom: 1rem; }

.floating-card {
    position: absolute;
    right: -18px;
    bottom: 28px;
    background: white;
    border-left: 6px solid var(--warm-yellow);
    border-radius: 18px;
    padding: 1.15rem;
    width: min(280px, 85%);
    box-shadow: 0 18px 35px rgba(0,59,115,0.18);
    font-weight: 750;
    color: var(--deep-blue);
}

body.high-contrast .floating-card { background: #000; color: #fff; border: 2px solid #FFD400; }

section { padding: 4rem 0; }

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 1rem;
    margin-bottom: 2rem;
}

.section-title h2 {
    margin: 0;
    color: var(--deep-blue);
    font-size: clamp(1.8rem, 3vw, 2.45rem);
    line-height: 1.1;
}

.section-title p {
    margin: 0.5rem 0 0;
    color: var(--muted-text);
    max-width: 720px;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.2rem;
}

.card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 1.4rem;
    box-shadow: 0 10px 28px rgba(0,59,115,0.07);
}

body.high-contrast .card { background: #000; border-color: #FFD400; }

.card:hover { transform: translateY(-4px); box-shadow: 0 18px 35px rgba(0,59,115,0.12); }

.card-icon {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: #EAF4FF;
    color: var(--deep-blue);
    margin-bottom: 1rem;
}

.card:nth-child(even) .card-icon { background: var(--soft-yellow); }

.card h3, .card h4 {
    margin: 0 0 0.55rem;
    color: var(--deep-blue);
    line-height: 1.25;
}

.card p { margin: 0; color: var(--muted-text); }

.start-panel {
    background: var(--deep-blue);
    color: white;
    border-radius: 28px;
    padding: 2rem;
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 1.5rem;
    align-items: center;
    box-shadow: 0 22px 45px rgba(0,59,115,0.2);
}

.start-panel h2 { color: white; margin: 0 0 0.6rem; }
.start-panel p { color: rgba(255,255,255,0.88); margin: 0; }

.start-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.start-option {
    background: white;
    color: var(--deep-blue);
    border-radius: 18px;
    padding: 1.1rem;
    text-decoration: none;
    font-weight: 800;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    min-height: 120px;
}

.start-option:hover { background: var(--warm-yellow); transform: translateY(-3px); }

.tools-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.3rem;
}

.tool-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 1.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    height: 100%;
    box-shadow: 0 10px 26px rgba(0,59,115,0.07);
    overflow: hidden;
}

.tool-card * {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.tool-card p {
    margin: 0;
    color: var(--muted-text);
    font-size: 0.97rem;
}

.tool-card p:first-of-type {
    flex: 1;
}

.tool-card .tag {
    flex-shrink: 0;
}

body.high-contrast .tool-card { background: #000; border-color: #FFD400; }

.tool-top {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.tool-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: var(--soft-yellow);
    display: grid;
    place-items: center;
    color: var(--deep-blue);
    flex-shrink: 0;
}

.tool-card h3 { margin: 0; color: var(--deep-blue); font-size: 1.15rem; }

.tag {
    display: inline-flex;
    width: fit-content;
    background: #EAF4FF;
    color: var(--deep-blue);
    border-radius: 999px;
    padding: 0.25rem 0.65rem;
    font-weight: 800;
    font-size: 0.82rem;
}

.steps-wrap {
    background: white;
    border: 1px solid var(--border);
    border-radius: 28px;
    padding: 2rem;
    box-shadow: 0 12px 28px rgba(0,59,115,0.07);
}

body.high-contrast .steps-wrap { background: #000; border-color: #FFD400; }

.steps-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
}

.step {
    text-align: center;
    position: relative;
}

.step-number {
    width: 54px;
    height: 54px;
    border-radius: 999px;
    margin: 0 auto 1rem;
    background: var(--deep-blue);
    color: white;
    display: grid;
    place-items: center;
    font-weight: 900;
    font-size: 1.35rem;
    border: 4px solid #EAF4FF;
}

.step:nth-child(even) .step-number {
    background: var(--warm-yellow);
    color: var(--deep-blue);
}

.step h3 { font-size: 1.02rem; margin: 0 0 0.4rem; color: var(--deep-blue); }
.step p { font-size: 0.9rem; margin: 0; color: var(--muted-text); }

.activities-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.3rem;
}

.activity-card {
    background: white;
    border-radius: 24px;
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: 0 12px 28px rgba(0,59,115,0.08);
}

body.high-contrast .activity-card { background: #000; border-color: #FFD400; }

.activity-image {
    min-height: 150px;
    background: linear-gradient(135deg, #EAF4FF, #FFF7D6);
    display: grid;
    place-items: center;
    color: var(--deep-blue);
}

.activity-content { padding: 1.3rem; }
.activity-content h3 { margin: 0.55rem 0; color: var(--deep-blue); }
.activity-content p { margin: 0; color: var(--muted-text); }

.meta {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
    color: var(--muted-text);
    font-size: 0.9rem;
}

.checklist-panel {
    background: linear-gradient(135deg, #FFF7D6, #FFFFFF);
    border: 2px solid var(--warm-yellow);
    border-radius: 28px;
    padding: 2rem;
    display: grid;
    grid-template-columns: 0.9fr 1.4fr;
    gap: 2rem;
    align-items: start;
}

body.high-contrast .checklist-panel { background: #000; border-color: #FFD400; }

.checklist-panel h2 { color: var(--deep-blue); margin: 0 0 0.75rem; }
.checklist-panel p { color: var(--muted-text); margin: 0 0 1.4rem; }

.checklist-items {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.9rem 1.2rem;
}

.check-item {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    background: rgba(255,255,255,0.65);
    border-radius: 14px;
    padding: 0.75rem;
}

body.high-contrast .check-item { background: #111827; }

.check-item input {
    width: 20px;
    height: 20px;
    margin-top: 0.2rem;
    accent-color: var(--deep-blue);
    flex-shrink: 0;
}

.check-item span { font-weight: 650; }

footer {
    background: var(--deep-blue);
    color: white;
    padding: 3rem 0 1.5rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr 1.2fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

footer h3 {
    color: var(--warm-yellow);
    margin: 0 0 0.9rem;
    font-size: 1.05rem;
}

footer p, footer a, footer li {
    color: rgba(255,255,255,0.88);
    font-size: 0.95rem;
}

footer a { text-decoration: none; }
footer a:hover { color: var(--warm-yellow); }
footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.2);
    padding-top: 1.2rem;
    text-align: center;
    font-weight: 700;
}

@media (max-width: 1050px) {
    .hero-grid, .start-panel, .checklist-panel { grid-template-columns: 1fr; }
    .cards-grid, .tools-grid { grid-template-columns: repeat(2, 1fr); }
    .steps-grid { grid-template-columns: repeat(2, 1fr); }
    .activities-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
    .nav-menu { display: none; }
    .nav-toggle {
        display: flex !important;
        position: fixed;
        top: 1rem;
        right: 1rem;
        z-index: 200;
        background: var(--deep-blue);
        color: white;
        border-color: var(--deep-blue);
    }
}

.admin-link {
    font-size: 0.75rem;
    opacity: 0.4;
    order: 10;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 0.25rem;
    padding-top: 0.25rem;
}
.admin-link:hover { opacity: 0.7; }

@media (max-width: 680px) {
    .topbar-content, .header-content { flex-direction: column; align-items: flex-start; }
    .logo { min-width: 0; }
    .cards-grid, .tools-grid, .start-options, .checklist-items, .footer-grid { grid-template-columns: 1fr; }
    .hero { padding-top: 3rem; }
    .floating-card { position: static; margin-top: 1rem; width: 100%; }
}

/* Mobile menu toggle */
.nav-toggle {
    display: none;
    background: none;
    border: 2px solid var(--deep-blue);
    color: var(--deep-blue);
    border-radius: 10px;
    width: 42px;
    height: 42px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
    position: relative;
    z-index: 100;
}

.nav-toggle:hover {
    background: var(--soft-yellow);
}

.nav-toggle-label {
    display: none;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.nav-toggle .close-icon {
    display: none;
}

.nav-toggle[aria-expanded="true"] .menu-icon {
    display: none;
}

.nav-toggle[aria-expanded="true"] .close-icon {
    display: block;
}

@media (max-width: 1050px) {
    .nav-toggle {
        gap: 0.35rem;
        width: auto;
        padding: 0.5rem 0.85rem;
        border-radius: 12px;
    }

    .nav-toggle-label {
        display: inline;
    }
}

body.high-contrast .nav-toggle {
    background: #000;
    color: #fff;
    border-color: #FFD400;
}

body.high-contrast .nav-menu.active {
    background: #000;
}

@media (max-width: 1050px) {
    body.high-contrast .nav-menu a,
    body.high-contrast .nav-menu .nav-link {
        border-bottom-color: #FFD400;
    }
}

/* Desktop: explicitly hide hamburger */
@media (min-width: 1051px) {
    .nav-toggle { display: none !important; }
}

/* Tablet & mobile: show hamburger, nav-menu as overlay */
@media (max-width: 1050px) {
    .nav-menu {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: white;
        z-index: 99;
        flex-direction: column;
        padding: 5.5rem 1.5rem 2rem;
        gap: 0.25rem;
        overflow-y: auto;
        justify-content: flex-start;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu a,
    .nav-menu .nav-link {
        font-size: 1.1rem;
        padding: 1rem 1.25rem;
        border-radius: 14px;
        border-bottom: 1px solid var(--border);
        width: 100%;
        text-align: left;
        white-space: normal;
    }

    .nav-menu a:last-child {
        border-bottom: none;
    }

    .nav-menu .nav-link {
        justify-content: space-between;
    }

    .nav-item-has-submenu.open > .nav-link {
        border-bottom: none;
    }

    .nav-item-has-submenu .submenu {
        position: static;
        box-shadow: none;
        border: none;
        border-radius: 0;
        padding: 0;
        padding-left: 1rem;
        background: transparent;
        flex-direction: column;
        transform: none;
        left: auto;
        min-width: auto;
    }

    .nav-item-has-submenu .submenu a {
        padding: 0.8rem 1.25rem;
        font-size: 0.95rem;
        border-bottom: 1px solid var(--border);
    }

    .nav-item-has-submenu .submenu a:last-child {
        border-bottom: none;
    }

    body.menu-open {
        overflow: hidden;
    }
}

/* Narrador por voz */
.narrar-btn {
    display: inline-flex !important;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.6rem;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 8px;
    background: transparent;
    color: white;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.narrar-btn:hover {
    background: rgba(255,255,255,0.15);
}

.narrar-btn.narrar-activo {
    background: rgba(239, 68, 68, 0.3);
    border-color: rgba(239, 68, 68, 0.6);
}

.btn-narrar {
    transition: all 0.2s;
}

.btn-narrar:hover {
    background: #EAF4FF !important;
    border-color: var(--deep-blue) !important;
}

.btn-narrar[data-leyendo="true"] {
    background: #FEE2E2 !important;
    border-color: #DC2626 !important;
    color: #DC2626 !important;
}

/* Modo leer al señalar */
.hover-read-mode *:hover {
    outline: 2px dashed #6366f1;
    outline-offset: 2px;
}

.hover-read-mode *:focus {
    outline: 3px solid #6366f1;
    outline-offset: 3px;
}

.hover-read-mode .narrar-btn:hover,
.hover-read-mode .narrar-btn:focus,
.hover-read-mode .btn-narrar:hover,
.hover-read-mode .btn-narrar:focus {
    outline: none !important;
}
