:root {
  --bg: #f4f7f4;
  --card: #ffffff;
  --ink: #1c2a24;
  --muted: #5c6b62;
  --line: #d7e0d8;
  --accent: #1f6f5c;
  --accent-2: #2f8f74;
  --accent-soft: #e5f1ec;
  --amber: #b06a1e;
  --shadow: 0 1px 3px rgba(28, 42, 36, .08), 0 6px 18px rgba(28, 42, 36, .05);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  font-size: 16px;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 1rem; }

/* --- Шапка --- */
.top {
  background: linear-gradient(135deg, #1f6f5c, #2f8f74);
  color: #fff;
  padding: 1.8rem 0 1.6rem;
}
.top h1 {
  margin: 0;
  font-size: 1.7rem;
  line-height: 1.25;
  letter-spacing: .01em;
  max-width: 60rem;
}
.top .tagline {
  margin: .6rem 0 1.1rem;
  opacity: .95;
  font-size: 1rem;
  max-width: 52rem;
}
.top .tagline b { color: #eafaf3; }

.actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.btn {
  display: inline-block;
  font: inherit;
  padding: .55rem 1.05rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, .9);
  background: rgba(255, 255, 255, .14);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  font-weight: 600;
}
.btn:hover { background: rgba(255, 255, 255, .24); }

main { padding: 1.3rem 0 2rem; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.1rem 1.2rem 1.3rem;
  margin-bottom: 1.1rem;
  box-shadow: var(--shadow);
}
.card h2 {
  margin: 0 0 .9rem;
  font-size: 1.25rem;
  color: var(--accent);
}
.hint { margin: .8rem 0 0; color: var(--muted); font-size: 14px; }
.hint code, .src code {
  background: #eef3ef;
  border-radius: 4px;
  padding: 1px 5px;
  font-family: "Courier New", monospace;
  font-size: 13px;
}

/* --- Статистика --- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: .7rem;
  margin-bottom: 1.1rem;
}
.stat {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .7rem .8rem;
  background: #fafcf9;
  display: flex;
  flex-direction: column;
  gap: .1rem;
}
.stat b { font-size: 1.5rem; color: var(--accent); line-height: 1.1; }
.stat span { font-size: 13px; color: var(--muted); }

/* --- Таблицы --- */
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table { border-collapse: collapse; width: 100%; }
th, td { padding: .45rem .55rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }

.regions { font-size: 15px; }
.regions th, .regions td { text-align: right; }
.regions th:first-child, .regions td:first-child { text-align: left; font-weight: 600; }
.regions thead th {
  background: var(--accent-soft);
  color: var(--ink);
  font-weight: 700;
  white-space: nowrap;
}
.regions tbody tr:nth-child(even) { background: #fafcf9; }
.regions tbody tr.total td {
  border-top: 2px solid var(--accent);
  font-weight: 700;
  background: var(--accent-soft);
}

/* --- Фильтры --- */
.filters {
  display: flex;
  gap: .7rem 1rem;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: .6rem;
}
.filters label {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}
.filters .grow { flex: 1 1 240px; min-width: 200px; }
select, input[type="search"] {
  font: inherit;
  padding: .5rem .6rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  min-width: 0;
}
.filters select { min-width: 12rem; }
select:focus, input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.filters .btn {
  border-color: var(--accent);
  background: #fff;
  color: var(--accent);
}
.filters .btn:hover { background: var(--accent-soft); }

.found { margin: .2rem 0 .7rem; font-size: 15px; color: var(--muted); }
.found b { color: var(--ink); }

/* --- Перечень --- */
.list { font-size: 15px; }
.list thead th {
  background: var(--accent-soft);
  color: var(--ink);
  font-weight: 700;
  position: sticky;
  top: 0;
  white-space: nowrap;
}
.list tbody tr:nth-child(even) { background: #fafcf9; }
.list tbody tr:hover { background: var(--accent-soft); }
.list .lat { font-style: italic; white-space: nowrap; }
.list .lf { white-space: nowrap; }
.list .reg { white-space: nowrap; }
.list ul.src {
  margin: 0;
  padding-left: 1.05rem;
  font-size: 13px;
  color: var(--muted);
  max-width: 34rem;
}
.list ul.src li { margin: 0 0 .15rem; }

/* --- Футер --- */
.foot {
  border-top: 1px solid var(--line);
  padding: 1.1rem 0 1.4rem;
  color: var(--muted);
  font-size: 14px;
}
.foot p { margin: .2rem 0; }
.foot a { color: var(--accent); }
.src { font-size: 13px; }

@media (max-width: 620px) {
  .top h1 { font-size: 1.35rem; }
  .list { font-size: 14px; }
  .list ul.src { max-width: none; }
  .filters select { min-width: 0; width: 100%; }
  .filters label { flex: 1 1 100%; }
}

@media print {
  .top .actions, .filters, .foot, .actions { display: none; }
  body { background: #fff; }
  .card { box-shadow: none; border-color: #bbb; break-inside: avoid; }
}
