.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 60;
}

.modal-panel {
  width: min(900px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  overflow: auto;
  border-radius: 28px;
  background: rgba(255,255,255,.97);
  box-shadow: 0 34px 80px rgba(15, 23, 42, 0.24);
  border: 1px solid rgba(255,255,255,.72);
  padding: 24px;
}

.modal-panel.wide { width: min(1180px, calc(100vw - 32px)); }

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.modal-close {
  min-width: 88px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border-radius: 16px;
}

.notifications-shell {
  margin-left: auto;
}

.notifications-list {
  display: grid;
  gap: 12px;
}

.notification-item {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--color-border);
  background: rgba(255,255,255,.92);
}

.notification-item.unread {
  border-color: rgba(192,57,43,.22);
  background: var(--color-primary-soft);
}

.notification-badge {
  position: absolute;
  top: 6px;
  right: 7px;
  width: 10px;
  height: 10px;
  min-width: 10px;
  padding: 0;
  border-radius: 999px;
  background: #e02020;
  color: transparent;
  font-size: 0;
  font-weight: 900;
  display: inline-block;
  box-shadow: 0 0 0 2px rgba(255,255,255,.96);
}


.modal-backdrop {
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(8px);
}

.modal-card,
.modal-panel {
  background: rgba(255,255,255,.98);
}

.classlist-modal-panel {
  width: min(1080px, calc(100vw - 40px));
  padding: 26px;
}

.classlist-modal-header {
  align-items: center;
  margin-bottom: 18px;
}

.classlist-modal-heading {
  display: grid;
  gap: 8px;
}

.classlist-modal-heading h3 {
  font-size: 1.85rem;
  line-height: 1.05;
}

.classlist-modal-subtitle {
  font-size: 1.04rem;
  font-weight: 700;
  color: var(--color-text);
}

.classlist-table-shell {
  overflow: auto;
  border-radius: 18px;
  border: 1px solid var(--color-border);
  background: linear-gradient(180deg, #fff 0%, #fbfcff 100%);
}

.notifications-card {
  width: min(680px, calc(100vw - 40px));
}

.notifications-shell {
  margin-left: auto;
}

.notification-item {
  display: grid;
  gap: 12px;
}

.notification-item.unread {
  border-left: 4px solid var(--color-primary);
  background: linear-gradient(180deg, var(--color-primary-soft), rgba(255,255,255,.96));
}

.notification-item.opened {
  background: rgba(255,255,255,.94);
}

.notification-badge {
  background: #e02020;
  color: transparent;
  border: 0;
}

.bell-button.has-unread .notification-badge {
  background: #e02020;
  color: transparent;
}

.bell-button.is-empty .notification-badge {
  display: none;
}






.editor-tools-modal-panel {
  width: min(520px, calc(100vw - 32px));
}

.table-insert-modal-panel {
  width: min(760px, calc(100vw - 32px));
}


#assignment-preload-modal .modal-panel {
  position: relative;
}

.assignment-preload-overlay {
  position: absolute;
  inset: 86px 24px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  border-radius: 24px;
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(4px);
  pointer-events: none;
}

.assignment-preload-overlay.hidden {
  display: none;
}

.assignment-preload-overlay-card {
  pointer-events: auto;
  width: min(420px, calc(100% - 24px));
  border-radius: 22px;
  border: 1px solid rgba(178,51,36,.12);
  background: rgba(255,255,255,.98);
  box-shadow: 0 24px 48px rgba(15,23,42,.16);
  padding: 18px 18px 16px;
  display: grid;
  gap: 10px;
}

.assignment-preload-overlay-title {
  font-size: 1rem;
  font-weight: 900;
  color: var(--color-text);
}

.assignment-preload-overlay-file,
.assignment-preload-overlay-meta {
  color: var(--color-text-soft);
}

.assignment-preload-overlay-progress-shell {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(15,23,42,.08);
  overflow: hidden;
}

.assignment-preload-overlay-progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(178,51,36,.96), rgba(58,164,216,.96));
  transition: width .22s ease;
}

.assignment-preload-overlay-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: .9rem;
}


#assignment-inspect-modal .modal-panel {
  width: min(1180px, calc(100vw - 32px));
}


/* V58 safer confirmation icon treatment */
.modal-icon svg {
  width: 22px;
  height: 22px;
}
#confirm-modal-message {
  white-space: pre-line;
}

.assignment-preload-overlay-card,
.assignment-preload-overlay-progress-shell {
  box-sizing: border-box;
  max-width: 100%;
}

.assignment-preload-overlay-meta {
  gap: 10px;
  min-width: 0;
}

.assignment-preload-overlay-meta span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.assignment-preload-overlay-card { overflow: hidden; box-sizing: border-box; }
.assignment-preload-overlay-progress-shell, .assignment-preload-progress-track { width: 100%; max-width: 100%; overflow: hidden; box-sizing: border-box; }
.assignment-preload-overlay-file { overflow-wrap: anywhere; }
