/* Broadcast Utility — Document tool */

body.bu-app.doc-tool {
  background: var(--bg, #f4f4f6);
  color: var(--ink, #18181b);
  padding-top: var(--bu-header-h, 52px);
  min-height: 100vh;
  overflow-x: visible;
}

body.bu-app.doc-tool.doc-editing {
  padding-top: 0;
  overflow: hidden;
}

body.bu-app.doc-tool.bu-at-home {
  padding-top: var(--bu-header-h, 52px);
}

/* Header avatar — keep fully visible at right edge */
body.bu-app.doc-tool #bu-header-slot {
  overflow: visible;
}

body.bu-app.doc-tool .bu-app-header,
body.bu-app.doc-tool .bu-site-header.bu-app-header {
  padding-right: 28px;
  overflow: visible;
  box-sizing: border-box;
}

body.bu-app.doc-tool .bu-header-right {
  flex-shrink: 0;
  margin-left: auto;
  padding-right: 6px;
  overflow: visible;
}

body.bu-app.doc-tool #bu-user-area {
  flex-shrink: 0;
  overflow: visible;
}

body.bu-app.doc-tool #bu-user-area .bu-user-pill {
  flex-shrink: 0;
  overflow: visible;
  margin-right: 2px;
  box-sizing: border-box;
}

/* ── Home ── */
.doc-home-wrap {
  min-height: calc(100vh - 52px);
}

body.doc-tool.bu-at-home #doc-recent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(214px, 1fr));
  gap: 18px;
}

body.doc-tool.bu-at-home #doc-recent-grid .doc-card {
  position: relative;
  background: #fff;
  border: 1px solid var(--bdr2, rgba(17, 24, 39, 0.11));
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.12s, box-shadow 0.12s, transform 0.12s;
}

body.doc-tool.bu-at-home #doc-recent-grid .doc-card:hover {
  border-color: var(--bdr3, rgba(17, 24, 39, 0.17));
  box-shadow: var(--shadow, 0 1px 2px rgba(17, 24, 39, 0.04), 0 6px 18px rgba(17, 24, 39, 0.07));
  transform: translateY(-1px);
}

body.doc-tool.bu-at-home #doc-recent-grid .doc-card-open {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: left;
  width: 100%;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  color: #18181b;
}

body.doc-tool.bu-at-home #doc-recent-grid .doc-card-thumb {
  display: block;
  height: 72px;
  border-bottom: 1px solid var(--bdr, rgba(17, 24, 39, 0.07));
  background: var(--bg3, #f5f5f7)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='1.4'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3Cline x1='16' y1='13' x2='8' y2='13'/%3E%3Cline x1='16' y1='17' x2='8' y2='17'/%3E%3C/svg%3E")
    center/40px no-repeat;
}

body.doc-tool.bu-at-home #doc-recent-grid .doc-card-body {
  display: block;
  padding: 11px 13px 13px;
}

body.doc-tool.bu-at-home #doc-recent-grid .doc-card-name {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #18181b;
  letter-spacing: -0.01em;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 22px;
}

body.doc-tool.bu-at-home #doc-recent-grid .doc-card-meta {
  display: block;
  font-size: 12px;
  color: #6b7280;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 24px;
}

body.doc-tool.bu-at-home #doc-recent-grid .doc-card-menu-btn {
  position: absolute;
  right: 8px;
  bottom: 10px;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  border: 0;
  background: transparent;
  color: #6b7280;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

body.doc-tool.bu-at-home #doc-recent-grid .doc-card-menu-btn:hover {
  background: var(--bg4, #ececef);
  color: #18181b;
}

body.doc-tool.bu-at-home #doc-recent-grid > p.muted,
body.doc-tool.bu-at-home #doc-recent-grid > p {
  color: #6b7280 !important;
  grid-column: 1 / -1;
}

.doc-floatmenu {
  position: fixed;
  z-index: 9999;
  background: #fff;
  border: 1px solid var(--bdr2);
  border-radius: 10px;
  box-shadow: var(--shadow-lift, 0 12px 40px rgba(17, 24, 39, 0.16));
  padding: 5px;
  min-width: 168px;
  font-family: var(--font, inherit);
}

