/* Empty descriptor (core/customSurface.ts). Same frame as a section: title, toolbar, status,
   Enlarge, Close, and an empty body. Not a database section. */

.custom-surface-dialog {
  position: relative;
  z-index: 1;
  width: min(1100px, 95vw);
  height: min(80vh, 820px);
  display: flex;
  flex-direction: column;
}

.custom-surface-dialog.is-enlarged {
  width: calc(100vw - 1.5rem);
  height: calc(100vh - 1.5rem);
}

.custom-surface-dialog > .custom-surface {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}

.custom-surface > .section-page-container,
.custom-surface .section-page-card {
  height: 100%;
  min-height: 0;
}

.lf-secondary-entry-body > .custom-surface {
  height: 100%;
}

.custom-surface .section-page-card {
  display: flex;
  flex-direction: column;
}

.custom-surface .custom-surface-body {
  display: flex;
  flex-direction: column;
  overflow: auto;
}

/* Commands of a surface that is not a section. On its own bar, and on the shared
   command bar once placeSurfaceTools has moved them there. */
.lf-surface-tools {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.35rem;
  min-width: max-content;
}

.lf-surface-tools .form-select,
.lf-surface-tools .form-control {
  width: auto;
  max-width: 16rem;
  height: var(--lf-tb-btn-height, 2rem);
  min-height: var(--lf-tb-btn-height, 2rem);
  padding-top: 0;
  padding-bottom: 0;
  font-size: var(--lf-tb-btn-font, 0.8rem);
}

.lf-surface-tools label {
  margin: 0;
  white-space: nowrap;
}

.lf-full-edit-toolbar .lf-surface-tools .form-select,
.lf-full-edit-toolbar .lf-surface-tools .form-control {
  background-color: transparent;
  color: #f8f9fa;
  border-color: rgba(255, 255, 255, 0.45);
}

.lf-full-edit-toolbar .lf-surface-tools .form-select:focus,
.lf-full-edit-toolbar .lf-surface-tools .form-control:focus {
  background-color: #3d4348;
  color: #f8f9fa;
}

/* `.text-muted` is `!important` (Bootstrap, then the theme mix of the page foreground).
   On this strip the page foreground is the wrong colour: the bar is dark. */
.lf-full-edit-toolbar .lf-surface-tools label,
.lf-full-edit-toolbar .lf-surface-tools .text-muted {
  color: rgba(248, 249, 250, 0.8) !important;
}

.docconv-dialog {
  width: min(720px, 95vw);
  height: min(52vh, 480px);
}

.docconv-panel {
  padding: 0.75rem 1rem;
}

.docconv-file-name {
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* The source name is the operand, not a command label. Icon-only mode squares every
   `.lf-tb-btn` and would clip it down to the glyph. */
html[data-lf-toolbar-buttons] .lf-tb-btn:has(.docconv-file-name) {
  width: auto;
  max-width: 16rem;
  padding: 0 var(--lf-tb-btn-padding);
}

.mailmerge-dialog,
.mailmerge-templates-dialog {
  width: min(960px, 96vw);
  height: min(84vh, 860px);
}

.custom-surface-body > .mailmerge-preview,
.custom-surface-body > .mailmerge-templates-list,
.custom-surface-body > .mailmerge-edit {
  flex: 1 1 auto;
  min-height: 0;
}

.custom-surface-body > .mailmerge-edit {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
