/* ====== Сброс и базовые стили ====== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #1A5276;
  --primary-light: #2980B9;
  --primary-dark: #0E3451;
  --accent: #2980B9;
  --bg-light: #F8F9FA;
  --bg-white: #FFFFFF;
  --text: #333333;
  --text-light: #666666;
  --text-muted: #999999;
  --border: #DEE2E6;
  --success: #27AE60;
  --radius: 8px;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.12);
  --max-width: 1200px;
  --header-height: 72px;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--text);
  background: var(--bg-white);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary-light);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover { color: var(--primary); }

img { max-width: 100%; height: auto; display: block; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* ====== Хедер ====== */
.header {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.header__logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--primary);
}

.header__logo-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.header__logo-icon img {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.header__nav { display: flex; gap: 4px; }

.header__nav a {
  padding: 8px 16px;
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.25;
  transition: background 0.2s, color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 40px;
  white-space: nowrap;
}
.header__nav a:hover,
.header__nav a.active {
  background: var(--primary);
  color: #fff;
}

.header__burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  background: none;
  border: none;
}
.header__burger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: 0.3s;
}

@media (max-width: 768px) {
  .header__nav {
    display: none;
    flex-direction: column;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    padding: 12px 20px;
    gap: 4px;
    box-shadow: var(--shadow);
  }
  .header__nav.open { display: flex; }
  .header__burger { display: flex; }
  .header__logo-icon,
  .header__logo-icon img {
    width: 52px;
    height: 52px;
  }
}

/* ====== Футер ====== */
.footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,0.85);
  padding: 48px 0 24px;
  margin-top: 80px;
}

.footer__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 40px;
  margin-bottom: 40px;
}

.footer__title {
  color: #fff;
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.footer a { color: rgba(255,255,255,0.7); }
.footer a:hover { color: #fff; }
.footer__links { list-style: none; }
.footer__links li { margin-bottom: 8px; }

.footer__bottom {
  border-top: 1px solid rgba(255,255,255,0.15);
  padding-top: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.5);
}
.footer__bottom a {
  color: #fff;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ====== Hero ====== */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  padding: 80px 0;
  text-align: center;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 16px;
  line-height: 1.3;
}

.hero p {
  font-size: 1.2rem;
  max-width: 700px;
  margin: 0 auto 32px;
  opacity: 0.9;
  line-height: 1.7;
}

.hero__cta {
  display: inline-block;
  padding: 14px 36px;
  background: #fff;
  color: var(--primary);
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 1.05rem;
  transition: transform 0.2s, box-shadow 0.2s;
}
.hero__cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0,0,0,0.2);
  color: var(--primary);
}

/* ====== Секции ====== */
.section {
  padding: 64px 0;
}

.section--gray {
  background: var(--bg-light);
}

.section__title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 12px;
  text-align: center;
}

.section__subtitle {
  text-align: center;
  color: var(--text-light);
  margin-bottom: 40px;
  font-size: 1.1rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* ====== Карточки ====== */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  justify-content: center;
  grid-auto-flow: row;
}

.card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.card__icon {
  width: 48px;
  height: 48px;
  background: var(--bg-light);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--primary);
  flex-shrink: 0;
}

