:root {
  --bg0: #0f1412;
  --bg1: #171e1a;
  --bg2: #1f2923;
  --line: #2c3a32;
  --text: #e8efe9;
  --muted: #9aafa1;
  --crit: #e85d4c;
  --rec: #e0a23a;
  --ok: #3dba7a;
  --busy: #5aa8d6;
  --hist: #8b8f9a;
  --accent: #c4f062;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --radius: 18px;
  --font: "Manrope", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(196, 240, 98, 0.12), transparent 60%),
    radial-gradient(900px 500px at 90% 0%, rgba(232, 93, 76, 0.12), transparent 55%),
    linear-gradient(180deg, #121916 0%, var(--bg0) 40%, #0c100e 100%);
  min-height: 100vh;
}

.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 0;
}

.top, .alert-strip, .stats, .layout, .list-panel, .incidents-panel, .links-panel, .lawsuit-panel {
  position: relative;
  z-index: 1;
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
}

.lawsuit-panel {
  margin-top: 20px;
  margin-bottom: 16px;
  border-color: rgba(232, 93, 76, 0.45);
  background:
    linear-gradient(135deg, rgba(232, 93, 76, 0.14), transparent 42%),
    rgba(23, 30, 26, 0.96);
  animation: rise 0.55s ease both;
}
.lawsuit-head { align-items: flex-start; }
.lawsuit-badge {
  display: inline-block;
  margin-bottom: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #2a0f0c;
  background: var(--crit);
}
.lawsuit-body { padding: 0 16px 18px; }
.lawsuit-lead {
  margin: 14px 0 12px;
  font-size: 1.08rem;
  line-height: 1.5;
  max-width: 70ch;
  font-weight: 600;
}
.lawsuit-core {
  margin: 0 0 16px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(232, 93, 76, 0.65);
  background: linear-gradient(135deg, rgba(232, 93, 76, 0.28), rgba(15, 20, 18, 0.75));
  color: #ffe8e4;
  font-size: 1.12rem;
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: -0.01em;
  max-width: 72ch;
}
.lawsuit-story {
  margin: 0 0 16px;
  padding: 12px 16px 12px 34px;
  border-radius: 14px;
  border: 1px solid rgba(232, 93, 76, 0.35);
  background: rgba(15, 20, 18, 0.65);
  display: grid;
  gap: 8px;
}
.lawsuit-story li {
  line-height: 1.45;
  font-weight: 600;
}
.lawsuit-story li::marker { color: var(--crit); font-weight: 800; }
.lawsuit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.lawsuit-grid h3 {
  margin: 0 0 8px;
  font-size: 0.95rem;
}
.lawsuit-grid ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
}
.lawsuit-form {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.lawsuit-form h3 { margin: 0 0 6px; }
.lawsuit-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 12px 0;
}
.lawsuit-fields label {
  display: grid;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--muted);
}
.lawsuit-fields label.full { grid-column: 1 / -1; }
.lawsuit-fields input,
.lawsuit-fields textarea {
  width: 100%;
}
.lawsuit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.lawsuit-actions button[type="submit"] {
  background: linear-gradient(180deg, #e85d4c, #c44738);
  border-color: #f08a7d;
  color: #fff;
  font-weight: 700;
}
.lawsuit-status {
  margin: 12px 0 0;
  color: var(--accent);
  font-size: 0.9rem;
}

.top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
  padding: 28px 0 18px;
}

.brand { display: flex; gap: 14px; align-items: center; }
.brand-mark {
  width: 54px; height: 54px; border-radius: 16px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--accent), #7fbf3a);
  color: #132016; font-weight: 800; letter-spacing: 0.04em;
  box-shadow: 0 0 0 1px rgba(196,240,98,0.35), var(--shadow);
}
.brand h1 { margin: 0; font-size: clamp(1.4rem, 2.4vw, 2rem); letter-spacing: -0.03em; }
.tagline { margin: 4px 0 0; color: var(--muted); font-size: 0.95rem; }
.top-meta { text-align: right; display: grid; gap: 8px; justify-items: end; }
.visit-counter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(196, 240, 98, 0.28);
  background: rgba(196, 240, 98, 0.08);
  color: var(--text);
  font-size: 0.78rem;
  font-family: var(--mono);
  line-height: 1.2;
}
.visit-counter .vc-item strong {
  color: var(--accent);
  font-weight: 700;
}
.visit-counter .vc-sep { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); }

