:root {
  color-scheme: light;
  --ink: #19323a;
  --muted: #4b646a;
  --teal: #086a63;
  --line: #cddfdd;
  font: 16px/1.45 Arial, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: #ecf4f3; }
.compact .lab { padding: 0; }
.compact .header { display: none; }
p, h1, h2, h3, ul { margin: 0; }
.lab { max-width: 1120px; margin: auto; padding: clamp(14px, 3vw, 32px); }
.header { margin-bottom: 18px; }
.header p { font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; color: var(--teal); margin-bottom: 5px; }
h1 { font-size: clamp(1.55rem, 4vw, 2.25rem); line-height: 1.12; }
h2 { font-size: 1.12rem; margin-bottom: 12px; }
h3 { font-size: .87rem; }
button, input, select { font: inherit; color: inherit; }
button, input, select { border: 1px solid var(--line); border-radius: 8px; background: #fff; min-height: 44px; }
button { cursor: pointer; padding: 6px 12px; }
button:hover { background: #edf7f5; }
button[aria-pressed=true] { background: var(--teal); border-color: var(--teal); color: #fff; }
button:disabled { opacity: .55; cursor: default; }
:focus-visible { outline: 3px solid #ad580f; outline-offset: 2px; }
.categories, .example-buttons { display: flex; flex-wrap: wrap; gap: 7px; }
.categories { margin: 0 0 12px; }
.layout { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.converter, .equivalents { background: #fff; border: 1px solid var(--line); border-radius: 13px; padding: clamp(13px, 2.2vw, 23px); min-width: 0; }
label { display: block; font-size: .84rem; font-weight: 700; margin-bottom: 4px; }
.amount input, .units select { width: 100%; padding: 7px 8px; }
.amount input, .result output, .equivalent-value { font-variant-numeric: tabular-nums; }
[aria-invalid=true] { border-color: #b53035; }
#input-error { color: #a01d29; font-size: .82rem; margin-top: 5px; }
.units { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: end; gap: 7px; margin-top: 12px; }
#swap { font-size: 1.2rem; min-width: 44px; }
.result { margin-top: 15px; background: #e6f4f1; padding: 12px; border-radius: 10px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.result > div { min-width: 0; max-width: 100%; }
.result-label { color: var(--muted); font-size: .8rem; }
.result output { display: block; color: #095751; font-size: clamp(1.25rem, 3vw, 1.9rem); font-weight: 700; overflow-wrap: anywhere; }
#copy { font-size: .82rem; }
#calculation { font-size: .88rem; color: var(--muted); margin-top: 8px; overflow-wrap: anywhere; }
#copy-status { min-height: 1.5em; font-size: .8rem; color: var(--teal); }
.examples { border-top: 1px solid var(--line); margin-top: 5px; padding-top: 10px; }
.example-buttons { margin-top: 6px; }
.example-buttons button { font-size: .82rem; }
.equivalents > p { margin-top: -6px; font-size: .82rem; color: var(--muted); }
.equivalents ul { list-style: none; padding: 0; display: grid; gap: 5px; margin-top: 10px; }
.equivalents li button { width: 100%; text-align: left; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.equivalents li button[aria-pressed=true] { background: #e6f4f1; color: #095751; border-color: #8bbdb4; }
.equivalent-unit { font-size: .82rem; }
.equivalent-value { text-align: right; font-weight: 700; overflow-wrap: anywhere; min-width: 0; }
details { margin-top: 12px; font-size: .87rem; }
summary { cursor: pointer; padding: 6px 0; }
.prefixes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px 10px; margin: 6px 0 0; }
.prefixes div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 5px; border-bottom: 1px solid var(--line); }
.prefixes dd { margin: 0; font-weight: 700; }
@media (max-width: 660px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .categories button { flex: 1 1 auto; padding-inline: 7px; font-size: .85rem; }
}