.card__heading {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.card__heading h3 {
  margin-bottom: 0;
}

.card h3 {
  font-size: 1.15rem;
  color: var(--primary-dark);
}

.card p {
  color: var(--text-light);
  font-size: 0.95rem;
  line-height: 1.6;
}

.card__link {
  display: inline-block;
  margin-top: 12px;
  font-weight: 600;
  font-size: 0.95rem;
}



/* ====== Новости (главная) ====== */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.news-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.news-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.news-card__image {
  height: 200px;
  background: var(--bg-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 2.5rem;
}
.news-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.news-card__body { padding: 20px; }
.news-card__date {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.news-card h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
  color: var(--primary-dark);
}
.news-card p {
  font-size: 0.95rem;
  color: var(--text-light);
  line-height: 1.6;
}

/* ====== Быстрые ссылки ====== */
.quick-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.quick-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-weight: 600;
  color: var(--primary-dark);
  transition: background 0.2s, border-color 0.2s;
}
.quick-link:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.quick-link__icon {
  font-size: 1.3rem;
  width: 24px;
  text-align: center;
}

/* ====== Страница "О центре" ====== */
.about-content {
  max-width: 800px;
  margin: 0 auto;
}

.about-content h2 {
  font-size: 1.5rem;
  color: var(--primary-dark);
  margin: 32px 0 16px;
}

.about-content p {
  margin-bottom: 16px;
  line-height: 1.8;
  color: var(--text);
}

.about-content ul {
  margin: 16px 0;
  padding-left: 24px;
}
.about-content li {
  margin-bottom: 8px;
  line-height: 1.7;
}

.awards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.award-card {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}

.award-card img {
  max-height: 400px;
  margin: 16px auto;
  border-radius: 4px;
  box-shadow: var(--shadow);
}

.award-card h4 {
  color: var(--primary-dark);
  margin-bottom: 8px;
}

.award-card .year {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ====== Законодательство ====== */
.legislation-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.legislation-tab {
  padding: 12px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-white);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  transition: all 0.2s;
}
.legislation-tab:hover { border-color: var(--primary-light); }
.legislation-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.legislation-panel {
  display: none;
  animation: fadeIn 0.3s;
}
.legislation-panel.active { display: block; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.legislation-panel h3 {
  font-size: 1.3rem;
  color: var(--primary-dark);
  margin-bottom: 16px;
}

.legislation-panel ul {
  list-style: none;
  margin-bottom: 24px;
}

.legislation-panel li {
  position: relative;
  padding: 12px 16px 12px 28px;
  margin-bottom: 8px;
  background: var(--bg-light);
  border-radius: var(--radius);
  border-left: 3px solid var(--primary-light);
  line-height: 1.7;
}

.legislation-panel li::before {
  content: "→";
  position: absolute;
  left: 10px;
  color: var(--primary);
  font-weight: bold;
}

.law-links {
  background: var(--bg-light);
  padding: 24px;
  border-radius: var(--radius);
  margin-top: 24px;
}

.law-links h4 {
  margin-bottom: 12px;
  color: var(--primary-dark);
}

.law-links a {
  display: block;
  padding: 8px 0;
  border-bottom: 1px dotted var(--border);
}
.law-links a:last-child { border-bottom: none; }

/* ====== Лента шагов (услуги) ====== */
.steps-timeline {
  display: flex;
  gap: 0;
  max-width: 960px;
  margin: 0 auto;
  position: relative;
}

@media (max-width: 768px) {
  .steps-timeline {
    flex-direction: column;
    gap: 0;
  }
}

.step-item {
  flex: 1;
  text-align: center;
  position: relative;
  padding: 0 12px;
}

.step-item:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 28px;
  right: -8px;
  width: 24px;
  height: 2px;
  background: var(--primary-light);
}

@media (max-width: 768px) {
  .step-item:not(:last-child)::after {
    top: auto;
    bottom: -2px;
    left: 50%;
    right: auto;
    width: 2px;
    height: 24px;
    transform: translateX(-50%);
  }
}

.step-item__num {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 1.4rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  flex-shrink: 0;
}

.step-item h4 {
  font-size: 1.1rem;
  color: var(--primary-dark);
  margin-bottom: 8px;
}

.step-item p {
  color: var(--text-light);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ====== Услуги ====== */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.service-card {
  padding: 32px 24px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.2s;
  max-width: 420px;
  justify-self: center;
  width: 100%;
}
.service-card:hover {
  box-shadow: var(--shadow-hover);
  border-color: var(--primary-light);
}

.service-card__icon {
  width: 56px;
  height: 56px;
  background: var(--primary);
  color: #fff;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
}

.service-card__heading {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}

.service-card__heading h3 {
  margin-bottom: 0;
}

.service-card h3 {
  font-size: 1.2rem;
  color: var(--primary-dark);
}

.service-card p {
  color: var(--text-light);
  line-height: 1.7;
  font-size: 0.95rem;
}

/* ====== Новости (страница) ====== */
.news-list {
  max-width: 800px;
  margin: 0 auto;
}

.news-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 24px;
  background: var(--bg-white);
}

.news-item__date {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.news-item h3 {
  font-size: 1.3rem;
  color: var(--primary-dark);
  margin-bottom: 12px;
}

.news-item__text {
  color: var(--text);
  line-height: 1.8;
}

.news-item__photo {
  margin-top: 16px;
  border-radius: var(--radius);
  overflow: hidden;
}
.news-item__photo img {
  width: 100%;
  border-radius: var(--radius);
}

/* ====== Отчёты ====== */
.reports-list {
  max-width: 800px;
  margin: 0 auto;
}

.report-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  background: var(--bg-white);
  transition: all 0.2s;
}
.report-card:hover { box-shadow: var(--shadow); }

.report-card__icon {
  width: 48px;
  height: 48px;
  background: var(--bg-light);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--primary);
  flex-shrink: 0;
}

