:root {
  --bg: #f6f8fb;
  --paper: #ffffff;
  --paper-2: #f9fbfd;
  --ink: #13202f;
  --muted: #64748b;
  --line: #d9e2ec;
  --line-soft: #e8eef5;
  --teal: #0e766b;
  --teal-dark: #0a5f57;
  --teal-soft: #e8f5f3;
  --indigo: #3446a8;
  --amber: #f59e0b;
  --green: #15803d;
  --shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
  --radius: 8px;
  font-family: "Golos Text", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); color: var(--ink); text-size-adjust: 100%; }
body { margin: 0; background: linear-gradient(180deg, #fff 0, #fff 190px, var(--bg) 520px); color: var(--ink); }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 68px;
  padding: 10px clamp(16px, 4vw, 48px);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line-soft);
  backdrop-filter: blur(14px);
}

.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 850; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: #fff;
  background: var(--teal);
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(14, 118, 107, 0.24);
}
.brand span:last-child { display: grid; gap: 1px; }
.brand strong { font-size: 18px; line-height: 1; }
.brand small { color: var(--muted); font-size: 12px; font-weight: 700; }
.topnav { display: flex; align-items: center; gap: 18px; color: var(--muted); font-size: 14px; font-weight: 750; }
.topnav a:hover { color: var(--teal); }

main { width: min(1180px, calc(100vw - 32px)); margin: 0 auto; }
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 18px;
  color: var(--muted);
  font-size: 13px;
}
.breadcrumbs a { color: var(--teal-dark); font-weight: 700; }

h1, h2, h3, p, dl { margin-top: 0; }
h1, h2, h3 { letter-spacing: 0; line-height: 1.12; }
h1 { max-width: 920px; font-size: clamp(34px, 5vw, 62px); }
h2 { margin-bottom: 10px; font-size: clamp(24px, 3vw, 34px); }
p { line-height: 1.65; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 36px;
  align-items: center;
  min-height: 430px;
  padding: 44px 0 34px;
}
.hero__lead { max-width: 760px; color: #405166; font-size: 18px; }
.searchbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  width: min(820px, 100%);
  min-height: 58px;
  margin: 26px 0 18px;
  padding: 7px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.searchbar > .icon { margin-left: 10px; color: var(--teal); }
.searchbar input { min-width: 0; height: 42px; padding: 0 12px; border: 0; outline: 0; background: transparent; }
.searchbar button, .toolbar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  color: #fff;
  background: var(--teal);
  border: 1px solid var(--teal);
  border-radius: 7px;
  font-weight: 850;
  cursor: pointer;
}
.searchbar button:hover, .toolbar button:hover { background: var(--teal-dark); }
.hero-stats { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-stats span {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 8px 10px;
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  color: var(--muted);
}
.hero-stats strong { color: var(--ink); font-size: 18px; }

.hero-panel, .side-panel, .summary-panel, .contact-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.hero-panel { display: grid; gap: 6px; padding: 16px; }
.panel-head { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; color: var(--teal-dark); }
.hero-panel a, .side-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 10px 0;
  border-top: 1px solid var(--line-soft);
}
.hero-panel b, .side-row b, .region-list b, .type-card b { color: var(--teal-dark); font-size: 13px; }
.side-section { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.side-section > strong { display: block; margin-bottom: 8px; }
.city-list { display: grid; gap: 2px; max-height: 420px; overflow: auto; padding-right: 4px; }
.city-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 34px;
  padding: 6px 0;
  color: var(--muted);
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
}
.city-list a[aria-current="page"], .city-list a:hover { color: var(--teal-dark); }

