/* 단위 변환기: 계측기 눈금. 값 크기(자릿수)를 눈금 위 바늘 위치로 보여 준다. */
:root { --accent: #c2410c; --on-accent: #fffaf6; --accent-soft: #c2410c1f; }
@media (prefers-color-scheme: dark) { :root { --accent: #f08a4b; --on-accent: #1b0d04; --accent-soft: #f08a4b24; } }

.cats { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 16px; }
.cat {
  min-height: 44px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 999px;
  background: transparent; cursor: pointer; font-weight: 600; font-size: 0.9375rem;
  touch-action: manipulation;
  transition: background-color 160ms var(--ease), border-color 160ms var(--ease);
}
.cat[aria-checked="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.meter {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 14px 12px;
}
.row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 42%); gap: 8px; align-items: center; }
.val {
  min-width: 0; min-height: 56px; width: 100%;
  padding: 0 4px;
  border: 0; border-bottom: 2px solid var(--line-strong); border-radius: 0;
  background: transparent;
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  font-size: clamp(1.25rem, 6.4vw, 1.75rem); font-weight: 600; letter-spacing: -0.02em;
}
.val:focus { outline: none; border-bottom-color: var(--accent); }
.out {
  display: flex; align-items: center; overflow-x: auto; white-space: nowrap;
  border-bottom-color: var(--accent); color: var(--accent);
  scrollbar-width: none;
}
.out::-webkit-scrollbar { display: none; }
.unit {
  min-height: 48px; width: 100%; min-width: 0;
  padding: 0 28px 0 10px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); font-weight: 600;
  text-overflow: ellipsis;
}

/* 눈금자: 긴 눈금 10칸, 짧은 눈금 50칸. 바늘은 10^-6 ~ 10^9 범위의 로그 위치. */
.scale {
  position: relative;
  height: 44px; margin: 12px 56px 8px 0;
  background:
    linear-gradient(var(--line-strong), var(--line-strong)) left bottom / 100% 1px no-repeat,
    repeating-linear-gradient(90deg, var(--line-strong) 0 1px, transparent 1px 10%) left bottom / 100% 18px no-repeat,
    repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px 2%) left bottom / 100% 9px no-repeat;
}
.needle {
  position: absolute; left: 0; bottom: 0;
  width: 2px; height: 40px; margin-left: -1px;
  background: var(--accent);
  transform: translateX(var(--x, 0px));
  transition: transform 420ms var(--ease);
}
.needle::after {
  content: ""; position: absolute; top: -3px; left: -4px;
  width: 10px; height: 10px; border-radius: 50%; background: var(--accent);
}

.swap {
  position: absolute; right: 14px; top: 50%;
  width: 48px; height: 48px; margin-top: -24px;
  border-radius: 50%; border: 1px solid var(--accent);
  background: var(--surface); color: var(--accent);
  font-size: 1.375rem; cursor: pointer; touch-action: manipulation;
  transition: transform 300ms var(--ease);
}
.swap:active { transform: rotate(180deg) scale(0.96); }

.formula { margin: 10px 2px 0; font-size: 0.875rem; color: var(--muted); font-variant-numeric: tabular-nums; min-height: 1.5em; }

.h2 { font-size: 0.9375rem; margin: 8px 0 8px; color: var(--muted); font-weight: 700; }
.all { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.all li {
  display: flex; justify-content: space-between; gap: 8px; align-items: baseline;
  min-height: 44px; padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.all .n { font-family: var(--mono); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; text-align: right; }
.all .u { color: var(--muted); font-size: 0.875rem; white-space: nowrap; }
.all li.is-to .n { color: var(--accent); font-weight: 700; }
@media (max-width: 420px) { .all { grid-template-columns: minmax(0, 1fr); } }
