/* Layout: inputs on the left, live amounts on the right (stacked on phones); reference pages in one reading column. */
:root {
  --bg: #f7f5f8; --surface: #fff; --sunk: #efeaf0; --text: #1d1720; --muted: #645b68; --line: #e2dbe4;
  --accent: #6b2f63; --accent-ink: #fff; --accent-soft: #f1e4ef;
  --amber: #a8620b; --amber-soft: #fbefdc; --warn: #a1340b; --warn-soft: #fbe6dd;
  --radius: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141016; --surface: #1c171f; --sunk: #241d28; --text: #ece6ee; --muted: #a59aa9; --line: #342c38;
    --accent: #e3a1d8; --accent-ink: #26101f; --accent-soft: #3a2236;
    --amber: #f0b45a; --amber-soft: #3a2a14; --warn: #ff9a73; --warn-soft: #3b1f15;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141016; --surface: #1c171f; --sunk: #241d28; --text: #ece6ee; --muted: #a59aa9; --line: #342c38;
  --accent: #e3a1d8; --accent-ink: #26101f; --accent-soft: #3a2236;
  --amber: #f0b45a; --amber-soft: #3a2a14; --warn: #ff9a73; --warn-soft: #3b1f15;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--font); }
a { color: var(--accent); }
.wrap { max-width: 1080px; margin: 0 auto; padding-inline: 16px; }
h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); line-height: 1.15; margin: 1.3rem 0 .6rem; letter-spacing: -.015em; text-wrap: balance; }
h2 { font-size: 1.3rem; line-height: 1.25; margin: 2rem 0 .6rem; text-wrap: balance; }
h3 { font-size: 1.05rem; margin: 1.3rem 0 .3rem; }
.lead { font-size: 1.08rem; color: var(--muted); max-width: 72ch; }
.lead strong { color: var(--text); }
.small, .fine { font-size: .86rem; color: var(--muted); }
.muted { color: var(--muted); font-weight: 400; }
.prose { max-width: 72ch; }
.crumbs { font-size: .9rem; color: var(--muted); margin-top: 1rem; }
.crumbs a { color: var(--muted); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; min-height: 58px; padding-block: 8px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.12rem; color: var(--text); text-decoration: none; }
.mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 7px; background: var(--accent); color: var(--accent-ink); }
nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }
nav a { color: var(--text); text-decoration: none; font-weight: 500; white-space: nowrap; }
nav a:hover { color: var(--accent); }
.button { display: inline-block; background: var(--accent); color: var(--accent-ink); font-weight: 700; text-decoration: none; padding: .6rem 1.1rem; border-radius: var(--radius); }

/* ---- calculator ---- */
.calc-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; margin-bottom: 2rem; }
@media (min-width: 900px) {
  .calc-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .results { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 12px); }
}
.calc { display: grid; gap: 12px; min-width: 0; }
fieldset, .costs { margin: 0; padding: 10px 14px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); min-width: 0; }
legend { padding: 0 6px; font-weight: 700; }
.costs > summary, details > summary { cursor: pointer; font-weight: 600; }
.costs > summary { padding: 4px 0; }
details > summary { color: var(--muted); font-size: .9rem; margin-top: 8px; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 10px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: .88rem; color: var(--muted); min-width: 0; }
input, select { font: inherit; color: var(--text); background: var(--surface); border: 1.5px solid var(--line); border-radius: 8px; padding: .5rem .65rem; min-width: 0; width: 100%; }
input:focus, select:focus { outline: none; border-color: var(--accent); }
.jars { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.chip { font: inherit; font-size: .88rem; padding: .25rem .7rem; border: 1px solid var(--line); border-radius: 999px; background: var(--sunk); color: var(--text); cursor: pointer; }
.chip:hover { border-color: var(--accent); color: var(--accent); }

.results { display: grid; gap: 12px; min-width: 0; }
.empty { padding: 1rem 1.2rem; border: 1.5px dashed var(--line); border-radius: var(--radius); color: var(--muted); }
.figures { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.figures div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem .85rem; min-width: 0; }
.figures .wax { border-top: 4px solid var(--accent); }
.figures .fo { border-top: 4px solid var(--amber); }
.figures span { display: block; font-size: .74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; line-height: 1.3; }
.figures b { display: block; font-size: clamp(1.3rem, 3.4vw, 1.75rem); line-height: 1.25; font-variant-numeric: tabular-nums; }
.figures small { color: var(--muted); font-size: .82rem; font-variant-numeric: tabular-nums; }
@media (max-width: 480px) { .figures { grid-template-columns: 1fr 1fr; } .figures div:last-child { grid-column: 1 / -1; } }
.warn { margin: 0; padding: .6rem .9rem; border-radius: var(--radius); background: var(--warn-soft); color: var(--text); border-left: 5px solid var(--warn); font-size: .92rem; }
.batch { background: var(--accent-soft); border-radius: var(--radius); padding: .4rem 1rem .6rem; }
.batch h2 { margin: .4rem 0; font-size: 1.05rem; }
.batch dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin: 0; }
.batch dt { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.batch dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.batch dd small { display: block; font-weight: 400; color: var(--muted); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem .9rem; min-width: 0; }
.card h3 { margin: 0 0 .2rem; font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.card .big { margin: 0 0 .3rem; font-size: 1.15rem; font-weight: 800; line-height: 1.3; }
.card .small { margin: 0; }

/* ---- reference pages ---- */
.table-wrap { overflow-x: auto; margin: .5rem 0 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table.chart { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: .95rem; }
.chart th, .chart td { text-align: left; padding: .5rem .8rem; border-top: 1px solid var(--line); vertical-align: top; }
.chart thead th { border-top: 0; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--sunk); white-space: nowrap; }
.chart tbody th { font-weight: 600; }
.chart td { white-space: nowrap; }
.chart small { color: var(--muted); }
.guide-list { padding-left: 1.1rem; }
.guide-list li { margin-bottom: .8rem; }
.ad { margin: 1.5rem 0; min-height: 100px; }
.foot { border-top: 1px solid var(--line); margin-top: 3rem; padding-block: 1.5rem; color: var(--muted); font-size: .9rem; }