.report-card__info { flex: 1; }
.report-card__info h4 { color: var(--primary-dark); margin-bottom: 4px; }
.report-card__info p { color: var(--text-light); font-size: 0.9rem; }

.report-card__download {
  padding: 8px 20px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 0.9rem;
  white-space: nowrap;
  transition: background 0.2s;
}
.report-card__download:hover { background: var(--primary-dark); color: #fff; }

.report-card__download.disabled {
  background: var(--text-muted);
  cursor: not-allowed;
  pointer-events: none;
}

/* Атрибут year */
[data-year] { display: block; }

/* ====== Контакты ====== */
.contacts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

@media (max-width: 768px) {
  .contacts-grid { grid-template-columns: 1fr; }
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 28px;
}

.contact-item__icon {
  width: 44px;
  height: 44px;
  background: var(--bg-light);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: var(--primary);
  flex-shrink: 0;
}

.contact-item h4 { color: var(--primary-dark); margin-bottom: 4px; }
.contact-item p { color: var(--text-light); }

/* Изображения внутри иконок */
.card__icon img,
.service-card__icon img,
.quick-link__icon img,
.report-card__icon img,
.contact-item__icon img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.contact-map {
  width: 100%;
  height: 400px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.contact-map iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* ====== Админка ====== */
.admin-login {
  max-width: 400px;
  margin: 80px auto;
  padding: 40px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.admin-login h2 {
  text-align: center;
  margin-bottom: 24px;
  color: var(--primary-dark);
}

.admin-login .form-group {
  margin-bottom: 16px;
}

.admin-login label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: var(--text);
}

.admin-login input,
.admin-login textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s;
}
.admin-login input:focus,
.admin-login textarea:focus {
  outline: none;
  border-color: var(--primary-light);
}

.btn {
  display: inline-block;
  padding: 10px 24px;
  border: none;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

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

.btn--danger {
  background: #e74c3c;
  color: #fff;
}
.btn--danger:hover { background: #c0392b; }

.btn--small {
  padding: 6px 14px;
  font-size: 0.85rem;
}

.admin-panel {
  max-width: 900px;
  margin: 40px auto;
  padding: 0 20px;
}

.admin-panel h2 {
  color: var(--primary-dark);
  margin-bottom: 24px;
}

.admin-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 32px;
}

.admin-tab {
  padding: 8px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  background: var(--bg-white);
  font-weight: 500;
  transition: all 0.2s;
}
.admin-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.admin-section { display: none; }
.admin-section.active { display: block; }
.admin-list-item__info { flex: 1; min-width: 0; }
.document-office-fallback { padding: 32px; text-align: center; background: var(--bg-light); border-radius: var(--radius); }
.attachment-list { display: grid; gap: 8px; margin-top: 10px; }
.attachment-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 8px 10px; background: var(--bg-light); border-radius: var(--radius); }
.news-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 14px 0; }
.news-gallery__link img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); }
.document-nav { display: flex; justify-content: center; align-items: center; gap: 16px; margin: 12px 0; }
@media (max-width: 600px) { .attachment-item { align-items: flex-start; } .document-nav { gap: 8px; flex-wrap: wrap; } .document-nav .btn { padding: 8px 12px; } }

