/* Unit converter. Builds on calc.css: one input, one big answer, quiet everything else. */
main.uc { gap: 20px; }
.uc-digits { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-3); }
.uc-eng { font-size: 12.5px; padding: 4px 9px; border: 1px solid transparent; }
.uc-eng[aria-pressed="true"] { background: var(--text); color: var(--on-accent); }

/* ---------- hero ---------- */
.uc-hero { padding: 18px 22px 16px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.uc-label { display: block; font-size: 12.5px; color: var(--text-3); margin-bottom: 7px; }
.uc-ex { border: 0; background: none; padding: 0; font: inherit; color: var(--text-2); cursor: pointer; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 2px; }
.uc-ex:hover { color: var(--text); text-decoration-color: currentColor; }
.uc-inrow { position: relative; display: flex; gap: 6px; align-items: stretch; }
#q { flex: 1; min-width: 0; font: 400 22px/1.3 var(--font); padding: 11px 14px; border: 1px solid var(--line-2); border-radius: 10px; outline: none; background: var(--surface); color: var(--text); font-feature-settings: "tnum", "cv11"; }
#q:focus { border-color: var(--text); box-shadow: 0 0 0 3px rgba(23, 24, 26, .06); }
.uc-icon { flex: none; width: 48px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text-2); cursor: pointer; display: grid; place-items: center; }
.uc-icon:hover { border-color: var(--line-2); color: var(--text); }
#fav[aria-pressed="true"] { color: var(--warn); --star: var(--x-f2c14e, #f2c14e); }
.uc-ac { position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; width: min(460px, 100%); margin: 0; padding: 4px; list-style: none; background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: 0 10px 28px rgba(0, 0, 0, .10); }
.uc-ac li { display: grid; grid-template-columns: minmax(64px, auto) minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 6px 10px; border-radius: 7px; cursor: pointer; font-size: 13px; }
.uc-ac li b { font-weight: 600; }
.uc-ac li span { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uc-ac li i { font-style: normal; color: var(--text-3); font-size: 11.5px; white-space: nowrap; }
.uc-ac li:hover, .uc-ac li.on { background: var(--sel-bg); }
.uc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.uc-chips[hidden] { display: none; }
.uc-chip { border: 1px solid var(--line); background: var(--surface-2); border-radius: 999px; padding: 3px 11px; font-size: 12px; color: var(--text-2); cursor: pointer; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uc-chip:hover { border-color: var(--line-2); color: var(--text); }
.uc-chip.fav span { color: var(--x-c9952c, #c9952c); margin-right: 4px; }

.uc-out { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 300px); gap: 8px 28px; align-items: start; }
.uc-big { display: flex; flex-wrap: wrap; align-items: baseline; font-size: 40px; line-height: 1.15; font-weight: 600; letter-spacing: -.01em; min-height: 46px; overflow-wrap: anywhere; }
.uc-big .uc-u { font-weight: 500; color: var(--text-2); font-size: 28px; }
.uc-big.dim { color: var(--text-3); }
.uc-exact { display: inline-block; vertical-align: 6px; margin-left: 10px; font-size: 11px; font-weight: 500; letter-spacing: 0; color: var(--good-ink); background: var(--good-bg); border-radius: 999px; padding: 2px 8px; line-height: 1.4; }
.uc-exact.more { color: var(--text-3); background: var(--fill-1); }
.uc-copy { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 10px 0 12px; }
.uc-copy.off .btn { opacity: .45; pointer-events: none; }
.uc-keys { font-size: 11.5px; color: var(--text-3); margin-left: 6px; }
.uc-facts { margin: 0; display: grid; gap: 6px; font-size: 13px; }
.uc-facts > div { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 10px; }
.uc-facts dt { color: var(--text-3); }
.uc-facts dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }
.uc-arrow { color: var(--text-3); }
.uc-inv { display: block; color: var(--text-2); font-size: 12.5px; }
.uc-qn { color: var(--text-2); margin-left: 8px; }
.uc-honest { display: block; color: var(--text-3); font-size: 12.5px; }
.uc-tag { display: inline-block; font-size: 10.5px; font-weight: 500; padding: 1px 7px; border-radius: 999px; vertical-align: 1px; margin-left: 4px; white-space: nowrap; }
.uc-tag.exact, .uc-tag.conventional { color: var(--good-ink); background: var(--good-bg); }
.uc-tag.rounded, .uc-tag.empirical { color: var(--warn); background: var(--warn-bg); }
.uc-notes { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 4px; font-size: 12.5px; color: var(--text-2); }
.uc-notes:empty { display: none; }
.uc-notes li { padding-left: 14px; position: relative; }
.uc-notes li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 5px; height: 5px; border-radius: 50%; background: var(--warn); }
.uc-notes li.err { color: var(--bad); font-weight: 500; }
.uc-notes li.err::before { background: var(--bad); }
.uc-notes li.soft { color: var(--text-3); }
.uc-notes li.soft::before { background: var(--line-2); }
.uc-hint { display: block; color: var(--text-2); font-weight: 400; }

.uc-alt h2 { font-size: 12px; font-weight: 500; color: var(--text-3); margin: 4px 0 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uc-alt ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.uc-alt li button { display: flex; width: 100%; justify-content: space-between; gap: 12px; align-items: baseline; border: 0; border-bottom: 1px solid var(--fill-1); background: none; padding: 5px 4px; font: inherit; font-size: 13px; cursor: pointer; text-align: left; color: var(--text); }
.uc-alt li button:hover { background: var(--surface-2); }
.uc-alt .v { font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.uc-alt .u { color: var(--text-2); white-space: nowrap; }
.uc-alt li button { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; }
.uc-alt .nm { min-width: 0; white-space: normal; line-height: 1.25; text-align: right; font-size: 11.5px; color: var(--text-3); }
.uc-none { margin: 0 0 12px; padding: 14px 16px; background: var(--surface); border: 1px dashed var(--line-2); border-radius: 12px; font-size: 13px; color: var(--text-2); }
.uc-none[hidden] { display: none; }

.uc-viz { border-top: 1px solid var(--line); padding-top: 10px; }
.uc-viz svg { display: block; width: 100%; height: auto; max-height: 104px; }
.vz-ax { stroke: var(--steel-350); stroke-width: 1; }
.vz-t { stroke: var(--steel-500); stroke-width: 1; }
.vz-l { font-size: 11px; fill: var(--text-3); font-variant-numeric: tabular-nums; }
.vz-l.u { fill: var(--text-2); font-weight: 500; }
.vz-l.ref { fill: var(--text-2); }
.vz-bar { fill: color-mix(in srgb, var(--sel) 14%, transparent); }
.vz-track { fill: var(--fill-1); }
.vz-mark { stroke: var(--sel); stroke-width: 2; }
.vz-ref { stroke: var(--text-2); stroke-width: 1; stroke-dasharray: 2 2; }

.uc-defs h2 { font-size: 12px; font-weight: 500; color: var(--text-3); margin: 0 0 4px; }
.uc-defs:empty { display: none; }
.uc-defs { border-top: 1px solid var(--line); padding-top: 10px; }
.uc-defs ul, .uc-pop ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; font-size: 12.5px; color: var(--text-2); }
.uc-defs b, .uc-pop b { color: var(--text); font-weight: 600; margin-right: 4px; }
.uc-defs .nm, .uc-pop .nm { margin-right: 8px; }
.uc-defs .eq, .uc-pop .eq { color: var(--text); font-variant-numeric: tabular-nums; }
.uc-defs a, .uc-pop a { color: var(--text-3); font-size: 11.5px; }
.uc-defs .nt, .uc-pop .nt { display: block; color: var(--text-3); font-size: 11.5px; }

/* ---------- quantity cards ---------- */
.uc-sechead { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; margin: 4px 0 10px; }
.uc-sechead .note { flex: 1; min-width: 200px; }
#cardFilter { width: 240px; max-width: 100%; border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 10px; outline: none; background: var(--surface); font-size: 13px; }
#cardFilter:focus { border-color: var(--text); }
.uc-cards { display: flex; gap: 14px; align-items: flex-start; }
.uc-col { flex: 1; min-width: 0; }
.uc-card { break-inside: avoid; margin: 0 0 14px; padding: 12px 14px 12px; display: block; }
.uc-card[hidden] { display: none; }
.uc-card header { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.uc-card h3 { font-size: 13.5px; font-weight: 600; margin: 0; }
.uc-card header span { font-size: 11.5px; color: var(--text-3); }
.uc-glabel { font-size: 11px; font-weight: 600; color: var(--text-3); margin: 10px 0 3px; letter-spacing: .01em; }
.uc-rows { display: grid; }
.uc-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: center; gap: 8px; padding: 1px 0; }
.uc-unit { display: flex; align-items: baseline; gap: 6px; min-width: 0; border: 0; background: none; padding: 3px 0; text-align: left; font: inherit; font-size: 12.5px; color: var(--text-2); cursor: pointer; white-space: nowrap; }
.uc-unit .sym { flex: none; }
.uc-unit { flex-wrap: wrap; row-gap: 0; }   /* a long symbol puts its name on the next line instead of overflowing (T102) */
.uc-unit .nm { flex: 1 1 auto; min-width: 0; white-space: normal; line-height: 1.25; font-size: 11.5px; color: var(--text-3); font-weight: 400; }   /* full names, wrapping (T102) */
.uc-unit mark, .uc-card h3 mark, .uc-alt mark { background: var(--mark); color: inherit; border-radius: 2px; padding: 0 1px; margin: 0 -1px; }
.uc-unit:hover .sym { color: var(--text); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 2px; }
.uc-unit.plain { cursor: default; text-decoration: none; }
.uc-row input, .uc-param input, .uc-param select { width: 100%; min-width: 0; border: 1px solid transparent; border-bottom-color: var(--fill-2); border-radius: 6px; padding: 3px 7px; font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; outline: none; background: transparent; }
.uc-row input:hover { border-color: var(--line); }
.uc-row input:focus, .uc-param input:focus, .uc-param select:focus { border-color: var(--text); background: var(--surface); }
.uc-row input.bad { border-color: var(--bad); }
/* the row the card's values come from */
.uc-row.src .uc-unit { color: var(--text); font-weight: 600; }
.uc-row.src .uc-unit .sym::after { content: "from"; margin-left: 6px; font-size: 9.5px; font-weight: 500; letter-spacing: .02em; color: var(--sel); background: var(--sel-bg-2); border-radius: 4px; padding: 0 4px; vertical-align: 1px; }
.uc-row.src input { background: var(--sel-bg); }   /* the source row: a quiet tint only, no accent edge */
.uc-row.src input:focus { border-color: var(--text); }   /* same focus as every other field on the site */
.uc-param { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center; margin-top: 8px; padding: 6px 8px; background: var(--surface-2); border-radius: 8px; font-size: 12px; color: var(--text-2); }
.uc-param input, .uc-param select { border-color: var(--line); background: var(--surface); }
.uc-param select { text-align: left; }
.uc-param em { font-style: normal; color: var(--text-3); }
.uc-ratio { margin-top: 2px; }
.uc-foot { margin: 8px 0 0; font-size: 11.5px; color: var(--text-3); line-height: 1.45; }
.uc-link p { margin: 0; font-size: 12.5px; color: var(--text-2); }

/* ---------- tables ---------- */
.uc-tables { padding: 16px 20px 18px; }
.uc-tblhead { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 8px; }
.uc-tblhead h2 { margin-right: auto; }
.uc-tables > div > .note, #tblBody > .note { margin: 4px 0 10px; }
.uc-tables .key { display: inline-block; }
.uc-fr { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 18px; }
table.uc-tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.uc-tbl th { font-weight: 500; font-size: 11.5px; color: var(--text-3); text-align: right; padding: 5px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.uc-tbl td { text-align: right; padding: 3px 6px; border-bottom: 1px solid var(--steel-50); white-space: nowrap; color: var(--text-2); }
.uc-tbl .l { text-align: left; }
.uc-tbl td.fits { white-space: normal; min-width: 120px; color: var(--text-3); }
.uc-tbl .fits-m { display: none; }
.uc-tbl tr.main td { color: var(--text); font-weight: 600; }
.uc-tbl tr.mid td { color: var(--text); font-weight: 500; }
.uc-tbl tr.drill td:first-child { box-shadow: inset 2px 0 0 var(--x-c9d6f5, #c9d6f5); }
.uc-tbl tr.close td { background: var(--sel-bg); }
.uc-tbl tr.in td:first-child b { color: var(--moment); }
.uc-tbl sup, .uc-tbl sub { font-size: .78em; line-height: 0; }
.uc-tbl td.tg { width: 26px; padding-left: 0; }
.t-wr { display: inline-block; font-size: 9.5px; font-weight: 600; color: var(--clamp); border: 1px solid currentColor; border-radius: 4px; padding: 0 3px; line-height: 1.35; }
.k-mid { font-weight: 500; color: var(--text); }
.k-dr { display: inline-block; width: 2px; height: 11px; background: var(--x-c9d6f5, #c9d6f5); vertical-align: -1px; margin: 0 2px; }

/* ---------- popover, toast ---------- */
.uc-pop { position: absolute; z-index: 30; background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: 0 10px 28px rgba(0, 0, 0, .12); padding: 12px 30px 12px 14px; }
.uc-pop .x { position: absolute; top: 6px; right: 6px; border: 0; background: none; font-size: 16px; color: var(--text-3); cursor: pointer; width: 24px; height: 24px; border-radius: 6px; }
.uc-pop .x:hover { background: var(--fill-1); color: var(--text); }
.uc-pop .eq { display: block; }
.uc-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: var(--on-accent); padding: 8px 14px; border-radius: 8px; font-size: 13px; z-index: 40; max-width: calc(100vw - 32px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 1100px) { .uc-fr { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 420px) { .uc-tbl .c-kc { display: none; } }
@media (max-width: 820px) {
  .uc-alt .nm { display: none; }
  .uc-alt li button { grid-template-columns: minmax(0, 1fr) auto; }
  .uc-out { grid-template-columns: minmax(0, 1fr); }
  .uc-alt ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); column-gap: 16px; }
}
@media (max-width: 560px) {
  .uc-hero { padding: 14px; }
  #q { font-size: 19px; padding: 10px 12px; }
  .uc-icon { width: 42px; }
  .uc-big { font-size: 32px; }
  .uc-big .uc-u { font-size: 22px; }
  .uc-keys { display: none; }
  .uc-facts > div { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .uc-fr { grid-template-columns: minmax(0, 1fr); }
  .uc-tables { padding: 14px; }
  .uc-digits > span { display: none; }
  .uc-tbl td.fits { min-width: 0; }
  .uc-tbl .c-in, .uc-tbl .c-fits { display: none; }
  .uc-tbl .fits-m { display: block; font-size: 11px; color: var(--text-3); white-space: normal; }
  .uc-card { margin-bottom: 8px; padding: 0 14px; }
  .uc-card > header { cursor: pointer; padding: 12px 0; margin: 0; }
  .uc-card > header::after { content: "+"; margin-left: auto; color: var(--text-3); }
  .uc-card.open > header::after { content: "−"; }
  .uc-card.open { padding-bottom: 12px; }
  .uc-card:not(.open) > :not(header) { display: none; }
  .uc-link > header::after { content: none; }
}
@media print {
  body.print-tbl .bar, body.print-tbl .site-foot, body.print-tbl main > :not(.uc-tables), body.print-tbl .uc-tblhead .seg, body.print-tbl #printTbl, body.print-tbl .uc-pop, body.print-tbl .ver { display: none !important; }
  body.print-tbl { background: var(--surface); }
  body.print-tbl .uc-tables { border: 0; padding: 0; }
  body.print-tbl .uc-fr { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  body.print-tbl .uc-tbl td { padding: 1px 4px; }
}

/* theme-auto:start · generated by scripts/theme/hexmap.py: dark values (the rule of scripts/theme/colour.py) for
   colours that are not tokens, written as var(--x-rrggbb, #rrggbb): light is the fallback, unchanged */
@media screen and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --x-c9952c: #e6bb6e; --x-c9d6f5: #31394d; --x-f2c14e: #b99339;
  }
}
@media screen {
  :root[data-theme="dark"] {
    --x-c9952c: #e6bb6e; --x-c9d6f5: #31394d; --x-f2c14e: #b99339;
  }
}
/* theme-auto:end */
