:root {
  --bg: #ffffff;
  --bg-soft: #f8f8f8;
  --grid: rgba(0,0,0,0.04);
  --text: #333333;
  --muted: #666666;
  --accent: #2563eb;
  --shadow: rgba(0,0,0,0.1);
  --border: rgba(0,0,0,0.08);
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  font-family: 'Montserrat', sans-serif;
  background:
    repeating-linear-gradient(
      0deg,
      var(--grid),
      var(--grid) 1px,
      transparent 1px,
      transparent 48px
    ),
    repeating-linear-gradient(
      90deg,
      var(--grid),
      var(--grid) 1px,
      transparent 1px,
      transparent 48px
    ),
    radial-gradient(circle at center, #f0f0f0, var(--bg));
  color: var(--text);
  min-height: 100vh;
  padding: 24px 32px;
  padding-bottom: 120px;
}
.container {
  max-width: 1400px;
  margin: 0 auto;
}
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 24px 0 32px;
  flex-wrap: wrap;
}
.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}
.update-info {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  width: 500px;
}
.update-info-header {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.12em;
  margin-bottom: 6px;
}
.update-info-version {
  font-size: 0.85rem;
  color: var(--text);
  margin-bottom: 8px;
}
.update-info-version strong {
  color: var(--text);
  font-weight: 700;
}
.update-info-changes {
  font-size: 0.8rem;
  color: var(--muted);
  padding-top: 8px;
  border-top: 1px solid var(--border);
  max-height: 100px;
  overflow-y: auto;
}
.update-info-changes-title {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.update-info-changes ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.update-info-changes li {
  padding: 4px 0;
  padding-left: 16px;
  position: relative;
  line-height: 1.4;
}
.update-info-changes li::before {
  content: '•';
  color: var(--muted);
  position: absolute;
  left: 0;
  font-weight: bold;
}
.update-info-changes::-webkit-scrollbar {
  width: 4px;
}
.update-info-changes::-webkit-scrollbar-track {
  background: transparent;
}
.update-info-changes::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}
.logo {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.logo-letter {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 28px;
  background: linear-gradient(145deg, var(--bg-soft), var(--bg));
  border: 1px solid var(--border);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.5),
    0 4px 12px var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  color: var(--text);
}
.logo-letter:hover {
  transform: translateY(-2px);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.8),
    0 8px 20px rgba(0,0,0,0.12);
}
.tagline {
  display: flex;
  flex-direction: column;
  font-size: 0.9rem;
  line-height: 1.3;
}
.tagline strong {
  font-weight: 700;
  color: var(--text);
  font-size: 1rem;
}
.tagline span {
  color: var(--muted);
  font-size: 0.9rem;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  margin: 32px 0;
}
.stat-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  box-shadow: 0 4px 12px var(--shadow);
}
.stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.stat-label {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 12px;
}
.filters {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin: 32px 0;
  box-shadow: 0 4px 12px var(--shadow);
}
.filter-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: flex-end;
}
.filter-group {
  flex: 1;
  min-width: 180px;
}
.filter-group label {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
  font-weight: 600;
}
.filter-group input,
.filter-group select {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.filter-group input:focus,
.filter-group select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.btn {
  background: var(--text);
  color: var(--bg);
  border: none;
  padding: 12px 28px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
}
.btn:hover {
  background: var(--text);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}
.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  border-color: var(--text);
  background: var(--bg-soft);
}
.table-wrapper {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px var(--shadow);
}
.table-container {
  overflow-x: auto;
  max-height: 70vh;
  overflow-y: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
thead {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg-soft);
}
th {
  padding: 16px 14px;
  text-align: left;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  border-bottom: 2px solid var(--border);
  cursor: pointer;
  user-select: none;
}
th:hover {
  background: #f0f0f0;
}
th.sorted {
  color: var(--accent);
}
th.sorted::after {
  content: ' ▼';
}
td {
  padding: 14px;
  border-bottom: 1px solid var(--grid);
  vertical-align: top;
}
tbody tr:hover {
  background: var(--bg-soft);
  cursor: pointer;
}
.court-name {
  color: var(--text);
  font-weight: 600;
  font-size: 0.9rem;
}
.court-type {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 400;
}
.court-address {
  color: var(--muted);
  font-size: 0.8rem;
  max-width: 300px;
}
.court-website a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}
.court-website a:hover {
  text-decoration: underline;
  color: var(--text);
}
.court-website .site-text {
  color: var(--text);
  font-weight: 600;
  word-break: break-all;
  font-size: 0.75rem;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  border-radius: 6px;
  text-transform: uppercase;
}
.badge-yes {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #c8e6c9;
}
.badge-no {
  background: #f5f5f5;
  color: #757575;
  border: 1px solid #e0e0e0;
}
.badge-inactive {
  background: #fff3e0;
  color: #e65100;
  border: 1px solid #ffe0b2;
  font-size: 10px;
  vertical-align: middle;
  margin-left: 6px;
}
.row-inactive {
  opacity: 0.75;
}
.row-inactive:hover {
  opacity: 1;
}
.results-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
}
.results-count {
  font-size: 0.85rem;
  color: var(--muted);
}
.results-count strong {
  color: var(--text);
  font-weight: 700;
}
footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: 16px;
  text-align: center;
  border-top: 1px solid var(--border);
  z-index: 100;
}
.footer-content {
  max-width: 1400px;
  margin: 0 auto;
  font-size: 0.75rem;
  color: var(--muted);
}
.footer-sources {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 8px;
}
.footer-source {
  display: flex;
  align-items: center;
  gap: 6px;
}
.footer-source a {
  color: var(--accent);
  text-decoration: none;
}
.footer-source a:hover {
  text-decoration: underline;
}
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeIn 0.8s ease forwards;
}
@keyframes fadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.changelog-body {
  padding: 24px 32px;
  padding-bottom: 120px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.changelog-container {
  max-width: 900px;
  margin: 0 auto;
  flex: 1;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 24px;
  font-size: 0.9rem;
  transition: color 0.3s;
}
.back-link:hover {
  color: var(--text);
}
.changelog-header {
  margin-bottom: 48px;
}
.changelog-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.changelog-subtitle {
  color: var(--muted);
  font-size: 1rem;
}
.changelog-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.version-card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.5),
    0 4px 12px var(--shadow);
  opacity: 0;
  transform: translateY(20px);
  animation: fadeIn 0.8s ease forwards;
}
.version-card:nth-child(1) { animation-delay: 0.1s; }
.version-card:nth-child(2) { animation-delay: 0.2s; }
.version-card:nth-child(3) { animation-delay: 0.3s; }
.version-card:nth-child(4) { animation-delay: 0.4s; }
.version-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.version-number {
  font-size: 1.2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.version-number strong {
  color: var(--text);
}
.version-delta {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
}
.version-delta.delta-positive {
  color: #4caf50;
  background: rgba(76, 175, 80, 0.1);
}
.version-delta.delta-negative {
  color: #f44336;
  background: rgba(244, 67, 54, 0.1);
}
.version-stats {
  display: flex;
  gap: 6px;
  margin-left: 4px;
  align-items: center;
}
.stat-item {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--muted);
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(0,0,0,0.03);
  white-space: nowrap;
}
.version-date {
  font-size: 0.85rem;
  color: var(--muted);
}
.version-changes {
  list-style: none;
  padding: 0;
  margin: 0;
}
.version-changes li {
  padding: 6px 0;
  padding-left: 20px;
  position: relative;
  font-size: 0.9rem;
  line-height: 1.5;
}
.version-changes li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--muted);
  font-weight: bold;
}
.version-changes li:has([data-type="added"])::before {
  color: #4caf50;
}
.version-changes li:has([data-type="deleted"])::before {
  color: #f44336;
}
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}
.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.5;
}
.update-info-link {
  float: right;
  color: var(--muted);
  text-decoration: none;
  font-weight: 400;
  font-size: 0.7rem;
  transition: color 0.2s;
}
.update-info-link:hover {
  color: var(--text);
  text-decoration: none;
}
.update-info-header {
  position: relative;
}
.changelog-header {
  opacity: 0;
  animation: fadeIn 0.8s ease forwards;
}
@media (max-width: 768px) {
  .update-info {
    max-width: 100%;
    font-size: 0.85rem;
  }
  .header {
    flex-direction: column;
    align-items: flex-start;
  }
  .logo-letter {
    width: 42px;
    height: 42px;
    font-size: 22px;
  }
  .tagline {
    font-size: 0.9rem;
  }
  .stat-value {
    font-size: 1.8rem;
  }
  .filter-row {
    flex-direction: column;
  }
  .filter-group {
    width: 100%;
  }
  .btn {
    width: 100%;
    font-size: 0.9rem;
    height: 48px;
  }
  .btn-secondary {
    height: 48px;
  }
  .version-header {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }
  .version-number {
    flex-wrap: wrap;
    gap: 6px;
  }
  .version-stats {
    margin-left: 4px;
    gap: 4px;
  }
  .filter-row .filters-actions {
    flex-direction: column;
    width: 100%;
  }
  .filter-row .filters-actions .btn {
    width: 100%;
    height: 48px;
    margin-bottom: 8px;
  }
  .filter-row .filters-actions .btn:last-child {
    margin-bottom: 0;
  }
  .results-bar .filters-actions {
    flex-direction: row;
    align-items: center;
    gap: 12px;
  }
  .results-bar .btn-small {
    flex: none;
    width: auto;
    align-self: flex-start;
    margin-left: 0;
  }
}

