/* ============================================================
   Skinia · Estilos y Experiencia Visual Profesional
   ============================================================ */
:root {
    --bg: #fdf9f5;
    --bg-deep: #f6ede6;
    --surface: rgba(255, 255, 255, 0.88);
    --surface-solid: #ffffff;
    --ink: #2f2522;
    --ink-soft: #7e6f68;
    --brand: #d97b9e;
    --brand-deep: #c05f85;
    --brand-soft: #fbeef3;
    --accent: #7eb8a0;
    --accent-soft: #eaf5f0;
    --warn: #e6a35c;
    --danger: #d96a6a;
    --success: #22c55e;
    --radius: 24px;
    --shadow: 0 20px 50px -18px rgba(80, 48, 32, 0.22);
    --shadow-sm: 0 8px 24px -12px rgba(80, 48, 32, 0.14);
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    background:
        radial-gradient(1200px 600px at 85% -10%, #fbe0ec 0%, transparent 55%),
        radial-gradient(900px 500px at -10% 30%, #e4f2ea 0%, transparent 50%),
        var(--bg);
    color: var(--ink);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.bg-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.5;
    z-index: -1;
    pointer-events: none;
}
.glow-1 { width: 420px; height: 420px; background: #f9c9dd; top: -120px; right: -80px; }
.glow-2 { width: 380px; height: 380px; background: #c8e8d8; bottom: -100px; left: -100px; }

/* ---------- Topbar ---------- */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    max-width: 860px;
    margin: 0 auto;
    width: 100%;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--ink);
}
.brand-mark {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--brand), var(--brand-deep));
    color: #fff;
    border-radius: 12px;
    font-size: 1.05rem;
    box-shadow: 0 6px 16px -6px var(--brand-deep);
}
.topbar-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    color: var(--ink-soft);
    background: var(--surface);
    padding: 8px 14px;
    border-radius: 999px;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    max-width: 60%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
    flex-shrink: 0;
}

/* ---------- Layout Uniforme ---------- */
.layout {
    max-width: 860px;
    width: 100%;
    margin: 0 auto;
    padding: 12px 20px 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    min-width: 0;
}

.card {
    width: 100%;
    max-width: 820px;
    min-width: 0;
    background: var(--surface);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px;
    overflow: hidden;
}

