/*
 * COCEMFE Ceuta - Widget de Accesibilidad propio (accessibility-widget.css)
 *
 * Prefijo "cam-" (COCEMFE Accesibilidad Menú) para no chocar con el resto de estilos.
 * Todas las clases de modo se aplican sobre <html> desde js/accessibility-widget.js.
 * El propio widget vive en #cam-widget (hijo directo de <body>) y se excluye
 * de los ajustes de página para que siempre sea legible y utilizable.
 */

:root {
    --cam-primary: #003c68;
    --cam-primary-dark: #002847;
    --cam-primary-light: #e6eff7;
    --cam-accent: #ff9c33;
    --cam-accent-dark: #b85c00;
    --cam-text: #1d2733;
    --cam-muted: #4a5a6a;
    --cam-surface: #ffffff;
    --cam-surface-alt: #f2f6fa;
    --cam-border: #c9d6e3;
    --cam-success: #1d6b3a;
    --cam-error: #a4161a;
    --cam-focus: #ff9c33;
    --cam-radius: 16px;
    --cam-font: 'Outfit', 'Roboto', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --cam-z: 2147483000;
}

/* ==========================================================================
   1. MEJORAS TRANSVERSALES (siempre activas)
   ========================================================================== */

/* Enlace "Saltar al contenido" */
.cam-skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: calc(var(--cam-z) + 5);
    padding: 14px 22px;
    background: var(--cam-primary);
    color: #fff !important;
    font-family: var(--cam-font);
    font-weight: 700;
    font-size: 1.05rem;
    border-radius: 10px;
    border: 3px solid var(--cam-accent);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
    transform: translateY(-160%);
    transition: transform .2s ease;
    text-decoration: underline;
}

.cam-skip-link:focus,
.cam-skip-link:focus-visible {
    transform: translateY(0);
    outline: 3px solid #fff;
    outline-offset: 2px;
}

#contenido-principal:focus {
    outline: none;
}

/* Texto solo para lectores de pantalla */
.cam-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Foco visible y claramente identificable en toda la web */
body :focus-visible {
    outline: 3px solid var(--cam-focus) !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 0 6px var(--cam-primary) !important;
    border-radius: 4px;
}

/* Menús desplegables accesibles con teclado (escritorio) */
@media (min-width: 769px) {
    .nav-item:focus-within .dropdown-menu,
    .nav-item.cam-open .dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        /* visibility cambia al instante para que el teclado pueda entrar en el submenú */
        transition-property: opacity, transform;
    }

    .nav-item:focus-within .dropdown-menu *,
    .nav-item.cam-open .dropdown-menu * {
        transition-property: color, background-color, border-color, padding;
    }

    .custom-language-selector:focus-within .lang-dropdown-menu {
        opacity: 1;
        visibility: visible;
    }
}

/* Mensajes de error de formularios: icono + texto, nunca solo color */
.cam-field-error {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 6px;
    padding: 8px 12px;
    background: #fdecea;
    color: var(--cam-error) !important;
    border-left: 4px solid var(--cam-error);
    border-radius: 6px;
    font-size: .95rem;
    font-weight: 600;
    line-height: 1.4;
}

.cam-field-error::before {
    content: "!";
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--cam-error);
    color: #fff;
    font-size: .8rem;
    font-weight: 800;
}

[aria-invalid="true"] {
    border: 2px solid var(--cam-error) !important;
    background-image: repeating-linear-gradient(135deg, rgba(164, 22, 26, .06) 0 6px, transparent 6px 12px) !important;
}

.cam-error-summary {
    margin: 0 0 22px;
    padding: 16px 20px;
    background: #fff;
    color: var(--cam-error);
    border: 3px solid var(--cam-error);
    border-radius: 10px;
    font-size: 1rem;
}

.cam-error-summary h2 {
    color: var(--cam-error);
    font-size: 1.15rem;
    margin-bottom: 8px;
}

.cam-error-summary ul {
    list-style: disc;
    padding-left: 22px;
}

.cam-error-summary a {
    color: var(--cam-error);
    text-decoration: underline;
    font-weight: 600;
}

/* Avisos de vídeo sin subtítulos / enlace a transcripción */
.cam-media-note {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 8px 0 16px;
    padding: 10px 14px;
    background: var(--cam-primary-light);
    color: var(--cam-primary-dark);
    border-left: 4px solid var(--cam-primary);
    border-radius: 6px;
    font-size: .95rem;
}

.cam-media-note a {
    font-weight: 700;
    text-decoration: underline;
}

/* Texto alternativo visible cuando se ocultan imágenes */
.cam-alt-text {
    display: none;
}

/* ==========================================================================
   2. BOTÓN FLOTANTE (FAB) ANIMADO
   ========================================================================== */

#cam-widget,
#cam-widget * {
    box-sizing: border-box;
}

#cam-widget {
    font-family: var(--cam-font);
    line-height: 1.4;
    letter-spacing: normal;
    word-spacing: normal;
    text-align: left;
}

