/* Школоскоп. Палитра: тетрадная клетка и Нева.
   paper #F3F5F7 · white #FFFFFF · ink #1B2A41 · neva #1F5FA8 · chalk-red #B9412F · amber #D9A21B · moss #2F8F5B · line #D7DEE6 */
:root {
  --paper: #f3f5f7; --white: #fff; --ink: #1b2a41; --muted: #5b6b7f; --neva: #1f5fa8; --line: #d7dee6;
  --b0: #b9412f; --b1: #d9a21b; --b2: #6aa6d6; --b3: #1f5fa8;
  --serif: "PT Serif", Georgia, "Times New Roman", serif;
  --sans: "Golos Text", "Segoe UI", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.55 var(--sans);
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 32px 32px; background-attachment: fixed;
}
a { color: var(--neva); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #163f70; }
:focus-visible { outline: 3px solid #f0c34f; outline-offset: 2px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.15; margin: 0 0 .4em; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: -.01em; }
h2 { font-size: 1.35rem; margin-top: 2rem; }
p { margin: 0 0 1em; }
small { color: var(--muted); font-size: .85em; }
.note { color: var(--muted); font-size: .92rem; max-width: 70ch; }
.lead { font-size: 1.1rem; max-width: 70ch; }
.legal { color: var(--muted); margin-top: -.3rem; }
.crumbs { color: var(--muted); font-size: .9rem; margin-bottom: .6rem; }
.crumbs a { color: var(--muted); }

.top, main, footer { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 2rem; padding-block: 18px; }
.brand { font-family: var(--serif); font-weight: 700; font-size: 1.5rem; color: var(--ink); text-decoration: none; }
.top nav { display: flex; gap: 1.2rem; }
.top nav a { color: var(--ink); text-decoration: none; border-bottom: 2px solid transparent; }
.top nav a:hover { border-color: var(--neva); }
.find { display: flex; margin-left: auto; }
.find input { font: inherit; padding: .45rem .7rem; border: 1px solid var(--line); border-right: 0; border-radius: 4px 0 0 4px; min-width: 16rem; background: var(--white); }
.find button { font: inherit; font-weight: 500; padding: .45rem .9rem; border: 1px solid var(--neva); background: var(--neva); color: #fff; border-radius: 0 4px 4px 0; cursor: pointer; }
.find button:hover { background: #163f70; }
.find.big { margin: 1.4rem 0 0; max-width: 40rem; }
.find.big input { font-size: 1.1rem; padding: .7rem .9rem; flex: 1; min-width: 0; }
.find.big button { font-size: 1.05rem; padding: .7rem 1.2rem; }

main { background: var(--white); padding: 28px 28px 40px; margin-top: 8px; border: 1px solid var(--line); border-radius: 6px; }
footer { padding: 24px 28px 40px; color: var(--muted); font-size: .85rem; }

.hero { padding-bottom: 1.5rem; border-bottom: 1px solid var(--line); margin-bottom: 1.5rem; }
.hero h1 { max-width: 20ch; font-size: clamp(2rem, 5vw, 3.2rem); }
.two { display: grid; grid-template-columns: 1fr 1.4fr; gap: 2.5rem; }
.two h2 { margin-top: 0; }
.districts { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 1.5rem; }
.districts li { display: flex; justify-content: space-between; border-bottom: 1px dotted var(--line); padding: .25rem 0; break-inside: avoid; }
.districts span { color: var(--muted); font-variant-numeric: tabular-nums; }
.top { }
ol.top { padding-left: 1.4rem; margin: 0; }
ol.top li { display: flex; gap: .5rem; align-items: baseline; padding: .3rem 0; border-bottom: 1px dotted var(--line); }
ol.top li b { margin-left: auto; }
.pct { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--neva); white-space: nowrap; }
.how dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin: 0; }
.how dt { font-weight: 600; margin-bottom: .3rem; }
.how dd { margin: 0; color: var(--muted); font-size: .95rem; }

table.list { width: 100%; border-collapse: collapse; margin: .5rem 0 1rem; font-size: .95rem; }
table.list th { text-align: left; font-weight: 500; color: var(--muted); border-bottom: 2px solid var(--ink); padding: .4rem .5rem; }
table.list td { padding: .45rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list td:first-child { padding-left: 0; }
table.list.compact td, table.list.compact th { padding-block: .3rem; }
td.addr { color: var(--muted); font-size: .88rem; }
.barcell { min-width: 12rem; }
table.ege td[rowspan] { font-weight: 500; }

.bar { display: inline-flex; width: 11rem; max-width: 100%; height: 12px; border-radius: 2px; overflow: hidden; vertical-align: middle; background: #e9edf1; }
.bar i { display: block; height: 100%; }
.b0 { background: var(--b0); } .b1 { background: var(--b1); } .b2 { background: var(--b2); } .b3 { background: var(--b3); }
.bar + .pct { margin-left: .5rem; }
.legend { color: var(--muted); font-size: .85rem; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 2px; vertical-align: -1px; margin: 0 .25rem 0 .8rem; }
.legend i:first-child { margin-left: 0; }

.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin: 1.5rem 0; padding: 1.2rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.facts h2 { margin: 0 0 .3rem; font-size: 1.05rem; font-family: var(--sans); font-weight: 600; color: var(--muted); }
.facts .big { font-family: var(--serif); font-size: 2.6rem; line-height: 1; margin: .2rem 0 .4rem; color: var(--neva); }
.facts p { margin-bottom: .3rem; }
.map { height: 320px; border: 1px solid var(--line); border-radius: 4px; margin: 1rem 0 1.5rem; }
.mapwrap { margin: 1rem 0 1.5rem; }
.mapwrap .map { margin: 0; }
.mapbar { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; align-items: center; font-size: .9rem; color: var(--muted); margin-bottom: .5rem; }
.mapbar input { margin-right: .35rem; }
.maplegend i { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: -1px; margin: 0 .25rem 0 .7rem; }
.leaflet-popup-content { font: 14px/1.4 var(--sans); }
.pie-cluster { background: none; border: 0; }
.pie-cluster svg { display: block; filter: drop-shadow(0 1px 2px rgba(27,42,65,.35)); }
.neigh { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: .3rem 1.5rem; }
.neigh li { display: flex; justify-content: space-between; border-bottom: 1px dotted var(--line); padding: .25rem 0; }
.subjects { font-size: .95rem; }
.prose { max-width: 72ch; }
.prose h2 { font-size: 1.2rem; }

@media (max-width: 760px) {
  .two, .how dl, .facts { grid-template-columns: 1fr; }
  .districts { columns: 1; }
  main { padding: 20px 16px 32px; }
  .find { width: 100%; margin-left: 0; }
  .find input { min-width: 0; flex: 1; }
  table.list { display: block; overflow-x: auto; }
  .hero h1 { font-size: 1.9rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* форма обратной связи */
.feedback { max-width: 40rem; display: grid; gap: .8rem; margin: 1rem 0 1.5rem; }
.feedback label { display: grid; gap: .3rem; font-size: .95rem; color: var(--muted); }
.feedback input, .feedback textarea { font: inherit; color: var(--ink); padding: .5rem .7rem; border: 1px solid var(--line); border-radius: 4px; background: var(--white); width: 100%; }
.feedback textarea { resize: vertical; }
.feedback button { justify-self: start; font: inherit; font-weight: 500; padding: .55rem 1.2rem; border: 1px solid var(--neva); background: var(--neva); color: #fff; border-radius: 4px; cursor: pointer; }
.feedback button:hover { background: #163f70; }
.feedback .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.feedback .note { margin: 0; }
.ok { color: var(--moss, #2f8f5b); font-weight: 500; }
.err { color: var(--b0); font-weight: 500; }
