/* ==========================================================
   MetaSlide — estilos propios (sobre shared/meta.css)
   ========================================================== */
.ms-main { position: relative; }

/* ---------- Barra de herramientas ---------- */
.ms-toolbar .mo-tool.stack { min-width: 52px; }
.ms-toolbar .mo-tool.stack .caret { position: absolute; right: 2px; top: 9px; }
.ms-toolbar .mo-tool.stack { position: relative; }
.ms-font { width: 148px; }
.ms-size { width: 58px !important; }
.mo-group.off { opacity: .45; }
.mo-group.off .mo-tool, .mo-group.off select, .mo-group.off input { pointer-events: none; }

/* ---------- Panel de diapositivas ---------- */
.ms-panel { display: flex; flex-direction: column; flex-basis: 200px; width: 200px; }
.ms-list { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 12px 6px 6px; display: flex; flex-direction: column; gap: 12px; }
.ms-thumb { position: relative; display: flex; gap: 6px; align-items: flex-start; outline: none; user-select: none; -webkit-user-select: none; touch-action: pan-y; }
.ms-thumb .n { flex: 0 0 18px; text-align: right; font-size: 11px; font-weight: 600; color: var(--ink-3); padding-top: 3px; font-variant-numeric: tabular-nums; }
.ms-thumb .pic { position: relative; flex: 1; min-width: 0; aspect-ratio: var(--ms-ar, 16 / 9); border-radius: 6px; overflow: hidden; background: #fff; box-shadow: 0 0 0 .5px rgba(0, 0, 0, .14), 0 1px 3px rgba(0, 0, 0, .08); transition: box-shadow var(--fast) var(--ease), transform var(--mid) var(--spring); }
.ms-thumb .pic canvas { display: block; width: 100%; height: 100%; }
.ms-thumb:hover .pic { box-shadow: 0 0 0 .5px rgba(0, 0, 0, .18), 0 4px 14px -6px rgba(0, 0, 0, .3); }
.ms-thumb.on .pic { box-shadow: 0 0 0 2.5px var(--accent), 0 4px 14px -6px rgba(0, 0, 0, .3); }
.ms-thumb.on .n { color: var(--accent); }
.ms-thumb.sel .pic { box-shadow: 0 0 0 2.5px color-mix(in srgb, var(--accent) 55%, transparent); }
.ms-thumb.hid .pic { opacity: .45; }
.ms-thumb.hid .n { text-decoration: line-through; }
.ms-thumb .badges { position: absolute; right: 4px; bottom: 4px; display: flex; gap: 3px; }
.ms-thumb .badges i { display: grid; place-items: center; width: 17px; height: 17px; border-radius: 5px; background: rgba(28, 28, 30, .66); color: #fff; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.ms-thumb .badges svg { width: 11px; height: 11px; }
.ms-list.dragging .ms-thumb { transition: none; }
.ms-dropmark { height: 3px; margin: -7px 0 -8px 24px; border-radius: 3px; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); flex: 0 0 auto; }
.ms-dropmark.v { width: 3px; height: auto; min-height: 90px; margin: 0 -8px; }
.ms-ghost { position: fixed; left: 0; top: 0; z-index: 2000; padding: 6px 12px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 600; pointer-events: none; box-shadow: var(--shadow-pop); }
.ms-addslide { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 6px 12px 12px; height: 32px; border: 0; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow-sm); font-size: 12.5px; font-weight: 500; color: var(--ink); transition: background var(--fast), transform var(--fast) var(--ease); flex: 0 0 auto; }
.ms-addslide:hover { background: var(--accent-soft); color: var(--accent); }
.ms-addslide:active { transform: scale(.97); }
.ms-addslide svg { width: 15px; height: 15px; }

