/* Готови — shared styles. System fonts only: the site loads nothing from other servers. */
:root {
  --bg: #f5f6f7; --surface: #ffffff; --fg: #18202b; --muted: #556170; --line: #d8dde3;
  --accent: #c94f16; --accent-ink: #ffffff; --accent-soft: #fbe8dc;
  --blue: #1c4d8c; --blue-soft: #e2ebf6; --warn-soft: #fff4d6; --warn: #8a5a00;
  --radius: 6px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11151b; --surface: #1a2029; --fg: #e7eaef; --muted: #9ba6b4; --line: #2d3541;
    --accent: #f0814a; --accent-ink: #1a0d05; --accent-soft: #3a2316;
    --blue: #86ade3; --blue-soft: #1a2a40; --warn-soft: #33290f; --warn: #e5b452;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font); font-size: 17px; line-height: 1.55; }
a { color: var(--blue); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { line-height: 1.2; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(1.7rem, 4.5vw, 2.4rem); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
p { margin: 0; }
ul, ol { margin: 0; padding-left: 1.25em; display: flex; flex-direction: column; gap: 4px; }

.wrap { max-width: 900px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

.site-head { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-head .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; padding-block: 12px; }
.brand { font-weight: 800; font-size: 1.2rem; text-decoration: none; color: var(--fg); display: flex; align-items: center; gap: 8px; }
.brand-mark { width: 22px; height: 22px; border-radius: 4px; background: var(--accent); display: inline-block; }
.nav { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .95rem; }
.nav a { text-decoration: none; color: var(--muted); padding: 4px 0; }
.nav a[aria-current="page"] { color: var(--fg); font-weight: 600; border-bottom: 2px solid var(--accent); }

main.wrap { display: flex; flex-direction: column; gap: 32px; padding-block: 28px 56px; }
section { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.lede { font-size: 1.1rem; color: var(--muted); max-width: 62ch; }

.notice { background: var(--warn-soft); border-radius: var(--radius); padding: 10px 14px; font-size: .9rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }

/* Calculator form */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 16px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-weight: 600; font-size: .95rem; }
.field small { color: var(--muted); font-size: .82rem; }
.stepper { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; width: fit-content; }
.stepper button { width: 44px; border: 0; background: var(--blue-soft); color: var(--fg); font-size: 1.3rem; cursor: pointer; }
.stepper input { width: 56px; border: 0; text-align: center; font-size: 1.1rem; background: var(--surface); color: var(--fg); font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.days { display: flex; flex-wrap: wrap; gap: 8px; }
.days label { cursor: pointer; }
.days input { position: absolute; opacity: 0; pointer-events: none; }
.days span { display: inline-flex; flex-direction: column; padding: 8px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); min-width: 92px; }
.days span b { font-size: 1.05rem; }
.days span small { color: var(--muted); font-size: .78rem; }
.days input:checked + span { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.days input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
legend { font-weight: 700; padding: 0; margin-bottom: 6px; }

/* Results */
.totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.total { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.total .num { font-size: 1.9rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.total .lbl { color: var(--muted); font-size: .88rem; }
.total.water { border-color: var(--blue); }
.tbl { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
td.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
.ex { color: var(--muted); font-size: .88rem; }
.mark { font-size: .75rem; color: var(--warn); border: 1px solid currentColor; border-radius: 3px; padding: 0 5px; white-space: nowrap; }

.checklist { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; }
.checklist li::before { content: ""; flex: none; width: 16px; height: 16px; margin-top: 4px; border: 2px solid var(--muted); border-radius: 3px; }
.checklist .q { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; padding-left: 8px; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }

.btn { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: var(--radius); background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 700; padding: 10px 18px; cursor: pointer; text-decoration: none; }
.btn.secondary { background: var(--blue-soft); color: var(--fg); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }

.tip { border-left: 4px solid var(--blue); background: var(--blue-soft); padding: 12px 14px; border-radius: 0 var(--radius) var(--radius) 0; }
.levels { display: flex; flex-direction: column; gap: 10px; }
.level { display: grid; grid-template-columns: 170px 1fr; gap: 6px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
@media (max-width: 560px) { .level { grid-template-columns: 1fr; } }
.level b { font-size: 1rem; }
.pill { display: inline-block; font-size: .78rem; font-weight: 700; padding: 1px 8px; border-radius: 99px; }
.pill.on { background: var(--accent-soft); color: var(--accent); }
.pill.opt { background: var(--blue-soft); color: var(--blue); }
.steps { counter-reset: s; list-style: none; padding: 0; gap: 8px; }
.steps li { counter-increment: s; display: flex; gap: 10px; }
.steps li::before { content: counter(s); flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 700; display: grid; place-items: center; font-size: .85rem; }
.src { font-size: .85rem; color: var(--muted); }
.src li { word-break: break-word; }

.site-foot { border-top: 1px solid var(--line); background: var(--surface); font-size: .88rem; color: var(--muted); }
.site-foot .wrap { padding-block: 18px 28px; display: flex; flex-direction: column; gap: 8px; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 4px 16px; }

.print-only { display: none; }
@media print {
  body { background: #fff; color: #000; font-size: 11pt; }
  .site-head, .site-foot, .no-print, .notice { display: none !important; }
  .print-only { display: block; }
  main.wrap { padding: 0; gap: 14px; max-width: none; }
  .card, .total, .tbl { border-color: #999; break-inside: avoid; }
  a { color: #000; text-decoration: none; }
}
