:root {
  --bg: #0b0d12;
  --bg-elevated: #10141c;
  --panel: rgba(21, 25, 34, 0.96);
  --panel-strong: #1a1d24;
  --panel-soft: #202633;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #e5e7eb;
  --muted: #9ca3af;
  --muted-strong: #c2c7d0;
  --accent: #8b0000;
  --accent-strong: #b30000;
  --accent-hover: #ff2a2a;
  --blue: #5f7cff;
  --red: #d32626;
  --shadow: 0 28px 70px rgba(0, 0, 0, 0.45);
  --shadow-soft: 0 18px 42px rgba(0, 0, 0, 0.28);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --transition: 220ms ease;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(179, 0, 0, 0.22), transparent 20%),
    radial-gradient(circle at top right, rgba(96, 16, 16, 0.18), transparent 24%),
    linear-gradient(180deg, #090b10 0%, #0f1115 52%, #131722 100%);
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
}

a {
  color: #f2f5ff;
}

code {
  font-family: Consolas, Monaco, monospace;
  font-size: 0.92em;
  color: #ffd9d9;
}

h1,
h2,
h3 {
  margin-top: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}

h1 {
  margin-bottom: 14px;
  font-size: clamp(2.3rem, 3.2vw, 3.9rem);
  line-height: 0.95;
}

h2 {
  margin-bottom: 14px;
  font-size: clamp(1.35rem, 2vw, 1.9rem);
  line-height: 1.05;
}

h3 {
  font-size: 1.18rem;
}

.eyebrow {
  margin: 0 0 14px;
  color: #ff7c7c;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.lead,
.stats,
.small-text,
.result-card__text,
.result-card__meta {
  color: var(--muted);
  line-height: 1.75;
  font-size: 1rem;
}

.home-shell,
.case-shell {
  max-width: 1480px;
  margin: 0 auto;
  padding: 18px;
}

.article-card,
.article-card--home {
  border: 1px solid var(--border);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(26, 29, 36, 0.98) 0%, rgba(18, 22, 30, 0.98) 100%);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.case-content,
.case-content--home {
  padding: 22px;
}

.page-back,
.case-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  margin-bottom: 18px;
  padding: 12px 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 0.96rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform var(--transition),
    border-color var(--transition),
    background var(--transition),
    color var(--transition),
    box-shadow var(--transition);
}

.page-back:hover,
.page-back:focus-visible,
.case-back:hover,
.case-back:focus-visible {
  outline: none;
  color: #ffffff;
  border-color: rgba(255, 42, 42, 0.45);
  background: rgba(179, 0, 0, 0.18);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.28);
  transform: translateY(-1px);
}

.home-hero {
  margin-bottom: 22px;
}

.case-hero {
  position: relative;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(179, 0, 0, 0.18) 0%, rgba(139, 0, 0, 0.08) 28%, rgba(14, 17, 24, 0.96) 100%),
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.06), transparent 26%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.case-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.03) 100%);
  pointer-events: none;
}

.case-hero > * {
  position: relative;
  z-index: 1;
}

.case-hero .eyebrow,
.case-hero .lead {
  color: rgba(229, 231, 235, 0.78);
}

.case-hero h1 {
  margin-bottom: 12px;
  color: #ffffff;
  text-shadow: 0 8px 34px rgba(0, 0, 0, 0.45);
}

.home-layout,
.layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.sidebar,
.content,
.sidebar--home,
.content--home {
  min-width: 0;
}

.sidebar,
.sidebar--home {
  display: grid;
  gap: 14px;
  align-content: start;
}

.content,
.content--home {
  display: grid;
  gap: 18px;
}

.panel {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, rgba(28, 32, 42, 0.96) 0%, rgba(21, 25, 34, 0.96) 100%);
  box-shadow: var(--shadow-soft);
}

.panel--hero {
  background:
    linear-gradient(160deg, rgba(139, 0, 0, 0.14) 0%, rgba(29, 33, 44, 0.96) 34%, rgba(21, 25, 34, 0.98) 100%);
}

.panel--hero h2 {
  margin-bottom: 8px;
  font-size: 1.55rem;
}

.panel--results {
  min-height: 240px;
}