/* ---------- Centro: lienzo y notas ---------- */
.ms-center { position: relative; flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.ms-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; background: var(--canvas); }
.ms-stage .canvas-container { position: absolute !important; inset: 0; }
body.ms-dropping .ms-stage::after { content: "Suelta aquí para insertar"; position: absolute; inset: 10px; border: 2px dashed var(--accent); border-radius: var(--r-lg); display: grid; place-items: center; font-weight: 600; color: var(--accent); background: var(--accent-soft); pointer-events: none; z-index: 5; }
.ms-notes { position: relative; flex: 0 0 auto; height: 108px; background: var(--surface-2); border-top: .5px solid var(--line); display: flex; }
.ms-notes-grip { position: absolute; left: 0; right: 0; top: -4px; height: 9px; cursor: ns-resize; z-index: 2; }
.ms-notes-grip::after { content: ""; position: absolute; left: 50%; top: 3px; width: 36px; height: 3px; margin-left: -18px; border-radius: 3px; background: var(--line); }
.ms-notes-ta { flex: 1; border: 0; resize: none; background: transparent; padding: 12px 18px; font-size: 13.5px; line-height: 1.5; outline: none; color: var(--ink); }
.ms-notes-ta::placeholder { color: var(--ink-3); }

/* ---------- Clasificador ---------- */
.ms-sorter { position: absolute; inset: 0; z-index: 40; overflow: auto; background: var(--canvas); padding: 0 24px 40px; animation: mo-fade var(--mid) var(--ease); }
.ms-sorter-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 12px; padding: 14px 0; background: color-mix(in srgb, var(--canvas) 86%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.ms-sorter-head b { font-size: 15px; }
.ms-sorter-head span { color: var(--ink-3); font-size: 12px; }
.ms-sorter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 26px 20px; }
.ms-thumb.big { flex-direction: column; gap: 6px; }
.ms-thumb.big .n { position: absolute; left: 8px; top: 8px; z-index: 1; padding: 1px 6px; border-radius: 6px; background: rgba(28, 28, 30, .6); color: #fff; text-align: center; flex: none; }
.ms-thumb.big .pic { width: 100%; flex: none; border-radius: 9px; }
.ms-thumb.big .cap { font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 2px; }
.ms-thumb.big.sel .pic, .ms-thumb.big.on .pic { box-shadow: 0 0 0 3px var(--accent), var(--shadow); }
.ms-thumb.big:hover .pic { transform: translateY(-3px); }

/* ---------- Inspector ---------- */
.ms-insp { padding: 0; display: flex; flex-direction: column; }
.ms-insp-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 6px; padding: 12px 12px 10px; background: var(--surface-2); border-bottom: .5px solid var(--line); }
.ms-tabs { flex: 1; }
.ms-tabs button { padding: 4px 6px; font-size: 12px; }
.ms-insp-close { display: none; }
.ms-insp-body { padding: 0 14px 24px; flex: 1; overflow-y: auto; }
.ms-insp section { padding: 12px 0; }
.ms-insp h3 { margin: 2px 0 10px; font-size: 12px; font-weight: 600; color: var(--ink-2); text-transform: none; letter-spacing: .01em; }
.ms-insp section > * + * { margin-top: 8px; }
.ms-row { display: flex; align-items: center; gap: 8px; min-height: 30px; }
.ms-lbl { flex: 0 0 76px; font-size: 12px; color: var(--ink-2); }
.ms-ctl { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ms-ctl > .mo-select, .ms-ctl > .mo-input:not([type=checkbox]) { flex: 1; min-width: 0; }
.ms-insp .mo-select { width: 100%; }
.ms-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ms-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.ms-grid2 .mo-field { margin-bottom: 8px; }
.ms-numwrap { position: relative; display: flex; align-items: center; min-width: 0; }
.ms-numwrap .ms-num { width: 100%; padding-right: 26px; }
.ms-numwrap .u { position: absolute; right: 8px; font-size: 11px; color: var(--ink-3); pointer-events: none; }
.ms-slider { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.ms-slider input { flex: 1; min-width: 0; height: 20px; }
.ms-slider .v { flex: 0 0 auto; min-width: 42px; text-align: right; font-size: 11.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.ms-color { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 8px 0 4px; border: 0; border-radius: var(--r-sm); background: var(--surface); box-shadow: inset 0 0 0 .5px var(--line), var(--shadow-sm); font-size: 12px; color: var(--ink); }
.ms-color .sw { width: 22px; height: 22px; border-radius: 6px; box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .2); }
.ms-color .tx:empty { display: none; }
.ms-color:hover { background: color-mix(in srgb, var(--surface) 92%, var(--ink)); }
.ms-switch { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12.5px; min-height: 30px; }
.ms-btnrow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ms-btnrow .mo-btn.danger-ghost { color: var(--danger); }
.ms-hint { font-size: 12px; color: var(--ink-3); margin: 6px 0 0; line-height: 1.45; }
.ms-hint.inline { margin: 0; }
.ms-count { min-width: 28px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.ms-wrap { flex-wrap: wrap; }
.ms-insp .mo-seg.full button { padding: 4px 6px; }
.ms-insp .mo-seg button svg { width: 15px; height: 15px; vertical-align: -3px; }
.ms-latex { margin: 0; padding: 8px 10px; border-radius: var(--r-sm); background: var(--surface-3); font: 12px/1.4 var(--mono); white-space: pre-wrap; word-break: break-all; max-height: 90px; overflow: auto; }
.ms-hr { border: 0; border-top: .5px solid var(--line); margin: 10px 0; }
.ms-indent { padding-left: 26px; display: grid; gap: 4px; margin-bottom: 8px; }

/* Diseños */
.ms-layouts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.ms-layout { display: grid; gap: 4px; justify-items: center; padding: 6px; border: 0; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow-sm); color: var(--ink-2); font-size: 11px; transition: transform var(--mid) var(--spring), box-shadow var(--fast); }
.ms-layout svg { width: 100%; height: auto; display: block; color: var(--ink-2); }
.ms-layout:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.ms-layout.on { box-shadow: 0 0 0 2px var(--accent); color: var(--accent); }
.ms-layout.on svg { color: var(--accent); }

/* Temas */
.ms-themeprev { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .16); }
.ms-themeprev b { font-size: 22px; line-height: 1; }
.ms-themeprev i { position: absolute; left: 8px; bottom: 7px; display: flex; gap: 3px; }
.ms-themeprev em { width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(255, 255, 255, .5); }
.ms-themecur { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px; border: 0; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow-sm); text-align: left; transition: box-shadow var(--fast); }
.ms-themecur:hover { box-shadow: var(--shadow); }
.ms-themecur .ms-themeprev { width: 86px; flex: 0 0 86px; }
.ms-themecur b { display: block; font-size: 13px; }
.ms-themecur small { color: var(--accent); font-size: 12px; }
.ms-themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.ms-themeitem { display: grid; gap: 7px; padding: 0; border: 0; background: transparent; font-size: 12.5px; font-weight: 500; color: var(--ink); }
.ms-themeitem .ms-themeprev { box-shadow: var(--shadow); transition: transform var(--mid) var(--spring), box-shadow var(--fast); }
.ms-themeitem .ms-themeprev b { font-size: 30px; }
.ms-themeitem:hover .ms-themeprev { transform: translateY(-3px) scale(1.02); }
.ms-themeitem.on .ms-themeprev { box-shadow: 0 0 0 3px var(--accent), var(--shadow); }