/* ---------- Captura ---------- */
.title {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: var(--ink);
}
.title .accent {
    background: linear-gradient(120deg, var(--brand), var(--brand-deep));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.subtitle {
    color: var(--ink-soft);
    font-size: 0.92rem;
    margin: 8px 0 20px;
}

.capture-box {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    background: linear-gradient(160deg, #2c2226, #4a3538);
    aspect-ratio: 4 / 3;
    display: grid;
    place-items: center;
    width: 100%;
    max-width: 100%;
}
#video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
#video.selfie {
    transform: scaleX(-1);
}

.camera-placeholder {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    text-align: center;
    color: rgba(255,255,255,0.85);
}
.face-guide {
    opacity: 0.5;
    width: 55%;
    max-width: 220px;
    animation: pulse 2.6s ease-in-out infinite;
}
.guide-ellipse { stroke: #fff; stroke-width: 2; stroke-dasharray: 8 7; }
.guide-ticks { stroke: #fff; stroke-width: 2; }
.placeholder-text { font-size: 0.85rem; margin-top: 6px; opacity: 0.75; }
@keyframes pulse { 0%, 100% { opacity: 0.35; } 50% { opacity: 0.7; } }

.camera-error {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(30, 20, 22, 0.92);
    color: #ffd7d7;
    text-align: center;
    font-size: 0.9rem;
}

.photo-preview {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: #1c1417;
}
.photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
#retakeBtn {
    position: absolute;
    top: 12px;
    right: 12px;
}

.hidden {
    display: none !important;
}

/* ---------- Controles ---------- */
.controls {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    flex-wrap: wrap;
    width: 100%;
}
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.88rem;
    padding: 12px 18px;
    border-radius: 14px;
    transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
    text-decoration: none;
}
.btn:active { transform: scale(0.97); }
.btn svg { width: 18px; height: 18px; }

.btn-primary {
    background: linear-gradient(135deg, var(--brand), var(--brand-deep));
    color: #fff !important;
    box-shadow: 0 10px 22px -8px var(--brand-deep);
}
.btn-primary:hover {
    box-shadow: 0 14px 28px -8px var(--brand-deep);
    transform: translateY(-1px);
    color: #fff !important;
}

.btn-ghost {
    background: rgba(255,255,255,0.9);
    color: var(--ink);
    border: 1px solid #eee2db;
}
.btn-ghost:hover { background: #fff; color: var(--ink); }

.btn-outline {
    background: #fff;
    color: var(--ink);
    border: 1.5px dashed var(--brand);
    cursor: pointer;
}
.btn-outline:hover { background: var(--brand-soft); color: var(--ink); }

.chip-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.94);
    border: 1px solid #ebdcd5;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--ink);
    padding: 8px 14px;
    border-radius: 999px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.chip-btn:hover { transform: scale(1.03); background: #fff; border-color: var(--brand); }
.chip-btn.active-mode { background: var(--brand-soft); border-color: var(--brand-deep); color: var(--brand-deep); }

.new-photo-btn {
    align-self: flex-start;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 0.78rem;
}
.error-back-btn {
    margin-top: 12px;
    padding: 9px 14px;
    border-radius: 999px;
    font-size: 0.8rem;
}

/* ---------- Botón analizar ---------- */
.btn-analyze {
    width: 100%;
    margin-top: 16px;
    padding: 16px;
    font-size: 1rem;
    border-radius: 16px;
    color: #fff;
    font-weight: 700;
    background: linear-gradient(135deg, var(--brand-deep), var(--brand));
    box-shadow: 0 14px 30px -10px var(--brand-deep);
    transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s ease, filter 0.2s ease;
}
.btn-analyze:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 18px 36px -10px var(--brand-deep); }
.btn-analyze:disabled { opacity: 0.45; cursor: not-allowed; filter: saturate(0.6); }
.btn-analyze.analyzing { opacity: 1; filter: saturate(1); }

.spinner {
    width: 16px;
    height: 16px;
    border: 2.5px solid rgba(255,255,255,0.35);
    border-top-color: #fff;
    border-radius: 50%;
    display: inline-block;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.hint {
    margin-top: 12px;
    font-size: 0.75rem;
    color: var(--ink-soft);
    text-align: center;
}

/* ---------- Resultados Card e Hijos ---------- */
.result-card {
    width: 100%;
    max-width: 820px;
    min-width: 0;
    overflow: hidden;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--ink-soft);
}
.empty-icon {
    font-size: 3.4rem;
    margin-bottom: 14px;
    filter: drop-shadow(0 8px 14px rgba(96,58,40,0.18));
}
.empty-state h2 {
    color: var(--ink);
    font-size: 1.25rem;
    margin-bottom: 8px;
    font-weight: 800;
}

.result-area {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
}

.result-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    width: 100%;
    min-width: 0;
}
.result-head h2 {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--ink);
    margin: 0;
}
.result-meta {
    font-size: 0.75rem;
    color: var(--ink-soft);
    margin-top: 2px;
}

.score-ring-wrap {
    text-align: center;
    flex-shrink: 0;
}
.score-ring {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: conic-gradient(var(--brand) calc(var(--score) * 1%), #f3e4ec 0);
    position: relative;
}
.score-ring::before {
    content: '';
    position: absolute;
    inset: 8px;
    border-radius: 50%;
    background: var(--surface-solid);
}
.score-ring span {
    position: relative;
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--ink);
}
.score-ring small {
    position: relative;
    font-size: 0.7rem;
    color: var(--ink-soft);
}
.score-label {
    font-size: 0.72rem;
    color: var(--ink-soft);
    margin-top: 6px;
    font-weight: 600;
}

.skin-facts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 24px;
    width: 100%;
    min-width: 0;
}
.fact {
    background: var(--accent-soft);
    border-radius: 14px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    overflow: hidden;
}
.fact-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-soft);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.fact-value {
    font-weight: 700;
    font-size: 0.92rem;
    color: #33604f;
    word-break: break-word;
    overflow-wrap: anywhere;
}

