.ig-import-shell {
  position: relative;
  z-index: 50;
  min-height: 100dvh;
  background: #fafafa;
  color: #111827;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

html.ig-import-active body {
  margin: 0;
  background: #fafafa;
}

html.ig-import-active body > :not(.ig-import-shell) {
  display: none !important;
}

.ig-import-shell * {
  box-sizing: border-box;
}

.ig-import-admin-layout {
  min-height: 100dvh;
  display: block;
}

.ig-import-admin-link {
  width: 100%;
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #4b5563;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
}

.ig-import-admin-link:hover,
.ig-import-admin-link.is-active {
  background: #fff1f4;
  color: #b60731;
}

.ig-import-admin-link__icon {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: #df0a3d;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 900;
  flex: 0 0 auto;
}

.ig-import-page {
  width: min(100%, 1080px);
  margin: 0 auto;
  padding: 24px 28px 44px;
}

.ig-import-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.ig-import-page-head h1 {
  margin: 0;
  color: #111827;
  font-size: 24px;
  line-height: 1.15;
  font-weight: 850;
  letter-spacing: 0;
}

.ig-import-page-head p {
  margin: 4px 0 0;
  max-width: 650px;
  color: #6b7280;
  font-size: 13px;
  line-height: 1.5;
}

.ig-import-run-status {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #fff;
  padding: 0 11px;
  color: #4b5563;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.ig-import-run-status.running {
  border-color: rgba(223, 10, 61, 0.22);
  background: #fff1f4;
  color: #b60731;
}

.ig-import-run-status.loaded {
  border-color: rgba(22, 101, 52, 0.18);
  background: #f0fdf4;
  color: #166534;
}

.ig-import-card {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}

.ig-import-steps {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
  color: #9ca3af;
}

.ig-import-steps span {
  min-height: 24px;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #6b7280;
  padding: 0;
  font-size: 12px;
  font-weight: 800;
}

.ig-import-steps strong {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #f3f4f6;
  color: #4b5563;
  font-size: 11px;
}

.ig-import-steps .is-active {
  border-color: transparent;
  background: transparent;
  color: #b60731;
}

.ig-import-steps .is-active strong,
.ig-import-steps .is-done strong {
  background: #df0a3d;
  color: #fff;
}

.ig-import-steps .is-done {
  color: #374151;
}

.ig-import-form {
  padding: 0 0 16px;
  display: grid;
  gap: 12px;
  border-bottom: 1px solid #e5e7eb;
}

.ig-import-main-input {
  display: grid;
  gap: 7px;
}

.ig-import-main-input label,
.ig-import-form-row label {
  color: #374151;
  font-size: 12px;
  font-weight: 800;
}

.ig-import-main-input textarea,
.ig-import-form-row input {
  width: 100%;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  color: #111827;
  outline: none;
}

.ig-import-main-input textarea {
  min-height: 104px;
  padding: 11px 12px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.45;
}

.ig-import-form-row input {
  height: 38px;
  padding: 0 10px;
  font-size: 13px;
}

.ig-import-main-input textarea:focus,
.ig-import-form-row input:focus {
  border-color: rgba(223, 10, 61, 0.5);
  box-shadow: 0 0 0 3px rgba(223, 10, 61, 0.08);
}

.ig-import-main-input > span {
  color: #7a8291;
  font-size: 12px;
}

.ig-import-form-row {
  display: grid;
  grid-template-columns: minmax(0, 220px) 96px auto;
  gap: 10px;
  align-items: end;
}

.ig-import-form-row label {
  display: grid;
  gap: 6px;
}

.ig-import-form-actions {
  display: flex;
  gap: 8px;
  align-items: end;
}

.ig-import-button {
  min-height: 36px;
  border-radius: 8px;
  border: 1px solid #dfe3ea;
  background: #fff;
  color: #374151;
  padding: 0 13px;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.ig-import-button.primary {
  border-color: #df0a3d;
  background: #df0a3d;
  color: #fff;
}

.ig-import-button.subtle {
  color: #6b7280;
}

.ig-import-button.danger {
  border-color: #b91c1c;
  background: #b91c1c;
  color: #fff;
}

.ig-import-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.ig-import-advanced {
  border-top: 0;
  padding-top: 0;
}

.ig-import-advanced summary {
  width: fit-content;
  color: #6b7280;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.ig-import-advanced > div {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 10px;
}

.ig-import-advanced label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #4b5563;
  font-size: 12px;
  font-weight: 700;
}

.ig-import-advanced input,
.ig-import-queue-row input {
  accent-color: #df0a3d;
}

.ig-import-summary {
  display: flex;
  gap: 12px;
  margin: 0;
  color: #6b7280;
  font-size: 12px;
}

.ig-import-summary strong {
  color: #111827;
  font-size: 14px;
}

.ig-import-queue-panel {
  margin-top: 16px;
  border-top: 1px solid #e5e7eb;
}

.ig-import-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid #edf0f4;
}

.ig-import-list-head h2 {
  margin: 0;
  color: #111827;
  font-size: 15px;
  font-weight: 850;
}

.ig-import-list-head span {
  color: #6b7280;
  font-size: 12px;
  font-weight: 700;
}

