@import url("https://fonts.googleapis.com/css2?family=Golos+Text:wght@400;500;600&family=Literata:opsz,wght@7..72,500;7..72,600&display=swap");

:root {
  --bg: #f2efe6; --surface: #fbfaf6; --fg: #15201a; --fg-2: #3a463f; --muted: #58635c;
  --accent: #6a561e; --good: #17693c; --warn: #7d5100; --crit: #a5352e; --info: #1f6099;
  --line: #d9d4c4; --on-accent: #fbfaf6;
  --radius: 12px;
  --font-head: "Literata", Georgia, serif;
  --font-body: "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1411; --surface: #111c17; --fg: #ece8dd; --fg-2: #bcc5bb; --muted: #95a298;
    --accent: #e4d2a6; --good: #5fbe84; --warn: #e2a93b; --crit: #f07b72; --info: #7fb0e0;
    --line: #213328; --on-accent: #0b1411;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 400 17px/1.55 var(--font-body);
  overflow-wrap: anywhere;
}
h1, h2, h3 { font-family: var(--font-head); font-weight: 600; line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(26px, 6vw, 36px); }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--info); outline-offset: 2px;
}

.wrap { max-width: 760px; margin: 0 auto; padding: 24px 16px 56px; }

.tool-head { margin: 8px 0 24px; }
.tool-head .badge {
  display: inline-block; font-size: 14px; font-weight: 600; color: var(--good);
  border: 1px solid var(--good); border-radius: 999px; padding: 2px 12px; margin-bottom: 12px;
}
.tool-head .sub { font-size: 19px; color: var(--fg-2); margin: 0; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; margin: 0 0 20px;
}
.card > :last-child { margin-bottom: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }

/* карточки инструментов на главной */
.tools { display: grid; gap: 16px; margin: 0 0 24px; padding: 0; list-style: none; }
.tool-card {
  display: block; text-decoration: none; color: inherit; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px;
}
.tool-card:hover { border-color: var(--accent); }
.tool-card h3 { margin: 0 0 6px; color: var(--fg); }
.tool-card .for { color: var(--muted); font-size: 15px; margin: 0 0 8px; }
.tool-card .free { font-size: 14px; font-weight: 600; color: var(--good); }
.tool-card .go { float: right; color: var(--accent); font-weight: 600; }

.field { margin: 0 0 16px; }
.field label { display: block; font-weight: 500; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; color: var(--fg); background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px; padding: 11px 12px; min-height: 46px;
}
.field textarea { min-height: 96px; resize: vertical; }
.field .hint { font-size: 14px; color: var(--muted); margin-top: 4px; }

.btn {
  display: inline-block; font: 600 17px var(--font-body); min-height: 48px; padding: 11px 22px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--fg);
  cursor: pointer; text-decoration: none; text-align: center;
}
.btn.pri { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn[disabled] { opacity: .6; cursor: default; }

.result { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin: 0 0 20px; }
.result .big { font: 600 clamp(38px, 11vw, 60px)/1.05 var(--font-head); color: var(--accent); margin: 0 0 4px; }
.result .row { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-top: 1px solid var(--line); }
.result .row:first-of-type { margin-top: 12px; }
.result .row b { white-space: nowrap; }

.callout { border-left: 4px solid var(--info); background: var(--surface); border-radius: 0 var(--radius) var(--radius) 0; padding: 14px 18px; margin: 0 0 20px; }
.callout.good { border-color: var(--good); }
.callout.warn { border-color: var(--warn); }
.callout.crit { border-color: var(--crit); }
.callout > :last-child { margin-bottom: 0; }
.callout strong:first-child { display: block; margin-bottom: 4px; }

.steps { counter-reset: s; list-style: none; padding: 0; margin: 0 0 20px; }
.steps li { counter-increment: s; position: relative; padding: 0 0 14px 48px; min-height: 36px; }
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: -2px; width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent); color: var(--on-accent); font: 600 17px/34px var(--font-head); text-align: center;
}

.src { font-size: 14px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 14px; margin: 0 0 24px; }
.src h2 { font-size: 16px; font-family: var(--font-body); margin-bottom: 6px; }
.src ul { margin: 0; padding-left: 20px; }
.src li { margin-bottom: 4px; }

.lead { background: var(--surface); border: 2px solid var(--accent); border-radius: var(--radius); padding: 20px; margin: 0 0 24px; }
.lead .ok { color: var(--good); font-weight: 600; }
.lead .err { color: var(--crit); font-weight: 500; margin: 12px 0 0; }
.lead .msg { margin: 12px 0 0; color: var(--fg-2); }
.lead .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.foot { font-size: 15px; color: var(--muted); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

.nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 0 0 20px; }
.nums div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; text-align: center; }
.nums .n { display: block; font: 600 34px/1.1 var(--font-head); color: var(--accent); }
.nums .t { font-size: 14px; color: var(--muted); }
@media (max-width: 480px) { .nums { grid-template-columns: 1fr; } .nums div { display: flex; align-items: baseline; gap: 12px; text-align: left; } }

.list { padding-left: 22px; margin: 0 0 1em; }
.list li { margin-bottom: 6px; }
details { margin: 0 0 10px; }
summary { cursor: pointer; font-weight: 600; padding: 6px 0; }

@media print {
  body { background: #fff; color: #000; font-size: 12pt; }
  .lead, .btn, .foot a { display: none !important; }
  .card, .result, .callout { border-color: #999; break-inside: avoid; }
}