button, select, input {
  font: inherit;
  color: var(--text);
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
}
button {
  cursor: pointer;
  background: linear-gradient(180deg, #2a3830, #223028);
  transition: transform 0.18s ease, border-color 0.18s ease;
}
button:hover { transform: translateY(-1px); border-color: var(--accent); }

.alert-strip {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}
.alert {
  border-radius: var(--radius);
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: rgba(232, 93, 76, 0.12);
  animation: rise 0.5s ease both;
}
.alert.rec { background: rgba(224, 162, 58, 0.12); }
.alert strong { display: block; margin-bottom: 4px; }

.stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.stat {
  background: rgba(31, 41, 35, 0.9);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  animation: rise 0.55s ease both;
}
.stat .n {
  font-size: 1.8rem; font-weight: 800; letter-spacing: -0.04em; line-height: 1;
}
.stat .l { color: var(--muted); margin-top: 6px; font-size: 0.85rem; }
.stat.crit .n { color: var(--crit); }
.stat.rec .n { color: var(--rec); }
.stat.ok .n { color: var(--ok); }
.stat.busy .n { color: var(--busy); }

.layout {
  display: grid;
  grid-template-columns: 1.5fr 0.9fr;
  gap: 16px;
  margin-bottom: 16px;
}
.panel {
  background: rgba(23, 30, 26, 0.92);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.panel-head {
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
}
.panel-head h2 { margin: 0; font-size: 1.05rem; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filters input { min-width: 180px; }

#map {
  height: min(62vh, 640px);
  width: 100%;
  background: #101612;
}
.legend {
  display: flex; flex-wrap: wrap; gap: 12px 16px;
  padding: 12px 16px; color: var(--muted); font-size: 0.85rem;
  border-top: 1px solid var(--line);
}
.dot {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%;
  margin-right: 6px; vertical-align: middle;
}
.dot.crit { background: var(--crit); }
.dot.rec { background: var(--rec); }
.dot.contest { background: #d47a3a; }
.dot.ok { background: var(--ok); }
.dot.busy { background: var(--busy); }
.dot.hist { background: var(--hist); }

.side { display: grid; gap: 16px; align-content: start; }
.checklist { margin: 0; padding: 8px 16px 16px 34px; display: grid; gap: 12px; }
.checklist li { line-height: 1.4; }
.checklist li::marker { color: var(--accent); font-weight: 700; }
.checklist strong { display: block; margin-bottom: 2px; }
.checklist span { color: var(--muted); font-size: 0.92rem; }

.redirects { padding: 12px 16px 16px; display: grid; gap: 12px; }
.card-soft {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: rgba(15, 20, 18, 0.55);
}
.card-soft h3 { margin: 0 0 8px; font-size: 0.98rem; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: 0.78rem;
  padding: 5px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #152019;
  color: var(--text);
}
.note { margin-top: 8px; color: var(--muted); font-size: 0.82rem; }

.timeline { padding: 12px 16px 8px; display: grid; gap: 10px; }
.tl-item {
  border-left: 3px solid var(--accent);
  padding: 8px 12px;
  background: rgba(15,20,18,0.55);
  border-radius: 0 12px 12px 0;
}
.tl-item .d { font-family: var(--mono); font-size: 0.78rem; color: var(--accent); }
.tl-item .w { font-weight: 700; margin: 4px 0; }
.tl-item .n { color: var(--muted); font-size: 0.9rem; }
.news-scan { padding: 8px 16px 16px; display: grid; gap: 8px; }
.news-row {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px;
}
.news-row strong { min-width: 120px; }
.news-row a { color: var(--accent); font-size: 0.82rem; }
.hint { color: var(--muted); font-size: 0.82rem; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th, td {
  text-align: left; padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top; font-size: 0.92rem;
}
th { color: var(--muted); font-weight: 600; background: rgba(0,0,0,0.18); position: sticky; top: 0; }
tbody tr { transition: background 0.15s ease; cursor: pointer; }
tbody tr:hover { background: rgba(196, 240, 98, 0.05); }
.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid transparent;
}
.badge.damaged_critical { color: #2a0f0c; background: var(--crit); }
.badge.recovering { color: #2a1d08; background: var(--rec); }
.badge.contested { color: #2a1608; background: #d47a3a; }
.badge.alive { color: #0d2418; background: var(--ok); }
.badge.busy { color: #071821; background: var(--busy); }
.badge.historical { color: #111; background: var(--hist); }

.panel-note {
  margin: 0;
  padding: 10px 16px 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
}
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  margin: 10px 0;
}
.media-grid figure {
  margin: 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #0c110e;
  cursor: zoom-in;
}
.media-grid img, .media-grid video {
  display: block;
  width: 100%;
  height: 110px;
  object-fit: cover;
  background: #000;
}
.media-grid figcaption {
  padding: 6px 8px;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.3;
}
.video-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.video-links a {
  color: var(--accent);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.8rem;
  background: #152019;
}
.video-links a:hover { border-color: var(--accent); }
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0,0,0,0.88);
  display: grid;
  place-items: center;
  padding: 24px;
}
.lightbox[hidden] { display: none !important; }
.lightbox img, .lightbox video {
  max-width: min(96vw, 1100px);
  max-height: 85vh;
  border-radius: 12px;
}
#lightboxClose {
  position: fixed;
  top: 16px;
  right: 16px;
  font-size: 1.6rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  z-index: 51;
}

.incidents { padding: 12px 16px 16px; display: grid; gap: 12px; }
.incident {
  border-radius: 14px;
  border: 1px solid var(--line);
  padding: 14px;
  background: rgba(15, 20, 18, 0.55);
  animation: rise 0.45s ease both;
}
.incident h3 { margin: 0 0 8px; }
.incident p { margin: 0 0 8px; color: var(--muted); line-height: 1.45; }
.incident ul { margin: 0; padding-left: 18px; color: var(--text); }
.links {
  padding: 12px 16px 8px;
  display: flex; flex-wrap: wrap; gap: 8px;
}
.links a {
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: #152019;
}
.links a:hover { border-color: var(--accent); color: var(--accent); }
.disclaimer {
  margin: 0 16px 16px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.leaflet-container { font: inherit; background: #101612; }
.wb-pin-wrap {
  position: relative;
  width: 14px;
  height: 14px;
}
.wb-pin {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid #0b100d;
  box-shadow: 0 0 0 4px rgba(255,255,255,0.08);
}
.wb-label {
  position: absolute;
  left: 18px;
  top: -6px;
  background: rgba(12, 17, 14, 0.92);
  border: 1px solid #2c3a32;
  color: #e8efe9;
  border-radius: 8px;
  padding: 2px 6px;
  font: 700 11px/1.2 Manrope, sans-serif;
  white-space: nowrap;
  box-shadow: 0 6px 16px rgba(0,0,0,0.35);
  pointer-events: none;
}
.wb-label span {
  display: block;
  font: 600 10px/1.2 "JetBrains Mono", monospace;
  color: #9aafa1;
  margin-top: 2px;
}
.gps-cell {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
}
.gps-cell a { color: var(--accent); text-decoration: none; }
.popup h4 { margin: 0 0 6px; }
.popup p { margin: 0 0 4px; color: #333; font-size: 0.88rem; }
.popup .gps { font-family: ui-monospace, monospace; font-size: 0.8rem; }

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .lawsuit-grid, .lawsuit-fields { grid-template-columns: 1fr; }
  .top { flex-direction: column; align-items: flex-start; }
  .top-meta { justify-items: start; text-align: left; }
  #map { height: 52vh; }
}