/* === Модальное окно контактов суда === */
.court-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.court-modal-overlay.visible {
  display: flex;
  opacity: 1;
}

.court-modal {
  background: #ffffff;
  border-radius: 16px;
  max-width: 560px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0,0,0,0.04);
  transform: translateY(16px) scale(0.98);
  transition: transform 0.25s ease;
  overscroll-behavior: contain;
}

.court-modal-overlay.visible .court-modal {
  transform: translateY(0) scale(1);
}

.court-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 20px 20px 0;
  position: sticky;
  top: 0;
  background: #ffffff;
  border-radius: 16px 16px 0 0;
  z-index: 2;
}

.court-modal-title {
  flex: 1;
  min-width: 0;
}

.court-modal-title h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #111827;
  margin: 0 0 6px;
  line-height: 1.35;
}

.court-modal-code {
  font-size: 0.75rem;
  color: #6b7280;
  font-family: 'SF Mono', 'Fira Code', monospace;
  background: #f3f4f6;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.02em;
}

.court-modal-close {
  background: transparent;
  border: none;
  font-size: 1.25rem;
  color: #9ca3af;
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.15s;
  flex-shrink: 0;
}

.court-modal-close:hover {
  background: #f3f4f6;
  color: #374151;
}

.court-modal-body {
  padding: 16px 20px 20px;
}