.cam-fab {
    position: fixed;
    left: 20px;
    bottom: 22px;
    z-index: var(--cam-z);
    display: flex;
    align-items: center;
    gap: 0;
    height: 68px;
    min-width: 68px;
    padding: 0;
    border: 3px solid #fff;
    border-radius: 999px;
    background: linear-gradient(135deg, #0a5c9a 0%, var(--cam-primary) 55%, var(--cam-primary-dark) 100%);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 10px 28px rgba(0, 40, 71, .45), 0 0 0 0 rgba(255, 156, 51, .7);
    font: inherit;
    animation: cam-fab-enter .7s cubic-bezier(.2, 1.4, .4, 1) both, cam-fab-float 4s ease-in-out 1s infinite;
    transition: box-shadow .25s ease, background .25s ease, padding .3s ease;
}

.cam-fab::before,
.cam-fab::after {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    border: 3px solid var(--cam-accent);
    pointer-events: none;
    animation: cam-fab-pulse 2.6s ease-out infinite;
}

.cam-fab::after {
    animation-delay: 1.3s;
}

.cam-fab__icon {
    position: relative;
    flex: 0 0 62px;
    width: 62px;
    height: 62px;
    display: grid;
    place-items: center;
}

.cam-fab__icon svg {
    width: 40px;
    height: 40px;
    /* Giro lento y suave al pasar el ratón */
    transition: transform 900ms ease-in-out;
}

.cam-fab__label {
    max-width: 0;
    overflow: hidden;
    white-space: nowrap;
    font-size: 1.05rem;
    font-weight: 700;
    opacity: 0;
    transition: max-width .35s ease, opacity .25s ease, padding .35s ease;
}

.cam-fab:hover,
.cam-fab:focus-visible,
.cam-fab.cam-fab--intro {
    background: linear-gradient(135deg, #0d6db5 0%, #004b82 60%, var(--cam-primary) 100%);
    box-shadow: 0 14px 34px rgba(0, 40, 71, .55);
}

.cam-fab:hover .cam-fab__label,
.cam-fab:focus-visible .cam-fab__label,
.cam-fab.cam-fab--intro .cam-fab__label {
    max-width: 220px;
    opacity: 1;
    padding-right: 22px;
}

.cam-fab:hover .cam-fab__icon svg,
.cam-fab:focus-visible .cam-fab__icon svg {
    transform: rotate(360deg) scale(1.08);
}

.cam-fab:active {
    transform: scale(.95);
}

.cam-fab[aria-expanded="true"] {
    animation: none;
    background: var(--cam-primary-dark);
}

.cam-fab[aria-expanded="true"]::before,
.cam-fab[aria-expanded="true"]::after {
    display: none;
}

/* Contador de ajustes activos */
.cam-fab__badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 26px;
    height: 26px;
    padding: 0 6px;
    display: none;
    place-items: center;
    background: var(--cam-accent);
    color: #1a1a1a;
    border: 2px solid #fff;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 800;
    animation: cam-pop .4s cubic-bezier(.3, 1.6, .5, 1);
}

.cam-fab__badge.is-visible {
    display: grid;
}

@keyframes cam-fab-enter {
    0% { transform: translateY(120px) scale(.4) rotate(-90deg); opacity: 0; }
    100% { transform: translateY(0) scale(1) rotate(0); opacity: 1; }
}

@keyframes cam-fab-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

@keyframes cam-fab-pulse {
    0% { transform: scale(1); opacity: .85; }
    80%, 100% { transform: scale(1.65); opacity: 0; }
}

@keyframes cam-pop {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

/* ==========================================================================
   3. PANEL
   ========================================================================== */

.cam-backdrop {
    position: fixed;
    inset: 0;
    z-index: calc(var(--cam-z) + 1);
    background: rgba(0, 20, 40, .45);
    opacity: 0;
    transition: opacity .3s ease;
}

.cam-backdrop.is-open {
    opacity: 1;
}

.cam-panel {
    position: fixed;
    left: 20px;
    bottom: 104px;
    z-index: calc(var(--cam-z) + 2);
    width: 460px;
    max-width: calc(100vw - 40px);
    height: min(760px, calc(100vh - 130px));
    height: min(760px, calc(100dvh - 130px));
    display: flex;
    flex-direction: column;
    background: var(--cam-surface);
    color: var(--cam-text);
    border-radius: var(--cam-radius);
    box-shadow: 0 24px 60px rgba(0, 20, 40, .35);
    overflow: hidden;
    transform-origin: bottom left;
    animation: cam-panel-in .38s cubic-bezier(.2, 1.1, .3, 1) both;
}

#cam-widget [hidden] {
    display: none !important;
}

.cam-panel.is-closing {
    animation: cam-panel-out .22s ease-in both;
}

@keyframes cam-panel-in {
    0% { opacity: 0; transform: translateY(30px) scale(.9); }
    100% { opacity: 1; transform: none; }
}

@keyframes cam-panel-out {
    to { opacity: 0; transform: translateY(20px) scale(.95); }
}

.cam-panel__header,
.cam-tabs,
.cam-panel__footer {
    /* Evita que se encojan cuando el contenido de la pestaña es largo */
    flex-shrink: 0;
}

.cam-panel__header {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 18px 16px 20px;
    background: linear-gradient(120deg, var(--cam-primary) 0%, #0a5c9a 100%);
    color: #fff;
    overflow: hidden;
}

.cam-panel__header::after {
    content: "";
    position: absolute;
    right: -40px;
    top: -60px;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 156, 51, .45), transparent 70%);
    animation: cam-glow 6s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes cam-glow {
    to { transform: translate(-40px, 30px) scale(1.2); }
}

.cam-panel__logo {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, .15);
    border: 2px solid rgba(255, 255, 255, .5);
    border-radius: 50%;
}

.cam-panel__logo svg {
    width: 30px;
    height: 30px;
}

.cam-panel__title {
    margin: 0;
    color: #fff !important;
    font-family: var(--cam-font);
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.2;
}

.cam-panel__subtitle {
    margin: 2px 0 0;
    font-size: .9rem;
    opacity: .9;
}

.cam-icon-btn {
    position: relative;
    z-index: 1;
    margin-left: auto;
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, .14);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, .6);
    border-radius: 12px;
    cursor: pointer;
    transition: background .2s ease, transform .3s ease;
}

.cam-icon-btn:hover {
    background: rgba(255, 255, 255, .28);
    transform: rotate(90deg);
}

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

/* Pestañas */
.cam-tabs {
    display: flex;
    gap: 8px;
    padding: 12px 14px 0;
    background: var(--cam-surface-alt);
    border-bottom: 1px solid var(--cam-border);
}

.cam-tab {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    min-height: 56px;
    padding: 8px 4px 10px;
    background: transparent;
    color: var(--cam-muted);
    border: 0;
    border-bottom: 4px solid transparent;
    border-radius: 10px 10px 0 0;
    font: inherit;
    font-size: .88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s ease, color .2s ease, border-color .2s ease;
}

