/* A route animation with fill-mode:both retains transform/filter and traps
   fixed dialogs inside the route. Release that containing block while open. */
.tc-route-view:has(.tc-modal-backdrop) {
  animation: none !important;
  transform: none !important;
  filter: none !important;
}
.tc-modal-backdrop {
  box-sizing: border-box;
  padding: 12px !important;
  overflow: hidden;
}
.tc-modal-backdrop .tc-modal {
  box-sizing: border-box;
  margin: 0;
  max-width: 100%;
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.tc-modal-backdrop .tc-modal__head,
.tc-modal-backdrop .tc-modal__actions {
  flex: 0 0 auto;
  min-width: 0;
}
.tc-modal-backdrop .tc-modal__head h2 {
  min-width: 0;
  overflow-wrap: anywhere;
}
.tc-modal-backdrop .tc-modal__close { flex-shrink: 0; }
.tc-modal-backdrop .tc-modal__body {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  overflow-wrap: anywhere;
}
.tc-modal-backdrop .tc-modal__body > * { min-width: 0; }
.tc-modal-backdrop .tc-modal__actions { flex-wrap: wrap; }
.tc-modal-backdrop iframe[title="Nội dung email"] {
  box-sizing: border-box;
  max-width: 100%;
  height: clamp(180px, 45vh, 480px) !important;
  height: clamp(180px, 45dvh, 480px) !important;
}
@media (max-width: 600px), (max-height: 600px) {
  .tc-modal-backdrop .tc-modal { padding: 12px; }
  .tc-modal-backdrop .tc-modal__actions { margin-top: 10px; }
}