.court-modal-section {
  margin-bottom: 12px;
  padding: 14px;
  background: #f9fafb;
  border: 1px solid #f3f4f6;
  border-radius: 10px;
  border-left: 3px solid var(--accent);
}

.court-modal-section:last-child {
  margin-bottom: 0;
}

.court-modal-section h3 {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b7280;
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.court-modal-section p {
  font-size: 0.88rem;
  line-height: 1.55;
  color: #374151;
  margin: 0;
}

.court-modal-section p + p {
  margin-top: 6px;
}

.court-modal-empty {
  color: #9ca3af;
  font-style: italic;
  font-size: 0.85rem;
}

/* Цвета акцентных полосок по секциям */
.court-modal-body .court-modal-section:nth-child(1) { border-left-color: #3b82f6; }
.court-modal-body .court-modal-section:nth-child(2) { border-left-color: #8b5cf6; }
.court-modal-body .court-modal-section:nth-child(3) { border-left-color: #f59e0b; }
.court-modal-body .court-modal-section:nth-child(4) { border-left-color: #10b981; }
.court-modal-body .court-modal-section:nth-child(5) { border-left-color: #ef4444; }
.court-modal-body .court-modal-section:nth-child(6) { border-left-color: #6366f1; }
.court-modal-body .court-modal-section:nth-child(7) { border-left-color: #ec4899; }
.court-modal-body .court-modal-section:nth-child(8) { border-left-color: #14b8a6; }
.court-modal-body .court-modal-section:nth-child(9) { border-left-color: #f97316; }
.court-modal-body .court-modal-section:nth-child(10) { border-left-color: #64748b; }

.court-modal-section.court-modal-meta {
  border-left-color: #3b82f6;
}

.modal-judge-name {
  font-size: 1rem;
  font-weight: 700;
  color: #111827;
  margin: 0 0 6px;
}

.modal-schedule {
  font-size: 0.88rem;
  line-height: 1.6;
  color: #374151;
  margin: 0;
}

.modal-schedule-note {
  font-size: 0.82rem;
  color: #6b7280;
  margin: 4px 0 0;
  padding-top: 4px;
  border-top: 1px dashed #e5e7eb;
}

.court-hierarchy-code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.75rem;
  color: #3b82f6;
  background: #eff6ff;
  padding: 2px 6px;
  border-radius: 4px;
}

.contact-row {
  display: flex;
  gap: 10px;
  margin-bottom: 5px;
  line-height: 1.5;
  align-items: baseline;
}
.contact-row:last-child {
  margin-bottom: 0;
}
.contact-label {
  font-weight: 600;
  font-size: 0.82rem;
  color: #374151;
  min-width: 100px;
  flex-shrink: 0;
}
.contact-value {
  color: #6b7280;
  font-size: 0.86rem;
  word-break: break-word;
  overflow-wrap: break-word;
}
.contact-value a {
  color: #3b82f6;
  text-decoration: none;
}
.contact-value a:hover {
  text-decoration: underline;
}

/* Модалка: мобильная версия — bottom sheet */
@media (max-width: 640px) {
  .court-modal-overlay {
    padding: 0;
    align-items: flex-end;
  }
  
  .court-modal {
    max-height: 92vh;
    max-width: 100%;
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
  }
  
  .court-modal-overlay.visible .court-modal {
    transform: translateY(0);
  }
  
  .court-modal-header {
    padding: 16px 16px 0;
    border-bottom: none;
  }
  
  /* Drag indicator */
  .court-modal-header::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    background: #d1d5db;
    border-radius: 2px;
    margin: 0 auto 12px;
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
  }
  
  .court-modal-header {
    position: sticky;
    top: 0;
    padding-top: 24px;
  }
  
  .court-modal-title h2 {
    font-size: 1.05rem;
  }
  
  .court-modal-body {
    padding: 12px 16px 24px;
  }
  
  .court-modal-section {
    padding: 10px 12px;
    margin-bottom: 8px;
  }
  
  .contact-row {
    flex-direction: column;
    gap: 1px;
  }
  
  .contact-label {
    min-width: auto;
    font-size: 0.75rem;
    color: #9ca3af;
  }
  
  .contact-value {
    font-size: 0.88rem;
    color: #374151;
  }
}

/* Ченджлог: пагинация */
.cl-pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 32px 0 16px;
  flex-wrap: wrap;
}
.cl-pagination button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.cl-pagination button:hover {
  border-color: var(--text);
  color: var(--text);
}
.cl-pagination button.active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}
.cl-pagination button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.cl-pagination .cl-nav {
  font-size: 1rem;
  padding: 0 14px;
}
.cl-showmore {
  text-align: center;
  margin: 24px 0;
}
.cl-showmore button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 24px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-soft);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.cl-showmore button:hover {
  border-color: var(--text);
  color: var(--text);
}


/* Кнопка контактов */
.btn-contact {
  display: inline-block;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn-contact:hover {
  border-color: var(--text);
  background: var(--bg-soft);
}
