.server-error-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
}

.server-error-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 8, 18, 0.72);
  backdrop-filter: blur(10px);
}

.server-error-modal-panel {
  position: relative;
  width: min(46rem, calc(100vw - 2rem));
  max-height: min(80vh, 52rem);
  margin: 6vh auto 0;
  display: flex;
  flex-direction: column;
  border-radius: 1.5rem;
  border: 1px solid rgba(255, 124, 124, 0.18);
  background: rgba(9, 18, 32, 0.96);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.server-error-modal-header,
.server-error-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
}

.server-error-modal-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.server-error-modal-body {
  padding: 1.25rem 1.5rem 1.5rem;
  display: grid;
  gap: 1rem;
  overflow: auto;
}

.server-error-modal-message {
  color: #ffd8d8;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.server-error-modal-details {
  margin: 0;
  padding: 1rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #dbe9ff;
  font-size: 0.85rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.server-error-modal-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

html[data-theme="light"] .server-error-modal-backdrop {
  background: rgba(12, 18, 31, 0.35);
}

html[data-theme="light"] .server-error-modal-panel {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(255, 124, 124, 0.2);
}

html[data-theme="light"] .server-error-modal-header,
html[data-theme="light"] .server-error-modal-footer {
  border-color: rgba(3, 14, 26, 0.08);
}

html[data-theme="light"] .server-error-modal-message {
  color: #8d1f1f;
}

html[data-theme="light"] .server-error-modal-details {
  background: rgba(15, 23, 42, 0.04);
  border-color: rgba(15, 23, 42, 0.08);
  color: #0e1e34;
}
