:root {
  --bg: #07111b;
  --panel: rgba(8, 19, 31, 0.82);
  --panel-strong: rgba(11, 26, 39, 0.96);
  --border: rgba(255, 255, 255, 0.08);
  --text: #eef3f7;
  --muted: #9cb0c2;
  --gold: #e7c56c;
  --orange: #ee6c4d;
  --blue: #73a9ff;
  --teal: #43baa9;
  --shipping: #c28df6;
  --protest: #f59e0b;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.32);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 15%, rgba(238, 108, 77, 0.16), transparent 28%),
    radial-gradient(circle at 85% 10%, rgba(67, 186, 169, 0.15), transparent 26%),
    linear-gradient(180deg, #091420 0%, #08111b 45%, #050c14 100%);
}

a {
  color: #b8d1ff;
}

button,
input,
select {
  font: inherit;
}

.page-shell {
  display: grid;
  grid-template-columns: 390px 1fr;
  min-height: 100vh;
}

.sidebar {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent),
    rgba(3, 10, 16, 0.5);
  border-right: 1px solid var(--border);
  overflow-y: auto;
}

.panel {
  background: var(--panel);
  backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

.hero-panel {
  position: relative;
  overflow: hidden;
}

.brand-lockup {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  width: 100%;
  max-width: 100%;
  height: 112px;
  padding: 0;
  overflow: hidden;
}

.brand-lockup a {
  display: flex;
  width: auto;
  max-width: 100%;
  height: 100%;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.brand-logo {
  display: block;
  width: auto;
  max-width: min(180px, 100%);
  height: auto;
  max-height: 104px;
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.24));
}

.hero-panel::after {
  content: "";
  position: absolute;
  inset: auto -10% -35% 35%;
  height: 170px;
  background: radial-gradient(circle, rgba(231, 197, 108, 0.22), transparent 65%);
  pointer-events: none;
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  color: var(--gold);
  font-weight: 700;
}

h1,
h2,
h3 {
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  letter-spacing: -0.03em;
  margin: 0;
}

h1 {
  font-size: 2rem;
  line-height: 1.02;
  max-width: 12ch;
}

.hero-copy,
.notes-panel p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.hero-meta,
.active-filters,
.modal-meta,
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.meta-pill,
.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.8rem;
  color: var(--text);
}

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

.ghost-button,
.icon-button,
.close-button {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}

.ghost-button:hover,
.icon-button:hover,
.close-button:hover,
.event-card:hover {
  transform: translateY(-1px);
}

.ghost-button {
  border-radius: 999px;
  padding: 8px 12px;
}

.icon-button {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 1rem;
}

.field,
.field-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

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

input,
select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

input::placeholder {
  color: rgba(238, 243, 247, 0.48);
}

.calendar-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.month-label {
  min-width: 120px;
  text-align: center;
  font-weight: 700;
}

.weekday-row,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.weekday-row {
  color: var(--muted);
  font-size: 0.78rem;
  margin-bottom: 10px;
}

.calendar-day {
  min-height: 62px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
  padding: 8px;
  text-align: left;
  color: var(--text);
  position: relative;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.calendar-day:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.12);
}

.calendar-day.other-month {
  opacity: 0.35;
}

.calendar-day.has-events {
  background: linear-gradient(180deg, rgba(238, 108, 77, 0.16), rgba(255, 255, 255, 0.02));
  border-color: rgba(238, 108, 77, 0.22);
}

.calendar-day.selected {
  outline: 2px solid var(--gold);
  outline-offset: -2px;
}

.day-number {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
}

.day-count {
  position: absolute;
  left: 8px;
  bottom: 8px;
  font-size: 0.7rem;
  color: var(--gold);
}

.calendar-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

.calendar-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  text-align: right;
}

.count-badge {
  min-width: 36px;
  text-align: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(231, 197, 108, 0.12);
  border: 1px solid rgba(231, 197, 108, 0.2);
}

.event-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 620px;
  overflow-y: auto;
  padding-right: 4px;
}

