.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: var(--scrim);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  animation: fade-in var(--dur) var(--ease);
}

#confirm { z-index: 80; }

.sheet,
.wizard-card,
.drawer-panel,
.modal,
.popover,
.map-sheet,
.dress-card {
  background: #ffffff;
  border: 1px solid var(--separator);
  box-shadow: var(--shadow-2);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.wizard-card,
.modal {
  animation: sheet-in var(--dur-sheet) var(--spring);
}

.sheet-grabber {
  width: 36px;
  height: 5px;
  border-radius: var(--r-pill);
  background: rgba(60, 60, 67, 0.28);
  margin: 2px auto 10px;
}

@keyframes sheet-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 90;
  max-width: min(440px, calc(100% - 32px));
  padding: 12px 16px;
  border-radius: var(--r-pill);
  background: var(--glass-thick);
  border: 1px solid var(--glass-stroke);
  color: var(--label);
  font-size: var(--text-footnote);
  box-shadow: var(--shadow-1);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

#stage-popover .btn-primary { width: 100%; }

.popover {
  position: fixed;
  z-index: 35;
  width: min(340px, calc(100vw - 24px));
  max-height: min(78vh, 640px);
  overflow: auto;
  padding: 16px;
  border-radius: 18px;
  animation: sheet-in var(--dur) var(--spring);
}

.popover label,
.wizard-card label,
.drawer-panel label,
.map-inspector label,
.lead-form label,
.person-card label,
.disclosure label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: var(--text-footnote);
  font-weight: 560;
  color: var(--label-secondary);
}

input[type="text"],
input[type="number"],
input:not([type]),
textarea,
select {
  width: 100%;
  border: 0;
  border-radius: 12px;
  background: var(--field);
  box-shadow: inset 0 0 0 1px rgba(60, 60, 67, 0.12);
  min-height: 44px;
  padding: 10px 12px;
  color: var(--label);
  font-size: var(--text-body);
}

textarea { min-height: 96px; resize: vertical; line-height: 1.4; }

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--accent);
}

.popover-divider {
  height: 1px;
  background: var(--separator);
  margin: 16px 0;
}

.recommend-list {
  list-style: none;
  margin: 8px 0 12px;
  padding: 4px 0;
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  background: var(--field);
}

.recommend-list li {
  display: grid;
  grid-template-columns: 22px 1fr;
  column-gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid var(--separator);
}

.recommend-list li:first-child { border-top: 0; }

.recommend-list span { color: var(--label-tertiary); font-size: var(--text-caption); padding-top: 2px; }

.recommend-list strong {
  font-weight: 600;
  font-size: var(--text-subhead);
  letter-spacing: -0.014em;
}

.recommend-list em {
  grid-column: 2;
  color: var(--label-tertiary);
  font-style: normal;
  font-size: var(--text-caption);
  margin-top: 1px;
}

.form-error {
  color: var(--destructive);
  min-height: 1.2em;
  margin: 8px 0 0;
  font-size: var(--text-footnote);
}

.modal {
  width: min(400px, 100%);
  padding: 22px 22px 18px;
  border-radius: 22px;
}

.modal h2,
.wizard-head h2,
.drawer-head h2,
.map-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-title2);
  font-weight: 700;
  letter-spacing: -0.022em;
  line-height: 1.15;
}

.modal p { margin: 8px 0 0; color: var(--label-secondary); font-size: var(--text-subhead); line-height: 1.4; }

.modal-actions,
.wizard-foot,
.drawer-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.modal-actions { margin-top: 18px; }

.check {
  flex-direction: row !important;
  align-items: center;
  gap: 8px !important;
  color: var(--label) !important;
  font-size: var(--text-subhead) !important;
  font-weight: 500 !important;
}

.check input { width: auto; min-height: 0; accent-color: var(--accent); }

.progress {
  height: 4px;
  border-radius: var(--r-pill);
  background: rgba(60, 60, 67, 0.12);
  overflow: hidden;
}

.progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

@media (prefers-reduced-motion: reduce) {
  @keyframes sheet-in {
    from { opacity: 0; }
    to { opacity: 1; }
  }

  .overlay,
  .popover,
  .wizard-card,
  .modal { animation-name: fade-in; }
}