.filters {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 10px;
}

.field span {
  color: var(--muted-strong);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.field input,
.field select {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font: inherit;
  transition:
    border-color var(--transition),
    background var(--transition),
    box-shadow var(--transition);
}

.field input::placeholder,
.field select::placeholder {
  color: rgba(156, 163, 175, 0.72);
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: rgba(255, 42, 42, 0.42);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 3px rgba(179, 0, 0, 0.18);
}

.checkbox-group {
  margin: 0;
  padding: 14px 16px 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
}

.checkbox-group legend {
  padding: 0 6px;
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.checkbox-list {
  display: grid;
  gap: 10px;
  max-height: 240px;
  overflow: auto;
  padding-right: 4px;
}

.checkbox-option {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted-strong);
  font-size: 0.95rem;
}

.checkbox-option input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-strong);
}

.filter-actions {
  display: flex;
  gap: 10px;
}

.button,
.chip,
body.page-case .link-list a {
  padding: 11px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(179, 0, 0, 0.18) 0%, rgba(109, 0, 0, 0.16) 100%);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform var(--transition),
    border-color var(--transition),
    background var(--transition),
    box-shadow var(--transition),
    color var(--transition);
}

body.page-case .link-list__placeholder {
  padding: 11px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(179, 0, 0, 0.18) 0%, rgba(109, 0, 0, 0.16) 100%);
  color: var(--text);
  font-weight: 700;
}

.button:hover,
.button:focus-visible,
.chip:hover,
.chip:focus-visible,
body.page-case .link-list a:hover,
body.page-case .link-list a:focus-visible {
  outline: none;
  color: #ffffff;
  border-color: rgba(255, 42, 42, 0.5);
  background:
    linear-gradient(180deg, rgba(255, 42, 42, 0.26) 0%, rgba(139, 0, 0, 0.22) 100%);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
  transform: translateY(-1px);
}

.button--ghost {
  background: rgba(255, 255, 255, 0.03);
}

.map,
.case-map {
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  background: #11151d;
  box-shadow: var(--shadow-soft);
}

.map {
  height: calc(100vh - 48px);
  min-height: 620px;
}

.map--home {
  height: 64vh;
  min-height: 660px;
}

.map--seo {
  height: 48vh;
  min-height: 360px;
  margin-top: 8px;
}

.case-map {
  height: 230px;
}

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.results-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 42, 42, 0.28);
  background: rgba(179, 0, 0, 0.16);
  color: #ffd8d8;
  font-size: 0.88rem;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.results-list,
.link-list,
.chip-list {
  display: grid;
  gap: 10px;
}

.result-card {
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(32, 38, 51, 0.96) 0%, rgba(23, 28, 37, 0.96) 100%);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.22);
}

.result-card--compact {
  display: grid;
  gap: 8px;
  text-decoration: none;
}

.result-card--compact.is-active {
  border-color: rgba(255, 42, 42, 0.34);
  box-shadow: inset 0 0 0 1px rgba(255, 42, 42, 0.12);
}

.result-card--button {
  width: 100%;
  text-align: left;
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition:
    transform var(--transition),
    border-color var(--transition),
    background var(--transition),
    box-shadow var(--transition);
}

.result-card--button:hover,
.result-card--button:focus-visible,
.result-card--compact:hover,
.result-card--compact:focus-visible {
  outline: none;
  border-color: rgba(255, 42, 42, 0.34);
  background:
    linear-gradient(180deg, rgba(38, 44, 58, 0.98) 0%, rgba(27, 31, 41, 0.98) 100%);
  box-shadow: 0 28px 44px rgba(0, 0, 0, 0.28);
  transform: translateY(-2px) scale(1.01);
}

.result-card h3 {
  margin-bottom: 8px;
  color: #ffffff;
  font-size: 1.02rem;
  line-height: 1.25;
}

.result-card__meta {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-bottom: 8px;
  padding: 5px 9px;
  border: 1px solid rgba(255, 42, 42, 0.18);
  border-radius: 999px;
  background: rgba(139, 0, 0, 0.12);
  color: #e3b9b9;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.result-card__text {
  margin: 0;
  color: var(--muted-strong);
  font-size: 0.92rem;
  line-height: 1.55;
}

