:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --primary: #009933;
  --primary-dark: #007a29;
  --primary-light: #eef7f0;
  --text: #1a1d22;
  --text-soft: #3f4753;
  --muted: #6b7280;
  --border: #e1e5ea;
  --border-strong: #cbd2d8;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Roboto", -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
a { color: var(--primary-dark); }

/* ============ Шапка ============ */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; padding: 14px 24px; max-width: 1180px; margin: 0 auto;
}
.brand {
  display: flex; align-items: center; gap: 14px;
  text-decoration: none; color: inherit;
}
.brand-logo { height: 44px; width: auto; display: block; }
.brand-divider {
  width: 1px; height: 32px; background: var(--border-strong);
}
.brand-title {
  font-size: 14px; line-height: 1.35; color: var(--text-soft);
}
.brand-title b { color: var(--text); font-weight: 600; }
.contacts {
  display: flex; flex-direction: column; gap: 2px;
  text-align: right; align-items: flex-end;
}
.contact-line {
  text-decoration: none; color: var(--text);
  font-size: 15px; font-weight: 500;
}
.contact-line.muted { color: var(--muted); font-size: 13px; font-weight: 400; }
.contact-line:hover { color: var(--primary-dark); }
@media (max-width: 720px) {
  .topbar-inner { flex-wrap: wrap; }
  .brand-title { display: none; }
  .contacts { width: 100%; align-items: flex-start; text-align: left; }
}

/* ============ Intro ============ */
.intro {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 26px 0 24px;
}
.intro-lead {
  margin: 0;
  font-size: 17px;
  line-height: 1.55;
  color: var(--text-soft);
  max-width: 820px;
}
.intro-specs {
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--muted);
}
.intro-specs span {
  color: var(--text);
  font-weight: 500;
}

/* ============ Layout ============ */
.layout {
  display: grid;
  grid-template-columns: minmax(330px, 1fr) 1.5fr;
  gap: 22px;
  padding: 26px 0 44px;
}
@media (max-width: 840px) {
  .layout { grid-template-columns: 1fr; }
}

/* ============ Cards ============ */
.card {
  background: var(--surface);
  border-radius: 6px;
  padding: 22px 24px;
  border: 1px solid var(--border);
}
.card h2 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin: 0 0 14px;
  font-weight: 600;
}
.card h2:not(:first-child) {
  margin-top: 24px; padding-top: 18px;
  border-top: 1px solid var(--border);
}
.hint { color: var(--muted); font-weight: 400; text-transform: none; font-size: 13px; letter-spacing: 0; }

/* ============ Form fields ============ */
.field { margin-bottom: 14px; }
.field label {
  display: block; margin-bottom: 5px; color: var(--text-soft);
  font-size: 13px; font-weight: 500;
}
.field select, .field input[type="text"] {
  width: 100%; padding: 9px 11px;
  border: 1px solid var(--border-strong); border-radius: 4px;
  background: #fff; color: var(--text); font-size: 14px;
  font-family: inherit;
  transition: border-color .12s, box-shadow .12s;
}
.field select:hover, .field input[type="text"]:hover { border-color: #a8b2bb; }
.field select:focus, .field input[type="text"]:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 153, 51, .14);
}

/* ============ Дисклеймер про оферту ============ */
.disclaimer {
  margin: 16px 0 8px;
  padding: 10px 12px;
  background: #fffbe6;
  border-left: 3px solid #f0c14b;
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.5;
  border-radius: 0 4px 4px 0;
}
.disclaimer a { color: var(--primary-dark); white-space: nowrap; }

/* ============ About-блок (SEO) ============ */
.about {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 32px 0 36px;
}
.about h2 {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 18px;
}
.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 30px;
  align-items: start;
}
@media (max-width: 760px) {
  .about-grid { grid-template-columns: 1fr; gap: 20px; }
}
.about p {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--text-soft);
  line-height: 1.6;
}
.about p b { color: var(--text); font-weight: 600; }
.about-features {
  margin: 0;
  padding-left: 18px;
  font-size: 13.5px;
  color: var(--text-soft);
  line-height: 1.7;
}
.about-features li { margin-bottom: 4px; }
.about-features b { color: var(--text); font-weight: 600; }
.about-source {
  margin-top: 16px !important;
  font-size: 13px;
  color: var(--muted) !important;
}