.ig-import-empty {
  padding: 44px 0;
  color: #7a8291;
  text-align: center;
  font-size: 13px;
}

.ig-import-queue {
  display: grid;
}

.ig-import-queue-row {
  display: grid;
  grid-template-columns: 54px minmax(260px, 1fr) minmax(240px, 0.85fr);
  gap: 14px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #edf0f4;
}

.ig-import-queue-row:last-child {
  border-bottom: 0;
}

.ig-import-row-select {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ig-import-row-index {
  color: #6b7280;
  font-size: 12px;
  font-weight: 850;
}

.ig-import-profile-cell {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.ig-import-profile-cell img,
.ig-import-avatar-fallback {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  object-fit: cover;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
}

.ig-import-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  font-size: 10px;
  font-weight: 900;
}

.ig-import-profile-cell strong,
.ig-import-profile-cell span,
.ig-import-stage-cell span {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.ig-import-profile-cell strong {
  color: #111827;
  font-size: 13px;
  line-height: 1.25;
  font-weight: 850;
}

.ig-import-profile-cell span,
.ig-import-stage-cell span {
  margin-top: 2px;
  color: #6b7280;
  font-size: 12px;
  line-height: 1.35;
}

.ig-import-profile-cell a,
.ig-import-stage-cell a {
  display: inline-block;
  margin-top: 3px;
  color: #df0a3d;
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
}

.ig-import-stage-cell {
  min-width: 0;
}

.ig-import-stage-top {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.ig-import-stage-top > span:last-child {
  color: #7a8291;
  font-size: 11px;
  font-weight: 800;
}

.ig-import-badge {
  display: inline-flex;
  width: fit-content;
  min-height: 23px;
  align-items: center;
  border-radius: 7px;
  padding: 0 8px;
  font-size: 10.5px;
  font-weight: 900;
}

.ig-import-badge.ready {
  background: #ecfdf3;
  color: #166534;
}

.ig-import-badge.error {
  background: #fef2f2;
  color: #991b1b;
}

.ig-import-badge.warn {
  background: #fffbeb;
  color: #92400e;
}

.ig-import-badge.skip {
  background: #f3f4f6;
  color: #4b5563;
}

.ig-import-badge.done {
  background: #eff6ff;
  color: #1d4ed8;
}

.ig-import-log {
  margin-top: 14px;
  padding: 0;
}

.ig-import-log summary {
  padding: 13px 16px;
  cursor: pointer;
  color: #374151;
  font-size: 13px;
  font-weight: 850;
}

.ig-import-log pre {
  margin: 0;
  max-height: 220px;
  overflow: auto;
  border-top: 1px solid #edf0f4;
  background: #111827;
  color: #d1d5db;
  padding: 12px 14px;
  font-size: 11.5px;
  line-height: 1.5;
}

.ig-import-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(17, 24, 39, 0.42);
  padding: 18px;
}

.ig-import-modal {
  width: min(720px, 100%);
  max-height: min(760px, calc(100dvh - 36px));
  overflow: auto;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 24px 80px rgba(17, 24, 39, 0.28);
}

.ig-import-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid #edf0f4;
}

.ig-import-modal-head span {
  color: #6b7280;
  font-size: 12px;
  font-weight: 850;
}

.ig-import-modal-head h2 {
  margin: 4px 0 0;
  color: #111827;
  font-size: 21px;
  line-height: 1.2;
}

.ig-import-modal-head p {
  margin: 4px 0 0;
  color: #6b7280;
  font-size: 13px;
}

.ig-import-modal-steps {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  padding: 14px 18px 0;
}

.ig-import-modal-steps span {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: #f3f4f6;
  color: #6b7280;
  padding: 0 8px;
  text-align: center;
  font-size: 11px;
  font-weight: 850;
}

.ig-import-modal-steps .is-active {
  background: #fff1f4;
  color: #b60731;
}

.ig-import-modal-steps .is-done {
  background: #ecfdf3;
  color: #166534;
}

.ig-import-modal-steps .is-error {
  background: #fef2f2;
  color: #991b1b;
}

.ig-import-modal-current {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
}

.ig-import-modal-current strong {
  color: #111827;
  font-size: 14px;
}

.ig-import-modal-current span:last-child {
  color: #4b5563;
  font-size: 13px;
  line-height: 1.45;
}

.ig-import-modal-log {
  margin: 0;
  max-height: 260px;
  overflow: auto;
  border-top: 1px solid #edf0f4;
  background: #111827;
  color: #d1d5db;
  padding: 13px 16px;
  font-size: 11.5px;
  line-height: 1.5;
}

@media (max-width: 980px) {
  .ig-import-admin-layout {
    grid-template-columns: 1fr;
  }

  .ig-import-page {
    padding: 20px 16px 36px;
  }

  .ig-import-page-head,
  .ig-import-list-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .ig-import-steps,
  .ig-import-modal-steps {
    flex-wrap: wrap;
    grid-template-columns: 1fr;
  }

  .ig-import-form-row,
  .ig-import-queue-row {
    grid-template-columns: 1fr;
  }

  .ig-import-summary {
    flex-wrap: wrap;
  }

  .ig-import-row-select {
    justify-content: space-between;
  }
}