.section, .page-head, .detail-page { padding: 32px 0; }
.section-head { max-width: 760px; margin-bottom: 18px; }
.section-head p, .page-head p { color: var(--muted); }
.section-head--inline { display: flex; align-items: center; gap: 10px; max-width: none; }
.section-head--inline h2 { margin-bottom: 0; }
.page-kicker {
  margin-bottom: 9px;
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 850;
  text-transform: uppercase;
}
.page-head { max-width: 980px; }
.page-head--catalog {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 30px;
  align-items: end;
  max-width: none;
}
.page-head--compact h1 { font-size: clamp(34px, 4vw, 54px); }

.type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 12px;
}
.type-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 70px;
  padding: 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.type-card:hover, .region-list a:hover, .row:hover { border-color: #9fc9c2; box-shadow: 0 10px 26px rgba(14, 118, 107, 0.09); }
.type-card .icon { color: var(--teal); }
.type-card span { min-width: 0; font-weight: 850; }

.region-list, .list, .program-table, .details-grid, .specialty-list { display: grid; gap: 10px; }
.region-list { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.region-list--wide { grid-template-columns: 1fr; }
.region-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 48px;
  padding: 12px 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 13px;
  align-items: center;
  padding: 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.row__icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: var(--teal);
  background: var(--teal-soft);
  border-radius: 7px;
}
.row__body { min-width: 0; }
.row strong, .row small { display: block; }
.row strong { overflow-wrap: anywhere; line-height: 1.3; }
.row small { margin-top: 4px; color: var(--muted); line-height: 1.45; overflow-wrap: anywhere; }
.row__meta { display: inline-flex; align-items: center; gap: 5px; color: var(--teal-dark); font-weight: 850; }

.split-layout, .catalog-layout, .detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 30px;
  align-items: start;
}
.side-panel { position: sticky; top: 86px; padding: 16px; }
.side-row .icon { color: var(--teal); }

.toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px auto;
  gap: 10px;
  padding: 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.toolbar label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 800; }
.toolbar input, .toolbar select {
  min-width: 0;
  height: 42px;
  padding: 0 10px;
  color: var(--ink);
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 7px;
}
.catalog-list { min-width: 0; }
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  color: var(--muted);
}
.pagination a { color: var(--teal-dark); font-weight: 850; }

.detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 26px;
  padding: 28px;
  background: linear-gradient(135deg, #ffffff 0%, #f4fbfa 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.detail-hero h1 { font-size: clamp(30px, 4vw, 50px); overflow-wrap: anywhere; }
.meta-line { display: flex; flex-wrap: wrap; gap: 9px 16px; margin-top: 16px; color: var(--muted); }
.meta-line span { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; overflow-wrap: anywhere; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 13px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 7px;
  font-weight: 850;
}
.button-link--primary { color: #fff; background: var(--teal); border-color: var(--teal); }
.summary-panel { display: grid; align-content: space-between; gap: 18px; padding: 18px; }
.summary-label { color: var(--muted); font-size: 12px; font-weight: 850; text-transform: uppercase; }
.summary-panel strong { display: block; margin-top: 4px; font-size: 44px; line-height: 1; }
.summary-panel span:last-child { color: var(--muted); }
.summary-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 0; }
.summary-stats div { padding: 11px; background: var(--paper-2); border: 1px solid var(--line-soft); border-radius: 7px; }
.summary-stats dt { color: var(--muted); font-size: 12px; font-weight: 800; }
.summary-stats dd { margin: 6px 0 0; font-size: 22px; font-weight: 850; }
.section--tight { padding-top: 0; }
.lead-text { max-width: 820px; color: #334155; font-size: 17px; }

.program-row, .detail-item {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.program-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 16px;
  padding: 16px;
}
.program-title { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.program-title strong { min-width: 0; font-size: 17px; line-height: 1.35; overflow-wrap: anywhere; }
.code-badge {
  padding: 4px 7px;
  color: var(--indigo);
  background: #eef2ff;
  border: 1px solid #dbe3ff;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 850;
}
.program-meta, .exam-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.program-meta span, .exam-list span {
  padding: 5px 8px;
  background: var(--paper-2);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.exam-list span { color: var(--green); background: #edf8f1; border-color: #cdebd6; }
.program-row__facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.program-row__facts span { display: grid; gap: 5px; padding: 10px; background: var(--paper-2); border: 1px solid var(--line-soft); border-radius: 7px; }
.program-row__facts small { color: var(--muted); font-size: 12px; font-weight: 800; }
.program-row__facts strong { font-size: 15px; white-space: nowrap; }
.details-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.detail-item { padding: 14px; }
.detail-item small, .detail-item strong, .detail-item span { display: block; }
.detail-item small { color: var(--muted); font-size: 12px; font-weight: 800; }
.detail-item strong { margin: 5px 0; }
.detail-item span { color: #334155; line-height: 1.5; overflow-wrap: anywhere; }

.contact-panel { position: sticky; top: 86px; padding: 16px; }
.contact-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 0;
  border-top: 1px solid var(--line-soft);
}
.contact-link span { min-width: 0; overflow-wrap: anywhere; }
.contact-link .icon { color: var(--teal); }
.map-panel { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.leaflet-map {
  width: 100%;
  height: 260px;
  overflow: hidden;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.map-coords { display: grid; gap: 4px; margin-top: 8px; color: var(--muted); font-size: 12px; font-weight: 750; }

.specialty-row, .specialty-institution {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.specialty-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 62px;
  padding: 14px;
}
.specialty-row:hover, .specialty-institution:hover { border-color: #9fc9c2; box-shadow: 0 10px 26px rgba(14, 118, 107, 0.09); }
.specialty-row__body { display: grid; gap: 4px; min-width: 0; }
.specialty-row__body small { color: var(--indigo); font-weight: 850; }
.specialty-row__body strong { line-height: 1.35; overflow-wrap: anywhere; }
.specialty-row__meta {
  display: grid;
  place-items: center;
  min-width: 42px;
  height: 32px;
  padding: 0 9px;
  color: var(--teal-dark);
  background: var(--teal-soft);
  border-radius: 999px;
  font-weight: 850;
}
.specialty-institution { display: grid; gap: 10px; padding: 10px; }
.specialty-institution > .row { border-color: var(--line-soft); box-shadow: none; }
.program-table--compact { gap: 8px; }
.program-row--compact { grid-template-columns: minmax(0, 1fr) 240px; padding: 12px; }
.program-row--compact .program-title strong { font-size: 15px; }

.seo-block {
  margin: 28px 0;
  padding: 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  border-radius: var(--radius);
}
.seo-block h2 { font-size: 24px; }
.seo-block p:last-child { margin-bottom: 0; }
.empty { color: var(--muted); }

.footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-top: 50px;
  padding: 28px clamp(16px, 4vw, 48px);
  color: var(--muted);
  background: #fff;
  border-top: 1px solid var(--line-soft);
}
.footer-brand { color: var(--ink); font-weight: 850; }
.footer p { max-width: 560px; margin: 8px 0 0; }
.footer nav { display: flex; gap: 16px; font-weight: 800; }

@media (max-width: 860px) {
  main { width: min(1180px, calc(100vw - 24px)); }
  .topbar, .footer { align-items: stretch; flex-direction: column; }
  .topnav { flex-wrap: wrap; }
  .hero, .page-head--catalog, .split-layout, .catalog-layout, .detail-hero, .detail-layout, .program-row, .program-row--compact {
    grid-template-columns: 1fr;
  }
  .hero { min-height: 0; padding-top: 34px; }
  .hero-panel, .side-panel, .contact-panel { position: static; }
  .searchbar { grid-template-columns: auto minmax(0, 1fr); }
  .searchbar button { grid-column: 1 / -1; width: 100%; }
  .toolbar { grid-template-columns: 1fr; }
  .program-row__facts, .summary-stats { grid-template-columns: 1fr; }
  .region-list { grid-template-columns: 1fr; }
  .detail-hero { padding: 20px; }
  .hero-actions { display: grid; }
}
