/* Acabamento do editor normal em monitores largos. */
@media (min-width: 1100px) {
  /* No PACS, aproveitar a largura livre para manter pasta, exame e dados
     complementares em uma única faixa. */
  body.preview-redesign.quick-editor-mode .editor-screen .details-panel > .field-grid {
    display: grid !important;
    grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
    grid-template-areas: "folder folder folder exam exam exam exam exam exam exam more more" !important;
    align-items: end !important;
    gap: 9px 10px !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  body.preview-redesign.quick-editor-mode .editor-screen .details-panel > .field-grid:has(.exam-subcategory-field:not([hidden])) {
    grid-template-areas: "folder folder category category category exam exam exam exam exam more more" !important;
  }

  body.preview-redesign.quick-editor-mode .editor-screen .details-panel .exam-folder-field {
    grid-area: folder !important;
  }

  body.preview-redesign.quick-editor-mode .editor-screen .details-panel .exam-subcategory-field:not([hidden]) {
    grid-area: category !important;
  }

  body.preview-redesign.quick-editor-mode .editor-screen .details-panel .exam-type-field {
    grid-area: exam !important;
  }

  body.preview-redesign.quick-editor-mode .editor-screen .details-panel .progressive-report-details {
    grid-area: more !important;
    align-self: end !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border-top: 0 !important;
  }

  body.preview-redesign.quick-editor-mode .editor-screen .details-panel .progressive-report-details > summary {
    display: flex !important;
    align-items: center !important;
    min-height: 42px !important;
    height: 42px !important;
    padding-inline: 10px !important;
    border-radius: 10px !important;
    font-size: 0.78rem !important;
    white-space: nowrap !important;
  }

  body.preview-redesign.quick-editor-mode .editor-screen .details-panel .progressive-report-details[open] {
    grid-area: auto !important;
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    width: 100% !important;
  }
}

@media (min-width: 1100px) {
  body.preview-redesign:not(.quick-editor-mode) .editor-screen .details-panel #examSideField:not([hidden]) {
    display: grid !important;
    grid-template-rows: auto 42px !important;
    gap: 4px !important;
    align-self: stretch !important;
    margin: 0 !important;
  }

  body.preview-redesign:not(.quick-editor-mode) .editor-screen .details-panel #examSideField select {
    width: 100% !important;
    height: 42px !important;
    min-height: 42px !important;
    max-height: 42px !important;
    margin: 0 !important;
    padding-inline: 11px !important;
    border-radius: 10px !important;
    font-size: 0.9rem !important;
  }

  body.preview-redesign:not(.quick-editor-mode) .editor-screen .template-tools-card {
    display: grid !important;
    grid-template-columns: minmax(250px, 1.15fr) minmax(390px, 1.75fr) auto auto !important;
    grid-template-areas: "mask actions more insert" !important;
    align-items: center !important;
    gap: 6px !important;
    min-height: 62px !important;
    padding: 8px 10px !important;
    overflow: visible !important;
  }

  body.preview-redesign:not(.quick-editor-mode) .editor-screen .template-tools-current {
    display: contents !important;
  }

  body.preview-redesign:not(.quick-editor-mode) .editor-screen .template-tools-current > div {
    grid-area: mask !important;
    display: grid !important;
    min-width: 0 !important;
    gap: 2px !important;
  }

  body.preview-redesign:not(.quick-editor-mode) .editor-screen .template-tools-current strong {
    display: -webkit-box !important;
    overflow: hidden !important;
    white-space: normal !important;
    text-overflow: ellipsis !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 2 !important;
    line-height: 1.15 !important;
  }

  body.preview-redesign:not(.quick-editor-mode) .editor-screen .template-tools-insert {
    grid-area: insert !important;
    justify-self: end !important;
    min-width: 82px !important;
    min-height: 38px !important;
    padding: 7px 14px !important;
    border-color: var(--accent) !important;
    border-radius: 10px !important;
    background: var(--accent) !important;
    color: white !important;
    font-weight: 800 !important;
    box-shadow: 0 5px 14px color-mix(in srgb, var(--accent) 24%, transparent) !important;
  }

  body.preview-redesign:not(.quick-editor-mode) .editor-screen .template-tools-insert:hover,
  body.preview-redesign:not(.quick-editor-mode) .editor-screen .template-tools-insert:focus-visible {
    background: var(--accent-dark) !important;
  }

  body.preview-redesign:not(.quick-editor-mode) .editor-screen .template-row-primary {
    grid-area: actions !important;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 5px !important;
    min-width: 0 !important;
  }

  body.preview-redesign:not(.quick-editor-mode) .editor-screen .template-row-primary .template-action-button {
    min-width: 0 !important;
    min-height: 36px !important;
    height: 36px !important;
    padding: 5px 8px !important;
    border-radius: 9px !important;
    font-size: 0.7rem !important;
  }

  body.preview-redesign:not(.quick-editor-mode) .editor-screen .template-row-primary .template-action-icon {
    width: 17px !important;
    height: 17px !important;
  }

  body.preview-redesign:not(.quick-editor-mode) .editor-screen .template-more-actions,
  body.preview-redesign:not(.quick-editor-mode) .editor-screen .template-more-actions[open] {
    grid-area: more !important;
    grid-column: auto !important;
    position: relative !important;
    width: auto !important;
    min-width: 96px !important;
    padding: 0 !important;
    border: 0 !important;
    overflow: visible !important;
  }

  body.preview-redesign:not(.quick-editor-mode) .editor-screen .template-more-actions summary {
    min-height: 36px !important;
    height: 36px !important;
    padding: 0 10px !important;
    border: 1px solid var(--line) !important;
    border-radius: 9px !important;
    background: transparent !important;
    font-size: 0.7rem !important;
    white-space: nowrap !important;
  }

  body.preview-redesign:not(.quick-editor-mode) .editor-screen .template-more-actions[open] summary {
    border-color: var(--accent) !important;
    background: color-mix(in srgb, var(--accent) 10%, var(--panel)) !important;
  }

  body.preview-redesign:not(.quick-editor-mode) .editor-screen .template-more-actions .template-row-secondary {
    position: absolute !important;
    top: calc(100% + 7px) !important;
    right: 0 !important;
    z-index: 30 !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(145px, 1fr)) !important;
    gap: 6px !important;
    width: 320px !important;
    padding: 8px !important;
    border: 1px solid var(--line) !important;
    border-radius: 12px !important;
    background: var(--panel) !important;
    box-shadow: var(--shadow) !important;
  }

  body.preview-redesign:not(.quick-editor-mode):has(#editorScreen:not([hidden])) #editorPrimaryActions,
  body.preview-redesign:not(.quick-editor-mode):has(#editorScreen:not([hidden])) .duty-mode-menu {
    box-sizing: border-box !important;
    width: 470px !important;
    max-width: calc(100vw - 48px) !important;
  }

  body.preview-redesign:not(.quick-editor-mode):has(#editorScreen:not([hidden])) .duty-mode-floating {
    left: calc(clamp(340px, 24vw, 380px) + clamp(24px, 3vw, 52px)) !important;
    right: clamp(24px, 3vw, 52px) !important;
    justify-content: center !important;
  }

  body.preview-redesign:not(.quick-editor-mode) .editor-screen.recent-sidebar-collapsed .duty-mode-floating {
    left: calc(72px + clamp(24px, 3vw, 52px)) !important;
  }

  body.preview-redesign:not(.quick-editor-mode):has(#editorScreen:not([hidden])) .app-footer {
    min-height: 42px !important;
    height: auto !important;
    padding: 9px 18px !important;
    gap: 14px !important;
    flex-wrap: wrap !important;
    overflow: visible !important;
    font-size: 0.74rem !important;
  }

  body.preview-redesign:not(.quick-editor-mode):has(#editorScreen:not([hidden])) .app-footer > span,
  body.preview-redesign:not(.quick-editor-mode):has(#editorScreen:not([hidden])) #privacyFooterButton,
  body.preview-redesign:not(.quick-editor-mode):has(#editorScreen:not([hidden])) #academyFooterButton,
  body.preview-redesign:not(.quick-editor-mode):has(#editorScreen:not([hidden])) #logoutButton:not([hidden]) {
    display: inline-flex !important;
  }
}
