:root {
  --paper: #f7f1e7;
  --paper-deep: #eee2cf;
  --surface: #fffdf8;
  --ink: #211c18;
  --muted: #756d66;
  --red: #a92922;
  --red-dark: #741813;
  --gold: #b48135;
  --line: rgba(58, 42, 31, .16);
  --shadow: 0 22px 65px rgba(65, 43, 27, .12);
  --serif: Georgia, "Times New Roman", serif;
  --sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
body.feed-open { overflow: hidden; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
img { max-width: 100%; }

.skip-link {
  position: fixed; z-index: 9999; left: 16px; top: -70px; padding: 12px 16px;
  border-radius: 8px; background: var(--ink); color: white; transition: top .2s;
}
.skip-link:focus { top: 16px; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.top-line { height: 4px; background: linear-gradient(90deg, var(--red-dark), var(--red), var(--gold)); }

.site-header {
  max-width: 1540px; min-height: 84px; margin: auto; padding: 0 34px;
  display: flex; align-items: center; justify-content: space-between; gap: 30px;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; text-decoration: none; }
.brand-logo { width: 52px; height: 52px; border-radius: 13px; object-fit: cover; }
.brand-wordmark { width: 238px; height: auto; display: block; }
.header-actions { display: flex; align-items: center; gap: 26px; font-size: 13px; }
.header-actions > a { color: var(--muted); text-decoration: none; }
.header-actions > a:hover { color: var(--red); }
.live-badge { display: flex; align-items: center; gap: 8px; color: var(--red); font-size: 11px; letter-spacing: .16em; }
.live-badge span { width: 7px; height: 7px; border-radius: 50%; background: #c54b42; box-shadow: 0 0 0 5px rgba(197,75,66,.12); }
.language-switch { display: flex; padding: 3px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); }
.language-switch button { padding: 7px 10px; border: 0; border-radius: 99px; background: none; color: var(--muted); font-size: 11px; font-weight: 800; cursor: pointer; }
.language-switch button.is-active { background: var(--red); color: white; }

.site-main { max-width: 1540px; margin: auto; padding: 34px 34px 70px; }
.intro { display: flex; align-items: end; justify-content: space-between; gap: 60px; margin-bottom: 24px; }
.eyebrow { margin: 0 0 8px; color: var(--red); font-size: 10px; line-height: 1.3; font-weight: 800; letter-spacing: .18em; }
h1, h2, h3 { font-family: var(--serif); }
h1 { max-width: 830px; margin: 0; font-size: clamp(42px, 5vw, 74px); line-height: .98; font-weight: 500; letter-spacing: -.035em; }
.intro-copy { max-width: 390px; margin: 0 0 5px; color: var(--muted); font-size: 14px; line-height: 1.68; }

.monitor { border-radius: 16px; box-shadow: var(--shadow); }
.toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px;
  border: 1px solid var(--line); border-bottom: 0; border-radius: 16px 16px 0 0; background: var(--surface);
}
.period-switch { display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--paper-deep); }
.period-switch button { padding: 9px 14px; border: 0; border-radius: 8px; background: none; color: var(--muted); font-size: 12px; font-weight: 700; cursor: pointer; }
.period-switch button.is-active { color: var(--red); background: var(--surface); box-shadow: 0 2px 8px rgba(54,39,25,.08); }
.search-field { position: relative; flex: 1; min-width: 210px; }
.search-field input, .select-field {
  width: 100%; height: 40px; border: 1px solid var(--line); border-radius: 9px;
  outline: 0; color: var(--ink); background: #fffefa;
}
.search-field input { padding: 0 13px 0 38px; }
.search-icon { position: absolute; left: 13px; top: 12px; width: 14px; height: 14px; border: 1.8px solid #8b827b; border-radius: 50%; }
.search-icon::after { content: ""; position: absolute; right: -5px; bottom: -3px; width: 6px; height: 2px; background: #8b827b; transform: rotate(45deg); transform-origin: left; }
.search-field input:focus, .select-field:focus { border-color: rgba(169,41,34,.55); box-shadow: 0 0 0 3px rgba(169,41,34,.08); }
.select-field { width: auto; max-width: 190px; padding: 0 31px 0 11px; cursor: pointer; }
.icon-button { width: 40px; height: 40px; flex: 0 0 40px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; background: #fffefa; color: var(--red); cursor: pointer; }
.refresh-icon { width: 16px; height: 16px; border: 2px solid currentColor; border-left-color: transparent; border-radius: 50%; position: relative; }
.refresh-icon::after { content: ""; position: absolute; right: -3px; top: -3px; border-left: 4px solid currentColor; border-top: 3px solid transparent; border-bottom: 3px solid transparent; transform: rotate(-30deg); }
.icon-button.is-loading .refresh-icon { animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.monitor-grid {
  height: min(735px, calc(100vh - 235px)); min-height: 590px; display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(390px, .72fr);
  overflow: hidden; border: 1px solid var(--line); border-radius: 0 0 16px 16px; background: var(--surface);
}
.map-column { position: relative; min-width: 0; background: #ddd3c5; }
#map { width: 100%; height: 100%; z-index: 1; }
.leaflet-container { background: #ddd3c5; font-family: var(--sans); }
.leaflet-tile-pane { filter: sepia(.18) saturate(.72) brightness(1.03); }
.leaflet-control-zoom a { color: var(--red-dark) !important; }
.leaflet-control-attribution { font-size: 10px !important; }
.map-key { position: absolute; z-index: 500; left: 15px; top: 15px; display: flex; align-items: center; gap: 8px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,253,248,.93); backdrop-filter: blur(8px); font-size: 10px; }
.map-key span { width: 9px; height: 9px; border-radius: 50%; background: var(--red); }
.layer-control { position: absolute; z-index: 650; top: 15px; right: 15px; display: flex; flex-direction: column; align-items: end; gap: 6px; }
.layer-toggle { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,253,248,.96); color: var(--ink); box-shadow: 0 4px 16px rgba(58,42,31,.12); cursor: pointer; }
.layer-toggle.is-active { color: var(--red); }
.layers-icon, .layers-icon::before, .layers-icon::after { width: 17px; height: 10px; border: 1.7px solid currentColor; transform: rotate(30deg) skew(-8deg); }
.layers-icon { position: relative; border-top: 0; border-left: 0; }
.layers-icon::before, .layers-icon::after { content: ""; position: absolute; left: -4px; }
.layers-icon::before { top: -6px; }
.layers-icon::after { top: 1px; }
.layer-menu { width: 184px; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,253,248,.98); box-shadow: 0 13px 34px rgba(58,42,31,.18); backdrop-filter: blur(10px); }
.layer-menu button { width: 100%; min-height: 43px; display: grid; grid-template-columns: 25px 1fr; align-items: center; gap: 5px; padding: 0 12px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--muted); text-align: left; cursor: pointer; }
.layer-menu button:hover { background: var(--paper); }
.layer-menu button.is-active { color: var(--red); background: rgba(169,41,34,.06); }
.layer-menu button span { font-size: 18px; text-align: center; }
.layer-menu button b { font-size: 11px; font-weight: 750; }
.layer-country-wrap { display: block; padding: 8px; background: var(--paper); }
.layer-country-wrap select { width: 100%; height: 38px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); padding: 0 8px; color: var(--ink); font-size: 11px; }
.layer-hint { position: absolute; z-index: 600; top: 16px; left: 50%; max-width: calc(100% - 430px); transform: translateX(-50%); padding: 9px 13px; border: 1px solid var(--line); border-radius: 99px; background: rgba(255,253,248,.94); color: var(--muted); box-shadow: 0 4px 16px rgba(58,42,31,.1); backdrop-filter: blur(8px); font-size: 10px; font-weight: 750; text-align: center; }
.layer-hint.is-selected { color: var(--red-dark); border-color: rgba(169,41,34,.35); }
.worflict-marker { width: 46px; height: 46px; display: grid; place-items: center; border: 2px solid white; border-radius: 50% 50% 50% 8px; transform: rotate(-45deg); background: var(--red); color: white; box-shadow: 0 5px 17px rgba(75,15,12,.34); transition: transform .16s, background .16s; }
.worflict-marker span { transform: rotate(45deg); font-size: 13px; font-weight: 800; }
.worflict-marker.is-selected { background: var(--red-dark); outline: 4px solid rgba(180,129,53,.46); }
.leaflet-marker-icon:hover .worflict-marker { transform: rotate(-45deg) scale(1.07); }

.feed-column { min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; border-left: 1px solid var(--line); background: #fffdfa; }
.feed-heading { display: flex; justify-content: space-between; align-items: start; gap: 18px; padding: 22px 22px 16px; border-bottom: 1px solid var(--line); }
.feed-heading h2 { margin: 0 0 5px; font-size: 31px; line-height: 1; }
.feed-count { margin: 0; color: var(--muted); font-size: 11px; }
.gdelt-link { color: #8a6129; font-size: 10px; white-space: nowrap; text-underline-offset: 3px; }
.close-feed { display: none; border: 0; background: none; font: 300 34px/1 var(--sans); color: var(--muted); cursor: pointer; }
.feed-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 0 22px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; scrollbar-gutter: stable; }
.story { padding: 21px 0; border-bottom: 1px solid var(--line); }
.story-meta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; color: var(--red); font-size: 9px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.severity { padding: 4px 7px; border: 1px solid rgba(169,41,34,.24); border-radius: 99px; }
.story h3 { margin: 10px 0 8px; font-size: 24px; line-height: 1.08; }
.story p { margin: 0; color: #6f6760; font-family: var(--serif); font-size: 16px; line-height: 1.45; }
.story-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 15px; color: #8a817a; font-size: 10px; }
.story-source { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.story-link { color: #86591f; font-weight: 750; text-decoration: none; white-space: nowrap; }
.story-link:hover { color: var(--red); }
.state-message { padding: 60px 25px; text-align: center; color: var(--muted); font-size: 13px; line-height: 1.6; }
.state-message strong { display: block; margin-bottom: 7px; color: var(--ink); font: 600 25px/1.1 var(--serif); }
.loading-list span { display: block; height: 145px; border-bottom: 1px solid var(--line); background: linear-gradient(90deg, transparent, rgba(180,155,120,.12), transparent); background-size: 220% 100%; animation: shimmer 1.5s infinite; }
@keyframes shimmer { to { background-position: -220% 0; } }
.mobile-feed-button { display: none; }

.principles { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 1px; margin-top: 56px; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--line); }
.principles article { padding: 31px; background: var(--surface); }
.principles h2, .principles h3 { margin: 0 0 10px; }
.principles h2 { font-size: 33px; }
.principles h3 { font-size: 23px; }
.principles p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.site-footer { max-width: 1540px; margin: auto; padding: 30px 34px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.site-footer img { width: 145px; }
.footer-meta { display: flex; align-items: center; justify-content: flex-end; gap: 20px; }
.footer-meta a { color: var(--red-dark); text-underline-offset: 3px; }
.footer-meta a:hover { color: var(--red); }

.policy-main { max-width: 980px; margin: auto; padding: 66px 34px 90px; }
.policy-hero { padding-bottom: 34px; border-bottom: 1px solid var(--line); }
.policy-hero h1 { max-width: none; font-size: clamp(44px, 7vw, 72px); }
.policy-lead { max-width: 760px; margin: 22px 0 0; color: var(--muted); font: 19px/1.65 var(--serif); }
.policy-date { margin: 18px 0 0; color: var(--muted); font-size: 11px; }
.policy-content { max-width: 800px; padding-top: 20px; }
.policy-section { padding: 30px 0; border-bottom: 1px solid var(--line); }
.policy-section h2 { margin: 0 0 14px; font-size: 28px; line-height: 1.15; }
.policy-section p, .policy-section li { color: var(--muted); font-size: 14px; line-height: 1.75; }
.policy-section p { margin: 0 0 12px; }
.policy-section p:last-child { margin-bottom: 0; }
.policy-section ul { margin: 10px 0 0; padding-left: 22px; }
.policy-section li + li { margin-top: 8px; }
.policy-section strong { color: var(--ink); }
.policy-section a { color: var(--red-dark); text-underline-offset: 3px; }
.policy-callout { margin-top: 16px; padding: 17px 19px; border: 1px solid rgba(169,41,34,.2); border-radius: 11px; background: rgba(169,41,34,.04); }
.policy-back { color: var(--muted); text-decoration: none; font-size: 13px; }
.policy-back:hover { color: var(--red); }
.language-switch a { padding: 7px 10px; border-radius: 99px; color: var(--muted); font-size: 11px; font-weight: 800; text-decoration: none; }
.language-switch a.is-active { background: var(--red); color: white; }
noscript { display: block; padding: 18px; text-align: center; background: var(--red-dark); color: white; }

@media (max-width: 1020px) {
  .intro { align-items: start; flex-direction: column; gap: 16px; }
  .monitor-grid { height: auto; min-height: 0; grid-template-columns: 1fr; grid-template-rows: 58vh auto; }
  .feed-column { border-top: 1px solid var(--line); border-left: 0; }
  .feed-list { max-height: 650px; }
  .principles { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .site-header { min-height: 69px; padding: 0 15px; }
  .brand { gap: 8px; }
  .brand-logo { width: 40px; height: 40px; border-radius: 10px; }
  .brand-wordmark { width: 145px; }
  .header-actions { gap: 11px; }
  .header-actions > a { display: none; }
  .live-badge { font-size: 9px; }
  .site-main { padding: 25px 12px 50px; }
  h1 { font-size: 45px; }
  .intro-copy { font-size: 13px; }
  .toolbar { border-radius: 13px 13px 0 0; }
  .period-switch { width: 100%; }
  .period-switch button { flex: 1; padding: 9px 6px; font-size: 11px; }
  .search-field { order: 2; min-width: calc(100% - 50px); }
  .select-field { flex: 1; min-width: 0; max-width: none; }
  .icon-button { order: 2; }
  .monitor-grid { grid-template-rows: calc(100svh - 250px); min-height: 510px; border-radius: 0 0 13px 13px; }
  .map-key { top: 10px; left: 10px; max-width: calc(100% - 65px); }
  .layer-control { top: 10px; right: 10px; }
  .layer-hint { top: 59px; max-width: calc(100% - 24px); white-space: normal; }
  .mobile-feed-button { display: block; position: absolute; z-index: 500; left: 50%; bottom: 22px; transform: translateX(-50%); padding: 12px 17px; border: 0; border-radius: 99px; background: var(--red-dark); color: white; box-shadow: 0 8px 25px rgba(71,17,13,.3); font-size: 12px; font-weight: 750; white-space: nowrap; }
  .feed-column { position: fixed; z-index: 1100; inset: 8vh 0 0; transform: translateY(105%); transition: transform .28s ease; border-radius: 17px 17px 0 0; box-shadow: 0 -18px 60px rgba(44,28,18,.24); }
  body.feed-open .feed-column { transform: translateY(0); }
  .feed-heading { padding: 20px 16px 14px; }
  .feed-heading h2 { font-size: 29px; }
  .close-feed { display: block; order: 3; }
  .gdelt-link { display: none; }
  .feed-list { max-height: none; padding: 0 16px calc(22px + env(safe-area-inset-bottom)); }
  .principles { margin-top: 36px; }
  .principles article { padding: 24px; }
  .site-footer { padding: 25px 16px; flex-direction: column; align-items: start; }
  .footer-meta { align-items: flex-start; flex-direction: column; gap: 10px; }
  .policy-main { padding: 42px 16px 65px; }
  .policy-lead { font-size: 17px; }
  .policy-section h2 { font-size: 25px; }
}

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