.admin-form {
  background: var(--bg-light);
  padding: 24px;
  border-radius: var(--radius);
  margin-bottom: 32px;
}

.admin-form .form-group {
  margin-bottom: 16px;
}
.admin-form label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  font-size: 0.95rem;
}
.admin-form input,
.admin-form textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
}
.admin-form textarea { min-height: 120px; resize: vertical; }
.admin-form input:focus,
.admin-form textarea:focus {
  outline: none;
  border-color: var(--primary-light);
}

.admin-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  background: var(--bg-white);
}
.admin-list-item__info h4 { font-size: 1rem; margin-bottom: 2px; }
.admin-list-item__info span { color: var(--text-muted); font-size: 0.85rem; }

/* ====== Утилиты ====== */
.text-center { text-align: center; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.hidden { display: none !important; }

.alert {
  padding: 12px 20px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-weight: 500;
}
.alert--error { background: #fde8e8; color: #c0392b; border: 1px solid #f5c6cb; }
.alert--success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }

/* ====== Адаптивность ====== */
@media (max-width: 768px) {
  .hero h1 { font-size: 1.8rem; }
  .hero p { font-size: 1.05rem; }
  .section { padding: 40px 0; }
  .section__title { font-size: 1.5rem; }
  .cards { grid-template-columns: 1fr; }
  .services-grid { grid-template-columns: 1fr; }
  .news-grid { grid-template-columns: 1fr; }
  .a11y-toggle span:last-child { display: none; }
  .a11y-toggle { padding: 6px 10px; margin-left: 8px; }
}

/* ====== Доступность ====== */
:focus-visible {
  outline: 3px solid var(--primary-light);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 8px;
  background: var(--primary);
  color: #fff;
  padding: 8px 16px;
  border-radius: var(--radius);
  z-index: 200;
  transition: top 0.2s;
}
.skip-link:focus { top: 8px; }

/* ====== Панель «Версия для слабовидящих» ====== */
.a11y-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.9rem;
  margin-left: 12px;
  transition: background 0.2s;
  white-space: nowrap;
}
.a11y-toggle:hover { background: var(--bg-light); }
.a11y-toggle__icon { font-size: 1.2rem; }

.a11y-panel {
  position: fixed;
  top: 0;
  right: -420px;
  width: 400px;
  height: 100vh;
  background: var(--bg-white);
  box-shadow: -4px 0 20px rgba(0,0,0,0.2);
  z-index: 1000;
  transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  padding: 24px;
  border-left: 1px solid var(--border);
}
.a11y-panel.open { right: 0; }
.a11y-panel__overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.a11y-panel__overlay.open { opacity: 1; pointer-events: auto; }
.a11y-panel__title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
  color: var(--text);
}
.a11y-panel__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: none;
  background: var(--bg-light);
  border-radius: 50%;
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  color: var(--text);
}
.a11y-panel__close:hover { background: var(--border); }
.a11y-panel__group {
  margin-bottom: 20px;
}
.a11y-panel__label {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 8px;
  color: var(--text);
}
.a11y-panel__options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.a11y-panel__btn {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-white);
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.15s;
  color: var(--text);
}
.a11y-panel__btn:hover { border-color: var(--primary-light); }
.a11y-panel__btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.a11y-panel__reset {
  margin-top: 24px;
  padding: 10px 20px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-white);
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  width: 100%;
  transition: all 0.15s;
  color: var(--text);
}
.a11y-panel__reset:hover { border-color: var(--primary); color: var(--primary); }

/* --- Режимы для слабовидящих --- */
/* Размер шрифта — меняем корневой, все rem-размеры масштабируются */
html.a11y-font-md { font-size: 24px; }
html.a11y-font-lg { font-size: 32px; }

