.pair-converter {
  --pair-line: #dfe5ef;
  --pair-accent: #5f46cb;
  --pair-muted: #68758b;
  min-width: 0;
  padding: 1.5rem;
  border: 1px solid var(--pair-line);
  border-radius: 16px;
  background: #fff;
}

.pair-converter > .pair-overline {
  margin: 0 0 .45rem;
  color: var(--pair-accent);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.pair-converter > h2 {
  margin: 0 0 .45rem;
  color: #1b263c;
  font-size: clamp(1.25rem, 3vw, 1.65rem);
  font-weight: 800;
  letter-spacing: -.035em;
}

.pair-converter > p {
  margin: 0;
  color: var(--pair-muted);
  font-size: .9rem;
}

.pair-upload {
  display: flex;
  min-width: 0;
  min-height: 230px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: 1.25rem;
  padding: 2rem 1rem;
  border: 2px dashed #b5bfd0;
  border-radius: 15px;
  background: #fafbfe;
  text-align: center;
  transition: border-color .15s, background-color .15s, transform .15s;
}

.pair-upload.drag-active {
  transform: scale(1.005);
  border-color: var(--pair-accent);
  background: #f3f0ff;
}

.pair-upload-icon {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  margin-bottom: .9rem;
  border-radius: 15px;
  background: #eeecf8;
  color: var(--pair-accent);
  font-size: 1.6rem;
  font-weight: 800;
}

.pair-upload > strong {
  color: #263248;
  font-size: .98rem;
}

.pair-upload > p {
  margin: .4rem 0;
  color: var(--pair-muted);
  font-size: .83rem;
}

.pair-upload .pair-file-note {
  margin: .75rem 0 0;
  font-size: .76rem;
}

.pair-converter .btn {
  min-height: 42px;
  border-radius: 9px;
  font-weight: 750;
}

.pair-error {
  padding: .9rem 1rem;
  border: 1px solid #f1c6c2;
  border-radius: 10px;
  background: #fff6f5;
  color: #8e2b23;
}

.pair-error h3 {
  margin: 0 0 .25rem;
  font-size: .95rem;
  font-weight: 800;
}

.pair-error p {
  margin: 0;
  font-size: .84rem;
}

.pair-preview-layout,
.pair-complete-layout {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  align-items: center;
  gap: clamp(1.2rem, 4vw, 2.5rem);
  margin-top: 1.4rem;
}

.pair-preview-image,
.pair-result-image {
  display: block;
  width: 100%;
  max-height: 360px;
  border: 1px solid var(--pair-line);
  border-radius: 12px;
  background:
    linear-gradient(45deg, #f1f3f7 25%, transparent 25%),
    linear-gradient(-45deg, #f1f3f7 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #f1f3f7 75%),
    linear-gradient(-45deg, transparent 75%, #f1f3f7 75%);
  background-color: #fff;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
  object-fit: contain;
}

.pair-preview-layout .pair-file-note,
.pair-complete-layout .pair-file-note {
  margin-bottom: .3rem;
  color: var(--pair-muted);
  font-size: .78rem;
}

.pair-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .65rem;
  margin: 1rem 0;
}

.pair-fact {
  display: grid;
  min-width: 0;
  gap: .2rem;
  padding: .7rem .8rem;
  border: 1px solid #e9edf4;
  border-radius: 9px;
  background: #fbfcfe;
}

.pair-fact small {
  color: var(--pair-muted);
  font-size: .72rem;
}

.pair-fact strong {
  overflow-wrap: anywhere;
  color: #263248;
  font-size: .86rem;
}

.pair-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-top: 1.1rem;
}

.pair-state-panel {
  margin-top: 1.35rem;
  padding: clamp(1rem, 3vw, 1.6rem);
  border: 1px solid #e7eaf2;
  border-radius: 14px;
  background: #fbfcff;
}

.pair-state-panel > p:first-child {
  color: #263248;
  font-size: 1rem;
}

.pair-status-list {
  display: grid;
  gap: .55rem;
  margin: 1rem 0 1.5rem;
  padding: 0;
  color: #8590a2;
  font-size: .82rem;
  list-style: none;
}

.pair-status-list li {
  display: flex;
  align-items: center;
  gap: .6rem;
}

.pair-status-list li::before {
  display: grid;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  place-items: center;
  border: 1px solid #d9deea;
  border-radius: 50%;
  background: #fff;
  color: #8590a2;
  content: attr(data-stage);
  font-size: .68rem;
  font-weight: 800;
}

.pair-status-list li.is-current {
  color: var(--pair-accent);
  font-weight: 800;
}

.pair-status-list li.is-current::before {
  border-color: var(--pair-accent);
  background: #eeecf8;
  color: var(--pair-accent);
}

.pair-status-list li.is-done {
  color: #16845a;
}

.pair-status-list li.is-done::before {
  border-color: #bce8d4;
  background: #eaf8f1;
  color: #16845a;
  content: "✓";
}

.pair-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .5rem;
  color: #354158;
  font-size: .84rem;
}

.pair-progress-head output {
  color: var(--pair-accent);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.pair-progress {
  height: 10px;
  overflow: hidden;
  border-radius: 99px;
  background: #e8eaf1;
}

.pair-progress .progress-bar {
  border-radius: inherit;
  background: var(--pair-accent);
  transition: width .18s ease;
}

.pair-time {
  margin: .85rem 0 0;
  color: var(--pair-muted);
  font-size: .82rem;
}

.pair-time strong {
  color: #263248;
  font-variant-numeric: tabular-nums;
}

.pair-conversion-label {
  display: inline-flex;
  align-items: center;
  padding: .35rem .65rem;
  border-radius: 99px;
  background: #eeecf8;
  color: var(--pair-accent);
  font-size: .75rem;
  font-weight: 800;
}

@media (max-width: 575px) {
  .pair-converter {
    padding: 1rem;
  }

  .pair-upload {
    min-height: 210px;
    padding: 1.7rem .75rem;
  }

  .pair-preview-layout,
  .pair-complete-layout {
    gap: 1.1rem;
  }

  .pair-facts {
    gap: .5rem;
  }

  .pair-fact {
    padding: .6rem;
  }

  .pair-actions > .btn {
    flex: 1 1 100%;
  }
}
