/* ============================================================
   Счёт и расчёт — schet-i-raschet.ru
   Деловой светлый стиль: белый фон, глубокий зелёный акцент,
   системные шрифты, максимум воздуха. Адаптив до 360px.
   ============================================================ */

:root {
  --accent: #1a7f5c;
  --accent-dark: #135f45;
  --accent-pale: #e9f5f0;
  --ink: #1e2b26;
  --muted: #5f6f68;
  --line: #e2e9e5;
  --bg: #ffffff;
  --bg-soft: #f7faf8;
  --radius: 10px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
}

.wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 20px;
}

a { color: var(--accent); }
a:hover { color: var(--accent-dark); }

h1 {
  font-size: 30px;
  line-height: 1.25;
  margin: 36px 0 16px;
  letter-spacing: -0.01em;
}

h2 { font-size: 23px; line-height: 1.3; margin: 40px 0 14px; }
h3 { font-size: 18px; line-height: 1.35; margin: 24px 0 10px; }

p { margin: 0 0 14px; }

/* ---------- Шапка ---------- */

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 24px;
  padding-top: 18px;
  padding-bottom: 18px;
}

.site-logo {
  font-size: 21px;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.site-logo::before {
  content: "=";
  display: inline-block;
  margin-right: 9px;
  padding: 1px 8px 3px;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

.site-logo:hover { color: var(--accent-dark); }

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 22px;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 15.5px;
  padding: 4px 0;
}

.site-nav a:hover { color: var(--accent); }

/* ---------- Основная область ---------- */

main { padding-bottom: 64px; }

.lead {
  font-size: 18px;
  color: var(--muted);
  max-width: 680px;
  margin-bottom: 28px;
}

/* ---------- Сетка карточек инструментов ---------- */

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 18px;
  margin: 22px 0 10px;
}

.tool-card {
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 22px 20px;
  background: var(--bg);
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.tool-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 18px rgba(26, 127, 92, 0.10);
  color: var(--ink);
}

.tool-card h3 {
  margin: 0 0 8px;
  font-size: 17.5px;
  color: var(--accent);
}

.tool-card p {
  margin: 0;
  font-size: 15px;
  color: var(--muted);
  line-height: 1.55;
}

/* ---------- Блок инструмента на внутренней странице ---------- */

.tool {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 26px 24px;
  margin: 22px 0 34px;
}

.tool h2:first-child { margin-top: 0; }

/* ---------- Поля форм ---------- */

.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-size: 14.5px;
  color: var(--muted);
  margin-bottom: 5px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cdd8d3;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
}

.field textarea { resize: vertical; min-height: 70px; }

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 0;
  border-color: var(--accent);
}

.field-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.field-row .field { flex: 1 1 180px; }

/* ---------- Кнопки ---------- */

.btn {
  display: inline-block;
  padding: 11px 22px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: #fff;
  color: var(--accent);
  font: inherit;
  font-size: 16px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.btn:hover { background: var(--accent-pale); color: var(--accent-dark); }

.btn-main {
  background: var(--accent);
  color: #fff;
}

.btn-main:hover { background: var(--accent-dark); color: #fff; }

/* ---------- Таблица результатов ---------- */

.result-table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  font-size: 16px;
  background: #fff;
}

.result-table th,
.result-table td {
  border: 1px solid var(--line);
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
}

.result-table th {
  background: var(--accent-pale);
  font-weight: 600;
  color: var(--ink);
}

.result-table td.num,
.result-table th.num { text-align: right; white-space: nowrap; }

.result-table tr.total td {
  font-weight: 700;
  background: var(--bg-soft);
}

/* ---------- Статья под инструментом ---------- */

.article {
  max-width: 720px;
  margin-top: 44px;
}

.article h2 {
  padding-bottom: 6px;
  border-bottom: 2px solid var(--accent-pale);
}

.article ul, .article ol { padding-left: 24px; margin: 0 0 14px; }
.article li { margin-bottom: 6px; }

.article table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 15.5px;
}

.article table th,
.article table td {
  border: 1px solid var(--line);
  padding: 9px 12px;
  text-align: left;
  vertical-align: top;
}

.article table th { background: var(--accent-pale); }

.article .note {
  background: var(--accent-pale);
  border-left: 4px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 12px 16px;
  margin: 16px 0;
  font-size: 15.5px;
}

/* Прокрутка широких таблиц на узких экранах */
.table-scroll { overflow-x: auto; }

/* ---------- Подвал ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
  margin-top: 40px;
  padding: 26px 0 32px;
  font-size: 14.5px;
  color: var(--muted);
}

.site-footer p { margin: 0 0 8px; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }

/* ---------- Адаптив ---------- */

@media (max-width: 640px) {
  h1 { font-size: 25px; margin-top: 26px; }
  h2 { font-size: 20px; }
  .lead { font-size: 16.5px; }
  .tool { padding: 18px 16px 16px; }
  .tools-grid { grid-template-columns: 1fr; }
  .site-header .wrap { padding-top: 14px; padding-bottom: 14px; }
}

@media (max-width: 380px) {
  body { font-size: 16px; }
  .wrap { padding: 0 14px; }
  .site-logo { font-size: 19px; }
  .site-nav { gap: 2px 14px; }
  .btn { width: 100%; text-align: center; }
}

/* ---------- Печать: только документ .printable ---------- */

@media print {
  @page { margin: 15mm; }

  body { background: #fff; font-size: 12pt; }

  body * { visibility: hidden; }

  .printable, .printable * { visibility: visible; }

  .printable {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    border: none;
    background: #fff;
    box-shadow: none;
  }

  .no-print { display: none !important; }
}