/* Fondo */
.ms-bgbox { display: grid; gap: 8px; }

/* Transiciones */
.ms-trgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.ms-tr { display: grid; gap: 5px; justify-items: center; padding: 8px 4px 6px; border: 0; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow-sm); font-size: 10.5px; color: var(--ink-2); transition: box-shadow var(--fast), transform var(--mid) var(--spring); }
.ms-tr:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.ms-tr.on { box-shadow: 0 0 0 2px var(--accent); color: var(--accent); }
.ms-tr .ic { position: relative; width: 44px; height: 26px; border-radius: 4px; overflow: hidden; background: color-mix(in srgb, var(--ink) 14%, transparent); perspective: 120px; }
.ms-tr .ic i { position: absolute; inset: 0; border-radius: 4px; }
.ms-tr .ic i:first-child { background: color-mix(in srgb, var(--ink) 22%, var(--surface)); }
.ms-tr .ic i:last-child { background: var(--accent); opacity: .85; left: 50%; }
.ms-tr:hover .ic i:last-child { left: 0; }
.ms-tr .ic-none i:last-child { display: none; }
.ms-tr:hover .ic-fade i:last-child, .ms-tr:hover .ic-fadeBlack i:last-child, .ms-tr:hover .ic-dissolve i:last-child { animation: ms-ic-fade 1.1s var(--ease) infinite; }
.ms-tr:hover .ic-push i:last-child, .ms-tr:hover .ic-cover i:last-child { animation: ms-ic-push 1.1s var(--ease) infinite; }
.ms-tr:hover .ic-push i:first-child { animation: ms-ic-pushout 1.1s var(--ease) infinite; }
.ms-tr:hover .ic-uncover i:last-child { animation: ms-ic-pushout 1.1s var(--ease) infinite reverse; }
.ms-tr:hover .ic-wipe i:last-child { animation: ms-ic-wipe 1.1s var(--ease) infinite; }
.ms-tr:hover .ic-zoom i:last-child { animation: ms-ic-zoom 1.1s var(--ease) infinite; }
.ms-tr:hover .ic-flip i:last-child, .ms-tr:hover .ic-cube i:last-child { animation: ms-ic-flip 1.1s var(--ease) infinite; }
.ms-tr:hover .ic-circle i:last-child { animation: ms-ic-circle 1.1s var(--ease) infinite; }
.ms-tr:hover .ic-split i:last-child { animation: ms-ic-split 1.1s var(--ease) infinite; }
@keyframes ms-ic-fade { 0% { opacity: 0; } 60%, 100% { opacity: .85; } }
@keyframes ms-ic-push { 0% { transform: translateX(100%); } 60%, 100% { transform: none; } }
@keyframes ms-ic-pushout { 0% { transform: none; } 60%, 100% { transform: translateX(-100%); } }
@keyframes ms-ic-wipe { 0% { clip-path: inset(0 0 0 100%); } 60%, 100% { clip-path: inset(0); } }
@keyframes ms-ic-zoom { 0% { transform: scale(.2); opacity: 0; } 60%, 100% { transform: none; opacity: .85; } }
@keyframes ms-ic-flip { 0% { transform: rotateY(90deg); } 60%, 100% { transform: none; } }
@keyframes ms-ic-circle { 0% { clip-path: circle(0 at 50% 50%); } 60%, 100% { clip-path: circle(75% at 50% 50%); } }
@keyframes ms-ic-split { 0% { clip-path: inset(0 50%); } 60%, 100% { clip-path: inset(0); } }