/* ============================================================
   CARRUSEL DE CAPAS / GALERÍA DE INDICADORES
   ============================================================ */
.layer-gallery-section {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin-bottom: 28px;
    background: #ffffff;
    border-radius: 20px;
    padding: 22px;
    border: 1px solid #f1e4dd;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.gallery-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 16px;
    gap: 10px;
}
.gallery-head h3 {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--ink);
    margin: 0;
}
.gallery-sub {
    font-size: 0.78rem;
    color: var(--ink-soft);
    margin-top: 2px;
}
.gallery-nav-btns {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}
.nav-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid #e8dad2;
    background: #fff;
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1;
    color: var(--ink);
    display: grid;
    place-items: center;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s ease, background 0.15s ease;
}
.nav-btn:hover { transform: scale(1.08); background: var(--brand-soft); border-color: var(--brand); }

.carousel-container {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    padding: 6px 2px 12px;
}
.carousel-container::-webkit-scrollbar {
    display: none;
}

.carousel-track {
    display: flex;
    gap: 16px;
    width: max-content;
    min-width: 0;
}

.layer-card {
    scroll-snap-align: center;
    width: 250px;
    max-width: 78vw;
    flex-shrink: 0;
    background: var(--bg);
    border-radius: 18px;
    border: 1.5px solid #eee1d8;
    overflow: hidden;
    box-shadow: 0 6px 18px -6px rgba(96,58,40,0.12);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.layer-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--brand); }
.layer-card.active-card { border-color: var(--brand-deep); box-shadow: 0 0 0 2px var(--brand); }

.layer-card-stage {
    position: relative;
    overflow: hidden;
    background: #1c1417;
    width: 100%;
    border-radius: 14px 14px 0 0;
    line-height: 0;
}
.layer-card-stage img {
    width: 100%;
    height: auto;
    display: block;
}
.layer-card-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Badge "No concerns found" */
.no-concerns-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(34, 197, 94, 0.9);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.02em;
}

.layer-card-tag {
    position: absolute;
    bottom: 8px;
    left: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 6px 10px;
    border-radius: 10px;
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--ink);
    border-left: 4px solid var(--brand);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.layer-card-info { padding: 12px 14px; }
.layer-card-meta { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.layer-card-score { font-size: 0.95rem; font-weight: 800; }
.layer-card-level { font-size: 0.7rem; text-transform: uppercase; font-weight: 700; color: var(--ink-soft); background: #f3e6de; padding: 2px 7px; border-radius: 6px; }
.layer-card-desc { font-size: 0.72rem; color: var(--ink-soft); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 10px;
}
.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    background: #e3d3ca;
    cursor: pointer;
    transition: all 0.2s ease;
}
.carousel-dot.active { width: 22px; border-radius: 99px; background: var(--brand); }

/* ============================================================
   VISOR MULTICAPA MAESTRO
   ============================================================ */
.layer-map-box {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin-bottom: 28px;
    padding: 22px;
    border-radius: 20px;
    background: var(--surface-solid);
    border: 1px solid #f1e4dd;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.layer-map-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
    gap: 14px;
    flex-wrap: wrap;
    width: 100%;
}
.layer-map-header h3 {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--ink);
    margin: 0;
}
.layer-map-hint {
    font-size: 0.78rem;
    color: var(--ink-soft);
    margin-top: 2px;
}
.layer-map-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.layer-map-stage {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: #1c1417;
    width: 100%;
    max-width: 580px;
    margin: 0 auto;
    box-shadow: 0 10px 30px -10px rgba(80, 48, 32, 0.2);
    line-height: 0;
}
.layer-map-stage img {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
}
.layer-map-stage svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.layer-toggles {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
    justify-content: center;
    width: 100%;
}
.layer-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--brand-soft);
    border: 1px solid #f3d7e2;
    border-radius: 999px;
    padding: 7px 13px;
    cursor: pointer;
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--ink);
    transition: opacity 0.15s ease, transform 0.15s ease, background 0.15s ease;
    user-select: none;
}
.layer-toggle:hover { transform: translateY(-1px); background: #fbe3ed; }
.layer-toggle input { accent-color: var(--brand-deep); cursor: pointer; }
.layer-toggle:has(input:not(:checked)) { opacity: 0.45; text-decoration: line-through; }
.layer-swatch {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.14);
}
.layer-map-empty {
    margin-top: 10px;
    font-size: 0.75rem;
    color: var(--ink-soft);
    text-align: center;
}

