/* Página /emotes — creador de emotes para Kick */
.em-main { max-width: 1180px; margin: 0 auto; padding: 0 20px 80px; }
.em-hero { text-align: center; padding: 56px 0 28px; }
.em-hero h1 { margin: 0 0 14px; font-size: clamp(30px, 5vw, 50px); line-height: 1.1; letter-spacing: -.025em; font-weight: 800; }
.em-hero p { margin: 0 auto; max-width: 620px; color: var(--muted); font-size: 17px; line-height: 1.55; }
.em-back { white-space: nowrap; }

.em-tool { background: linear-gradient(180deg, #151a1c, #101416); border: 1px solid var(--line); border-radius: 22px; padding: 22px; box-shadow: 0 30px 80px -30px rgba(0,0,0,.7), inset 0 1px 0 rgba(255,255,255,.04); }
.em-tabs { display: inline-flex; padding: 4px; gap: 4px; border-radius: 14px; background: #0c1012; border: 1px solid var(--line); margin-bottom: 18px; }
.em-tabs button { border: 0; background: transparent; color: var(--muted); font-weight: 700; font-size: 14px; padding: 9px 16px; border-radius: 10px; transition: background .2s, color .2s; }
.em-tabs button.on { background: var(--green); color: #0b0e0f; }
.em-load { display: flex; gap: 10px; }
.em-load[hidden] { display: none; }
.em-load input { flex: 1; min-width: 0; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: #0c1012; color: var(--text); font-size: 15px; outline: 0; transition: border-color .2s, box-shadow .2s; }
.em-load input:focus { border-color: rgba(83,252,24,.55); box-shadow: 0 0 0 4px rgba(83,252,24,.12); }
.em-drop { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 38px 20px; border: 1.5px dashed #34403f; border-radius: 18px; color: var(--muted); text-align: center; cursor: pointer; transition: border-color .2s, background .2s; }
.em-drop[hidden] { display: none; }
.em-drop strong { color: var(--text); font-size: 16px; }
.em-drop u { color: var(--green); text-decoration: none; font-weight: 700; }
.em-drop:hover, .em-drop.over { border-color: var(--green); background: rgba(83,252,24,.05); }
.em-status { margin: 14px 2px 0; color: var(--muted); font-size: 14px; }
.em-status.err { color: #ff8a8a; }
.em-status[hidden] { display: none; }

.em-stage { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 22px; margin-top: 20px; }
.em-stage[hidden] { display: none; }
.em-view { position: relative; width: 100%; max-width: 560px; aspect-ratio: 1; margin: 0 auto; border-radius: 18px; overflow: hidden;
  background: repeating-conic-gradient(#1a2022 0 25%, #12181a 0 50%) 50% / 24px 24px; border: 1px solid var(--line); cursor: grab; touch-action: none; }
.em-view:active { cursor: grabbing; }
.em-view canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.em-grip { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); padding: 6px 12px; border-radius: 999px; background: rgba(8,10,10,.62); backdrop-filter: blur(8px); color: #cfd8da; font-size: 12px; font-weight: 600; pointer-events: none; transition: opacity .4s; white-space: nowrap; }
.em-view.moved .em-grip { opacity: 0; }
.em-play { position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255,255,255,.18); background: rgba(8,10,10,.6); backdrop-filter: blur(10px); color: #fff; display: grid; place-items: center; padding: 0; }
.em-play svg { width: 18px; height: 18px; }
.em-time { display: flex; justify-content: space-between; max-width: 560px; margin: 12px auto 6px; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.em-range { max-width: 560px; margin: 0 auto; padding: 8px 0; }
.em-track { position: relative; height: 8px; border-radius: 99px; background: #232b2e; }
.em-sel { position: absolute; top: 0; bottom: 0; border-radius: 99px; background: linear-gradient(90deg, rgba(83,252,24,.55), var(--green)); }
.em-head { position: absolute; top: -4px; width: 3px; height: 16px; margin-left: -1.5px; border-radius: 2px; background: #fff; box-shadow: 0 0 8px rgba(255,255,255,.6); }

.em-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.em-group { padding: 14px; border-radius: 16px; background: #0f1416; border: 1px solid var(--line); }
.em-group[hidden] { display: none; }
.em-group h3 { margin: 0 0 10px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.em-row { display: grid; grid-template-columns: 70px 1fr 54px; gap: 10px; align-items: center; font-size: 14px; margin: 6px 0; }
.em-row b { text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; }
.em-group input[type=range] { width: 100%; accent-color: var(--green); }
.em-opts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.em-opts label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); }
.em-opts select { width: 100%; padding: 9px 8px; border-radius: 10px; border: 1px solid var(--line); background: #0c1012; color: var(--text); font-size: 14px; }
.em-chat { background: #0b0e0f; border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 12px; }
.em-chat-row { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.em-chat-row b { color: #7aa2ff; }
.em-chat-row canvas { width: 28px; height: 28px; border-radius: 4px; }
.em-chat-row.big canvas:nth-child(1) { width: 56px; height: 56px; }
.em-chat-row.big canvas:nth-child(2) { width: 112px; height: 112px; }
.em-group small { display: block; margin-top: 8px; color: #6b767a; font-size: 12px; }
.em-actions { display: flex; flex-direction: column; gap: 10px; }
.em-actions .btn { width: 100%; justify-content: center; padding: 13px; }
.em-actions .btn[disabled] { opacity: .6; cursor: progress; }
.em-result { display: grid; grid-template-columns: 76px 1fr; gap: 12px; align-items: center; padding: 12px; border-radius: 16px; border: 1px solid rgba(83,252,24,.35); background: rgba(83,252,24,.06); animation: emIn .35s cubic-bezier(.2,.8,.2,1); }
.em-result[hidden] { display: none; }
.em-result img { width: 76px; height: 76px; border-radius: 10px; background: #0c1012; object-fit: contain; }
.em-res-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.em-res-info b { font-size: 18px; }
.em-res-info span { color: var(--muted); font-size: 13px; }
.em-result .btn { grid-column: 1 / -1; justify-content: center; }
.em-result.warn { border-color: rgba(255,170,60,.45); background: rgba(255,170,60,.07); }
@keyframes emIn { from { opacity: 0; transform: translateY(8px); } }
.em-legal { margin: 18px 2px 0; font-size: 12.5px; color: #6b767a; }

.em-seo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 44px; }
.em-card { padding: 24px; border-radius: 20px; background: #12171a; border: 1px solid var(--line); }
.em-card h2 { margin: 0 0 14px; font-size: 20px; letter-spacing: -.01em; }
.em-faq { grid-column: 1 / -1; }
.em-specs { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.em-specs li { padding: 10px 14px; border-radius: 12px; background: #0c1012; border: 1px solid var(--line); font-weight: 600; }
.em-note { margin: 12px 0 0; color: var(--muted); font-size: 13.5px; }
.em-how { margin: 0; padding-left: 20px; display: grid; gap: 10px; color: #d6dddf; line-height: 1.5; }
.em-faq details { border-top: 1px solid var(--line); padding: 14px 0; }
.em-faq details:first-of-type { border-top: 0; }
.em-faq summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.em-faq summary::after { content: '+'; color: var(--green); font-size: 20px; line-height: 1; transition: transform .2s; }
.em-faq details[open] summary::after { transform: rotate(45deg); }
.em-faq p { margin: 10px 0 0; color: var(--muted); line-height: 1.6; }

@media (max-width: 900px) {
  .em-stage { grid-template-columns: minmax(0, 1fr); }
  .em-seo { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .em-main { padding: 0 14px 60px; }
  .em-tool { padding: 14px; border-radius: 18px; }
  .em-hero { padding: 36px 0 20px; }
  .em-load { flex-direction: column; }
  .em-back { display: none; }
}
.em-time[hidden], .em-range[hidden], .em-play[hidden] { display: none !important; }
.em-grip { max-width: calc(100% - 24px); overflow: hidden; text-overflow: ellipsis; }

/* v2 — editor: modo GIF/Imagen, línea de tiempo con extremos arrastrables */
.em-mode { display: inline-flex; padding: 4px; gap: 4px; margin: 0 auto 14px; border-radius: 14px; background: #0c1012; border: 1px solid var(--line); }
.em-left { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.em-mode button { border: 0; background: transparent; color: var(--muted); font-weight: 700; font-size: 13.5px; padding: 8px 14px; border-radius: 10px; transition: background .2s, color .2s; }
.em-mode button.on { background: rgba(83,252,24,.14); color: var(--green); box-shadow: inset 0 0 0 1px rgba(83,252,24,.4); }
.em-mode[hidden] { display: none; }
.em-tl { position: relative; width: 100%; max-width: 560px; height: 52px; margin-top: 14px; border-radius: 12px; overflow: hidden; background: #0c1012; border: 1px solid var(--line); touch-action: none; cursor: pointer; }
.em-tl[hidden] { display: none; }
.em-film { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .75; }
.em-track { position: absolute; inset: 0; }
.em-sel { position: absolute; top: 0; bottom: 0; border-top: 2px solid var(--green); border-bottom: 2px solid var(--green); box-shadow: 0 0 0 100vmax rgba(5,7,8,.62); border-radius: 4px; }
.em-h { position: absolute; top: -2px; bottom: -2px; width: 14px; background: var(--green); cursor: ew-resize; }
.em-h::after { content: ''; position: absolute; top: 50%; left: 50%; width: 2px; height: 16px; margin: -8px 0 0 -1px; border-radius: 2px; background: rgba(0,0,0,.55); }
.em-h.l { left: -2px; border-radius: 8px 0 0 8px; }
.em-h.r { right: -2px; border-radius: 0 8px 8px 0; }
.em-head { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 10px rgba(255,255,255,.7); pointer-events: none; }
.em-head::before { content: ''; position: absolute; top: -1px; left: -4px; width: 10px; height: 8px; background: #fff; border-radius: 0 0 6px 6px; }
.em-tbar { display: flex; align-items: center; gap: 12px; width: 100%; max-width: 560px; margin-top: 10px; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.em-tbar[hidden] { display: none; }
.em-grow { flex: 1; }
.em-step { display: inline-flex; gap: 4px; }
.em-step button { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: #12181a; color: var(--text); transition: border-color .2s, background .2s, transform .15s; padding: 0; }
.em-step button:hover { border-color: rgba(83,252,24,.5); background: rgba(83,252,24,.07); }
.em-step button:active { transform: scale(.94); }
.em-help { width: 100%; max-width: 560px; margin: 12px 0 0; padding: 12px 14px; border-radius: 12px; background: rgba(83,252,24,.06); border: 1px solid rgba(83,252,24,.18); color: #cfe8c8; font-size: 13.5px; line-height: 1.5; }
.em-kb { width: 100%; max-width: 560px; margin: 8px 0 0; color: #5d676b; font-size: 12px; }
.em-stage[data-mode="png"] .gif-only, .em-stage[data-mode="png"] .em-sel { display: none; }
.em-stage[data-mode="png"] .em-opts { grid-template-columns: 1fr; }
.em-stage[data-mode="png"] .em-film { opacity: .95; }
@media (max-width: 900px) { .em-tl, .em-tbar, .em-help, .em-kb { max-width: none; } .em-kb { display: none; } }
.em-track { height: 100%; background: none; border-radius: 0; }
.em-sel { background: none; }
.em-head { height: auto; border-radius: 0; }

/* Vista previa de chat realista y tramo arrastrable */
.em-sel { cursor: grab; }
.em-tl.grabbing, .em-tl.grabbing .em-sel { cursor: grabbing; }
.em-chat-row { flex-wrap: wrap; gap: 6px; line-height: 28px; }
.em-chat-row i { font-style: normal; color: var(--muted); margin-left: -4px; }
.em-chat-row span { color: #e6ebec; }
.em-chat-row b.u1 { color: #7aa2ff; }
.em-chat-row b.u2 { color: #ff7a9c; }
.em-chat-row canvas { vertical-align: middle; }
.em-chat-sep { display: flex; align-items: center; gap: 10px; color: #5d676b; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.em-chat-sep::before, .em-chat-sep::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.em-chat-row.big { align-items: flex-end; }

/* v4 — cabezal elegante + encuadre animado */
.em-head { width: 2px; margin-left: -1px; background: #fff; opacity: 0; transition: opacity .18s; box-shadow: 0 0 0 1px rgba(0,0,0,.35), 0 0 12px rgba(255,255,255,.55); }
.em-head::before { content: ''; position: absolute; top: -3px; left: 50%; width: 9px; height: 9px; margin-left: -4.5px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.35), 0 1px 6px rgba(0,0,0,.5); }
.em-tl.playing .em-head, .em-tl.grabbing .em-head { opacity: 1; }
.em-stage[data-mode="png"] .em-head { opacity: 1; }
.em-prog { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: linear-gradient(90deg, rgba(83,252,24,0), rgba(83,252,24,.34)); pointer-events: none; border-radius: 4px 0 0 4px; }
.em-sel { background: rgba(83,252,24,.07); }

.em-kf-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.em-kf-head h3 { margin: 0 0 4px; }
.em-kf-head p { margin: 0; color: #7f8a8e; font-size: 12.5px; line-height: 1.45; }
.em-switch { position: relative; flex: none; width: 46px; height: 26px; border-radius: 999px; border: 1px solid var(--line); background: #1a2124; padding: 0; transition: background .25s, border-color .25s; }
.em-switch i { position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #8b9599; transition: transform .28s cubic-bezier(.2,.8,.2,1), background .25s; }
.em-switch[aria-checked="true"] { background: rgba(83,252,24,.22); border-color: rgba(83,252,24,.6); }
.em-switch[aria-checked="true"] i { transform: translateX(20px); background: var(--green); }
.em-kf.on { border-color: rgba(83,252,24,.35); }
.em-kf-body { margin-top: 14px; animation: emIn .3s cubic-bezier(.2,.8,.2,1); }
.em-kf-body[hidden] { display: none; }
.em-kf-pair { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.em-kf-arrow { color: #55616a; }
.em-kf-chip { display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 8px; border-radius: 14px; border: 1px solid var(--line); background: #0c1012; color: var(--text); transition: border-color .2s, background .2s, transform .15s; }
.em-kf-chip canvas { width: 100%; aspect-ratio: 1; border-radius: 9px; background: #151b1e; }
.em-kf-chip span { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; justify-content: center; }
.em-kf-chip b { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; background: #232b2e; color: var(--muted); font-size: 12px; }
.em-kf-chip:hover { border-color: #3a4448; }
.em-kf-chip:active { transform: scale(.98); }
.em-kf-chip.on { border-color: var(--green); background: rgba(83,252,24,.07); box-shadow: 0 0 0 3px rgba(83,252,24,.12); }
.em-kf-chip.on b { background: var(--green); color: #0b0e0f; }
.em-kf-now { margin: 12px 0 0; font-size: 13px; font-weight: 700; color: var(--green); min-height: 1.2em; }
.em-kf-how { margin: 6px 0 0; color: #7f8a8e; font-size: 12.5px; line-height: 1.5; }
.em-tl.kf .em-sel::before, .em-tl.kf .em-sel::after { position: absolute; top: 3px; font-size: 10px; font-weight: 800; line-height: 1; padding: 3px 5px; border-radius: 5px; background: rgba(0,0,0,.65); color: #fff; pointer-events: none; z-index: 2; }
.em-tl.kf .em-sel::before { content: 'A'; left: 18px; }
.em-tl.kf .em-sel::after { content: 'B'; right: 18px; }

/* v5 — marcas ◆ (fotogramas clave), zoom de línea de tiempo, BETA */
.em-tl.kf .em-sel::before, .em-tl.kf .em-sel::after { content: none; }
.em-kfl { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.em-kfm { position: absolute; bottom: 6px; width: 16px; height: 16px; margin-left: -8px; padding: 0; border: 0; background: none; pointer-events: auto; cursor: pointer; transform: translateZ(0); }
.em-kfm::before { content: ''; position: absolute; inset: 2px; transform: rotate(45deg); border-radius: 3px; background: #fff; box-shadow: 0 0 0 1.5px rgba(0,0,0,.55), 0 2px 6px rgba(0,0,0,.5); transition: transform .15s, background .15s, box-shadow .15s; }
.em-kfm:hover::before { transform: rotate(45deg) scale(1.15); }
.em-kfm.on::before { background: #ffd23f; box-shadow: 0 0 0 1.5px rgba(0,0,0,.6), 0 0 12px rgba(255,210,63,.75); transform: rotate(45deg) scale(1.2); }
.em-kfm:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; border-radius: 4px; }

.em-ruler { display: flex; justify-content: space-between; width: 100%; max-width: 560px; margin-top: 4px; color: #5d676b; font-size: 11px; font-variant-numeric: tabular-nums; }
.em-ruler[hidden] { display: none; }
.em-tlz { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line); background: #12181a; color: var(--text); font-size: 12.5px; font-weight: 600; white-space: nowrap; transition: border-color .2s, background .2s; }
.em-tlz:hover { border-color: rgba(83,252,24,.5); }
.em-tlz[aria-pressed="true"] { border-color: rgba(83,252,24,.6); background: rgba(83,252,24,.1); color: var(--green); }
.em-tbar { flex-wrap: wrap; }

.em-beta { display: inline-block; margin-left: 6px; padding: 2px 7px; border-radius: 6px; vertical-align: 1px; background: linear-gradient(135deg, #ffd23f, #ffa31a); color: #1a1400; font-size: 10px; font-weight: 900; letter-spacing: .08em; }
.em-kf-how { margin: 0 0 12px; color: #9aa6aa; font-size: 12.5px; line-height: 1.5; }
.em-kf-tools { display: grid; grid-template-columns: 38px 1fr 38px; gap: 8px; }
.em-kbtn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; border-radius: 11px; border: 1px solid var(--line); background: #12181a; color: var(--text); font-weight: 700; font-size: 13.5px; padding: 0; transition: border-color .2s, background .2s, transform .15s; }
.em-kbtn:hover { border-color: rgba(83,252,24,.5); background: rgba(83,252,24,.07); }
.em-kbtn:active { transform: scale(.97); }
.em-kbtn.add svg { color: #ffd23f; }
.em-kf-foot { display: flex; align-items: center; gap: 14px; margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.em-link { background: none; border: 0; padding: 2px 0; color: #9aa6aa; font-size: 12.5px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.em-link:hover { color: var(--text); }
.em-link:disabled { opacity: .35; cursor: default; text-decoration: none; }

/* v6 — efectos y elementos */
.em-fx-head { display: flex; align-items: center; justify-content: space-between; }
.em-fx-head h3 { margin: 0 0 10px; }
.em-fx-head span { color: var(--green); font-size: 12px; font-weight: 700; margin-bottom: 10px; }
.em-fx-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.em-fxt { display: flex; flex-direction: column; gap: 6px; align-items: stretch; padding: 5px; border-radius: 12px; border: 1px solid var(--line); background: #0c1012; color: #aeb8bb; font-size: 10.5px; font-weight: 700; transition: border-color .2s, background .2s, transform .15s, color .2s; }
.em-fxt canvas { width: 100%; aspect-ratio: 1; border-radius: 8px; background: #151b1e; display: block; }
.em-fxt span { text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.em-fxt:hover { border-color: #3a4448; color: var(--text); }
.em-fxt:active { transform: scale(.96); }
.em-fxt.on { border-color: var(--green); background: rgba(83,252,24,.08); color: var(--green); box-shadow: 0 0 0 3px rgba(83,252,24,.12); }
#emFxAmt { margin-top: 12px; }
#emFxAmt.off { opacity: .4; pointer-events: none; }

.em-el-add { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.em-el-add button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; border-radius: 12px; border: 1px solid var(--line); background: #12181a; color: var(--text); font-size: 12.5px; font-weight: 700; transition: border-color .2s, background .2s, transform .15s; }
.em-el-add button svg { color: var(--green); }
.em-el-add button:hover { border-color: rgba(83,252,24,.5); background: rgba(83,252,24,.06); }
.em-el-add button:active { transform: scale(.97); }
.em-emoji { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-top: 10px; padding: 8px; border-radius: 12px; background: #0c1012; border: 1px solid var(--line); animation: emIn .25s cubic-bezier(.2,.8,.2,1); }
.em-emoji[hidden] { display: none; }
.em-emoji button { aspect-ratio: 1; border: 0; border-radius: 8px; background: transparent; font-size: 20px; line-height: 1; padding: 0; transition: background .15s, transform .15s; }
.em-emoji button:hover { background: rgba(255,255,255,.08); transform: scale(1.15); }
.em-el-edit { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); animation: emIn .25s cubic-bezier(.2,.8,.2,1); }
.em-el-edit[hidden] { display: none; }
.em-el-edit > input[type=text] { width: 100%; padding: 11px 12px; margin-bottom: 8px; border-radius: 10px; border: 1px solid var(--line); background: #0c1012; color: var(--text); font-size: 14px; outline: 0; }
.em-el-edit > input[type=text]:focus { border-color: rgba(83,252,24,.55); box-shadow: 0 0 0 4px rgba(83,252,24,.12); }
.em-el-edit > input[hidden] { display: none; }
.em-el-foot { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.em-color { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.em-color[hidden] { display: none; }
.em-color input { width: 32px; height: 26px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: none; cursor: pointer; }
.em-el-help { margin: 12px 0 0; color: #6b767a; font-size: 12.5px; line-height: 1.5; }

/* La acción principal queda siempre a mano */
.em-actions { position: sticky; bottom: 12px; z-index: 5; padding: 10px; border-radius: 16px; background: rgba(14,18,20,.86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--line); box-shadow: 0 -10px 30px -12px rgba(0,0,0,.6); }
@media (max-width: 560px) { .em-fx-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; } .em-fxt span { font-size: 9.5px; } }

/* =====================================================================
   v7 — panel con pestañas, capas con tiempo, efectos de movimiento y ambiente
   ===================================================================== */
.em-stage { grid-template-columns: minmax(0, 1fr) 400px; align-items: stretch; }
.em-panel { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-radius: 20px; background: linear-gradient(180deg, #131819, #0e1213); border: 1px solid var(--line); box-shadow: inset 0 1px 0 rgba(255,255,255,.04); overflow: hidden; }
.em-ptabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 8px; border-bottom: 1px solid var(--line); background: #0b0f10; }
.em-ptabs button { position: relative; padding: 10px 6px; border: 0; border-radius: 11px; background: transparent; color: var(--muted); font-weight: 700; font-size: 13px; transition: background .2s, color .2s; white-space: nowrap; }
.em-ptabs button:hover { color: var(--text); }
.em-ptabs button.on { background: rgba(83,252,24,.12); color: var(--green); box-shadow: inset 0 0 0 1px rgba(83,252,24,.35); }
.em-ptabs i { display: inline-grid; place-items: center; min-width: 17px; height: 17px; margin-left: 6px; padding: 0 5px; border-radius: 9px; background: var(--green); color: #0b0e0f; font-style: normal; font-size: 11px; font-weight: 800; }
.em-ptabs i[hidden] { display: none; }
.em-pbody { flex: 1; min-height: 0; overflow-y: auto; padding: 14px; scrollbar-width: thin; scrollbar-color: #2a3235 transparent; }
.em-psec[hidden] { display: none; }
.em-psec > * + * { margin-top: 14px; }
.em-pfoot { padding: 12px 14px 14px; border-top: 1px solid var(--line); background: #0b0f10; display: flex; flex-direction: column; gap: 10px; }
/* anula el viejo botón flotante */
.em-actions { position: static; padding: 0; border: 0; background: none; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; display: grid; gap: 8px; }
.em-result { margin: 0; }
.em-note2 { margin: 0; color: #6f7a7e; font-size: 12.5px; line-height: 1.5; }
.em-empty { margin: 0; padding: 12px; border-radius: 12px; border: 1px dashed var(--line); color: #6f7a7e; font-size: 13px; text-align: center; }
.em-lhead h3 { margin: 4px 0 0; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }

/* Efectos */
.em-cats { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: #0b0f10; border: 1px solid var(--line); }
.em-cats button { flex: 1; padding: 8px 6px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 700; font-size: 13px; transition: background .2s, color .2s; }
.em-cats button.on { background: rgba(255,255,255,.08); color: var(--text); }
.em-fx-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.em-fxt { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 6px; border-radius: 13px; border: 1px solid var(--line); background: #0c1012; color: #c3ccce; font-size: 12px; font-weight: 700; transition: border-color .2s, background .2s, transform .15s; }
.em-fxt canvas { width: 100%; aspect-ratio: 1; border-radius: 9px; background: #151b1e; display: block; }
.em-fxt span { text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-bottom: 2px; }
.em-fxt b { position: absolute; top: 10px; right: 10px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: rgba(8,10,10,.7); color: #fff; font-size: 15px; line-height: 1; opacity: 0; transform: scale(.8); transition: opacity .2s, transform .2s, background .2s; }
.em-fxt:hover { border-color: rgba(83,252,24,.5); background: rgba(83,252,24,.05); }
.em-fxt:hover b { opacity: 1; transform: none; background: var(--green); color: #0b0e0f; }
.em-fxt:active { transform: scale(.97); }

/* Lista de capas */
.em-llist { display: flex; flex-direction: column; gap: 6px; }
.em-li { display: grid; grid-template-columns: 10px 1fr auto auto; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 12px; border: 1px solid var(--line); background: #0c1012; cursor: pointer; transition: border-color .2s, background .2s; }
.em-li > i { width: 10px; height: 10px; border-radius: 3px; background: #55616a; }
.em-li.color > i { background: var(--green); } .em-li.motion > i { background: #4ea8ff; } .em-li.fun > i { background: #ff6fb1; } .em-li.el > i { background: #ffd23f; }
.em-li .n { font-weight: 700; font-size: 13.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.em-li .t { color: #6f7a7e; font-size: 12px; font-variant-numeric: tabular-nums; }
.em-li .x { width: 24px; height: 24px; border: 0; border-radius: 7px; background: transparent; color: #8b9599; font-size: 18px; line-height: 1; padding: 0; }
.em-li .x:hover { background: rgba(255,90,90,.15); color: #ff8a8a; }
.em-li:hover { border-color: #3a4448; }
.em-li.on { border-color: rgba(83,252,24,.55); background: rgba(83,252,24,.06); }

/* Inspector */
.em-insp { padding: 12px; border-radius: 14px; background: #0c1012; border: 1px solid rgba(83,252,24,.28); animation: emIn .25s cubic-bezier(.2,.8,.2,1); }
.em-insp[hidden] { display: none; }
.em-insp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.em-insp-head b { font-size: 14px; }
.em-ins-txt { width: 100%; padding: 11px 12px; margin-bottom: 4px; border-radius: 10px; border: 1px solid var(--line); background: #0f1416; color: var(--text); font-size: 14px; outline: 0; transition: border-color .2s, box-shadow .2s; }
.em-ins-txt:focus { border-color: rgba(83,252,24,.55); box-shadow: 0 0 0 4px rgba(83,252,24,.12); }
.em-sub { margin: 10px 0 6px; color: var(--muted); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.em-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.em-chip { padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line); background: #12181a; color: #c3ccce; font-size: 12.5px; font-weight: 700; transition: border-color .2s, background .2s, color .2s; }
.em-chip:hover { border-color: #3a4448; }
.em-chip.on { border-color: var(--green); background: rgba(83,252,24,.12); color: var(--green); }
.em-chip.st-meme { font-family: Impact, "Arial Black", sans-serif; letter-spacing: .02em; }
.em-chip.st-neon { text-shadow: 0 0 8px currentColor; }
.em-chip.st-comic { font-family: "Comic Sans MS", "Chalkboard SE", sans-serif; }
.em-insp .em-row { grid-template-columns: 86px 1fr 52px; }

/* Elementos */
.em-el-add { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.em-el-add button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; border-radius: 12px; border: 1px solid var(--line); background: #12181a; color: var(--text); font-size: 12.5px; font-weight: 700; transition: border-color .2s, background .2s, transform .15s; }
.em-el-add button svg { color: var(--green); }
.em-el-add button:hover { border-color: rgba(83,252,24,.5); background: rgba(83,252,24,.06); }
.em-el-add button:active { transform: scale(.97); }

/* Barras de capas bajo la línea de tiempo */
.em-layers { width: 100%; max-width: 560px; margin-top: 8px; padding: 6px; border-radius: 12px; background: #0c1012; border: 1px solid var(--line); max-height: 132px; overflow-y: auto; scrollbar-width: thin; }
.em-layers[hidden] { display: none; }
.em-lrow { position: relative; height: 26px; margin: 2px 0; }
.em-lbar { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; min-width: 14px; border-radius: 7px; cursor: grab; color: #0b0e0f; font-size: 11.5px; font-weight: 800; overflow: hidden; white-space: nowrap; touch-action: none; transition: box-shadow .15s, filter .15s; }
.em-lbar span { flex: 1; padding: 0 12px; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.em-lbar i { position: absolute; top: 0; bottom: 0; width: 10px; cursor: ew-resize; background: rgba(0,0,0,.22); }
.em-lbar i.l { left: 0; border-radius: 7px 0 0 7px; } .em-lbar i.r { right: 0; border-radius: 0 7px 7px 0; }
.em-lbar.color { background: var(--green); } .em-lbar.motion { background: #4ea8ff; } .em-lbar.fun { background: #ff6fb1; } .em-lbar.el { background: #ffd23f; }
.em-lbar:hover { filter: brightness(1.08); }
.em-lbar.on { box-shadow: 0 0 0 2px #fff, 0 0 14px rgba(255,255,255,.35); }
.em-lbar:active { cursor: grabbing; }

@media (max-width: 1100px) { .em-stage { grid-template-columns: minmax(0, 1fr) 360px; } }
@media (max-width: 900px) {
  .em-stage { grid-template-columns: minmax(0, 1fr); }
  .em-pbody { overflow: visible; }
}

/* v8 — panel pegajoso sin huecos, quitar efectos con claridad, capas con escala propia */
.em-stage { align-items: start; }
.em-panel { position: sticky; top: 76px; align-self: start; max-height: calc(100vh - 96px); }
@media (max-width: 900px) { .em-panel { position: static; max-height: none; } }

.em-fxt.used { border-color: var(--green); background: rgba(83,252,24,.08); box-shadow: 0 0 0 3px rgba(83,252,24,.12); }
.em-fxt.used b { opacity: 1; transform: none; background: var(--green); color: #0b0e0f; font-size: 0; }
.em-fxt.used b::before { content: ''; width: 9px; height: 5px; border: 2px solid #0b0e0f; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.em-fxt.used:hover b { background: #ff5c5c; }
.em-fxt.used:hover b::before { content: '×'; width: auto; height: auto; border: 0; transform: none; font-size: 16px; color: #fff; }

.em-del { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 9px; border: 1px solid rgba(255,90,90,.35); background: rgba(255,90,90,.08); color: #ff8a8a; font-size: 12.5px; font-weight: 700; transition: background .2s, color .2s, border-color .2s; }
.em-del:hover { background: rgba(255,90,90,.2); color: #fff; border-color: rgba(255,90,90,.7); }
.em-li .x { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; }

.em-layers { padding: 8px 10px 10px; }
.em-lhdr { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; color: #5d676b; font-size: 11px; font-variant-numeric: tabular-nums; }
.em-lhdr b { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.em-lbody { position: relative; }
.em-lph { position: absolute; top: -2px; bottom: -2px; width: 2px; margin-left: -1px; background: rgba(255,255,255,.85); box-shadow: 0 0 8px rgba(255,255,255,.5); pointer-events: none; z-index: 3; }
.em-lx { position: absolute; right: 12px; top: 3px; width: 20px; height: 20px; display: grid; place-items: center; border: 0; border-radius: 6px; background: rgba(0,0,0,.28); color: #0b0e0f; font-size: 15px; font-weight: 800; line-height: 1; padding: 0; z-index: 2; }
.em-lx:hover { background: rgba(0,0,0,.6); color: #fff; }
.em-lbar.on span { padding-right: 36px; }

/* v9 — modo Simple (como antes) y Avanzado (efectos, elementos, capas) */
.em-adv { padding: 10px 10px 0; background: #0b0f10; }
.em-adv-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 13px; background: #12181a; border: 1px solid var(--line); }
.em-adv-seg button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 8px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 700; font-size: 13.5px; transition: background .2s, color .2s; }
.em-adv-seg button svg { color: #ffd23f; }
.em-adv-seg button.on { background: rgba(83,252,24,.14); color: var(--green); box-shadow: inset 0 0 0 1px rgba(83,252,24,.4); }
.em-adv-note { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 8px 0 0; padding: 8px 10px; border-radius: 10px; background: rgba(255,210,63,.08); border: 1px solid rgba(255,210,63,.28); color: #ffe08a; font-size: 12.5px; }
.em-adv-note[hidden] { display: none; }
.em-adv-note .em-link { color: #ffe08a; }
.em-stage[data-adv="0"] .em-ptabs { display: none; }
.em-stage[data-adv="0"] .em-layers { display: none; }
.em-adv + .em-ptabs { border-top: 0; }

/* =====================================================================
   v10 — pulido visual premium
   ===================================================================== */
.em-tool { background:
    radial-gradient(900px 260px at 12% -10%, rgba(83,252,24,.07), transparent 60%),
    linear-gradient(180deg, #151a1c, #0f1315);
  border-color: #242c2f; box-shadow: 0 40px 90px -40px rgba(0,0,0,.85), inset 0 1px 0 rgba(255,255,255,.05); }

/* Visor */
.em-view { border-color: #2a3336; box-shadow: 0 24px 60px -28px rgba(0,0,0,.9), 0 0 0 1px rgba(255,255,255,.02); }
.em-view::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; box-shadow: inset 0 0 0 1px rgba(255,255,255,.05), inset 0 -60px 80px -60px rgba(0,0,0,.45); }
.em-play { transition: transform .2s, background .2s; }
.em-play:hover { transform: scale(1.08); background: rgba(8,10,10,.8); }

/* Línea de tiempo */
.em-tl { border-color: #2a3336; border-radius: 14px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.02); }
.em-sel { box-shadow: 0 0 0 100vmax rgba(5,7,8,.66); border-radius: 6px; }
.em-h { width: 12px; }
.em-ruler { padding: 0 2px; }
.em-tbar { margin-top: 12px; }
.em-step button { background: #12181a; border-color: #2a3336; }
.em-tlz { border-color: #2a3336; }

/* Modos y selector Simple / Avanzado con indicador deslizante */
.em-mode { padding: 4px; border-color: #2a3336; background: #0b0f10; box-shadow: inset 0 1px 3px rgba(0,0,0,.4); }
.em-mode button { padding: 9px 16px; border-radius: 11px; }
.em-adv { padding: 12px 12px 4px; background: linear-gradient(180deg, #0c1112, #0b0f10); }
.em-adv-seg { position: relative; border-color: #2a3336; background: #0f1416; box-shadow: inset 0 1px 3px rgba(0,0,0,.45); }
.em-adv-seg::before { content: ''; position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 6px); border-radius: 10px;
  background: linear-gradient(180deg, rgba(83,252,24,.22), rgba(83,252,24,.12)); box-shadow: inset 0 0 0 1px rgba(83,252,24,.45), 0 4px 14px -6px rgba(83,252,24,.5);
  transition: transform .35s cubic-bezier(.2,.8,.2,1); }
.em-stage[data-adv="1"] .em-adv-seg::before { transform: translateX(calc(100% + 4px)); }
.em-adv-seg button { position: relative; z-index: 1; letter-spacing: .01em; }
.em-adv-seg button.on { background: none; box-shadow: none; }

/* Panel */
.em-panel { border-color: #2a3336; background: linear-gradient(180deg, #141a1c, #0e1214); box-shadow: 0 30px 70px -40px rgba(0,0,0,.9), inset 0 1px 0 rgba(255,255,255,.05); }
.em-ptabs { background: #0b0f10; padding: 6px 10px 10px; gap: 2px; border-bottom: 1px solid #222a2d; }
.em-ptabs button { border-radius: 10px; padding: 10px 4px; }
.em-ptabs button.on { background: rgba(83,252,24,.1); box-shadow: inset 0 0 0 1px rgba(83,252,24,.32); }
.em-pbody { padding: 16px; }
.em-psec:not([hidden]) { animation: emSec .32s cubic-bezier(.2,.8,.2,1); }
@keyframes emSec { from { opacity: 0; transform: translateY(6px); } }
.em-group { background: linear-gradient(180deg, #111719, #0e1315); border-color: #232b2e; border-radius: 16px; padding: 16px; }
.em-group h3 { display: flex; align-items: center; gap: 8px; letter-spacing: .1em; font-size: 11.5px; }
.em-group h3::before { content: ''; width: 3px; height: 12px; border-radius: 3px; background: var(--green); opacity: .85; }
.em-kf-head h3 { margin-bottom: 6px; }
.em-row { margin: 8px 0; }
.em-group input[type=range], .em-insp input[type=range] { height: 18px; }
.em-opts select { background: #0c1012; border-color: #2a3336; padding: 10px 9px; transition: border-color .2s, box-shadow .2s; }
.em-opts select:hover { border-color: #3a4448; }
.em-opts select:focus { outline: 0; border-color: rgba(83,252,24,.55); box-shadow: 0 0 0 4px rgba(83,252,24,.12); }
.em-kf.on { border-color: rgba(83,252,24,.4); box-shadow: 0 0 0 1px rgba(83,252,24,.12), 0 14px 34px -22px rgba(83,252,24,.5); }

/* Pie con acciones */
.em-pfoot { padding: 14px 16px 16px; background: linear-gradient(180deg, #0c1112, #0a0d0e); border-top-color: #222a2d; }
.em-actions .btn { padding: 14px; font-size: 15px; border-radius: 13px; }
.em-actions .btn-primary { background: linear-gradient(180deg, #62ff2e, #3fe00e); box-shadow: 0 10px 26px -10px rgba(83,252,24,.65), inset 0 1px 0 rgba(255,255,255,.4); transition: transform .15s, box-shadow .25s, filter .2s; }
.em-actions .btn-primary:hover { transform: translateY(-1px); box-shadow: 0 14px 30px -10px rgba(83,252,24,.75), inset 0 1px 0 rgba(255,255,255,.4); }
.em-actions .btn-primary:active { transform: translateY(0) scale(.99); }
.em-actions .btn-ghost { border-color: #2a3336; }
.em-result { border-radius: 16px; padding: 12px; background: linear-gradient(180deg, rgba(83,252,24,.09), rgba(83,252,24,.04)); }
.em-result img { border: 1px solid #2a3336; }

/* Efectos y capas */
.em-cats { border-color: #2a3336; background: #0b0f10; }
.em-cats button { position: relative; }
.em-cats button.on { background: rgba(255,255,255,.09); box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.em-fxt { border-color: #232b2e; background: linear-gradient(180deg, #10161a, #0c1012); border-radius: 14px; }
.em-fxt canvas { border-radius: 10px; box-shadow: 0 6px 16px -8px rgba(0,0,0,.7); }
.em-li { border-color: #232b2e; background: linear-gradient(180deg, #10161a, #0c1012); }
.em-insp { background: linear-gradient(180deg, #10161a, #0c1012); border-color: rgba(83,252,24,.3); box-shadow: 0 16px 36px -24px rgba(83,252,24,.4); }
.em-layers { border-color: #2a3336; background: #0b0f10; border-radius: 14px; }
.em-lbar { box-shadow: 0 2px 8px -3px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.25); }

/* Chat y pestañas generales */
.em-chat { background: #0a0d0e; border-color: #232b2e; border-radius: 14px; }
.em-tabs { border-color: #2a3336; background: #0b0f10; }
.em-tabs button.on { box-shadow: 0 6px 18px -8px rgba(83,252,24,.6); }
.em-load input { border-color: #2a3336; background: #0b0f10; }
.em-hero h1 { text-wrap: balance; }

/* Tarjetas de ayuda y SEO */
.em-help { border-radius: 14px; background: linear-gradient(180deg, rgba(83,252,24,.08), rgba(83,252,24,.04)); }
.em-card { background: linear-gradient(180deg, #14191c, #101416); border-color: #232b2e; transition: border-color .25s, transform .25s; }
.em-card:hover { border-color: #33403f; }
.em-specs li { border-color: #232b2e; background: #0b0f10; }
.em-faq details { transition: background .2s; }
.em-faq summary { padding: 2px 0; }

@media (prefers-reduced-motion: reduce) { .em-psec:not([hidden]), .em-adv-seg::before { animation: none; transition: none; } }

/* v11 — selector de clips de la web, miniaturas progresivas, sin cursor de bloqueo al arrastrar */
.em-tl, .em-view, .em-layers, .em-film, .em-view canvas { -webkit-user-select: none; user-select: none; -webkit-user-drag: none; }
.em-tl *, .em-view *, .em-layers * { -webkit-user-drag: none; }
.em-tl.film-loading .em-film { animation: filmPulse 1.2s ease-in-out infinite; }
@keyframes filmPulse { 0%, 100% { opacity: .55; } 50% { opacity: .9; } }

.em-pick { margin-top: 2px; }
.em-pick[hidden] { display: none; }
.em-pick-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.em-pick-ch { display: flex; align-items: center; gap: 8px; flex: 1 1 280px; min-width: 0; padding: 4px 4px 4px 10px; border-radius: 14px; border: 1px solid #2a3336; background: #0b0f10; }
.em-pick-ch img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex: none; border: 1px solid #2a3336; }
.em-pick-ch img[hidden] { display: none; }
.em-pick-ch input { flex: 1; min-width: 0; border: 0; background: none; color: var(--text); font-size: 14.5px; outline: 0; padding: 8px 2px; }
.em-pick-ch .btn { padding: 8px 14px; }
.em-pick-seg { display: inline-flex; padding: 4px; gap: 4px; border-radius: 12px; border: 1px solid #2a3336; background: #0b0f10; }
.em-pick-seg button { border: 0; background: transparent; color: var(--muted); font-weight: 700; font-size: 13px; padding: 8px 12px; border-radius: 9px; transition: background .2s, color .2s; }
.em-pick-seg button.on { background: rgba(83,252,24,.14); color: var(--green); box-shadow: inset 0 0 0 1px rgba(83,252,24,.35); }
.em-pick-q { width: 100%; padding: 12px 14px; margin-bottom: 14px; border-radius: 12px; border: 1px solid #2a3336; background: #0b0f10; color: var(--text); font-size: 14px; outline: 0; transition: border-color .2s, box-shadow .2s; }
.em-pick-q:focus { border-color: rgba(83,252,24,.55); box-shadow: 0 0 0 4px rgba(83,252,24,.12); }
.em-pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; max-height: 520px; overflow-y: auto; padding: 2px 4px 4px 2px; scrollbar-width: thin; scrollbar-color: #2a3235 transparent; }
.em-pick-msg { grid-column: 1 / -1; margin: 18px 0; text-align: center; color: var(--muted); font-size: 14px; }
.em-pick-msg.err { color: #ff8a8a; }
.em-pc { display: flex; flex-direction: column; gap: 6px; padding: 0; text-align: left; border: 0; background: none; color: var(--text); animation: pcIn .35s cubic-bezier(.2,.8,.2,1) both; animation-delay: var(--d, 0ms); }
@keyframes pcIn { from { opacity: 0; transform: translateY(8px); } }
.em-pc .th { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #151b1e; border: 1px solid #232b2e; transition: border-color .2s, transform .25s, box-shadow .25s; }
.em-pc .th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.em-pc .th em { position: absolute; right: 6px; bottom: 6px; padding: 2px 6px; border-radius: 6px; background: rgba(0,0,0,.72); font-style: normal; font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.em-pc b { font-size: 13.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.em-pc small { color: #6f7a7e; font-size: 12px; }
.em-pc:hover .th { border-color: rgba(83,252,24,.55); transform: translateY(-2px); box-shadow: 0 14px 28px -16px rgba(0,0,0,.8); }
.em-pc.busy .th { border-color: var(--green); }
.em-pc.busy .th::after { content: ''; position: absolute; inset: 0; background: rgba(8,10,10,.5); }
.em-pick-more { display: flex; justify-content: center; margin-top: 14px; }
.em-pick-more .btn[hidden] { display: none; }
.em-tabs button { white-space: nowrap; }
@media (max-width: 560px) { .em-tabs { display: flex; width: 100%; overflow-x: auto; } .em-pick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: 440px; } }

/* v12 — biblioteca de clips en ventana, barra de origen plegada */
.em-pick-card { display: flex; align-items: center; gap: 16px; padding: 18px; border-radius: 16px; border: 1px solid #2a3336; background: linear-gradient(180deg, #11171a, #0c1012); }
.em-pick-ic { flex: none; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 14px; background: rgba(83,252,24,.1); color: var(--green); border: 1px solid rgba(83,252,24,.28); }
.em-pick-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.em-pick-tx b { font-size: 16px; }
.em-pick-tx span { color: var(--muted); font-size: 13.5px; line-height: 1.45; }
@media (max-width: 640px) { .em-pick-card { flex-direction: column; align-items: stretch; text-align: left; } }

.em-src { display: flex; align-items: center; gap: 14px; padding: 10px; border-radius: 16px; border: 1px solid #2a3336; background: linear-gradient(180deg, #11171a, #0c1012); animation: emIn .3s cubic-bezier(.2,.8,.2,1); }
.em-src[hidden] { display: none; }
.em-src img { width: 84px; height: 47px; border-radius: 9px; object-fit: cover; flex: none; border: 1px solid #2a3336; background: #151b1e; }
.em-src img[hidden] { display: none; }
.em-src-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.em-src-tx b { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.em-src-tx small { color: var(--muted); font-size: 12.5px; }
.em-tabs[hidden] { display: none; }

html.em-lock, html.em-lock body { overflow: hidden; }
.em-lib { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 24px; }
.em-lib[hidden] { display: none; }
.em-lib-back { position: absolute; inset: 0; background: rgba(4,6,7,.74); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); animation: libFade .25s ease-out; }
.em-lib-panel { position: relative; width: min(1180px, 100%); height: min(780px, 100%); display: flex; flex-direction: column; border-radius: 22px; background: linear-gradient(180deg, #151b1d, #0e1214); border: 1px solid #2a3336; box-shadow: 0 40px 100px -30px rgba(0,0,0,.9), inset 0 1px 0 rgba(255,255,255,.05); animation: libIn .35s cubic-bezier(.2,.8,.2,1); overflow: hidden; }
@keyframes libFade { from { opacity: 0; } }
@keyframes libIn { from { opacity: 0; transform: translateY(14px) scale(.985); } }
.em-lib-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 22px 14px; }
.em-lib-head h2 { margin: 0 0 12px; font-size: 20px; letter-spacing: -.01em; }
.em-lib-ch { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.em-lib-ch img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; border: 1px solid #2a3336; }
.em-lib-ch img[hidden] { display: none; }
.em-lib-ch form { display: flex; align-items: center; gap: 6px; padding: 4px 4px 4px 12px; border-radius: 12px; border: 1px solid #2a3336; background: #0b0f10; }
.em-lib-ch input { width: 190px; border: 0; background: none; color: var(--text); font-size: 14px; outline: 0; padding: 6px 0; }
.em-lib-ch .btn { padding: 7px 12px; }
.em-lib-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.em-lib-chips button { padding: 6px 11px; border-radius: 999px; border: 1px solid #2a3336; background: #12181a; color: #c3ccce; font-size: 12.5px; font-weight: 700; transition: border-color .2s, background .2s, color .2s; }
.em-lib-chips button:hover { border-color: #3a4448; }
.em-lib-chips button.on { border-color: var(--green); background: rgba(83,252,24,.12); color: var(--green); }
.em-lib-x { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; border: 1px solid #2a3336; background: #12181a; color: var(--text); transition: background .2s, border-color .2s; }
.em-lib-x:hover { background: rgba(255,255,255,.08); border-color: #3a4448; }

.em-lib-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 0 22px 14px; border-bottom: 1px solid #222a2d; }
.em-lib-q { flex: 1 1 240px; min-width: 0; padding: 11px 14px; border-radius: 12px; border: 1px solid #2a3336; background: #0b0f10; color: var(--text); font-size: 14px; outline: 0; transition: border-color .2s, box-shadow .2s; }
.em-lib-q:focus { border-color: rgba(83,252,24,.55); box-shadow: 0 0 0 4px rgba(83,252,24,.12); }
.em-lib-seg { display: inline-flex; padding: 4px; gap: 3px; border-radius: 12px; border: 1px solid #2a3336; background: #0b0f10; }
.em-lib-seg button { border: 0; background: transparent; color: var(--muted); font-weight: 700; font-size: 13px; padding: 7px 11px; border-radius: 9px; transition: background .2s, color .2s; }
.em-lib-seg button.on { background: rgba(83,252,24,.14); color: var(--green); box-shadow: inset 0 0 0 1px rgba(83,252,24,.35); }
.em-lib-filters select { padding: 10px 28px 10px 12px; border-radius: 12px; border: 1px solid #2a3336; background: #0b0f10; color: var(--text); font-size: 13.5px; font-weight: 600; max-width: 190px; transition: border-color .2s; }
.em-lib-filters select:hover { border-color: #3a4448; }
.em-lib-filters select:focus { outline: 0; border-color: rgba(83,252,24,.55); box-shadow: 0 0 0 4px rgba(83,252,24,.12); }
.em-lib-filters [hidden] { display: none; }
.em-lib-meta { padding: 10px 22px 0; color: #6f7a7e; font-size: 12.5px; min-height: 26px; font-variant-numeric: tabular-nums; }
.em-lib-grid { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px 14px; align-content: start; padding: 10px 22px 14px; scrollbar-width: thin; scrollbar-color: #2a3235 transparent; transition: opacity .2s; }
.em-lib-grid.is-loading { opacity: .55; pointer-events: none; }
.em-lib-msg { grid-column: 1 / -1; margin: 40px 0; text-align: center; color: var(--muted); }
.em-lib-msg.err { color: #ff8a8a; }
.em-lib-pager { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 12px 16px 16px; border-top: 1px solid #222a2d; background: #0b0f10; min-height: 62px; }
.em-lib-pager .pg { min-width: 38px; height: 38px; padding: 0 10px; display: inline-grid; place-items: center; border-radius: 11px; border: 1px solid #2a3336; background: #12181a; color: var(--text); font-weight: 700; font-size: 13.5px; font-variant-numeric: tabular-nums; transition: border-color .2s, background .2s, transform .15s; }
.em-lib-pager .pg:hover:not(:disabled) { border-color: rgba(83,252,24,.5); }
.em-lib-pager .pg:active:not(:disabled) { transform: scale(.95); }
.em-lib-pager .pg.on { background: rgba(83,252,24,.16); border-color: var(--green); color: var(--green); }
.em-lib-pager .pg:disabled { opacity: .35; cursor: default; }
.em-lib-pager .gap { color: #55616a; padding: 0 4px; }
.em-lib-pager .cur { font-weight: 800; padding: 0 10px; }
@media (max-width: 720px) {
  .em-lib { padding: 0; }
  .em-lib-panel { width: 100%; height: 100%; border-radius: 0; }
  .em-lib-head, .em-lib-filters, .em-lib-meta, .em-lib-grid { padding-left: 14px; padding-right: 14px; }
  .em-lib-ch input { width: 130px; }
  .em-lib-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 10px; }
  .em-lib-filters select { flex: 1 1 140px; max-width: none; }
}
@media (prefers-reduced-motion: reduce) { .em-lib-panel, .em-lib-back { animation: none; } }

.em-kf-head p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Encuadre animado compacto: título e interruptor en una fila, texto completo debajo (sin cortes) */
.em-kf { padding: 12px 14px; }
.em-kf-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "t s" "p p"; align-items: center; column-gap: 12px; row-gap: 6px; }
.em-kf-head > div { display: contents; }
.em-kf-head h3 { grid-area: t; margin: 0; }
.em-kf-head p { grid-area: p; margin: 0; display: block; -webkit-line-clamp: unset; overflow: visible; font-size: 12.5px; line-height: 1.4; color: #7f8a8e; }
.em-kf-head .em-switch { grid-area: s; }
.em-kf-body { margin-top: 12px; }

/* =====================================================================
   v13 — modo Simple compacto: todo entra sin scroll
   ===================================================================== */
.em-pbody { padding: 12px; }
.em-psec > * + * { margin-top: 10px; }
.em-group { padding: 12px 14px; }
.em-group h3 { margin-bottom: 8px; }
.em-row { margin: 4px 0; }

/* Zoom y encuadre animado forman una sola tarjeta; la descripción solo aparece al activarlo */
.em-psec[data-p="frame"] > .em-group:first-child { border-bottom-left-radius: 0; border-bottom-right-radius: 0; border-bottom-color: transparent; }
.em-psec[data-p="frame"] > .em-kf { margin-top: 0; border-top-left-radius: 0; border-top-right-radius: 0; border-top: 1px dashed #2a3336; padding-top: 10px; padding-bottom: 10px; }
.em-kf-head { grid-template-areas: "t s"; row-gap: 0; }
.em-kf-head p { display: none; }
.em-kf-head h3 { margin: 0; }
.em-kf.on .em-kf-body { margin-top: 10px; }

/* Vista previa de chat más baja */
.em-chat { padding: 10px; gap: 8px; }
.em-chat-row { line-height: 24px; }
.em-chat-row canvas { width: 24px; height: 24px; }
.em-chat-row.big canvas:nth-child(1) { width: 48px; height: 48px; }
.em-chat-row.big canvas:nth-child(2) { width: 96px; height: 96px; }
.em-chat-sep { font-size: 10.5px; }
.em-group small { margin-top: 6px; }
.em-opts { gap: 8px; }
.em-opts select { padding: 8px; }
.em-pfoot { padding: 12px 14px 14px; gap: 8px; }
.em-actions .btn { padding: 12px; }
.em-adv { padding: 10px 10px 2px; }
@media (min-width: 901px) { .em-panel { max-height: calc(100vh - 84px); top: 70px; } }

/* =====================================================================
   v14 — panel fijo en su sitio (no se mueve al hacer scroll) y a la altura del visor
   ===================================================================== */
@media (min-width: 901px) {
  .em-stage { align-items: stretch; }
  .em-panel { position: static; top: auto; max-height: none; align-self: stretch; }
  .em-pbody { display: flex; flex-direction: column; }
  .em-pbody > .em-psec { flex: none; }
  /* La tarjeta de la vista previa del chat absorbe el espacio sobrante y centra su contenido */
  .em-psec[data-p="out"]:not([hidden]) { flex: 1; display: flex; flex-direction: column; min-height: 0; }
  .em-psec[data-p="out"] > .em-group:last-child { flex: 1; display: flex; flex-direction: column; }
  .em-psec[data-p="out"] .em-chat { flex: 1; justify-content: center; gap: clamp(10px, 2.2vh, 22px); }
  .em-psec[data-p="out"] .em-group:last-child small { text-align: center; }
}

/* =====================================================================
   v15 — panel compacto de altura propia: todo y las acciones entran en una sola vista
   ===================================================================== */
.em-pbody > .em-psec + .em-psec { margin-top: 10px; }
.em-opts { grid-template-columns: minmax(0, .8fr) minmax(0, .8fr) minmax(0, 1.5fr); gap: 8px; }
.em-opts select { padding: 8px 22px 8px 9px; font-size: 13.5px; text-overflow: clip; }
@media (min-width: 901px) {
  .em-panel { align-self: start; }
  .em-psec[data-p="out"]:not([hidden]) { flex: none; display: block; }
  .em-psec[data-p="out"] > .em-group:last-child { flex: none; display: block; }
  .em-psec[data-p="out"] .em-chat { flex: none; justify-content: flex-start; gap: 8px; padding: 8px 10px; }
  .em-psec[data-p="out"] .em-group:last-child small { margin-top: 6px; }
}

/* v16 — vista previa del chat con más aire */
@media (min-width: 901px) {
  .em-psec[data-p="out"] .em-chat { padding: 16px 16px 18px; gap: 14px; }
  .em-psec[data-p="out"] .em-chat-row { line-height: 26px; gap: 8px; }
  .em-psec[data-p="out"] .em-chat-sep { margin: 4px 0 2px; }
  .em-psec[data-p="out"] .em-chat-row.big { gap: 12px; padding-top: 4px; }
  .em-psec[data-p="out"] .em-group:last-child small { margin-top: 10px; }
}
@media (min-width: 901px) {
  .em-psec[data-p="out"] .em-chat { padding: 14px 14px 14px; gap: 12px; }
  .em-psec[data-p="out"] .em-chat-sep { margin: 2px 0 0; }
  .em-psec[data-p="out"] .em-group:last-child small { margin-top: 8px; }
}