/* ============ Cookie-баннер ============ */
.cookie-banner {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: #1a1d22;
  color: #e6e9ec;
  font-size: 13px;
  padding: 12px 0;
  z-index: 1000;
  box-shadow: 0 -2px 10px rgba(0,0,0,.12);
}
.cookie-banner .container {
  display: flex; align-items: center; gap: 16px;
  justify-content: space-between; flex-wrap: wrap;
}
.cookie-banner a { color: #7ee397; text-decoration: underline; }
.cookie-ok {
  background: var(--primary); color: #fff; font-weight: 600;
  border: none; border-radius: 4px; padding: 8px 18px;
  cursor: pointer; font-size: 13px; font-family: inherit;
  flex: none;
}
.cookie-ok:hover { background: var(--primary-dark); }

/* ============ Consent checkbox ============ */
.consent {
  display: flex; gap: 10px; align-items: flex-start;
  margin: 16px 0 8px;
  font-size: 13px; color: var(--text-soft); line-height: 1.45;
}
.consent input[type="checkbox"] {
  margin: 2px 0 0; flex: none;
  accent-color: var(--primary);
  width: 16px; height: 16px;
}
.consent a { color: var(--primary-dark); }

/* honeypot — скрытое поле для ботов */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ============ Buttons ============ */
button.primary {
  width: 100%;
  background: var(--primary);
  color: #fff; font-weight: 600;
  border: none; border-radius: 4px;
  padding: 12px;
  cursor: pointer; font-size: 15px;
  font-family: inherit;
  margin-top: 6px;
  transition: background .12s;
}
button.primary:hover { background: var(--primary-dark); }
button.primary:disabled { background: #b9c5be; cursor: not-allowed; }

/* ============ Result block ============ */
.code-label {
  font-size: 12px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); margin-bottom: 6px;
}
.result .code-box {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  background: #fafbfc; border: 1px solid var(--border);
  padding: 12px 14px; border-radius: 4px;
  font-size: 13px; word-break: break-all;
  margin-bottom: 20px;
  color: var(--primary-dark);
  font-weight: 500;
}

table.breakdown { width: 100%; border-collapse: collapse; }
table.breakdown td {
  padding: 10px 0; border-bottom: 1px solid var(--border);
  font-size: 14px;
}
table.breakdown td:first-child { color: var(--text-soft); }
table.breakdown td.num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }

.totals {
  margin-top: 16px;
  padding: 16px 18px;
  background: #fafbfc;
  border: 1px solid var(--border);
  border-radius: 4px;
}
.totals .row {
  display: flex; justify-content: space-between;
  padding: 5px 0; font-size: 14px; color: var(--text-soft);
}
.totals .row.big {
  font-size: 18px; font-weight: 700; color: var(--primary-dark);
  margin-top: 8px; padding-top: 12px;
  border-top: 1px solid var(--border);
}
.totals .row.big .num { color: var(--primary-dark); }
.num { font-variant-numeric: tabular-nums; }

/* ============ Ссылка на документацию ============ */
.docs-link {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 16px;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid var(--primary);
  border-radius: 4px;
  color: var(--primary-dark);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: background .12s;
}
.docs-link:hover { background: var(--primary-light); }
.docs-link[hidden] { display: none; }

/* ============ Спецификация ============ */
details.bom { margin-top: 18px; }
details.bom summary {
  cursor: pointer; color: var(--primary-dark); font-weight: 500;
  padding: 8px 0; font-size: 14px;
  list-style: none;
}
details.bom summary::before {
  content: "▸ "; display: inline-block; transition: transform .15s;
}
details.bom[open] summary::before { transform: rotate(90deg); }
details.bom summary::-webkit-details-marker { display: none; }
#bom_table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13px; }
#bom_table th, #bom_table td {
  text-align: left; padding: 7px 9px;
  border-bottom: 1px solid var(--border);
}
#bom_table th {
  background: #fafbfc; font-weight: 600;
  color: var(--text-soft); font-size: 12px;
  text-transform: uppercase; letter-spacing: .04em;
}
#bom_table td.num { text-align: right; }

.note {
  font-size: 12px; color: var(--muted); margin-top: 18px; line-height: 1.6;
}

/* ============ Footer ============ */
.footer {
  padding: 18px 0;
  color: var(--muted);
  font-size: 13px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  margin-top: 22px;
}
.footer .container {
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; flex-wrap: wrap;
}
.footer-link { color: var(--text-soft); text-decoration: none; font-weight: 500; }
.footer-link:hover { color: var(--primary-dark); }

/* ============ Privacy/static страница ============ */
.doc {
  max-width: 760px; margin: 30px auto 50px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 6px; padding: 32px 40px;
}
.doc h1 { font-size: 22px; margin: 0 0 8px; color: var(--text); }
.doc .doc-meta { color: var(--muted); font-size: 13px; margin-bottom: 22px; }
.doc h2 { font-size: 16px; margin: 22px 0 8px; color: var(--text); }
.doc p, .doc li { font-size: 14px; color: var(--text-soft); line-height: 1.6; }
.doc ol, .doc ul { padding-left: 22px; }