.doc-floatmenu-item {
  padding: 8px 12px;
  font-size: 13px;
  color: var(--ink2, #3f3f46);
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}

.doc-floatmenu-item:hover {
  background: var(--bg3, #f5f5f7);
  color: var(--ink, #18181b);
}

.doc-floatmenu-item.is-danger {
  color: var(--red, #dc2626);
}

.doc-floatmenu-item.is-danger:hover {
  background: rgba(220, 38, 38, 0.08);
}

/* Editable page headers */
.doc-sheet-pagehead--edit {
  gap: 12px;
}

.doc-ph-inp {
  border: 1px solid transparent;
  background: transparent;
  font: inherit;
  color: inherit;
  padding: 4px 6px;
  border-radius: 6px;
  min-width: 0;
  line-height: 1.3;
}

.doc-ph-inp--co {
  font-weight: 600;
  font-size: 11px;
  color: #333;
  flex: 1;
}

.doc-ph-inp--title {
  font-size: 11px;
  color: #666;
  text-align: right;
  max-width: 48%;
}

.doc-ph-inp:focus {
  outline: none;
  border-color: var(--accent);
  background: #fef9c3;
}

.doc-ph-logo-btn {
  border: 1px dashed var(--bdr2);
  background: var(--bg3);
  border-radius: 6px;
  padding: 4px 8px;
  cursor: pointer;
  flex-shrink: 0;
  min-width: 52px;
  min-height: 36px;
  max-width: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.doc-ph-logo-btn:hover {
  border-color: var(--accent);
  background: #fff;
}

.doc-ph-logo-placeholder {
  font-size: 10px;
  font-weight: 600;
  color: var(--ink3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Editor chrome ── */
#doc-app {
  display: flex;
  flex-direction: column;
  background: #e8e8ec;
}

#doc-app:not([hidden]) {
  position: fixed;
  top: var(--bu-header-h, 52px);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  height: auto;
}

#doc-app[hidden] {
  display: none !important;
}

.doc-titlebar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  height: 40px;
  background: #fff;
  border-bottom: 1px solid var(--bdr, rgba(17, 24, 39, 0.08));
  flex-shrink: 0;
}

.doc-titlebar-back {
  border: 0;
  background: transparent;
  color: var(--ink2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 6px;
}

.doc-titlebar-back:hover {
  background: var(--bg3);
}

.doc-titlebar-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.doc-titlebar-status {
  font-size: 12px;
  color: var(--ink4);
  flex-shrink: 0;
  padding-right: 12px;
}

.doc-titlebar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto;
}

.doc-titlebar-btn {
  height: 32px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--bdr2);
  background: #fff;
  color: var(--ink2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.doc-titlebar-btn:hover {
  border-color: var(--bdr3);
  color: var(--ink);
  background: var(--bg3);
}

.doc-titlebar-btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.doc-titlebar-btn--primary:hover {
  background: var(--accent2);
  border-color: var(--accent2);
  color: #fff;
}

/* Ribbon */
.doc-ribbon {
  background: #fff;
  border-bottom: 1px solid var(--bdr);
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

.doc-ribbon-tabs {
  display: flex;
  gap: 0;
  padding: 0 12px;
  border-bottom: 1px solid var(--bdr);
  flex-shrink: 0;
  min-height: 36px;
  align-items: stretch;
  background: #fff;
}

.doc-rib-tab {
  height: 36px;
  padding: 0 14px;
  border: 0;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink3);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.doc-rib-tab:hover {
  color: var(--ink);
  background: var(--bg3);
}

.doc-rib-tab.is-on {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.doc-ribbon-panel {
  display: none;
  padding: 10px 16px;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  min-height: 52px;
}

.doc-ribbon-panel.is-on {
  display: flex;
}

.doc-rib-group {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-right: 12px;
  margin-right: 8px;
  border-right: 1px solid var(--bdr);
}

.doc-rib-group:last-child {
  border-right: 0;
  margin-right: 0;
  padding-right: 0;
}

.doc-rib-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 52px;
  height: 48px;
  padding: 4px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink2);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
}

.doc-rib-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
}

.doc-rib-btn:hover {
  background: var(--bg3);
  color: var(--ink);
}

.doc-rib-btn.is-on {
  background: var(--accentDim);
  color: var(--accent);
}

.doc-rib-btn--primary {
  background: var(--accent);
  color: #fff;
  min-width: auto;
  height: 36px;
  padding: 0 16px;
  flex-direction: row;
  font-size: 13px;
}

.doc-rib-btn--primary:hover {
  background: var(--accent2);
  color: #fff;
}

.doc-rib-btn span {
  line-height: 1;
}

.doc-rib-group--text {
  align-items: flex-end;
  gap: 6px;
}

.doc-rib-select {
  height: 32px;
  border: 1px solid var(--bdr2);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
  padding: 0 8px;
  font-family: inherit;
  cursor: pointer;
}

.doc-rib-select--font {
  min-width: 118px;
}

.doc-rib-select--size {
  width: 64px;
  margin-right: 2px;
}

.doc-rib-colorpick {
  position: relative;
  display: inline-flex;
}

.doc-rib-colorpick-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 8px 0 6px;
  border: 1px solid var(--bdr2);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.doc-rib-colorpick-btn:hover {
  border-color: var(--accent);
  background: var(--bg3);
}

.doc-rib-colorpick-swatch {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
  background: #1a1a1a;
}

.doc-rib-colorpick-swatch.is-empty {
  background: linear-gradient(135deg, #fff 45%, #ccc 45%, #ccc 55%, #fff 55%);
}

.doc-rib-colorpick-text {
  max-width: 88px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.doc-rib-colorpick-chevron {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  color: var(--ink3);
}

.doc-rib-colorpick-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 50;
  min-width: 188px;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--bdr2);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.doc-rib-colorpick-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  margin: 6px 0;
}

.doc-rib-swatch-opt {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 6px;
  cursor: pointer;
}

.doc-rib-swatch-opt:hover {
  transform: scale(1.06);
}

.doc-rib-swatch-opt.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px #fff inset;
}

.doc-rib-colorpick-row {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 12px;
  color: var(--ink2);
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
}

.doc-rib-colorpick-row:hover {
  background: var(--bg3);
}

.doc-rib-colorpick-row.is-selected {
  background: var(--accentDim);
  color: var(--accent);
  font-weight: 600;
}

.doc-rib-colorpick-row--none.is-selected {
  background: var(--bg3);
  color: var(--ink);
}

.doc-rib-lbl {
  font-size: 10px;
  font-weight: 600;
  color: var(--ink4);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 4px;
}

.doc-rib-colors {
  display: flex;
  gap: 3px;
  align-items: center;
  margin-right: 8px;
}

.doc-swatch {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  cursor: pointer;
  padding: 0;
}

.doc-swatch:hover {
  transform: scale(1.1);
}

.doc-rib-btn--primary {
  background: var(--accent);
  color: #fff;
  min-width: auto;
  height: 36px;
  padding: 0 16px;
  flex-direction: row;
  font-size: 13px;
}

.doc-rib-btn--primary:hover {
  background: var(--accent2);
  color: #fff;
}

.doc-rib-color-inp {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--bdr2);
  border-radius: 6px;
  cursor: pointer;
  background: transparent;
}

.doc-rib-dd {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  margin-right: 8px;
}

.doc-rib-dd-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--ink4);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.doc-rib-select--color {
  min-width: 118px;
}

