/* Scientific Unit & SI Prefix Converter.
   Uses only the site theme variables from ui.css, so light and dark
   mode both work. No hardcoded colours. British spelling in copy. */

.uc-card {
  max-width: none;
}

.uc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr auto 1fr;
  gap: var(--s3);
  align-items: end;
}

.uc-grid .field {
  margin-bottom: 0;
}

.uc-swap-wrap {
  padding-bottom: 1px;
}

.uc-swap {
  white-space: nowrap;
}

.uc-result {
  margin-top: var(--s4);
  padding: var(--s4);
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-card);
}

.uc-result-value {
  margin: 0;
  font-size: var(--fs-xl);
  font-weight: 700;
  line-height: var(--lh-tight);
  color: var(--ink);
  overflow-wrap: break-word;
}

.uc-formula {
  margin: var(--s2) 0 0;
  font-size: var(--fs-sm);
  color: var(--muted);
  line-height: var(--lh);
  overflow-wrap: break-word;
}

.uc-formula:empty {
  display: none;
}

.uc-actions {
  margin-top: var(--s3);
  display: flex;
  gap: var(--s2);
}

.uc-prefix-table {
  max-width: 480px;
}

.uc-prefix-table td:nth-child(2),
.uc-prefix-table td:nth-child(3) {
  font-family: var(--font-mono);
}

@media (max-width: 640px) {
  .uc-grid {
    grid-template-columns: 1fr 1fr;
  }

  .uc-swap-wrap {
    grid-column: 1 / -1;
    order: 3;
  }

  .uc-swap {
    width: 100%;
    justify-content: center;
  }

  .uc-grid .field:nth-child(4) {
    order: 4;
  }

  .uc-result-value {
    font-size: var(--fs-lg);
  }
}
