/* ======================================================
   ARN - Laboratorio de Conocimiento e Innovación
   Diseño Integrado Institucional - Responsivo Multidispositivo
   ====================================================== */

.arn-container {
    --arn-blue: #003876;
    --arn-blue-dark: #00224A;
    --arn-blue-light: #EBF3FA;
    --arn-yellow: #FCD116;
    --arn-yellow-text: #FFE875;
    --arn-yellow-hover: #E5BB00;
    --arn-red: #CE1126;
    --arn-red-dark: #991B1B;
    --arn-red-light: #FDF2F2;

    --text-dark: #0F172A;
    --text-muted: #475569;
    --bg-light: #F8FAFC;
    --card-bg: #FFFFFF;
    --border: #CBD5E1;

    --radius-lg: 16px;
    --radius-md: 10px;
    --shadow-sm: 0 2px 4px rgba(0, 56, 118, 0.06);
    --shadow-md: 0 10px 25px -5px rgba(0, 56, 118, 0.12);
    --shadow-lg: 0 20px 30px -10px rgba(0, 56, 118, 0.2);

    font-family: 'Work Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-dark);
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
    box-sizing: border-box;
    overflow-x: hidden;
    /* Evita scroll horizontal accidental */
}

.arn-container *,
.arn-container *::before,
.arn-container *::after {
    box-sizing: border-box;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

/* Previene que textos largos o enlaces rompan el layout en móviles */
.arn-container h1,
.arn-container h2,
.arn-container h3,
.arn-container h4,
.arn-container p,
.arn-container span,
.arn-container a {
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* Enlaces */
.arn-container a {
    color: var(--arn-blue);
    text-decoration: underline;
    font-weight: 600;
}

.arn-container a:visited {
    color: var(--arn-blue-dark);
}

.arn-container a:hover,
.arn-container a:focus {
    color: var(--arn-blue-dark);
    text-decoration: none;
}

.arn-container *:focus-visible {
    outline: 3px solid var(--arn-yellow);
    outline-offset: 2px;
}

/* --- Hero Section --- */
.arn-hero-header {
    background: linear-gradient(135deg, var(--arn-blue-dark) 0%, var(--arn-blue) 100%);
    border-radius: var(--radius-lg);
    padding: 2.5rem 2rem;
    color: #FFFFFF;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
}

.arn-hero-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, var(--arn-yellow) 0% 50%, var(--arn-blue) 50% 75%, var(--arn-red) 75% 100%);
}

.arn-hero-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    background: rgba(0, 20, 50, 0.65);
    border: 1px solid var(--arn-yellow);
    color: var(--arn-yellow-text);
    font-size: 0.85rem;
    font-weight: 700;
    padding: 6px 16px;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
    max-width: 100%;
}

.arn-hero-header h1 {
    font-size: clamp(1.5rem, 3.5vw, 2.2rem);
    font-weight: 800;
    margin: 0 0 1rem 0;
    color: #FFFFFF !important;
    line-height: 1.25;
}

.arn-hero-header p {
    font-size: clamp(0.95rem, 1.5vw, 1.05rem);
    color: #F1F5F9 !important;
    max-width: 900px;
    margin: 0 auto;
    line-height: 1.7;
    text-align: justify;
}

/* --- Navegación Pestañas --- */
.arn-tab-nav {
    display: flex;
    gap: 8px;
    background: var(--arn-blue-light);
    padding: 8px;
    border-radius: var(--radius-md);
    margin-bottom: 2rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    border: 1px solid #BCE0FD;
    width: 100%;
}

.arn-tab-btn {
    flex: 1 0 auto;
    min-width: 170px;
    background: transparent;
    border: none;
    padding: 12px 16px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--arn-blue-dark);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    white-space: nowrap;
}

.arn-tab-btn svg {
    fill: none;
    stroke: var(--arn-blue-dark);
    stroke-width: 2.2;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.arn-tab-btn:hover {
    background: rgba(0, 56, 118, 0.12);
}

.arn-tab-btn.active {
    background: var(--arn-blue);
    color: #FFFFFF !important;
    box-shadow: 0 4px 12px rgba(0, 56, 118, 0.3);
}

.arn-tab-btn.active svg {
    stroke: var(--arn-yellow);
}

/* --- Paneles --- */
.arn-panel {
    display: none;
    opacity: 0;
    transform: translateY(10px);
    width: 100%;
}

.arn-panel.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* --- Secciones y Contenedores --- */
.arn-section-title {
    color: var(--arn-blue-dark);
    font-size: clamp(1.2rem, 2.5vw, 1.4rem);
    font-weight: 800;
    margin: 2rem 0 1rem 0;
    text-align: center;
}

.arn-grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
    gap: 1.25rem;
    margin: 1.5rem 0;
    width: 100%;
}