.doc-rib-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink2);
  cursor: pointer;
  user-select: none;
  padding: 6px 4px;
}

.doc-rib-check input {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
}

.doc-rib-group--layout {
  align-items: center;
  padding-left: 8px;
  border-left: 1px solid var(--bdr);
}

/* Workspace */
.doc-main {
  flex: 1;
  display: flex;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

.doc-canvas-wrap {
  flex: 1;
  overflow: auto;
  padding: 28px 20px 56px;
  --doc-zoom: 1;
}

.doc-page-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  transform: scale(var(--doc-zoom));
  transform-origin: top center;
  margin: 0 auto;
  width: fit-content;
}

.doc-zoom-bar {
  position: absolute;
  right: 28px;
  bottom: 22px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: #fff;
  border: 1px solid var(--bdr2);
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  font-size: 12px;
  color: var(--ink2);
}

.doc-zoom-bar-label {
  font-weight: 600;
  white-space: nowrap;
}

.doc-zoom-slider {
  width: 120px;
  accent-color: var(--accent);
  cursor: pointer;
}

.doc-zoom-bar-value {
  min-width: 38px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--ink);
}

/* Document sheets (pages on canvas) — 8.5×11 at 96dpi */
.doc-sheet {
  width: 816px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 12px 40px rgba(0, 0, 0, 0.06);
  border: 1px solid #d4d4d8;
  box-sizing: border-box;
  position: relative;
  color: #1a1a1a;
}

.doc-sheet--body,
.doc-sheet--content {
  height: var(--doc-page-h, 1056px);
  max-height: var(--doc-page-h, 1056px);
  min-height: var(--doc-page-h, 1056px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  --doc-page-w: 816px;
  --doc-page-h: 1056px;
  --doc-margin: 96px;
  --doc-content-w: 624px;
}

.doc-page-content-area {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 0 var(--doc-margin, 96px);
  box-sizing: border-box;
}

.doc-page-bottom {
  flex-shrink: 0;
  height: var(--doc-margin, 96px);
  position: relative;
  pointer-events: none;
}

.doc-sheet-pagenum {
  position: absolute;
  right: var(--doc-margin, 96px);
  bottom: 28px;
  font-size: 11px;
  color: #888;
  pointer-events: none;
  user-select: none;
}

.doc-sheet--cover,
.doc-sheet--lineitems,
.doc-sheet--schedule {
  min-height: 1056px;
}

.doc-sheet-label {
  position: absolute;
  top: -22px;
  left: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink3);
}

.doc-sheet-head {
  position: absolute;
  top: -26px;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
}

.doc-sheet-head .doc-sheet-label {
  position: static;
}

.doc-sheet-del {
  pointer-events: auto;
  border: 1px solid var(--bdr2);
  background: #fff;
  color: var(--ink3);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}

.doc-sheet-del:hover {
  background: #fee2e2;
  border-color: #fecaca;
  color: var(--red, #c0392b);
}

.doc-sheet-pagehead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
  width: 100%;
  font-size: 11px;
  line-height: 1.3;
  color: #666;
  border-bottom: 1px solid #ddd;
  padding: 0 0 8px;
  margin: 0;
  box-sizing: border-box;
}