.cam-tab svg {
    width: 22px;
    height: 22px;
}

.cam-tab:hover {
    background: #e3ecf5;
    color: var(--cam-primary);
}

.cam-tab[aria-selected="true"] {
    background: var(--cam-surface);
    color: var(--cam-primary);
    border-bottom-color: var(--cam-accent);
}

.cam-panel__body {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 22px 20px 28px;
    scroll-behavior: smooth;
}

.cam-tabpanel {
    animation: cam-fade .3s ease both;
}

@keyframes cam-fade {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

.cam-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 28px 0 12px;
    color: var(--cam-primary) !important;
    font-family: var(--cam-font);
    font-size: 1.05rem;
    font-weight: 700;
    text-transform: none;
}

.cam-section-title:first-child {
    margin-top: 0;
}

.cam-section-title::before {
    content: "";
    width: 6px;
    height: 20px;
    background: var(--cam-accent);
    border-radius: 3px;
}

.cam-intro {
    margin: 0 0 18px;
    color: var(--cam-muted);
    font-size: .95rem;
}

/* Tarjetas de perfil */
.cam-profiles {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.cam-profile {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 118px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 12px 12px 12px;
    background: var(--cam-surface);
    color: var(--cam-text);
    border: 2px solid var(--cam-border);
    border-radius: 14px;
    font: inherit;
    text-align: left;
    cursor: pointer;
    overflow: hidden;
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease, background .2s ease;
    animation: cam-card-in .45s cubic-bezier(.2, 1.2, .4, 1) both;
    animation-delay: calc(var(--i, 0) * 35ms);
}

@keyframes cam-card-in {
    from { opacity: 0; transform: translateY(14px) scale(.96); }
    to { opacity: 1; transform: none; }
}

.cam-profile:hover {
    transform: translateY(-3px);
    border-color: var(--cam-primary);
    box-shadow: 0 8px 18px rgba(0, 60, 104, .15);
}

.cam-profile__icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    background: var(--cam-primary-light);
    color: var(--cam-primary);
    border-radius: 12px;
    transition: transform .35s cubic-bezier(.3, 1.6, .5, 1), background .2s ease, color .2s ease;
}

.cam-profile:hover .cam-profile__icon {
    transform: scale(1.1) rotate(-6deg);
}

.cam-profile__icon svg {
    width: 26px;
    height: 26px;
}

.cam-profile__name {
    font-size: .98rem;
    font-weight: 700;
    line-height: 1.25;
}

.cam-profile__desc {
    color: var(--cam-muted);
    font-size: .8rem;
    line-height: 1.35;
}

/* Estado activo: color + marca + texto (no solo color) */
.cam-profile__state {
    position: absolute;
    top: 10px;
    right: 10px;
    display: none;
    align-items: center;
    gap: 4px;
    padding: 3px 8px 3px 5px;
    background: var(--cam-success);
    color: #fff;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
}

.cam-profile__state svg {
    width: 14px;
    height: 14px;
}

.cam-profile[aria-pressed="true"] {
    background: linear-gradient(160deg, #fff 0%, #eef5fb 100%);
    border-color: var(--cam-primary);
    border-width: 3px;
    padding: 11px;
    box-shadow: inset 0 -4px 0 var(--cam-accent);
}

.cam-profile[aria-pressed="true"] .cam-profile__icon {
    background: var(--cam-primary);
    color: #fff;
}

.cam-profile[aria-pressed="true"] .cam-profile__state {
    display: inline-flex;
    animation: cam-pop .35s cubic-bezier(.3, 1.6, .5, 1);
}

.cam-profile--custom {
    border-style: dashed;
}

/* Opciones contextuales de perfil (tipo de daltonismo) */
.cam-profile-extra {
    margin-top: 12px;
    padding: 12px 14px;
    background: var(--cam-surface-alt);
    border: 2px solid var(--cam-border);
    border-radius: 12px;
    animation: cam-fade .3s ease both;
}

/* Selector de tipo de daltonismo */
.cam-extra-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: var(--cam-primary) !important;
    font-family: var(--cam-font);
    font-size: 1.02rem;
    font-weight: 700;
}

.cam-extra-title svg {
    width: 22px;
    height: 22px;
}

.cam-profile-extra > .cam-hint {
    margin: 2px 0 12px;
}

.cam-cb-types {
    display: grid;
    gap: 8px;
    margin-bottom: 12px;
}

.cam-cb-type {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 60px;
    padding: 10px 12px;
    background: var(--cam-surface);
    color: var(--cam-text);
    border: 2px solid var(--cam-border);
    border-radius: 12px;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color .2s ease, background .2s ease, transform .15s ease;
}

.cam-cb-type:hover {
    border-color: var(--cam-primary);
}

.cam-cb-type:active {
    transform: scale(.98);
}

.cam-cb-type__swatch {
    flex: 0 0 44px;
    width: 44px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, .2);
}

.cam-cb-type__text {
    flex: 1 1 auto;
    line-height: 1.25;
}

.cam-cb-type__text strong {
    display: block;
    font-size: .95rem;
}

.cam-cb-type__text small {
    display: block;
    margin-top: 2px;
    color: var(--cam-muted);
    font-size: .8rem;
}

.cam-cb-type__check {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border: 2px solid var(--cam-border);
    border-radius: 50%;
    color: transparent;
    transition: background .2s ease, border-color .2s ease;
}

.cam-cb-type__check svg {
    width: 16px;
    height: 16px;
}

.cam-cb-type[aria-checked="true"] {
    background: var(--cam-primary-light);
    border-color: var(--cam-primary);
    border-width: 3px;
    padding: 9px 11px;
}

.cam-cb-type[aria-checked="true"] .cam-cb-type__check {
    background: var(--cam-success);
    border-color: var(--cam-success);
    color: #fff;
    animation: cam-pop .3s cubic-bezier(.3, 1.6, .5, 1);
}