.arn-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    box-shadow: var(--shadow-sm);
    border-top: 4px solid var(--arn-blue);
    min-width: 0;
}

.arn-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.arn-card-icon-wrap {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: var(--arn-blue-light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.arn-card-icon-wrap svg {
    width: 26px;
    height: 26px;
    stroke: var(--arn-blue-dark);
    stroke-width: 2.2;
    fill: none;
}

.arn-card-text {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.4;
    min-width: 0;
}

/* --- Buscador --- */
.arn-search-wrapper {
    position: relative;
    margin: 1.5rem 0 2rem;
    width: 100%;
}

.arn-search-wrapper svg {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    stroke: var(--text-muted);
    fill: none;
    stroke-width: 2;
    pointer-events: none;
}

.arn-search-input {
    width: 100%;
    padding: 14px 20px 14px 48px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    font-size: 1rem;
    /* Evita zoom automático en iOS Safari */
    background: #FFFFFF;
    color: var(--text-dark);
    outline: none;
}

.arn-search-input:focus {
    border-color: var(--arn-blue);
    box-shadow: 0 0 0 3px rgba(0, 56, 118, 0.2);
}

/* --- Publicaciones --- */
.arn-pub-item {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-left: 5px solid var(--arn-blue);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.arn-pub-item>div {
    min-width: 0;
    flex: 1;
}

.arn-pub-item:hover {
    box-shadow: var(--shadow-md);
    border-left-color: var(--arn-blue-dark);
}

.arn-badge-tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 4px;
    background: var(--arn-blue-light);
    color: var(--arn-blue-dark);
    margin-bottom: 6px;
    border: 1px solid #BCE0FD;
}

.arn-pub-title {
    font-weight: 700;
    color: var(--arn-blue-dark);
    font-size: 1rem;
    margin: 0 0 4px 0;
}

.arn-pub-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* --- Stepper --- */
.arn-stepper {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1.5rem 0;
    width: 100%;
}

.arn-step-card {
    display: flex;
    gap: 1.25rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    align-items: flex-start;
    width: 100%;
}

.arn-step-card:hover {
    border-color: var(--arn-blue);
    box-shadow: var(--shadow-sm);
}

.arn-step-num {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--arn-blue-dark);
    color: #FFFFFF !important;
    font-weight: 800;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.arn-step-content {
    min-width: 0;
    flex: 1;
}

.arn-step-content h4 {
    margin: 0 0 4px 0;
    font-size: 1.05rem;
    color: var(--arn-blue-dark);
}

.arn-step-content p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-muted);
}

/* --- Cajas Informativas --- */
.arn-box-info,
.arn-box-alert,
.arn-box-note {
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-md);
    margin: 1.5rem 0;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    width: 100%;
}

.arn-box-info>div,
.arn-box-alert>div,
.arn-box-note>div {
    min-width: 0;
    flex: 1;
}

.arn-box-info {
    background: var(--arn-blue-light);
    border: 1px solid #BCE0FD;
    border-left: 5px solid var(--arn-blue);
}

.arn-box-alert {
    background: var(--arn-red-light);
    border: 1px solid #FCA5A5;
    border-left: 5px solid var(--arn-red-dark);
}

.arn-box-note {
    background: #FEF9C3;
    border: 1px solid #FEF08A;
    border-left: 5px solid var(--arn-yellow-hover);
}

.arn-box-title {
    font-weight: 800;
    font-size: 1.05rem;
    margin-bottom: 4px;
    display: block;
}

.arn-box-info .arn-box-title {
    color: var(--arn-blue-dark);
}

.arn-box-alert .arn-box-title {
    color: var(--arn-red-dark);
}

.arn-box-note .arn-box-title {
    color: #78350F;
}

.arn-box-text {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-dark);
}

/* --- Botones --- */
.arn-container .arn-btn-primary,
.arn-container .arn-btn-primary:visited {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--arn-blue);
    color: #FFFFFF !important;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none !important;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 56, 118, 0.25);
    flex-shrink: 0;
    text-align: center;
}

.arn-container .arn-btn-primary:hover {
    background: var(--arn-blue-dark);
    transform: translateY(-2px);
}

