/* unit-convert: value and unit pickers, the live result and the all-units table. */
.uc-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--matrix-space-12) var(--matrix-space-16); align-items: end; }
.uc-row--units { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
.uc-field { display: grid; gap: var(--matrix-space-8); min-width: 0; }
.uc-field label { font-weight: 600; }
.uc-field select, .uc-field input { width: 100%; box-sizing: border-box; }
.matrix-ui .uc-value { font-family: var(--matrix-font-mono); font-size: 1.125rem; }
.uc-error { margin: 0; font-size: var(--matrix-type-caption); }
.uc-error:empty { display: none; }
.uc-swap { align-self: end; }
.uc-line { font-family: var(--matrix-font-mono); font-size: 1.35rem; overflow-wrap: anywhere; }
.uc-scroll { max-height: 50vh; overflow: auto; border: 1px solid var(--matrix-border); border-radius: var(--matrix-radius-control); background: var(--matrix-surface); margin-top: var(--matrix-space-12); }
.uc-table { width: 100%; border-collapse: collapse; font-size: var(--matrix-type-control); }
.uc-caption { caption-side: top; text-align: left; padding: 6px 8px; color: var(--matrix-muted); font-size: var(--matrix-type-caption); }
.uc-table th { position: sticky; top: 0; background: var(--matrix-surface-subtle); color: var(--matrix-muted); font-weight: 600; text-align: left; padding: 4px 8px; border-bottom: 1px solid var(--matrix-border); }
.uc-table td { padding: 3px 8px; border-bottom: 1px solid var(--matrix-border); }
.uc-table .uc-num { text-align: right; font-family: var(--matrix-font-mono); white-space: nowrap; }
.uc-table tr.uc-target { background: var(--matrix-selected); }
.uc-table tr.uc-target td { color: var(--matrix-selected-text); font-weight: 600; }
.uc-table tr.uc-source td { color: var(--matrix-muted); }
@media (max-width: 560px) {
  .uc-row--units { grid-template-columns: 1fr; }
  .uc-swap { justify-self: start; }
}
