/* ============================================================
   🖐️ ATLAS ANATÓMICO v14.0 — estética Pixar × Imperial
   Mapa interactivo sobre render 3D + panel explicativo
   ============================================================ */

.atlas {
    position: relative;
    margin: 34px 0;
    padding: clamp(18px, 3vw, 34px);
    border-radius: 30px;
    background:
        radial-gradient(120% 90% at 12% 0%, rgba(124, 58, 237, 0.20), transparent 60%),
        linear-gradient(165deg, rgba(30, 12, 58, 0.94), rgba(16, 6, 34, 0.97));
    border: 1px solid rgba(212, 175, 55, 0.30);
    box-shadow:
        0 34px 80px -28px rgba(0, 0, 0, 0.85),
        inset 0 1px 0 rgba(255, 255, 255, 0.07);
    overflow: hidden;
    contain: layout style;
}
.atlas::before {
    content: '';
    position: absolute; inset: 0;
    background: conic-gradient(from 210deg at 50% -10%,
        transparent, rgba(212, 175, 55, 0.10), transparent 40%);
    pointer-events: none;
}

/* ── Cabecera ── */
.atlas-head { position: relative; text-align: center; margin-bottom: 20px; }
.atlas-title {
    margin: 0 0 8px;
    font-size: clamp(1.35rem, 3.4vw, 2.05rem);
    font-weight: 800;
    letter-spacing: 0.01em;
    background: linear-gradient(100deg, #f8ecc2 8%, #d4af37 34%, #fff6d8 52%, #c9a227 70%, #f8ecc2 92%);
    background-size: 250% 100%;
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: atlasFoil 7s linear infinite;
}
@keyframes atlasFoil { to { background-position: 250% 0; } }
.atlas-title-icon {
    -webkit-text-fill-color: initial;
    filter: drop-shadow(0 3px 8px rgba(212, 175, 55, 0.5));
}
.atlas-sub {
    margin: 0 auto;
    max-width: 62ch;
    color: rgba(233, 226, 255, 0.72);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ── Selector de mano ── */
.atlas-side-switch {
    position: relative;
    display: flex; gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 22px;
}
.atlas-side-btn {
    display: flex; align-items: center; gap: 11px;
    min-height: 44px;
    padding: 10px 18px;
    border-radius: 16px;
    cursor: pointer;
    background: rgba(124, 58, 237, 0.14);
    border: 1px solid rgba(212, 175, 55, 0.24);
    color: rgba(233, 226, 255, 0.80);
    font-family: inherit;
    transition: transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1),
                background 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.atlas-side-btn:hover { transform: translateY(-3px) scale(1.02); }
.atlas-side-btn.is-active {
    background: linear-gradient(140deg, rgba(212, 175, 55, 0.28), rgba(124, 58, 237, 0.30));
    border-color: rgba(244, 221, 154, 0.72);
    color: #fff8e2;
    box-shadow: 0 12px 30px -12px rgba(212, 175, 55, 0.6),
                inset 0 1px 0 rgba(255, 255, 255, 0.16);
}
.atlas-side-emoji { font-size: 1.5rem; line-height: 1; }
.atlas-side-txt { display: flex; flex-direction: column; text-align: left; line-height: 1.25; }
.atlas-side-txt strong { font-size: 0.95rem; font-weight: 700; }
.atlas-side-txt em { font-size: 0.74rem; opacity: 0.72; font-style: normal; }

/* ── 👁️ Conmutador render 3D ↔ foto real ── */
.atlas-mode-switch {
    position: relative;
    display: flex; gap: 6px;
    justify-content: center;
    margin: 0 auto 20px;
    padding: 5px;
    width: fit-content;
    border-radius: 999px;
    background: rgba(12, 4, 26, 0.65);
    border: 1px solid rgba(212, 175, 55, 0.24);
}
.atlas-mode-btn {
    display: inline-flex; align-items: center; gap: 7px;
    min-height: 40px;
    padding: 8px 17px;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    font-family: inherit; font-size: 0.84rem; font-weight: 600;
    color: rgba(233, 226, 255, 0.72);
    background: transparent;
    transition: background 0.3s, color 0.3s, box-shadow 0.3s;
}
.atlas-mode-btn:hover { color: #fff8e2; }
.atlas-mode-btn.is-active {
    color: #1a0b33;
    background: linear-gradient(135deg, #f8ecc2, #d4af37);
    box-shadow: 0 6px 18px -8px rgba(212, 175, 55, 0.9);
}
.atlas-mode-btn:focus-visible { outline: 2px solid #f4dd9a; outline-offset: 2px; }

/* La foto real se muestra completa (sin recorte) para que el mapa encaje */
.atlas-render.is-photo {
    object-fit: contain;
    animation: none;
    filter: saturate(1.05) contrast(1.03);
}

/* ── Botón de herramienta (medidas reales) ── */
.atlas-tool {
    display: inline-flex; align-items: center; gap: 8px;
    min-height: 44px;
    padding: 8px 17px;
    border-radius: 999px;
    cursor: pointer;
    font-family: inherit; font-size: 0.85rem; font-weight: 600;
    color: #f8ecc2;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.26), rgba(124, 58, 237, 0.26));
    border: 1px solid rgba(244, 221, 154, 0.5);
    transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.28s;
}
.atlas-tool:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px -12px rgba(212, 175, 55, 0.8);
}
.atlas-tool:focus-visible { outline: 2px solid #f4dd9a; outline-offset: 2px; }

/* ── 📐 Tabla de métricas medidas ── */
.atlas-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px 14px;
    margin: 0;
}
.atlas-metric {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 10px;
    padding: 5px 9px;
    border-radius: 9px;
    background: rgba(0, 0, 0, 0.22);
}
.atlas-metric dt {
    font-size: 0.76rem;
    color: rgba(226, 220, 250, 0.72);
}
.atlas-metric dd {
    margin: 0;
    font-size: 0.86rem; font-weight: 700;
    color: #fff8e2;
    font-variant-numeric: tabular-nums;
}
@media (max-width: 560px) { .atlas-metrics { grid-template-columns: 1fr; } }

/* ── Cuerpo: escenario + panel ── */
.atlas-body {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
    gap: clamp(16px, 2.6vw, 30px);
    align-items: start;
}

/* ── Escenario del render 3D ── */
.atlas-stage {
    position: relative;
    margin: 0;
    border-radius: 26px;
    overflow: hidden;
    aspect-ratio: 3 / 4;
    background: radial-gradient(ellipse at 50% 42%, rgba(76, 29, 149, 0.55), rgba(12, 4, 26, 0.96));
    border: 1px solid rgba(212, 175, 55, 0.24);
    box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.6);
    contain: layout paint style;
}
.atlas-glow {
    position: absolute; inset: 0;
    background: radial-gradient(circle at 54% 54%, rgba(244, 221, 154, 0.16), transparent 58%);
    pointer-events: none; z-index: 2;
    animation: atlasBreathe 6s ease-in-out infinite;
}
@keyframes atlasBreathe {
    0%, 100% { opacity: 0.55; transform: scale(1); }
    50%      { opacity: 1;    transform: scale(1.06); }
}
.atlas-render {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    z-index: 1;
    animation: atlasFloat 9s ease-in-out infinite;
}

/* Mano izquierda = la derecha reflejada.
   Se usa la propiedad independiente `scale` en vez de `transform` porque
   ese canal ya lo ocupan las animaciones de flotación y de volteo: así el
   espejo compone con ellas en lugar de pisarlas. En modo foto NO se
   refleja, porque ahí la matriz se calcula sobre la imagen real.
   Resultado: la mano izquierda cuesta 0 bytes en vez de 4,9 MB. */
.atlas-stage[data-side="left"] .atlas-render:not(.is-photo) { scale: -1 1; }
@keyframes atlasFloat {
    0%, 100% { transform: translateY(0) scale(1.005); }
    50%      { transform: translateY(-9px) scale(1.02); }
}
.atlas-stage.atlas-flip .atlas-render { animation: atlasFlipIn 720ms cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes atlasFlipIn {
    0%   { transform: perspective(900px) rotateY(-52deg) scale(0.9); opacity: 0.25; filter: blur(6px); }
    100% { transform: perspective(900px) rotateY(0) scale(1);        opacity: 1;    filter: blur(0); }
}

.atlas-svg {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    z-index: 3;
    overflow: visible;
}
.atlas-caption {
    position: absolute; left: 0; right: 0; bottom: 0;
    z-index: 4;
    padding: 22px 14px 12px;
    font-size: 0.8rem;
    text-align: center;
    color: rgba(255, 246, 216, 0.92);
    background: linear-gradient(to top, rgba(10, 3, 22, 0.92), transparent);
    pointer-events: none;
}

/* ── Puntos activos del mapa ── */
.atlas-g.is-hidden { display: none; }

/* Zona táctil ampliada (invisible) */
.atlas-hit {
    fill: none;
    stroke: transparent;
    stroke-width: 7;
    pointer-events: stroke;
    cursor: pointer;
}

.atlas-line {
    fill: none;
    stroke-linecap: round;
    filter: drop-shadow(0 0 1.6px currentColor);
    opacity: 0.88;
    cursor: pointer;
    pointer-events: stroke;
    transition: stroke-width 0.28s, opacity 0.28s, filter 0.28s;
    animation: atlasLineDraw 2.4s ease-out backwards;
    stroke-dasharray: 100; stroke-dashoffset: 0;
}
@keyframes atlasLineDraw {
    from { stroke-dashoffset: 100; opacity: 0; }
    to   { stroke-dashoffset: 0;   opacity: 0.88; }
}
.atlas-line:hover, .atlas-line:focus-visible { opacity: 1; stroke-width: 2.4; outline: none; }
.atlas-line.is-active {
    opacity: 1;
    stroke-width: 2.6;
    filter: drop-shadow(0 0 4px currentColor) drop-shadow(0 0 9px currentColor);
    animation: atlasLinePulse 1.7s ease-in-out infinite;
}
@keyframes atlasLinePulse {
    0%, 100% { stroke-width: 2.4; }
    50%      { stroke-width: 3.2; }
}

/* ═══════════════════════════════════════════
   🔪 PLIEGUES MEDIDOS (v16) — trazado real de la foto
   Se distinguen de la plantilla: núcleo brillante,
   doble halo y un guionado técnico sutil al aparecer.
   ═══════════════════════════════════════════ */
.atlas-line--measured {
    opacity: 0.97;
    filter:
        drop-shadow(0 0 1.4px #fff)
        drop-shadow(0 0 4px currentColor)
        drop-shadow(0 0 10px currentColor);
    stroke-linejoin: round;
    animation: atlasMeasuredDraw 1.9s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}
@keyframes atlasMeasuredDraw {
    from { stroke-dashoffset: 100; opacity: 0; filter: none; }
    60%  { opacity: 1; }
    to   { stroke-dashoffset: 0;   opacity: 0.97; }
}
.atlas-line--measured.is-active {
    filter:
        drop-shadow(0 0 2px #fff)
        drop-shadow(0 0 7px currentColor)
        drop-shadow(0 0 18px currentColor);
}

/* Insignia "medido" en las tarjetas del panel */
.atlas-measured-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.34em;
    padding: 0.16em 0.62em;
    margin-left: 0.5em;
    border-radius: 999px;
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #052e1a;
    background: linear-gradient(135deg, #6ee7b7, #34d399);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset,
                0 2px 6px -1px rgba(16, 185, 129, 0.55);
    vertical-align: middle;
    white-space: nowrap;
}
.atlas-measured-badge i { font-size: 0.62rem; }

/* Bloque de precisión quirúrgica dentro de la tarjeta de línea */
.atlas-precision {
    margin-top: 0.7rem;
    padding: 0.66rem 0.8rem;
    border-radius: 12px;
    border: 1px solid rgba(110, 231, 183, 0.28);
    background: linear-gradient(145deg, rgba(16, 185, 129, 0.11), rgba(16, 185, 129, 0.03));
}
.atlas-precision-title {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6ee7b7;
    margin-bottom: 0.45rem;
    display: flex; align-items: center; gap: 0.4em;
}
.atlas-precision-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
    gap: 0.4rem 0.7rem;
}
.atlas-precision-item {
    display: flex; flex-direction: column; gap: 0.1rem;
    font-size: 0.72rem;
}
.atlas-precision-item b {
    font-size: 0.62rem; font-weight: 700; letter-spacing: 0.05em;
    text-transform: uppercase; color: rgba(226, 232, 240, 0.6);
}
.atlas-precision-item span {
    font-weight: 700; color: #ecfdf5; font-variant-numeric: tabular-nums;
}

/* ═══════════════════════════════════════════
   🕸️ LÍNEAS MENORES MEDIDAS (v16.1)
   Trazos finos extraídos del esqueleto real. Se diferencian
   de los nodos de plantilla (.atlas-minor) por ser polilíneas.
   ═══════════════════════════════════════════ */
.atlas-minor-line {
    fill: none;
    stroke: #6ee7b7;
    stroke-width: 0.9;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.9;
    cursor: pointer;
    pointer-events: stroke;
    filter: drop-shadow(0 0 1px #34d399) drop-shadow(0 0 3.5px rgba(16, 185, 129, 0.7));
    stroke-dasharray: 100;
    stroke-dashoffset: 0;
    transition: stroke-width 0.26s, opacity 0.26s, filter 0.26s, stroke 0.26s;
    animation: atlasMinorDraw 1.6s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}
@keyframes atlasMinorDraw {
    from { stroke-dashoffset: 100; opacity: 0; }
    to   { stroke-dashoffset: 0;   opacity: 0.9; }
}
.atlas-minor-line:hover,
.atlas-minor-line:focus-visible {
    stroke: #d1fae5;
    stroke-width: 1.5;
    opacity: 1;
    outline: none;
}
.atlas-minor-line.is-active {
    stroke: #ecfdf5;
    stroke-width: 1.7;
    opacity: 1;
    filter: drop-shadow(0 0 2px #fff) drop-shadow(0 0 6px #34d399) drop-shadow(0 0 14px #10b981);
    animation: atlasMinorPulse 1.7s ease-in-out infinite;
}
@keyframes atlasMinorPulse {
    0%, 100% { stroke-width: 1.5; }
    50%      { stroke-width: 2.2; }
}

/* ═══════════════════════════════════════════
   🔺 MARCAS ESPECIALES MEDIDAS (v16.1)
   Glifo vectorial dorado sobre disco de respaldo, situado
   en el nodo exacto del esqueleto donde se detectó.
   ═══════════════════════════════════════════ */
.atlas-g-marks { pointer-events: none; }

.atlas-mark {
    cursor: pointer;
    pointer-events: auto;
    transform-box: view-box;
    transform-origin: center;
    animation: atlasMarkPop 0.72s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
    animation-delay: calc(0.9s + var(--mark-i, 0) * 0.11s);
}
@keyframes atlasMarkPop {
    from { opacity: 0; }
    55%  { opacity: 1; }
    to   { opacity: 1; }
}

.atlas-mark-halo {
    fill: rgba(26, 7, 51, 0.62);
    stroke: rgba(244, 221, 154, 0.42);
    stroke-width: 0.45;
    transition: fill 0.26s, stroke 0.26s, r 0.26s;
    filter: drop-shadow(0 0 3px rgba(10, 2, 24, 0.85));
}

.atlas-mark-glyph {
    fill: none;
    stroke: #fbf0cd;
    stroke-width: 0.78;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
    filter: drop-shadow(0 0 1.4px #d4af37) drop-shadow(0 0 4px rgba(212, 175, 55, 0.8));
    transition: stroke 0.26s, stroke-width 0.26s, filter 0.26s;
}
/* Glifos cerrados (relleno translúcido para leerse mejor) */
.atlas-mark[data-id="triangle"] .atlas-mark-glyph,
.atlas-mark[data-id="square"]   .atlas-mark-glyph,
.atlas-mark[data-id="star"]     .atlas-mark-glyph,
.atlas-mark[data-id="island"]   .atlas-mark-glyph,
.atlas-mark[data-id="fish"]     .atlas-mark-glyph {
    fill: rgba(244, 221, 154, 0.22);
}
.atlas-mark[data-id="dot"] .atlas-mark-glyph { fill: #fbf0cd; }

/* Marcas favorables → oro cálido · desfavorables → ámbar frío */
.atlas-mark[data-id="island"] .atlas-mark-glyph,
.atlas-mark[data-id="grill"]  .atlas-mark-glyph,
.atlas-mark[data-id="tassel"] .atlas-mark-glyph,
.atlas-mark[data-id="chain"]  .atlas-mark-glyph {
    stroke: #fca5a5;
    filter: drop-shadow(0 0 1.4px #f87171) drop-shadow(0 0 4px rgba(248, 113, 113, 0.7));
}
.atlas-mark[data-id="island"] .atlas-mark-glyph { fill: rgba(248, 113, 113, 0.18); }

.atlas-mark:hover,
.atlas-mark:focus-visible { outline: none; }
.atlas-mark:hover .atlas-mark-halo,
.atlas-mark:focus-visible .atlas-mark-halo {
    fill: rgba(76, 29, 149, 0.78);
    stroke: rgba(255, 246, 216, 0.95);
    stroke-width: 0.6;
}
.atlas-mark:hover .atlas-mark-glyph,
.atlas-mark:focus-visible .atlas-mark-glyph {
    stroke: #fff;
    stroke-width: 1;
}
.atlas-mark.is-active .atlas-mark-halo {
    fill: rgba(124, 58, 237, 0.82);
    stroke: #fff6d8;
    stroke-width: 0.7;
    animation: atlasMarkRing 1.8s ease-in-out infinite;
}
@keyframes atlasMarkRing {
    0%, 100% { r: 4.6; }
    50%      { r: 5.6; }
}
.atlas-mark.is-active .atlas-mark-glyph {
    stroke: #fff;
    stroke-width: 1.05;
    filter: drop-shadow(0 0 2px #fff) drop-shadow(0 0 7px #d4af37);
}

/* Tarjeta del panel para una marca medida */
.atlas-card--mark .atlas-card-emoji { filter: drop-shadow(0 0 6px rgba(212, 175, 55, 0.6)); }

.atlas-mark-zone {
    margin-top: 0.7rem;
    padding: 0.6rem 0.8rem;
    border-radius: 12px;
    border: 1px solid rgba(244, 221, 154, 0.26);
    background: linear-gradient(145deg, rgba(212, 175, 55, 0.12), rgba(212, 175, 55, 0.03));
    font-size: 0.82rem;
    line-height: 1.5;
    color: rgba(255, 246, 216, 0.92);
}
.atlas-mark-zone strong { color: #f4dd9a; }

[data-theme="light"] .atlas-mark-zone { color: #4a3407; }

@media (prefers-reduced-motion: reduce) {
    .atlas-line--measured,
    .atlas-minor-line,
    .atlas-mark { animation: none; }
    .atlas-minor-line.is-active,
    .atlas-mark.is-active .atlas-mark-halo { animation: none; }
}

/* ═══════════════════════════════════════════
   🔪 Insignias "medido" en las tarjetas de resultados
   (marcas especiales y líneas menores)
   ═══════════════════════════════════════════ */
.measured-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.32em;
    padding: 0.14em 0.56em;
    margin-left: 0.5em;
    border-radius: 999px;
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #052e1a;
    background: linear-gradient(135deg, #6ee7b7, #34d399);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45),
                0 2px 5px -1px rgba(16, 185, 129, 0.5);
    vertical-align: middle;
    white-space: nowrap;
}
.measured-tag i { font-size: 0.56rem; }

.mark-card.is-measured,
.minor-line-card.is-measured {
    border-left: 3px solid #34d399;
    background-image: linear-gradient(90deg, rgba(16, 185, 129, 0.09), transparent 42%);
}

.mark-location,
.minor-measure {
    font-size: 0.72rem;
    color: #6ee7b7;
    margin: 0.22rem 0 0.3rem;
    display: flex;
    align-items: flex-start;
    gap: 0.4em;
    line-height: 1.4;
}
.mark-location i,
.minor-measure i { margin-top: 0.18em; flex-shrink: 0; }

[data-theme="light"] .mark-location,
[data-theme="light"] .minor-measure { color: #047857; }

.atlas-mount, .atlas-finger, .atlas-minor {
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.28s, filter 0.28s;
    transform-box: fill-box; transform-origin: center;
}
.atlas-mount {
    fill: rgba(212, 175, 55, 0.10);
    stroke: rgba(244, 221, 154, 0.55);
    stroke-width: 0.5;
    stroke-dasharray: 2 1.6;
}
.atlas-mount--prominent {
    fill: rgba(244, 221, 154, 0.20);
    stroke: rgba(255, 246, 216, 0.9);
    stroke-dasharray: none;
}
.atlas-mount--overdeveloped {
    fill: rgba(244, 114, 182, 0.18);
    stroke: rgba(251, 146, 190, 0.85);
    stroke-dasharray: none;
}
.atlas-mount--flat { fill: rgba(148, 163, 184, 0.10); stroke: rgba(203, 213, 225, 0.5); }
.atlas-mount:hover, .atlas-mount:focus-visible,
.atlas-finger:hover, .atlas-finger:focus-visible,
.atlas-minor:hover, .atlas-minor:focus-visible { transform: scale(1.18); outline: none; }
.atlas-mount.is-active, .atlas-finger.is-active, .atlas-minor.is-active {
    filter: drop-shadow(0 0 5px rgba(251, 240, 205, 0.95));
    stroke-width: 0.9;
    animation: atlasNodePulse 1.8s ease-in-out infinite;
}
@keyframes atlasNodePulse {
    0%, 100% { transform: scale(1);    }
    50%      { transform: scale(1.14); }
}

.atlas-finger {
    fill: rgba(103, 232, 249, 0.14);
    stroke: rgba(165, 243, 252, 0.7);
    stroke-width: 0.5;
}
.atlas-minor.is-present {
    fill: rgba(52, 211, 153, 0.22);
    stroke: rgba(110, 231, 183, 0.85);
    stroke-width: 0.5;
}
.atlas-minor.is-absent {
    fill: rgba(148, 163, 184, 0.08);
    stroke: rgba(148, 163, 184, 0.42);
    stroke-width: 0.4;
    stroke-dasharray: 1.4 1.4;
}

.atlas-mount-glyph, .atlas-finger-glyph {
    font-size: 3.4px;
    text-anchor: middle;
    fill: rgba(255, 250, 235, 0.94);
    pointer-events: none;
    user-select: none;
}
.atlas-finger-glyph { font-size: 3px; }

/* ── Panel explicativo ── */
.atlas-panel {
    position: relative;
    min-height: 340px;
    border-radius: 24px;
    padding: clamp(15px, 2.2vw, 24px);
    background: linear-gradient(170deg, rgba(46, 20, 84, 0.62), rgba(18, 7, 38, 0.86));
    border: 1px solid rgba(212, 175, 55, 0.22);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.atlas-panel-in { animation: atlasPanelIn 560ms cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes atlasPanelIn {
    0%   { opacity: 0; transform: translateY(14px) scale(0.985); }
    100% { opacity: 1; transform: translateY(0)    scale(1);     }
}
.atlas-empty {
    display: grid; place-items: center;
    min-height: 300px;
    color: rgba(233, 226, 255, 0.55);
    text-align: center;
    font-size: 0.95rem;
}

.atlas-card { --card-accent: #d4af37; }
.atlas-card-head {
    display: flex; align-items: center; gap: 13px;
    padding-bottom: 14px; margin-bottom: 15px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.22);
}
.atlas-card-emoji {
    flex: 0 0 auto;
    display: grid; place-items: center;
    width: 52px; height: 52px;
    font-size: 1.6rem;
    border-radius: 16px;
    background: radial-gradient(circle at 34% 28%,
        color-mix(in srgb, var(--card-accent) 42%, transparent),
        rgba(30, 12, 58, 0.9));
    border: 1px solid color-mix(in srgb, var(--card-accent) 52%, transparent);
    box-shadow: 0 8px 22px -10px color-mix(in srgb, var(--card-accent) 70%, transparent),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.atlas-card-title {
    margin: 0 0 6px;
    font-size: clamp(1.05rem, 2.2vw, 1.32rem);
    font-weight: 800;
    color: #fff8e2;
    line-height: 1.25;
}
.atlas-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.atlas-chip {
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.71rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    border: 1px solid transparent;
}
.atlas-chip--gold   { background: rgba(212, 175, 55, 0.20); color: #f8ecc2; border-color: rgba(244, 221, 154, 0.45); }
.atlas-chip--violet { background: rgba(124, 58, 237, 0.24); color: #ddd6fe; border-color: rgba(167, 139, 250, 0.45); }
.atlas-chip--warn   { background: rgba(244, 114, 182, 0.20); color: #fbcfe8; border-color: rgba(251, 146, 190, 0.45); }
.atlas-chip--neutral{ background: rgba(148, 163, 184, 0.16); color: #e2e8f0; border-color: rgba(203, 213, 225, 0.35); }

/* Veredicto destacado */
.atlas-verdict {
    display: flex; flex-direction: column; gap: 3px;
    padding: 13px 16px;
    margin-bottom: 15px;
    border-radius: 15px;
    background: linear-gradient(105deg,
        color-mix(in srgb, var(--card-accent) 22%, transparent),
        rgba(124, 58, 237, 0.14));
    border-left: 4px solid var(--card-accent);
}
.atlas-verdict-label {
    font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.14em;
    color: rgba(233, 226, 255, 0.66);
}
.atlas-verdict-value { font-size: 1.08rem; font-weight: 800; color: #fff8e2; line-height: 1.3; }
.atlas-verdict--good { border-left-color: #6ee7b7; }
.atlas-verdict--warn { border-left-color: #fb92be; }
.atlas-verdict--neutral { border-left-color: #cbd5e1; }

/* Bloques de contenido */
.atlas-block { margin-bottom: 13px; }
.atlas-block h4 {
    display: flex; align-items: center; gap: 7px;
    margin: 0 0 5px;
    font-size: 0.76rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.1em;
    color: rgba(244, 221, 154, 0.85);
}
.atlas-block h4 i { font-size: 0.8rem; opacity: 0.9; }
.atlas-block p {
    margin: 0;
    font-size: 0.92rem; line-height: 1.65;
    color: rgba(240, 235, 255, 0.88);
}
.atlas-block--primary {
    padding: 12px 14px;
    border-radius: 13px;
    background: rgba(124, 58, 237, 0.13);
    border: 1px solid rgba(167, 139, 250, 0.20);
}
.atlas-block--gold {
    padding: 12px 14px;
    border-radius: 13px;
    background: rgba(212, 175, 55, 0.11);
    border: 1px solid rgba(244, 221, 154, 0.24);
}
.atlas-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.atlas-hand-note {
    display: flex; gap: 9px; align-items: flex-start;
    padding: 11px 14px; margin-bottom: 13px;
    border-radius: 13px;
    background: rgba(244, 221, 154, 0.08);
    border: 1px dashed rgba(244, 221, 154, 0.34);
    font-size: 0.88rem; line-height: 1.6;
    color: rgba(248, 236, 194, 0.92);
}
.atlas-hand-note i { margin-top: 3px; color: #f4dd9a; }
.atlas-absent-note {
    margin: 10px 0 0;
    padding: 10px 13px;
    border-radius: 12px;
    background: rgba(148, 163, 184, 0.10);
    font-size: 0.85rem; line-height: 1.6;
    color: rgba(226, 232, 240, 0.78);
}

.atlas-card-foot {
    margin-top: 15px; padding-top: 13px;
    border-top: 1px solid rgba(212, 175, 55, 0.18);
}
.atlas-card-foot p {
    margin: 0 0 6px;
    font-size: 0.82rem; line-height: 1.6;
    color: rgba(226, 220, 250, 0.70);
}
.atlas-card-foot p:last-child { margin-bottom: 0; }
.atlas-card-foot strong { color: rgba(244, 221, 154, 0.9); }
.atlas-tradition { font-style: italic; }

/* ── Leyenda de capas ── */
.atlas-legend {
    position: relative;
    display: flex; flex-wrap: wrap; gap: 9px;
    justify-content: center;
    margin-top: 20px;
}
.atlas-layer {
    display: inline-flex; align-items: center; gap: 8px;
    min-height: 44px;
    padding: 8px 15px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.85rem;
    color: rgba(233, 226, 255, 0.78);
    background: rgba(124, 58, 237, 0.12);
    border: 1px solid rgba(212, 175, 55, 0.20);
    transition: background 0.28s, border-color 0.28s, transform 0.28s;
}
.atlas-layer:hover { transform: translateY(-2px); background: rgba(124, 58, 237, 0.20); }
.atlas-layer input { position: absolute; opacity: 0; width: 0; height: 0; }
.atlas-layer-dot {
    width: 11px; height: 11px; border-radius: 50%;
    background: rgba(148, 163, 184, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.25);
    transition: background 0.28s, box-shadow 0.28s;
}
.atlas-layer--lines   input:checked ~ .atlas-layer-dot { background: #a78bfa; box-shadow: 0 0 9px #a78bfa; }
.atlas-layer--mounts  input:checked ~ .atlas-layer-dot { background: #f4dd9a; box-shadow: 0 0 9px #f4dd9a; }
.atlas-layer--fingers input:checked ~ .atlas-layer-dot { background: #67e8f9; box-shadow: 0 0 9px #67e8f9; }
.atlas-layer--minor   input:checked ~ .atlas-layer-dot { background: #6ee7b7; box-shadow: 0 0 9px #6ee7b7; }
.atlas-layer--marks   input:checked ~ .atlas-layer-dot { background: #f9a8d4; box-shadow: 0 0 9px #f9a8d4; }
.atlas-layer:focus-within {
    outline: 2px solid rgba(244, 221, 154, 0.8);
    outline-offset: 2px;
}

/* ── Responsive ── */
@media (max-width: 980px) {
    .atlas-body { grid-template-columns: 1fr; }
    .atlas-stage { max-width: 440px; margin: 0 auto; }
    .atlas-panel { min-height: 0; }
}
@media (max-width: 560px) {
    .atlas { padding: 14px; border-radius: 22px; }
    .atlas-grid2 { grid-template-columns: 1fr; }
    .atlas-side-txt em { display: none; }
    .atlas-mount-glyph { font-size: 4px; }
    .atlas-card-emoji { width: 44px; height: 44px; font-size: 1.35rem; }
}

/* ── Accesibilidad ── */
@media (prefers-reduced-motion: reduce) {
    .atlas-title, .atlas-glow, .atlas-render, .atlas-line,
    .atlas-mount, .atlas-finger, .atlas-panel-in {
        animation: none !important;
    }
    .atlas-line { stroke-dashoffset: 0 !important; opacity: 0.9 !important; }
    .atlas-stage.atlas-flip .atlas-render { animation: none !important; }
}
@media (prefers-contrast: more) {
    .atlas-block p { color: #fdfcff; }
    .atlas-card-foot p { color: rgba(240, 236, 255, 0.92); }
    .atlas-sub { color: #ece7ff; }
    .atlas-line { opacity: 1; }
}
@media (forced-colors: active) {
    .atlas, .atlas-panel, .atlas-stage { border: 1px solid CanvasText; }
    .atlas-title { -webkit-text-fill-color: CanvasText; color: CanvasText; }
    .atlas-chip, .atlas-layer { border: 1px solid CanvasText; }
}
@media print {
    .atlas-legend, .atlas-side-switch { display: none; }
    .atlas { break-inside: avoid; }
}
