/* =========================================================
   Vidarivo · sistema de diseño
   Bootstrap 5 como base + tokens propios. Sin build de Node.
   ========================================================= */
:root {
    --brand: #5b4cf0;
    --brand-strong: #4636d8;
    --brand-soft: #eeecff;
    --teal: #27d5ce;
    --coral: #ff6b5a;
    --ink: #0f1430;
    --ink-2: #3b4163;
    --muted: #6b7290;
    --bg: #f6f7fb;
    --surface: #ffffff;
    --border: #e6e8f0;
    --success: #12a37f;
    --danger: #e04a3c;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 2px rgba(15, 20, 48, .06);
    --shadow: 0 10px 30px -12px rgba(15, 20, 48, .18);
    --ring: 0 0 0 4px rgba(91, 76, 240, .18);
    --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    --bs-body-font-family: var(--font);
    --bs-body-color: var(--ink);
    --bs-body-bg: var(--bg);
    --bs-primary: var(--brand);
    --bs-link-color: var(--brand);
    --bs-border-radius: var(--radius-sm);
}

html, body { font-family: var(--font); background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { letter-spacing: -.02em; font-weight: 800; }
h1:focus { outline: none; }
a { color: var(--brand); text-decoration: none; }
.material-symbols-rounded { font-size: 1.25em; vertical-align: -.2em; line-height: 1; }
.grow { flex: 1; min-width: 0; }
.optional { color: var(--muted); font-weight: 400; }
.text-gradient { background: linear-gradient(90deg, #a99cff, var(--teal)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Botones ---------- */
.btn { font-weight: 700; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; gap: .45rem; transition: transform .12s ease, box-shadow .2s ease, background .2s ease; }
.btn:active { transform: translateY(1px); }
.btn-brand { background: var(--brand); color: #fff; border: 0; padding: .7rem 1.25rem; box-shadow: 0 8px 20px -8px rgba(91, 76, 240, .7); }
.btn-brand:hover { background: var(--brand-strong); color: #fff; }
.btn-brand:disabled { background: #b9b3f5; box-shadow: none; color: #fff; }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--ink-2); padding: .6rem 1.1rem; }
.btn-ghost:hover { background: var(--surface); border-color: #cfd3e3; }
.btn-xl { padding: 1rem 1.6rem; font-size: 1.1rem; border-radius: 14px; }
.icon-btn { border: 0; background: transparent; color: var(--muted); width: 36px; height: 36px; border-radius: 10px; display: inline-grid; place-items: center; }
.icon-btn:hover { background: var(--brand-soft); color: var(--brand); }
.btn:focus-visible, .form-control:focus, .form-select:focus, .form-check-input:focus { box-shadow: var(--ring); border-color: var(--brand); }

/* ---------- Formularios ---------- */
.field { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1rem; }
.field label { font-weight: 600; font-size: .9rem; color: var(--ink-2); }
.form-control, .form-select { border-radius: var(--radius-sm); border-color: var(--border); padding: .65rem .85rem; }
.input-lg { padding: .85rem 1rem; font-size: 1rem; }
.field-error, .validation-message { color: var(--danger); font-size: .85rem; }
.check { display: flex; align-items: center; gap: .5rem; margin: .25rem 0 1.25rem; color: var(--ink-2); font-size: .92rem; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 1rem; }

/* ---------- Login ---------- */
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-hero { position: relative; overflow: hidden; background: radial-gradient(1200px 600px at 10% 10%, #2a1f8f 0%, #0f1430 55%, #070a1c 100%); color: #fff; display: flex; align-items: center; padding: 3rem; }
.auth-hero-inner { position: relative; z-index: 2; max-width: 520px; }
.auth-claim { font-size: clamp(2rem, 3.4vw, 3.1rem); line-height: 1.08; margin: 2.5rem 0 1rem; }
.auth-sub { color: #c4c8e4; font-size: 1.1rem; }
.auth-steps { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: .8rem; }
.auth-steps li { display: flex; gap: .75rem; align-items: center; color: #e3e5f6; font-weight: 500; }
.auth-steps .material-symbols-rounded { background: rgba(255,255,255,.1); border-radius: 10px; padding: .45rem; font-size: 1.2rem; color: var(--teal); }
.auth-orb { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; animation: float 12s ease-in-out infinite alternate; }
.orb-1 { width: 380px; height: 380px; background: #6c4cf0; right: -80px; top: -60px; }
.orb-2 { width: 300px; height: 300px; background: #1fb5c4; left: 20%; bottom: -120px; animation-delay: -4s; }
@keyframes float { to { transform: translate(-30px, 40px) scale(1.08); } }
.auth-main { display: grid; place-items: center; padding: 2rem; background: var(--surface); }
.auth-card { width: 100%; max-width: 400px; }
.auth-title { font-size: 2rem; margin-bottom: .25rem; }
.auth-lead { color: var(--muted); margin-bottom: 1.75rem; }
.auth-foot { color: var(--muted); font-size: .85rem; text-align: center; margin-top: 1.25rem; }
@media (max-width: 900px) { .auth-shell { grid-template-columns: 1fr; } .auth-hero { padding: 2rem; min-height: 260px; } .auth-claim { margin-top: 1.5rem; font-size: 1.8rem; } .auth-steps { display: none; } }

/* ---------- Marca ---------- */
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--ink); font-weight: 800; font-size: 1.2rem; letter-spacing: -.02em; }
.brand-light { color: #fff; }
.brand-mark { display: inline-flex; }

/* ---------- Topbar ---------- */
.topbar { position: sticky; top: 0; z-index: 10; background: rgba(255,255,255,.85); backdrop-filter: saturate(1.6) blur(12px); border-bottom: 1px solid var(--border); }
.topbar-inner { max-width: 1200px; margin: 0 auto; padding: .7rem 1.5rem; display: flex; align-items: center; gap: 2rem; }
.topnav { display: flex; gap: .25rem; flex: 1; }
.topnav a { display: inline-flex; align-items: center; gap: .4rem; padding: .5rem .85rem; border-radius: 10px; color: var(--ink-2); font-weight: 600; font-size: .95rem; }
.topnav a:hover { background: var(--bg); }
.topnav a.active { background: var(--brand-soft); color: var(--brand); }
.usermenu { display: flex; align-items: center; gap: .4rem; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--brand), var(--teal)); }
@media (max-width: 700px) { .topbar-inner { gap: .75rem; padding: .6rem 1rem; } .topnav a { padding: .5rem; font-size: 0; } .topnav a .material-symbols-rounded { font-size: 1.4rem; } .brand-name { display: none; } }

.page { max-width: 1200px; margin: 0 auto; padding: 2rem 1.5rem 4rem; }
.page-title { font-size: 1.9rem; margin: 0; }

/* ---------- Home ---------- */
.hero-card { display: flex; align-items: center; justify-content: space-between; gap: 2rem; flex-wrap: wrap; padding: 2.5rem; border-radius: 24px; color: #fff; background: radial-gradient(800px 400px at 0% 0%, #6c4cf0 0%, transparent 60%), radial-gradient(600px 400px at 100% 100%, #1fb5c4 0%, transparent 55%), #141a46; box-shadow: var(--shadow); }
.hero-card .eyebrow { margin: 0 0 .3rem; color: #c9c4ff; font-weight: 600; }
.hero-title { font-size: clamp(1.8rem, 3vw, 2.6rem); margin: 0 0 .5rem; }
.hero-sub { color: #d4d7ee; max-width: 560px; margin: 0; }
.hero-card .btn-brand { background: #fff; color: var(--brand); box-shadow: 0 10px 30px -10px rgba(0,0,0,.5); }
.hero-card .btn-brand:hover { background: #f3f1ff; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin: 2.5rem 0 1rem; }
.section-head h2 { font-size: 1.35rem; margin: 0; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.25rem; }
.video-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); min-height: 220px; transition: transform .15s, box-shadow .2s; }
.video-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.video-thumb { aspect-ratio: 16/9; display: grid; place-items: center; background: linear-gradient(135deg, #e9e6ff, #d8f6f4); color: var(--brand); font-size: 2.4rem; }
.video-meta { padding: 1rem; }
.video-meta h3 { font-size: 1rem; margin: 0 0 .25rem; }
.video-meta p { color: var(--muted); font-size: .85rem; margin: 0 0 .6rem; }
.status { display: inline-block; font-size: .75rem; font-weight: 700; padding: .25rem .6rem; border-radius: 999px; background: var(--bg); color: var(--ink-2); }
.status-completed { background: #e3f7f0; color: var(--success); }
.status-failed { background: #fde9e7; color: var(--danger); }
.status-rendering, .status-generatingscript { background: var(--brand-soft); color: var(--brand); }
.empty { text-align: center; padding: 3.5rem 1rem; background: var(--surface); border: 1px dashed #d5d8e6; border-radius: var(--radius); }
.empty-icon { font-size: 3rem; color: var(--brand); background: var(--brand-soft); border-radius: 20px; padding: .8rem; }
.empty h3 { margin: 1rem 0 .3rem; font-size: 1.2rem; }
.empty p { color: var(--muted); }
.skeleton { background: linear-gradient(90deg, #eceef5 0%, #f6f7fb 50%, #eceef5 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border: 0; border-radius: var(--radius); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Asistente ---------- */
.wizard { max-width: 980px; margin: 0 auto; }
.stepper { list-style: none; display: flex; gap: .5rem; padding: 0; margin: 0 0 1.5rem; counter-reset: s; }
.stepper li { flex: 1; position: relative; }
.stepper li:not(:last-child)::after { content: ""; position: absolute; top: 18px; left: calc(50% + 24px); right: calc(-50% + 24px); height: 2px; background: var(--border); }
.stepper li.done:not(:last-child)::after { background: var(--brand); }
.stepper button { width: 100%; border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: .35rem; color: var(--muted); font-weight: 600; font-size: .85rem; }
.stepper button:disabled { cursor: default; }
.step-dot { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--border); font-weight: 800; color: var(--muted); }
.stepper li.active .step-dot { border-color: var(--brand); color: var(--brand); box-shadow: var(--ring); }
.stepper li.active .step-label { color: var(--ink); }
.stepper li.done .step-dot { background: var(--brand); border-color: var(--brand); color: #fff; }
@media (max-width: 600px) { .step-label { display: none; } }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 2rem; box-shadow: var(--shadow-sm); }
.panel.p-0 { padding: 0; overflow: hidden; }
.panel-title { font-size: 1.6rem; margin: 0 0 .35rem; }
.panel-sub { color: var(--muted); margin: 0 0 1.5rem; }
.sub-title { font-size: 1rem; font-weight: 700; margin: 1.75rem 0 .75rem; }
.panel-actions { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 720px) { .two-col { grid-template-columns: 1fr; } .panel { padding: 1.25rem; } }

.dropzone { position: relative; display: flex; flex-direction: column; align-items: center; gap: .4rem; padding: 2.5rem 1rem; border: 2px dashed #cfd2f5; border-radius: var(--radius); background: #fafaff; text-align: center; cursor: pointer; transition: border-color .2s, background .2s; }
.dropzone:hover { border-color: var(--brand); background: var(--brand-soft); }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dz-icon { font-size: 2.6rem; color: var(--brand); }
.dropzone small { color: var(--muted); }
.file-list { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: .5rem; }
.file-list li { display: flex; align-items: center; gap: .75rem; padding: .6rem .8rem; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.file-list small { color: var(--muted); }

.option-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .8rem; }
.option-card, .style-card, .format-card, .voice-card { text-align: left; background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius); transition: border-color .15s, box-shadow .2s, transform .12s; }
.option-card:hover, .style-card:hover, .format-card:hover, .voice-card:hover { border-color: #c4bffa; transform: translateY(-1px); }
.selected { border-color: var(--brand) !important; box-shadow: var(--ring); }
.option-card { padding: 1rem; display: flex; flex-direction: column; gap: .3rem; }
.option-card small, .style-info small, .format-card small, .voice-card small { color: var(--muted); font-size: .82rem; line-height: 1.35; }
.opt-icon { font-size: 1.6rem; color: var(--brand); background: var(--brand-soft); border-radius: 12px; padding: .4rem; align-self: flex-start; margin-bottom: .3rem; }

.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { border: 1.5px solid var(--border); background: var(--surface); padding: .45rem .95rem; border-radius: 999px; font-weight: 600; font-size: .9rem; color: var(--ink-2); }
.chip:hover { border-color: #c4bffa; }
.chip.selected { background: var(--brand); color: #fff; box-shadow: none; }

.style-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.style-card { padding: 0; overflow: hidden; }
.style-preview { aspect-ratio: 16/9; position: relative; background: radial-gradient(circle at 75% 30%, var(--c2, #27d5ce) 0 14%, transparent 15%), linear-gradient(135deg, var(--c0, #0b1230), var(--c1, #1d2b6b)); }
.sp-title { position: absolute; left: 1rem; top: .9rem; font-size: 2rem; font-weight: 800; color: var(--c3, #fff); mix-blend-mode: normal; }
.sp-bar { position: absolute; left: 1rem; bottom: 1rem; width: 45%; height: 10px; border-radius: 6px; background: var(--c3, #fff); opacity: .9; box-shadow: 0 16px 0 -2px var(--c2, #27d5ce); }
.style-info { padding: .9rem 1rem 1rem; display: flex; flex-direction: column; gap: .2rem; }

.format-row { display: flex; gap: .7rem; flex-wrap: wrap; }
.format-card { padding: .9rem; display: flex; flex-direction: column; align-items: center; gap: .3rem; flex: 1; min-width: 110px; text-align: center; }
.format-shape { display: block; border: 2.5px solid var(--brand); border-radius: 6px; margin-bottom: .3rem; }
.f-169 { width: 48px; height: 27px; } .f-916 { width: 22px; height: 39px; } .f-11 { width: 32px; height: 32px; }

.segmented { display: inline-flex; background: var(--bg); border-radius: 12px; padding: 4px; }
.segmented button { border: 0; background: none; padding: .5rem 1.2rem; border-radius: 9px; font-weight: 700; color: var(--muted); }
.segmented button.on { background: var(--surface); color: var(--brand); box-shadow: var(--shadow-sm); }

.voice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .7rem; margin-top: .5rem; }
.voice-card { padding: .8rem; display: flex; align-items: center; gap: .75rem; }
.voice-card .grow { display: flex; flex-direction: column; }
.voice-card .play { color: var(--brand); font-size: 1.7rem; }
.voice-avatar { width: 38px; height: 38px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: var(--brand); background: var(--brand-soft); }

.toggles { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; margin-top: 1.75rem; }
.toggle { display: inline-flex; align-items: center; gap: .6rem; font-weight: 600; cursor: pointer; }
.toggle input { display: none; }
.toggle .track { width: 44px; height: 26px; border-radius: 999px; background: #d6d9e6; position: relative; transition: background .2s; }
.toggle .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .2s; }
.toggle input:checked + .track { background: var(--brand); }
.toggle input:checked + .track::after { transform: translateX(18px); }

.summary { display: grid; grid-template-columns: 140px 1fr; gap: .7rem 1rem; margin: 0; }
.summary dt { color: var(--muted); font-weight: 600; }
.summary dd { margin: 0; font-weight: 600; }
.notice { display: flex; align-items: center; gap: .6rem; margin-top: 1.5rem; padding: .85rem 1rem; border-radius: var(--radius-sm); background: #fff7e8; color: #8a5a00; font-weight: 600; font-size: .92rem; }

/* ---------- Tablas ---------- */
.table-clean { width: 100%; border-collapse: collapse; }
.table-clean th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: .9rem 1.25rem; background: #fafbfd; border-bottom: 1px solid var(--border); }
.table-clean td { padding: .85rem 1.25rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table-clean tr:last-child td { border-bottom: 0; }
.table-clean tr.inactive td { opacity: .55; }
.user-cell { display: flex; align-items: center; gap: .75rem; }
.user-cell small { display: block; color: var(--muted); }

/* ---------- Plantilla Blazor ---------- */
.valid.modified:not([type=checkbox]) { outline: 1px solid var(--success); }
.invalid { outline: 1px solid var(--danger); }
.blazor-error-boundary { background: #fde9e7; padding: 1rem; color: var(--danger); border-radius: var(--radius-sm); }
.blazor-error-boundary::after { content: "Se ha producido un error."; }
#blazor-error-ui { color-scheme: light only; background: #fff7e8; bottom: 0; box-shadow: 0 -1px 2px rgba(0,0,0,.2); box-sizing: border-box; display: none; left: 0; padding: .6rem 1.25rem .7rem; position: fixed; width: 100%; z-index: 1000; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }
.btn-ghost:disabled { opacity: .45; border-color: var(--border); }

/* ---------- Banco de pruebas del motor ---------- */
.lab-controls { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.lab-time { color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 600; }
.lab-stage { background: #000; border-radius: var(--radius); overflow: hidden; display: flex; justify-content: center; }
.lab-stage canvas { display: block; width: 100%; height: auto; }
.lab-stage.ratio-Portrait9x16 canvas { width: auto; height: 70vh; }
.lab-stage.ratio-Square1x1 canvas { width: auto; height: 70vh; max-width: 100%; }
.lab-video { display: block; width: 100%; margin-top: 1rem; border-radius: var(--radius); background: #000; }
.lab-video.ratio-Portrait9x16, .lab-video.ratio-Square1x1 { width: auto; max-height: 70vh; margin-inline: auto; }

/* ---------- Home: tarjetas de vídeo ---------- */
a.video-card { display: block; color: inherit; }
.video-thumb { position: relative; overflow: hidden; }
.video-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.video-thumb .thumb-play { position: relative; color: #fff; font-size: 3rem; text-shadow: 0 4px 20px rgba(0,0,0,.5); opacity: .9; }
.status-scriptqueued, .status-scriptready { background: var(--brand-soft); color: var(--brand); }

/* ---------- Asistente: voces ---------- */
.voice-card { cursor: pointer; }
.voice-card .icon-btn.play { color: var(--brand); width: 40px; height: 40px; }
.voice-card .icon-btn.play .material-symbols-rounded { font-size: 1.8rem; }
.spinner-sm { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff; animation: spin .8s linear infinite; display: inline-block; }

/* ---------- Proyecto ---------- */
.project-head { margin-bottom: 1.5rem; }
.project-head .back { display: inline-flex; align-items: center; gap: .3rem; color: var(--muted); font-weight: 600; margin-bottom: .5rem; }
.chips-static { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
.chips-static > span { display: inline-flex; align-items: center; gap: .35rem; background: var(--surface); border: 1px solid var(--border); padding: .35rem .75rem; border-radius: 999px; font-size: .85rem; font-weight: 600; color: var(--ink-2); }
.chips-static .material-symbols-rounded { color: var(--brand); font-size: 1.1rem; }
.panel.working { display: flex; align-items: center; gap: 1.5rem; }
.spinner { width: 56px; height: 56px; flex: none; border-radius: 50%; border: 5px solid var(--brand-soft); border-top-color: var(--brand); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.progress-track { height: 12px; background: var(--brand-soft); border-radius: 999px; overflow: hidden; margin: .25rem 0 .5rem; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--brand), var(--teal)); border-radius: 999px; transition: width .6s ease; }
.panel.result { display: grid; grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr); gap: 2rem; align-items: center; }
.player { width: 100%; border-radius: var(--radius); background: #000; display: block; }
.player.ratio-Portrait9x16, .player.ratio-Square1x1 { max-height: 70vh; width: auto; max-width: 100%; margin-inline: auto; }
@media (max-width: 860px) { .panel.result { grid-template-columns: 1fr; } }
.panel.failed { display: flex; align-items: center; gap: 1.25rem; border-color: #f6c9c4; background: #fff8f7; }
.panel.failed > .material-symbols-rounded { font-size: 2.4rem; color: var(--danger); }
.script-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.script-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.script-summary { background: var(--bg); border-radius: var(--radius-sm); padding: .8rem 1rem; color: var(--ink-2); }
.scene-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .8rem; }
.scene-card { display: grid; grid-template-columns: 150px 1fr; gap: 1rem; padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius); }
.scene-meta { display: flex; flex-direction: column; gap: .5rem; align-items: flex-start; }
.scene-num { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: #fff; font-weight: 800; }
.scene-type { display: inline-flex; align-items: center; gap: .3rem; font-size: .82rem; font-weight: 700; color: var(--brand); background: var(--brand-soft); padding: .25rem .6rem; border-radius: 999px; }
.scene-type .material-symbols-rounded { font-size: 1rem; }
.scene-body label { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); display: block; margin-bottom: .25rem; }
.scene-headline { font-weight: 700; }
.scene-data { margin-top: .5rem; font-size: .88rem; color: var(--ink-2); background: var(--bg); border-radius: 8px; padding: .4rem .7rem; }
.save-bar { position: sticky; bottom: 1rem; margin-top: 1rem; display: flex; align-items: center; gap: .75rem; justify-content: flex-end; background: var(--ink); color: #fff; padding: .75rem 1rem; border-radius: var(--radius); box-shadow: var(--shadow); }
.save-bar span { margin-right: auto; font-weight: 600; }
.save-bar .btn-ghost { color: #fff; border-color: rgba(255,255,255,.3); }
@media (max-width: 640px) { .scene-card { grid-template-columns: 1fr; } .scene-meta { flex-direction: row; align-items: center; } }

/* Vista previa del guion (StoryboardPreview) */
.preview-player .lab-stage { position: relative; cursor: pointer; }
.preview-play { position: absolute; left: 16px; bottom: 16px; width: 64px; height: 64px; font-size: 44px; color: #fff; background: rgba(15,18,30,.55); border-radius: 50%; backdrop-filter: blur(4px); pointer-events: none; display: flex; align-items: center; justify-content: center; }
.preview-controls { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.preview-controls .form-range { flex: 1; }
.preview-panel .lab-stage.ratio-Portrait9x16 canvas, .preview-panel .lab-stage.ratio-Square1x1 canvas { height: 60vh; }
/* Miniaturas verticales o cuadradas: se ven enteras sobre fondo oscuro, sin recortar el título. */
.video-thumb.ratio-Portrait9x16, .video-thumb.ratio-Square1x1 { background: #0d1020; }
.video-thumb.ratio-Portrait9x16 img, .video-thumb.ratio-Square1x1 img { object-fit: contain; }

/* Kit de marca */
.brand-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 24px; align-items: start; }
@media (max-width: 960px) { .brand-grid { grid-template-columns: 1fr; } }
.brand-logo-box { display: flex; align-items: center; gap: 12px; min-height: 72px; padding: 12px; border: 1px dashed var(--border, #d9dbe6); border-radius: 12px; background: #fff; }
.brand-logo-box img { max-height: 56px; max-width: 70%; object-fit: contain; }
.color-field { display: flex; gap: 8px; align-items: center; }
.color-field input[type=color] { width: 48px; height: 38px; padding: 2px; border: 1px solid var(--border, #d9dbe6); border-radius: 8px; background: #fff; }
.brand-toggle { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--border, #d9dbe6); border-radius: 14px; cursor: pointer; }
.brand-toggle small { display: block; color: var(--muted, #6b7280); }
.brand-logo-mini { max-height: 32px; max-width: 110px; object-fit: contain; }
.swatch { width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }

/* Consumo */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.stat { background: #fff; border-radius: var(--radius, 16px); padding: 18px 20px; box-shadow: 0 1px 2px rgba(16,24,40,.06); }
.stat small { display: block; color: var(--muted, #6b7280); }
.stat strong { font-size: 1.8rem; }
.quota-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ===== Mis vídeos (UX) ===== */
.starter-row { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-top: 1.25rem; }
.starter-label { font-weight: 700; color: var(--muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; margin-right: .25rem; }
.starter { display: flex; align-items: center; gap: .65rem; padding: .6rem .95rem .6rem .7rem; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; color: var(--ink); text-decoration: none; box-shadow: var(--shadow-sm); transition: transform .15s, border-color .15s, box-shadow .2s; }
.starter:hover { transform: translateY(-2px); border-color: #c4bffa; box-shadow: var(--shadow); color: var(--ink); }
.starter > .material-symbols-rounded { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: var(--brand-soft); color: var(--brand); }
.starter strong { display: block; font-size: .92rem; line-height: 1.2; }
.starter small { color: var(--muted); font-size: .8rem; }

.library-head { align-items: center; flex-wrap: wrap; }
.library-head h2 { display: flex; align-items: center; gap: .5rem; }
.library-head .count { font-size: .8rem; font-weight: 700; color: var(--brand); background: var(--brand-soft); border-radius: 999px; padding: .15rem .55rem; }
.library-tools { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.search { display: flex; align-items: center; gap: .4rem; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: .35rem .9rem; min-width: 240px; }
.search:focus-within { box-shadow: var(--ring); border-color: #c4bffa; }
.search input { border: 0; outline: 0; background: transparent; width: 100%; font: inherit; }
.search .material-symbols-rounded { color: var(--muted); font-size: 1.2rem; }

article.video-card { position: relative; min-height: 0; display: flex; flex-direction: column; }
.video-card .video-thumb { position: relative; display: grid; place-items: center; color: var(--brand); text-decoration: none; }
.video-card .thumb-play { position: absolute; inset: 0; margin: auto; width: 64px; height: 64px; display: grid; place-items: center; font-size: 64px; color: #fff; opacity: 0; transform: scale(.85); transition: opacity .2s, transform .2s; text-shadow: 0 6px 24px rgba(0,0,0,.45); }
.video-card:hover .thumb-play { opacity: 1; transform: scale(1); }
.video-card .video-thumb img { transition: transform .35s; }
.video-card:hover .video-thumb img { transform: scale(1.03); }
.thumb-icon { font-size: 2.6rem; opacity: .75; }
.thumb-working .spinner { width: 34px; height: 34px; }
.thumb-badge { position: absolute; bottom: 8px; font-size: .72rem; font-weight: 700; color: #fff; background: rgba(10,12,28,.72); padding: .15rem .45rem; border-radius: 6px; backdrop-filter: blur(4px); }
.thumb-badge.right { right: 8px; }
.thumb-badge.left { left: 8px; top: 8px; bottom: auto; background: rgba(255,255,255,.88); color: var(--ink-2); }
.thumb-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(91,76,240,.18); }
.thumb-progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--teal)); transition: width .6s; }
.video-card.is-processing .video-thumb { background: linear-gradient(110deg, #eeecff 30%, #f7f6ff 50%, #eeecff 70%); background-size: 200% 100%; animation: shimmer 1.6s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.meta-row { display: flex; align-items: flex-start; gap: .25rem; }
.meta-title { flex: 1; font-weight: 700; color: var(--ink); text-decoration: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.3; margin-top: .3rem; }
.meta-title:hover { color: var(--brand); }
.status { display: inline-flex; align-items: center; gap: .35rem; }
.dot-pulse { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; transform: scale(.7); } }
.empty.slim { padding: 2rem 1rem; }

.menu-backdrop { position: fixed; inset: 0; z-index: 20; }
.menu { position: absolute; right: .75rem; bottom: 3.2rem; z-index: 21; min-width: 230px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 18px 40px -12px rgba(15,20,48,.3); padding: .35rem; animation: pop .14s ease-out; }
.menu a, .menu button { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .55rem .7rem; border: 0; background: transparent; border-radius: 9px; color: var(--ink); font: inherit; font-size: .92rem; text-decoration: none; text-align: left; }
.menu a:hover, .menu button:hover { background: var(--brand-soft); color: var(--brand); }
.menu .danger:hover { background: #fde9e7; color: var(--danger); }
.menu .material-symbols-rounded { font-size: 1.2rem; }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.98); } }

/* Avisos */
.toasts { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 100; display: flex; flex-direction: column; gap: .6rem; max-width: min(420px, calc(100vw - 2.5rem)); }
.toast-item { display: flex; align-items: center; gap: .7rem; background: #141a46; color: #fff; padding: .8rem .9rem .8rem 1rem; border-radius: 14px; box-shadow: 0 20px 40px -14px rgba(10,12,40,.55); animation: pop .18s ease-out; }
.toast-item > .material-symbols-rounded { color: var(--teal); }
.toast-item.ok > .material-symbols-rounded { color: #5ee6b0; }
.toast-item.error > .material-symbols-rounded { color: #ff8f84; }
.toast-item button { border: 0; background: rgba(255,255,255,.12); color: #fff; font-weight: 700; border-radius: 9px; padding: .35rem .7rem; }
.toast-item button:hover { background: rgba(255,255,255,.22); }
.toast-item button.close { background: transparent; padding: .2rem; opacity: .7; }

/* ===== Asistente (UX) ===== */
.dropzone.dragging { border-color: var(--brand); background: var(--brand-soft); transform: scale(1.01); box-shadow: var(--ring); }
.dropzone.dragging .dz-icon { animation: bob .8s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px); } }
.idea-meta { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; margin-top: .6rem; }
.idea-hint { color: var(--muted); font-size: .85rem; }
.chip-sm { display: inline-flex; align-items: center; gap: .3rem; padding: .3rem .7rem; font-size: .82rem; }
.chip-sm .material-symbols-rounded { font-size: 1rem; color: var(--brand); }
.style-card { position: relative; }
.style-live { aspect-ratio: 16/9; background: #0b0f1e; overflow: hidden; }
.style-live canvas { display: block; width: 100%; height: 100%; }
.style-card .style-check { position: absolute; top: 10px; right: 10px; color: #fff; background: var(--brand); border-radius: 50%; font-size: 1.6rem; box-shadow: 0 4px 14px rgba(91,76,240,.5); animation: pop .15s ease-out; }
.style-card.selected { border-color: var(--brand); box-shadow: var(--ring); }

/* ===== Proyecto (UX) ===== */
.page-title.editable { cursor: text; display: inline-flex; align-items: center; gap: .5rem; border-radius: 10px; padding: .1rem .4rem; margin-left: -.4rem; }
.page-title.editable .material-symbols-rounded { font-size: 1.2rem; color: var(--muted); opacity: 0; transition: opacity .15s; }
.page-title.editable:hover { background: var(--surface); }
.page-title.editable:hover .material-symbols-rounded { opacity: 1; }
.title-edit { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.page-title-input { font-size: 1.5rem; font-weight: 800; max-width: 720px; }

.working-steps { display: flex; align-items: center; gap: 2rem; }
.working-visual { flex: none; width: 96px; display: grid; place-items: center; }
.working-visual .spinner { width: 56px; height: 56px; }
.ring { width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--brand) calc(var(--p) * 1%), var(--brand-soft) 0); transition: background .6s; }
.ring span { width: 72px; height: 72px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-weight: 800; color: var(--brand); }
.steps-check { list-style: none; padding: 0; margin: .6rem 0 1rem; display: grid; gap: .35rem; }
.steps-check li { display: flex; align-items: center; gap: .5rem; color: var(--muted); font-weight: 600; }
.steps-check li.done { color: var(--success); }
.steps-check li.now { color: var(--ink); }
.steps-check li.now .material-symbols-rounded { color: var(--brand); animation: spin 1.1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 640px) { .working-steps { flex-direction: column; align-items: flex-start; gap: 1rem; } }

.result-badge { display: inline-flex; align-items: center; gap: .3rem; color: var(--success); background: #e3f7f0; font-weight: 700; font-size: .8rem; border-radius: 999px; padding: .2rem .6rem; margin-bottom: .4rem; }
.result-badge .material-symbols-rounded { font-size: 1rem; }
.side-label { margin: 1.25rem 0 .5rem; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.variant-row { display: flex; gap: .5rem; flex-wrap: wrap; }
.variant { display: inline-flex; align-items: center; gap: .5rem; border: 1.5px solid var(--border); background: var(--surface); border-radius: 12px; padding: .5rem .8rem; font-weight: 700; color: var(--ink-2); transition: border-color .15s, transform .12s; }
.variant:hover:not(:disabled) { border-color: var(--brand); transform: translateY(-1px); color: var(--brand); }
.variant .format-shape { margin: 0; border-width: 2px; }
.variant .f-169 { width: 28px; height: 16px; } .variant .f-916 { width: 12px; height: 21px; } .variant .f-11 { width: 18px; height: 18px; }
.side-links { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 1.25rem; }
.link-btn { display: inline-flex; align-items: center; gap: .3rem; border: 0; background: transparent; padding: 0; color: var(--brand); font-weight: 700; text-decoration: none; }
.link-btn .material-symbols-rounded { font-size: 1.15rem; }

.workspace { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.workspace-preview { position: sticky; top: 1rem; }
.workspace-script { padding: 1.5rem; }
@media (max-width: 1100px) { .workspace { grid-template-columns: 1fr; } .workspace-preview { position: static; } }
.material-symbols-rounded.inline { font-size: 1rem; vertical-align: -3px; }
.toggle.small { font-size: .88rem; gap: .45rem; }
.toggle.small .track { width: 36px; height: 22px; }
.toggle.small .track::after { width: 16px; height: 16px; }
.toggle.small input:checked + .track::after { transform: translateX(14px); }

.scene-card { grid-template-columns: 1fr; gap: .6rem; transition: border-color .2s, box-shadow .2s, background .2s; }
.scene-card.active { border-color: var(--brand); box-shadow: var(--ring); background: #fbfaff; }
.scene-meta { flex-direction: row; align-items: center; flex-wrap: wrap; }
button.scene-num { border: 0; position: relative; cursor: pointer; transition: transform .12s; }
button.scene-num:hover { transform: scale(1.08); }
button.scene-num .p { display: none; font-size: 1.2rem; }
button.scene-num:hover .n { display: none; }
button.scene-num:hover .p { display: block; }
.scene-time { font-size: .8rem; font-weight: 600; color: var(--muted); }
.scene-tools { margin-left: auto; display: inline-flex; gap: .1rem; opacity: .35; transition: opacity .15s; }
.scene-card:hover .scene-tools, .scene-card:focus-within .scene-tools { opacity: 1; }
.scene-tools .icon-btn { width: 32px; height: 32px; }
.scene-tools .icon-btn:disabled { opacity: .3; }
.icon-btn.danger:hover { background: #fde9e7; color: var(--danger); }
.save-bar { z-index: 30; box-shadow: 0 18px 40px -12px rgba(10,12,40,.5); animation: pop .18s ease-out; }
.save-bar .grow { margin-right: auto; }
.save-bar > .material-symbols-rounded { color: var(--teal); }
.save-bar span { margin-right: 0; } .save-bar span.grow { margin-right: auto; }
.starter-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .75rem; }
.starter-label { grid-column: 1 / -1; margin-bottom: -.25rem; }
article.video-card { overflow: visible; }
article.video-card:has(.menu) { z-index: 25; transform: none; }
article.video-card .video-thumb { border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; }
article.video-card .video-meta { position: relative; }
.menu { bottom: auto; top: 2.6rem; }
.style-card .style-check { z-index: 2; }
.project-head .back { display: flex; width: fit-content; }
@media (max-width: 700px) {
  .topnav { flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; gap: .1rem; }
  .topnav::-webkit-scrollbar { display: none; }
  .usermenu { flex: none; }
  .library-tools, .search { width: 100%; }
  .toasts { left: 1rem; right: 1rem; max-width: none; }
}
.file-errors { display: flex; gap: .6rem; margin-top: .75rem; padding: .7rem .9rem; border-radius: 12px; background: #fff6e5; color: #8a5a00; border: 1px solid #f3d9a4; font-weight: 600; } .file-errors small { display: block; font-weight: 500; margin-top: .25rem; opacity: .85; }
/* Seis ideas de farma: 3 columnas en escritorio, 2 en tableta, 1 en móvil. */
.starter-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .starter-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .starter-row { grid-template-columns: 1fr; } }
.brand-accent { font-weight: 700; background: linear-gradient(90deg, #7C6CFF, #27D5CE); -webkit-background-clip: text; background-clip: text; color: transparent; } .brand-light .brand-accent { background: linear-gradient(90deg, #b9b0ff, #6ff0ea); -webkit-background-clip: text; background-clip: text; }

/* ---- Estilo «Como tus documentos» */
.doc-style-note { display: flex; align-items: center; gap: .5rem; color: var(--muted, #667); margin: -.25rem 0 1rem; }
.doc-style-card { position: relative; }
.doc-style-tag {
  position: absolute; top: .6rem; left: .6rem; display: inline-flex; align-items: center; gap: .25rem;
  padding: .2rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 700;
  background: linear-gradient(135deg, #7c5cff, #2fb7ff); color: #fff; box-shadow: 0 4px 12px rgba(80, 70, 220, .3);
}
.doc-style-tag .material-symbols-rounded { font-size: 15px; }
.doc-style-meta { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; margin-top: .3rem; }
.doc-style-meta .swatch { width: 16px; height: 16px; }
.doc-style-meta .brand-logo-mini { max-height: 20px; max-width: 70px; }
.doc-style-source { display: block; opacity: .75; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Cambio de contraseña (Administración › Usuarios) */
.pw-row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.pw-row .form-control { flex: 1 1 260px; font-family: ui-monospace, "Cascadia Mono", monospace; }
.table-clean td.text-end .btn + .btn { margin-left: .25rem; }

/* ---- Ojo para mostrar la contraseña (inicio de sesión) */
.pw-field { position: relative; }
.pw-field .form-control { padding-right: 3rem; }
.pw-toggle {
  position: absolute; top: 50%; right: .5rem; transform: translateY(-50%);
  display: grid; place-items: center; width: 2.25rem; height: 2.25rem;
  border: 0; border-radius: 50%; background: transparent; color: #6b7280; cursor: pointer;
}
.pw-toggle:hover { background: rgba(0, 0, 0, .06); color: #111827; }
.pw-toggle:focus-visible { outline: 2px solid #6d5dfc; outline-offset: 2px; }
.pw-toggle .material-symbols-rounded { font-size: 22px; }
