/* Folio — a quiet place for considered words. */
:root {
  color-scheme: light;
  --ink: #29352f;
  --ink-strong: #183f3a;
  --muted: #7a817b;
  --brand: #17584e;
  --brand-hover: #10483e;
  --mint: #e5efeb;
  --mint-strong: #cae1cb;
  --surface: #fffefa;
  --chrome: #faf9f5;
  --canvas: #e8ede9;
  --line: #e2e4dc;
  --line-strong: #ccd3c8;
  --page-width: 210mm;
  --page-height: 297mm;
  --margin-top: 24mm;
  --margin-right: 23mm;
  --margin-bottom: 24mm;
  --margin-left: 23mm;
  --zoom: 1;
  --sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --serif: Georgia, "Noto Serif SC", "Songti SC", SimSun, serif;
  font-family: var(--sans);
  color: var(--ink);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; }
body { background: var(--chrome); font-size: 13px; }
button, input, select, textarea { font: inherit; }
button, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .38; }
button, input, select, textarea { outline: none; }
button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, a:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid #61947a;
  outline-offset: 3px;
}
button { color: inherit; }
a { color: var(--brand); text-underline-offset: 3px; }
[hidden] { display: none !important; }
svg { flex-shrink: 0; }
::selection { background: #d5e8d9; color: #153e2e; }

.app-shell { display: flex; flex-direction: column; width: 100%; height: 100dvh; min-height: 440px; overflow: hidden; }
html.studio-embed, html.studio-embed body, html.studio-embed .app-shell { height: 100%; min-height: 0; }
.topbar {
  z-index: 20;
  display: flex;
  align-items: center;
  min-height: 76px;
  padding: 13px 26px;
  gap: 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 192px; text-decoration: none; }
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 39px;
  height: 42px;
  color: #f7f9ed;
  background: var(--brand);
  border-radius: 10px 10px 10px 3px;
}
.brand-mark svg { width: 24px; height: 24px; }
.brand-mark { font-family: Georgia, serif; font-size: 35px; font-style: italic; letter-spacing: -6px; padding-right: 5px; }
.brand-mark > span { color: #a4ccbc; font-size: 30px; }
.brand-name { font-family: Georgia, "Noto Serif SC", "Songti SC", serif; font-size: 27px; line-height: 1.1; letter-spacing: -.9px; color: var(--ink-strong); }
.brand-subtitle { margin-top: 3px; color: #899184; font-size: 9px; font-weight: 600; letter-spacing: 2.1px; text-transform: uppercase; }
.brand-copy { display: flex; flex-direction: column; }
.document-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 13px; min-width: 0; flex: 1; }
.document-title {
  width: auto;
  min-width: 110px;
  max-width: min(320px, 29vw);
  padding: 6px 8px;
  margin-left: -8px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  font-weight: 550;
  font-size: 14px;
  color: var(--ink);
  text-overflow: ellipsis;
}
input.document-title:hover { border-color: var(--line); }
input.document-title:focus { background: white; border-color: #aabfae; }
.save-state { display: flex; align-items: center; gap: 6px; font-size: 11px; color: #7d887a; white-space: nowrap; }
.save-state svg { width: 13px; height: 13px; color: #719274; }
.save-state .state-dot { width: 5px; height: 5px; border-radius: 50%; background: #8aa685; }
.top-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.top-actions .separator { height: 24px; width: 1px; margin: 0 5px; background: var(--line); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 35px; padding: 8px 13px; border: 1px solid var(--line); border-radius: 6px; background: white; font-weight: 500; font-size: 12px; line-height: 1.3; white-space: nowrap; transition: background 140ms, border-color 140ms, box-shadow 140ms; }
.btn:hover { background: #f3f5ef; border-color: var(--line-strong); }
.btn:active { transform: translateY(1px); }
.btn-primary { color: white; background: var(--brand); border-color: var(--brand); box-shadow: 0 2px 3px #103d2e0a; }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn-ghost { background: transparent; border-color: transparent; color: #63715f; }
.btn-ghost:hover { background: #f0f2eb; border-color: transparent; }
.btn-icon { width: 34px; min-width: 34px; height: 34px; min-height: 34px; padding: 7px; }
.btn-small { min-height: 29px; font-size: 11px; padding: 6px 10px; }
.btn-wide { width: 100%; }
.icon, .btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.language-select { height: 32px; padding: 0 20px 0 8px; border: 0; background: transparent; color: #667261; font-size: 11px; }

.workspace-nav { display: flex; align-items: center; flex-shrink: 0; gap: 27px; height: 41px; padding: 0 27px; background: var(--surface); border-bottom: 1px solid var(--line); }
.nav-tab { position: relative; display: inline-flex; align-items: center; justify-content: center; align-self: stretch; min-width: 28px; padding: 0 2px; border: none; background: transparent; color: #7c8478; font-size: 12px; font-weight: 500; white-space: nowrap; }
.nav-tab:hover { color: var(--brand); }
.nav-tab.active { color: var(--brand); font-weight: 650; }
.nav-tab.active::after { position: absolute; content: ""; bottom: -1px; left: 0; right: 0; height: 2px; border-radius: 2px 2px 0 0; background: var(--brand); }
.nav-spacer { flex: 1; }
.nav-hint { display: flex; align-items: center; gap: 6px; color: #899180; font-size: 10px; }
.nav-hint svg { width: 13px; height: 13px; }

.ribbon { z-index: 11; position: relative; flex-shrink: 0; min-height: 93px; background: #fdfcf8; border-bottom: 1px solid #dbe0d5; }
.ribbon-panel { display: none; align-items: stretch; min-height: 93px; padding: 12px 18px 7px; overflow-x: auto; scrollbar-width: thin; }
.ribbon-panel.active { display: flex; }
.tool-group { position: relative; display: flex; flex-direction: column; justify-content: space-between; align-items: center; flex-shrink: 0; gap: 6px; padding: 0 16px; border-right: 1px solid var(--line); }
.tool-group:first-child { padding-left: 7px; }
.tool-group:last-child { border-right: none; }
.tool-row { display: flex; align-items: center; justify-content: flex-start; gap: 3px; min-height: 27px; }
.tool-stack { display: flex; flex-direction: column; gap: 5px; }
.tool-label { display: block; margin: 2px 0 0; color: #94998c; font-size: 9px; line-height: 1.2; letter-spacing: .2px; white-space: nowrap; }
.tool-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 28px; min-width: 28px; padding: 5px 6px; border: 1px solid transparent; border-radius: 4px; background: transparent; line-height: 1; font-size: 12px; color: #56634f; white-space: nowrap; }
.tool-btn:hover { background: #eef1e8; }
.tool-btn.active, .tool-btn[aria-pressed="true"] { color: var(--brand); background: #e5ede0; border-color: #d0ddc9; }
.tool-btn svg { width: 16px; height: 16px; stroke-width: 1.65; }
.tool-btn.tall { flex-direction: column; height: 52px; padding: 4px 9px; gap: 7px; font-size: 10px; }
.tool-btn.tall svg { width: 20px; height: 20px; }
.tool-btn.text-tool { font-family: Georgia, serif; font-size: 15px; }
.tool-btn .tool-text { font-size: 11px; }
.tool-btn.color-tool { position: relative; padding-bottom: 8px; }
.tool-btn.color-tool::after { content: ""; position: absolute; bottom: 2px; width: 14px; height: 3px; background: var(--color, #446b45); }
.ribbon select, .ribbon input[type="number"], .ribbon input[type="text"] { height: 27px; max-width: 170px; padding: 4px 22px 4px 8px; color: #53604f; background: #fffefa; border: 1px solid #dfe3d8; border-radius: 4px; font-size: 11px; }
.ribbon .font-select { width: 145px; }
.ribbon .font-size-select { width: 55px; padding-right: 5px; }
.ribbon .style-select { width: 127px; }
.ribbon input[type="color"] { width: 27px; height: 27px; padding: 4px; border: 1px solid var(--line); border-radius: 4px; background: #fffefa; cursor: pointer; }
.ribbon input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.ribbon input[type="color"]::-webkit-color-swatch { border: none; border-radius: 2px; }
.ribbon .tool-divider { width: 1px; align-self: center; height: 18px; margin: 0 3px; background: var(--line); }
.ribbon-note { align-self: center; padding: 8px 14px; color: var(--muted); line-height: 1.65; font-size: 11px; }
.ribbon-hint { align-self: center; max-width: 270px; margin: 0 15px; color: var(--muted); font-size: 11px; line-height: 1.8; }
.math-icon { font-family: "Cambria Math",serif; font-size: 18px; }
.equation-preview { min-height: 76px; padding: 20px; border: 1px solid var(--line); border-radius: 7px; background: #fcfcf8; font-family: "Cambria Math",serif; font-size: 21px; text-align: center; }
.equation-preview math { font-size: 24px; }
#pageCount { white-space: nowrap; font-variant-numeric: tabular-nums; color: #476d60; }

.workspace-grid { position: relative; flex: 1; display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 0; overflow: hidden; }
.workspace-grid:has(> .inspector) { grid-template-columns: 232px minmax(0, 1fr) 252px; }
.workspace-grid:has(> .sidebar.is-collapsed) { grid-template-columns: 0 minmax(0, 1fr); }
.workspace-grid:has(> .sidebar.is-collapsed):has(> .inspector) { grid-template-columns: 0 minmax(0, 1fr) 252px; }
.sidebar { z-index: 5; min-width: 0; overflow: auto; scrollbar-width: thin; background: #fafaf6; border-right: 1px solid var(--line); }
.sidebar.is-collapsed { visibility: hidden; overflow: hidden; border: 0; }
.sidebar-tabs { display: flex; gap: 19px; height: 56px; padding: 0 21px; border-bottom: 1px solid var(--line); }
.sidebar-tab { position: relative; display: flex; align-items: center; gap: 6px; padding: 0; border: 0; background: transparent; color: #8c9387; font-size: 11px; white-space: nowrap; }
.sidebar-tab svg { width: 13px; height: 13px; }
.sidebar-tab.active { color: var(--brand); font-weight: 600; }
.sidebar-tab.active::after { position: absolute; bottom: -1px; right: 0; left: 0; content: ""; height: 2px; background: var(--brand); }
.sidebar-content { padding: 22px 17px; }
.panel-title { display: flex; align-items: center; justify-content: space-between; margin: 0 0 16px; color: #838c7c; font-size: 10px; font-weight: 550; letter-spacing: 1.4px; text-transform: uppercase; }
.panel-title .count { display: inline-flex; justify-content: center; align-items: center; min-width: 18px; height: 18px; padding: 0 5px; font-size: 9px; letter-spacing: 0; color: #7f8e79; background: #eaf0e4; border-radius: 4px; }
.outline-list { display: flex; flex-direction: column; gap: 5px; }
.outline-item { display: block; width: 100%; text-align: left; padding: 9px 11px; border: none; border-radius: 5px; background: transparent; color: #7b8574; font-size: 11px; line-height: 1.55; text-decoration: none; overflow: hidden; text-overflow: ellipsis; }
.outline-item:hover { background: #eef1e8; color: var(--brand); }
.outline-item.active { background: #e8eee2; color: #41613e; font-weight: 550; }
.outline-item[data-level="2"] { padding-left: 21px; }
.outline-item[data-level="3"] { padding-left: 32px; font-size: 10px; }
.outline-item .outline-number { color: #a4ac9b; margin-right: 7px; font-size: 9px; }
.empty-state { padding: 21px 9px; color: #969e8c; font-size: 11px; line-height: 1.85; text-align: center; }
.empty-state svg { display: block; width: 27px; height: 27px; margin: 0 auto 12px; color: #aab6a3; }
.sidebar-divider { height: 1px; margin: 23px 0; background: var(--line); }
.sidebar-footer { padding: 18px 20px; color: #939b88; font-size: 10px; line-height: 1.7; border-top: 1px solid var(--line); }
.sidebar-footer svg { width: 13px; height: 13px; margin-right: 5px; }
.search-field { position: relative; margin-bottom: 16px; }
.search-field input { width: 100%; height: 33px; padding: 7px 10px; background: white; border: 1px solid var(--line); border-radius: 5px; font-size: 11px; }
.search-field input::placeholder { color: #a1a798; }
.search-result { margin: 6px 0; padding: 10px; border: 1px solid var(--line); border-radius: 5px; background: white; font-size: 11px; line-height: 1.6; }
.search-result mark { color: #375233; background: #e1edc8; }
.search-actions { display: flex; gap: 6px; margin-top: 10px; }

.editor-workspace { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; background: var(--canvas); }
.document-viewport { flex: 1; min-height: 0; overflow: auto; scrollbar-color: #bfc8b8 transparent; scrollbar-width: thin; }
.workspace-info { z-index: 3; position: relative; display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; gap: 15px; min-width: 100%; min-height: 55px; padding: 12px 27px; background: #eaece7f2; }
.document-badge { display: inline-flex; align-items: center; gap: 7px; color: #8b9383; font-size: 10px; white-space: nowrap; }
.document-badge svg { width: 13px; height: 13px; }
.document-badge .badge-dot { width: 3px; height: 3px; border-radius: 50%; background: #a7b19c; margin: 0 3px; }
.mode-switch { display: inline-flex; align-items: center; padding: 3px; gap: 2px; border: 1px solid #d3d9cc; border-radius: 6px; background: #e3e7de; }
.mode-switch button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 25px; padding: 4px 9px; background: transparent; border: 0; border-radius: 4px; color: #8a9480; font-size: 10px; white-space: nowrap; }
.mode-switch button.active, .mode-switch button[aria-pressed="true"] { color: #4a6542; background: #fffefa; box-shadow: 0 1px 3px #3b48300a; }
.mode-switch button svg { width: 12px; height: 12px; }
.ruler { position: relative; width: var(--page-width); height: 19px; margin: 1px auto 14px; color: #9ba492; font-size: 8px; user-select: none; }
.ruler::before { content: ""; display: block; position: absolute; top: 10px; left: 0; right: 0; height: 5px; background: repeating-linear-gradient(90deg, #aeb8a4 0, #aeb8a4 1px, transparent 1px, transparent 18.9px); opacity: .65; }
.ruler-track { display: flex; position: relative; justify-content: space-between; padding: 0 1px; }
.ruler-track span { min-width: 12px; text-align: center; background: var(--canvas); }
.ruler-markers { display: flex; justify-content: space-between; }
.ruler .margin-marker { position: absolute; bottom: 1px; left: var(--margin-left); width: 6px; height: 8px; background: #84977b; clip-path: polygon(0 0, 100% 0, 100% 65%, 50% 100%, 0 65%); }
.ruler .margin-marker.right { left: auto; right: var(--margin-right); }
.page-stage { width: max-content; min-width: 0; padding: 0 36px 40px; margin: 0 auto; transform-origin: top center; }
.paper {
  position: relative;
  width: var(--page-width);
  min-height: var(--page-height);
  margin: 0 auto;
  padding: var(--margin-top) var(--margin-right) var(--margin-bottom) var(--margin-left);
  background: white;
  box-shadow: 0 1px 2px #2530210b, 0 6px 22px #2530210b;
  outline: 1px solid #dce0d6;
  font-family: Calibri, "Microsoft YaHei", sans-serif;
  font-size: 11pt;
  line-height: 1.0791667;
  color: #000;
  overflow-wrap: break-word;
  caret-color: var(--brand);
}
.paper:focus { outline: 1px solid #c2ccba; }
.paper[contenteditable="false"] { cursor: default; }
.paper:empty::before { content: attr(data-placeholder); color: #b4b9ad; pointer-events: none; }
.doc-content p { margin: 0 0 8pt; }
.doc-content h1, .doc-content h2, .doc-content h3, .doc-content h4, .doc-content h5, .doc-content h6 { margin: 12pt 0 6pt; font-family: inherit; color: inherit; font-weight: bold; line-height: inherit; break-after: avoid; }
.doc-content h1 { font-size: 16pt; }
.doc-content h2 { font-size: 13pt; }
.doc-content h3 { font-size: 12pt; }
.doc-content h4 { font-size: 11pt; }
.doc-content h5 { font-size: 10pt; }
.doc-content h6 { font-size: 9pt; }
.doc-content a { color: #356b4d; }
.doc-content ul, .doc-content ol { padding-left: 36pt; margin: 0; }
.doc-content li { margin: 0 0 8pt; padding-left: 0; }
.doc-content blockquote { margin: 0 0 8pt; padding: 0; border: 0; background: transparent; color: inherit; font-size: inherit; font-style: normal; }
.doc-content blockquote p:last-child { margin-bottom: 0; }
.doc-content table { border-collapse: collapse; table-layout: auto; margin: 0; font-size: inherit; }
.doc-content th, .doc-content td { padding: 4pt 5.4pt; border: 0; vertical-align: top; text-align: left; }
.doc-content th { font-weight: inherit; color: inherit; background: transparent; }
.doc-content td > p:last-child, .doc-content th > p:last-child { margin-bottom: 0; }
.doc-content img { max-width: 100%; height: auto; vertical-align: middle; }
.doc-content hr { height: 0; margin: 0 0 8pt; border: 0; border-top: 1px solid #a0a8b5; }
.doc-content pre { padding: 12pt; white-space: pre-wrap; font-family: Consolas, monospace; font-size: 9pt; background: #f4f5f1; border-radius: 3px; }
.doc-content code { font-family: Consolas, monospace; font-size: .9em; }
.doc-content [data-page-break], .doc-content .page-break { display: block; height: 1px; border-top: 1px dashed #cbd4c3; margin: 28px 0; break-before: page; break-after: auto; }
.doc-content mark { background: #fff3b7; }
.doc-content .doc-kicker { margin: 0 0 14pt; font-family: var(--sans); color: #879b75; font-size: 8pt; font-weight: 550; letter-spacing: 2pt; text-transform: uppercase; }
.doc-content .doc-subtitle { margin: 0 0 22pt; color: #89917f; font-size: 11pt; line-height: 1.75; }
.doc-content .doc-tag { display: inline-block; margin-right: 6pt; padding: 3pt 7pt; color: #6f805e; background: #eff3e9; border: 1px solid #e2e9da; border-radius: 2pt; font-family: var(--sans); font-size: 7.5pt; }
.doc-content .doc-divider { width: 38pt; margin: 24pt 0; border-color: #a4b69a; border-top-width: 2px; }
.doc-content .doc-footer { margin-top: 34pt; padding-top: 10pt; border-top: 1px solid #e5e8df; font-family: var(--sans); color: #a1a794; font-size: 7pt; letter-spacing: .4pt; }
.doc-content .doc-eyebrow { color: #929d86; font-family: var(--sans); font-size: 8pt; letter-spacing: 1pt; }

.preview-surface { width: max-content; min-width: 100%; min-height: 300px; }
.preview-surface .docx-wrapper { padding: 0 36px 65px !important; background: transparent !important; }
.preview-surface .docx-wrapper > section.docx { margin: 0 auto 25px !important; box-shadow: 0 2px 16px #25302112 !important; }
.preview-surface .docx-wrapper > section { overflow: visible; }
.preview-message { width: min(500px, calc(100% - 48px)); margin: 50px auto; padding: 30px; text-align: center; color: #87927d; background: #f4f5f0; border: 1px dashed #cbd3c3; border-radius: 8px; line-height: 1.8; }
.preview-message svg { width: 32px; height: 32px; color: #8fa17e; margin-bottom: 12px; }
.preview-message h3 { font-size: 15px; color: #516648; font-weight: 550; }

.workspace-grid > .inspector { z-index: 4; min-width: 0; padding: 24px 18px; overflow: auto; scrollbar-width: thin; border-left: 1px solid var(--line); background: #fafaf6; }
.inspector > .panel-title { margin: 0 0 18px; }
.info-card { margin-bottom: 16px; padding: 15px 13px; border: 1px solid #e2e6d9; border-radius: 7px; background: #fffefa; }
.info-card h3, .info-card h4 { display: flex; align-items: center; gap: 7px; margin: 0 0 10px; font-size: 11px; font-weight: 600; color: #52654a; }
.info-card h3 svg, .info-card h4 svg { width: 14px; height: 14px; }
.info-card p { margin: 7px 0 0; font-size: 10px; line-height: 1.8; color: #919780; }
.info-card .info-row { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; color: #929a86; font-size: 10px; }
.info-card .info-row strong { color: #69765e; font-weight: 500; }
.fidelity-note { padding: 14px; border: 1px solid #dfe6d4; border-radius: 7px; background: #f0f4e9; color: #839075; font-size: 10px; line-height: 1.85; }
.fidelity-note h3, .fidelity-note strong { color: #637e52; font-weight: 550; }
.fidelity-note h3 { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; font-size: 11px; }
.fidelity-note svg { width: 14px; height: 14px; }
.fidelity-note p { margin: 0 0 8px; }
.fidelity-note p:last-child { margin-bottom: 0; }
.feature-list { display: flex; flex-direction: column; gap: 11px; margin: 12px 0 0; padding: 0; list-style: none; }
.feature-list li { display: flex; align-items: flex-start; gap: 7px; font-size: 10px; color: #8b967e; line-height: 1.65; }
.feature-list svg { width: 12px; height: 12px; margin-top: 2px; color: #85a173; }
.feature-list .feature-warning svg { color: #b6a56d; }
.inspector-caption { padding: 1px 8px; color: #a2aa97; font-size: 9px; line-height: 1.9; }
.privacy-note { display: flex; align-items: flex-start; gap: 7px; padding: 16px 2px; color: #98a18c; font-size: 9px; line-height: 1.75; }
.privacy-note svg { width: 12px; height: 12px; margin-top: 2px; color: #90a17d; }

.statusbar { z-index: 15; display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; gap: 15px; min-height: 32px; padding: 0 21px; border-top: 1px solid #dbe0d5; background: #fafbf6; color: #8a9680; font-size: 10px; }
.status-left, .status-right { display: flex; align-items: center; gap: 17px; white-space: nowrap; }
.statusbar .status-item { display: inline-flex; align-items: center; gap: 5px; }
.statusbar .status-separator { height: 11px; width: 1px; margin: 0 -7px; background: #d9dfd0; }
.statusbar svg { width: 12px; height: 12px; }
.statusbar button { border: 0; background: transparent; color: inherit; font-size: 10px; }
.statusbar button:hover { color: var(--brand); }
.zoom-controls { display: flex; align-items: center; gap: 6px; }
.zoom-controls button { display: inline-flex; align-items: center; justify-content: center; width: 23px; height: 23px; padding: 4px; border-radius: 4px; }
.zoom-controls button:hover { background: #e9eee2; }
.zoom-controls input[type="range"] { width: 81px; height: 3px; accent-color: #769469; cursor: pointer; }
.zoom-value { min-width: 33px; text-align: right; font-variant-numeric: tabular-nums; }

.modal-backdrop { position: fixed; z-index: 100; inset: 0; display: flex; align-items: center; justify-content: center; padding: 24px; background: #1b2d2580; backdrop-filter: blur(3px); animation: fade-in 140ms ease-out; }
.modal { width: min(560px, 100%); max-height: calc(100dvh - 48px); overflow: auto; background: var(--surface); border: 1px solid #e7eadf; border-radius: 12px; box-shadow: 0 15px 75px #0f211e30; animation: modal-in 160ms ease-out; }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 22px 25px 18px; border-bottom: 1px solid var(--line); }
.modal-header h2 { margin: 0; color: #344d39; font-size: 18px; font-weight: 550; letter-spacing: -.3px; }
.modal-header .btn-icon { margin: -4px -8px -4px 0; }
.modal-body { padding: 22px 25px; color: #7b8772; font-size: 12px; line-height: 1.85; }
.modal-body p { margin: 0 0 13px; }
.modal-body p:last-child { margin-bottom: 0; }
.modal-body h3 { margin: 21px 0 8px; font-size: 12px; font-weight: 600; color: #4c6645; }
.modal-body ul { margin: 7px 0 16px; padding-left: 20px; }
.modal-body li { margin: 6px 0; }
.modal-footer { display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding: 16px 25px 20px; border-top: 1px solid var(--line); }
.modal-description { color: #909b85; font-size: 11px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.form-field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.form-field:last-child { margin-bottom: 0; }
.form-field label { color: #6d7e61; font-size: 11px; font-weight: 500; }
.form-field input, .form-field select, .form-field textarea, .modal-body > input, .modal-body > select { width: 100%; min-height: 36px; padding: 8px 10px; border: 1px solid #d9e0d0; border-radius: 5px; color: #485d40; background: white; font-size: 12px; }
.form-field textarea { min-height: 90px; resize: vertical; }
.form-field small { color: #929d86; font-size: 10px; }
.checkbox-field { display: flex; align-items: flex-start; gap: 8px; font-size: 11px; color: #7a8c6a; }
.checkbox-field input { margin-top: 4px; accent-color: var(--brand); }
.modal-callout { margin: 16px 0; padding: 13px 15px; border: 1px solid #dfe6d3; border-radius: 6px; background: #eff4e7; color: #7b8c69; font-size: 11px; line-height: 1.85; }
.modal-callout.warning { background: #faf5e9; border-color: #e9dfc3; color: #9b8b63; }
.format-options { display: flex; flex-direction: column; gap: 9px; }
.format-option { display: flex; align-items: flex-start; gap: 12px; padding: 15px; border: 1px solid var(--line); border-radius: 6px; background: white; cursor: pointer; }
.format-option:has(input:checked) { border-color: #a6c095; background: #f3f7ed; }
.format-option input { margin-top: 4px; accent-color: var(--brand); }
.format-option strong { display: block; color: #536c48; font-size: 12px; font-weight: 550; }
.format-option small { display: block; margin-top: 3px; color: #8d9b80; font-size: 10px; line-height: 1.7; }
.keyboard-grid { display: grid; grid-template-columns: 1fr auto; gap: 10px 20px; }
kbd { display: inline-block; padding: 2px 5px; border: 1px solid #dce3d3; border-radius: 3px; background: #f4f6ef; color: #829375; font-family: var(--sans); font-size: 10px; box-shadow: 0 1px 0 #dce3d3; }
.toast-stack { z-index: 150; position: fixed; right: 24px; bottom: 50px; display: flex; align-items: flex-end; flex-direction: column; gap: 9px; max-width: min(420px, calc(100vw - 40px)); pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; padding: 13px 17px; border: 1px solid #dce5d3; border-radius: 7px; background: #fffff9; color: #557047; font-size: 12px; line-height: 1.6; box-shadow: 0 5px 25px #2c402319; animation: toast-in 180ms ease-out; pointer-events: auto; }
.toast svg { width: 17px; height: 17px; color: #739765; }
.toast.error { border-color: #ead3c8; color: #956c58; }
.toast.error svg { color: #bb8c73; }
.toast.warning { border-color: #e7ddbd; color: #9a8752; }
.toast button { margin-left: auto; padding: 3px; border: 0; background: transparent; }
.drop-overlay { position: fixed; z-index: 90; inset: 14px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 15px; border: 2px dashed #86a575; border-radius: 15px; background: #f3f7eef5; color: #587b49; backdrop-filter: blur(5px); pointer-events: none; }
.drop-overlay svg { width: 50px; height: 50px; stroke-width: 1.2; }
.drop-overlay h2 { margin: 0; font-weight: 500; font-size: 24px; }
.drop-overlay p { color: #8b9d7b; font-size: 12px; }
.loading-spinner { display: inline-block; width: 15px; height: 15px; border: 2px solid #d6e1cb; border-top-color: var(--brand); border-radius: 50%; animation: spin 700ms linear infinite; }
.loading-state { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 140px; color: #859777; font-size: 12px; }

/* Application controls. Document formatting is intentionally kept separate. */
.brand-mark { font-family: Georgia, serif; font-size: 36px; font-style: italic; font-weight: 600; line-height: 1; padding: 0 0 6px 2px; }
.brand-mark > span { display: inline-block; align-self: flex-end; margin: 0 0 1px 0; font-size: 22px; font-style: normal; color: #bbd2a9; }
.brand-name > .brand-subtitle { display: inline-block; margin: 0 0 2px 10px; font-family: var(--sans); font-size: 11px; font-weight: 400; letter-spacing: 1px; vertical-align: middle; }
.header-divider { align-self: center; width: 1px; height: 28px; background: var(--line); }
.topbar { gap: 20px; }
.brand { min-width: 158px; }
.language-control { display: flex; align-items: center; gap: 5px; margin-right: 10px; color: #7c8775; }
.language-control > .icon { width: 14px; height: 14px; }
.language-control select { max-width: 84px; height: 30px; padding: 0 2px; border: 0; background: transparent; color: #7d8776; font-size: 11px; cursor: pointer; }
.status-dot { display: inline-block; flex-shrink: 0; width: 5px; height: 5px; border-radius: 50%; background: #84a27b; }
.status-dot.amber { background: #b6a16c; }
.nav-tabs { display: flex; align-items: stretch; align-self: stretch; gap: 28px; }
.new-button { min-height: 27px; margin-left: -6px; padding: 5px 8px; font-size: 11px; }
.new-button .icon { width: 14px; height: 14px; }
.nav-note { display: inline-flex; align-items: center; gap: 6px; margin-left: 0; color: #929b85; font-size: 10px; white-space: nowrap; }
.nav-note > .icon { width: 12px; height: 12px; }
.workspace-nav .top-actions { flex-shrink: 0; margin-left: auto; gap: 6px; }
.workspace-nav .save-state { display: inline-flex; align-items: center; gap: 6px; margin-right: 4px; color: #7d8776; font-size: 10px; white-space: nowrap; }
.workspace-nav .language-control { margin-right: 2px; }
.workspace-nav .top-actions .btn { min-height: 28px; padding: 5px 10px; font-size: 11px; }
.workspace-nav > .btn-icon { width: 26px; min-width: 26px; height: 26px; min-height: 26px; margin-left: 0; }
.tool-btn.script-btn { position: relative; min-width: 32px; overflow: visible; font-family: Georgia, "Times New Roman", serif; font-size: 15px; line-height: 1; }
.tool-btn.script-btn .script-super, .tool-btn.script-btn .script-sub { display: inline-block; font-size: 0.58em; line-height: 1; }
.tool-btn.script-btn .script-super { transform: translateY(-0.55em); }
.tool-btn.script-btn .script-sub { transform: translateY(0.38em); }
.ribbon .size-select { width: 53px; padding-right: 3px; }
.text-bold { font-family: Georgia, serif; font-weight: 700; font-size: 15px; }
.text-italic { font-family: Georgia, serif; font-style: italic; font-size: 15px; }
.text-underline { text-decoration: underline; text-underline-offset: 3px; }
.text-strike { text-decoration: line-through; }
.color-tool { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border: 1px solid transparent; border-radius: 4px; cursor: pointer; }
.color-tool:hover { background: #eef1e8; }
.color-tool:focus-within { outline: 2px solid #61947a; outline-offset: 2px; }
.color-tool > span { display: block; height: 20px; border-bottom: 3px solid #174e46; color: #53634c; font-family: Georgia, serif; font-size: 14px; font-weight: 600; line-height: 17px; }
.highlight-tool > span { height: 19px; padding: 0 2px; border: 0; border-bottom: 4px solid #fff0a3; font-family: var(--sans); font-size: 10px; font-weight: 500; line-height: 16px; }
.ribbon .color-tool input[type="color"] { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.ribbon-hint { align-self: center; max-width: 360px; margin: 0; padding: 8px 21px; color: #929d85; font-size: 11px; line-height: 1.8; }
.sidebar-tabs { position: sticky; z-index: 1; top: 0; flex-shrink: 0; gap: 20px; padding-left: 20px; padding-right: 17px; background: #fafaf6; }
.sidebar-tab { font-size: 10px; }
.sidebar-content[data-side-panel="outline"] { display: flex; flex-direction: column; min-height: calc(100% - 56px); }
.panel-title > #headingCount { display: inline-flex; justify-content: center; align-items: center; min-width: 18px; height: 18px; padding: 0 5px; font-size: 9px; letter-spacing: 0; color: #7f8e79; background: #eaf0e4; border-radius: 4px; }
.sidebar-bottom { display: flex; align-items: flex-start; gap: 9px; margin-top: auto; padding: 50px 9px 1px; color: #a3ac96; }
.sidebar-bottom .icon { width: 15px; height: 15px; margin-top: 1px; color: #9aab8c; }
.sidebar-bottom p { margin: 0; font-size: 9px; line-height: 1.9; }
.field-label { display: block; margin: 0 0 9px; color: #839276; font-size: 10px; font-weight: 500; }
.text-input { display: block; width: 100%; min-height: 33px; padding: 8px 10px; border: 1px solid #dce3d3; border-radius: 5px; background: #fffefa; color: #5e7351; font-size: 11px; }
.text-input::placeholder { color: #a5af9b; }
.text-input:focus { border-color: #a4bc94; }
.checkbox-label { display: flex; align-items: center; gap: 6px; margin: 12px 0; color: #8e9b81; font-size: 10px; }
.checkbox-label input { margin: 0; accent-color: var(--brand); }
.field-divider { height: 1px; margin: 23px 0; background: var(--line); }
.replace-actions { display: flex; justify-content: space-between; gap: 7px; margin-top: 13px; }
.replace-actions .btn { flex: 1; min-height: 29px; padding: 6px 7px; font-size: 10px; }
.search-results { display: flex; flex-direction: column; gap: 7px; margin-top: 14px; font-size: 10px; line-height: 1.7; color: #8f9c82; }
.search-results > button { padding: 8px 9px; border: 1px solid #e0e6d6; border-radius: 4px; background: #fffefa; color: #859575; text-align: left; font-size: 10px; line-height: 1.8; }
.search-results > button:hover { border-color: #b7c9a8; background: #eff4e8; }
.sidebar-content.inspector { padding: 22px 17px; }
.sidebar-content.inspector > .info-card > .icon { width: 16px; height: 16px; margin-right: 5px; margin-bottom: 2px; color: #8ba576; }
.sidebar-content.inspector > .info-card > strong { color: #657e55; font-size: 10px; font-weight: 550; }
.sidebar-content.inspector > .feature-list { margin: 20px 3px; }
.sidebar-content.inspector > .btn { font-size: 10px; }
.badge-divider { color: #bbc2b1; font-size: 9px; margin: 0 3px; }
.ruler { display: flex; justify-content: space-between; align-items: flex-start; padding: 0 var(--margin-right) 0 var(--margin-left); }
.ruler::before { left: var(--margin-left); right: var(--margin-right); }
.ruler > span { z-index: 1; position: relative; display: block; min-width: 8px; height: 8px; padding: 0 1px; background: var(--canvas); text-align: center; font-variant-numeric: tabular-nums; }
.page-end-note { margin: 22px auto 0; color: #a3ae98; font-size: 9px; letter-spacing: .5px; text-align: center; }
.status-button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-width: 20px; height: 25px; padding: 3px; border-radius: 3px; }
.status-button:hover { background: #edf1e6; }
.status-button.compatibility-status { gap: 6px; color: #9c9474; }
.drop-overlay > div { text-align: center; }
.drop-overlay > div > .icon { width: 50px; height: 50px; margin-bottom: 12px; }

/* Imported content keeps the document's own inline OOXML formatting. */
.doc-content.is-imported { color: #000; }
.doc-content.is-imported h1, .doc-content.is-imported h2, .doc-content.is-imported h3,
.doc-content.is-imported h4, .doc-content.is-imported h5, .doc-content.is-imported h6 { margin: 0; letter-spacing: normal; }
.doc-content.is-imported blockquote { margin: 0; padding: 0; border: 0; background: transparent; color: inherit; font-size: inherit; font-style: normal; }
.doc-content.is-imported table { width: auto; margin: 0; font-size: inherit; }
.doc-content.is-imported th, .doc-content.is-imported td { padding: 0; border: 0; background: transparent; color: inherit; font-weight: inherit; }
.doc-content.is-imported img { max-width: none; }
.doc-content.is-imported p, .doc-content.is-imported h1, .doc-content.is-imported h2,
.doc-content.is-imported h3, .doc-content.is-imported h4, .doc-content.is-imported h5,
.doc-content.is-imported h6 { white-space: pre-wrap; }
.word-list-marker { white-space: pre; user-select: none; }
.doc-content .word-page-break { display: block; height: 0; margin: 0; border: 0; break-before: page; break-after: auto; }
.word-preserved { border-bottom: 1px dotted #b5bda9; cursor: help; }
.word-preserved-block { margin: 0 0 8pt; padding: 9pt; border: 1px dashed #c9d2be; background: #f5f7f0; color: #859579; font-size: 10pt; cursor: help; }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(7px) scale(.99); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (min-width: 1600px) {
  .workspace-grid { grid-template-columns: 252px minmax(0, 1fr); }
  .workspace-grid:has(> .inspector) { grid-template-columns: 252px minmax(0, 1fr) 276px; }
  .topbar { padding-left: 30px; padding-right: 30px; }
  .sidebar-content { padding-left: 22px; padding-right: 22px; }
  .workspace-grid > .inspector { padding-left: 24px; padding-right: 24px; }
}
@media (max-width: 1280px) {
  .workspace-grid:has(> .inspector) { grid-template-columns: 205px minmax(0, 1fr); }
  .workspace-grid:has(> .sidebar.is-collapsed):has(> .inspector) { grid-template-columns: 0 minmax(0, 1fr); }
  .workspace-grid > .inspector { display: none; }
  .brand { min-width: 160px; }
  .topbar { gap: 23px; }
  .top-actions { gap: 5px; }
  .tool-group { padding-left: 12px; padding-right: 12px; }
  .nav-hint { display: none; }
}
@media (max-width: 1024px) {
  .topbar { min-height: 68px; padding: 11px 18px; gap: 17px; }
  .brand { min-width: 135px; gap: 9px; }
  .brand-mark { width: 34px; height: 37px; }
  .brand-name { font-size: 24px; }
  .brand-subtitle { font-size: 8px; letter-spacing: 1.6px; }
  .document-meta { align-items: flex-start; flex-direction: column; gap: 1px; }
  .document-title { max-width: 25vw; font-size: 12px; padding-top: 2px; padding-bottom: 2px; }
  .save-state { font-size: 9px; }
  .top-actions .btn { min-height: 33px; padding: 7px 10px; font-size: 11px; }
  .top-actions .btn-icon { width: 31px; min-width: 31px; padding: 6px; }
  .workspace-grid, .workspace-grid:has(> .inspector) { grid-template-columns: 187px minmax(0, 1fr); }
  .sidebar-content { padding: 20px 13px; }
  .sidebar-tabs { padding: 0 15px; gap: 15px; }
  .workspace-info { padding-left: 21px; padding-right: 21px; }
  .ribbon-panel { padding-left: 12px; padding-right: 12px; }
  .workspace-nav { padding-left: 21px; gap: 24px; }
  .nav-note { display: none; }
  .workspace-nav .save-state { display: none; }
  .workspace-nav > .btn-icon { margin-left: 0; }
}
@media (max-width: 820px) {
  .workspace-grid, .workspace-grid:has(> .inspector) { grid-template-columns: minmax(0, 1fr); }
  .workspace-grid:has(> .sidebar.is-collapsed), .workspace-grid:has(> .sidebar.is-collapsed):has(> .inspector) { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .sidebar.is-mobile-open { z-index: 9; position: absolute; inset: 0 auto 0 0; display: block; visibility: visible; width: 246px; overflow: auto; border-right: 1px solid #cfd8c5; background: #fafaf6; box-shadow: 7px 0 24px #283c2426; }
  .topbar { gap: 16px; padding-left: 16px; padding-right: 16px; }
  .brand { min-width: 112px; }
  .brand-subtitle { display: none; }
  .brand-mark { width: 31px; height: 34px; border-radius: 8px 8px 8px 2px; }
  .brand-mark svg { width: 20px; height: 20px; }
  .brand-name { font-size: 23px; }
  .document-title { max-width: 27vw; }
  .top-actions .hide-tablet { display: none; }
  .header-divider { display: none; }
  .top-actions .separator { margin: 0 2px; }
  .ribbon-panel { scrollbar-width: none; }
  .ribbon-panel::-webkit-scrollbar { display: none; }
  .statusbar { padding: 0 14px; }
  .status-left, .status-right { gap: 12px; }
  .statusbar .hide-tablet { display: none; }
  .zoom-controls input[type="range"] { width: 60px; }
}
@media (max-width: 600px) {
  .app-shell { min-height: 380px; }
  .topbar { min-height: 62px; padding: 10px 12px; gap: 10px; }
  .brand { min-width: 35px; }
  .brand-name { display: none; }
  .document-meta { gap: 0; }
  .document-title { width: 100%; min-width: 80px; max-width: 31vw; font-size: 11px; }
  .save-state { max-width: 34vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 8px; }
  .save-state svg { width: 10px; height: 10px; }
  .top-actions { gap: 2px; }
  .top-actions .btn { gap: 5px; padding-left: 8px; padding-right: 8px; font-size: 10px; }
  .top-actions .btn svg { width: 13px; height: 13px; }
  .top-actions .btn-icon { min-width: 28px; width: 28px; padding: 6px; }
  .top-actions .hide-mobile, .hide-mobile { display: none !important; }
  .top-actions .separator { display: none; }
  .top-actions #importBtn > span, .top-actions #exportBtn > span { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .top-actions #importBtn, .top-actions #exportBtn { width: 31px; min-width: 31px; padding: 7px; }
  .language-control { gap: 3px; margin-right: 4px; }
  .language-control > .icon { width: 12px; height: 12px; }
  .language-control select { max-width: 61px; font-size: 10px; }
  .language-select { width: 40px; padding: 0 0 0 3px; font-size: 9px; }
  .workspace-nav { height: 36px; padding: 0 15px; gap: 23px; overflow: auto; scrollbar-width: none; }
  .workspace-nav::-webkit-scrollbar { display: none; }
  .nav-tab { font-size: 11px; min-width: 24px; }
  .nav-tabs { gap: 21px; }
  .workspace-nav > .btn-icon { flex-shrink: 0; margin-left: auto; }
  .ribbon, .ribbon-panel { min-height: 87px; }
  .ribbon-panel { padding-top: 9px; padding-bottom: 6px; }
  .tool-group { padding-left: 10px; padding-right: 10px; }
  .tool-label { font-size: 8px; }
  .tool-btn { min-width: 27px; }
  .ribbon .font-select { width: 125px; }
  .workspace-info { min-height: 49px; padding: 10px 15px; gap: 8px; }
  .document-badge { font-size: 9px; gap: 5px; }
  .mode-switch { padding: 2px; }
  .mode-switch button { min-height: 24px; padding: 4px 7px; gap: 4px; font-size: 9px; }
  .mode-switch button svg { width: 11px; height: 11px; }
  .page-stage { padding-left: 20px; padding-right: 20px; padding-bottom: 40px; }
  .ruler { margin-top: 0; margin-bottom: 11px; }
  .statusbar { min-height: 29px; padding: 0 10px; gap: 7px; font-size: 8px; }
  .status-left, .status-right { gap: 9px; }
  #modeLabel { display: none; }
  #documentStats { max-width: 34vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .statusbar button { font-size: 8px; }
  .zoom-controls { gap: 2px; }
  .zoom-controls input[type="range"] { display: none; }
  .zoom-value { min-width: 27px; }
  .statusbar .status-separator { margin: 0 -3px; height: 9px; }
  .modal-backdrop { padding: 15px; }
  .modal { max-height: calc(100dvh - 30px); border-radius: 9px; }
  .modal-header { padding: 18px; }
  .modal-header h2 { font-size: 16px; }
  .modal-body { padding: 18px; font-size: 11px; }
  .modal-footer { padding: 14px 18px 18px; }
  .form-grid { gap: 10px; }
  .toast-stack { bottom: 43px; right: 15px; max-width: calc(100vw - 30px); }
  .toast { padding: 11px 14px; font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

@page { size: A4; margin: 0; }
.setting-checks { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0; }
.setting-check { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink); }
.setting-check input { width: 15px; height: 15px; accent-color: var(--brand); }
.settings-detail { margin-top: 16px; padding: 13px 0 0; border-top: 1px solid var(--line); font-size: 12px; }
.settings-detail summary { cursor: pointer; font-weight: 600; color: var(--brand); margin-bottom: 10px; }
.settings-detail p { color: #727f75; line-height: 1.6; }
.tab-stop-list { display: grid; gap: 5px; margin-top: 10px; color: #657469; }
.tab-stop-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 5px 8px; background: #f3f6f0; border-radius: 5px; }
.version-chip { font: 9px/1.4 var(--sans); color: #718677; white-space: nowrap; }
.selection-announcer { position: fixed; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 540px) { .setting-checks { grid-template-columns: 1fr; } .version-chip { display: none; } }
@media print {
  html, body { height: auto !important; width: auto !important; overflow: visible !important; background: white !important; }
  body { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .app-shell { display: block; height: auto; min-height: 0; overflow: visible; }
  .topbar, .workspace-nav, .ribbon, .sidebar, .inspector, .statusbar, .workspace-info,
  .ruler, .modal-backdrop, .toast-stack, .drop-overlay, .preview-message, .page-end-note { display: none !important; }
  .workspace-grid, .workspace-grid:has(> .inspector) { display: block; overflow: visible; }
  .editor-workspace { display: block !important; overflow: visible !important; background: white; }
  .document-viewport { overflow: visible !important; }
  .page-stage { width: auto !important; min-width: 0; margin: 0; padding: 0; transform: none !important; zoom: 1 !important; }
  .paper { width: 100% !important; min-height: 0 !important; margin: 0; box-shadow: none; outline: none !important; overflow: visible !important; transform: none !important; }
  .paper[contenteditable]:empty::before { display: none; }
  .word-preserved { border: 0; }
  .word-preserved-block { padding: 0; border: 0; background: transparent; color: inherit; font-size: inherit; }
  .doc-content [data-page-break], .doc-content .page-break { height: 0; margin: 0; border: 0; break-before: page; break-after: auto; }
  .doc-content img, .doc-content blockquote, .doc-content tr { break-inside: avoid; }
  .doc-content h1, .doc-content h2, .doc-content h3, .doc-content h4 { break-after: avoid; }
  .doc-content p { orphans: 2; widows: 2; }
  .preview-surface { width: auto !important; min-width: 0; }
  .preview-surface .docx-wrapper { padding: 0 !important; }
  .preview-surface .docx-wrapper > section.docx { margin: 0 !important; box-shadow: none !important; break-after: page; }
  body.print-preview #editor { display: none !important; }
  body.print-preview #previewSurface { display: block !important; }
  body:not(.print-preview) #previewSurface { display: none !important; }
  body:not(.print-preview) #editor { display: block !important; }
}
/* Compact upgrade action aligned with the language and document controls. */
.top-actions .writer-upgrade-btn{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;height:32px;min-height:32px;padding:0 13px;border:1px solid #202020;border-radius:7px;background:#202020;color:#fff;text-decoration:none;font:600 12px/1 system-ui,sans-serif;white-space:nowrap}
.top-actions .writer-upgrade-btn:hover{background:#383838;border-color:#383838;color:#fff}
.top-actions .writer-upgrade-btn:focus-visible{outline:2px solid #777;outline-offset:3px}
.workspace-nav .writer-upgrade-btn{display:inline-flex;align-items:center;justify-content:center;gap:7px;flex:0 0 auto;min-height:32px;height:32px;margin-left:14px;padding:0 15px;border:1px solid #191919;border-radius:999px;background:#191919;color:#fff;text-decoration:none;font:650 12px/1 system-ui,sans-serif;white-space:nowrap;box-shadow:0 2px 7px #0002}
.workspace-nav .writer-upgrade-btn svg{width:16px;height:16px;fill:#ff7a1a;stroke:none;color:#ff7a1a;flex-shrink:0}
.workspace-nav .writer-upgrade-btn:hover{background:#333;border-color:#333;color:#fff}
.workspace-nav .writer-upgrade-btn:focus-visible{outline:2px solid #888;outline-offset:3px}
@media(max-width:700px){.workspace-nav .writer-upgrade-btn{margin-left:8px;padding:0 11px;gap:5px;height:30px;min-height:30px;font-size:11px}}

/* Compact editor actions; retain save state internally without a visible badge. */
.workspace-nav #saveState{display:none}
.workspace-nav .writer-upgrade-btn{margin-left:-19px}
@media(max-width:700px){.workspace-nav .writer-upgrade-btn{margin-left:-15px}}