.arn-container .arn-btn-primary svg {
    width: 18px;
    height: 18px;
    stroke: #FFFFFF;
    fill: none;
    stroke-width: 2.2;
    flex-shrink: 0;
}

.arn-container .arn-btn-yellow,
.arn-container .arn-btn-yellow:visited {
    background: var(--arn-yellow);
    color: var(--arn-blue-dark) !important;
    box-shadow: 0 4px 12px rgba(252, 209, 22, 0.35);
}

.arn-container .arn-btn-yellow:hover {
    background: var(--arn-yellow-hover);
}

.arn-container .arn-btn-yellow svg {
    stroke: var(--arn-blue-dark);
}

/* --- Footer --- */
.arn-footer-card {
    background: linear-gradient(135deg, var(--arn-blue-light) 0%, #FFFFFF 100%);
    border: 1px solid #BCE0FD;
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-top: 3rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
    width: 100%;
}

.arn-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    max-width: calc(100vw - 40px);
    background: var(--arn-blue-dark);
    color: #FFFFFF;
    border-left: 5px solid var(--arn-yellow);
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 700;
    box-shadow: var(--shadow-lg);
    display: none;
    z-index: 9999;
}

/* --- Bloques de Texto Narrativo --- */
.arn-intro-block {
    background: var(--bg-light);
    border-left: 4px solid var(--arn-blue);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    width: 100%;
}

.arn-intro-block p {
    margin: 0 0 0.85rem 0;
    font-size: 0.98rem;
    line-height: 1.7;
    color: var(--text-dark);
    text-align: justify;
}

.arn-intro-block p:last-child {
    margin-bottom: 0;
}

/* --- Línea de Tiempo Responsiva (Gesco+i) --- */
.arn-timeline-wrapper,
.arn-timeline-scroll {
    width: 100%;
    padding: 1.5rem 1rem;
    margin: 1.5rem 0;
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.arn-timeline {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
}

.arn-tl-item {
    display: grid;
    grid-template-rows: 135px 10px 135px;
    align-items: center;
    text-align: center;
    min-width: 0;
}

.arn-tl-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    padding-bottom: 10px;
}

.arn-tl-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    height: 100%;
    padding-top: 10px;
}

.arn-tl-bar {
    height: 10px;
    width: 100%;
    border-radius: 999px;
    background: var(--arn-blue);
}

.tl-red .arn-tl-bar {
    background: #B91C1C;
}

.tl-amber .arn-tl-bar {
    background: #C87D20;
}

.tl-sky .arn-tl-bar {
    background: #BAE0F5;
}

.tl-navy .arn-tl-bar {
    background: #385D7A;
}

.tl-gold .arn-tl-bar {
    background: #E5C128;
}

.tl-steel .arn-tl-bar {
    background: #5695BD;
}

.arn-tl-year {
    font-size: 1.15rem;
    font-weight: 800;
    color: #1E293B;
    line-height: 1.2;
}

.arn-tl-desc {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    line-height: 1.35;
    padding: 0 2px;
    overflow-wrap: break-word;
}

.arn-tl-connector {
    width: 3px;
    height: 24px;
    background: #CBD5E1;
    margin: 4px 0;
}

.arn-tl-icon {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 3px solid #CBD5E1;
    background: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
}

.arn-tl-icon svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: #64748B;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.tl-amber .arn-tl-icon svg,
.tl-sky .arn-tl-icon svg {
    stroke: #166534;
}

.tl-steel .arn-tl-icon svg {
    stroke: #1E3A5F;
}

.arn-tl-item:hover .arn-tl-icon {
    border-color: var(--arn-blue);
    transform: scale(1.06);
}