.cam-profile-extra .cam-group {
    background: var(--cam-surface);
}

/* Muestra de colores (con nombre: no depende solo del color) */
.cam-samples {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
}

.cam-samples li {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.cam-sample__color {
    width: 100%;
    height: 34px;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, .2);
}

.cam-sample__name {
    font-size: .75rem;
    font-weight: 600;
    color: var(--cam-muted);
}

.cam-options[data-key-group="colorblindStrength"] {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cam-svg-filters {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 1px;
    height: 1px;
    overflow: hidden;
    pointer-events: none;
    opacity: 0;
}

/* Controles */
.cam-group {
    margin: 0 0 12px;
    padding: 12px 14px;
    background: var(--cam-surface-alt);
    border: 1px solid var(--cam-border);
    border-radius: 12px;
}

.cam-group > legend,
.cam-label {
    display: block;
    margin-bottom: 8px;
    padding: 0;
    color: var(--cam-text);
    font-size: .95rem;
    font-weight: 700;
}

.cam-group > legend {
    float: left;
    width: 100%;
}

.cam-group > legend + * {
    clear: left;
}

.cam-hint {
    display: block;
    margin-top: 4px;
    color: var(--cam-muted);
    font-size: .8rem;
    font-weight: 400;
}

.cam-stepper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cam-step-btn {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    background: var(--cam-primary);
    color: #fff;
    border: 0;
    border-radius: 12px;
    font: inherit;
    font-size: 1.5rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s ease, transform .15s ease;
}

.cam-step-btn:hover {
    background: var(--cam-primary-dark);
}

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

.cam-step-btn:disabled {
    background: #9aabbb;
    cursor: not-allowed;
}

.cam-meter {
    flex: 1 1 auto;
    text-align: center;
}

.cam-meter__value {
    display: block;
    color: var(--cam-primary);
    font-size: 1.25rem;
    font-weight: 800;
}

.cam-meter__bar {
    display: block;
    height: 8px;
    margin-top: 4px;
    background: #d5e0ea;
    border-radius: 999px;
    overflow: hidden;
}

.cam-meter__fill {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--cam-primary), var(--cam-accent));
    border-radius: inherit;
    transition: width .3s ease;
}

/* Botones de opción (segmentados) */
.cam-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
    gap: 8px;
}

.cam-option {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 48px;
    padding: 8px 10px;
    background: var(--cam-surface);
    color: var(--cam-text);
    border: 2px solid var(--cam-border);
    border-radius: 10px;
    font: inherit;
    font-size: .88rem;
    font-weight: 600;
    text-align: left;
    line-height: 1.2;
    cursor: pointer;
    transition: border-color .2s ease, background .2s ease;
}

.cam-option:hover {
    border-color: var(--cam-primary);
}

.cam-option > span:first-child {
    min-width: 0;
    overflow-wrap: anywhere;
    hyphens: auto;
}

.cam-option::before {
    content: "";
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    border: 2px solid var(--cam-muted);
    border-radius: 50%;
    background: #fff;
    transition: box-shadow .2s ease, border-color .2s ease;
}

.cam-option[aria-checked="true"] {
    background: var(--cam-primary-light);
    border-color: var(--cam-primary);
    color: var(--cam-primary-dark);
}

.cam-option[aria-checked="true"]::before {
    border-color: var(--cam-primary);
    box-shadow: inset 0 0 0 4px #fff, inset 0 0 0 10px var(--cam-primary);
}

.cam-swatch {
    flex: 0 0 auto;
    width: 26px;
    height: 18px;
    margin-left: auto;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, .25);
}

/* Interruptores */
.cam-switches {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.cam-switch {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 56px;
    padding: 8px 12px;
    background: var(--cam-surface);
    color: var(--cam-text);
    border: 2px solid var(--cam-border);
    border-radius: 12px;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color .2s ease, background .2s ease;
}

.cam-switch:hover {
    border-color: var(--cam-primary);
}

.cam-switch__icon {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    color: var(--cam-primary);
    background: var(--cam-primary-light);
    border-radius: 10px;
}

.cam-switch__icon svg {
    width: 22px;
    height: 22px;
}

.cam-switch__text {
    flex: 1 1 auto;
    font-size: .95rem;
    font-weight: 600;
    line-height: 1.25;
}

.cam-switch__text small {
    display: block;
    margin-top: 2px;
    color: var(--cam-muted);
    font-size: .78rem;
    font-weight: 400;
}

.cam-switch__track {
    position: relative;
    flex: 0 0 58px;
    width: 58px;
    height: 32px;
    background: #8796a5;
    border-radius: 999px;
    transition: background .25s ease;
}

.cam-switch__track::before {
    content: "NO";
    position: absolute;
    right: 7px;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    font-size: .62rem;
    font-weight: 800;
}

.cam-switch__track::after {
    content: "";
    position: absolute;
    top: 4px;
    left: 4px;
    width: 24px;
    height: 24px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, .25);
    transition: transform .25s cubic-bezier(.3, 1.5, .5, 1);
}

.cam-switch[aria-checked="true"] {
    border-color: var(--cam-primary);
    background: #f4f9fd;
}

.cam-switch[aria-checked="true"] .cam-switch__track {
    background: var(--cam-success);
}

.cam-switch[aria-checked="true"] .cam-switch__track::before {
    content: "SÍ";
    right: auto;
    left: 8px;
}

.cam-switch[aria-checked="true"] .cam-switch__track::after {
    transform: translateX(26px);
}

/* Botones de acción */
.cam-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.cam-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 50px;
    padding: 10px 14px;
    background: var(--cam-primary);
    color: #fff;
    border: 2px solid var(--cam-primary);
    border-radius: 12px;
    font: inherit;
    font-size: .95rem;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    transition: background .2s ease, transform .15s ease, color .2s ease;
}

.cam-btn svg {
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
}

.cam-btn:hover {
    background: var(--cam-primary-dark);
}

