:root {
  --bg: #f5f0e8;
  --surface: #fffcf7;
  --surface-2: #f7f1e7;
  --ink: #1f1b16;
  --muted: #6e665b;
  --faint: #a59c8f;
  --line: #e8e0d3;
  --glass: rgba(140, 160, 180, 0.08);
  --glass-stroke: #8d98a4;
  --scale: #2a2622;
  --scale-lip: #3a352f;
  --lcd: #cfe0c3;
  --lcd-ink: #1f2b17;
  --shadow: 0 1px 2px rgba(40, 30, 20, .05), 0 18px 40px -18px rgba(40, 30, 20, .22);
  --ing: #2b7bbf;
  --ing-ui: var(--ing);
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12110f;
    --surface: #1b1916;
    --surface-2: #23201c;
    --ink: #f2ece2;
    --muted: #a69d90;
    --faint: #6f675c;
    --line: #2f2a25;
    --glass: rgba(170, 190, 210, 0.06);
    --glass-stroke: #8a95a1;
    --scale: #0c0b0a;
    --scale-lip: #26231f;
    --lcd: #a9c49a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 18px 40px -18px rgba(0, 0, 0, .6);
    --ing-ui: color-mix(in oklab, var(--ing) 62%, white);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #12110f;
  --surface: #1b1916;
  --surface-2: #23201c;
  --ink: #f2ece2;
  --muted: #a69d90;
  --faint: #6f675c;
  --line: #2f2a25;
  --glass: rgba(170, 190, 210, 0.06);
  --glass-stroke: #8a95a1;
  --scale: #0c0b0a;
  --scale-lip: #26231f;
  --lcd: #a9c49a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 18px 40px -18px rgba(0, 0, 0, .6);
  --ing-ui: color-mix(in oklab, var(--ing) 62%, white);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--ing-ui); outline-offset: 2px; border-radius: 8px; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 28px; }

/* Header */
.top { display: flex; justify-content: space-between; align-items: center; padding-top: 22px; padding-bottom: 22px; }
.brand { display: flex; gap: 10px; align-items: center; color: var(--ink); text-decoration: none; font-family: var(--sans); font-weight: 600; font-size: 19px; letter-spacing: -.01em; }
.brand-mark { width: 26px; height: 26px; }
.brand-fill { fill: var(--ing-ui); transition: fill .4s; }

/* Intro */
.intro { padding: 36px 0 32px; max-width: 760px; }
h1 { font-family: var(--sans); font-weight: 700; font-size: clamp(38px, 5.6vw, 64px); line-height: 1.02; letter-spacing: -.035em; margin: 0; }

/* Tool layout */
.tool { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 20px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); }
.converter { padding: 28px; display: flex; flex-direction: column; gap: 26px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.label { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }

.seg { display: inline-flex; padding: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; }
.seg button { border: 0; background: none; padding: 7px 16px; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--muted); transition: background .2s, color .2s; }
.seg button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08), 0 0 0 1px var(--line); }
.swap { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; transition: transform .35s, border-color .2s; }
.swap svg { width: 18px; height: 18px; }
.swap:hover { border-color: var(--ing-ui); transform: rotate(180deg); }

