.docx-editor-vue {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}
.docx-editor-vue__hidden-pm {
  position: fixed;
  left: -9999px;
  top: 0;
  opacity: 0;
  z-index: -1;
  pointer-events: none;
  user-select: none;
  overflow-anchor: none;
}
.docx-editor-vue {
  width: 100%;
}
/* React TitleBar (packages/react/src/components/TitleBar.tsx:333):
   `flex items-stretch bg-white pt-2 pb-1`
   - left col:    `flex items-center flex-shrink-0 pl-3 pr-1`
   - center col:  `flex flex-col justify-center flex-1 min-w-0 py-1`
       top row:   `flex items-center gap-2 px-1`
       menu row:  `flex items-center px-1`
   - right col:   `flex items-center flex-shrink-0 px-3`
*/
/* Wraps title-bar + Toolbar so the white background and the
   subtle drop shadow apply to the whole toolbar block as a unit
   (mirrors React EditorToolbar.tsx:50 `bg-white shadow-sm
   flex-shrink-0`). Without this the doc-bg gray bled between the
   title bar and the toolbar, and there was no visual separation
   between the toolbar and the page area below. */
.docx-editor-vue__toolbar-shell {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: relative;
  /* Above outline toggle/panel (z-index: 40) so title-bar menus stay clickable. */
  z-index: 100;
  /* Token so the chrome follows dark mode (mirrors React's bg-doc-surface). */
  background: var(--doc-surface);
  /* Tailwind shadow-sm: `0 1px 2px 0 rgb(0 0 0 / 0.05)` */
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}
.docx-editor-vue__title-bar {
  display: flex;
  align-items: stretch;
  background: var(--doc-surface);
  padding: 8px 0 4px;
  width: 100%;
  font-family:
    'Google Sans Text',
    system-ui,
    -apple-system,
    sans-serif;
}
.docx-editor-vue__title-bar-left {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  padding: 0 4px 0 12px;
}
.docx-editor-vue__title-bar-right {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 8px;
  padding: 0 12px;
}
.docx-editor-vue__title-bar-center {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
  min-width: 0;
  padding: 4px 0;
}
.docx-editor-vue__title-bar-center > * {
  padding: 0 4px;
}
.docx-editor-vue__title-bar-center .basic-toolbar {
  width: auto;
}
/* Editor scroll container — doc-bg paints the strip between toolbar and
   page. */
.docx-editor-vue__editor-scroll {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--doc-bg);
  overflow: hidden;
}
/* Sticky ruler row that stays at the top while the page scrolls. */
.docx-editor-vue__ruler-row {
  display: flex;
  justify-content: center;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 9;
  padding: 4px 20px;
  background: var(--doc-bg);
}
.docx-editor-vue__editor-area {
  flex: 1;
  display: flex;
  min-height: 0;
  overflow: hidden;
  position: relative; /* anchors the absolutely-positioned vertical ruler */
}
/* Outline toggle — small circular button at the top-left of the
   editor area. `top: 24px` aligns with the page's top edge (the
   pages-viewport's padding-top from `renderPages`); `left: 48px`
   matches React's `OUTLINE_BUTTON_LEFT_OFFSET`. */
.docx-editor-vue__outline-toggle {
  position: absolute;
  top: 24px;
  left: 48px;
  z-index: 40;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #444746;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.docx-editor-vue__outline-toggle:hover {
  background: rgba(60, 64, 67, 0.08);
}
/* Vertical ruler overlays the left edge of the page area instead of
   eating a flex slot — keeping it in flow shifted the page 20px right
   and broke horizontal-ruler/page alignment. Mirrors React's
   `position: absolute, left: 0, paddingTop: 48` placement (24px
   viewport pad + 24px pages-container pad = 48px to align with the
   first page's top edge). */
.docx-editor-vue__vertical-ruler {
  position: absolute;
  left: 0;
  top: 48px;
  z-index: 30;
  pointer-events: auto;
}
.docx-editor-vue__pages-viewport {
  flex: 1;
  overflow-y: auto;
  /* Reserve scrollbar gutter on both sides so the page stays centered
     whether the scrollbar is currently visible or not — without this,
     the page nudges horizontally when content grows past one screen
     and the centered horizontal ruler ends up offset relative to the
     page on first paint. `both-edges` keeps the centering symmetric.
     NOTE: ImageSelectionOverlay's `computeImageOverlayRect` subtracts the
     inline-start gutter as half of `offsetWidth - clientWidth`, which assumes
     `both-edges`. If this ever changes to single-edge `stable`, update that
     math too (issue #764). */
  scrollbar-gutter: stable both-edges;
  /* Breathing room under the last page so it isn't flush against the
     scroll bottom. */
  padding-bottom: 24px;
  background: var(--doc-bg);
  cursor: text;
  position: relative;
}
.docx-editor-vue__pages {
  position: relative;
}

/* Floating "Add comment" button — appears next to the page's right
   edge whenever the user has a non-empty selection. */
.docx-editor-vue__floating-comment {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 50;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--doc-primary);
  background: var(--doc-surface);
  color: var(--doc-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(60, 64, 67, 0.2);
  transition:
    background-color 0.15s ease,
    box-shadow 0.15s ease;
}
.docx-editor-vue__floating-comment:hover {
  background: rgba(26, 115, 232, 0.08);
  box-shadow: 0 1px 4px rgba(26, 115, 232, 0.3);
}

/* Table quick-action insert button. */
.docx-editor-vue__table-insert-btn {
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 1px solid var(--doc-border-light);
  background: var(--doc-bg-input);
  color: var(--doc-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 200;
  padding: 0;
}
.docx-editor-vue__table-insert-btn:hover {
  background: #e8eaed;
}
.docx-editor-vue__loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  color: #64748b;
  font-size: 14px;
}
.docx-editor-vue__error {
  padding: 1rem;
  background: #fef2f2;
  color: #dc2626;
  font-size: 13px;
  border-bottom: 1px solid #fecaca;
}
