/* ─── Reusable Modal shell (src/components/Modal.tsx) ─── */
@keyframes ui-modal-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ui-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: var(--modal-scrim, rgba(0, 0, 0, 0.5));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6vh 16px;
  animation: fadeIn 150ms ease both;
  /* No backdrop-filter: on WebKitGTK (some GPU stacks) the blur bleeds onto the
     modal content and makes its text look unfocused. */
}

.ui-modal {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(520px, 94vw);
  max-height: 88vh;
  background: var(--bg-sidebar);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  animation: ui-modal-in 200ms ease both;
}
.ui-modal--sm { width: min(400px, 94vw); }
.ui-modal--lg { width: min(720px, 94vw); }

.ui-modal-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px 12px 18px;
}
.ui-modal-icon {
  display: flex;
  align-items: center;
  margin-top: 1px;
  color: var(--accent);
  flex-shrink: 0;
}
.ui-modal-titles {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ui-modal-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}
.ui-modal-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}
.ui-modal-close {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 2px;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-muted);
  opacity: 0.7;
  transition: opacity var(--transition-fast), color var(--transition-fast), background var(--transition-fast);
}
.ui-modal-close:hover {
  opacity: 1;
  color: var(--text-primary);
  background: var(--bg-glass);
}

.ui-modal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.ui-modal-footer {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 12px 18px;
  border-top: 1px solid var(--border-subtle);
  flex-shrink: 0;
}