/* Цветовые схемы — через CSS-переменные */
body.a11y-scheme-bw {
  --primary: #888888;
  --primary-light: #61afef;
  --primary-dark: #aaaaaa;
  --bg-light: #1a1a1a;
  --bg-white: #000000;
  --text: #ffffff;
  --text-light: #cccccc;
  --text-muted: #999999;
  --border: #444444;
}

/* bw-схема: футер и hero — тёмный фон */
body.a11y-scheme-bw .footer { background: #111 !important; }
body.a11y-scheme-bw .hero { background: #222 !important; }

/* bw-схема: нав-ссылки и активное состояние */
body.a11y-scheme-bw .header__nav a { color: #fff; }
body.a11y-scheme-bw .header__nav a:hover,
body.a11y-scheme-bw .header__nav a.active { background: #444; color: #fff; }

/* bw-схема: заголовки всех уровней */
body.a11y-scheme-bw h1,
body.a11y-scheme-bw h2,
body.a11y-scheme-bw h3,
body.a11y-scheme-bw h4,
body.a11y-scheme-bw .section__title,
body.a11y-scheme-bw .card__heading h3,
body.a11y-scheme-bw .card h3,
body.a11y-scheme-bw .service-card__heading h3,
body.a11y-scheme-bw .service-card h3,
body.a11y-scheme-bw .news-card h3,
body.a11y-scheme-bw .footer__title,
body.a11y-scheme-bw .step-item h4,
body.a11y-scheme-bw .contact-item h4,
body.a11y-scheme-bw .report-card__info h4,
body.a11y-scheme-bw .legislation-panel h3,
body.a11y-scheme-bw .about-section h3,
body.a11y-scheme-bw .about-content h2,
body.a11y-scheme-bw .award-card h4,
body.a11y-scheme-bw .law-links h4,
body.a11y-scheme-bw .admin-login h2,
body.a11y-scheme-bw .admin-panel h2 { color: #fff !important; }

/* bw-схема: второстепенный текст */
body.a11y-scheme-bw .section__subtitle,
body.a11y-scheme-bw .card p,
body.a11y-scheme-bw .service-card p,
body.a11y-scheme-bw .news-card p,
body.a11y-scheme-bw .step-item p,
body.a11y-scheme-bw .contact-item p,
body.a11y-scheme-bw .report-card__info p,
body.a11y-scheme-bw .news-meta { color: #ccc !important; }

/* bw-схема: кнопки */
body.a11y-scheme-bw .btn--primary { background: #555; color: #fff; }
body.a11y-scheme-bw .btn--primary:hover { background: #777; }
body.a11y-scheme-bw .hero__cta { background: #555; color: #fff; }
body.a11y-scheme-bw .hero__cta:hover { background: #777; color: #fff; }

/* bw-схема: ссылки-карточки и логотип */
body.a11y-scheme-bw .quick-link { color: #ccc; }
body.a11y-scheme-bw .quick-link:hover { background: #555; color: #fff; }
body.a11y-scheme-bw .header__logo { color: #ccc; }

/* bw-схема: ссылки */
body.a11y-scheme-bw a:not(.header__nav a):not(.btn):not(.hero__cta) { color: #61afef; }

/* bw-схема: панель a11y */
body.a11y-scheme-bw .a11y-panel { background: #111; border-color: #444; }
body.a11y-scheme-bw .a11y-panel__btn { background: #222; border-color: #555; color: #ccc; }
body.a11y-scheme-bw .a11y-panel__btn.active { background: #555; color: #fff; }
body.a11y-scheme-bw .a11y-panel__reset { background: #222; border-color: #555; color: #ccc; }
body.a11y-scheme-bw .a11y-panel__close { background: #333; color: #ccc; }
body.a11y-scheme-bw .a11y-toggle { color: #fff; border-color: #555; }
body.a11y-scheme-bw .a11y-toggle:hover { background: #222; }

body.a11y-scheme-bw .card__icon img,
body.a11y-scheme-bw .service-card__icon img,
body.a11y-scheme-bw .quick-link__icon img,
body.a11y-scheme-bw .report-card__icon img,
body.a11y-scheme-bw .contact-item__icon img,
body.a11y-scheme-bw .header__logo-icon img { filter: invert(1); }

.document-office-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  padding: 48px 24px;
  background: var(--bg-light);
  border-radius: var(--radius);
  text-align: center;
}

.document-office-fallback p {
  color: var(--text-muted);
  margin-bottom: 8px;
  font-size: 1rem;
}

body.a11y-scheme-beige {
  --primary: #5C4033;
  --primary-light: #7B5B3A;
  --primary-dark: #3D2B1F;
  --bg-light: #EDE4D3;
  --bg-white: #F5F0E8;
  --text: #3D2B1F;
  --text-light: #5C4033;
  --text-muted: #8B7355;
  --border: #D4C4A8;
}

body.a11y-scheme-blue {
  --primary: #1A3A6B;
  --primary-light: #2B5EA7;
  --primary-dark: #0F2440;
  --bg-light: #DCE8FA;
  --bg-white: #E8F0FE;
  --text: #1A2A4A;
  --text-light: #2B4A7A;
  --text-muted: #5A7AA0;
  --border: #B0C8E8;
}

body.a11y-spacing-wide { letter-spacing: 0.08em; }
body.a11y-spacing-wider { letter-spacing: 0.12em; }
body.a11y-lh-relaxed { line-height: 2.2; }
body.a11y-lh-loose { line-height: 2.8; }

body.a11y-img-gray img { filter: grayscale(1); }

@media (max-width: 480px) {
  .a11y-panel { width: 100%; right: -100%; }
}

.document-original { display: inline-block; margin-bottom: 16px; }
.document-preview-status { padding: 24px 0; color: var(--text); }
.document-viewer { min-width: 0; }
.pdf-toolbar { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 12px; padding: 12px 0; }
.pdf-toolbar .btn { border: 1px solid var(--border); padding: 8px 12px; }
.pdf-toolbar button:disabled { opacity: .45; cursor: default; }
.pdf-viewport { overflow: auto; padding: 12px; background: var(--bg-light); border: 1px solid var(--border); border-radius: var(--radius); }
.pdf-viewport canvas { display: block; margin: 0 auto; background: white; max-width: none; }
.pdf-text { margin-top: 16px; text-align: left; }
.pdf-text summary { cursor: pointer; color: var(--primary); }
.pdf-text > div { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 12px; }

/* ====== Безопасный динамический контент и админка ====== */
.muted { color: var(--text-muted); }
.content-link { display: inline-block; margin-top: 12px; font-size: 0.9rem; }
.news-detail__date { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 12px; }
.news-detail__title { font-size: 1.8rem; color: var(--primary-dark); margin-bottom: 24px; line-height: 1.4; }
.news-detail__text { font-size: 1.05rem; line-height: 1.9; }
.news-detail__photo { margin-top: 32px; }
.news-detail__photo img, .document-image { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); }
.document-title { color: var(--primary-dark); margin-bottom: 24px; }
.document-pdf { width: 100%; height: 75vh; min-height: 560px; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.document-fallback { margin-top: 16px; }
.content-back { margin-top: 40px; text-align: center; }
.dynamic-reports-title { margin: 32px 0 16px; color: var(--primary-dark); }
.dialog-open { overflow: hidden; }
.a11y-panel[hidden], .a11y-panel__overlay[hidden], .admin-section[hidden] { display: none; }
.a11y-panel__group { border: 0; padding: 0; }
.admin-panel__header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.admin-panel__header h2 { margin: 0; }
.admin-form h3, .admin-list-title { margin-bottom: 16px; }
.admin-form__actions, .admin-list-item__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn--full { width: 100%; }
.btn:disabled, input:disabled, textarea:disabled { opacity: 0.65; cursor: wait; }

@media (max-width: 640px) {
  .admin-list-item, .report-card { align-items: flex-start; flex-direction: column; }
  .report-card__download { align-self: stretch; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