/* Vista Tablet y Móvil (<= 992px): Línea de tiempo vertical */
@media (max-width: 992px) {

    .arn-timeline-wrapper,
    .arn-timeline-scroll {
        padding: 1.25rem 1rem;
    }

    .arn-timeline {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    .arn-tl-item {
        display: grid;
        grid-template-columns: 48px 8px 1fr;
        grid-template-rows: auto auto;
        column-gap: 14px;
        row-gap: 4px;
        align-items: center;
        text-align: left;
        background: var(--bg-light);
        padding: 0.9rem 1rem;
        border-radius: var(--radius-md);
        border: 1px solid #E2E8F0;
    }

    .arn-tl-top,
    .arn-tl-bottom {
        display: contents;
    }

    .arn-tl-connector {
        display: none;
    }

    .arn-tl-icon {
        grid-column: 1;
        grid-row: 1 / 3;
        width: 46px;
        height: 46px;
    }

    .arn-tl-bar {
        grid-column: 2;
        grid-row: 1 / 3;
        width: 8px;
        height: 100%;
        min-height: 44px;
    }

    .arn-tl-year {
        grid-column: 3;
        grid-row: 1;
        font-size: 1.15rem;
    }

    .arn-tl-desc {
        grid-column: 3;
        grid-row: 2;
        font-size: 0.9rem;
        padding: 0;
    }

    .arn-intro-block p {
        text-align: left;
    }
}

/* ======================================================
   Tarjetas Tipo Rompecabezas (Ecosistema de Aprendizaje)
   ====================================================== */
.arn-puzzle-grid {
    --pz-tab-right: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 64'%3E%3Cpath fill='%23000' d='M0 0 L0 22 C0 24 4 25 8 22 C13 18 26 20 26 32 C26 44 13 46 8 42 C4 39 0 40 0 42 L0 64 Z'/%3E%3C/svg%3E");
    --pz-tab-left: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 64'%3E%3Cpath fill='%23000' d='M28 0 L28 22 C28 24 24 25 20 22 C15 18 2 20 2 32 C2 44 15 46 20 42 C24 39 28 40 28 42 L28 64 Z'/%3E%3C/svg%3E");
    --pz-tab-bottom: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 28'%3E%3Cpath fill='%23000' d='M0 0 L22 0 C24 0 25 4 22 8 C18 13 20 26 32 26 C44 26 46 13 42 8 C39 4 40 0 42 0 L64 0 Z'/%3E%3C/svg%3E");
    --pz-tab-top: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 28'%3E%3Cpath fill='%23000' d='M0 28 L22 28 C24 28 25 24 22 20 C18 15 20 2 32 2 C44 2 46 15 42 20 C39 24 40 28 42 28 L64 28 Z'/%3E%3C/svg%3E");
    --pz-body: linear-gradient(#000, #000);

    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin: 2rem 0;
    width: 100%;
    filter: drop-shadow(0 0 1.5px rgba(0, 56, 118, 0.55)) drop-shadow(0 6px 14px rgba(0, 56, 118, 0.12));
}

.arn-puzzle-card {
    position: relative;
    border: none;
    background: var(--card-bg);
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    transition: transform 0.25s ease;
    min-width: 0;
}

.arn-puzzle-card:hover {
    transform: translateY(-4px);
    z-index: 5;
}

.arn-puzzle-inner {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
}

.arn-puzzle-inner h4 {
    margin: 10px 0 8px 0;
    color: var(--arn-blue-dark);
    font-size: 1.08rem;
    font-weight: 700;
}

.arn-puzzle-inner p {
    margin: 0;
    font-size: 0.93rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Pieza 1 (Superior Izquierda) */
.arn-puzzle-card:nth-child(1) {
    width: calc(100% + 28px);
    z-index: 2;
    -webkit-mask-image: var(--pz-tab-top), var(--pz-tab-right), var(--pz-body);
    mask-image: var(--pz-tab-top), var(--pz-tab-right), var(--pz-body);
    -webkit-mask-size: 64px 28px, 28px 64px, calc(100% - 28px) 100%;
    mask-size: 64px 28px, 28px 64px, calc(100% - 28px) 100%;
    -webkit-mask-position: calc(50% - 14px) 100%, 100% 50%, 0 0;
    mask-position: calc(50% - 14px) 100%, 100% 50%, 0 0;
    -webkit-mask-composite: xor, source-over;
    mask-composite: exclude, add;
}

.arn-puzzle-card:nth-child(1) .arn-puzzle-inner {
    padding: 1.5rem 3.25rem 2.75rem 1.5rem;
}

/* Pieza 2 (Superior Derecha) */
.arn-puzzle-card:nth-child(2) {
    height: calc(100% + 28px);
    z-index: 2;
    -webkit-mask-image: var(--pz-tab-right), var(--pz-tab-bottom), var(--pz-body);
    mask-image: var(--pz-tab-right), var(--pz-tab-bottom), var(--pz-body);
    -webkit-mask-size: 28px 64px, 64px 28px, 100% calc(100% - 28px);
    mask-size: 28px 64px, 64px 28px, 100% calc(100% - 28px);
    -webkit-mask-position: 0 calc(50% - 14px), 50% 100%, 0 0;
    mask-position: 0 calc(50% - 14px), 50% 100%, 0 0;
    -webkit-mask-composite: xor, source-over;
    mask-composite: exclude, add;
}

.arn-puzzle-card:nth-child(2) .arn-puzzle-inner {
    padding: 1.5rem 1.5rem 3.25rem 2.75rem;
}

/* Pieza 3 (Inferior Izquierda) */
.arn-puzzle-card:nth-child(3) {
    margin-top: -28px;
    height: calc(100% + 28px);
    z-index: 2;
    -webkit-mask-image: var(--pz-tab-left), var(--pz-tab-top), var(--pz-body);
    mask-image: var(--pz-tab-left), var(--pz-tab-top), var(--pz-body);
    -webkit-mask-size: 28px 64px, 64px 28px, 100% calc(100% - 28px);
    mask-size: 28px 64px, 64px 28px, 100% calc(100% - 28px);
    -webkit-mask-position: 100% calc(50% + 14px), 50% 0, 0 28px;
    mask-position: 100% calc(50% + 14px), 50% 0, 0 28px;
    -webkit-mask-composite: xor, source-over;
    mask-composite: exclude, add;
}

.arn-puzzle-card:nth-child(3) .arn-puzzle-inner {
    padding: 3.25rem 2.75rem 1.5rem 1.5rem;
}

/* Pieza 4 (Inferior Derecha) */
.arn-puzzle-card:nth-child(4) {
    margin-left: -28px;
    width: calc(100% + 28px);
    z-index: 2;
    -webkit-mask-image: var(--pz-tab-bottom), var(--pz-tab-left), var(--pz-body);
    mask-image: var(--pz-tab-bottom), var(--pz-tab-left), var(--pz-body);
    -webkit-mask-size: 64px 28px, 28px 64px, calc(100% - 28px) 100%;
    mask-size: 64px 28px, 28px 64px, calc(100% - 28px) 100%;
    -webkit-mask-position: calc(50% + 14px) 0, 0 50%, 28px 0;
    mask-position: calc(50% + 14px) 0, 0 50%, 28px 0;
    -webkit-mask-composite: xor, source-over;
    mask-composite: exclude, add;
}

.arn-puzzle-card:nth-child(4) .arn-puzzle-inner {
    padding: 2.75rem 1.5rem 1.5rem 3.25rem;
}

/* --- Botones internos de las piezas de rompecabezas --- */
.arn-puzzle-footer {
    margin-top: auto;
    padding-top: 1.15rem;
    width: 100%;
    display: flex;
    align-items: center;
}

.arn-container .arn-puzzle-btn,
.arn-container .arn-puzzle-btn:visited {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--arn-blue);
    color: #FFFFFF !important;
    font-weight: 700;
    font-size: 0.88rem;
    padding: 9px 18px;
    border-radius: 999px;
    text-decoration: none !important;
    border: 1px solid transparent;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0, 56, 118, 0.2);
}

.arn-container .arn-puzzle-btn:hover,
.arn-container .arn-puzzle-btn:focus {
    background: var(--arn-blue-dark);
    color: #FFFFFF !important;
    transform: translateY(-2px);
}

.arn-container .arn-puzzle-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.3;
    flex-shrink: 0;
}