.doc-page-margin-top {
  flex-shrink: 0;
  height: var(--doc-margin, 96px);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  box-sizing: border-box;
  padding: 14px var(--doc-margin, 96px) 0;
  overflow: visible;
}

.doc-ph-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
  overflow: visible;
}

.doc-ph-logo {
  max-height: 36px;
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}

.doc-ph-co {
  font-weight: 600;
  color: #333;
}

.doc-ph-title {
  text-align: right;
  flex-shrink: 0;
  margin-left: auto;
}

.doc-sheet-heading {
  font-size: 1.35em;
  /* Inset to match the table so the underline is only as wide as the table. */
  margin: 16px 62px 0;
  padding: 0 0 8px;
  color: var(--doc-primary, #1e2d5a);
  border-bottom: 3px solid var(--doc-primary, #1e2d5a);
}

/* Cover sheet */
.doc-sheet--cover {
  color: #fff;
  overflow: hidden;
}

.doc-sheet--cover .doc-cover-overlay {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.doc-sheet--cover .doc-cover-edit {
  position: relative;
  z-index: 1;
  /* border-box so the 48px padding stays inside one page (was overflowing the
     PDF page, clipping the bottom cover text). */
  box-sizing: border-box;
  height: 1056px;
  min-height: 1056px;
  max-height: 1056px;
  display: flex;
  flex-direction: column;
  padding: 48px 56px;
  overflow: hidden;
}

.doc-sheet--cover.layout-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 0;
  color: #1a1a1a;
}

.doc-cover-side {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  height: 1056px;
  min-height: 1056px;
  max-height: 1056px;
  padding: 40px;
  overflow: hidden;
}

.doc-cover-panel {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 48px 40px;
  box-sizing: border-box;
  height: 1056px;
  min-height: 1056px;
  max-height: 1056px;
  overflow: hidden;
  background: #fff;
}

.doc-cover-panel--light .doc-cover-input {
  background: var(--bg3);
  color: var(--ink);
  border-color: var(--bdr);
}

.doc-cover-panel--light .doc-sheet-mini-btn {
  border-color: var(--bdr2);
  background: var(--bg3);
  color: var(--ink2);
}

.doc-sheet--cover.layout-banner .doc-cover-banner {
  background: var(--doc-cover);
  margin: -48px -56px 0;
  padding: 32px 56px;
}

.doc-sheet--cover.layout-banner .doc-cover-body {
  padding-top: 24px;
}

.doc-sheet--cover.layout-minimal .doc-cover-edit--center {
  justify-content: center;
  text-align: center;
  align-items: center;
}

.doc-sheet--cover.layout-minimal .doc-cover-top,
.doc-sheet--cover.layout-minimal .doc-cover-meta {
  text-align: center;
}

.doc-cover-logo {
  max-height: 52px;
  max-width: 180px;
  object-fit: contain;
}

.doc-sheet--cover.layout-split .doc-cover-overlay,
.doc-sheet--cover.layout-split .doc-cover-edit {
  display: none;
}

.doc-sheet--cover.layout-split::before {
  display: none;
}

.doc-cover-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: auto;
}

.doc-cover-meta {
  text-align: right;
  font-size: 12px;
  line-height: 1.7;
  opacity: 0.9;
}

.doc-cover-fields {
  margin-top: auto;
}

.doc-cover-kicker {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.75;
  margin-bottom: 8px;
}

.doc-cover-input {
  display: block;
  width: 100%;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.12);
  color: inherit;
  font: inherit;
  padding: 6px 8px;
  border-radius: 6px;
  margin-bottom: 8px;
}

.doc-sheet--cover.layout-split .doc-cover-input {
  background: var(--bg3);
  color: var(--ink);
  border-color: var(--bdr);
}

.doc-cover-input--lg {
  font-size: 28px;
  font-weight: 700;
}

.doc-cover-input--title {
  font-size: 20px;
}

.doc-cover-input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.2);
}

.doc-cover-tools {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
  font-size: 12px;
}

.doc-cover-tool {
  display: flex;
  align-items: center;
  gap: 8px;
}

.doc-sheet-mini-btn {
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.2);
  color: #fff;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
}

/* Body / Tiptap — shared with static preview/export prose */
.doc-sheet--body .ProseMirror,
.doc-sheet--body .doc-tiptap-inner,
.doc-sheet--body .doc-prose-static {
  height: 100%;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
  padding: 0;
  outline: none;
  line-height: 1.7;
  font-size: 14px;
  color: #1a1a1a;
  box-sizing: border-box;
}

.doc-sheet--body .ProseMirror p,
.doc-sheet--body .doc-prose-static p {
  min-height: 1.7em;
  margin: 0;
}

.doc-sheet--body .ProseMirror p + p,
.doc-sheet--body .doc-prose-static p + p {
  margin-top: 0.35em;
}

