/* Word-specific styles */
.workspace{background:#e7e6e6}
.page-container{padding:20px 0}
.page{background:#fff;width:21cm;min-height:29.7cm;padding:2.54cm;margin:0 auto;box-shadow:0 4px 16px rgba(0,0,0,.15);transition:width .2s, padding .2s}
.page.landscape{width:29.7cm;min-height:21cm}
.page.letter{width:21.59cm;min-height:27.94cm}
.page.legal{width:21.59cm;min-height:35.56cm}
.page.a3{width:29.7cm;min-height:42cm}
.page.a5{width:14.8cm;min-height:21cm}
.page.narrow{padding:1.27cm}
.page.normal{padding:2.54cm}
.page.wide{padding:5.08cm 2.54cm}

.editor{min-height:25cm;outline:none;font-family:Calibri,'Segoe UI',sans-serif;font-size:11pt;line-height:1.5;color:#000}
.editor h1{font-size:24pt;font-weight:400;color:#475569;margin:.5em 0}
.editor h2{font-size:18pt;font-weight:400;color:#475569;margin:.5em 0}
.editor h3{font-size:14pt;color:#1e293b;margin:.5em 0}
.editor h4{font-size:12pt;color:#1e293b;font-style:italic;margin:.5em 0}
.editor p{margin:0 0 8pt 0}
.editor blockquote{border-left:4px solid #475569;margin:0 0 0 20px;padding:5px 15px;color:#444;font-style:italic}
.editor pre{background:#f5f5f5;padding:10px;border-left:3px solid #ccc;font-family:Consolas,monospace;font-size:10pt;overflow-x:auto}
.editor table{border-collapse:collapse;margin:8px 0;min-width:60%}
.editor table td,.editor table th{border:1px solid #999;padding:6px 10px;min-width:60px}
.editor table th{background:#f2f2f2;font-weight:600}
.editor img{max-width:100%;height:auto}
.editor ul,.editor ol{margin:8px 0;padding-left:36px}
.editor a{color:#0563c1;text-decoration:underline}
.editor hr{border:none;border-top:1px solid #ccc;margin:1em 0}

.page-break{page-break-after:always;border-top:1px dashed #aaa;margin:20px 0;text-align:center;color:#999;font-size:10px}

.dark-mode .workspace{background:#1f1f1f}
.dark-mode .page{background:#2d2d2d;color:#eee}
.dark-mode .editor{color:#eee}

.comment-mark{background:#fff3a0;border-bottom:2px dotted #f9a825;cursor:help}
.tc-insert{color:#0a8043;text-decoration:underline}
.tc-delete{color:#0f766e;text-decoration:line-through}
.equation{font-family:'Cambria Math',serif;background:#f4f8ff;padding:2px 6px;border-radius:3px}
.dropcap{float:left;font-size:48pt;line-height:0.9;padding:4px 8px 0 0;font-weight:bold;color:#334155}
.footnotes-section{border-top:1px solid #999;margin-top:30px;padding-top:10px;font-size:9pt;color:#444}
.img-handles{position:absolute;pointer-events:none}

/* Document structure */
.doc-header,.doc-footer{font-family:Calibri;font-size:10pt;color:#555;background:#fafafa;outline:1px dashed transparent}
.doc-header:hover,.doc-footer:hover{outline-color:#ccc}
.doc-header:focus,.doc-footer:focus{outline-color:#334155;background:#fff}
.toc-block,.lot-block,.lof-block{background:#fff;border:1px dashed #334155;padding:20px;margin-bottom:24px;cursor:default}
.toc-block:hover,.lot-block:hover,.lof-block:hover{border-style:solid}
.tbl-caption,.fig-caption{font-style:italic;color:#444;text-align:center;font-size:10pt;margin:6px 0 12px}
.section-break{page-break-after:always;border-top:2px dashed #334155;margin:20px 0;text-align:center;color:#334155;font-size:10px;padding-top:4px}
.cross-ref{color:#334155;text-decoration:underline;cursor:pointer}
.cross-ref:hover{color:#0f766e}
.bookmark{border-left:2px solid #334155;padding-left:2px;background:#e8f0fe}

/* Sections - true multi-section document */
.page.has-sections{padding:0 !important;background:transparent !important;box-shadow:none !important;width:auto !important;min-height:0 !important}
.editor{min-height:0}
.page.has-sections .editor{display:flex;flex-direction:column;align-items:center;gap:24px;background:transparent}
.doc-section{background:#fff;box-shadow:0 4px 16px rgba(0,0,0,.15);position:relative;padding:2.54cm;width:21cm;min-height:29.7cm;display:flex;flex-direction:column;page-break-after:always}
.doc-section > .sec-header{padding-bottom:8px;border-bottom:1px solid #eee;margin-bottom:16px;font-size:10pt;color:#555;background:#fafafa;outline:1px dashed transparent;min-height:24px}
.doc-section > .sec-header:hover{outline-color:#ccc}
.doc-section > .sec-header:focus{outline-color:#334155;background:#fff}
.doc-section > .sec-footer{padding-top:8px;border-top:1px solid #eee;margin-top:auto;font-size:10pt;color:#555;background:#fafafa;outline:1px dashed transparent;min-height:24px}
.doc-section > .sec-footer:hover{outline-color:#ccc}
.doc-section > .sec-footer:focus{outline-color:#334155;background:#fff}
.doc-section > .sec-badge{position:absolute;top:-10px;right:10px;background:#334155;color:#fff;font-size:10px;padding:3px 10px;border-radius:3px;font-family:'Segoe UI',sans-serif;letter-spacing:.3px;user-select:none}
.section-break-marker{background:linear-gradient(90deg,transparent,#fce5cd,transparent);text-align:center;color:#0f766e;font-size:11px;font-weight:600;padding:6px;margin:8px 0;border-top:1px dashed #0f766e;border-bottom:1px dashed #0f766e;user-select:none;font-family:'Segoe UI',sans-serif}
.page-break{background:linear-gradient(90deg,transparent,#cfe2f3,transparent);text-align:center;color:#334155;font-size:11px;padding:4px;margin:8px 0;border-top:1px dashed #334155;border-bottom:1px dashed #334155;user-select:none}

/* Tab characters */
.tabchar{display:inline-block;vertical-align:middle;min-height:1em}
.tabchar[data-leader="dots"]{background-image:radial-gradient(circle,#666 1px,transparent 1.2px);background-size:5px 100%;background-position:left center;background-repeat:repeat-x}
.tabchar[data-leader="dashes"]{background-image:linear-gradient(90deg,#666 50%,transparent 50%);background-size:7px 1.5px;background-position:left center;background-repeat:repeat-x}
.tabchar[data-leader="line"]{border-bottom:1px solid #666}

/* Ruler */
#docRuler{user-select:none}
#docRuler #rulerScale{height:100%}
#docRuler #rulerMarkers > div:hover{background:rgba(43,87,154,.1)}

/* Mirror margins indicator */
.doc-section.mirror-margins{background:linear-gradient(to right,#fff 0%,#fff 99%,rgba(43,87,154,.05) 99%,rgba(43,87,154,.05) 100%)}

/* Excluded items indicator */
[data-exclude-toc="1"]::before,[data-exclude-lot="1"]::before,[data-exclude-lof="1"]::before{
  content:'⊘'; color:#0f766e; font-size:11px; margin-right:6px; opacity:.7;
}
h1[data-exclude-toc="1"],h2[data-exclude-toc="1"],h3[data-exclude-toc="1"],h4[data-exclude-toc="1"]{opacity:.7}
.tbl-caption[data-exclude-lot="1"],.fig-caption[data-exclude-lof="1"]{opacity:.5;text-decoration:line-through}
.item-ctx-menu{font-family:'Segoe UI',Arial,sans-serif}

/* Style Gallery */
.style-thumb{background:#fff;border:1px solid #e1dfdd;padding:6px 10px;cursor:pointer;border-radius:3px;min-width:88px;max-width:108px;text-align:left;flex-shrink:0;transition:all .15s;font-family:'Segoe UI',Arial}
.style-thumb:hover{border-color:#334155;background:#f4f8ff}
.style-thumb .style-preview{line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.style-thumb .style-label{font-size:10px;color:#666;margin-top:4px;text-align:center;border-top:1px solid #eee;padding-top:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

.style-entry:hover{box-shadow:0 1px 4px rgba(0,0,0,.08)}
.style-ctx{font-family:'Segoe UI',Arial,sans-serif}

@media print{
  .titlebar,.ribbon,.statusbar{display:none}
  .workspace{padding:0;background:#fff}
  .page{box-shadow:none;margin:0}
}
