.dxe-workspace {
  --dxe-bg: var(--panel, #fff);
  --dxe-paper: #fff;
  --dxe-text: var(--text, #172033);
  --dxe-muted: var(--muted, #64748b);
  --dxe-line: var(--line, #dce3ed);
  --dxe-accent: var(--accent, #415be9);
  width: 100%;
  min-width: 0;
  color: var(--dxe-text);
  font-family: inherit;
}
.dxe-app {
  border: 1px solid var(--dxe-line);
  border-radius: 16px;
  background: var(--dxe-bg);
  overflow: clip;
  min-width: 0;
  box-shadow: 0 8px 32px #16203906;
}
.dxe-app [hidden],
.dxe-workspace [hidden] {
  display: none !important;
}
.dxe-app * {
  box-sizing: border-box;
}
.dxe-app button,
.dxe-app input,
.dxe-app select,
.dxe-app textarea {
  font: inherit;
  line-height: 1.3;
  color: var(--dxe-text);
}
.dxe-app button,
.dxe-app select {
  cursor: pointer;
}
.dxe-app button:disabled {
  opacity: 0.35;
  cursor: default;
}
.dxe-app button:focus-visible,
.dxe-app input:focus-visible,
.dxe-app select:focus-visible,
.dxe-app textarea:focus-visible {
  outline: 3px solid var(--dxe-accent);
  outline-offset: 2px;
}
.dxe-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--dxe-line);
}
.dxe-document-name {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}
.dxe-document-name > svg {
  color: var(--dxe-accent);
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}
.dxe-document-name input {
  width: min(330px, 100%);
  min-width: 60px;
  border: 1px solid transparent;
  background: transparent;
  padding: 7px;
  border-radius: 6px;
  font-weight: 650;
}
.dxe-document-name input:hover {
  border-color: var(--dxe-line);
}
.dxe-local-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--dxe-muted);
  white-space: nowrap;
}
.dxe-local-badge svg {
  width: 15px;
}
.dxe-quick-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}
.dxe-button {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 36px;
  min-height: 36px;
  padding: 7px;
  background: transparent;
  color: var(--dxe-text);
  vertical-align: middle;
  white-space: nowrap;
  text-decoration: none;
}
.dxe-button svg {
  display: block;
  flex-shrink: 0;
}
.dxe-button:hover:not(:disabled) {
  background: var(--accent-soft, #eef2ff);
  border-color: var(--dxe-line);
}
.dxe-button.is-active {
  background: var(--accent-soft, #eef2ff);
  border-color: var(--dxe-accent);
  color: var(--dxe-accent);
}
.dxe-button-label {
  padding-inline: 10px;
  font-size: 12px;
}
.dxe-button.dxe-primary {
  background: var(--dxe-accent);
  color: var(--accent-contrast, #fff);
  border-color: var(--dxe-accent);
  padding-inline: 15px;
  font-weight: 600;
}
.dxe-button.dxe-primary:hover {
  background: var(--dxe-accent);
  filter: brightness(0.95);
}
html[data-theme="dark"] .dxe-button.dxe-primary {
  color: #081727;
}
.dxe-export-menu {
  position: relative;
}
.dxe-menu {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  min-width: 260px;
  background: var(--dxe-bg);
  border: 1px solid var(--dxe-line);
  border-radius: 12px;
  padding: 7px;
  z-index: 80;
  box-shadow: 0 10px 40px #0003;
}
.dxe-menu button {
  width: 100%;
  text-align: start;
  display: flex;
  gap: 10px;
  align-items: center;
  border: 0;
  background: transparent;
  padding: 12px;
  border-radius: 7px;
  font-size: 13px;
}
.dxe-menu button:hover {
  background: var(--accent-soft);
}
.dxe-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: thin;
  border-bottom: 1px solid var(--dxe-line);
  padding: 0 12px;
  white-space: nowrap;
  direction: inherit;
}
.dxe-tabs button {
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
  padding: 12px 13px 10px;
  font-size: 13px;
  font-weight: 550;
  flex-shrink: 0;
}
.dxe-tabs button[aria-selected="true"] {
  border-color: var(--dxe-accent);
  color: var(--dxe-accent);
}
.dxe-ribbon {
  border-bottom: 1px solid var(--dxe-line);
  padding: 10px 12px;
  min-height: 100px;
  background: var(--bg-soft, #f9fbff);
}
.dxe-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-height: 78px;
}
.dxe-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px;
  padding-inline-end: 12px;
  border-inline-end: 1px solid var(--dxe-line);
  min-height: 40px;
}
.dxe-group:last-child {
  border: 0;
}
.dxe-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 10px;
  color: var(--dxe-muted);
  margin-inline-end: 4px;
}
.dxe-field select {
  border: 1px solid var(--dxe-line);
  background: var(--dxe-bg);
  border-radius: 6px;
  padding: 7px;
  max-width: 165px;
  font-size: 12px;
  min-height: 34px;
}
.dxe-field select[data-control="fontSize"] {
  width: 65px;
}
.dxe-color {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 34px;
  padding: 3px;
  cursor: pointer;
}
.dxe-color input {
  appearance: none;
  width: 25px;
  height: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.dxe-color input::-webkit-color-swatch-wrapper {
  padding: 0;
}
.dxe-color input::-webkit-color-swatch {
  border: 0;
  border-radius: 2px;
}
.dxe-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  cursor: pointer;
}
.dxe-check input {
  accent-color: var(--dxe-accent);
  width: 16px;
  height: 16px;
}
.dxe-hint {
  font-size: 12px;
  color: var(--dxe-muted);
  max-width: 480px;
  line-height: 1.6;
  padding: 8px;
}
.dxe-editing-body {
  display: flex;
  min-width: 0;
  height: clamp(460px, 68vh, 960px);
  background: var(--bg-soft, #f2f4f8);
}
.dxe-canvas {
  padding: 22px 14px 46px;
  min-width: 0;
  flex: 1;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  direction: ltr;
  background: linear-gradient(
    135deg,
    var(--bg-soft, #f2f4f8),
    var(--bg, #f8fafc)
  );
}
.dxe-page-wrap {
  position: relative;
  margin-inline: auto;
  flex: none;
  min-width: 0;
}
.dxe-paper {
  box-sizing: border-box;
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: top left;
  background: #fff;
  color: #172033;
  box-shadow: 0 3px 18px #1720331a;
  border: 1px solid #e2e5eb;
  font-family: Arial, sans-serif;
  font-size: 12pt;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.dxe-paper .tiptap {
  outline: none;
  min-height: 650px;
  color: #172033;
  caret-color: #172033;
  position: relative;
  white-space: pre-wrap;
}
.dxe-paper .tiptap p {
  margin: 0 0 8pt;
}
.dxe-paper .tiptap h1,
.dxe-paper .tiptap h2,
.dxe-paper .tiptap h3,
.dxe-paper .tiptap h4,
.dxe-paper .tiptap h5,
.dxe-paper .tiptap h6 {
  color: inherit;
  margin: 16pt 0 8pt;
  line-height: 1.25;
  letter-spacing: normal;
  break-after: avoid;
  font-weight: 700;
}
.dxe-paper h1 {
  font-size: 28pt;
}
.dxe-paper h2 {
  font-size: 22pt;
}
.dxe-paper h3 {
  font-size: 18pt;
}
.dxe-paper h4 {
  font-size: 16pt;
}
.dxe-paper h5 {
  font-size: 14pt;
}
.dxe-paper h6 {
  font-size: 12pt;
}
.dxe-paper ul,
.dxe-paper ol {
  padding-inline-start: 28px;
}
.dxe-paper li {
  margin: 3pt 0;
}
.dxe-paper li p {
  margin-bottom: 0 !important;
}
.dxe-paper ul[data-type="taskList"] {
  list-style: none;
  padding-inline-start: 0;
}
.dxe-paper li[data-type="taskItem"] {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.dxe-paper li[data-type="taskItem"] > div {
  flex: 1;
}
.dxe-paper li[data-type="taskItem"] > label {
  padding-top: 4px;
}
.dxe-paper li[data-type="taskItem"] > label input {
  width: 16px;
  height: 16px;
  accent-color: #415be9;
}
.dxe-paper blockquote {
  margin: 12pt 0;
  border-inline-start: 3px solid #a5b4fc;
  padding-inline-start: 16px;
  color: #475569;
}
.dxe-paper pre {
  font-family: monospace;
  background: #f1f5f9;
  border-radius: 4px;
  padding: 12px;
  white-space: pre-wrap;
}
.dxe-paper a {
  color: #2457b3;
  text-decoration: underline;
  cursor: text;
}
.dxe-paper hr {
  border: 0;
  border-top: 1px solid #94a3b8;
  margin: 12pt 0;
}
.dxe-paper img {
  max-width: 100%;
  height: auto;
  display: block;
  cursor: default;
  margin: 8px 0;
}
.dxe-paper .ProseMirror-selectednode {
  outline: 3px solid #415be9;
}
.dxe-paper .tableWrapper {
  overflow: visible;
  max-width: 100%;
  margin: 14px 0;
}
.dxe-paper table {
  border-collapse: collapse;
  table-layout: fixed;
  margin: 0;
  width: 100%;
  max-width: 100%;
  overflow: visible;
}
.dxe-paper td,
.dxe-paper th {
  min-width: 40px;
  border: 1px solid #94a3b8;
  padding: 7px;
  vertical-align: top;
  position: relative;
  box-sizing: border-box;
}
.dxe-paper th {
  font-weight: bold;
  background: #eef2f7;
  text-align: start;
}
.dxe-paper .selectedCell:after {
  z-index: 2;
  position: absolute;
  inset: 0;
  background: #415be92a;
  content: "";
  pointer-events: none;
}
.dxe-paper .column-resize-handle {
  position: absolute;
  right: -2px;
  top: 0;
  bottom: -2px;
  width: 4px;
  background: #415be9;
  pointer-events: none;
}
.dxe-paper .resize-cursor {
  cursor: col-resize;
}
.dxe-page-header,
.dxe-page-footer {
  white-space: pre-wrap;
  font-size: 10pt;
  color: #64748b;
  min-height: 18px;
}
.dxe-page-header:empty,
.dxe-page-footer:empty {
  display: none;
}
.dxe-page-header {
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 10px;
  margin-bottom: 18px;
}
.dxe-page-footer {
  border-top: 1px solid #e2e8f0;
  padding-top: 10px;
  margin-top: 20px;
}
.dxe-page-break {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-block: 1px dashed #aebdd3;
  margin: 20px 0;
  color: #64748b;
  font:
    10px Arial,
    sans-serif;
  user-select: none;
}
.dxe-comment-mark {
  background: #fff2bf;
  border-bottom: 2px solid #e8b947;
}
.dxe-note-ref {
  color: #3158ad;
  font-weight: 700;
  font-size: 0.7em;
  cursor: help;
}
.dxe-search-match {
  background: #fde68a;
  box-shadow: 0 0 0 1px #d97706;
}
#dxe-footnotes:not(:empty) {
  font-size: 10pt;
  border-top: 1px solid #94a3b8;
  margin-top: 28px;
  padding-top: 10px;
}
.dxe-statusbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  border-top: 1px solid var(--dxe-line);
  font-size: 11px;
  color: var(--dxe-muted);
  min-height: 34px;
}
.dxe-find-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid var(--dxe-line);
}
.dxe-find-panel > input {
  width: 175px;
  min-width: 100px;
  padding: 9px;
  border: 1px solid var(--dxe-line);
  border-radius: 6px;
  background: var(--dxe-bg);
  font-size: 13px;
}
.dxe-find-panel output {
  font-size: 12px;
  color: var(--dxe-muted);
}
.dxe-sidebar {
  width: 260px;
  max-width: 38%;
  flex-shrink: 0;
  border-inline-end: 1px solid var(--dxe-line);
  background: var(--dxe-bg);
  overflow: auto;
  padding: 12px;
  font-size: 13px;
  color: var(--dxe-muted);
}
.dxe-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--dxe-text);
  margin-bottom: 15px;
}
.dxe-outline-link {
  display: block;
  border: 0;
  background: transparent;
  color: var(--dxe-text);
  width: 100%;
  text-align: start;
  padding: 10px;
  border-radius: 6px;
  font-size: 12px;
}
.dxe-outline-link:hover {
  background: var(--accent-soft);
}
.dxe-comment-card {
  padding: 12px;
  border: 1px solid var(--dxe-line);
  border-radius: 8px;
  margin-bottom: 10px;
  background: var(--bg-soft);
}
.dxe-comment-card p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 0 0 8px;
  color: var(--dxe-text);
}
.dxe-notice,
.dxe-draft-offer {
  padding: 9px 14px;
  font-size: 12px;
  line-height: 1.6;
  background: var(--accent-soft);
  color: var(--dxe-text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--dxe-line);
}
.dxe-notice > span {
  flex: 1;
}
.dxe-error {
  background: var(--panel);
  border-inline-start: 4px solid #e35b5b;
}
.dxe-draft-offer > span {
  flex: 1;
}
.dxe-dialog {
  border: 1px solid var(--dxe-line);
  border-radius: 16px;
  background: var(--dxe-bg);
  color: var(--dxe-text);
  padding: 22px;
  width: min(480px, calc(100vw - 24px));
  max-height: 85dvh;
  box-shadow: 0 20px 80px #0005;
}
.dxe-dialog::backdrop {
  background: #07152b80;
  backdrop-filter: blur(3px);
}
.dxe-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.dxe-dialog h2 {
  font-size: 19px;
  margin: 0;
}
.dxe-dialog-fields {
  display: grid;
  gap: 16px;
}
.dxe-dialog-fields label {
  display: grid;
  gap: 8px;
  font-size: 13px;
}
.dxe-dialog input,
.dxe-dialog textarea,
.dxe-dialog select {
  border: 1px solid var(--dxe-line);
  border-radius: 8px;
  padding: 12px;
  min-width: 0;
  width: 100%;
  background: var(--bg);
  color: var(--dxe-text);
}
.dxe-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}
.dxe-dialog-fields p {
  font-size: 14px;
  line-height: 1.7;
}
.dxe-loading {
  min-height: 450px;
  display: grid;
  place-items: center;
  color: var(--muted);
}
.dxe-print-frame {
  position: fixed;
  width: 1px;
  height: 1px;
  inset: 0;
  opacity: 0;
  border: 0;
  pointer-events: none;
}
.dxe-app:fullscreen {
  border: 0;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  overflow: auto;
}
.dxe-app:fullscreen .dxe-editing-body {
  flex: 1;
  height: auto;
  min-height: 200px;
}
@media (min-width: 1500px) {
  .dxe-ribbon {
    min-height: 86px;
  }
  .dxe-panel {
    min-height: 64px;
  }
}
@media (max-width: 800px) {
  .dxe-app {
    border-radius: 10px;
  }
  .dxe-titlebar {
    gap: 5px;
    padding: 9px;
  }
  .dxe-local-badge {
    display: none;
  }
  .dxe-quick-actions > .dxe-button-label span {
    display: none;
  }
  .dxe-quick-actions {
    gap: 1px;
  }
  .dxe-titlebar .dxe-button {
    min-width: 32px;
    padding: 6px;
  }
  .dxe-titlebar .dxe-primary {
    padding: 8px;
  }
  .dxe-document-name {
    gap: 3px;
  }
  .dxe-document-name input {
    font-size: 14px;
  }
  .dxe-ribbon {
    padding: 8px;
    min-height: 115px;
  }
  .dxe-group {
    padding-inline-end: 5px;
  }
  .dxe-panel {
    gap: 5px;
  }
  .dxe-field select {
    max-width: 122px;
  }
  .dxe-tabs {
    padding: 0 4px;
    gap: 0;
  }
  .dxe-tabs button {
    padding: 12px 11px;
    font-size: 12px;
  }
  .dxe-editing-body {
    height: 64dvh;
    min-height: 380px;
  }
  .dxe-sidebar {
    width: 200px;
    max-width: 46%;
  }
  .dxe-find-panel {
    gap: 4px;
  }
  .dxe-find-panel > input {
    flex: 1;
    width: 120px;
  }
  .dxe-draft-offer {
    flex-wrap: wrap;
  }
  .dxe-statusbar {
    font-size: 10px;
    gap: 6px;
  }
  .dxe-statusbar #dxe-save-status {
    max-width: 48%;
    text-align: end;
  }
  .dxe-hint {
    font-size: 11px;
  }
  .dxe-button-label {
    font-size: 11px;
    min-height: 40px;
  }
  .dxe-panel .dxe-button {
    min-height: 38px;
    min-width: 34px;
  }
}
@media (max-width: 420px) {
  .dxe-titlebar {
    flex-wrap: wrap;
  }
  .dxe-document-name {
    flex-basis: 100%;
  }
  .dxe-document-name input {
    width: 100%;
  }
  .dxe-quick-actions {
    margin-inline-start: auto;
  }
  .dxe-ribbon {
    max-height: 220px;
    overflow-y: auto;
  }
  .dxe-sidebar {
    position: absolute;
    z-index: 20;
    max-width: 80%;
    height: 55dvh;
    box-shadow: 0 10px 30px #0003;
  }
  .dxe-canvas {
    padding-inline: 5px;
  }
  .dxe-field select {
    font-size: 12px;
  }
  .dxe-button {
    min-width: 34px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .dxe-app * {
    scroll-behavior: auto !important;
  }
}
/* Revision colors remain readable on the white document in both site themes. */
.dxe-paper .dxe-insertion {
  color: #166534;
  background: #dcfce7;
  text-decoration: underline;
}
.dxe-paper .dxe-deletion {
  color: #991b1b;
  background: #fee2e2;
  text-decoration: line-through;
}
.dxe-ribbon-toggle {
  display: none !important;
}
@media (max-width: 600px) {
  .dxe-ribbon-toggle {
    display: inline-flex !important;
  }
  .dxe-dialog input,
  .dxe-dialog textarea,
  .dxe-dialog select,
  .dxe-find-panel input {
    font-size: 16px !important;
  }
}
/* Explicit paragraph direction, separate from interface-language navigation. */
.dxe-direction-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 10px;
  color: var(--dxe-muted);
}
.dxe-direction-field > div {
  display: flex;
  gap: 3px;
}
.dxe-direction-field .dxe-button {
  font-size: 11px;
  padding: 7px;
  min-height: 34px;
  border-color: var(--dxe-line);
}
.dxe-direction-field .dxe-button svg {
  width: 18px;
  height: 18px;
}
.dxe-tabs [data-tab="file"] {
  color: var(--dxe-accent);
  font-weight: 650;
}
@media (max-width: 800px) {
  .dxe-direction-field {
    order: -1;
    flex-basis: 100%;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    border-bottom: 1px solid var(--dxe-line);
    padding-bottom: 7px;
  }
  .dxe-direction-field > span {
    font-size: 11px;
    font-weight: 600;
    color: var(--dxe-text);
  }
  .dxe-direction-field .dxe-button {
    font-size: 10px;
  }
}