.cam-btn:active {
    transform: scale(.97);
}

.cam-btn:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.cam-btn--ghost {
    background: #fff;
    color: var(--cam-primary);
}

.cam-btn--ghost:hover {
    background: var(--cam-primary-light);
}

.cam-btn--accent {
    background: var(--cam-accent);
    border-color: var(--cam-accent);
    color: #1a1a1a;
}

.cam-btn--accent:hover {
    background: #f28a1c;
}

.cam-btn--wide {
    grid-column: 1 / -1;
}

/* Estructura de página */
.cam-outline {
    margin: 0;
    padding: 0;
    list-style: none;
}

.cam-outline li + li {
    margin-top: 6px;
}

.cam-outline button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 44px;
    padding: 8px 12px;
    background: #fff;
    color: var(--cam-text);
    border: 1px solid var(--cam-border);
    border-radius: 10px;
    font: inherit;
    font-size: .92rem;
    text-align: left;
    cursor: pointer;
}

.cam-outline button:hover {
    border-color: var(--cam-primary);
    background: var(--cam-primary-light);
}

.cam-outline__tag {
    flex: 0 0 auto;
    min-width: 34px;
    padding: 2px 6px;
    background: var(--cam-primary);
    color: #fff;
    border-radius: 6px;
    font-size: .75rem;
    font-weight: 800;
    text-align: center;
}

.cam-outline [data-level="3"] { margin-left: 16px; width: calc(100% - 16px); }
.cam-outline [data-level="4"] { margin-left: 32px; width: calc(100% - 32px); }

.cam-kbd-list {
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: .9rem;
}

.cam-kbd-list li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 0;
    border-bottom: 1px dashed var(--cam-border);
}

.cam-kbd-list kbd {
    flex: 0 0 auto;
    padding: 2px 7px;
    background: #fff;
    border: 1px solid var(--cam-border);
    border-bottom-width: 3px;
    border-radius: 6px;
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: .8rem;
    white-space: nowrap;
}

/* Pie del panel */
.cam-panel__footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    background: var(--cam-surface-alt);
    border-top: 1px solid var(--cam-border);
}

.cam-check {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 200px;
    min-height: 44px;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
}

.cam-check input {
    width: 24px;
    height: 24px;
    accent-color: var(--cam-primary);
    cursor: pointer;
}

.cam-panel__footer .cam-btn {
    flex: 0 0 auto;
}

/* Notificaciones visuales (alternativa a sonidos) */
.cam-toast {
    position: fixed;
    left: 50%;
    top: 20px;
    z-index: calc(var(--cam-z) + 4);
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: min(560px, calc(100vw - 32px));
    padding: 14px 18px;
    background: var(--cam-primary-dark);
    color: #fff;
    border: 3px solid var(--cam-accent);
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, .35);
    font-family: var(--cam-font);
    font-size: 1rem;
    font-weight: 600;
    transform: translate(-50%, -150%);
    transition: transform .4s cubic-bezier(.2, 1.3, .4, 1);
}

.cam-toast.is-visible {
    transform: translate(-50%, 0);
}

.cam-toast__icon {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    background: var(--cam-accent);
    color: #1a1a1a;
    border-radius: 50%;
}

.cam-toast__icon svg {
    width: 20px;
    height: 20px;
}

.cam-toast__close {
    margin-left: 6px;
    width: 36px;
    height: 36px;
    background: transparent;
    color: #fff;
    border: 2px solid rgba(255, 255, 255, .6);
    border-radius: 8px;
    font-size: 1.2rem;
    cursor: pointer;
}

/* Guía y máscara de lectura */
.cam-guide {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    z-index: calc(var(--cam-z) - 2);
    height: 12px;
    background: rgba(255, 156, 51, .35);
    border-top: 3px solid var(--cam-primary);
    border-bottom: 3px solid var(--cam-primary);
    pointer-events: none;
    transform: translateY(-100px);
    will-change: transform;
}

.cam-mask {
    position: fixed;
    left: 0;
    right: 0;
    z-index: calc(var(--cam-z) - 3);
    background: rgba(0, 0, 0, .6);
    pointer-events: none;
}

.cam-mask--top {
    top: 0;
    height: 0;
}

.cam-mask--bottom {
    bottom: 0;
    height: 0;
}

/* Elemento que se está leyendo en voz alta */
.cam-speaking {
    outline: 3px dashed var(--cam-accent) !important;
    outline-offset: 4px !important;
    background-color: rgba(255, 156, 51, .15) !important;
}

/* Modo lectura (vista simplificada) */
.cam-reader {
    position: fixed;
    inset: 0;
    z-index: calc(var(--cam-z) + 3);
    display: flex;
    flex-direction: column;
    background: #fbf8f1;
    color: #1b1b1b;
    animation: cam-fade .3s ease both;
}

.cam-reader__bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: var(--cam-primary);
    color: #fff;
}

.cam-reader__bar h2 {
    margin: 0;
    color: #fff !important;
    font-size: 1.2rem;
}

.cam-reader__bar .cam-btn {
    margin-left: auto;
    background: #fff;
    color: var(--cam-primary);
}

.cam-reader__content {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 32px 20px 64px;
}

.cam-reader__article {
    max-width: 68ch;
    margin: 0 auto;
    font-family: 'Atkinson Hyperlegible', Verdana, sans-serif;
    font-size: 1.25rem;
    line-height: 1.9;
    letter-spacing: .01em;
}

.cam-reader__article h1,
.cam-reader__article h2,
.cam-reader__article h3,
.cam-reader__article h4 {
    margin: 1.6em 0 .5em;
    color: #0a2a44 !important;
    line-height: 1.3;
}

.cam-reader__article p,
.cam-reader__article ul,
.cam-reader__article ol {
    margin: 0 0 1.2em;
}

.cam-reader__article ul,
.cam-reader__article ol {
    padding-left: 1.4em;
    list-style: disc;
}