.result-card__link {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-top: 14px;
  color: #ffb3b3;
  font-weight: 800;
  text-decoration: none;
}

.result-card__link:hover,
.result-card__link:focus-visible {
  color: #ffffff;
  outline: none;
}

.stats strong {
  color: #ffffff;
}

.stat-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.stat-card,
.detail-card,
.place-nav__info {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(29, 34, 46, 0.96) 0%, rgba(22, 27, 36, 0.96) 100%);
}

.stat-card__label,
.detail-card strong,
.chip-group__label {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.stat-card__value {
  margin: 8px 0;
  color: #ffffff;
  font-size: 1.72rem;
  font-weight: 800;
  line-height: 1.15;
}

.stat-card__detail,
.place-nav__info p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.detail-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.detail-card {
  display: grid;
  gap: 8px;
}

.detail-card span {
  color: var(--text);
}

.article-section {
  padding: 22px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.article-section:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.article-section--home-map {
  padding-top: 0;
}

.article-section--map-nav {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(320px, 1fr);
  gap: 16px;
  align-items: start;
}

.place-nav {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 1fr);
  gap: 12px;
}

.place-nav__list {
  display: grid;
  gap: 8px;
}

.place-nav__button {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  text-align: left;
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition:
    transform var(--transition),
    border-color var(--transition),
    background var(--transition),
    box-shadow var(--transition);
}

.place-nav__button:hover,
.place-nav__button:focus-visible,
.place-nav__button.is-active {
  outline: none;
  border-color: rgba(255, 42, 42, 0.34);
  background: rgba(179, 0, 0, 0.12);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.22);
  transform: translateY(-1px);
}

.place-nav__title {
  font-weight: 700;
}

.place-nav__meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.place-nav__image,
.case-image {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.place-nav__image img,
.case-image img {
  display: block;
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 16px;
  background: #0f1115;
}

.fup-viewer {
  display: grid;
  gap: 14px;
}

.fup-viewer__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.fup-viewer__tab {
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform var(--transition),
    border-color var(--transition),
    background var(--transition),
    box-shadow var(--transition);
}

.fup-viewer__tab:hover,
.fup-viewer__tab:focus-visible,
.fup-viewer__tab.is-active {
  outline: none;
  border-color: rgba(255, 42, 42, 0.42);
  background: rgba(179, 0, 0, 0.18);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
  transform: translateY(-1px);
}

.fup-viewer__frame {
  min-height: 78vh;
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  overflow: hidden;
  background: #0d1016;
  box-shadow: var(--shadow-soft);
}

.fup-viewer__frame iframe {
  display: block;
  width: 100%;
  min-height: 78vh;
  border: 0;
  background: #0d1016;
}

.supplementary-media {
  display: grid;
  gap: 16px;
}

.supplementary-media__card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(29, 34, 46, 0.96) 0%, rgba(22, 27, 36, 0.96) 100%);
}

.supplementary-media__card h3 {
  margin-bottom: 12px;
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-group__label {
  width: 100%;
}

.chip {
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
}

.chip.is-active {
  border-color: rgba(255, 42, 42, 0.42);
  background: rgba(179, 0, 0, 0.18);
  color: #ffffff;
}

.map-legend {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(18, 21, 29, 0.92);
  color: var(--text);
  box-shadow: var(--shadow-soft);
}

.map-legend__title {
  margin: 0 0 8px;
  font-size: 0.9rem;
  font-weight: 700;
}

.map-legend__item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
}

.map-legend__item + .map-legend__item {
  margin-top: 6px;
}

.map-legend__dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.map-legend__dot--case {
  background: var(--blue);
}

.map-legend__dot--related {
  background: var(--red);
}

.leaflet-container {
  background: #11151d;
  color: var(--text);
}