.event-card {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 18px;
  padding: 14px;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.event-card.active {
  border-color: rgba(231, 197, 108, 0.32);
  background: rgba(231, 197, 108, 0.08);
}

.event-card-head,
.event-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.event-card-head {
  margin-bottom: 10px;
}

.event-card-title {
  margin: 0;
  font-size: 1rem;
  line-height: 1.25;
}

.event-type {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.74rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
}

.event-date,
.event-location {
  font-size: 0.82rem;
  color: var(--muted);
}

.event-summary {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.9rem;
}

.stage {
  position: relative;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.stage-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 14px;
}

.headline-card,
.stats-card {
  padding: 18px 20px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.headline-card h2 {
  font-size: 1.8rem;
  margin-bottom: 8px;
}

.headline-card p,
.overlay-meta,
.modal-summary,
.modal-details {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.stats-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.stat-label {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stat strong {
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  font-size: 1.6rem;
}

.map-stage {
  position: relative;
  min-height: calc(100vh - 182px);
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

#map {
  width: 100%;
  height: 100%;
  min-height: calc(100vh - 182px);
  background:
    linear-gradient(180deg, rgba(7, 17, 27, 0.2), rgba(7, 17, 27, 0.75)),
    radial-gradient(circle at 50% 30%, rgba(115, 169, 255, 0.14), transparent 30%);
}

.map-overlay {
  position: absolute;
  z-index: 550;
  background: rgba(7, 17, 27, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 20px;
  padding: 14px 16px;
  backdrop-filter: blur(16px);
  max-width: 420px;
}

.map-overlay.top-left {
  top: 16px;
  left: 16px;
}

.map-overlay.bottom-left {
  bottom: 16px;
  left: 16px;
}

.overlay-label {
  margin: 0 0 8px;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.74rem;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  color: var(--muted);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.legend-dot.military {
  background: var(--orange);
}

.legend-dot.statement {
  background: var(--blue);
}

.legend-dot.diplomacy {
  background: var(--teal);
}

.legend-dot.shipping {
  background: var(--shipping);
}

.legend-dot.protest {
  background: var(--protest);
}

.leaflet-control-attribution {
  background: rgba(7, 17, 27, 0.8) !important;
  color: var(--muted) !important;
}

.leaflet-control-attribution a {
  color: #b7cfff !important;
}

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

.leaflet-tooltip {
  background: rgba(7, 17, 27, 0.92);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: none;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  background: rgba(3, 8, 12, 0.72);
  backdrop-filter: blur(10px);
  padding: 20px;
}

.hidden {
  display: none;
}

.modal-card {
  width: min(780px, 100%);
  max-height: min(88vh, 920px);
  background: var(--panel-strong);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 28px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.modal-scroll {
  padding: 28px;
  overflow-y: auto;
  max-height: min(88vh, 920px);
}

.close-button {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.4rem;
}

.modal-meta {
  margin: 12px 0 16px;
}

.modal-summary {
  font-size: 1.05rem;
  color: var(--text);
  margin-bottom: 14px;
}

.modal-details {
  margin-bottom: 18px;
}

.modal-quote {
  margin: 0 0 20px;
  padding: 14px 18px;
  border-left: 3px solid var(--gold);
  background: rgba(255, 255, 255, 0.03);
  color: #d5e0ea;
  font-size: 1rem;
}

.source-block h3 {
  margin-bottom: 10px;
}

.source-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  display: grid;
  gap: 8px;
}

.source-list li {
  line-height: 1.45;
}

.source-list a {
  color: #b8d1ff;
}

.production-note {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.production-note p {
  margin-top: 8px;
}

.map-country-label {
  background: transparent;
  border: none;
  box-shadow: none;
  color: rgba(244, 248, 251, 0.94);
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-shadow:
    0 1px 0 rgba(0, 0, 0, 0.7),
    0 0 10px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
  pointer-events: none;
}

.theme-military {
  color: var(--orange);
}

.theme-statement {
  color: var(--blue);
}

.theme-diplomacy {
  color: var(--teal);
}

.theme-shipping {
  color: var(--shipping);
}

.theme-protest {
  color: var(--protest);
}


/* Interactive state and control clarity */
:root {
  --control: rgba(255, 255, 255, 0.055);
  --control-hover: rgba(231, 197, 108, 0.12);
  --control-border: rgba(255, 255, 255, 0.12);
  --focus-ring: rgba(231, 197, 108, 0.42);
}

a {
  transition: color 140ms ease;
}

a:hover {
  color: #d9e5ff;
}

button,
select {
  color-scheme: dark;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.filter-pill {
  gap: 7px;
  background: rgba(231, 197, 108, 0.1);
  border-color: rgba(231, 197, 108, 0.2);
}

.filter-pill.empty {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  border-color: rgba(255, 255, 255, 0.06);
}

.filter-pill button {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin: -3px -5px -3px 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.filter-pill button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.12);
}

.ghost-button,
.icon-button,
.close-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-color: var(--control-border);
  background: var(--control);
  transition:
    transform 140ms ease,
    color 140ms ease,
    background 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease;
}

.ghost-button:hover,
.icon-button:hover,
.close-button:hover {
  transform: translateY(-1px);
  color: #fff7dc;
  background: var(--control-hover);
  border-color: rgba(231, 197, 108, 0.42);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

.ghost-button:active,
.icon-button:active,
.close-button:active {
  transform: translateY(0);
  background: rgba(231, 197, 108, 0.2);
}

.ghost-button:disabled,
.icon-button:disabled,
.close-button:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.ghost-button svg,
.icon-button svg,
.close-button svg,
.filter-pill svg {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}

.field:focus-within > span {
  color: var(--gold);
}

input,
select {
  border-color: var(--control-border);
  background: var(--control);
  transition:
    color 140ms ease,
    background 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease;
}

input:hover,
select:hover {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.075);
}

input:focus,
select:focus {
  border-color: rgba(231, 197, 108, 0.58);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 4px rgba(231, 197, 108, 0.08);
}

input.is-active,
select.is-active {
  border-color: rgba(231, 197, 108, 0.36);
  background: rgba(231, 197, 108, 0.09);
}

select option {
  background: #0d1c2c;
  color: var(--text);
}

.month-picker {
  display: block;
}

.month-picker select {
  width: 144px;
  min-height: 34px;
  padding: 5px 8px;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 700;
  text-align: center;
}

.weekday-row,
.calendar-grid {
  gap: 6px;
}

.calendar-day {
  min-width: 0;
  padding: 7px;
  border-radius: 10px;
  cursor: default;
  transition:
    transform 140ms ease,
    color 140ms ease,
    border-color 140ms ease,
    background 140ms ease,
    box-shadow 140ms ease;
}

.calendar-day:not(:disabled):hover {
  transform: translateY(-1px);
  background: rgba(238, 108, 77, 0.24);
  border-color: rgba(238, 108, 77, 0.56);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
}

.calendar-day:not(:disabled):active {
  transform: translateY(0);
}

.calendar-day.other-month {
  opacity: 0.22;
}

.calendar-day:disabled {
  color: rgba(238, 243, 247, 0.34);
  cursor: not-allowed;
}

.calendar-day.has-source-events:disabled::after {
  content: "";
  position: absolute;
  right: 7px;
  top: 7px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(238, 108, 77, 0.35);
}

.calendar-day.selected,
.calendar-day.selected:hover {
  color: #07111b;
  background: var(--gold);
  border-color: #f8dda0;
  box-shadow:
    0 0 0 3px rgba(231, 197, 108, 0.2),
    0 10px 22px rgba(0, 0, 0, 0.22);
}

.calendar-day.selected:hover {
  background: #f3d98e;
  border-color: #fff0c3;
}

.day-count {
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: rgba(231, 197, 108, 0.12);
  border: 1px solid rgba(231, 197, 108, 0.22);
  line-height: 1;
}

.calendar-day.selected .day-count {
  color: #3f3212;
  background: rgba(7, 17, 27, 0.1);
  border-color: rgba(7, 17, 27, 0.18);
  font-weight: 700;
}

.calendar-day.selected::after {
  content: "\2713";
  position: absolute;
  top: 6px;
  right: 6px;
  color: #3f3212;
  font-size: 0.68rem;
  font-weight: 700;
}

.date-status {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.date-status-mark {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(156, 176, 194, 0.55);
}

.calendar-footer.has-selection .date-status-mark {
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(231, 197, 108, 0.12);
}

.calendar-footer.has-selection .calendar-hint {
  color: var(--text);
  font-weight: 600;
}

.calendar-hint {
  text-align: left;
}

.event-card {
  width: 100%;
  color: var(--text);
  font: inherit;
  text-align: left;
}

.event-card:hover {
  transform: translateY(-1px);
  border-color: rgba(115, 169, 255, 0.32);
  background: rgba(115, 169, 255, 0.08);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.event-card:active {
  transform: translateY(0);
}

.event-card.active,
.event-card.active:hover {
  border-color: rgba(231, 197, 108, 0.5);
  background: rgba(231, 197, 108, 0.12);
  box-shadow: inset 3px 0 0 var(--gold);
}

.event-card:not(button) {
  cursor: default;
}

.event-card:not(button):hover {
  transform: none;
  border-color: rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.035);
  box-shadow: none;
}

.event-card-head {
  display: block;
}

.event-card-head::after {
  content: "";
  display: table;
  clear: both;
}

.event-type {
  float: right;
  max-width: 44%;
  margin: 0 0 6px 10px;
  text-align: center;
  overflow-wrap: anywhere;
}

.event-card-title {
  display: block;
}

.leaflet-bar a {
  color: var(--text);
  background: var(--panel-strong);
  border-bottom-color: var(--control-border);
  transition: color 140ms ease, background 140ms ease;
}

.leaflet-bar a:hover,
.leaflet-bar a:focus {
  color: #07111b;
  background: var(--gold);
}

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

@media (max-width: 1180px) {
  .page-shell {
    grid-template-columns: 340px 1fr;
  }

  .stage-header {
    grid-template-columns: 1fr;
  }

  .calendar-panel .panel-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .calendar-controls {
    width: 100%;
  }

  .month-picker {
    flex: 1;
  }

  .month-picker select {
    width: 100%;
  }
}

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

  .sidebar {
    max-height: none;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .map-stage,
  #map {
    min-height: 70vh;
  }
}

@media (max-width: 640px) {
  .sidebar,
  .stage {
    padding: 14px;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .calendar-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .map-overlay {
    max-width: calc(100% - 24px);
  }

  .map-overlay.top-left {
    top: 12px;
    left: 12px;
  }

  .map-overlay.bottom-left {
    bottom: 12px;
    left: 12px;
  }

  .modal-scroll {
    padding: 22px 18px 18px;
  }
}
