/* Dental Cinema — panel "Crear" a la izquierda (estilo estudio de video) + galería / Mis creaciones a la derecha.
   Superficies oscuras, acento = azul DentalPro (--primary #1D4ED8), tipografía de display Archivo (solo acá). */

.cn-app, .cn-panel, .cn-main {
    --cn-bg: #0B0F1A;
    --cn-surface: #111827;
    --cn-navy: #0E2038;
    --cn-line: rgba(255, 255, 255, 0.10);
    --cn-text: #e5e7eb;
    --cn-muted: #94a3b8;
    --cn-accent: var(--primary, #1D4ED8);
    --cn-display: 'Archivo', 'Inter', system-ui, sans-serif;
}

.cn-app {
    display: grid;
    grid-template-columns: 380px minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
}
.cn-main { min-width: 0; }

/* Títulos de display: grotesk pesada en mayúsculas, tracking apretado */
.cn-hero h1, .cn-title, .cn-h2, .cn-gen, .cn-hero-cta, .cn-seg-btn, .cn-tab {
    font-family: var(--cn-display);
    text-transform: uppercase;
    letter-spacing: -0.01em;
}

/* ─────────────── Panel Crear ─────────────── */
.cn-panel {
    position: sticky; top: 1rem;
    display: flex; flex-direction: column;
    max-height: calc(100vh - 2rem);
    background: var(--cn-navy); color: var(--cn-text);
    border: 1px solid var(--cn-line); border-radius: 20px;
    overflow: hidden;
}
.cn-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 1rem 1.1rem 0.6rem; }
.cn-title { margin: 0; font-size: 1.5rem; font-weight: 900; color: #fff; line-height: 1; }
.cn-panel-credits { display: flex; align-items: center; gap: 0.45rem; font-size: 0.8rem; color: var(--cn-muted); }
.cn-panel-credits b { color: #fff; font-size: 1.05rem; }

.cn-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 0.25rem; margin: 0 1.1rem 0.75rem; padding: 0.25rem; background: rgba(0, 0, 0, 0.3); border-radius: 12px; }
.cn-tab {
    border: 0; cursor: pointer; padding: 0.6rem 0.5rem; border-radius: 9px;
    font-size: 0.85rem; font-weight: 800; color: var(--cn-muted); background: transparent;
    transition: background 150ms ease, color 150ms ease;
}
.cn-tab:hover { color: #fff; }
.cn-tab.on { background: var(--cn-accent); color: #fff; }

.cn-panel-body { flex: 1; min-height: 0; overflow-y: auto; padding: 0 1.1rem 1rem; display: flex; flex-direction: column; gap: 0.7rem; }
.cn-panel-foot {
    position: sticky; bottom: 0; padding: 0.85rem 1.1rem calc(1rem + env(safe-area-inset-bottom));
    background: linear-gradient(0deg, var(--cn-navy) 70%, rgba(14, 32, 56, 0));
    border-top: 1px solid var(--cn-line);
}
.cn-gen {
    width: 100%; border: 0; cursor: pointer; border-radius: 14px; padding: 0.95rem 1rem;
    font-size: 1rem; font-weight: 900; color: #fff; background: var(--cn-accent);
    box-shadow: 0 6px 20px rgba(29, 78, 216, 0.35);
    transition: transform 150ms ease, filter 150ms ease;
}
.cn-gen:hover:not(:disabled) { filter: brightness(1.12); transform: translateY(-1px); }
.cn-gen:disabled { cursor: not-allowed; background: rgba(255, 255, 255, 0.1); color: rgba(255, 255, 255, 0.5); box-shadow: none; }
.cn-reason { margin-top: 0.5rem; text-align: center; font-size: 0.8rem; color: var(--cn-muted); }

.cn-field-label { margin: 0.35rem 0 0.1rem; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--cn-muted); }
.cn-opt { font-weight: 500; letter-spacing: 0; text-transform: none; opacity: 0.8; }
.cn-field { display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; }
.cn-desc, .cn-sub, .cn-hint { margin: 0; font-size: 0.82rem; line-height: 1.4; color: var(--cn-muted); }

/* Lista compacta de plantillas */
.cn-tpl-list { display: flex; flex-direction: column; gap: 0.4rem; }
.cn-tpl {
    display: flex; align-items: center; gap: 0.7rem; width: 100%; text-align: left; cursor: pointer;
    padding: 0.4rem; border-radius: 12px; color: var(--cn-text);
    background: rgba(255, 255, 255, 0.04); border: 1px solid transparent;
    transition: background 150ms ease, border-color 150ms ease;
}
.cn-tpl:hover { background: rgba(255, 255, 255, 0.09); }
.cn-tpl.on { border-color: var(--cn-accent); background: rgba(29, 78, 216, 0.22); }
.cn-tpl-thumb { flex: none; width: 52px; height: 52px; border-radius: 9px; overflow: hidden; background: var(--cn-bg); display: flex; align-items: center; justify-content: center; color: var(--cn-muted); }
.cn-tpl-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cn-tpl-text { display: flex; flex-direction: column; min-width: 0; }
.cn-tpl-text b { font-size: 0.9rem; color: #fff; line-height: 1.2; }
.cn-tpl-text small { font-size: 0.75rem; color: var(--cn-muted); }

/* Tarjetas de modelo (Estudio libre) */
.cn-models { display: flex; flex-direction: column; gap: 0.45rem; }
.cn-model {
    display: flex; flex-direction: column; gap: 0.2rem; text-align: left; cursor: pointer;
    padding: 0.7rem 0.8rem; border-radius: 12px; color: var(--cn-text);
    background: rgba(255, 255, 255, 0.04); border: 1px solid var(--cn-line);
    transition: background 150ms ease, border-color 150ms ease;
}
.cn-model:hover { background: rgba(255, 255, 255, 0.09); }
.cn-model.on { border-color: var(--cn-accent); background: rgba(29, 78, 216, 0.22); }
.cn-model-top { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.cn-model-top b { color: #fff; font-size: 0.95rem; }
.cn-mbadge { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 0.15rem 0.5rem; border-radius: 999px; background: rgba(255, 255, 255, 0.12); color: #cbd5e1; white-space: nowrap; }
.cn-model small { font-size: 0.78rem; line-height: 1.35; color: var(--cn-muted); }
.cn-model-price { font-size: 0.75rem; font-weight: 700; color: #93c5fd; }

/* Inputs */
.cn-input {
    width: 100%; box-sizing: border-box; resize: vertical; min-height: 5.5rem; padding: 0.7rem 0.8rem;
    font: inherit; font-size: 0.9rem; line-height: 1.4; color: #fff;
    background: rgba(0, 0, 0, 0.3); border: 1px solid var(--cn-line); border-radius: 12px;
}
.cn-input::placeholder { color: #64748b; }
.cn-input:focus { outline: 2px solid var(--cn-accent); outline-offset: 1px; border-color: transparent; }
.cn-ideas { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.cn-idea {
    cursor: pointer; border-radius: 999px; padding: 0.3rem 0.7rem; font-size: 0.72rem; color: #cbd5e1;
    background: rgba(255, 255, 255, 0.06); border: 1px dashed rgba(255, 255, 255, 0.2);
}
.cn-idea:hover { background: rgba(255, 255, 255, 0.12); }

/* Chips de formato / calidad / duración */
.cn-pills { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.cn-pill {
    cursor: pointer; border-radius: 999px; padding: 0.4rem 0.85rem; font-size: 0.8rem; font-weight: 600; color: #cbd5e1;
    background: rgba(255, 255, 255, 0.06); border: 1px solid var(--cn-line);
    transition: background 150ms ease;
}
.cn-pill:hover { background: rgba(255, 255, 255, 0.13); }
.cn-pill.on { background: var(--cn-accent); border-color: var(--cn-accent); color: #fff; }

/* Toggle y checks */
.cn-switch { display: flex; align-items: flex-start; gap: 0.7rem; cursor: pointer; font-size: 0.85rem; color: var(--cn-text); }
.cn-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.cn-switch-ui { flex: none; position: relative; width: 38px; height: 22px; margin-top: 2px; border-radius: 999px; background: rgba(255, 255, 255, 0.18); transition: background 150ms ease; }
.cn-switch-ui::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform 150ms ease; }
.cn-switch input:checked + .cn-switch-ui { background: var(--cn-accent); }
.cn-switch input:checked + .cn-switch-ui::after { transform: translateX(16px); }
.cn-switch input:focus-visible + .cn-switch-ui { outline: 2px solid #93c5fd; outline-offset: 2px; }
.cn-switch small { display: block; margin-top: 0.1rem; font-size: 0.75rem; color: var(--cn-muted); }
.cn-check { display: flex; align-items: flex-start; gap: 0.55rem; font-size: 0.82rem; line-height: 1.35; color: var(--cn-text); cursor: pointer; }
.cn-check input { margin-top: 0.2rem; accent-color: var(--cn-accent); flex: none; }
.cn-consent { padding: 0.7rem; border-radius: 12px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--cn-line); }

.cn-final { font-size: 0.8rem; color: var(--cn-muted); }
.cn-final summary { cursor: pointer; font-weight: 700; color: #cbd5e1; }
.cn-final p { margin: 0.5rem 0 0; line-height: 1.4; overflow-wrap: anywhere; }

/* Dropzones */
.cn-drop-grid { display: grid; grid-template-columns: 1fr; gap: 0.6rem; }
.cn-drop-grid.two { grid-template-columns: 1fr 1fr; }
.cn-drop {
    position: relative; display: flex; align-items: center; justify-content: center;
    min-height: 130px; border-radius: 14px; overflow: hidden; cursor: pointer;
    border: 2px dashed rgba(255, 255, 255, 0.25); background: rgba(0, 0, 0, 0.22);
    transition: border-color 150ms ease, background 150ms ease;
}
.cn-drop:hover, .cn-drop.over { border-color: var(--cn-accent); background: rgba(29, 78, 216, 0.16); }
.cn-drop:focus-visible { outline: 2px solid #93c5fd; outline-offset: 2px; }
.cn-drop.filled { border-style: solid; border-color: var(--cn-line); aspect-ratio: 4 / 3; }
.cn-drop img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cn-drop-empty { display: flex; flex-direction: column; align-items: center; gap: 0.2rem; padding: 0.75rem; text-align: center; color: var(--cn-muted); }
.cn-drop-empty i, .cn-drop-empty svg { width: 28px; height: 28px; color: #93c5fd; margin-bottom: 0.2rem; }
.cn-drop-empty b { font-size: 0.85rem; color: #fff; line-height: 1.2; }
.cn-drop-empty small { font-size: 0.72rem; }
.cn-drop-hint { opacity: 0.8; }
.cn-drop-x {
    position: absolute; top: 0.4rem; right: 0.4rem; z-index: 2; width: 28px; height: 28px; border: 0; border-radius: 50%;
    cursor: pointer; font-size: 1.15rem; line-height: 1; color: #fff; background: rgba(0, 0, 0, 0.7);
}
.cn-drop-x:hover { background: #dc2626; }
.cn-spin { width: 22px; height: 22px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.2); border-top-color: #fff; animation: cn-rot 0.8s linear infinite; }
@keyframes cn-rot { to { transform: rotate(360deg); } }

/* ─────────────── Columna derecha ─────────────── */
.cn-hero {
    position: relative; overflow: hidden; border-radius: 20px; min-height: 280px; margin-bottom: 1rem;
    background: #05070d; color: #fff; display: flex; align-items: flex-end; isolation: isolate;
}
.cn-hero-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; background: #05070d; }
.cn-hero-shade {
    position: absolute; inset: 0; z-index: -1;
    background:
        linear-gradient(0deg, rgba(5, 7, 13, 0.92) 0%, rgba(5, 7, 13, 0.45) 55%, rgba(5, 7, 13, 0.25) 100%),
        linear-gradient(90deg, rgba(5, 7, 13, 0.6) 0%, rgba(5, 7, 13, 0) 70%);
}
.cn-hero-body { padding: 1.75rem 2rem; max-width: 720px; }
.cn-eyebrow { display: inline-block; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: #93c5fd; margin-bottom: 0.75rem; }
.cn-hero h1 { font-size: clamp(1.8rem, 3.6vw, 2.8rem); line-height: 0.98; font-weight: 900; letter-spacing: -0.03em; margin: 0 0 0.75rem; color: #fff; }
.cn-hero p { margin: 0 0 1.25rem; font-size: 1rem; color: rgba(255, 255, 255, 0.82); max-width: 500px; }
.cn-hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; }
.cn-hero-cta { padding: 0.8rem 1.6rem; font-size: 0.95rem; font-weight: 900; border-radius: 999px; }
.cn-credits {
    display: inline-flex; align-items: center; gap: 0.6rem; padding: 0.4rem 0.5rem 0.4rem 1rem; border-radius: 999px;
    background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.cn-credits-label { font-size: 0.75rem; color: rgba(255, 255, 255, 0.7); }
.cn-credits .cn-bal { font-size: 1.35rem; font-weight: 800; line-height: 1; }
.cn-buy {
    border: 0; cursor: pointer; border-radius: 999px; padding: 0.45rem 0.95rem; font-size: 0.8rem; font-weight: 700;
    background: #fff; color: #0f172a; transition: transform 150ms ease;
}
.cn-buy:hover { transform: translateY(-1px); }

.cn-stage { background: var(--cn-bg); color: var(--cn-text); border-radius: 20px; padding: 0 1.1rem 1.25rem; margin-bottom: 1rem; }
.cn-stage .text-muted { color: var(--cn-muted); }
.cn-bar {
    position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: 0.9rem 0; background: rgba(11, 15, 26, 0.9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.cn-bar-credits { display: flex; align-items: center; gap: 0.6rem; flex: none; font-size: 0.85rem; color: #cbd5e1; }
.cn-bar-credits b { color: #fff; font-size: 1rem; }
.cn-h2 { margin: 0.5rem 0 0.75rem; font-size: 1.3rem; font-weight: 900; color: #fff; }

/* Segmentado (Explorar | Mis creaciones, Foto | Video) */
.cn-seg { display: inline-flex; gap: 0.2rem; padding: 0.25rem; background: rgba(255, 255, 255, 0.07); border-radius: 12px; }
.cn-seg-wide { display: grid; grid-template-columns: 1fr 1fr; background: rgba(0, 0, 0, 0.3); }
.cn-seg-btn {
    border: 0; cursor: pointer; padding: 0.5rem 1rem; border-radius: 9px; font-size: 0.82rem; font-weight: 800;
    color: var(--cn-muted); background: transparent; transition: background 150ms ease, color 150ms ease;
}
.cn-seg-btn:hover { color: #fff; }
.cn-seg-btn.active { background: #fff; color: #0f172a; }
.cn-seg-wide .cn-seg-btn.active { background: var(--cn-accent); color: #fff; }
.cn-count { display: inline-block; margin-left: 0.25rem; min-width: 1.3em; padding: 0 0.35em; border-radius: 999px; font-size: 0.72rem; background: rgba(0, 0, 0, 0.18); text-align: center; }

.cn-chips { display: flex; gap: 0.5rem; overflow-x: auto; scrollbar-width: none; min-width: 0; margin-bottom: 0.75rem; }
.cn-chips::-webkit-scrollbar { display: none; }
.cn-chip {
    flex: none; cursor: pointer; border-radius: 999px; padding: 0.45rem 1rem; font-size: 0.83rem; font-weight: 600; color: #cbd5e1;
    background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.12); transition: background 150ms ease, color 150ms ease;
}
.cn-chip:hover { background: rgba(255, 255, 255, 0.14); }
.cn-chip.active { background: #fff; color: #0f172a; border-color: #fff; }

/* Mosaico masonry */
.cn-gallery { columns: 3; column-gap: 0.75rem; }
.cn-tile { position: relative; display: block; width: 100%; margin: 0 0 0.75rem; break-inside: avoid; overflow: hidden; border-radius: 14px; background: #131826; }
.cn-tile[hidden] { display: none; }
.cn-tile > video, .cn-tile > img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cn-badges { position: absolute; top: 0.6rem; left: 0.6rem; display: flex; gap: 0.35rem; z-index: 2; }
.cn-badge {
    font-size: 0.65rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; padding: 0.2rem 0.55rem; border-radius: 999px;
    color: #fff; background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.cn-badge-gen { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.cn-overlay {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; display: flex; flex-direction: column; gap: 0.5rem;
    padding: 2.5rem 0.8rem 0.8rem; background: linear-gradient(0deg, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0)); color: #fff; transition: opacity 180ms ease;
}
.cn-overlay-title { font-size: 0.85rem; font-weight: 700; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cn-cta { align-self: flex-start; border: 0; cursor: pointer; border-radius: 999px; padding: 0.45rem 1rem; font-size: 0.8rem; font-weight: 700; background: #fff; color: #0f172a; }
.cn-cta:hover { background: #bfdbfe; }
@media (hover: hover) {
    .cn-overlay { opacity: 0; }
    .cn-tile:hover .cn-overlay, .cn-tile:focus-within .cn-overlay { opacity: 1; }
    .cn-tile { transition: transform 200ms ease; }
    .cn-tile:hover { transform: translateY(-2px); }
}
.cn-note { margin: 0.5rem 0 0; font-size: 0.75rem; color: var(--cn-muted); text-align: center; }

/* Mis creaciones */
.cn-job { margin-bottom: 0.75rem; padding: 1rem; border-radius: 14px; background: var(--cn-surface); border: 1px solid var(--cn-line); color: var(--cn-text); }
.cn-job b { color: #fff; }
.cn-low { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; border-left: 4px solid #f59e0b; background: var(--cn-surface); }
.cn-job-video { display: block; width: 100%; max-width: 360px; border-radius: 10px; margin-top: 0.75rem; background: #000; }
.cn-job-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.cn-job-error { margin: 0.5rem 0 0; color: var(--danger, #dc2626); }
.cn-job-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.5rem; margin-top: 0.75rem; }
.cn-job-photos img { display: block; width: 100%; border-radius: 8px; }
.cn-job-actions { margin-top: 0.5rem; display: flex; gap: 0.5rem; flex-wrap: wrap; }
.cn-mine-note { margin: -0.25rem 0 0.75rem; }
.cn-dl {
    display: inline-block; padding: 0.35rem 0.9rem; border-radius: 999px; font-size: 0.8rem; font-weight: 700; text-decoration: none;
    color: #fff; background: rgba(255, 255, 255, 0.1); border: 1px solid var(--cn-line);
}
.cn-dl:hover { background: rgba(255, 255, 255, 0.2); }

/* ─────────────── Responsive ─────────────── */
@media (max-width: 1100px) { .cn-gallery { columns: 2; } }
@media (max-width: 900px) {
    .cn-app { grid-template-columns: minmax(0, 1fr); }
    .cn-panel { position: relative; top: 0; max-height: none; }
    .cn-panel-body { overflow: visible; }
    /* Pie fijo abajo. Sticky no servía: el pie es el último hijo del panel y no tiene espacio para moverse. */
    .cn-panel-foot {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
        background: var(--cn-navy);   /* sólido: con el degradado el resumen se leía encima del formulario */
        box-shadow: 0 -10px 24px rgba(0, 0, 0, 0.35);
    }
    /* Reserva el final del formulario para que el pie no lo tape. */
    .cn-panel-body { padding-bottom: 11rem; }
    /* Mientras el pie está visible, el "+" global se oculta (tapaba el resumen de precio y el botón Generar).
       El micrófono de PRISMA NO se oculta: se apoya justo encima del pie. Su altura la publica
       dental_cinema.js como --cn-foot-h (cambia con el saldo corto y los avisos). */
    body:has(#cn-panel .cn-panel-foot) #fab { display: none !important; }
    body:has(#cn-panel .cn-panel-foot) #prisma-mic {
        bottom: calc(var(--cn-foot-h, 200px) + 12px + env(safe-area-inset-bottom));
    }
}
@media (max-width: 420px) {
    /* Las cuatro pestañas no entran en una fila: se parten en dos filas en vez de cortar "CREAR VIDEO". */
    .cn-nav { flex-wrap: wrap; overflow-x: visible; row-gap: 0.3rem; }
}
@media (max-width: 768px) {
    /* La barra inferior de la app ocupa 64 px: el pie va justo encima de ella. */
    .cn-panel-foot { bottom: calc(64px + env(safe-area-inset-bottom)); }
    .cn-panel-body { padding-bottom: calc(11rem + 64px); }
    /* El pie va 64 px más arriba (barra inferior de la app): el micrófono también. */
    body:has(#cn-panel .cn-panel-foot) #prisma-mic {
        bottom: calc(var(--cn-foot-h, 200px) + 64px + 12px + env(safe-area-inset-bottom));
    }
}
@media (max-width: 768px) {
    .cn-hero { min-height: 300px; border-radius: 16px; }
    .cn-hero-body { padding: 1.5rem 1.25rem; }
    .cn-stage { padding: 0 0.75rem 1.1rem; border-radius: 16px; }
    .cn-bar { position: static; background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
    .cn-bar-credits { display: none; }
    .cn-gallery { column-gap: 0.5rem; }
    .cn-tile { margin-bottom: 0.5rem; border-radius: 12px; }
    .cn-overlay { padding-top: 2rem; }
    .cn-tile.cn-wide .cn-overlay { padding-top: 0.5rem; }
    .cn-tile.cn-wide .cn-overlay-title { display: none; }
}
@media (max-width: 480px) {
    .cn-hero h1 { font-size: 1.65rem; overflow-wrap: anywhere; }
    .cn-hero p { font-size: 0.95rem; }
    .cn-hero-actions { flex-direction: column; align-items: stretch; gap: 0.75rem; }
    .cn-hero-cta { width: 100%; }
    .cn-credits { justify-content: space-between; }
    .cn-bar { justify-content: stretch; }
    .cn-seg { width: 100%; }
    .cn-seg .cn-seg-btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
    .cn-tile, .cn-overlay, .cn-buy, .cn-gen, .cn-pill, .cn-tab, .cn-tpl, .cn-model, .cn-drop, .cn-switch-ui, .cn-switch-ui::after { transition: none; }
    .cn-tile:hover, .cn-gen:hover:not(:disabled) { transform: none; }
    .cn-spin { animation-duration: 3s; }
}

.cn-idea, .cn-pill, .cn-model, .cn-tpl, .cn-chip, .cn-buy, .cn-cta, .cn-input { font-family: inherit; }


/* ─────────────── Pantallas (Explorar / Crear / Mis creaciones) ───────────────
   .cn-app es el contenedor oscuro de TODA la página; ocupa el ancho completo del área de contenido.
   #main-content trae max-width 1200px + 4rem de padding para el resto de las páginas: :has(.cn-app) lo
   ensancha ÚNICAMENTE mientras está dibujado Dental Cinema (se limpia solo al cambiar de página). */
.cn-app {
    display: block; background: var(--cn-bg); color: var(--cn-text);
    border-radius: 20px; padding: 16px 20px 24px;
}
@media (min-width: 901px) {
    #main-content:has(.cn-app) { max-width: none; padding: 16px 20px; }
}
.cn-body { min-width: 0; }
.cn-h2 { margin: 1.1rem 0 0.7rem; font-size: 1.2rem; }

/* Barra superior */
.cn-top { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; margin-bottom: 16px; }
.cn-brand { font-family: var(--cn-display); font-weight: 900; font-size: 1.25rem; text-transform: uppercase; letter-spacing: -0.02em; color: #fff; white-space: nowrap; }
.cn-brand span { color: #93c5fd; }
.cn-nav { display: flex; gap: 0.3rem; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.cn-nav::-webkit-scrollbar { display: none; }
.cn-navbtn {
    flex: none; border: 0; cursor: pointer; border-radius: 999px; padding: 0.55rem 1.05rem;
    font-family: var(--cn-display); text-transform: uppercase; font-weight: 800; font-size: 0.8rem; letter-spacing: -0.005em;
    color: #cbd5e1; background: transparent; transition: background 150ms ease, color 150ms ease;
}
.cn-navbtn:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.cn-navbtn.active { background: #fff; color: #0f172a; }
.cn-navbtn .cn-count { background: rgba(0, 0, 0, 0.15); }
.cn-top-credits { display: flex; align-items: center; gap: 0.6rem; font-size: 0.85rem; color: #cbd5e1; white-space: nowrap; }
.cn-top-credits b { color: #fff; font-size: 1.05rem; }
.cn-buy-blue { background: var(--cn-accent); color: #fff; }

/* Hero (lupas): ancho completo, más bajo para que el contenido asome arriba del pliegue */
.cn-hero { min-height: clamp(230px, 22vw, 300px); margin-bottom: 0.25rem; }
.cn-hero-body { padding: 1.5rem 2rem; }
.cn-hero h1 { font-size: clamp(1.7rem, 3.2vw, 2.7rem); }
.cn-hero p { margin-bottom: 1rem; }

/* Atajos */
.cn-short-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.cn-short {
    display: flex; align-items: center; gap: 0.7rem; text-align: left; cursor: pointer; padding: 0.55rem;
    border-radius: 14px; background: var(--cn-surface); border: 1px solid var(--cn-line); color: var(--cn-text); font-family: inherit;
    transition: border-color 150ms ease, background 150ms ease;
}
.cn-short:hover { border-color: var(--cn-accent); background: rgba(29, 78, 216, 0.18); }
.cn-short-img { flex: none; width: 56px; height: 56px; border-radius: 10px; overflow: hidden; background: #131826; }
.cn-short-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cn-short-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.cn-short-text b { color: #fff; font-size: 0.88rem; line-height: 1.15; }
.cn-short-text small { color: var(--cn-muted); font-size: 0.74rem; line-height: 1.3; }
.cn-short-go { color: #93c5fd; font-size: 1.1rem; padding-right: 0.3rem; }

/* Banner Genjutsu + destacados */
.cn-feat-row { display: grid; grid-template-columns: 2.4fr 1fr 1fr; gap: 14px; margin: 1.4rem 0 0.4rem; }
.cn-fcard { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.cn-fmedia { position: relative; margin: 0; border-radius: 16px; overflow: hidden; background: #131826; height: clamp(220px, 20vw, 360px); }
.cn-fmedia > video { display: block; width: 100%; height: 100%; object-fit: cover; }
.cn-fcta { position: absolute; left: 12px; bottom: 12px; z-index: 3; padding: 0.55rem 1.2rem; }
.cn-fcap { display: flex; flex-direction: column; gap: 0.1rem; }
.cn-fcap b { font-family: var(--cn-display); text-transform: uppercase; font-weight: 900; letter-spacing: -0.01em; color: #fff; font-size: 0.95rem; line-height: 1.1; }
.cn-fcap span { color: var(--cn-muted); font-size: 0.8rem; }
.cn-gal-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 0.8rem; }
.cn-gal-head .cn-chips { margin-bottom: 0.4rem; }

/* Galería: más columnas en pantallas anchas */
.cn-gallery { columns: 3; }
@media (min-width: 1100px) { .cn-gallery { columns: 4; } }
@media (min-width: 1600px) { .cn-gallery { columns: 5; } }
@media (min-width: 1900px) { .cn-gallery { columns: 6; } }

/* Pantalla Crear: panel fijo de ~400px a la izquierda y vista previa grande a la derecha */
.cn-create { display: grid; grid-template-columns: 400px minmax(0, 1fr); gap: 16px; height: calc(100vh - 150px); min-height: 560px; }
.cn-create .cn-panel { position: relative; top: 0; height: 100%; max-height: none; }
.cn-back { border: 0; background: none; cursor: pointer; color: var(--cn-muted); font-family: inherit; font-size: 0.8rem; padding: 0 0 0.3rem; }
.cn-back:hover { color: #fff; }
.cn-preview {
    min-width: 0; min-height: 0; height: 100%; display: flex; flex-direction: column; gap: 10px; padding: 14px;
    background: var(--cn-surface); border: 1px solid var(--cn-line); border-radius: 20px;
}
.cn-prev-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.cn-prev-label { font-family: var(--cn-display); text-transform: uppercase; font-weight: 800; font-size: 0.78rem; letter-spacing: 0.06em; color: var(--cn-muted); }
.cn-prev-actions { display: flex; align-items: center; gap: 0.6rem; }
.cn-prev-stage { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #05070d; border-radius: 14px; overflow: hidden; }
.cn-prev-video, .cn-prev-img, .cn-result { width: 100%; height: 100%; max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.cn-prev-wait { display: flex; flex-direction: column; align-items: center; gap: 0.6rem; text-align: center; padding: 2rem; color: #cbd5e1; max-width: 460px; }
.cn-prev-wait b { color: #fff; font-family: var(--cn-display); text-transform: uppercase; font-size: 1.1rem; }
.cn-prev-wait small { color: var(--cn-muted); }
.cn-spin-lg { width: 44px; height: 44px; border-width: 4px; }
.cn-prev-warn { position: absolute; bottom: 0.5rem; left: 0; right: 0; margin: 0; text-align: center; font-size: 0.72rem; color: var(--cn-muted); pointer-events: none; }
.cn-gen-sm { display: inline-block; width: auto; padding: 0.45rem 1rem; font-size: 0.8rem; text-decoration: none; text-align: center; border-radius: 999px; }
.cn-link { border: 0; background: none; cursor: pointer; color: #93c5fd; font-family: inherit; font-size: 0.8rem; text-decoration: underline; }
.cn-strip { display: flex; align-items: center; gap: 10px; min-height: 68px; }
.cn-strip-title { flex: none; font-family: var(--cn-display); text-transform: uppercase; font-weight: 800; font-size: 0.72rem; letter-spacing: 0.06em; color: var(--cn-muted); }
.cn-strip-row { display: flex; gap: 8px; overflow-x: auto; flex: 1; min-width: 0; padding: 2px; scrollbar-width: thin; }
.cn-strip-empty { color: var(--cn-muted); }
.cn-thumb { flex: none; width: 48px; height: 64px; padding: 0; border-radius: 8px; overflow: hidden; cursor: pointer; background: #0b0f1a; border: 2px solid transparent; display: flex; align-items: center; justify-content: center; }
.cn-thumb.on { border-color: var(--cn-accent); }
.cn-thumb img, .cn-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.cn-thumb-x { color: #f87171; font-size: 0.9rem; }

/* Mis creaciones */
.cn-mine-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.cn-mine-grid .cn-job { margin: 0; }

/* Responsive */
@media (max-width: 1099px) { .cn-gallery { columns: 3; } }
@media (max-width: 900px) {
    .cn-app { padding: 12px 12px 20px; border-radius: 16px; }
    .cn-nav { order: 3; width: 100%; }
    .cn-fmedia { height: auto; aspect-ratio: 3 / 4; }
    .cn-create { grid-template-columns: minmax(0, 1fr); height: auto; min-height: 0; }
    .cn-create .cn-panel { height: auto; }
    .cn-panel-body { overflow: visible; }
    .cn-preview { height: auto; min-height: 360px; }
    .cn-prev-stage { min-height: 300px; }
}
@media (max-width: 768px) {
    .cn-gallery { columns: 2; column-gap: 0.5rem; }
    .cn-hero { min-height: 280px; }
    .cn-hero-body { padding: 1.25rem; }
    .cn-short-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cn-short { min-width: 0; padding: 0.45rem; gap: 0.5rem; }
    .cn-short-img { width: 40px; height: 40px; }
    /* Sin partir palabras ("blanqueamie/nto"): la tarjeta que queda sola en la
       última fila ocupa todo el ancho y ahí entra el título completo. */
    .cn-short-text b { font-size: 0.8rem; overflow-wrap: normal; word-break: normal; hyphens: manual; }
    .cn-short:last-child:nth-child(odd) { grid-column: 1 / -1; }
    .cn-short-text small { display: none; }
    .cn-short-go { display: none; }

    /* Mis creaciones compacto: miniatura 3:4 a la izquierda, info y acciones a la derecha. */
    .cn-mine-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
    .cn-job-card {
        display: grid; grid-template-columns: 92px minmax(0, 1fr); column-gap: 0.75rem;
        grid-template-areas: "media info" "media actions"; align-content: start; padding: 0.65rem;
    }
    .cn-job-card:not(:has(.cn-job-media)) { grid-template-columns: minmax(0, 1fr); grid-template-areas: "info" "actions"; }
    .cn-job-info { grid-area: info; min-width: 0; }
    .cn-job-head { gap: 0.15rem 0.5rem; }
    .cn-job-head b { font-size: 0.9rem; line-height: 1.25; }
    .cn-job-head span { font-size: 0.8rem; }
    .cn-job-info small { display: block; font-size: 0.74rem; line-height: 1.3; margin-top: 0.15rem; }
    .cn-job-media { grid-area: media; align-self: start; aspect-ratio: 3 / 4; overflow: hidden; border-radius: 10px; background: #000; margin: 0; }
    .cn-job-media video, .cn-job-media img { display: block; width: 100%; height: 100%; max-width: none; margin: 0; object-fit: cover; border-radius: 0; }
    .cn-job-photos { display: block; }
    .cn-job-photos a { display: block; height: 100%; }
    .cn-job-photos a:not(:first-child) { display: none; }
    .cn-job-actions { grid-area: actions; align-self: end; margin-top: 0.4rem; gap: 0.35rem; }
    .cn-job-actions .cn-dl { padding: 0.3rem 0.7rem; font-size: 0.74rem; }
}
@media (max-width: 480px) {
    .cn-brand { font-size: 1.05rem; }
    .cn-top-credits .cn-buy { padding: 0.4rem 0.7rem; }
}
@media (prefers-reduced-motion: reduce) {
    .cn-navbtn, .cn-short { transition: none; }
}

/* ─────────────── Controles de formulario: SIEMPRE legibles ───────────────
   style.css define input/select/textarea globales con `:focus { background: #FFF }` y `color: var(--text)`.
   Dentro de Dental Cinema (texto claro sobre fondo oscuro) eso dejaba texto blanco sobre fondo blanco al enfocar.
   Estos selectores van scopeados a .cn-app (más específicos que los globales) y fijan fondo, color, caret,
   placeholder y foco explícitos, también con autofill del navegador. */
.cn-app textarea,
.cn-app input[type="text"],
.cn-app input[type="number"],
.cn-app input[type="email"],
.cn-app input[type="search"],
.cn-app select,
.cn-app [contenteditable="true"] {
    background-color: #0F172A;
    color: #F8FAFC;
    -webkit-text-fill-color: #F8FAFC;
    caret-color: #FFFFFF;
    border: 1px solid rgba(255, 255, 255, 0.18);
    color-scheme: dark;
}
.cn-app textarea:hover,
.cn-app input[type="text"]:hover,
.cn-app input[type="number"]:hover,
.cn-app select:hover {
    background-color: #0F172A;
    border-color: rgba(255, 255, 255, 0.3);
}
.cn-app textarea:focus,
.cn-app textarea:active,
.cn-app input[type="text"]:focus,
.cn-app input[type="number"]:focus,
.cn-app input[type="email"]:focus,
.cn-app input[type="search"]:focus,
.cn-app select:focus,
.cn-app [contenteditable="true"]:focus {
    background-color: #0F172A;
    color: #F8FAFC;
    -webkit-text-fill-color: #F8FAFC;
    border-color: #1D4ED8;
    outline: 2px solid #1D4ED8;
    outline-offset: 1px;
}
.cn-app textarea::placeholder,
.cn-app input::placeholder { color: #94A3B8; opacity: 1; -webkit-text-fill-color: #94A3B8; }
.cn-app textarea:-webkit-autofill,
.cn-app input:-webkit-autofill,
.cn-app select:-webkit-autofill {
    -webkit-text-fill-color: #F8FAFC;
    caret-color: #FFFFFF;
    -webkit-box-shadow: 0 0 0 1000px #0F172A inset;
    box-shadow: 0 0 0 1000px #0F172A inset;
}
.cn-app select option { background: #0F172A; color: #F8FAFC; }
.cn-app textarea:disabled, .cn-app input:disabled, .cn-app select:disabled { opacity: 0.6; cursor: not-allowed; }
/* Checkboxes: sin el estilo "caja de texto" global (width:100%, padding). */
.cn-app input[type="checkbox"] { width: auto; padding: 0; background: transparent; }


/* ─────────────── Tile de la agencia (mosaico) ─────────────── */
.cn-agency {
    display: flex; flex-direction: column; justify-content: flex-end; gap: 0.6rem; padding: 1.1rem; min-height: 300px;
    background: radial-gradient(120% 90% at 100% 0%, rgba(29, 78, 216, 0.55), rgba(14, 32, 56, 0) 60%), linear-gradient(160deg, #0E2038, #0B0F1A);
    border: 1px solid rgba(255, 255, 255, 0.14);
}
.cn-agency .cn-badge-agency { align-self: flex-start; margin-bottom: auto; background: var(--cn-accent); letter-spacing: 0.12em; }
.cn-agency h3 { margin: 0; font-family: var(--cn-display); text-transform: uppercase; letter-spacing: -0.02em; font-weight: 900; font-size: 1.25rem; line-height: 1.05; color: #fff; }
.cn-agency p { margin: 0; font-size: 0.85rem; line-height: 1.4; color: #cbd5e1; }
.cn-agency-cta { display: inline-block; align-self: flex-start; text-decoration: none; padding: 0.6rem 1.2rem; font-size: 0.85rem; }

/* ─────────────── Mi kit (reutiliza la página Contenido sobre el fondo oscuro) ─────────────── */
.cn-kit {
    --text: #E5E7EB; --text-muted: #94A3B8; --text-light: #94A3B8; --border: rgba(255, 255, 255, 0.14);
    --bg: #0B0F1A; --bg-alt: #111827; --card-bg: #111827;
    color: var(--text);
}
.cn-kit .card { background: #111827; color: #E5E7EB; border: 1px solid rgba(255, 255, 255, 0.12); box-shadow: none; }
.cn-kit .card h3 { color: #fff; }
.cn-kit .text-muted, .cn-kit .text-xs, .cn-kit .text-sm { color: #94A3B8; }
.cn-kit .btn-secondary { background: rgba(255, 255, 255, 0.08); color: #fff; border-color: rgba(255, 255, 255, 0.2); }

@media (max-width: 768px) {
    .cn-agency { min-height: 0; padding: 0.8rem; }
    .cn-agency h3 { font-size: 0.95rem; }
    .cn-agency p { font-size: 0.74rem; }
    .cn-agency-cta { padding: 0.5rem 0.9rem; font-size: 0.75rem; }
}

/* ─────────────── Video del Estudio: chooser, formulario y pie ─────────────── */
.cn-vhead { display: flex; flex-direction: column; gap: 0.2rem; margin-top: 0.25rem; }
.cn-vhead b { font-family: var(--cn-display); text-transform: uppercase; letter-spacing: -0.01em; font-size: 1.05rem; line-height: 1.1; color: #fff; }
.cn-vhead small { font-size: 0.82rem; line-height: 1.35; color: var(--cn-muted); }
.cn-vmodes { display: flex; flex-direction: column; gap: 0.5rem; }
.cn-vmode { min-height: 44px; }
.cn-vlink {
    display: flex; flex-direction: column; gap: 0.15rem; width: 100%; min-height: 44px; text-align: left; cursor: pointer;
    padding: 0.7rem 0.8rem; border-radius: 12px; border: 1px dashed rgba(255, 255, 255, 0.25); background: transparent;
    color: var(--cn-text); font-family: inherit;
}
.cn-vlink:hover { background: rgba(255, 255, 255, 0.06); }
.cn-vlink b { font-size: 0.9rem; color: #fff; }
.cn-vlink small { font-size: 0.76rem; color: var(--cn-muted); }
.cn-vform { display: flex; flex-direction: column; gap: 0.7rem; min-width: 0; }
.cn-vform .cn-pill, .cn-vform .cn-idea { min-height: 44px; display: inline-flex; align-items: center; }
.cn-vphotos { min-width: 0; }
.cn-vpair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.cn-vpair .cn-drop { min-height: 150px; }
.cn-field-help { font-size: 0.75rem; line-height: 1.3; color: var(--cn-muted); }
.cn-field-error { font-size: 0.78rem; color: #fca5a5; }
.cn-field-foot { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; min-height: 1.1rem; }
.cn-field-msg { font-size: 0.78rem; color: #fca5a5; }
.cn-counter { margin-left: auto; font-size: 0.72rem; color: var(--cn-muted); }
.cn-vsum { margin-bottom: 0.55rem; text-align: center; font-size: 0.88rem; font-weight: 700; color: #fff; }
.cn-panel-foot .cn-gen { min-height: 48px; }
.cn-vform > .cn-back { align-self: flex-start; }
.cn-cta:disabled { opacity: 0.6; cursor: not-allowed; }
.cn-panel-foot .cn-reason { overflow-wrap: anywhere; }
/* Objetivos táctiles de al menos 44 px en el panel (en una columna: tablet y celular). */
@media (max-width: 900px) {
    .cn-panel .cn-tab, .cn-panel .cn-seg-btn, .cn-panel .cn-back, .cn-panel .cn-buy { min-height: 44px; display: inline-flex; align-items: center; }
    /* Chips de formato, duración y ideas: también en plantillas y fotos, no solo en el formulario de video. */
    .cn-panel .cn-pill, .cn-panel .cn-idea { min-height: 44px; display: inline-flex; align-items: center; }
    .cn-panel .cn-drop-x { width: 44px; height: 44px; }
}

/* ─────────────── Genjutsu: "Ponete en otra escena" ─────────────── */
.cn-model.cn-soon, .cn-model.cn-soon:hover { opacity: 0.6; cursor: not-allowed; background: rgba(255, 255, 255, 0.04); }
.cn-model.cn-soon .cn-model-price { color: var(--cn-muted); }
.cn-drop-video { min-height: 150px; }
.cn-drop-video.filled { aspect-ratio: 16 / 10; cursor: default; background: #05070d; }
.cn-drop-video video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #05070d; }
.cn-drop-video .cn-drop-x { width: 44px; height: 44px; }
.cn-gen-dur { margin-top: 0.1rem; }
/* Destacados: sin la tarjeta ancha, dos tarjetas verticales de ancho parejo. */
.cn-feat-row { grid-template-columns: repeat(auto-fill, minmax(160px, 260px)); }
.cn-fmedia { height: auto; aspect-ratio: 3 / 4; }
.cn-consent input[type="checkbox"] { width: 22px; height: 22px; }
/* Celular: controles táctiles de al menos 44 px (barra superior y botones de tarjetas). */
@media (max-width: 900px) {
    .cn-navbtn, .cn-cta { min-height: 44px; }
}

/* ─────────────── Video: "Elegí el modelo" (niveles, tarjetas, segundos, resolución) ─────────────── */
.cn-vmodel { display: flex; flex-direction: column; gap: 0.55rem; min-width: 0; }
.cn-tiers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.25rem; padding: 0.25rem; background: rgba(0, 0, 0, 0.3); border-radius: 12px; }
.cn-tier {
    min-height: 44px; border: 0; border-radius: 9px; cursor: pointer; font: inherit; font-size: 0.88rem; font-weight: 700;
    background: transparent; color: var(--cn-muted); transition: background 150ms ease, color 150ms ease;
}
.cn-tier:hover { color: #fff; }
.cn-tier.on { background: var(--cn-accent); color: #fff; }
.cn-tier-tag { margin: 0; }
.cn-engines { display: flex; flex-direction: column; gap: 0.45rem; }
.cn-engine { min-height: 44px; width: 100%; font: inherit; }
.cn-engine .cn-model-top { flex-wrap: wrap; }
.cn-stepper { display: flex; align-items: center; gap: 0.6rem; }
.cn-step {
    width: 44px; height: 44px; flex: none; cursor: pointer; border-radius: 12px; border: 1px solid var(--cn-line);
    background: rgba(255, 255, 255, 0.08); color: #fff; font-size: 1.4rem; line-height: 1; font-weight: 700;
}
.cn-step:hover:not(:disabled) { background: rgba(255, 255, 255, 0.16); }
.cn-step:disabled { opacity: 0.35; cursor: not-allowed; }
.cn-step-val { flex: 1; min-width: 7rem; text-align: center; font-size: 0.95rem; color: var(--cn-text); }
.cn-step-val b { font-size: 1.3rem; color: #fff; }
.cn-warn { margin-bottom: 0.55rem; padding: 0.6rem 0.75rem; border-radius: 12px; font-size: 0.88rem; font-weight: 700; text-align: center; color: #fde68a; background: rgba(245, 158, 11, 0.16); border: 1px solid rgba(245, 158, 11, 0.5); }
.cn-confirm { display: grid; grid-template-columns: 1fr auto; gap: 0.5rem; }
.cn-ghost { min-height: 44px; padding: 0 1rem; cursor: pointer; border-radius: 14px; font: inherit; font-weight: 700; color: #fff; background: transparent; border: 1px solid var(--cn-line); }
.cn-ghost:hover { background: rgba(255, 255, 255, 0.08); }
.cn-cheaper { width: 100%; margin-top: 0.5rem; }
