.legacy-import-overlay {
  position: fixed;
  inset: 0;
  z-index: 260;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(19, 24, 34, 0.18);
  backdrop-filter: blur(18px) saturate(120%);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
}

.legacy-import-overlay[hidden] { display: none; }

.legacy-import-card {
  width: min(480px, calc(100vw - 48px));
  max-height: min(680px, calc(100vh - 48px));
  overflow: auto;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 24px;
  background: rgba(248, 250, 253, 0.9);
  box-shadow: 0 26px 80px rgba(31, 43, 66, 0.2);
}

.legacy-import-card > header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.legacy-import-mark {
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  height: 42px;
  border-radius: 14px;
  color: #1768e5;
  background: rgba(38, 119, 244, 0.1);
  font-size: 22px;
}

.legacy-import-card h2 { margin: 0; color: #172033; font-size: 19px; font-weight: 680; }
.legacy-import-card header p { margin: 4px 0 0; color: #788293; font-size: 12px; }

.legacy-import-stats,
.legacy-import-completion dl {
  display: grid;
  gap: 1px;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(37, 49, 72, 0.08);
  border-radius: 16px;
  background: rgba(37, 49, 72, 0.06);
}

.legacy-import-stats div,
.legacy-import-completion dl div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  background: rgba(255, 255, 255, 0.72);
}

.legacy-import-card dt { color: #697386; font-size: 13px; }
.legacy-import-card dd { margin: 0; color: #1d2738; font-size: 14px; font-weight: 650; font-variant-numeric: tabular-nums; }
.legacy-import-excluded { margin: 12px 0 0; color: #697386; font-size: 12px; line-height: 1.6; }

.legacy-import-estimate {
  margin: 17px 2px 0;
  color: #626d80;
  font-size: 13px;
  text-align: center;
}

.legacy-import-estimate b { color: #1768e5; font-size: 16px; }

.legacy-import-progress-panel > strong {
  display: block;
  color: #1c2738;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

.legacy-import-progress-panel > p {
  min-height: 18px;
  margin: 7px 0 14px;
  overflow: hidden;
  color: #758093;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.legacy-import-progress {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(31, 49, 79, 0.09);
}

.legacy-import-progress i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #1674f5;
  transition: width 160ms ease;
}

.legacy-import-running-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 17px 0 0;
}

.legacy-import-running-stats div {
  padding: 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.68);
  text-align: center;
}

.legacy-import-running-stats dt { margin-bottom: 4px; font-size: 11px; }

.legacy-import-errors {
  max-height: 112px;
  margin: 16px 0 0;
  padding: 11px 12px;
  overflow: auto;
  border-radius: 12px;
  color: #8b4d48;
  background: rgba(190, 61, 48, 0.06);
  font: 11px/1.55 -apple-system, BlinkMacSystemFont, sans-serif;
  white-space: pre-wrap;
}

.legacy-import-card > footer {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 22px;
}

.legacy-import-card > footer button {
  min-height: 36px;
  padding: 0 16px;
  border: 1px solid rgba(28, 42, 65, 0.1);
  border-radius: 11px;
  color: #3e495c;
  background: rgba(255, 255, 255, 0.74);
  font: inherit;
  cursor: pointer;
}

.legacy-import-card > footer button[hidden] { display: none; }
.legacy-import-card > footer button:disabled { opacity: 0.46; cursor: default; }

.legacy-import-card > footer .legacy-import-primary {
  border-color: transparent;
  color: white;
  background: #1674f5;
  box-shadow: 0 7px 18px rgba(22, 116, 245, 0.22);
}

@media (max-width: 560px) {
  .legacy-import-card { padding: 20px; border-radius: 20px; }
}
