.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(42, 50, 61, 0.4);
  backdrop-filter: blur(4px);
  animation: modal-fade var(--motion-base) var(--ease-out-quart);
}

@keyframes modal-fade {
  from {
    opacity: 0;
  }
}

.modal-panel {
  display: flex;
  width: 100%;
  max-width: 1000px;
  max-height: 85vh;
  flex-direction: column;
  overflow: hidden;
  border-radius: 16px;
  background: var(--card);
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15);
  animation: modal-pop var(--motion-base) var(--ease-out-expo);
}

@keyframes modal-pop {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
}

.modal-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color-light);
}

.modal-panel__title {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 600;
  color: var(--foreground);
}

.modal-panel__close {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  color: var(--muted-foreground);
  transition: var(--transition-smooth);
}

.modal-panel__close:hover {
  color: var(--gold-dark);
  background: var(--gold-light);
}

.modal-panel__close:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.modal-panel__body {
  overflow-y: auto;
  padding: 24px;
}

@media (max-width: 640px) {
  .modal-overlay {
    padding: 0;
  }

  .modal-panel {
    max-height: 100dvh;
    height: 100dvh;
    border-radius: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .modal-overlay,
  .modal-panel {
    animation: none;
  }
}
