/* firecategory.ru: оформление справочника. Системные шрифты, светлая и темная схемы. */
:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --text: #1d1f22;
  --muted: #5c6168;
  --line: #dcd8cf;
  --accent: #b3261e;
  --link: #1f5a8a;
  --note: #fff6e5;
  --code: #f1efe9;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171a;
    --surface: #1d2024;
    --text: #e7e5e1;
    --muted: #a3a8ae;
    --line: #353a40;
    --accent: #ef6b5f;
    --link: #8cc0ea;
    --note: #2b2618;
    --code: #262a2f;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
a { color: var(--link); text-underline-offset: 2px; }
.wrap { max-width: 820px; margin: 0 auto; padding: 0 16px; }

.site-header { background: var(--surface); border-bottom: 3px solid var(--accent); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 20px; padding-top: 12px; padding-bottom: 12px; }
.logo { font-weight: 700; color: var(--text); text-decoration: none; font-size: 17px; line-height: 1.3; }
.site-nav { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 15px; }
.site-nav a { color: var(--muted); text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--accent); }

.page { padding: 24px 0 8px; }
h1 { font-size: 30px; line-height: 1.2; margin: 0 0 6px; }
h2 { font-size: 23px; line-height: 1.3; margin: 34px 0 10px; }
h3 { font-size: 19px; line-height: 1.35; margin: 24px 0 8px; }
p, ul, ol { margin: 0 0 14px; }
li { margin-bottom: 6px; }
.updated { color: var(--muted); font-size: 14px; margin-bottom: 20px; }

.table-wrap { overflow-x: auto; margin: 0 0 18px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 15px; line-height: 1.45; }
th, td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--line); }
th { background: var(--code); font-weight: 600; }
tr:last-child td { border-bottom: 0; }

.formula {
  font-family: "Cambria Math", "STIX Two Math", Cambria, Georgia, serif;
  font-size: 19px; background: var(--code); border-radius: 6px; padding: 10px 14px; overflow-x: auto;
}
var { font-style: italic; }
code { background: var(--code); padding: 1px 4px; border-radius: 3px; font-size: 0.92em; }
.example, .note {
  border-left: 4px solid var(--accent); background: var(--surface); padding: 12px 16px; margin: 0 0 18px;
  border-radius: 0 6px 6px 0;
}
.note { background: var(--note); border-left-color: #d29a1c; }
.example > :last-child, .note > :last-child { margin-bottom: 0; }
figure { margin: 0 0 18px; }
figure svg { max-width: 100%; height: auto; display: block; }
figcaption { color: var(--muted); font-size: 14px; margin-top: 6px; }
details.faq { border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; margin-bottom: 10px; background: var(--surface); }
details.faq summary { cursor: pointer; font-weight: 600; }
details.faq[open] summary { margin-bottom: 8px; }
.sources { font-size: 15px; }

.article-list { list-style: none; padding: 0; }
.article-list li { margin-bottom: 12px; }
.article-list a { font-weight: 600; }
.article-list span { display: block; color: var(--muted); font-size: 15px; }
.more { border-top: 1px solid var(--line); margin-top: 28px; padding-top: 4px; }
.more h2 { font-size: 20px; }

.site-footer { border-top: 1px solid var(--line); margin-top: 32px; padding: 16px 0 28px; color: var(--muted); font-size: 14px; }

/* Калькулятор В1-В4 */
.calc { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 16px; margin: 0 0 20px; }
.calc fieldset { border: 1px solid var(--line); border-radius: 6px; margin: 0 0 14px; padding: 12px; min-width: 0; }
.calc legend { font-weight: 600; padding: 0 4px; }
.calc label { display: block; font-size: 15px; margin-bottom: 4px; }
.calc input, .calc select {
  font: inherit; font-size: 16px; color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 4px; padding: 6px 8px; width: 100%;
}
.calc .row { display: grid; grid-template-columns: 1fr; gap: 10px; margin-bottom: 10px; }
@media (min-width: 640px) { .calc .row { grid-template-columns: repeat(3, 1fr); } .calc .row.mat { grid-template-columns: 2fr 1fr 1fr auto; align-items: end; } }
.calc .row.mat { padding-bottom: 10px; border-bottom: 1px dashed var(--line); }
.calc button {
  font: inherit; font-size: 15px; cursor: pointer; border-radius: 4px; padding: 7px 12px;
  border: 1px solid var(--accent); background: transparent; color: var(--accent);
}
.calc button.primary { background: var(--accent); color: #fff; }
.calc .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.calc-result { border-top: 2px solid var(--accent); margin-top: 14px; padding-top: 12px; }
.calc-result .cat { font-size: 26px; font-weight: 700; color: var(--accent); }
.calc .hint { color: var(--muted); font-size: 14px; }
.calc .error { color: var(--accent); font-weight: 600; }

@media (max-width: 480px) {
  body { font-size: 16px; }
  h1 { font-size: 25px; }
  h2 { font-size: 21px; }
  .formula { font-size: 17px; }
}
