/* Keep the document canvas in one scrollable frame, without a second editor toolbar. */
.office-save-state { display: none !important; }
.is-office-workspace .office-save-state { display: flex !important; align-items: center; gap: 6px; margin: 3px 0 0; color: var(--muted); font-size: 12px; font-weight: 400; line-height: 1.4; }
.is-office-workspace .office-save-state::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--teal); }
.is-office-workspace .office-save-state[data-state="pending"]::before, .is-office-workspace .office-save-state[data-state="loading"]::before { background: var(--amber); }
.is-office-workspace .office-save-state[data-state="error"] { color: var(--red); }
.is-office-workspace .office-save-state[data-state="error"]::before { background: currentColor; }
#filePreviewOverlay.is-office-workspace { inset: 0; margin: 0; width: 100%; max-width: 100%; height: 100dvh; max-height: 100dvh; border-radius: 0; }
#filePreviewOverlay.is-office-workspace .file-preview-window { border: 0; border-radius: 0; }
#filePreviewOverlay.is-office-workspace.is-office-compact { inset: 0; margin: auto; width: calc(100% - 48px); max-width: 1600px; height: 86dvh; max-height: 86dvh; border: 1px solid var(--line); border-radius: 8px; }
.is-office-workspace :is(.file-preview-header, .attachment-preview-header) { position: relative; display: flex; flex-wrap: nowrap; align-items: center; gap: 12px; padding: 8px 14px; min-height: 60px; background: var(--surface); border-bottom: 1px solid var(--line); z-index: 3; }
.is-office-workspace :is(.file-preview-header, .attachment-preview-header) > div:first-child { flex: 1; min-width: 0; padding: 0; }
.is-office-workspace :is(#filePreviewTitle, #editAttachmentPreviewTitle) { display: block; padding: 0; font-size: 14px; line-height: 1.5; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.is-office-workspace :is(#filePreviewMeta, #editAttachmentPreviewMeta) { display: none; }
.is-office-workspace :is(.file-preview-actions, .attachment-preview-actions) { display: flex; flex: none; align-items: center; flex-wrap: nowrap; gap: 6px; width: auto; }
.is-office-workspace :is(.file-preview-actions, .attachment-preview-actions) > :is(button, a) { display: grid; place-items: center; position: static; flex: 0 0 36px; width: 36px; min-width: 36px; height: 36px; min-height: 36px; padding: 0; border-radius: 6px; }
.is-office-workspace :is(.file-preview-actions, .attachment-preview-actions) > .is-hidden { display: none; }
.is-office-workspace :is(.file-preview-actions, .attachment-preview-actions) .secondary-button span { display: none; }
.is-office-workspace :is(.file-preview-actions, .attachment-preview-actions) svg { width: 18px; height: 18px; }
.is-office-workspace :is(#filePreviewOpen, #editAttachmentFullscreen) { background: var(--ui-active); color: var(--ui-active-text); border-color: transparent; }
.is-office-workspace :is(#filePreviewTotal, #editAttachmentTotal) { display: none; }
.is-office-workspace.office-totals-open :is(#filePreviewTotal, #editAttachmentTotal) { display: block; position: absolute; top: calc(100% + 4px); right: 10px; width: min(480px, calc(100vw - 20px)); max-height: 45dvh; overflow: auto; padding: 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); box-shadow: var(--shadow-strong); z-index: 4; }
.is-office-workspace :is(#filePreviewTotalsToggle, #editAttachmentTotalsToggle)[aria-expanded="true"] { background: var(--ui-active); color: var(--ui-active-text); }
.attachment-preview-panel.is-office-workspace:not(.is-expanded-preview) { height: max(520px, 74dvh); min-height: 0; }
.attachment-preview-panel.is-office-workspace.is-expanded-preview { inset: 0; border: 0 !important; border-radius: 0 !important; }
.is-office-workspace :is(.file-preview-frame, .attachment-preview-frame) { touch-action: auto; }
@media (max-width: 760px) {
  #filePreviewOverlay.is-office-workspace.is-office-compact { width: 100%; max-width: 100%; height: 100dvh; max-height: 100dvh; border: 0; border-radius: 0; }
  .is-office-workspace :is(.file-preview-header, .attachment-preview-header) { display: grid; grid-template-columns: minmax(0, 1fr) 44px 44px; gap: 4px; padding: max(6px, env(safe-area-inset-top)) 8px 6px; }
  .is-office-workspace :is(.file-preview-header, .attachment-preview-header) > div:first-child { grid-column: 1; padding: 0; }
  .is-office-workspace :is(.file-preview-actions, .attachment-preview-actions) { display: contents; }
  .is-office-workspace :is(.file-preview-actions, .attachment-preview-actions) > :is(button, a) { display: none; }
  .is-office-workspace :is(.file-preview-actions > [data-close-preview], #editAttachmentFullscreen, #editAttachmentCloseInline) { display: grid; grid-column: 3; grid-row: 1; width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 0; }
  .is-office-workspace :is(#filePreviewDownload, #editAttachmentDownload) { display: grid; grid-column: 2; grid-row: 1; width: 44px; min-width: 44px; height: 44px; min-height: 44px; }
  .is-office-workspace :is(#editAttachmentCloseInline) { display: none; }
  .is-office-workspace.is-expanded-preview #editAttachmentCloseInline { display: grid; }
  .is-office-workspace.is-expanded-preview #editAttachmentFullscreen { display: none; }
  .is-office-workspace :is(#filePreviewTotalsToggle, #editAttachmentTotalsToggle):not(.is-hidden) { display: grid; grid-row: 2; grid-column: 2; width: 44px; min-width: 44px; height: 44px; min-height: 44px; }
  .is-office-workspace :is(#filePreviewTitle, #editAttachmentPreviewTitle) { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; padding: 0 !important; font-size: 14px; white-space: normal; overflow-wrap: anywhere; }
  .is-office-workspace :is(.file-preview-header, .attachment-preview-header):has([id$="TotalsToggle"]:not(.is-hidden)) { grid-template-columns: minmax(0, 1fr) repeat(3, 44px); }
  .is-office-workspace :is(.file-preview-header, .attachment-preview-header):has([id$="TotalsToggle"]:not(.is-hidden)) :is(#filePreviewTotalsToggle, #editAttachmentTotalsToggle) { grid-row: 1; grid-column: 2; }
  .is-office-workspace :is(.file-preview-header, .attachment-preview-header):has([id$="TotalsToggle"]:not(.is-hidden)) :is(#filePreviewDownload, #editAttachmentDownload) { grid-column: 3; }
  .is-office-workspace :is(.file-preview-header, .attachment-preview-header):has([id$="TotalsToggle"]:not(.is-hidden)) :is([data-close-preview], #editAttachmentFullscreen, #editAttachmentCloseInline) { grid-column: 4; }
  .edit-dialog .attachment-preview-panel.is-office-workspace:not(.is-expanded-preview) { height: 78dvh; min-height: 400px; margin-inline: 0; border-radius: 0; }
  .is-office-workspace .file-preview-body { padding-bottom: env(safe-area-inset-bottom); }
}