.leaflet-bar a,
.leaflet-bar a:hover {
  background: rgba(26, 29, 36, 0.96);
  border-bottom-color: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.leaflet-control-zoom a {
  width: 34px;
  height: 34px;
  line-height: 34px;
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: #1b202a;
  color: var(--text);
}

.leaflet-popup-content {
  margin: 14px 16px;
}

.popup h3 {
  margin: 0 0 8px;
  font-size: 1.08rem;
  line-height: 1.3;
  color: #ffffff;
}

.popup p {
  margin: 6px 0;
  color: var(--muted-strong);
  font-size: 0.98rem;
  line-height: 1.72;
}

.popup__link {
  display: inline-block;
  margin-top: 10px;
  color: #ffb3b3;
  font-weight: 700;
  text-decoration: none;
}

.empty-state {
  padding: 18px;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  line-height: 1.6;
}

.layout--seo .sidebar {
  align-self: start;
  align-content: start;
}

.layout--seo .content {
  align-self: start;
  gap: 14px;
}

.layout--seo {
  max-width: 1480px;
  margin: 0 auto;
  padding: 18px;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 18px;
}

.layout--seo .panel {
  padding: 18px;
}

.layout--seo .stat-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  align-items: stretch;
}

.layout--seo .stat-card {
  min-height: 100%;
}

.layout--seo .results-list {
  gap: 12px;
}

.layout--seo .result-card {
  padding: 14px 16px;
}

.layout--seo .page-back {
  margin-bottom: 4px;
}

.page-home .page-back {
  margin-bottom: 14px;
}

.site-footer {
  padding: 0 20px 28px;
}

.site-footer__inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: rgba(15, 17, 21, 0.92);
  color: var(--muted);
}

.site-footer__links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.site-footer__links a {
  color: #ffb3b3;
  text-decoration: none;
  font-weight: 700;
}

.site-footer__links a:hover,
.site-footer__links a:focus-visible {
  color: #ffd1d1;
}

@media (max-width: 1100px) {
  .home-layout,
  .layout,
  .article-section--map-nav,
  .place-nav,
  .detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .home-shell,
  .case-shell {
    padding: 12px;
  }

  .home-layout {
    display: flex;
    flex-direction: column;
  }

  .content--home {
    order: 1;
  }

  .sidebar--home {
    order: 2;
  }

  .site-footer {
    padding: 0 12px 16px;
  }

  .site-footer__inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .case-content,
  .case-content--home {
    padding: 16px;
  }

  .case-hero {
    padding: 24px 20px;
  }

  .map,
  .map--home {
    height: 56vh;
    min-height: 360px;
  }

  .case-map {
    height: 320px;
  }
}

@media (max-width: 640px) {
  h1 {
    font-size: clamp(2rem, 11vw, 2.8rem);
    line-height: 0.98;
  }

  h2 {
    font-size: 1.55rem;
  }

  .home-shell,
  .case-shell {
    padding: 8px;
  }

  .article-card,
  .article-card--home {
    border-radius: 20px;
  }

  .case-content,
  .case-content--home {
    padding: 12px;
  }

  .home-hero {
    margin-bottom: 14px;
  }

  .case-hero {
    padding: 18px 16px;
    border-radius: 18px;
  }

  .case-hero .eyebrow {
    margin-bottom: 8px;
    font-size: 0.7rem;
  }

  .case-hero .lead {
    font-size: 0.95rem;
    line-height: 1.55;
  }

  .home-layout,
  .content--home,
  .sidebar--home,
  .sidebar,
  .content {
    gap: 12px;
  }

  .panel {
    padding: 14px;
    border-radius: 18px;
  }

  .panel--hero {
    display: none;
  }

  .field input,
  .field select,
  .button,
  .chip,
  body.page-case .link-list a {
    padding: 11px 12px;
  }

  .checkbox-group {
    padding: 12px;
    border-radius: 16px;
  }

  .checkbox-list {
    max-height: 180px;
  }

  .map,
  .map--home {
    height: 44vh;
    min-height: 280px;
  }

  .results-header {
    margin-bottom: 12px;
  }

  .results-count {
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
  }

  .result-card {
    padding: 14px;
    border-radius: 16px;
  }

  .result-card h3 {
    font-size: 1.05rem;
    margin-bottom: 8px;
  }

  .result-card__meta {
    margin-bottom: 10px;
    padding: 5px 9px;
    font-size: 0.74rem;
  }

  .result-card__text {
    font-size: 0.93rem;
    line-height: 1.6;
  }
}