/* ---------- Grid de Métricas ---------- */
.section-title {
    font-size: 1.05rem;
    font-weight: 800;
    margin-bottom: 12px;
    color: var(--ink);
}

.metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    width: 100%;
    min-width: 0;
}
.metric {
    background: var(--surface-solid);
    border: 1px solid #f2e7e0;
    border-radius: 16px;
    padding: 14px 16px;
    box-shadow: var(--shadow-sm);
    min-width: 0;
    overflow: hidden;
    transition: transform 0.15s ease, border-color 0.15s ease;
}
.metric:hover { transform: translateY(-2px); border-color: var(--brand); }
.metric-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
}
.metric-name {
    font-weight: 700;
    font-size: 0.86rem;
    color: var(--ink);
}
.metric-score {
    font-weight: 800;
    font-size: 0.86rem;
    color: var(--brand-deep);
}
.metric-bar {
    height: 8px;
    border-radius: 99px;
    background: #f3e4ec;
    overflow: hidden;
}
.metric-bar i {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--brand-soft), var(--brand));
    border-radius: 99px;
    transition: width 1s cubic-bezier(0.22, 1, 0.36, 1);
}
.metric-bar i.low   { background: linear-gradient(90deg, #f3c2c2, var(--danger)); }
.metric-bar i.mid   { background: linear-gradient(90deg, #f8e3c0, var(--warn)); }
.metric-bar i.high  { background: linear-gradient(90deg, var(--accent-soft), var(--accent)); }
.metric-bar i.excel { background: linear-gradient(90deg, #d9f2e6, #4fa582); }
.metric-detail {
    font-size: 0.74rem;
    color: var(--ink-soft);
    margin-top: 8px;
    word-break: break-word;
    overflow-wrap: anywhere;
}
.metric-rec {
    font-size: 0.72rem;
    color: #5d7a6d;
    margin-top: 4px;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.summary, .routine {
    width: 100%;
    min-width: 0;
    margin-top: 20px;
    padding: 20px;
    border-radius: 18px;
    background: var(--surface-solid);
    border: 1px solid #f2e7e0;
    overflow: hidden;
    word-break: break-word;
}
.summary h3, .routine h3 {
    font-size: 0.95rem;
    margin-bottom: 8px;
    font-weight: 800;
    color: var(--ink);
}
.summary p {
    font-size: 0.88rem;
    color: var(--ink-soft);
    line-height: 1.6;
}
.routine ul {
    list-style: none;
    display: grid;
    gap: 8px;
    padding: 0;
    margin: 0;
}
.routine li {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: 0.85rem;
    color: var(--ink);
    line-height: 1.5;
}
.routine li::before {
    content: '✦';
    color: var(--brand);
    flex-shrink: 0;
}

/* ---------- Errores ---------- */
.error-box {
    background: #fdeeee;
    border: 1px solid #f2c9c9;
    color: #a34242;
    border-radius: 14px;
    padding: 16px;
    font-size: 0.86rem;
    margin-top: 16px;
    white-space: pre-wrap;
    width: 100%;
}

.footer {
    text-align: center;
    padding: 28px 16px;
    font-size: 0.74rem;
    color: var(--ink-soft);
    width: 100%;
}

/* ============================================================
   RESPONSIVE (Smartphones y Pantallas Móviles)
   ============================================================ */
@media (max-width: 768px) {
    .layout {
        padding: 6px 12px calc(40px + env(safe-area-inset-bottom));
        gap: 16px;
    }
    .topbar {
        padding: 12px 14px;
    }
    .topbar-status {
        font-size: 0.72rem;
        padding: 6px 12px;
        max-width: 55%;
    }
    .title {
        font-size: 1.35rem;
    }
    .subtitle {
        font-size: 0.84rem;
        margin: 6px 0 14px;
    }
    .card {
        padding: 16px 14px;
        border-radius: 20px;
    }
    
    .controls {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .controls #cameraBtn {
        grid-column: 1 / -1;
    }
    .btn {
        padding: 12px 14px;
        font-size: 0.86rem;
        justify-content: center;
    }

    /* Resultados Header en Móvil */
    .result-head {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
        margin-bottom: 14px;
    }
    .result-head h2 {
        font-size: 1.18rem;
    }
    .new-photo-btn {
        margin-top: 6px;
        padding: 6px 12px;
        font-size: 0.75rem;
    }
    
    .score-ring {
        width: 74px;
        height: 74px;
    }
    .score-ring span {
        font-size: 1.4rem;
    }
    .score-ring small {
        font-size: 0.65rem;
    }
    .score-label {
        font-size: 0.68rem;
        margin-top: 2px;
    }

    /* Ficha de hechos rápidos en 2 columnas */
    .skin-facts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        margin-bottom: 16px;
    }
    .fact {
        padding: 10px 12px;
        border-radius: 12px;
    }
    .fact-label {
        font-size: 0.64rem;
    }
    .fact-value {
        font-size: 0.85rem;
    }

    /* Carrusel de capas en móvil */
    .layer-gallery-section {
        padding: 14px 10px;
        margin-bottom: 18px;
        border-radius: 16px;
    }
    .gallery-head {
        align-items: center;
        margin-bottom: 10px;
    }
    .gallery-head h3 {
        font-size: 0.92rem;
    }
    .gallery-sub {
        font-size: 0.72rem;
    }
    .nav-btn {
        width: 32px;
        height: 32px;
        font-size: 1.1rem;
    }

    .carousel-container {
        padding: 4px 2px 8px;
    }
    .carousel-track {
        gap: 10px;
    }
    .layer-card {
        width: 200px;
        border-radius: 15px;
    }
    .layer-card-info {
        padding: 10px 12px;
    }
    .layer-card-score {
        font-size: 0.86rem;
    }
    .layer-card-desc {
        font-size: 0.7rem;
    }

    /* Visor Multicapa en móvil */
    .layer-map-box {
        padding: 14px 10px;
        margin-bottom: 18px;
        border-radius: 16px;
    }
    .layer-map-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        margin-bottom: 10px;
    }
    .layer-map-header h3 {
        font-size: 0.92rem;
    }
    .layer-map-hint {
        font-size: 0.72rem;
    }
    .layer-map-actions {
        width: 100%;
        display: flex;
        gap: 6px;
    }
    .layer-map-actions .chip-btn {
        flex: 1;
        justify-content: center;
        padding: 7px 10px;
        font-size: 0.74rem;
    }

    .layer-map-stage {
        border-radius: 14px;
        max-width: 100%;
    }

    .layer-toggles {
        justify-content: flex-start;
        gap: 6px;
        margin-top: 10px;
    }
    .layer-toggle {
        padding: 6px 10px;
        font-size: 0.72rem;
        gap: 5px;
    }

    /* Grid de métricas en 1 columna */
    .section-title {
        font-size: 0.92rem;
        margin-bottom: 10px;
    }
    .metrics {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }
    .metric {
        padding: 12px 14px;
        border-radius: 14px;
    }
    .metric-name {
        font-size: 0.82rem;
    }
    .metric-score {
        font-size: 0.82rem;
    }
    .metric-detail {
        font-size: 0.72rem;
        margin-top: 6px;
    }
    .metric-rec {
        font-size: 0.7rem;
        margin-top: 3px;
    }

    /* Resumen y Rutina */
    .summary, .routine {
        margin-top: 14px;
        padding: 14px 12px;
        border-radius: 15px;
    }
    .summary h3, .routine h3 {
        font-size: 0.88rem;
    }
    .summary p {
        font-size: 0.82rem;
    }
    .routine li {
        font-size: 0.8rem;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .brand-name { font-size: 1.1rem; }
    .title { font-size: 1.22rem; }
    .layer-card { width: 180px; max-width: 72vw; }
    .score-ring { width: 68px; height: 68px; }
    .score-ring span { font-size: 1.3rem; }
    .fact-value { font-size: 0.8rem; }
}

/* ============================================================
   MODAL DE CARGA + PUBLICIDAD ADSENSE
   ============================================================ */
.ad-loading-modal {
    position: fixed;
    inset: 0;
    z-index: 1080;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(20, 14, 16, 0.72);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    animation: adModalIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.ad-loading-modal.hidden {
    display: none;
}

@keyframes adModalIn {
    from { opacity: 0; transform: scale(0.94); }
    to   { opacity: 1; transform: scale(1); }
}

.ad-modal-dialog {
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 24px 64px -12px rgba(0,0,0,0.45), 0 0 0 1px rgba(255,255,255,0.12);
    padding: 28px 24px 24px;
    width: 100%;
    max-width: 360px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ── Spinner ── */
.ad-loading-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
}

.ad-spinner-ring {
    position: relative;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: conic-gradient(var(--brand) 0%, transparent 100%);
    animation: adSpin 1.2s linear infinite;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ad-spinner-ring::before {
    content: '';
    position: absolute;
    inset: 6px;
    background: #fff;
    border-radius: 50%;
}
.ad-spinner-core {
    position: relative;
    z-index: 1;
    font-size: 1.4rem;
    line-height: 1;
    animation: adCorePulse 1.2s ease-in-out infinite;
}

@keyframes adSpin {
    to { transform: rotate(360deg); }
}
@keyframes adCorePulse {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.18); }
}

.ad-loading-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--ink);
    margin: 0;
}
.ad-loading-sub {
    font-size: 0.78rem;
    color: var(--ink-muted);
    margin: 0;
    line-height: 1.45;
}

/* ── Progress bar ── */
.ad-progress-bar-wrap {
    width: 100%;
    height: 6px;
    border-radius: 99px;
    background: #f0e8e2;
    overflow: hidden;
}
.ad-progress-bar {
    height: 100%;
    width: 0%;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--brand), var(--brand-deep));
    animation: adProgressAnim 12s cubic-bezier(0.1, 0.6, 0.4, 1) forwards;
    position: relative;
    overflow: hidden;
}
.ad-progress-bar::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.45) 50%, transparent 100%);
    animation: adShimmer 1.4s ease-in-out infinite;
    background-size: 200% 100%;
}

