/* ==========================================================
   MetaDoc — estilos del procesador de textos.
   Hojas blancas (también en modo oscuro) sobre fondo gris, reglas,
   barra de formato, inspector, navegador y buscar/reemplazar.
   ========================================================== */

/* ---------- Zona de trabajo ---------- */
.doc-ws { position: relative; background: var(--canvas); overscroll-behavior: contain; outline: none; overflow-anchor: none; }
.doc-sizer { position: relative; margin: 0 auto; }
.doc-stage { position: absolute; top: 0; transform-origin: 0 0; }
.doc-pages { position: absolute; inset: 0; }
.doc-page { position: absolute; left: 0; background: #fff; box-shadow: var(--shadow-page); border-radius: 2px; transition: background var(--mid) var(--ease); }
.doc-bounds { position: absolute; display: none; outline: 1px dashed rgba(0, 122, 255, .35); outline-offset: 0; pointer-events: none; }
.doc-stage.bounds .doc-bounds { display: block; }
.doc-vruler { position: absolute; left: -22px; top: 0; bottom: 0; width: 14px; border-radius: 3px; display: none;
  background:
    linear-gradient(to bottom, color-mix(in srgb, var(--ink) 14%, transparent) 0 var(--mt), transparent var(--mt) calc(100% - var(--mb)), color-mix(in srgb, var(--ink) 14%, transparent) calc(100% - var(--mb))),
    repeating-linear-gradient(to bottom, color-mix(in srgb, var(--ink) 30%, transparent) 0 1px, transparent 1px 37.8px),
    var(--surface);
  box-shadow: inset 0 0 0 .5px var(--line); }
.doc-ws:not(.no-rulers) .doc-vruler { display: block; }

/* ---------- Texto del documento (papel blanco siempre) ---------- */
.doc-stage .doc-body { position: absolute; outline: none; color: #1d1d1f; white-space: pre-wrap; overflow-wrap: break-word; display: flow-root; caret-color: #007aff; tab-size: 36pt; -moz-tab-size: 36pt; cursor: text; }
.doc-body ::selection, .doc-hf ::selection { background: rgba(0, 122, 255, .24); }
.doc-body p, .doc-body h1, .doc-body h2, .doc-body h3, .doc-body h4, .doc-body h5, .doc-body h6 { min-height: 1em; }
.doc-body h1, .doc-body h2, .doc-body h3, .doc-body h4, .doc-body h5, .doc-body h6 { break-after: avoid; }
.doc-body ul, .doc-body ol { margin: 0 0 8pt; padding-left: 24pt; }
.doc-body li > ul, .doc-body li > ol { margin: 2pt 0 0; }
.doc-body li { padding-left: 2pt; }
.doc-body ul.tasks { list-style: none; padding-left: 22pt; }
.doc-body ul.tasks > li { position: relative; }
.doc-body ul.tasks > li::before { content: ""; position: absolute; left: -20pt; top: .2em; width: .95em; height: .95em; border-radius: 4px; box-shadow: inset 0 0 0 1.4px #8e8e93; background: #fff no-repeat center / 80%; cursor: pointer; transition: background-color var(--fast) var(--ease); }
.doc-body ul.tasks > li[data-checked="1"]::before { background-color: #007aff; box-shadow: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E"); }
.doc-body ul.tasks > li[data-checked="1"] { color: #8e8e93; text-decoration: line-through; text-decoration-color: rgba(142, 142, 147, .7); }
.doc-body a { color: #0563c1; text-decoration: underline; }
.doc-body hr { border: 0; border-top: 1px solid #c7c7cc; margin: 10pt 0; }
.doc-body img { max-width: 100%; vertical-align: bottom; }
.doc-body img.wl, .doc-body .shape.wl, .doc-body .tbox.wl { float: left; margin: 2pt 12pt 6pt 0; }
.doc-body img.wr, .doc-body .shape.wr, .doc-body .tbox.wr { float: right; margin: 2pt 0 6pt 12pt; }
.doc-body img.wc, .doc-body .shape.wc { display: block; margin: 6pt auto; }
.doc-body .objsel { outline: 2px solid #007aff; outline-offset: 1px; }
.doc-body sup.fn { color: #007aff; cursor: pointer; font-size: .7em; padding: 0 1px; user-select: none; }
.doc-body .field { background: rgba(120, 120, 128, .14); border-radius: 2px; padding: 0 1px; user-select: none; }
.doc-body .math { display: inline-block; cursor: pointer; padding: 0 1px; border-radius: 3px; }
.doc-body .math:hover { background: rgba(0, 122, 255, .08); }
.doc-body .math.block { display: block; text-align: center; margin: 6pt 0; }
.doc-body .math .katex { font-size: 1.1em; }
.doc-body .cmt { background: rgba(255, 204, 0, .32); border-bottom: 2px solid rgba(255, 179, 0, .9); border-radius: 1px; cursor: pointer; }
.doc-body .cmt.on { background: rgba(255, 204, 0, .62); }
.doc-body .cmt-pt { display: inline-block; width: 6px; height: 1em; vertical-align: text-bottom; }
.doc-body ins.tc { color: #b4007a; text-decoration: underline; text-decoration-color: rgba(180, 0, 122, .7); }
.doc-body del.tc { color: #c41e15; text-decoration: line-through; }
body.doc-hide-changes .doc-body del.tc { display: none; }
body.doc-hide-changes .doc-body ins.tc { color: inherit; text-decoration: inherit; }
.doc-body .pagebreak { height: 0; position: relative; user-select: none; }
.doc-body a.bm { display: inline; }
.doc-body .cols { margin: 4pt 0 8pt; column-fill: balance; }
.doc-body .cols > * { break-inside: avoid-column; }
.doc-body .tbox { border: .75pt solid #8e8e93; border-radius: 3px; padding: 6pt 8pt; margin: 4pt 0; background: #fff; box-sizing: border-box; max-width: 100%; }
.doc-body .tbox p:last-child { margin-bottom: 0; }
.doc-body .shape { display: inline-block; vertical-align: middle; line-height: 0; cursor: default; }
.doc-body .shape svg { width: 100%; height: 100%; overflow: visible; }
.doc-body .pg-gap { display: block; width: 100%; user-select: none; pointer-events: none; }
.doc-body .pg-push { margin-top: var(--push) !important; }
.doc-body tr.pg-gaprow > td { border: none !important; padding: 0 !important; background: transparent !important; }

/* Tablas */
.doc-body table.dt { border-collapse: collapse; table-layout: fixed; width: 100%; margin: 4pt 0 10pt; --bc: #9a9aa0; --bw: .75pt; }
.doc-body table.dt td, .doc-body table.dt th { border: var(--bw) solid var(--bc); padding: 4pt 6pt; vertical-align: top; min-width: 14px; overflow-wrap: anywhere; }
.doc-body table.dt td > p:last-child, .doc-body table.dt th > p:last-child { margin-bottom: 0; }
.doc-body table.dt[data-header="1"] > tbody > tr:first-child > td, .doc-body table.dt[data-header="1"] > tbody > tr:first-child > th { font-weight: 600; background-color: #f2f2f7; }
.doc-body table.dt[data-borders="none"] td, .doc-body table.dt[data-borders="none"] th { border: 1px dashed transparent; }
.doc-stage.bounds .doc-body table.dt[data-borders="none"] td, .doc-body.np table.dt[data-borders="none"] td { border-color: rgba(0, 122, 255, .25); }
.doc-body table.dt[data-borders="outer"] { border: var(--bw) solid var(--bc); }
.doc-body table.dt[data-borders="outer"] td, .doc-body table.dt[data-borders="outer"] th { border: none; }
.doc-body table.dt[data-borders="h"] td, .doc-body table.dt[data-borders="h"] th { border-left: none; border-right: none; }
.doc-body td.csel, .doc-body th.csel { background-image: linear-gradient(rgba(0, 122, 255, .18), rgba(0, 122, 255, .18)) !important; }
.doc-body.col-rs, body.doc-colresize, body.doc-colresize * { cursor: col-resize !important; }

/* Índice */
.doc-body .toc { margin: 6pt 0 14pt; cursor: default; }
.doc-body .toc .toc-title { font-size: 1.35em; font-weight: 700; margin: 0 0 8pt; }
.doc-body .toc p { margin: 0 0 3pt; }
.doc-body .toc a { display: flex; align-items: baseline; color: inherit; text-decoration: none; cursor: pointer; }
.doc-body .toc a:hover .t { color: #007aff; }
.doc-body .toc .t { flex: 1; display: flex; align-items: baseline; min-width: 0; }
.doc-body .toc .t::after { content: ""; flex: 1; min-width: 12px; border-bottom: 1.5px dotted #8e8e93; margin: 0 6px; transform: translateY(-.25em); }
.doc-body .toc .pg { font-variant-numeric: tabular-nums; }
.doc-body .toc .toc-l1 { font-weight: 600; }
.doc-body .toc .toc-l2 { padding-left: 14pt; }
.doc-body .toc .toc-l3 { padding-left: 28pt; }
.doc-body .toc .toc-l4, .doc-body .toc .toc-l5, .doc-body .toc .toc-l6 { padding-left: 42pt; font-size: .95em; }

/* Caracteres no imprimibles */
.doc-body.np p::after, .doc-body.np h1::after, .doc-body.np h2::after, .doc-body.np h3::after, .doc-body.np h4::after, .doc-body.np h5::after, .doc-body.np h6::after, .doc-body.np li::after { content: "¶"; color: #8e8e93; font-weight: 400; font-style: normal; margin-left: 2px; font-family: Arial, sans-serif; }
.doc-body.np .toc p::after { content: none; }
.doc-body.np .pagebreak { height: 14px; }
.doc-body.np .pagebreak::before { content: "Salto de página"; position: absolute; left: 0; right: 0; top: 3px; border-top: 1px dashed #007aff; color: #007aff; font: 600 9px/1 var(--font); text-align: center; padding-top: 2px; }
.doc-body.np a.bm::before { content: "⚑"; color: #007aff; font-size: .8em; }
.doc-body.np .cmt-pt { background: #ffcc00; }

/* Encabezados, pies y notas en la hoja */
.doc-hf { position: absolute; color: #1d1d1f; outline: none; white-space: pre-wrap; overflow-wrap: break-word; min-height: 12px; border-radius: 3px; transition: box-shadow var(--fast) var(--ease); }
.doc-hf p { margin: 0; }
.doc-hf:hover { box-shadow: 0 0 0 1px rgba(0, 122, 255, .25); cursor: text; }
.doc-hf.empty:hover::before { content: attr(data-ph); color: #aeaeb2; font: 11px var(--font); }
.doc-hf.editing { box-shadow: 0 0 0 1.5px #007aff, 0 0 0 5px rgba(0, 122, 255, .12); background: #fff; cursor: text; }
.doc-hf .field { background: rgba(120, 120, 128, .14); border-radius: 2px; }
.doc-pages.hf-editing ~ .doc-body { opacity: .55; }
.doc-fns, .doc-measure.doc-fns { position: absolute; font-size: 9pt; line-height: 1.35; color: #1d1d1f; white-space: pre-wrap; }
.doc-fns::before { content: ""; display: block; width: 33%; border-top: .75pt solid #aeaeb2; margin-bottom: 4px; }
.doc-fns .fn-item, .doc-measure .fn-item { margin: 0 0 2px; padding-left: 1.4em; text-indent: -1.4em; cursor: pointer; }
.doc-fns .fn-item sup { color: #007aff; }
.doc-measure { position: absolute; left: -99999px; top: 0; visibility: hidden; pointer-events: none; white-space: pre-wrap; }

/* Tiradores de imagen y objetos */
.doc-overlay { position: absolute; inset: 0; pointer-events: none; }
.doc-handles { position: absolute; pointer-events: none; }
.doc-handles .h { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; background: #fff; border-radius: 50%; box-shadow: 0 0 0 1.5px #007aff, 0 1px 3px rgba(0, 0, 0, .3); pointer-events: auto; touch-action: none; }
.doc-handles .nw { left: 0; top: 0; cursor: nwse-resize; } .doc-handles .n { left: 50%; top: 0; cursor: ns-resize; }
.doc-handles .ne { left: 100%; top: 0; cursor: nesw-resize; } .doc-handles .e { left: 100%; top: 50%; cursor: ew-resize; }
.doc-handles .se { left: 100%; top: 100%; cursor: nwse-resize; } .doc-handles .s { left: 50%; top: 100%; cursor: ns-resize; }
.doc-handles .sw { left: 0; top: 100%; cursor: nesw-resize; } .doc-handles .w { left: 0; top: 50%; cursor: ew-resize; }

/* Comentarios al margen */
.doc-cmts { position: absolute; top: 0; width: 260px; }
.doc-cmt { position: absolute; left: 0; width: 260px; padding: 8px 10px 10px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); border-left: 3px solid #ffcc00; transition: top var(--mid) var(--ease), box-shadow var(--fast) var(--ease), transform var(--mid) var(--spring); }
.doc-cmt.on { box-shadow: var(--shadow-pop); transform: translateX(-6px); }
.doc-cmt .hd { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.doc-cmt .hd b { font-size: 12px; }
.doc-cmt .hd small { color: var(--ink-3); font-size: 11px; flex: 1; }
.doc-cmt textarea { width: 100%; min-height: 34px; resize: none; font-size: 12.5px; }
.doc-cmtpop { width: 260px; display: grid; gap: 6px; }
.doc-cmtpop small { color: var(--ink-3); }

/* Resaltado de búsqueda */
::highlight(mdoc-find) { background-color: rgba(255, 214, 10, .55); color: inherit; }
::highlight(mdoc-find-cur) { background-color: rgba(255, 149, 0, .85); color: #000; }

/* ---------- Regla horizontal ---------- */
.doc-ruler { position: sticky; top: 0; z-index: 15; height: 22px; margin: 0 auto; pointer-events: none; }
.doc-ws.no-rulers .doc-ruler { display: none; }
.doc-ruler .in { position: absolute; top: 3px; height: 17px; border-radius: 4px; background: color-mix(in srgb, var(--surface) 80%, var(--canvas)); box-shadow: var(--shadow-sm); overflow: visible; pointer-events: auto; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.doc-ruler .paper { position: absolute; top: 0; bottom: 0; background: var(--surface); }
.doc-ruler .t { position: absolute; bottom: 0; width: 1px; height: 3px; background: var(--ink-3); }
.doc-ruler .t.h { height: 6px; }
.doc-ruler .t.n { width: 1px; height: 0; background: none; font-size: 9px; color: var(--ink-2); transform: translateX(-50%); top: 3px; bottom: auto; line-height: 1; width: auto; }
.doc-ruler .mk { position: absolute; top: 0; bottom: 0; width: 8px; margin-left: -4px; cursor: ew-resize; }
.doc-ruler .mk:hover { background: var(--accent-soft); }
.doc-ruler .ind { position: absolute; width: 0; height: 0; margin-left: -5px; cursor: ew-resize; border-left: 5px solid transparent; border-right: 5px solid transparent; }
.doc-ruler .ind.fi { top: 0; border-top: 6px solid var(--accent); }
.doc-ruler .ind.li, .doc-ruler .ind.ri { bottom: 0; border-bottom: 6px solid var(--accent); }
.doc-rtip { position: fixed; z-index: 1200; transform: translateX(-50%); padding: 3px 8px; border-radius: 6px; background: #1d1d1f; color: #fff; font-size: 11px; pointer-events: none; }

/* ---------- Barra de formato ---------- */
.doc-toolbar { gap: 4px; }
.doc-stylebtn { min-width: 128px; justify-content: space-between; }
.doc-stylebtn .lbl { max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
.doc-stylebtn .caret { width: 11px; height: 11px; opacity: .55; }
.doc-fontsel { width: 150px; }
.doc-sizewrap { display: inline-flex; align-items: center; }
.doc-sizein { width: 46px; text-align: center; border-radius: var(--r-sm) 0 0 var(--r-sm); }
.doc-sizecaret { min-width: 20px !important; width: 20px; padding: 0 !important; }
.doc-sizecaret svg { width: 12px !important; height: 12px !important; }
.doc-tpick .grid { display: grid; grid-template-columns: repeat(10, 18px); gap: 3px; margin: 8px 0 10px; }
.doc-tpick .grid span { width: 18px; height: 18px; border-radius: 4px; background: var(--surface-3); box-shadow: inset 0 0 0 .5px var(--line); transition: background var(--fast); }
.doc-tpick .grid span.on { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }

/* ---------- Inspector ---------- */
.doc-insp { padding-top: 6px; }
.doc-insp-head { display: flex; align-items: center; gap: 4px; position: sticky; top: -14px; z-index: 2; background: var(--surface-2); margin: 0 -14px; padding: 4px 8px 0 14px; }
.doc-insp-head .mo-tabs { flex: 1; margin-bottom: 0; overflow-x: auto; scrollbar-width: none; }
.doc-insp-close { display: none; }
.doc-insp section { padding: 12px 0; }
.doc-insp .mo-label { display: block; margin-bottom: 8px; }
.doc-insp .mo-row { flex-wrap: nowrap; gap: 6px; }
.doc-insp .mo-row > .mo-field { min-width: 0; margin-bottom: 6px; }
.doc-insp .mo-input[type="number"] { width: 100%; }
.doc-insp .mo-select { width: 100%; }
.doc-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.doc-row2 .mo-select { width: 100%; }
.doc-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.doc-btns .mo-btn { flex: 1 0 auto; }
.doc-sw { display: flex !important; align-items: center; padding: 5px 0 !important; }
.doc-colrow { justify-content: flex-start; gap: 7px; }
.doc-colrow .sw { width: 14px; height: 14px; border-radius: 4px; box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .25); background-image: linear-gradient(135deg, transparent 45%, rgba(255, 59, 48, .7) 45% 55%, transparent 55%); }
.doc-colrow .sw[style*="background: rgb"], .doc-colrow .sw[style*="background: #"] { background-image: none; }
.doc-stylegal { display: grid; gap: 3px; max-height: 236px; overflow-y: auto; margin-bottom: 8px; padding: 2px; }
.doc-stylecard { border: 0; background: #fff; text-align: left; padding: 6px 10px; border-radius: var(--r-sm); font-size: 13px; box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .08); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: box-shadow var(--fast) var(--ease), transform var(--fast) var(--ease); }
.doc-stylecard:hover { box-shadow: inset 0 0 0 1px var(--accent-line); }
.doc-stylecard.on { box-shadow: inset 0 0 0 2px var(--accent); }
.doc-hint { color: var(--ink-3); font-size: 12px; margin: 0; }

/* ---------- Navegador ---------- */
.doc-nav { padding: 8px 6px 20px; flex-basis: 230px; width: 230px; }
.doc-nav.collapsed { margin-left: -230px; }
.doc-nav-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 8px 8px; }
.doc-nav-head b { font-size: 13px; }
.doc-nav-g { margin-bottom: 6px; }
.doc-nav-g summary { display: flex; align-items: center; gap: 7px; padding: 6px 8px; border-radius: var(--r-sm); font-size: 12px; font-weight: 600; color: var(--ink-2); list-style: none; cursor: default; }
.doc-nav-g summary::-webkit-details-marker { display: none; }
.doc-nav-g summary:hover { background: var(--hover); }
.doc-nav-g summary svg { width: 15px; height: 15px; }
.doc-nav-g summary span { flex: 1; }
.doc-nav-g summary small { font-weight: 500; color: var(--ink-3); }
.doc-nav-g .mo-list button { font-size: 12.5px; padding: 5px 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; width: 100%; }
.doc-nav-empty { padding: 3px 12px 6px; font-size: 12px; color: var(--ink-3); }

/* ---------- Buscar y reemplazar ---------- */
.doc-find { position: absolute; top: 30px; right: 18px; z-index: 40; width: 400px; max-width: calc(100% - 24px); padding: 8px; border-radius: var(--r-lg); background: var(--glass-strong); backdrop-filter: saturate(180%) blur(24px); -webkit-backdrop-filter: saturate(180%) blur(24px); box-shadow: var(--shadow-pop); animation: mo-pop var(--mid) var(--spring); }
.doc-find .r1, .doc-find .r2 { display: flex; align-items: center; gap: 4px; }
.doc-find .r1 .ic { display: grid; place-items: center; width: 22px; color: var(--ink-3); }
.doc-find .r1 .ic svg { width: 16px; height: 16px; }
.doc-find .q, .doc-find .rep { flex: 1; min-width: 0; }
.doc-find .q.bad { box-shadow: inset 0 0 0 1px var(--danger), 0 0 0 3px color-mix(in srgb, var(--danger) 15%, transparent); }
.doc-find .cnt { font-size: 11px; color: var(--ink-3); white-space: nowrap; padding: 0 4px; }
.doc-find .r2, .doc-find .r3 { display: none; }
.doc-find .r2 { margin-top: 6px; padding-left: 26px; }
.doc-find .r3 { margin-top: 6px; padding-left: 26px; flex-wrap: wrap; gap: 2px 12px; }
.doc-find .r3 .mo-check { font-size: 12px; padding: 2px 0; }
.doc-find.rep-on .r2, .doc-find.rep-on .r3 { display: flex; }
.doc-find:not(.rep-on) .r3 { display: flex; }

/* ---------- Barra de estado ---------- */
.doc-trackind { color: #b4007a !important; font-weight: 600; }
.doc-zoomlbl { min-width: 46px; font-variant-numeric: tabular-nums; }

/* ---------- Diálogos ---------- */
.doc-special .mo-input { width: 100%; margin-bottom: 10px; }
.doc-spectabs { display: flex; flex-wrap: wrap; margin-bottom: 10px; }
.doc-spectabs button { padding: 4px 9px; }
.doc-specgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 4px; max-height: 260px; overflow-y: auto; padding: 2px; }
.doc-specgrid button { height: 38px; border: 0; border-radius: var(--r-sm); background: var(--surface-3); font-size: 19px; color: var(--ink); transition: transform var(--fast) var(--spring), background var(--fast); }
.doc-specgrid button:hover { background: var(--accent); color: var(--accent-ink); transform: scale(1.12); }
.doc-specinfo { margin-top: 10px; font-size: 12px; color: var(--ink-2); min-height: 18px; }
.doc-emoji { width: 330px; max-width: calc(100vw - 32px); }
.doc-emoji .tabs { display: flex; gap: 2px; overflow-x: auto; padding-bottom: 6px; border-bottom: .5px solid var(--line); scrollbar-width: none; }
.doc-emoji .tabs button { border: 0; background: transparent; font-size: 18px; padding: 4px 6px; border-radius: 8px; }
.doc-emoji .tabs button.on { background: var(--accent-soft); }
.doc-emoji .grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; max-height: 240px; overflow-y: auto; padding-top: 6px; }
.doc-emoji .grid button { border: 0; background: transparent; font-size: 22px; height: 38px; border-radius: 8px; transition: transform var(--fast) var(--spring), background var(--fast); }
.doc-emoji .grid button:hover { background: var(--hover); transform: scale(1.2); }
.doc-mathdlg .ex { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }
.doc-mathdlg textarea { font-family: var(--mono); width: 100%; }
.doc-mathdlg .prev { min-height: 70px; display: grid; place-items: center; border-radius: var(--r); background: #fff; color: #1d1d1f; box-shadow: inset 0 0 0 .5px var(--line); padding: 10px; overflow-x: auto; font-size: 18px; margin-top: 6px; }
.doc-mathdlg .prev.err { color: var(--danger); font-size: 12px; }
.doc-charprev { margin: 8px 0 4px; padding: 14px; border-radius: var(--r); background: #fff; color: #1d1d1f; box-shadow: inset 0 0 0 .5px var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mo-dialog .mo-row > .mo-field { min-width: 90px; }

/* Miniaturas de plantillas */
.doc-tthumb { width: 100%; height: 100%; position: relative; overflow: hidden; background: #fff; }
.doc-tthumb .pg { position: absolute; left: 0; top: 0; width: 794px; height: 1123px; transform: scale(.205); transform-origin: 0 0; pointer-events: none; }
.doc-tthumb .doc-body { position: static; color: #1d1d1f; white-space: normal; }
.doc-tthumb table.dt { width: 100%; }

/* Brocha */
body.doc-brush .doc-body { cursor: copy; }

/* Modo enfoque */
body.doc-focus .mo-titlebar, body.doc-focus .mo-menubar, body.doc-focus .mo-toolbars, body.doc-focus .mo-statusbar { display: none; }
body.doc-focus .mo-shell { grid-template-rows: 0 0 0 1fr 0; }
body.doc-focus .mo-inspector, body.doc-focus .mo-sidebar { display: none; }

/* ---------- Móvil ---------- */
@media (max-width: 760px) {
  .doc-fontsel { width: 118px; }
  .doc-stylebtn { min-width: 104px; }
  .doc-insp { padding-top: 0; }
  .doc-insp-close { display: inline-flex; }
  .doc-insp-head { top: -14px; padding-top: 8px; }
  .doc-insp::before { content: ""; display: block; width: 38px; height: 5px; border-radius: 3px; background: var(--line); margin: 6px auto 2px; }
  .doc-find { left: 8px; right: 8px; width: auto; top: 8px; }
  .doc-cmt { display: none; }
  .doc-nav { width: 82vw; flex-basis: 82vw; }
  .doc-nav.collapsed { margin-left: 0; transform: translateX(-105%); }
  .doc-stage .doc-body { -webkit-user-select: text; }
  .doc-handles .h { width: 16px; height: 16px; margin: -8px 0 0 -8px; }
}
@media print {
  .doc-ws { overflow: visible; }
}