.doc-sheet--body .ProseMirror ul,
.doc-sheet--body .ProseMirror ol,
.doc-sheet--body .doc-prose-static ul,
.doc-sheet--body .doc-prose-static ol {
  margin: 0.35em 0;
  padding-left: 1.5em;
  list-style-position: outside;
}

.doc-sheet--body .ProseMirror ul,
.doc-sheet--body .doc-prose-static ul {
  list-style-type: disc;
  padding-left: 1.625em;
}

.doc-sheet--body .ProseMirror ol,
.doc-sheet--body .doc-prose-static ol {
  list-style-type: decimal;
  padding-left: 2em;
}

.doc-sheet--body .ProseMirror li,
.doc-sheet--body .doc-prose-static li {
  display: list-item;
  margin: 0;
  padding: 0;
}

.doc-sheet--body .ProseMirror li > p,
.doc-sheet--body .doc-prose-static li > p {
  margin: 0;
  min-height: 1.7em;
}

.doc-sheet--body .ProseMirror li > p + p,
.doc-sheet--body .doc-prose-static li > p + p {
  margin-top: 0.35em;
}

.doc-sheet--body .ProseMirror li ul,
.doc-sheet--body .ProseMirror li ol,
.doc-sheet--body .doc-prose-static li ul,
.doc-sheet--body .doc-prose-static li ol {
  margin: 0.35em 0 0;
}

