:root {
  --bg: #fbfaf7; --surface: #ffffff; --ink: #1d1d1b; --muted: #5f5e5a; --line: #e4e1da;
  --accent: #1f6feb; --accent-soft: #e8f0fe; --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #151514; --surface: #1e1e1c; --ink: #f1efe9; --muted: #a9a69e; --line: #34332f;
          --accent: #6ea8ff; --accent-soft: #1d2a40; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink);
       font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
.top, .foot { max-width: 760px; margin: 0 auto; padding: 16px; display: flex; gap: 16px;
              justify-content: space-between; align-items: center; color: var(--muted); font-size: 14px; }
.brand { font-weight: 700; color: var(--ink); text-decoration: none; font-size: 17px; }
main { max-width: 760px; margin: 0 auto; padding: 0 16px 32px; }
h1 { font-size: clamp(26px, 5vw, 36px); line-height: 1.2; margin: 8px 0 8px; }
.intro { color: var(--muted); font-size: 17px; margin: 0 0 20px; }
.crumbs { font-size: 13px; color: var(--muted); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.field .label { font-weight: 600; }
.control { display: flex; align-items: center; gap: 8px; }
input, select { width: 100%; padding: 10px 12px; font: inherit; color: var(--ink); background: var(--bg);
                border: 1px solid var(--line); border-radius: 8px; }
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.unit { color: var(--muted); font-size: 14px; white-space: nowrap; }
.results { margin-top: 18px; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.result { background: var(--accent-soft); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; }
.result .label { font-size: 13px; color: var(--muted); }
.result .value { font-size: 24px; font-weight: 700; }
.error { color: #c0392b; font-size: 14px; }
.prose { margin-top: 28px; }
.prose h2 { font-size: 21px; margin: 24px 0 8px; }
details { border-bottom: 1px solid var(--line); padding: 10px 0; }
summary { cursor: pointer; font-weight: 600; }
.tools { list-style: none; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.tools a { display: flex; flex-direction: column; gap: 4px; padding: 16px; background: var(--surface);
           border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); height: 100%; }
.tools a span { color: var(--muted); font-size: 14px; }
.tools a:hover { border-color: var(--accent); }
.ad { margin: 20px 0; min-height: 90px; }
.note { color: var(--muted); font-size: 13px; margin-top: 28px; }
