/* Unit converter (templates/unit_converter/*) */
.cv-head { padding: 10px 0 16px; }
.cv-head h1 { margin: 0 0 6px; font-size: clamp(1.35rem, 3.4vw, 1.9rem); }
.cv-head p { margin: 0; color: var(--muted); }
.cv-ico { display: inline-grid; place-items: center; vertical-align: middle; margin-right: 12px; width: 44px; height: 44px; flex: none;
  border-radius: 14px; background: #dbeafe; color: #1d4ed8; }
.cv-ico .icon { width: 24px; height: 24px; }
@media (prefers-color-scheme: dark) { .cv-ico { background: #1c2840; color: #f1eee9; } }

.cv-box { display: flex; flex-direction: column; gap: 12px; }
.cv-cats { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.cv-cat { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; font: inherit; font-size: .85rem; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px; cursor: pointer; }
.cv-cat .icon { width: 15px; height: 15px; }
.cv-cat.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.cv-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; align-items: center; }
.cv-side { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cv-num { width: 100%; font-size: clamp(1.4rem, 4vw, 1.9rem) !important; font-weight: 700; padding: 10px 14px !important;
  font-variant-numeric: tabular-nums; }
.cv-out { display: block; min-height: 58px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent);
  border: 1px solid transparent; overflow-wrap: anywhere; }
.cv-swap { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font-size: 1.3rem; cursor: pointer; }
.cv-swap:hover { border-color: var(--accent); color: var(--accent); }
.cv-formula { margin: 0; color: var(--muted); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.cv-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cv-tools label { display: flex; align-items: center; gap: 6px; }
.cv-tools select { padding: 5px 8px; font-size: .85rem; }
.cv-msg { margin: 0; padding: 8px 12px; border-radius: var(--radius-sm); }
.cv-msg.ok { background: var(--ok-soft); color: var(--ok); }
.cv-msg.bad { background: var(--bad-soft); color: var(--bad); }

.cv-section { margin-top: 26px; }
.cv-section h2 { font-size: 1.15rem; margin: 0 0 12px; }
.cv-links { display: flex; flex-wrap: wrap; gap: 6px; }
.cv-links a { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: .88rem; color: var(--text); text-decoration: none; background: var(--surface); }
.cv-links a:hover { border-color: var(--accent); color: var(--accent); }
.cv-cat-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.cv-cat-card { display: flex; gap: 12px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--text); text-decoration: none; transition: border-color .15s, transform .15s; }
.cv-cat-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.cv-cat-card .cv-ico { margin: 0; width: 40px; height: 40px; }
.cv-cat-card small { display: block; color: var(--muted); font-size: .8rem; margin-top: 2px; }

.cv-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.cv-table th, .cv-table td { padding: 7px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.cv-table tbody th { font-weight: 400; }
.cv-table td { text-align: right; }
.cv-table-2 td { text-align: left; }
.cv-table-2 tbody tr:nth-child(even) { background: var(--bg); }
.cv-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.cv-two h2 { font-size: 1.05rem; }
.cv-two h3 { font-size: .95rem; margin: 14px 0 6px; }
.cv-big-formula { font-size: 1.15rem; font-weight: 600; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--bg); margin: 0; }
.cv-batch textarea { width: 100%; resize: vertical; font-variant-numeric: tabular-nums; }
#cv-batch-out { max-height: 360px; overflow: auto; margin-top: 10px; }
.cv-matrix { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.cv-matrix h3 { font-size: .95rem; margin: 0 0 6px; }
.cv-matrix ul { margin: 0; padding-left: 1.1em; font-size: .88rem; line-height: 1.7; }
.cv-notes dt { font-weight: 600; margin-top: 10px; }
.cv-notes dd { margin: 2px 0 0; color: var(--muted); }

@media (max-width: 720px) {
  .cv-row { grid-template-columns: minmax(0, 1fr); }
  .cv-swap { justify-self: center; transform: rotate(90deg); }
  .cv-two { grid-template-columns: minmax(0, 1fr); }
}
