:root {
  --bg: #f6f7f4;
  --card: #ffffff;
  --text: #1c1f1d;
  --muted: #5d6560;
  --line: #dfe3dc;
  --accent: #2f6f4f;
  --accent-soft: #e6f0ea;
  --accent-text: #ffffff;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141715;
    --card: #1d211f;
    --text: #e9ece9;
    --muted: #a0a8a3;
    --line: #313733;
    --accent: #6fbf94;
    --accent-soft: #223128;
    --accent-text: #0f1311;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.top { background: var(--card); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; justify-content: space-between; align-items: center; height: 56px; }
.logo { font-weight: 700; font-size: 1.15rem; text-decoration: none; color: var(--text); }
.top nav a { text-decoration: none; font-size: .95rem; }
main { padding-top: 20px; padding-bottom: 48px; }
h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); line-height: 1.2; margin: 8px 0 10px; }
h2 { font-size: 1.25rem; margin-top: 32px; }
.lead { font-size: 1.05rem; color: var(--muted); max-width: 720px; }
.crumbs { font-size: .85rem; color: var(--muted); }
.crumbs a { color: var(--muted); }

.tool { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; margin-top: 20px; align-items: start; }
@media (max-width: 800px) { .tool { grid-template-columns: minmax(0, 1fr); } }
form, .result { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.units { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 14px; font-size: .9rem; color: var(--muted); }
.units button { font: inherit; font-size: .85rem; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--text); cursor: pointer; }
.units button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
label { display: block; margin-bottom: 12px; }
label > span { display: block; font-size: .9rem; color: var(--muted); margin-bottom: 4px; }
.row { display: flex; gap: 8px; align-items: center; }
.row em { font-style: normal; color: var(--muted); font-size: .9rem; white-space: nowrap; }
input, select {
  font: inherit; font-size: 1rem; color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; width: 100%; min-width: 0;
}
.row select { width: auto; flex: 0 0 auto; }
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.result { position: sticky; top: 12px; }
.result h2 { margin: 0 0 10px; font-size: 1.05rem; color: var(--muted); font-weight: 600; }
.res { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.res:last-child { border-bottom: 0; }
.res span { color: var(--muted); }
.res strong { text-align: right; overflow-wrap: anywhere; }
.res.main { display: block; background: var(--accent-soft); border: 0; border-radius: 10px; padding: 14px; margin-bottom: 6px; }
.res.main span { display: block; font-size: .9rem; }
.res.main strong { display: block; text-align: left; font-size: 1.8rem; line-height: 1.2; color: var(--text); }

.content { max-width: 720px; }
.content ol { padding-left: 20px; }
details { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin-bottom: 8px; }
summary { cursor: pointer; font-weight: 600; }
.list { padding-left: 18px; }
.list li { margin: 4px 0; }
.ad-slot { margin: 24px 0; }

.hero { padding: 8px 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin-top: 12px; }
.cat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 4px 18px 12px; }
.cat h2 { font-size: 1.1rem; margin-top: 14px; }
.cat h2 a { color: var(--text); text-decoration: none; }
.bottom { border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; padding: 16px 0 32px; }
.table-wrap { overflow-x: auto; margin: 8px 0 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
td { white-space: nowrap; }
@media (max-width: 600px) { th, td { padding: 8px 9px; font-size: .88rem; } }
thead th { background: var(--accent-soft); font-weight: 600; }
tbody th { font-weight: 500; }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
.content ul { padding-left: 20px; }
