/* Winston V3 — modal. Centered card with backdrop. */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background: rgba(20, 18, 14, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  animation: modal-fade var(--motion-base) var(--ease-out);
}
@keyframes modal-fade {
  from { background: rgba(20, 18, 14, 0); }
  to   { background: rgba(20, 18, 14, 0.45); }
}

.modal {
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-5) var(--space-3);
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: var(--type-lg); font-weight: var(--weight-bold); margin: 0; }
.modal-close {
  width: 36px; height: 36px;
  border-radius: var(--radius-full);
  font-size: 20px;
  color: var(--ink-muted);
}
.modal-close:hover { background: var(--surface-2); color: var(--ink); }

.modal-body {
  padding: var(--space-5);
  overflow-y: auto;
  flex: 1;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border);
}
.modal-foot:empty { padding: 0; border-top: none; }

@media (max-width: 540px) {
  .modal {
    max-width: none;
    max-height: 100vh;
    height: 100vh;
    border-radius: 0;
  }
}