@keyframes adProgressAnim {
    0%   { width: 0%; }
    30%  { width: 45%; }
    65%  { width: 72%; }
    90%  { width: 88%; }
    100% { width: 94%; }
}
@keyframes adShimmer {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ── Contenedor del anuncio ── */
.ad-card-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.ad-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.ad-sponsor-pill {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #888;
    border: 1px solid #ddd;
    border-radius: 99px;
    padding: 2px 8px;
    background: #f7f5f4;
    flex-shrink: 0;
}
.ad-sponsor-note {
    font-size: 0.7rem;
    color: var(--ink-muted);
    line-height: 1.35;
}

.ad-slot-box {
    width: 100%;
    min-height: 120px;
    border-radius: 14px;
    overflow: hidden;
    background: #faf8f6;
    border: 1.5px dashed #e0d5cc;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Placeholder visual de AdSense ── */
.adsense-placeholder-banner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 20px 16px;
    text-align: center;
    width: 100%;
}
.adsense-logo {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1;
}
.adsense-g  { color: #4285F4; }
.adsense-o1 { color: #EA4335; }
.adsense-o2 { color: #FBBC05; }
.adsense-g2 { color: #4285F4; }
.adsense-l  { color: #34A853; }
.adsense-e  { color: #EA4335; }
.adsense-txt { color: #666; font-size: 0.85rem; font-weight: 600; }

.adsense-banner-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--ink);
    margin: 0;
}
.adsense-banner-desc {
    font-size: 0.72rem;
    color: var(--ink-muted);
    margin: 0;
    line-height: 1.4;
}
.adsense-tag-hint {
    font-size: 0.65rem;
    color: #aaa;
    border: 1px solid #e0d5cc;
    border-radius: 6px;
    padding: 2px 8px;
    background: #fff;
}