.cam-reader__article a {
    color: #00458a;
    text-decoration: underline;
}

.cam-reader__article .cam-reader__img {
    display: block;
    margin: 0 0 1em;
    padding: .4em .8em;
    border-left: 4px solid var(--cam-accent);
    font-size: .95em;
    font-style: italic;
    color: #444;
}

/* ==========================================================================
   4. MODOS DE ACCESIBILIDAD (clases sobre <html>)
   "Contenido de página" = todo lo que no sea el widget.
   ========================================================================== */

/* --- Filtros de color (daltonismo, saturación, brillo, inversión) --- */
html.cam-filter {
    filter: var(--cam-filter, none);
}

/* Al invertir, devolvemos imágenes, vídeos y el propio widget a su color real */
html.cam-inverted body :is(img, video, picture, iframe, canvas, .slide, [style*="background-image"]):not(.slide *, #cam-widget *),
html.cam-inverted #cam-widget > * {
    filter: invert(1) hue-rotate(180deg);
}

/* --- Daltonismo: contenido de otros dominios que no se puede recolorear con canvas --- */
html.cam-cb-on body :is(.cam-cb-fallback, iframe):not(#cam-widget *) {
    filter: url(#cam-cb-active);
}

/* --- Tipografías --- */
html.cam-font-legible body :not(#cam-widget, #cam-widget *, .fa, i, svg, svg *) {
    font-family: 'Atkinson Hyperlegible', Verdana, Tahoma, sans-serif !important;
}

html.cam-font-dyslexic body :not(#cam-widget, #cam-widget *, .fa, i, svg, svg *) {
    font-family: 'OpenDyslexic', 'Lexend', 'Comic Sans MS', Verdana, sans-serif !important;
}

html.cam-font-lexend body :not(#cam-widget, #cam-widget *, .fa, i, svg, svg *) {
    font-family: 'Lexend', Verdana, sans-serif !important;
}

/* --- Texto ampliado: la cabecera crece en lugar de desbordarse --- */
html.cam-scaled .main-header .container {
    height: auto !important;
    min-height: 90px;
    flex-wrap: wrap;
    row-gap: 4px;
    padding-top: 8px;
    padding-bottom: 8px;
}

@media (min-width: 769px) {
    html.cam-scaled .nav-list {
        flex-wrap: wrap;
    }

    html.cam-scaled .nav-link {
        padding-top: 16px;
        padding-bottom: 16px;
    }

    html.cam-scaled .nav-link::after {
        bottom: 8px;
    }
}

/* --- Interlineado --- */
html.cam-lh-1 body :not(#cam-widget, #cam-widget *) {
    line-height: 1.8 !important;
}

html.cam-lh-2 body :not(#cam-widget, #cam-widget *) {
    line-height: 2.2 !important;
}

/* --- Espaciado entre letras y palabras --- */
html.cam-ls-1 body :not(#cam-widget, #cam-widget *) {
    letter-spacing: .06em !important;
    word-spacing: .16em !important;
}

html.cam-ls-2 body :not(#cam-widget, #cam-widget *) {
    letter-spacing: .12em !important;
    word-spacing: .3em !important;
}

html:is(.cam-lh-1, .cam-lh-2, .cam-ls-1, .cam-ls-2) body :is(p, li, dd, blockquote):not(#cam-widget *) {
    margin-bottom: 1em;
}

/* --- Alineación --- */
html.cam-align-left body :not(#cam-widget, #cam-widget *) {
    text-align: left !important;
}

html.cam-align-center body :is(p, li, h1, h2, h3, h4, h5, h6, dd, td, th, label):not(#cam-widget *) {
    text-align: center !important;
}

/* --- Alto contraste oscuro --- */
html.cam-contrast-dark body,
html.cam-contrast-dark body :not(#cam-widget, #cam-widget *, svg, svg *, img, video, iframe, .cam-skip-link) {
    background-color: #000 !important;
    background-image: none !important;
    color: #fff !important;
    border-color: #fff !important;
    text-shadow: none !important;
    box-shadow: none !important;
}

html.cam-contrast-dark body :is(h1, h2, h3, h4, h5, h6):not(#cam-widget *),
html.cam-contrast-dark body :is(h1, h2, h3, h4, h5, h6):not(#cam-widget *) * {
    color: #7fdbff !important;
}

html.cam-contrast-dark body :is(a, a *):not(#cam-widget *) {
    color: #ffeb3b !important;
    text-decoration: underline !important;
}

html.cam-contrast-dark body :is(button, input, select, textarea, .btn):not(#cam-widget *) {
    border: 2px solid #ffeb3b !important;
}

/* --- Alto contraste claro --- */
html.cam-contrast-light body,
html.cam-contrast-light body :not(#cam-widget, #cam-widget *, svg, svg *, img, video, iframe, .cam-skip-link) {
    background-color: #fff !important;
    background-image: none !important;
    color: #000 !important;
    border-color: #000 !important;
    text-shadow: none !important;
    box-shadow: none !important;
}

html.cam-contrast-light body :is(a, a *):not(#cam-widget *) {
    color: #0000c8 !important;
    text-decoration: underline !important;
}

html.cam-contrast-light body :is(button, input, select, textarea, .btn):not(#cam-widget *) {
    border: 2px solid #000 !important;
}

/* --- Contraste suave (tonos crema, menos deslumbramiento) --- */
html.cam-contrast-soft body,
html.cam-contrast-soft body :not(#cam-widget, #cam-widget *, svg, svg *, img, video, iframe, .cam-skip-link, .slide, .slide *) {
    background-color: #f4efe4 !important;
    background-image: none !important;
    color: #3b3a36 !important;
    border-color: #cfc6b4 !important;
    text-shadow: none !important;
    box-shadow: none !important;
}

html.cam-contrast-soft body :is(h1, h2, h3, h4, h5, h6):not(#cam-widget *) {
    color: #2f4a5e !important;
}

html.cam-contrast-soft body :is(a, a *):not(#cam-widget *) {
    color: #35607f !important;
}

/* --- Modo oscuro suave --- */
html.cam-contrast-softdark body,
html.cam-contrast-softdark body :not(#cam-widget, #cam-widget *, svg, svg *, img, video, iframe, .cam-skip-link, .slide, .slide *) {
    background-color: #1f2328 !important;
    background-image: none !important;
    color: #d4d0c8 !important;
    border-color: #3d444c !important;
    text-shadow: none !important;
    box-shadow: none !important;
}

html.cam-contrast-softdark body :is(h1, h2, h3, h4, h5, h6):not(#cam-widget *) {
    color: #a9c7dd !important;
}

html.cam-contrast-softdark body :is(a, a *):not(#cam-widget *) {
    color: #e3bc85 !important;
}

html.cam-contrast-softdark body :is(img, video):not(#cam-widget *) {
    opacity: .85;
}

/* --- Resaltar enlaces --- */
html.cam-links body a:not(#cam-widget *, .cam-skip-link) {
    text-decoration: underline !important;
    text-decoration-thickness: 2px !important;
    text-underline-offset: 3px !important;
    outline: 2px dashed currentColor !important;
    outline-offset: 2px !important;
}

html.cam-links body a[target="_blank"]:not(#cam-widget *)::after {
    content: " ↗";
    font-weight: 700;
}

/* --- Resaltar títulos (con etiqueta de nivel) --- */
html.cam-headings body :is(h1, h2, h3, h4, h5, h6):not(#cam-widget *) {
    outline: 3px solid var(--cam-accent) !important;
    outline-offset: 4px !important;
    border-radius: 2px;
}

html.cam-headings body :is(h1, h2, h3, h4, h5, h6):not(#cam-widget *)::before {
    display: inline-block;
    margin-right: .4em;
    padding: 0 .35em;
    background: var(--cam-primary);
    color: #fff;
    border-radius: 4px;
    font-family: var(--cam-font);
    font-size: .6em;
    font-weight: 800;
    line-height: 1.6;
    vertical-align: middle;
}

html.cam-headings body h1:not(#cam-widget *)::before { content: "H1"; }
html.cam-headings body h2:not(#cam-widget *)::before { content: "H2"; }
html.cam-headings body h3:not(#cam-widget *)::before { content: "H3"; }
html.cam-headings body h4:not(#cam-widget *)::before { content: "H4"; }
html.cam-headings body h5:not(#cam-widget *)::before { content: "H5"; }
html.cam-headings body h6:not(#cam-widget *)::before { content: "H6"; }

/* --- Foco reforzado --- */
html.cam-focus body :focus:not(#cam-widget *, #contenido-principal) {
    outline: 5px solid var(--cam-accent) !important;
    outline-offset: 4px !important;
    box-shadow: 0 0 0 10px var(--cam-primary), 0 0 0 13px #fff !important;
    position: relative;
    z-index: 5;
}

/* --- Cursores grandes --- */
html.cam-cursor-dark,
html.cam-cursor-dark body * {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cpath d='M6 3l30 21-13 2 8 16-6 3-8-16-11 9z' fill='%23000' stroke='%23fff' stroke-width='2.5' stroke-linejoin='round'/%3E%3C/svg%3E") 6 3, auto !important;
}

html.cam-cursor-dark body :is(a, button, [role="button"], label, select, summary, input[type="checkbox"], input[type="radio"]),
html.cam-cursor-dark body :is(a, button, [role="button"]) * {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cpath d='M17 44V21l-4 4-4-3 10-18c2-3 6-1 5 2v10l14 3c3 1 3 4 3 6l-3 19z' fill='%23000' stroke='%23fff' stroke-width='2.5' stroke-linejoin='round'/%3E%3C/svg%3E") 18 4, pointer !important;
}

html.cam-cursor-light,
html.cam-cursor-light body * {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cpath d='M6 3l30 21-13 2 8 16-6 3-8-16-11 9z' fill='%23fff' stroke='%23000' stroke-width='2.5' stroke-linejoin='round'/%3E%3C/svg%3E") 6 3, auto !important;
}

html.cam-cursor-light body :is(a, button, [role="button"], label, select, summary, input[type="checkbox"], input[type="radio"]),
html.cam-cursor-light body :is(a, button, [role="button"]) * {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cpath d='M17 44V21l-4 4-4-3 10-18c2-3 6-1 5 2v10l14 3c3 1 3 4 3 6l-3 19z' fill='%23fff' stroke='%23000' stroke-width='2.5' stroke-linejoin='round'/%3E%3C/svg%3E") 18 4, pointer !important;
}

html:is(.cam-cursor-dark, .cam-cursor-light) body :is(input:not([type="checkbox"], [type="radio"]), textarea) {
    cursor: text !important;
}

/* --- Sin animaciones ni movimiento --- */
html.cam-no-motion,
html.cam-no-motion *,
html.cam-no-motion *::before,
html.cam-no-motion *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: .001ms !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
}

html.cam-no-motion body :is(marquee, blink):not(#cam-widget *) {
    display: none !important;
}

/* --- Ocultar imágenes (se muestra su texto alternativo) --- */
html.cam-hide-images body :is(img, picture, video, svg:not(.flag-icon)):not(#cam-widget *, .cam-skip-link *) {
    visibility: hidden !important;
}

html.cam-hide-images body :not(#cam-widget, #cam-widget *) {
    background-image: none !important;
}

html.cam-hide-images .cam-alt-text {
    display: inline-block;
    padding: 4px 8px;
    background: var(--cam-surface-alt);
    color: var(--cam-text);
    border: 1px dashed var(--cam-muted);
    border-radius: 4px;
    font-size: .9rem;
    font-style: italic;
}

/* --- Controles grandes y separados (motricidad) --- */
html.cam-big-targets body :is(button, select, input:not([type="checkbox"], [type="radio"], [type="hidden"]), textarea, .btn, .nav-link, .dropdown-link, [role="button"]):not(#cam-widget *) {
    min-height: 52px !important;
    min-width: 52px;
    font-size: max(1.05rem, 1em);
}

html.cam-big-targets body :is(.btn, button):not(#cam-widget *) {
    padding: 14px 24px !important;
}

html.cam-big-targets body :is(input[type="checkbox"], input[type="radio"]):not(#cam-widget *) {
    width: 28px !important;
    height: 28px !important;
    margin-right: 10px !important;
}

html.cam-big-targets body :is(p, li, td) a:not(#cam-widget *) {
    display: inline-block;
    padding: 6px 4px;
    margin: 2px 4px;
}

html.cam-big-targets body :is(ul, ol) > li:not(#cam-widget *) + li {
    margin-top: 10px;
}

html.cam-big-targets body .form-group:not(#cam-widget *) {
    margin-bottom: 26px !important;
}

html.cam-big-targets body :is(.footer-social-inline, .form-checkbox-item, label):not(#cam-widget *) {
    gap: 16px !important;
}

html.cam-big-targets body .footer-social-inline a,
html.cam-big-targets body .slider-dot,
html.cam-big-targets body .slider-arrow {
    min-width: 48px !important;
    min-height: 48px !important;
}

/* --- Interfaz simplificada (cognitivo / enfoque) --- */
html.cam-simplify body :is(.slider-patterns-left, .slider-patterns-right, [class*="base-pattern"], .accent-triangle, .honeycomb__placeholder, iframe[src*="facebook"]) {
    display: none !important;
}

html.cam-simplify body :not(#cam-widget, #cam-widget *) {
    box-shadow: none !important;
    text-shadow: none !important;
}

html.cam-simplify body main :is(p, li):not(#cam-widget *) {
    max-width: 75ch;
}

html.cam-simplify body :is(h1, h2, h3):not(#cam-widget *) {
    margin-top: .6em;
}

html.cam-simplify body main section:not(#cam-widget *) {
    border-bottom: 2px solid #d1dbe5;
}

/* --- Lectura simplificada (diseño) --- */
html.cam-reading-layout body main :is(p, li, dd):not(#cam-widget *) {
    max-width: 68ch !important;
    margin-bottom: 1.3em !important;
}

html.cam-reading-layout body main section:not(#cam-widget *) {
    padding-top: 48px !important;
    padding-bottom: 48px !important;
}

html.cam-reading-layout body :is(aside, iframe[src*="facebook"], .footer-partners-row):not(#cam-widget *) {
    display: none !important;
}

/* --- Apoyos visuales que no dependen del color --- */
html.cam-cues body .nav-item.active > .nav-link {
    text-decoration: underline wavy !important;
    text-underline-offset: 6px !important;
}

html.cam-cues body .nav-item.active > .nav-link::before {
    content: "▸ ";
}

html.cam-cues body .slider-dot.active {
    transform: scale(1.4);
    outline: 3px solid #fff;
    background-image: repeating-linear-gradient(45deg, #000 0 2px, transparent 2px 4px) !important;
}

html.cam-cues body :is(.tab-btn.active, .lang-option.active):not(#cam-widget *)::before {
    content: "✔ ";
}

html.cam-cues body .alert-success::before {
    content: "✔ Correcto: ";
    font-weight: 800;
}

html.cam-cues body .cam-required-mark::after {
    content: " (obligatorio)";
    font-size: .85em;
    font-weight: 700;
}

html.cam-cues body :is(input, select, textarea):not(#cam-widget *):not([type="checkbox"], [type="radio"]) {
    border-width: 2px !important;
    border-style: solid !important;
}

/* ==========================================================================
   5. RESPONSIVE
   ========================================================================== */

@media (max-width: 768px) {
    .cam-fab {
        left: 14px;
        bottom: 16px;
        height: 60px;
        min-width: 60px;
    }

    .cam-fab::before,
    .cam-fab::after {
        width: 54px;
        height: 54px;
    }

    .cam-fab__icon {
        flex-basis: 54px;
        width: 54px;
        height: 54px;
    }

    .cam-fab__icon svg {
        width: 34px;
        height: 34px;
    }

    /* Panel como hoja inferior a pantalla casi completa */
    .cam-panel {
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-width: 100%;
        height: 92vh;
        height: 92dvh;
        border-radius: 20px 20px 0 0;
        transform-origin: bottom center;
    }

    .cam-panel__body {
        padding: 16px 16px 24px;
    }
}

@media (max-width: 400px) {
    .cam-profile {
        min-height: 0;
        padding: 10px;
    }

    .cam-profile__desc {
        font-size: .76rem;
    }

    .cam-actions {
        grid-template-columns: 1fr;
    }

    .cam-tab {
        font-size: .78rem;
    }
}

@media (max-width: 330px) {
    .cam-profiles {
        grid-template-columns: 1fr;
    }
}

/* Respeta la preferencia del sistema de reducir movimiento */
@media (prefers-reduced-motion: reduce) {
    .cam-fab,
    .cam-fab::before,
    .cam-fab::after,
    .cam-panel,
    .cam-panel__header::after,
    .cam-profile,
    .cam-tabpanel,
    .cam-reader {
        animation: none !important;
    }

    .cam-fab::before,
    .cam-fab::after {
        display: none;
    }

    .cam-toast,
    .cam-fab__icon svg,
    .cam-skip-link {
        transition: none !important;
    }
}

/* Modo de colores forzados del sistema (Windows Alto Contraste) */
@media (forced-colors: active) {
    .cam-fab,
    .cam-profile,
    .cam-switch,
    .cam-option,
    .cam-btn {
        border: 2px solid ButtonText;
    }

    .cam-switch[aria-checked="true"] .cam-switch__track,
    .cam-option[aria-checked="true"]::before {
        background: Highlight;
    }
}

/* Impresión: no imprimir el widget */
@media print {
    #cam-widget,
    .cam-skip-link {
        display: none !important;
    }
}
