:root {
  --ink: #17150f;
  --muted: #747a75;
  --paper: #f3f0e7;
  --cream: #fbfaf6;
  --line: #d9d4c7;
  --green: #1f5a43;
  --green-deep: #163d30;
  --green-soft: #e3ece6;
  --red: #a72d32;
  --amber: #c78a25;
  --blue: #3f6d7b;
  --violet: #725d7c;
  --brown: #956342;
  --gold: #c8922e;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select { color: inherit; font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}
[hidden] { display: none !important; }
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.skip-link {
  position: fixed;
  z-index: 9999;
  top: 10px;
  left: 10px;
  padding: 9px 12px;
  border-radius: 5px;
  background: #fff;
  color: var(--green-deep);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

.news-shell {
  height: 100svh;
  min-height: 720px;
  overflow: hidden;
  background: var(--paper);
}
.topbar {
  position: relative;
  z-index: 1000;
  height: 68px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr);
  align-items: center;
  gap: 24px;
  padding: 0 26px;
  border-bottom: 1px solid var(--line);
  background: rgba(251, 250, 246, .97);
  box-shadow: 0 1px 0 rgba(23, 21, 15, .02);
}
.brand {
  width: max-content;
  display: flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  text-decoration: none;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--green-deep);
  color: #f6df9c;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -.03em;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16);
}
.brand-copy strong, .brand-copy small { display: block; line-height: 1; }
.brand-copy strong { font-family: Georgia, "Times New Roman", serif; font-size: 15px; letter-spacing: .06em; }
.brand-copy small { margin-top: 5px; color: #747a75; font-size: 8px; font-weight: 800; letter-spacing: .15em; }
.topbar nav { height: 100%; display: flex; align-items: center; gap: 32px; }
.topbar nav a { position: relative; color: #6d736e; font-size: 12px; font-weight: 700; text-decoration: none; }
.topbar nav a:hover, .topbar nav a.active { color: var(--ink); }
.topbar nav a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -25px;
  height: 2px;
  background: var(--red);
}
.update-chip {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}
.update-chip:hover { border-color: #b9b3a5; }
.update-chip:disabled { cursor: wait; opacity: .7; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #42a36a; box-shadow: 0 0 0 4px #e1f1e7; }
.refresh-icon { color: #89908b; font-size: 14px; line-height: 1; }
.update-chip.is-refreshing .refresh-icon { animation: spin .85s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.workspace {
  height: calc(100svh - 68px);
  min-height: 652px;
  display: grid;
  grid-template-columns: 216px minmax(420px, 1fr) minmax(340px, 420px);
}
.rail, .briefings { background: var(--cream); }
.rail {
  z-index: 2;
  padding: 25px 20px;
  border-right: 1px solid var(--line);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.eyebrow {
  margin: 0 0 13px;
  color: #777e78;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .15em;
  text-transform: uppercase;
}
.search-box {
  height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 27px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}
.search-box > span { color: #8b918c; font-size: 20px; line-height: 1; transform: rotate(-15deg); }
.search-box input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 11px; }
.search-box input::placeholder { color: #999e9a; }
.search-box:focus-within { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(200, 146, 46, .16); }
.filter {
  width: 100%;
  display: grid;
  grid-template-columns: 20px 1fr auto;
  align-items: center;
  gap: 7px;
  margin: 3px 0;
  padding: 10px 11px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  text-align: left;
  font-size: 11px;
  cursor: pointer;
}
.filter > span { color: #939994; font-size: 15px; }
.filter b { color: #949a95; font-size: 9px; }
.filter:hover { background: #f0f1ed; }
.filter.active-filter { background: var(--green-soft); color: var(--green-deep); font-weight: 800; }
.filter.active-filter > span { color: var(--green); }
.category-filter { display: block; margin-top: 28px; }
.category-filter > span {
  display: block;
  margin-bottom: 8px;
  color: #777e78;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .15em;
  text-transform: uppercase;
}
.category-filter select {
  width: 100%;
  height: 40px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  font-size: 10px;
}
.rail-note { margin-top: 26px; padding: 14px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.rail-note span, .rail-note strong, .rail-note small { display: block; }
.rail-note span { color: #7b817c; font-size: 8px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.rail-note strong { margin: 6px 0 8px; font-family: Georgia, "Times New Roman", serif; font-size: 16px; font-weight: 500; }
.rail-note small { color: #7e847f; font-size: 9px; line-height: 1.5; }

.map-panel {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  background: #e1e6df;
}
.map-heading {
  min-height: 122px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 21px 25px;
  border-bottom: 1px solid #ccd2cb;
  background: #e8ece6;
}
.map-heading .eyebrow { margin-bottom: 7px; color: #5f6c63; }
.map-heading h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(30px, 3.3vw, 48px);
  font-weight: 500;
  line-height: .98;
  letter-spacing: -.04em;
}
.dek { margin: 7px 0 0; color: #667169; font-family: Georgia, "Times New Roman", serif; font-size: 12px; font-style: italic; }
.map-counter {
  min-width: 74px;
  padding: 12px;
  border: 1px solid rgba(31, 77, 60, .18);
  border-radius: 8px;
  background: rgba(251, 250, 246, .75);
  text-align: center;
}
.map-counter strong, .map-counter span { display: block; }
.map-counter strong { font-family: Georgia, "Times New Roman", serif; font-size: 28px; font-weight: 500; line-height: 1; }
.map-counter span { margin-top: 5px; color: #657069; font-size: 8px; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
.mobile-controls { display: none; }
.map-frame { position: relative; min-height: 300px; overflow: hidden; }
.leaflet-map { position: absolute; inset: 0; background: #dfe5df; }
.map-loading {
  position: absolute;
  z-index: 500;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #e3e8e2;
  color: #68736b;
  font-size: 11px;
  letter-spacing: .04em;
  text-align: center;
}
.map-loading.is-error { color: #842c31; background: #f1e5e1; }
.leaflet-tile-pane { filter: saturate(.55) sepia(.08) brightness(1.03) contrast(.88); }
.leaflet-container { font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.leaflet-control-zoom { margin-top: 16px !important; margin-right: 16px !important; border: 0 !important; box-shadow: 0 6px 18px rgba(34, 49, 39, .16) !important; }
.leaflet-control-zoom a {
  width: 34px !important;
  height: 34px !important;
  line-height: 32px !important;
  border: 1px solid #d0d5cf !important;
  background: rgba(251, 250, 246, .95) !important;
  color: var(--ink) !important;
}
.leaflet-control-attribution { color: #707771 !important; font-size: 8px !important; background: rgba(251, 250, 246, .82) !important; }
.news-map-icon { border: 0; background: none; }
.marker-pin {
  position: relative;
  display: block;
  width: 30px;
  height: 30px;
  border: 2px solid #fff;
  border-radius: 50% 50% 50% 0;
  background: var(--red);
  color: var(--red);
  box-shadow: 0 5px 14px rgba(25, 39, 30, .28);
  transform: rotate(-45deg);
  transition: transform .18s ease, box-shadow .18s ease;
}
.marker-pin::after {
  content: "";
  position: absolute;
  inset: -6px;
  border: 1px solid currentColor;
  border-radius: 50%;
  opacity: 0;
}
.marker-pin > span { position: absolute; inset: 8px; border-radius: 50%; background: rgba(255, 255, 255, .96); }
.marker-pin:hover, .marker-pin.is-active { z-index: 4; transform: rotate(-45deg) scale(1.18); box-shadow: 0 7px 19px rgba(25, 39, 30, .35); }
.marker-pin.is-active::after { opacity: .65; animation: pin-pulse 2s infinite; }
.marker-security { color: var(--red); background: var(--red); }
.marker-politics { color: var(--blue); background: var(--blue); }
.marker-diplomacy { color: #51669a; background: #51669a; }
.marker-rights { color: var(--violet); background: var(--violet); }
.marker-humanitarian { color: #b45d45; background: #b45d45; }
.marker-economy { color: var(--amber); background: var(--amber); }
.marker-infrastructure { color: #528260; background: #528260; }
.marker-society { color: var(--brown); background: var(--brown); }
@keyframes pin-pulse { 0%, 100% { transform: scale(.75); opacity: .7; } 60% { transform: scale(1.25); opacity: 0; } }
.news-popup .leaflet-popup-content-wrapper {
  border: 1px solid #d5d7d1;
  border-radius: 9px;
  background: var(--cream);
  box-shadow: 0 12px 30px rgba(26, 39, 31, .17);
}
.news-popup .leaflet-popup-content { margin: 14px; }
.news-popup .leaflet-popup-tip { background: var(--cream); }
.pin-popup-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; color: #777e79; font-size: 9px; }
.pin-popup > strong { display: block; font-family: Georgia, "Times New Roman", serif; font-size: 16px; line-height: 1.22; }
.pin-popup > p { margin: 8px 0 10px; color: #747b76; font-size: 9px; }
.pin-popup-links { display: flex; flex-wrap: wrap; gap: 7px 11px; }
.pin-popup a { color: var(--green); font-size: 9px; font-weight: 800; text-decoration: none; }
.pin-popup a:hover { text-decoration: underline; }
.map-footer {
  min-height: 43px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 16px;
  border-top: 1px solid #cdd3cc;
  background: #e8ece6;
  color: #667169;
  font-size: 8px;
}
.overlay-toggle { display: flex; align-items: center; gap: 7px; font-weight: 650; cursor: pointer; }
.overlay-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-track { width: 25px; height: 14px; padding: 2px; border-radius: 999px; background: #aeb8b1; transition: background .18s ease; }
.toggle-track::after { content: ""; display: block; width: 10px; height: 10px; border-radius: 50%; background: #fff; transition: transform .18s ease; }
.overlay-toggle input:checked + .toggle-track { background: var(--green); }
.overlay-toggle input:checked + .toggle-track::after { transform: translateX(11px); }
.overlay-toggle input:focus-visible + .toggle-track { outline: 3px solid var(--gold); outline-offset: 2px; }

.briefings {
  min-width: 0;
  padding: 24px 24px 0;
  border-left: 1px solid var(--line);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: #c6c2b8 transparent;
}
.briefings-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.briefings-head .eyebrow { margin-bottom: 6px; }
.briefings h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 25px; font-weight: 500; letter-spacing: -.02em; }
.live-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
  padding: 5px 7px;
  border-radius: 4px;
  background: #e5f0e9;
  color: #2f7650;
  font-size: 7px;
  font-weight: 850;
  letter-spacing: .09em;
}
.live-pill > span { width: 5px; height: 5px; border-radius: 50%; background: #42a36a; }
.refresh-note { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; color: #848a86; font-size: 8px; }
.refresh-note time { white-space: nowrap; }
.stories { display: grid; gap: 9px; }
.story-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
  background: #fff;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.story-card:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(28, 40, 33, .07); }
.story-card.selected-story { border-color: #769785; box-shadow: 0 0 0 2px rgba(31, 77, 60, .08); }
.story-select { position: relative; width: 100%; padding: 15px 15px 12px; border: 0; background: transparent; text-align: left; cursor: pointer; }
.story-topline { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.story-topline time { color: #898f8b; font-size: 8px; }
.status-tag {
  display: inline-block;
  padding: 4px 6px;
  border-radius: 3px;
  font-size: 7px;
  font-weight: 850;
  letter-spacing: .08em;
  line-height: 1;
  text-transform: uppercase;
}
.status-confirmed { background: #e0eee5; color: #2a7650; }
.status-reported { background: #f7ecd5; color: #986613; }
.status-disputed { background: #f6dfdb; color: #a13d2d; }
.status-corrected { background: #ddeaf0; color: #356577; }
.story-number { position: absolute; top: 43px; right: 15px; color: #d0d3d0; font-family: Georgia, "Times New Roman", serif; font-size: 12px; }
.story-card h3 { max-width: calc(100% - 24px); margin: 12px 0 7px; font-family: Georgia, "Times New Roman", serif; font-size: 17px; font-weight: 500; line-height: 1.22; }
.story-summary {
  display: -webkit-box;
  margin: 0 0 12px;
  overflow: hidden;
  color: #737a75;
  font-size: 9px;
  line-height: 1.52;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}
.story-place { display: flex; align-items: center; gap: 6px; color: #68706a; font-size: 8px; font-weight: 700; }
.category-dot { flex: 0 0 auto; width: 6px; height: 6px; border-radius: 50%; background: var(--red); }
.dot-security { background: var(--red); }
.dot-politics { background: var(--blue); }
.dot-diplomacy { background: #51669a; }
.dot-rights { background: var(--violet); }
.dot-humanitarian { background: #b45d45; }
.dot-economy { background: var(--amber); }
.dot-infrastructure { background: #528260; }
.dot-society { background: var(--brown); }
.story-source {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 15px;
  border-top: 1px solid #ece9e1;
  background: #fcfbf7;
  color: #858b87;
  font-size: 8px;
}
.source-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px 9px; }
.story-source a { color: var(--green); font-weight: 800; text-decoration: none; }
.story-source a:hover { text-decoration: underline; }
.empty-state { padding: 38px 18px; border: 1px dashed var(--line); border-radius: 9px; text-align: center; }
.empty-state strong { font-family: Georgia, "Times New Roman", serif; font-size: 17px; }
.empty-state p { color: var(--muted); font-size: 10px; }
.empty-state button { padding: 8px 11px; border: 0; border-radius: 6px; background: var(--green); color: #fff; font-size: 9px; font-weight: 800; cursor: pointer; }
.briefings footer { margin-top: 20px; padding: 20px 3px 30px; border-top: 1px solid var(--line); color: #7b827d; font-size: 9px; line-height: 1.55; }
.briefings footer strong { color: var(--ink); font-family: Georgia, "Times New Roman", serif; font-size: 16px; font-weight: 500; }
.briefings footer p { margin: 9px 0 0; }
.noscript { margin: 20px; padding: 16px; border: 1px solid #c6b8a4; background: #fff; font: 14px/1.5 sans-serif; }

@media (max-width: 1120px) {
  .workspace { grid-template-columns: 190px minmax(390px, 1fr) 360px; }
  .topbar { grid-template-columns: 200px 1fr 190px; }
  .rail { padding-inline: 16px; }
  .briefings { padding-inline: 18px; }
}

@media (max-width: 920px) {
  .workspace { grid-template-columns: minmax(380px, 1fr) 360px; }
  .rail { display: none; }
  .map-panel { grid-template-rows: auto auto minmax(0, 1fr) auto; }
  .map-heading { min-height: 106px; }
  .mobile-controls {
    z-index: 600;
    display: grid;
    gap: 7px;
    padding: 8px 12px 9px;
    border-bottom: 1px solid #ccd2cb;
    background: rgba(232, 236, 230, .96);
  }
  .mobile-filter-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(130px, .8fr); gap: 7px; }
  .mobile-search input, .mobile-topic select {
    width: 100%;
    height: 34px;
    padding: 0 9px;
    border: 1px solid #cdd3cd;
    border-radius: 6px;
    background: #fff;
    font-size: 9px;
  }
  .mobile-regions { display: flex; gap: 5px; overflow-x: auto; scrollbar-width: none; }
  .mobile-regions::-webkit-scrollbar { display: none; }
  .mobile-regions button {
    flex: 0 0 auto;
    padding: 6px 9px;
    border: 1px solid #cdd3cd;
    border-radius: 999px;
    background: rgba(251, 250, 246, .95);
    font-size: 8px;
    font-weight: 800;
    cursor: pointer;
  }
  .mobile-regions button.active { border-color: var(--green); background: var(--green); color: #fff; }
}

@media (max-width: 740px) {
  html { scroll-padding-top: 64px; }
  .news-shell { height: auto; min-height: 100svh; overflow: visible; }
  .topbar { position: sticky; top: 0; height: 64px; grid-template-columns: 1fr auto; padding: 0 14px; }
  .topbar nav { display: none; }
  .workspace { height: auto; min-height: 0; display: block; }
  .map-panel { height: calc(100svh - 64px); min-height: 620px; grid-template-rows: auto auto minmax(300px, 1fr) auto; }
  .map-heading { min-height: 105px; padding: 17px; }
  .map-heading h1 { font-size: clamp(30px, 10vw, 44px); }
  .map-counter { min-width: 62px; padding: 10px; }
  .briefings { padding: 25px 17px 0; border-top: 1px solid var(--line); border-left: 0; overflow: visible; }
  .briefings h2 { font-size: 28px; }
  .stories { gap: 11px; }
  .story-card h3 { font-size: 19px; }
  .story-summary { font-size: 10px; }
  .map-footer { align-items: flex-start; flex-direction: column; gap: 4px; padding-block: 8px; }
}

@media (max-width: 440px) {
  .brand-copy strong { font-size: 13px; }
  .refresh-label { display: none; }
  .update-chip { padding-inline: 10px; }
  .map-heading .dek { display: none; }
  .map-counter { display: none; }
  .mobile-filter-row { grid-template-columns: 1fr 1fr; }
  .refresh-note { flex-direction: column; gap: 3px; }
  .story-source { align-items: flex-start; flex-direction: column; }
  .source-links { justify-content: flex-start; }
}

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