.arn-container .arn-puzzle-btn--soon,
.arn-container .arn-puzzle-btn--soon:visited {
    background: rgba(255, 255, 255, 0.75);
    color: var(--text-muted) !important;
    border: 1px dashed #94A3B8;
    box-shadow: none;
    cursor: default;
}

.arn-container .arn-puzzle-btn--soon:hover,
.arn-container .arn-puzzle-btn--soon:focus {
    background: rgba(255, 255, 255, 0.75);
    color: var(--text-muted) !important;
    transform: none;
}

/* Colores institucionales suaves por pieza */
.puzzle-blue {
    background: #EBF3FA;
}

.puzzle-gold {
    background: #FEFCE8;
}

.puzzle-sky {
    background: #E0F2FE;
}

.puzzle-slate {
    background: #F1F5F9;
}

/* Vista Tablet Pequeña / Móvil (<= 820px): cadena vertical de piezas encajadas */
@media (max-width: 820px) {
    .arn-puzzle-grid {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    /* Pieza 1 móvil */
    .arn-puzzle-card:nth-child(1) {
        width: 100%;
        margin-left: 0;
        height: calc(100% + 28px);
        -webkit-mask-image: var(--pz-tab-bottom), var(--pz-body);
        mask-image: var(--pz-tab-bottom), var(--pz-body);
        -webkit-mask-size: 64px 28px, 100% calc(100% - 28px);
        mask-size: 64px 28px, 100% calc(100% - 28px);
        -webkit-mask-position: 50% 100%, 0 0;
        mask-position: 50% 100%, 0 0;
        -webkit-mask-composite: source-over;
        mask-composite: add;
    }

    .arn-puzzle-card:nth-child(1) .arn-puzzle-inner {
        padding: 1.5rem 1.35rem 3.25rem 1.35rem;
    }

    /* Piezas 2 y 3 móvil */
    .arn-puzzle-card:nth-child(2),
    .arn-puzzle-card:nth-child(3) {
        margin-top: -28px;
        margin-left: 0;
        width: 100%;
        height: calc(100% + 28px);
        -webkit-mask-image: var(--pz-tab-bottom), var(--pz-tab-bottom), var(--pz-body);
        mask-image: var(--pz-tab-bottom), var(--pz-tab-bottom), var(--pz-body);
        -webkit-mask-size: 64px 28px, 64px 28px, 100% calc(100% - 28px);
        mask-size: 64px 28px, 64px 28px, 100% calc(100% - 28px);
        -webkit-mask-position: 50% 0, 50% 100%, 0 0;
        mask-position: 50% 0, 50% 100%, 0 0;
        -webkit-mask-composite: xor, source-over;
        mask-composite: exclude, add;
    }

    .arn-puzzle-card:nth-child(2) .arn-puzzle-inner,
    .arn-puzzle-card:nth-child(3) .arn-puzzle-inner {
        padding: 2.75rem 1.35rem 3.25rem 1.35rem;
    }

    /* Pieza 4 móvil */
    .arn-puzzle-card:nth-child(4) {
        margin-top: -28px;
        margin-left: 0;
        width: 100%;
        height: 100%;
        -webkit-mask-image: var(--pz-tab-bottom), var(--pz-body);
        mask-image: var(--pz-tab-bottom), var(--pz-body);
        -webkit-mask-size: 64px 28px, 100% 100%;
        mask-size: 64px 28px, 100% 100%;
        -webkit-mask-position: 50% 0, 0 0;
        mask-position: 50% 0, 0 0;
        -webkit-mask-composite: xor;
        mask-composite: exclude;
    }

    .arn-puzzle-card:nth-child(4) .arn-puzzle-inner {
        padding: 2.75rem 1.35rem 1.5rem 1.35rem;
    }
}

/* ======================================================
   Ajustes Globales para Celulares (<= 768px)
   ====================================================== */
@media (max-width: 768px) {
    .arn-container {
        padding: 1rem 0.75rem;
    }

    /* Hero en móvil */
    .arn-hero-header {
        padding: 1.75rem 1.15rem;
        border-radius: var(--radius-md);
    }

    .arn-hero-header p {
        text-align: left;
        /* Evita huecos gigantes entre palabras en móvil */
    }

    /* Apilamiento de elementos en columna */
    .arn-pub-item,
    .arn-step-card,
    .arn-box-info,
    .arn-box-alert,
    .arn-box-note {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 1rem;
    }

    /* Tarjetas de la grilla */
    .arn-card {
        padding: 1rem;
        flex-direction: row;
        align-items: center;
        gap: 0.9rem;
    }

    .arn-card-icon-wrap {
        width: 44px;
        height: 44px;
    }

    /* Botones al 100% de ancho en móvil */
    .arn-pub-item .arn-btn-primary,
    .arn-footer-card .arn-btn-primary,
    .arn-puzzle-footer,
    .arn-container .arn-puzzle-btn {
        width: 100%;
    }

    .arn-puzzle-footer {
        flex-direction: column;
    }

    /* Footer */
    .arn-footer-card {
        flex-direction: column;
        text-align: center;
        justify-content: center;
        gap: 1rem;
        padding: 1.25rem 1rem;
    }

    /* Pestañas */
    .arn-tab-nav {
        padding: 6px;
    }

    .arn-tab-btn {
        min-width: 145px;
        padding: 10px 12px;
        font-size: 0.85rem;
    }

    /* Toast centrado en móvil */
    .arn-toast {
        left: 16px;
        right: 16px;
        bottom: 16px;
        max-width: none;
        text-align: center;
    }
}

/* ======================================================
   Celulares muy pequeños (<= 400px)
   ====================================================== */
@media (max-width: 400px) {
    .arn-container {
        padding: 0.75rem 0.5rem;
    }

    .arn-card {
        flex-direction: column;
        align-items: flex-start;
    }
}