:root {
  --bg: #f5f2ea;
  --panel: #ffffff;
  --line: #d4d0c8;
  --ink: #1f2430;
  --muted: #667084;
  --accent: #0d6d9c;
  --danger: #c62828;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Source Sans 3", Arial, sans-serif;
}

body.map-focus {
  overflow: hidden;
}

.shell {
  max-width: 1700px;
  margin: 0 auto;
  padding: 14px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.brand img {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
}

.eyebrow {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--muted);
}

h1 {
  margin: 2px 0 0;
  font-size: 1.9rem;
}

.toolbar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.toolbar label,
.toolbar select,
.toolbar button,
.home-link {
  font-size: 14px;
}

.toolbar select,
.toolbar button,
.home-link {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  padding: 8px 10px;
  color: var(--ink);
  text-decoration: none;
}

.toolbar button {
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.status {
  margin: 10px 0;
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.country-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  min-height: 420px;
  position: relative;
}

.country-card > header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.country-card.zoomable > header {
  cursor: zoom-in;
}

.country-card.zoomed > header {
  cursor: zoom-out;
}

.country-card.zoomable > header::after {
  content: "Agrandir";
  margin-left: 10px;
  color: var(--muted);
  font-size: 12px;
  font-family: monospace;
}

.country-card.zoomed > header::after {
  content: "Reduire";
}

.country-card h2 {
  margin: 0;
  font-size: 1.2rem;
}

.count {
  font-family: monospace;
  font-size: 1rem;
  color: var(--muted);
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.85fr);
  min-height: 370px;
}

.map {
  min-height: 370px;
}

.timeline {
  border-left: 1px solid var(--line);
  padding: 8px;
  overflow: auto;
  max-height: 370px;
  background: #fcfbf9;
}

.timeline-empty {
  color: var(--muted);
  margin: 4px;
}

.timeline-item {
  border: 1px solid #e2ddd1;
  border-radius: 10px;
  background: #fff;
  padding: 8px;
  margin-bottom: 8px;
  cursor: pointer;
}

.timeline-item:hover {
  border-color: #c2b9a8;
}

.timeline-item time {
  display: inline-block;
  font-family: monospace;
  font-size: 12px;
  color: #bb2d2d;
  margin-bottom: 4px;
}

.timeline-item .title {
  font-weight: 700;
  font-size: 14px;
  line-height: 1.25;
  margin-bottom: 5px;
}

.timeline-item .meta {
  color: var(--muted);
  font-size: 12px;
}

.popup-list {
  margin: 6px 0 0 16px;
  padding: 0;
}

.popup-list li {
  margin-bottom: 3px;
  line-height: 1.25;
}

.country-card.zoomed {
  position: fixed;
  top: 10px;
  left: 10px;
  right: 10px;
  bottom: 10px;
  width: auto;
  min-height: 0;
  z-index: 2500;
  box-shadow: 0 18px 48px rgba(11, 18, 32, 0.28);
}

.country-card.zoomed .split {
  min-height: calc(100vh - 88px);
}

.country-card.zoomed .map {
  min-height: calc(100vh - 88px);
}

.country-card.zoomed .timeline {
  max-height: calc(100vh - 88px);
}

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

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

  .timeline {
    border-left: 0;
    border-top: 1px solid var(--line);
    max-height: 260px;
  }

  .country-card.zoomed .split {
    min-height: calc(100vh - 88px);
  }

  .country-card.zoomed .timeline {
    max-height: 38vh;
  }
}