.field { display: flex; flex-direction: column; gap: 12px; }
.amount-wrap { display: flex; align-items: baseline; gap: 10px; border-bottom: 2px solid var(--line); padding-bottom: 6px; transition: border-color .2s; }
.amount-wrap:focus-within { border-color: var(--ing-ui); }
.amount-wrap.invalid { border-color: #c2412d; }
#amount { flex: 1; min-width: 0; width: 0; border: 0; outline: none; background: none; color: var(--ink); padding: 0; font-family: var(--sans); font-weight: 600; font-size: clamp(46px, 7vw, 72px); line-height: 1.05; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.amount-unit { font-family: var(--sans); font-size: 28px; color: var(--muted); }

.presets { display: flex; flex-wrap: wrap; gap: 6px; }
.presets button { border: 1px solid var(--line); background: var(--surface); padding: 5px 12px; border-radius: 999px; font-size: 13px; color: var(--muted); transition: border-color .2s, color .2s, background .2s; }
.presets button:hover { color: var(--ink); border-color: var(--faint); }
.presets button[aria-pressed="true"] { color: var(--ink); border-color: var(--ing-ui); background: color-mix(in oklab, var(--ing) 9%, var(--surface)); }

.tabs { display: flex; gap: 2px; flex-wrap: wrap; }
.tabs button { border: 0; background: none; padding: 4px 10px; font-size: 13px; color: var(--muted); border-radius: 8px; position: relative; }
.tabs button[aria-selected="true"] { color: var(--ink); background: var(--surface-2); }

.chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.chip { display: flex; align-items: center; gap: 10px; text-align: left; padding: 10px 12px; border: 1px solid var(--line); background: var(--surface); border-radius: 14px; transition: border-color .2s, background .2s, transform .15s; }
.chip:hover { border-color: var(--faint); }
.chip:active { transform: scale(.98); }
.chip[aria-pressed="true"] { border-color: var(--ing-ui); background: color-mix(in oklab, var(--ing) 9%, var(--surface)); }
.swatch { flex: none; width: 18px; height: 18px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.14); }
.chip-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.chip-name { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip-d { font-family: var(--mono); font-size: 11px; color: var(--faint); }

.custom { display: grid; gap: 8px; padding: 16px; border: 1px dashed var(--line); border-radius: 14px; }
.custom label { font-size: 14px; font-weight: 500; }
.custom-input { display: flex; align-items: baseline; gap: 8px; border-bottom: 2px solid var(--line); max-width: 220px; }
.custom-input:focus-within { border-color: var(--ing-ui); }
.custom-input input { width: 100%; border: 0; outline: none; background: none; color: var(--ink); font-family: var(--sans); font-size: 32px; padding: 0; }
.custom-input span { color: var(--muted); }
.custom p { margin: 0; font-size: 13px; color: var(--muted); }

.result { background: var(--surface-2); border-radius: 18px; padding: 20px 22px; display: grid; gap: 4px; border: 1px solid var(--line); }
.result-top { display: flex; justify-content: space-between; align-items: center; }
.result-value { display: flex; align-items: baseline; gap: 10px; font-family: var(--sans); color: var(--ing-ui); transition: color .4s; }
#out { font-size: clamp(46px, 7vw, 68px); font-weight: 700; line-height: 1.05; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.result-unit { font-size: 28px; opacity: .8; }
.formula { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.copy { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 12px; font-size: 13px; color: var(--muted); transition: color .2s, border-color .2s; }
.copy svg { width: 14px; height: 14px; }
.copy:hover { color: var(--ink); border-color: var(--faint); }
.copy.done { color: var(--ing-ui); border-color: var(--ing-ui); }

/* Stage */
.stage {
  position: relative; padding: 22px 22px 16px; display: flex; flex-direction: column; overflow: hidden;
  background: radial-gradient(120% 70% at 50% 0%, color-mix(in oklab, var(--ing) 13%, var(--surface)), var(--surface) 70%);
}
.stage-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.stage-name { font-family: var(--sans); font-weight: 600; letter-spacing: -.02em; font-size: 24px; line-height: 1.1; }
.stage-meta { font-family: var(--mono); font-size: 13px; color: var(--muted); margin-top: 4px; }
.pill { font-size: 12px; font-weight: 500; padding: 5px 11px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
#scene { width: 100%; max-height: 520px; flex: 1; margin-top: 4px; touch-action: none; user-select: none; -webkit-user-select: none; }
#beaker { cursor: ns-resize; }
.stage-hint { margin: 2px 0 0; text-align: center; font-size: 12px; color: var(--faint); }

.glass-back { fill: var(--glass); }
.glass { fill: none; stroke: var(--glass-stroke); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.glare { stroke: #fff; stroke-opacity: .5; stroke-width: 5; stroke-linecap: round; fill: none; }
.glare.thin { stroke-width: 2; stroke-opacity: .35; }
.surface { fill: none; stroke: #fff; stroke-opacity: .45; stroke-width: 1.6; }
.tick { stroke: var(--glass-stroke); stroke-width: 1.2; stroke-linecap: round; }
.tick.major { stroke-width: 1.8; }
.tick-label { font-family: var(--mono); font-size: 10px; font-weight: 500; fill: var(--muted); paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; }
.level-line { stroke: var(--ing-ui); stroke-width: 1.4; stroke-dasharray: 3 3; }
.tag-bg { fill: var(--ing-ui); }
.tag-text { font-family: var(--mono); font-size: 11px; font-weight: 700; fill: var(--surface); }
.platform { fill: var(--scale-lip); }
.stem { fill: var(--scale); }
.scale-body { fill: var(--scale); }
.scale-lip { fill: var(--scale-lip); }
.lcd { fill: var(--lcd); }
.lcd-text { font-family: var(--mono); font-weight: 700; font-size: 22px; fill: var(--lcd-ink); letter-spacing: .02em; }
.lcd-unit { font-family: var(--mono); font-weight: 700; font-size: 12px; fill: var(--lcd-ink); }
.knob { fill: var(--scale-lip); stroke: #4a443d; stroke-width: 1; }
.knob-label { font-family: var(--sans); font-size: 7px; letter-spacing: .12em; fill: #8b8379; }

/* Equivalents */
.equivs { margin-top: 20px; }
.equiv-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.equiv { padding: 16px 18px; border-radius: 18px; }
.equiv-val { font-family: var(--sans); font-weight: 600; font-size: 26px; line-height: 1.1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.equiv-label { font-size: 13px; color: var(--muted); margin-top: 4px; }
.equiv-bar { height: 4px; border-radius: 2px; background: var(--surface-2); margin-top: 12px; overflow: hidden; }
.equiv-bar i { display: block; height: 100%; width: 0; background: var(--ing-ui); border-radius: 2px; transition: width .5s cubic-bezier(.2,.8,.2,1), background .4s; }


/* Sub calculator options */
.opts { display: flex; flex-direction: column; gap: 20px; }
.opts:empty { display: none; }
.opt { display: flex; flex-direction: column; gap: 10px; }
.opt-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.opt-val { font-family: var(--mono); font-size: 14px; font-weight: 700; color: var(--ing-ui); }
.opt input[type="range"] { width: 100%; accent-color: var(--ing-ui); margin: 0; height: 22px; }
.num-field { display: flex; align-items: baseline; gap: 8px; border-bottom: 2px solid var(--line); max-width: 240px; transition: border-color .2s; }
.num-field:focus-within { border-color: var(--ing-ui); }
.num-field input { width: 100%; min-width: 0; border: 0; outline: none; background: none; color: var(--ink); font: 600 28px/1.2 var(--sans); letter-spacing: -.02em; padding: 0; }
.num-field span { color: var(--muted); font-size: 14px; white-space: nowrap; }
.stage-note { margin: 4px 0 0; text-align: center; font-size: 14px; font-weight: 600; color: var(--ink); min-height: 1.4em; }

/* Guide sections */
.guide { padding-top: 40px; }
.g-sec { padding-top: 72px; max-width: 920px; }
.g-sec h2 { font-family: var(--sans); font-weight: 700; font-size: clamp(26px, 3.4vw, 36px); letter-spacing: -.03em; line-height: 1.15; margin: 0 0 14px; }
.g-sec p, .g-list { font-size: 16.5px; line-height: 1.7; color: color-mix(in oklab, var(--ink) 88%, var(--muted)); max-width: 72ch; }
.g-sec p { margin: 0 0 14px; }
.g-lead { font-size: 18px !important; color: var(--ink) !important; }
.g-sec b { font-weight: 650; color: var(--ink); }
.g-sec a { color: var(--ing-ui); text-underline-offset: 3px; }
.g-list { margin: 0 0 16px; padding-left: 22px; }
.g-list li { margin: 4px 0; }
.g-list li::marker { color: var(--ing-ui); font-weight: 700; }
.g-fig { margin: 22px 0 26px; padding: 22px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); }
.g-fig figcaption { margin-top: 14px; font-size: 13px; color: var(--muted); }
.g-fig svg { stroke-linecap: round; stroke-linejoin: round; }

.flow { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: stretch; gap: 12px; }
.flow-step { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 18px 12px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); }
.flow-step svg { width: 44px; height: 44px; fill: none; stroke: var(--ing-ui); stroke-width: 2.2; margin-bottom: 6px; }
.flow-step svg .fill { fill: color-mix(in oklab, var(--ing) 35%, transparent); stroke: none; }
.flow-step svg .thin, .g-card svg .thin, .vs-card svg .thin { stroke-width: 1.4; }
.flow-k { font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.flow-v { font-size: 26px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.flow-s { font-size: 13px; color: var(--muted); }
.flow-step.is-result { background: color-mix(in oklab, var(--ing) 10%, var(--surface)); border-color: color-mix(in oklab, var(--ing) 40%, var(--line)); }
.flow-step.is-result .flow-v { color: var(--ing-ui); }
.flow-op { align-self: center; font-size: 28px; font-weight: 300; color: var(--faint); }

.g-split { display: grid; grid-template-columns: 1.3fr 1fr; gap: 22px; align-items: center; }
.g-split figcaption { grid-column: 1 / -1; margin-top: 0; }
.formula-card { padding: 24px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); }
.formula-big { font-family: var(--mono); font-size: clamp(30px, 5vw, 44px); font-weight: 700; color: var(--ing-ui); letter-spacing: -.02em; }
.formula-live { margin-top: 10px; font-family: var(--mono); font-size: 16px; font-variant-numeric: tabular-nums; }
.formula-sub { margin-top: 4px; font-size: 13px; color: var(--muted); }
.tri { width: 100%; max-width: 260px; justify-self: center; }
.tri-shape { fill: color-mix(in oklab, var(--ing) 9%, var(--surface)); stroke: var(--ing-ui); stroke-width: 2.5; }
.tri-line { stroke: var(--ing-ui); stroke-width: 2; fill: none; }
.tri-t { font: 700 30px var(--mono); fill: var(--ink); text-anchor: middle; }
.tri-s { font: 500 11px var(--sans); fill: var(--muted); text-anchor: middle; }

.g-chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.g-chart-title { font-weight: 650; font-size: 15px; }
.g-chart-note { font-size: 13px; color: var(--muted); }
.bars { display: flex; flex-direction: column; gap: 2px; }
.bar-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) 72px; align-items: center; gap: 14px; padding: 7px 10px; border-radius: 10px; cursor: default; transition: background .2s; }
.bar-row:hover { background: var(--surface-2); }
.bar-name { font-size: 14px; font-weight: 500; }
.bar-track { height: 10px; }
.bar-track i { display: block; height: 100%; border-radius: 0 4px 4px 0; background: color-mix(in oklab, var(--ing-ui) 38%, var(--surface-2)); transition: background .3s; }
.bar-val { font-family: var(--mono); font-size: 13px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.bar-row.is-current { background: color-mix(in oklab, var(--ing) 9%, var(--surface)); }
.bar-row.is-current .bar-track i { background: var(--ing-ui); }
.bar-row.is-current .bar-name, .bar-row.is-current .bar-val { color: var(--ink); font-weight: 700; }

.g-table-wrap { overflow-x: auto; margin: 10px 0 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.g-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
.g-table caption { text-align: left; padding: 14px 18px 4px; font-weight: 650; font-size: 14px; }
.g-table th, .g-table td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; }
.g-table thead th { font-size: 12px; font-weight: 600; color: var(--muted); vertical-align: bottom; }
.g-table thead th small { display: block; font-weight: 500; color: var(--faint); }
.g-table th[scope="row"], .g-table thead th:first-child { text-align: left; font-weight: 600; }
.g-table td { font-family: var(--mono); font-size: 13px; }
.g-table tr:last-child > * { border-bottom: 0; }
.g-table tbody tr.is-current { background: color-mix(in oklab, var(--ing) 9%, var(--surface)); }
.g-table-2 { min-width: 520px; }
.g-table-2 td { font-family: var(--sans); font-size: 14px; text-align: left; }

.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0; }
.steps li { position: relative; display: flex; gap: 16px; padding: 0 0 18px; }
.steps li:not(:last-child)::before { content: ""; position: absolute; left: 17px; top: 36px; bottom: 0; width: 2px; background: var(--line); }
.step-n { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--ing-ui); color: var(--surface); font-weight: 700; font-family: var(--mono); }
.step-t { padding-top: 6px; font-size: 16px; line-height: 1.55; }
.g-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 0 0 18px; }
.g-card { padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.g-card svg { width: 40px; height: 40px; fill: none; stroke: var(--ing-ui); stroke-width: 2.2; }
.g-card h3 { margin: 8px 0 6px; font-size: 16px; }
.g-card p { font-size: 14.5px !important; margin: 0 !important; }

.line-chart { width: 100%; height: auto; display: block; }
.lc-grid line { stroke: var(--line); stroke-width: 1; }
.lc-grid .lc-base { stroke: var(--faint); }
.lc-y text, .lc-x text { font: 500 11px var(--mono); fill: var(--muted); }
.lc-y text { text-anchor: end; }
.lc-x text { text-anchor: middle; }
.lc-line { fill: none; stroke: var(--ing-ui); stroke-width: 2.5; }
.lc-pts circle { fill: var(--ing-ui); stroke: var(--surface); stroke-width: 2; cursor: default; }
.lc-pts circle:hover { r: 7; }
.lc-label { font: 600 12px var(--sans); fill: var(--ink); }

.g-vs { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; }
.vs-card { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 20px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); }
.vs-card svg { width: 64px; height: 64px; fill: none; stroke: var(--ing-ui); stroke-width: 2.4; }
.vs-unit { font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
.vs-what { font-size: 13px; color: var(--muted); }
.vs-mid { font-size: 34px; color: var(--faint); }

.g-faq details { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); margin-bottom: 10px; transition: border-color .2s; }
.g-faq details[open] { border-color: color-mix(in oklab, var(--ing) 40%, var(--line)); }
.g-faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; }
.g-faq summary::-webkit-details-marker { display: none; }
.g-faq summary::after { content: "+"; font-size: 22px; color: var(--ing-ui); transition: transform .2s; }
.g-faq details[open] summary::after { transform: rotate(45deg); }
.g-faq summary h3 { margin: 0; font-size: 17px; font-weight: 650; }
.faq-a { padding: 0 20px 6px; }
.faq-a p { font-size: 15.5px; }

.g-sources { max-width: 920px; margin-top: 56px; padding: 18px 22px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); }
.g-sources h2 { margin: 0 0 8px; font-size: 14px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.g-sources ul { margin: 0 0 8px; padding-left: 18px; font-size: 14px; line-height: 1.7; }
.g-sources a { color: var(--ink); text-underline-offset: 3px; }
.g-sources p { margin: 0; font-size: 13px; color: var(--muted); }

.ruler-wrap { width: 100%; }
.ruler { width: 100%; height: auto; display: block; overflow: visible; }
.ru-axis { stroke: var(--faint); stroke-width: 2; }
.ru-tick { stroke: var(--faint); stroke-width: 1.5; }
.ru-t { font: 500 11px var(--mono); fill: var(--muted); text-anchor: middle; }
.ru-water { stroke: #2b7bbf; stroke-width: 2; stroke-dasharray: 4 3; }
.ru-wl { font: 600 11px var(--sans); fill: #2b7bbf; text-anchor: middle; }
.ru-pt { fill: color-mix(in oklab, var(--ing-ui) 40%, var(--surface)); stroke: var(--surface); stroke-width: 2; cursor: default; transition: r .2s; }
.ru-pt.is-current { fill: var(--ing-ui); r: 9; }
.g-split .ruler-wrap, .g-split .bars { min-width: 0; }
.tip { position: fixed; z-index: 50; pointer-events: none; padding: 7px 10px; border-radius: 8px; background: var(--ink); color: var(--surface); font-size: 12.5px; font-weight: 500; max-width: 260px; box-shadow: 0 8px 24px -10px rgba(0,0,0,.4); }

@media (max-width: 720px) {
  .flow { grid-template-columns: 1fr; }
  .flow-op { justify-self: center; transform: rotate(90deg); }
  .g-split { grid-template-columns: 1fr; }
  .g-compare { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 112px minmax(0, 1fr) 62px; gap: 10px; padding: 7px 4px; }
  .bar-name { font-size: 13px; }
  .g-fig { padding: 16px; }
  .g-vs { gap: 8px; }
  .vs-card { padding: 14px 8px; }
  .vs-unit { font-size: 24px; }
}

/* Related calculators */
.more { padding-top: 88px; }
.more-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 8px 24px; flex-wrap: wrap; margin-bottom: 28px; }
.more h2 { font-family: var(--sans); font-weight: 700; font-size: clamp(28px, 3.6vw, 40px); letter-spacing: -.03em; line-height: 1.1; margin: 0; }
.more-head p { margin: 0; color: var(--muted); font-size: 14px; }
.more-groups { display: flex; flex-direction: column; gap: 32px; }
.more-label { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.more-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.more-label span { font-family: var(--mono); font-size: 11px; letter-spacing: 0; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--faint); }
.more-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); gap: 10px; }
.calc-card {
  --cc: var(--c);
  position: relative; display: flex; align-items: center; gap: 14px; padding: 14px 16px; overflow: hidden;
  border: 1px solid var(--line); border-radius: 18px; background: var(--surface); color: var(--ink); text-decoration: none;
  transition: transform .25s cubic-bezier(.2,.8,.2,1), border-color .25s, box-shadow .25s;
}
.calc-card::before { content: ""; position: absolute; inset: 0; background: radial-gradient(120% 140% at 0% 0%, color-mix(in oklab, var(--cc) 14%, transparent), transparent 60%); opacity: 0; transition: opacity .25s; pointer-events: none; }
.calc-icon { position: relative; flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: color-mix(in oklab, var(--cc) 14%, var(--surface)); color: var(--cc); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--cc) 22%, transparent); transition: transform .25s cubic-bezier(.2,.8,.2,1), background .25s, color .25s; }
.calc-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.calc-text { position: relative; display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.calc-name { font-size: 14.5px; font-weight: 600; letter-spacing: -.01em; line-height: 1.3; }
.calc-meta { font-family: var(--mono); font-size: 11.5px; color: var(--faint); }
.calc-arrow { position: relative; flex: none; width: 16px; height: 16px; fill: none; stroke: var(--faint); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s, stroke .25s; }
.calc-card:hover { transform: translateY(-2px); border-color: color-mix(in oklab, var(--cc) 45%, var(--line)); box-shadow: 0 14px 30px -18px color-mix(in oklab, var(--cc) 70%, transparent); }
.calc-card:hover::before, .calc-card[aria-current="page"]::before { opacity: 1; }
.calc-card:hover .calc-icon { transform: scale(1.06) rotate(-4deg); background: var(--cc); color: #fff; }
.calc-card:hover .calc-arrow { transform: translateX(3px); stroke: var(--cc); }
.calc-card[aria-current="page"] { border-color: var(--cc); }
.calc-card[aria-current="page"] .calc-meta::after { content: " · you are here"; color: var(--cc); }
:root[data-theme="dark"] .calc-card { --cc: color-mix(in oklab, var(--c) 62%, white); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .calc-card { --cc: color-mix(in oklab, var(--c) 62%, white); } }
.brand-link { color: inherit; text-decoration: none; }

/* Scene drawing classes */
.v-glass-back { fill: var(--glass); }
.v-glass { fill: none; stroke: var(--glass-stroke); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.v-thin { fill: none; stroke: var(--glass-stroke); stroke-width: 1.6; stroke-linecap: round; }
.v-glare { stroke: #fff; stroke-opacity: .45; stroke-width: 5; stroke-linecap: round; fill: none; }
.v-surf { fill: none; stroke: #fff; stroke-opacity: .45; stroke-width: 1.6; }
.v-tick { stroke: var(--glass-stroke); stroke-width: 1.4; stroke-linecap: round; }
.v-tick-label, .v-small { font-family: var(--mono); font-size: 10px; font-weight: 500; fill: var(--muted); paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; }
.v-label { font-family: var(--sans); font-size: 12px; font-weight: 600; fill: var(--muted); }
.v-big { font-family: var(--sans); font-size: 15px; font-weight: 700; fill: var(--ink); }
.v-tag-line { stroke: var(--ing-ui); stroke-width: 1.4; stroke-dasharray: 3 3; }
.v-tag-bg { fill: var(--ing-ui); }
.v-tag-text { font-family: var(--mono); font-size: 10.5px; font-weight: 700; fill: var(--surface); }
.v-accent { fill: var(--ing-ui); }
.v-accent-stroke { stroke: var(--ing-ui); fill: none; }
.v-track { fill: var(--surface-2); stroke: var(--line); }
.v-obj { fill: var(--obj); }
.v-obj-light { fill: color-mix(in srgb, var(--obj) 72%, white); }
.v-obj-dark { fill: color-mix(in srgb, var(--obj) 78%, black); }
.v-obj-stroke { stroke: color-mix(in srgb, var(--obj) 70%, black); }
.v-metal { fill: #b9c0c7; stroke: #8f979f; stroke-width: 1.5; }
.v-metal-dark { fill: #8f979f; }
.v-paper { fill: #f6f3ec; stroke: #d8d1c3; stroke-width: 1.5; }
.v-ink-on-paper { font-family: var(--sans); font-weight: 700; fill: #2a2622; }
.v-wood { fill: #b88652; }
.v-scale { fill: var(--scale); }
.v-lcd { fill: var(--lcd); }
.v-lcd-text { font-family: var(--mono); font-weight: 700; font-size: 16px; fill: var(--lcd-ink); }
.v-steam { fill: none; stroke: var(--faint); stroke-width: 2.5; stroke-linecap: round; }
.v-bowl { fill: var(--surface-2); stroke: var(--glass-stroke); stroke-width: 2.5; }
.v-bowl-in { fill: color-mix(in srgb, var(--surface-2) 80%, black); }
#scene { overflow: visible; }

.foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 64px; padding-bottom: 40px; color: var(--faint); font-size: 13px; }

/* Responsive */
@media (max-width: 1020px) {
  .equiv-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .tool { grid-template-columns: minmax(0, 1fr); }
  #scene { max-height: 440px; }
}
@media (max-width: 600px) {
  .wrap { padding: 0 16px; }
  .intro { padding: 16px 0 24px; }
  .converter { padding: 20px; gap: 22px; }
  .stage { padding: 18px 14px 12px; }
  .chips { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
  .row-between .tabs { width: 100%; }
  .equiv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .equiv-val { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  html { scroll-behavior: auto; }
}

/* Info pages: About Us, Terms of Use, Privacy Policy */
.doc { max-width: 780px; padding-top: 24px; }
.doc h1 { margin-bottom: 14px; }
.doc h2 { font-size: clamp(22px, 2.8vw, 28px); font-weight: 700; letter-spacing: -.02em; margin: 44px 0 12px; }
.doc p, .doc-list { font-size: 16.5px; line-height: 1.7; color: color-mix(in oklab, var(--ink) 88%, var(--muted)); }
.doc p { margin: 0 0 14px; }
.doc a { color: var(--ing-ui); text-underline-offset: 3px; }
.doc b { color: var(--ink); font-weight: 650; }
.doc code { font-family: var(--mono); font-size: 14px; padding: 1px 6px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); }
.doc-lead { font-size: 19px !important; color: var(--ink) !important; }
.doc-date { font-size: 13px !important; color: var(--muted) !important; font-family: var(--mono); }
.doc-list { padding-left: 22px; margin: 0 0 16px; }
.doc-list li { margin: 8px 0; }
.doc-list li::marker { color: var(--ing-ui); }
.doc-stats, .doc-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 26px 0 8px; }
.doc-stats div, .doc-cards div { display: flex; flex-direction: column; gap: 2px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.doc-stats b { font-size: 34px; letter-spacing: -.03em; color: var(--ing-ui) !important; }
.doc-stats span, .doc-cards span { font-size: 13px; color: var(--muted); }
.doc-cards b { font-size: 16px; }
.todo { padding: 1px 6px; border-radius: 6px; background: #fde68a; color: #5a4310; font-family: var(--mono); font-size: 14px; }
.foot-links { display: flex; gap: 18px; flex-wrap: wrap; }
.foot-links a { color: var(--muted); text-decoration: none; }
.foot-links a:hover, .foot-links a[aria-current="page"] { color: var(--ink); }
@media (max-width: 600px) {
  .doc-stats, .doc-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Contact form */
.contact-form { display: grid; gap: 16px; margin: 26px 0 10px; padding: 22px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); }
.cf-row { display: grid; gap: 6px; }
.cf-row label { font-size: 13px; font-weight: 600; letter-spacing: .04em; color: var(--muted); }
.cf-row input, .cf-row textarea { font: 16px/1.5 var(--sans); color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; outline: none; transition: border-color .2s; }
.cf-row input:focus, .cf-row textarea:focus { border-color: var(--ing-ui); }
.cf-row textarea { resize: vertical; min-height: 140px; }
.cf-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.cf-send { justify-self: start; border: 0; border-radius: 999px; padding: 11px 22px; background: var(--ing-ui); color: var(--surface); font-weight: 600; font-size: 15px; }
.cf-send:disabled { opacity: .6; cursor: progress; }
.cf-status { margin: 0 !important; font-size: 14.5px !important; min-height: 1.4em; }
.cf-status[data-state="success"] { color: #2f8a57 !important; }
.cf-status[data-state="error"] { color: #c2412d !important; }
.cf-status[data-state="sending"] { color: var(--muted) !important; }

/* Language switcher */
.lang-switch { position: relative; }
.lang-switch summary { cursor: pointer; list-style: none; color: var(--muted); }
.lang-switch summary::-webkit-details-marker { display: none; }
.lang-switch summary::before { content: "🌐 "; }
.lang-switch ul { position: absolute; bottom: calc(100% + 8px); inset-inline-start: 0; z-index: 20; display: grid; grid-template-columns: repeat(2, minmax(120px, 1fr)); gap: 2px 14px; margin: 0; padding: 12px 14px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.lang-switch a { display: block; padding: 4px 0; color: var(--muted); text-decoration: none; font-size: 13.5px; }
.lang-switch a:hover, .lang-switch a[aria-current] { color: var(--ink); }
.more-note { font-size: 13px !important; color: var(--faint) !important; }
.sm-list { columns: 2; column-gap: 28px; }
.sm-list li { break-inside: avoid; }
.doc h3 { font-size: 15px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 26px 0 4px; }
@media (max-width: 600px) { .sm-list { columns: 1; } .lang-switch ul { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Right-to-left (Arabic) */
[dir="rtl"] .bar-track i { border-radius: 4px 0 0 4px; }
[dir="rtl"] .g-list, [dir="rtl"] .doc-list { padding-left: 0; padding-right: 22px; }
[dir="rtl"] .steps li:not(:last-child)::before { left: auto; right: 17px; }
[dir="rtl"] .bar-val, [dir="rtl"] .g-table th, [dir="rtl"] .g-table td { text-align: left; }
[dir="rtl"] .g-table th[scope="row"], [dir="rtl"] .g-table thead th:first-child { text-align: right; }
[dir="rtl"] .more-grid a::after, [dir="rtl"] .calc-arrow { transform: scaleX(-1); }
[dir="rtl"] #scene, [dir="rtl"] .line-chart, [dir="rtl"] .tri, [dir="rtl"] .flow-v, [dir="rtl"] .formula-live, [dir="rtl"] .formula-big { direction: ltr; }
[dir="rtl"] .bar-val, [dir="rtl"] .chip-d, [dir="rtl"] .presets button, [dir="rtl"] #stageMeta, [dir="rtl"] #stageCap,
[dir="rtl"] .equiv-val, [dir="rtl"] .formula, [dir="rtl"] .g-table td, [dir="rtl"] .g-table thead th, [dir="rtl"] .flow-s { unicode-bidi: plaintext; }
[dir="rtl"] .result-value, [dir="rtl"] .amount-wrap { direction: ltr; justify-content: flex-end; }