/* Animaciones */
.ms-animlist { display: grid; gap: 4px; }
.ms-anim { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: var(--r-sm); background: var(--surface); box-shadow: var(--shadow-sm); cursor: default; transition: background var(--fast), box-shadow var(--fast), opacity var(--fast); }
.ms-anim:hover { background: color-mix(in srgb, var(--surface) 94%, var(--ink)); }
.ms-anim.on { box-shadow: 0 0 0 2px var(--accent); }
.ms-anim.obj:not(.on) { box-shadow: 0 0 0 1px var(--accent-line); }
.ms-anim.drag { opacity: .4; }
.ms-anim.over { box-shadow: 0 -2px 0 0 var(--accent); }
.ms-anim .st { flex: 0 0 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; font-size: 11px; font-weight: 700; background: var(--surface-3); color: var(--ink-2); }
.ms-anim .dot { flex: 0 0 8px; height: 8px; border-radius: 50%; }
.ms-anim .dot.in { background: #34c759; }
.ms-anim .dot.emph { background: #ffcc00; }
.ms-anim .dot.out { background: #ff3b30; }
.ms-anim .tx { flex: 1; min-width: 0; display: grid; }
.ms-anim .tx b { font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-anim .tx small { font-size: 11px; color: var(--ink-3); }
.ms-anim .grip { color: var(--ink-3); cursor: grab; }
.ms-anim .grip svg { width: 15px; height: 15px; }

/* ---------- Editor de tablas sobre el lienzo ---------- */
.ms-tedit { position: absolute; z-index: 20; box-shadow: 0 0 0 2px var(--accent), 0 10px 30px -10px rgba(0, 0, 0, .35); border-radius: 2px; animation: mo-fade var(--fast) var(--ease); }
.ms-tedit table { width: 100%; border-collapse: collapse; table-layout: fixed; line-height: 1.2; }
.ms-tedit td { border-style: solid; outline: none; vertical-align: middle; word-break: break-word; white-space: pre-wrap; cursor: text; }
.ms-tedit td:focus { box-shadow: inset 0 0 0 2px var(--accent); background-image: linear-gradient(rgba(255, 122, 0, .06), rgba(255, 122, 0, .06)); }

/* Selector de tamaño de tabla */
.ms-tpick { width: 214px; }
.ms-tpick .mo-label { margin-bottom: 8px; display: block; text-align: center; }
.ms-tpick-grid { display: grid; grid-template-columns: repeat(8, 22px); gap: 3px; justify-content: center; }
.ms-tpick-grid button { width: 22px; height: 22px; border: 0; border-radius: 4px; background: var(--surface-3); box-shadow: inset 0 0 0 .5px var(--line); padding: 0; transition: background var(--fast); }
.ms-tpick-grid button.on { background: var(--accent); }

/* ---------- Diálogos ---------- */
.ms-datagrid { max-height: 300px; overflow: auto; border-radius: var(--r-sm); box-shadow: inset 0 0 0 .5px var(--line); margin: 6px 0 10px; }
.ms-datagrid table { border-collapse: collapse; width: 100%; }
.ms-datagrid td, .ms-datagrid th { padding: 3px; border-bottom: .5px solid var(--line-2); }
.ms-datagrid .mo-input { width: 100%; min-width: 70px; height: 28px; font-size: 12.5px; }
.ms-datagrid .mo-input.head { font-weight: 600; background: var(--surface-3); }
.ms-th { display: flex; align-items: center; gap: 2px; }
.ms-chartpv { margin-top: 10px; height: 260px; border-radius: var(--r); background: #fff; box-shadow: inset 0 0 0 .5px var(--line); overflow: hidden; }
.ms-formula .mo-textarea { width: 100%; font: 14px/1.45 var(--mono); }
.ms-snips { display: flex; flex-wrap: wrap; gap: 5px; margin: 10px 0; }
.ms-formula-pv { min-height: 110px; display: grid; place-items: center; padding: 14px; border-radius: var(--r); background: #fff; color: #1d1d1f; box-shadow: inset 0 0 0 .5px var(--line); overflow: auto; margin-bottom: 12px; font-size: 26px; }
.ms-formula-pv.err { font-size: 13px; color: var(--danger); }
.ms-crop { position: relative; width: 100%; max-height: 62dvh; margin: 0 auto 12px; user-select: none; touch-action: none; background: repeating-conic-gradient(#e5e5ea 0 25%, #fff 0 50%) 0 0 / 16px 16px; border-radius: 6px; overflow: hidden; }
.ms-crop img { display: block; width: 100%; height: 100%; object-fit: fill; opacity: .45; pointer-events: none; }
.ms-crop-rect { position: absolute; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .35), inset 0 0 0 2px #fff; cursor: move; touch-action: none; background: transparent; outline: 1px dashed rgba(255, 255, 255, .8); outline-offset: -6px; }
.ms-crop-rect i { position: absolute; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1.5px var(--accent), 0 2px 6px rgba(0, 0, 0, .3); }
.ms-crop-rect .k-nw { left: 0; top: 0; cursor: nwse-resize; } .ms-crop-rect .k-n { left: 50%; top: 0; cursor: ns-resize; } .ms-crop-rect .k-ne { left: 100%; top: 0; cursor: nesw-resize; }
.ms-crop-rect .k-e { left: 100%; top: 50%; cursor: ew-resize; } .ms-crop-rect .k-se { left: 100%; top: 100%; cursor: nwse-resize; } .ms-crop-rect .k-s { left: 50%; top: 100%; cursor: ns-resize; }
.ms-crop-rect .k-sw { left: 0; top: 100%; cursor: nesw-resize; } .ms-crop-rect .k-w { left: 0; top: 50%; cursor: ew-resize; }
.ms-exp-extra { margin-top: 14px; padding-top: 12px; border-top: .5px solid var(--line); }
.ms-exp-extra .mo-select { width: 100%; }

/* ---------- Vista previa sobre el lienzo ---------- */
.ms-preview { position: absolute; inset: 0; z-index: 30; overflow: hidden; pointer-events: none; transition: opacity .2s var(--ease); }
.ms-preview.out { opacity: 0; }
.ms-preview-view { position: absolute; left: 0; top: 0; transform-origin: 0 0; perspective: 2200px; }
.ms-preview-view .msp-slide { position: absolute; left: 0; top: 0; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; background: #000; }

/* ---------- Vista del moderador ---------- */
body.ms-presenter { background: #0b0b0c; color: #f5f5f7; }
.ms-pv { position: fixed; inset: 0; display: grid; grid-template-rows: auto 1fr auto; background: #0b0b0c; color: #f5f5f7; font-family: var(--font); }
.ms-pv header { display: flex; align-items: center; gap: 24px; padding: 14px 20px; border-bottom: .5px solid rgba(255, 255, 255, .1); }
.ms-pv header .t { flex: 1; display: grid; }
.ms-pv header .t b { font-size: 15px; }
.ms-pv header .ttl { color: #8e8e93; font-size: 12px; }
.ms-pv .lbl { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: #8e8e93; font-weight: 600; }
.ms-pv .clock b, .ms-pv .timer b { font-size: 28px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.ms-pv .timer { display: flex; align-items: flex-end; gap: 6px; }
.ms-pv .timer .lbl { position: absolute; transform: translateY(-34px); }
.ms-pv .timer, .ms-pv .clock { position: relative; padding-top: 14px; }
.ms-pv .clock .lbl { position: absolute; top: 0; }
.ms-pv .mo-btn.ghost { color: #f5f5f7; }
.ms-pv .mo-btn.ghost:hover { background: rgba(255, 255, 255, .1); }
.ms-pv main { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(260px, 1fr); gap: 20px; padding: 20px; min-height: 0; }
.ms-pv .frame { position: relative; aspect-ratio: var(--ar, 16 / 9); background: #000; border-radius: 10px; overflow: hidden; box-shadow: 0 0 0 .5px rgba(255, 255, 255, .14), 0 20px 50px -20px #000; }
.ms-pv .frame img { width: 100%; height: 100%; object-fit: contain; display: block; }
.ms-pv .frame .cover { position: absolute; inset: 0; display: none; }
.ms-pv .cur { display: flex; flex-direction: column; gap: 10px; min-height: 0; justify-content: center; }
.ms-pv .cur .frame { cursor: pointer; max-height: 100%; }
.ms-pv .meta { display: flex; gap: 14px; color: #aeaeb2; font-size: 13px; }
.ms-pv aside { display: flex; flex-direction: column; gap: 16px; min-height: 0; }
.ms-pv .nextw .frame { margin-top: 6px; }
.ms-pv .endtx { position: absolute; inset: 0; display: none; place-items: center; color: #8e8e93; }
.ms-pv .notesw { flex: 1; min-height: 0; display: flex; flex-direction: column; background: #1c1c1e; border-radius: 12px; padding: 12px 14px; }
.ms-pv .nh { display: flex; align-items: center; gap: 4px; margin-bottom: 8px; }
.ms-pv .notes { flex: 1; overflow: auto; font-size: 20px; line-height: 1.5; white-space: pre-wrap; color: #f5f5f7; }
.ms-pv .notes.empty { color: #636366; font-style: italic; }
.ms-pv footer { display: flex; align-items: center; gap: 8px; padding: 12px 20px; border-top: .5px solid rgba(255, 255, 255, .1); flex-wrap: wrap; }
.ms-pv footer .mo-btn { height: 38px; }
.ms-pv footer svg { width: 16px; height: 16px; }
.ms-pv .waiting { position: absolute; inset: 0; display: grid; place-items: center; background: #0b0b0c; color: #aeaeb2; font-size: 16px; text-align: center; }
.ms-pv .waiting b { color: #fff; font-size: 20px; }

/* ---------- Estado ---------- */
.ms-views { display: flex; gap: 2px; }
.ms-views button.on { color: var(--accent); background: var(--accent-soft); }
.mo-statusbar .mo-zoom button { min-width: 22px; }

/* ---------- Móvil (375 px) ---------- */
@media (max-width: 760px) {
  .ms-main { flex-direction: column; }
  .ms-panel { position: static; order: 0; flex: 0 0 auto; width: auto; height: 82px; flex-direction: row; border-right: 0; border-bottom: .5px solid var(--line); box-shadow: none; margin: 0 !important; opacity: 1 !important; pointer-events: auto !important; }
  .ms-panel.collapsed, body.ms-sorting .ms-panel { display: none; }
  .ms-list { flex-direction: row; overflow-x: auto; overflow-y: hidden; padding: 8px 6px 8px 10px; gap: 8px; scroll-snap-type: x proximity; }
  .ms-thumb { flex: 0 0 auto; width: 104px; scroll-snap-align: start; touch-action: pan-x; }
  .ms-thumb .n { position: absolute; left: 4px; top: 4px; z-index: 1; flex: none; padding: 0 4px; border-radius: 4px; background: rgba(28, 28, 30, .55); color: #fff; font-size: 10px; text-align: center; }
  .ms-thumb.on .n { background: var(--accent); color: #fff; }
  .ms-addslide { margin: 8px 8px 8px 0; width: 44px; height: auto; flex: 0 0 44px; padding: 0; }
  .ms-addslide span { display: none; }
  .ms-dropmark { width: 3px; height: auto; margin: 0 -5px; }
  .ms-center { order: 1; transition: padding-bottom var(--slow) var(--ease); }
  .ms-main.insp-open .ms-center { padding-bottom: 44dvh; }
  .ms-notes { height: 90px; }
  .ms-insp { z-index: 60; height: 44dvh; max-height: 44dvh; }
  .ms-insp-close { display: inline-flex; }
  .ms-insp-head { border-radius: var(--r-xl) var(--r-xl) 0 0; padding-top: 16px; }
  .ms-insp-head::before { content: ""; position: absolute; left: 50%; top: 6px; width: 36px; height: 4px; margin-left: -18px; border-radius: 4px; background: var(--line); }
  .ms-lbl { flex-basis: 70px; }
  .ms-sorter { padding: 0 12px 30px; }
  .ms-sorter-grid { grid-template-columns: repeat(2, 1fr); gap: 16px 10px; }
  .ms-sorter-head span { display: none; }
  .ms-font { width: 120px; }
  .ms-pv main { grid-template-columns: 1fr; overflow: auto; }
  .ms-pv header { flex-wrap: wrap; gap: 12px; }
  .ms-trgrid { grid-template-columns: repeat(4, 1fr); }
  .ms-layouts { grid-template-columns: repeat(4, 1fr); }
  .ms-layout span { display: none; }
}

/* La galería de plantillas común no aplica --ar (Meta.h no admite variables CSS en style): se fija aquí */
body[data-app="slide"] .mo-template .thumb { aspect-ratio: 16 / 9; }
