/* GDMM v1.3-clean · modals.css
 * Dialoge (.modal-shade, .modal, .modal-head, .modal-actions) und Meldungen (.toast).
 * Steht vor den Bereichsdateien, weil einzelne Bereiche ihre Dialoge anpassen.
 *
 * Einbindung (Reihenfolge ist Teil der Kaskade, siehe index.html):
 *   tokens → base → layout → modals → forum → tnt → live-participant → trainer → presenter → ux → trainer-workspace → awards
 *
 * Mobile First: Die Regeln ohne Media Query beschreiben die Smartphone-Ansicht,
 * @media (min-width: …) ergänzt größere Bildschirme. Die Werte enden auf .02px (z. B. 750.02px),
 * damit sie lückenlos an die früheren Grenzen (max-width: 750px) anschließen – auch bei gebrochenen
 * Fensterbreiten durch Zoom. Verbliebene @media (max-width: …)-Blöcke enthalten Deklarationen, die es
 * nur auf kleinen Bildschirmen gibt (die Regel setzt dafür auf großen Bildschirmen keinen eigenen Wert).
 */

.modal-shade {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(1,9,29,.63);
  display: grid;
  place-items: center;
  padding: var(--space-18);
}

.modal {
  width: min(540px,100%);
  max-height: calc(100dvh - 36px);
  overflow: auto;
  background: white;
  border-radius: var(--r-lg);
  padding: var(--space-20);
  box-shadow: 0 30px 90px rgba(0,0,0,.2);
}

.modal h2 {
  margin: 0;
  font-size: var(--fs-145);
}

.modal p {
  color: var(--muted);
  line-height: 1.6;
  font-size: var(--fs-090);
}

.modal.gdmm-library-dialog {
  width: 100%;
  max-height: calc(100dvh - 36px);
  overflow: auto;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-15);
  margin-bottom: var(--space-14);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-10);
  flex-wrap: wrap;
  margin-top: var(--space-22);
}

.toast {
  position: fixed;
  z-index: 100;
  right: 25px;
  bottom: 90px;
  max-width: min(370px,calc(100vw - 30px));
  background: #0e1735;
  color: white;
  border-radius: var(--radius-15);
  padding: var(--space-13) var(--space-17);
  box-shadow: 0 15px 38px #0004;
  font-weight: 750;
  font-size: var(--fs-085);
}

.toast-error {
  background: var(--red-33);
  color: var(--white);
  padding-right: 45px;
}

.toast-dismiss {
  position: absolute;
  right: 8px;
  top: 4px;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: var(--fs-125);
  cursor: pointer;
  padding: var(--space-5) var(--space-9);
}

@media (min-width: 470.02px) {
  .modal {
    padding: var(--space-26);
  }

}

@media (min-width: 600.02px) {
  .modal.gdmm-library-dialog {
    width: min(1050px,calc(100vw - 36px));
  }

}

@media (min-width: 950.02px) {
  .toast {
    bottom: 25px;
  }

}

@media (max-width: 600px) {
  .modal.gdmm-library-dialog {
    padding: var(--space-18);
  }

}

/* Fit dialogs to the usable viewport while a mobile keyboard is open. */
body.gdmm-keyboard-open .modal-shade {
  top: var(--gdmm-visible-top, 0px);
  bottom: auto;
  height: var(--gdmm-visible-height, 100dvh);
  box-sizing: border-box;
}
body.gdmm-keyboard-open .modal {
  max-height: calc(var(--gdmm-visible-height, 100dvh) - 32px);
}

@media (max-width: 950px) {
  body.gdmm-text-editing .modal-actions {
    padding-bottom: 24px;
  }
}