.doc-sheet--body .ProseMirror blockquote,
.doc-sheet--body .doc-prose-static blockquote {
  margin: 0.5em 0;
  padding-left: 1em;
  border-left: 3px solid var(--doc-primary, #1e2d5a);
}

.doc-pagination-measure {
  position: absolute;
  left: -10000px;
  top: 0;
  visibility: hidden;
  pointer-events: none;
  overflow: hidden;
  display: flow-root;
  padding: 0;
  line-height: 1.7;
  font-size: 14px;
  box-sizing: border-box;
  color: #1a1a1a;
}

.doc-pagination-measure p {
  min-height: 1.7em;
  margin: 0;
}

.doc-pagination-measure p + p {
  margin-top: 0.35em;
}

.doc-pagination-measure ul,
.doc-pagination-measure ol {
  margin: 0.35em 0;
  padding-left: 0;
  list-style-position: outside;
}

.doc-pagination-measure ul {
  list-style-type: disc;
  padding-left: 1.625em;
}

.doc-pagination-measure ol {
  list-style-type: decimal;
  padding-left: 2em;
}

.doc-pagination-measure li {
  display: list-item;
  margin: 0;
  padding: 0;
}

.doc-pagination-measure li > p {
  margin: 0;
  min-height: 1.7em;
}

.doc-pagination-measure li > p + p {
  margin-top: 0.35em;
}

.doc-pagination-measure blockquote {
  margin: 0.5em 0;
  padding-left: 1em;
  border-left: 3px solid var(--doc-primary, #1e2d5a);
}

.doc-pagination-measure h1 {
  font-size: 1.75em;
  margin: 0 0 0.5em;
  color: var(--doc-primary, #1e2d5a);
}

.doc-pagination-measure h2 {
  font-size: 1.35em;
  margin: 1.2em 0 0.4em;
  color: var(--doc-primary, #1e2d5a);
}

.doc-pagination-measure h3 {
  font-size: 1.15em;
  margin: 1em 0 0.35em;
  color: var(--doc-primary, #1e2d5a);
}

.doc-pagination-measure img {
  max-width: 100%;
  height: auto;
}

.doc-sheet--body .ProseMirror h1,
.doc-sheet--body .doc-prose-static h1 {
  font-size: 1.75em;
  margin: 0 0 0.5em;
  color: var(--doc-primary, #1e2d5a);
}

.doc-sheet--body .ProseMirror h2,
.doc-sheet--body .doc-prose-static h2 {
  font-size: 1.35em;
  margin: 1.2em 0 0.4em;
  color: var(--doc-primary, #1e2d5a);
}

.doc-sheet--body .ProseMirror h3,
.doc-sheet--body .doc-prose-static h3 {
  font-size: 1.15em;
  margin: 1em 0 0.35em;
  color: var(--doc-primary, #1e2d5a);
}

.doc-sheet--body .ProseMirror img,
.doc-sheet--body .doc-prose-static img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

.doc-img-node {
  display: flex;
  margin: 1em 0;
  user-select: none;
  position: relative;
}

.doc-img-node[data-align='left'] {
  justify-content: flex-start;
}

.doc-img-node[data-align='center'] {
  justify-content: center;
}

.doc-img-node[data-align='right'] {
  justify-content: flex-end;
}

.doc-img-frame {
  position: relative;
  display: inline-block;
  max-width: 100%;
  line-height: 0;
  cursor: grab;
  touch-action: none;
  border-radius: 2px;
  box-sizing: border-box;
}

.doc-img-frame.is-dragging {
  cursor: grabbing;
  opacity: 0.92;
}

.doc-img-frame img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  pointer-events: none;
}

.doc-img-node.ProseMirror-selectednode .doc-img-frame {
  box-shadow: 0 0 0 2px var(--accent, #2563eb);
}

.doc-img-handle {
  position: absolute;
  right: -5px;
  bottom: -5px;
  width: 14px;
  height: 14px;
  background: var(--accent, #2563eb);
  border: 2px solid #fff;
  border-radius: 3px;
  cursor: nwse-resize;
  opacity: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.doc-img-node.ProseMirror-selectednode .doc-img-handle {
  opacity: 1;
}

.doc-sheet--body .ProseMirror mark,
.doc-sheet--body .doc-prose-static mark {
  border-radius: 2px;
  padding: 0 2px;
}

.doc-sheet--body .ProseMirror a,
.doc-sheet--body .doc-prose-static a {
  color: var(--doc-accent, var(--doc-primary));
  text-decoration: underline;
}

.doc-sheet--body .ProseMirror p.is-editor-empty:first-child::before {
  color: #9ca3af;
  content: attr(data-placeholder);
  float: left;
  height: 0;
  pointer-events: none;
}

/* Manual page break (Umo-style) — paginate only at export/print */
.doc-sheet--body .ProseMirror .doc-page-break,
.doc-prose-static .doc-page-break {
  display: block;
  width: 100%;
  height: 1px;
  background: #d4d4d8;
  break-before: page;
  margin: 30px 0 !important;
  position: relative;
  user-select: none;
}

.doc-sheet--body .ProseMirror .doc-page-break::after,
.doc-prose-static .doc-page-break::after {
  content: attr(data-content);
  font-size: 10px;
  border: 1px solid #d4d4d8;
  padding: 1px 8px;
  border-radius: 2px;
  background: #fff;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: #888;
}

.doc-sheet--body.layout-wide .doc-page-margin-top,
.doc-sheet--body.layout-wide .doc-page-content-area {
  padding-left: 72px;
  padding-right: 72px;
}

.doc-sheet--body.layout-wide .doc-sheet-pagehead {
  padding-left: 0;
  padding-right: 0;
}

.doc-sheet--body.layout-sidebar {
  display: grid;
  grid-template-columns: 120px 1fr;
  padding: 0;
}

.doc-sheet--body.layout-sidebar::before {
  content: '';
  background: var(--doc-billbox, #f5f5f5);
  border-right: 1px solid var(--doc-sect-border, #ddd);
  grid-row: 1 / -1;
}

.doc-sheet--body.layout-sidebar .doc-sheet-head {
  grid-column: 1 / -1;
}

.doc-sheet--body.layout-sidebar .doc-page-margin-top,
.doc-sheet--body.layout-sidebar .doc-sheet-pagehead,
.doc-sheet--body.layout-sidebar .doc-page-content-area,
.doc-sheet--body.layout-sidebar .doc-page-bottom {
  grid-column: 2;
}

.doc-sheet--body.head-underline .ProseMirror h2,
.doc-sheet--body.head-underline .doc-prose-static h2 {
  border-bottom: 1px solid var(--doc-sect-border, #ddd);
  padding-bottom: 4px;
}

.doc-sheet--body.head-bar .ProseMirror h2,
.doc-sheet--body.head-bar .doc-prose-static h2 {
  border-bottom: 3px solid var(--doc-primary, #1e2d5a);
  padding-bottom: 6px;
}

.doc-sheet--body.head-minimal .doc-sheet-pagehead {
  border-bottom: 0;
  color: #999;
}

/* Line items & schedule sheets */
.doc-sheet--lineitems,
.doc-sheet--schedule {
  padding-bottom: 48px;
}

.doc-inline-table {
  width: calc(100% - 124px);
  margin: 16px 62px;
  border-collapse: collapse;
  font-size: 13px;
}

.doc-inline-table th,
.doc-inline-table td {
  border: 1px solid #ddd;
  padding: 6px 8px;
  text-align: left;
  vertical-align: middle;
}

.doc-inline-table th {
  background: var(--doc-billbox, #f5f5f5);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--ink3);
}

.doc-inline-table input {
  width: 100%;
  border: 0;
  background: transparent;
  font: inherit;
  padding: 4px 2px;
  outline: none;
}

.doc-inline-table input:focus {
  background: #fef9c3;
  border-radius: 4px;
}

.doc-li-line-total {
  text-align: right;
  font-weight: 600;
  white-space: nowrap;
}

.doc-row-del {
  border: 0;
  background: transparent;
  color: var(--ink4);
  font-size: 18px;
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 6px;
}

.doc-row-del:hover {
  background: #fee2e2;
  color: var(--red);
}

.doc-empty-row td {
  text-align: center;
  color: var(--ink4);
  font-style: italic;
  padding: 24px;
}

.doc-sheet-add {
  margin: 8px 62px 0;
  padding: 8px 14px;
  border: 1px dashed var(--bdr2);
  border-radius: 8px;
  background: var(--bg3);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  width: calc(100% - 124px);
}

.doc-est-fin {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 20px 62px 0;
  padding-top: 16px;
  border-top: 1px solid var(--bdr);
}

.doc-est-fin label {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink3);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.doc-est-fin input {
  padding: 6px 8px;
  border: 1px solid var(--bdr2);
  border-radius: 6px;
  font-size: 13px;
}

.doc-est-totals {
  max-width: 260px;
  margin: 16px 62px 0 auto;
  font-size: 13px;
}

.doc-est-totals > div {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
}

.doc-est-grand {
  border-top: 2px solid #333;
  margin-top: 8px;
  padding-top: 8px;
  font-weight: 700;
}

/* Old single-page (removed) */
.doc-page {
  width: 816px;
  min-height: 1056px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 12px 40px rgba(0, 0, 0, 0.06);
  border: 1px solid #d4d4d8;
  box-sizing: border-box;
}

.doc-page .ProseMirror,
.doc-page .doc-tiptap-inner {
  min-height: 980px;
  padding: 53px 62px;
  outline: none;
  line-height: 1.7;
  font-size: 14px;
  color: #1a1a1a;
}

.doc-page .ProseMirror h1 {
  font-size: 1.75em;
  margin: 0 0 0.5em;
  color: var(--doc-primary, #1e2d5a);
}

.doc-page .ProseMirror h2 {
  font-size: 1.35em;
  margin: 1.2em 0 0.4em;
  color: var(--doc-primary, #1e2d5a);
}

.doc-page .ProseMirror img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

.doc-page .ProseMirror p.is-editor-empty:first-child::before {
  color: #9ca3af;
  content: attr(data-placeholder);
  float: left;
  height: 0;
  pointer-events: none;
}

/* Side panel */
.doc-panel {
  width: 380px;
  max-width: 42vw;
  background: #fff;
  border-left: 1px solid var(--bdr);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.doc-panel[hidden] {
  display: none !important;
}

.doc-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--bdr);
}

.doc-panel-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}

.doc-panel-close {
  border: 0;
  background: var(--bg3);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
}

.doc-panel-body {
  flex: 1;
  overflow: auto;
  padding: 16px;
}

.doc-field {
  margin-bottom: 14px;
}

.doc-field label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink3);
  margin-bottom: 6px;
}

.doc-field input,
.doc-field select,
.doc-field textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--bdr2);
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  color: var(--ink);
}

.doc-field textarea {
  min-height: 80px;
  resize: vertical;
}

/* Template grid */
.doc-tpl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.doc-tpl-card {
  border: 1px solid var(--bdr2);
  border-radius: 10px;
  padding: 8px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  font: inherit;
}

.doc-tpl-card.on {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accentDim);
}

.doc-tpl-card .tpl-prev {
  height: 56px;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 8px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
}

.doc-tpl-card .tpl-prev-bar {
  height: 12px;
  flex-shrink: 0;
}

.doc-tpl-card .tpl-prev-body {
  flex: 1;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.doc-tpl-card .tpl-prev-body span,
.doc-tpl-card .tpl-prev-body b {
  display: block;
  height: 4px;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.1);
}

.doc-tpl-card .tpl-prev-body span:first-child,
.doc-tpl-card .tpl-prev-body b {
  height: 5px;
  width: 70%;
}

.tpl-prev--split {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.tpl-prev--minimal {
  align-items: center;
  justify-content: center;
  background: #fff;
}

.tpl-prev-page {
  height: 18px;
  margin-top: 4px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 4px;
  padding: 4px 6px;
}

.tpl-prev-page--side {
  display: grid;
  grid-template-columns: 22px 1fr;
  padding: 0;
  overflow: hidden;
}

.tpl-prev-page--side i {
  display: block;
  height: 100%;
}

.doc-tpl-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}

.doc-tpl-desc {
  font-size: 11px;
  color: var(--ink3);
  margin-top: 2px;
}

/* Line items table */
.doc-li-row {
  display: grid;
  grid-template-columns: 1fr 1fr 64px 72px 36px;
  gap: 8px;
  margin-bottom: 8px;
  align-items: start;
}

.doc-li-row input {
  padding: 6px 8px;
  border: 1px solid var(--bdr2);
  border-radius: 6px;
  font-size: 13px;
}

.doc-li-add {
  margin-top: 8px;
  padding: 8px 14px;
  border: 1px dashed var(--bdr2);
  border-radius: 8px;
  background: var(--bg3);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  width: 100%;
}

/* Schedule */
.doc-ms-row {
  display: grid;
  grid-template-columns: 1fr 120px 36px;
  gap: 8px;
  margin-bottom: 8px;
}

.doc-ms-row input {
  padding: 6px 8px;
  border: 1px solid var(--bdr2);
  border-radius: 6px;
  font-size: 13px;
}

/* Modal */
.doc-modal-bg {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(17, 24, 39, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.doc-modal-bg[hidden] {
  display: none !important;
}

.doc-modal {
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow: auto;
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--shadow-lift);
  padding: 22px;
}

.doc-modal h2 {
  margin: 0 0 16px;
  font-size: 18px;
}

.doc-type-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.doc-type-opt {
  padding: 12px;
  border: 1px solid var(--bdr2);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  font: inherit;
}

.doc-type-opt.on {
  border-color: var(--accent);
  background: var(--accentDim);
}

.doc-type-opt strong {
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
}

.doc-type-opt span {
  font-size: 11px;
  color: var(--ink3);
}

.doc-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--bdr);
}

.doc-btn {
  height: 36px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid var(--bdr2);
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.doc-btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Preview */
.doc-preview-bg {
  position: fixed;
  inset: 0;
  z-index: 2500;
  background: #c4c4c8;
  overflow: auto;
}

.doc-preview-bg[hidden] {
  display: none !important;
}

.doc-preview-toolbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid var(--bdr);
  backdrop-filter: blur(8px);
}

.doc-preview-inner {
  padding: 0;
  min-height: calc(100vh - 52px);
}

.doc-preview-frame {
  display: block;
  width: 100%;
  min-height: calc(100vh - 52px);
  border: 0;
  background: #e8e8ec;
}

.doc-preview-pages {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

@media screen and (max-width: 900px) {
  .doc-sheet {
    width: 100%;
  }

  .doc-sheet--cover,
  .doc-sheet--lineitems,
  .doc-sheet--schedule {
    min-height: 70vh;
  }

  .doc-inline-table,
  .doc-sheet-add,
  .doc-est-fin,
  .doc-est-totals,
  .doc-sheet-pagehead,
  .doc-sheet-heading {
    margin-left: 20px;
    margin-right: 20px;
    width: calc(100% - 40px);
  }

  .doc-sheet--body .ProseMirror,
  .doc-sheet--body .doc-tiptap-inner {
    padding: 20px 24px 40px;
  }

  .doc-panel {
    position: fixed;
    inset: 52px 0 0 0;
    width: 100%;
    max-width: none;
    z-index: 200;
  }
}

/* ── Continuous single-editor page flow ──────────────────────────── */
/* The body is one editor flowing over a stack of page-background sheets.
   Page boundaries are drawn visually by the live pagination plugin. */
.doc-sheet--flow {
  background: transparent;
  border: 0;
  box-shadow: none;
  height: auto;
  min-height: 0;
  max-height: none;
  overflow: visible;
  display: block;
  padding: 0;
  width: var(--doc-page-w, 816px);
}

.doc-flow {
  position: relative;
  width: var(--doc-page-w, 816px);
  min-height: var(--doc-page-h, 1056px);
  margin: 0 auto;
}

.doc-flow-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.doc-flow-page {
  position: absolute;
  left: 0;
  width: var(--doc-page-w, 816px);
  height: var(--doc-page-h, 1056px);
  background: #fff;
  border: 1px solid #d4d4d8;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 12px 40px rgba(0, 0, 0, 0.06);
  box-sizing: border-box;
}

.doc-flow-page-head {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: var(--doc-margin, 96px);
  box-sizing: border-box;
  padding: 14px var(--doc-margin, 96px) 0;
  pointer-events: auto;
}

.doc-flow-page-foot {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--doc-margin, 96px);
  pointer-events: none;
}

.doc-flow-pagenum {
  position: absolute;
  right: var(--doc-margin, 96px);
  bottom: 28px;
  font-size: 11px;
  color: #888;
  user-select: none;
}

.doc-sheet--flow.no-pagenums .doc-flow-pagenum {
  display: none;
}

/* The single editor column, aligned to each page's content area. */
.doc-flow-editor {
  position: absolute;
  top: var(--doc-margin, 96px);
  left: var(--doc-margin, 96px);
  width: var(--doc-content-w, 624px);
  z-index: 1;
}

.doc-flow-editor .ProseMirror {
  min-height: 1px;
  padding: 0;
  outline: none;
}

/* Spacer widgets inserted by the pagination plugin to skip the inter-page
   dead-zone (footer + gap + next header). Non-interactive, invisible. */
.doc-page-spacer {
  width: 100%;
  user-select: none;
  pointer-events: none;
}

/* A block pushed to the top of a page sits flush (suppress its top margin,
   like Word does at a page break). */
.doc-flow-editor .ProseMirror .doc-page-spacer + * {
  margin-top: 0 !important;
}

/* In flow mode the manual page break is invisible — the page gap itself shows
   the break — and the plugin inserts the spacer that moves following content. */
.doc-sheet--flow .ProseMirror .doc-page-break {
  height: 0;
  margin: 0 !important;
  background: transparent;
}

.doc-sheet--flow .ProseMirror .doc-page-break::after {
  display: none;
}
