.monthly-trajectories {
  --monthly-navy: #153e61;
  --monthly-blue: #0878a8;
  --monthly-red: #dc2626;
  --monthly-light-blue: #eaf5fa;
  --monthly-border: #d8e4ec;
  --monthly-text: #243746;
  --monthly-muted: #5b6d7a;
  background: #f6f9fb;
  color: var(--monthly-text);
}

.monthly-trajectories *,
.monthly-trajectories *::before,
.monthly-trajectories *::after {
  box-sizing: border-box;
}

.monthly-container {
  width: min(1120px, calc(100% - 32px));
  margin-inline: auto;
}

.monthly-hero {
  position: relative;
  overflow: hidden;
  padding: 42px 0 46px;
  background:
    radial-gradient(circle at 88% 18%, rgba(97, 197, 230, 0.28), transparent 30%),
    linear-gradient(135deg, #0d3857 0%, #075d86 100%);
  color: #fff;
}

.monthly-eyebrow {
  margin: 0 0 10px;
  color: #bfeeff;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.monthly-hero h1 {
  max-width: 900px;
  margin: 0;
  color: #fff;
  font-size: clamp(2rem, 6vw, 3.25rem);
  line-height: 1.08;
}

.monthly-introduction {
  max-width: 850px;
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.94);
  font-size: clamp(1rem, 2.5vw, 1.16rem);
  line-height: 1.65;
}

.monthly-main {
  padding-block: 24px 50px;
}

.monthly-controls-card,
.monthly-map-section,
.monthly-education {
  border: 1px solid var(--monthly-border);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(21, 62, 97, 0.07);
}

.monthly-controls-card {
  margin-bottom: 22px;
  padding: 20px;
}

.monthly-controls-heading,
.monthly-map-heading {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.monthly-controls-heading h2,
.monthly-map-heading h2,
.monthly-education h2 {
  margin: 0;
  color: var(--monthly-navy);
}

.monthly-controls-heading p,
.monthly-map-heading p {
  margin: 5px 0 0;
  color: var(--monthly-muted);
}

.monthly-loading {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 8px;
  color: var(--monthly-blue);
  font-size: 0.9rem;
  font-weight: 700;
}

.monthly-loading[hidden] {
  display: none;
}

.monthly-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid #b9dce9;
  border-top-color: var(--monthly-blue);
  border-radius: 50%;
  animation: monthly-spin 0.8s linear infinite;
}

@keyframes monthly-spin {
  to { transform: rotate(360deg); }
}

.monthly-controls {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.monthly-field {
  min-width: 0;
}

.monthly-field label {
  display: block;
  margin-bottom: 6px;
  color: var(--monthly-navy);
  font-size: 0.86rem;
  font-weight: 800;
}

.monthly-field select {
  width: 100%;
  min-height: 46px;
  margin: 0;
  border: 1px solid #aebfcb;
  border-radius: 9px;
  padding: 9px 36px 9px 11px;
  background-color: #fff;
  color: #17384f;
  font: inherit;
}

.monthly-field select:focus,
.monthly-secondary-button:focus-visible,
.monthly-education a:focus-visible {
  outline: 3px solid rgba(8, 120, 168, 0.3);
  outline-offset: 2px;
}

.monthly-navigation {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.monthly-secondary-button {
  min-height: 42px;
  border: 1px solid #9eb5c5;
  border-radius: 9px;
  padding: 9px 13px;
  background: #fff;
  color: #174f78;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.monthly-secondary-button:hover:not(:disabled) {
  border-color: var(--monthly-blue);
  background: var(--monthly-light-blue);
}

.monthly-secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.monthly-map-section {
  position: relative;
  z-index: 0;
  isolation: isolate;
  overflow: hidden;
  margin-bottom: 22px;
}

.monthly-map-heading {
  padding: 20px;
}

.monthly-line-key {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 8px;
  color: #455d6c;
  font-size: 0.86rem;
  font-weight: 700;
}

.monthly-line-key #monthlyLineKeyColor {
  display: inline-block;
  width: 34px;
  border-top: 2px solid var(--monthly-blue);
  opacity: 0.65;
}

.monthly-map-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.monthly-map-size-controls {
  display: flex;
  gap: 8px;
}

.monthly-map-size-button {
  min-height: 36px;
  padding: 6px 10px;
  font-size: 0.82rem;
}

.monthly-map-shell {
  position: relative;
  z-index: 0;
  isolation: isolate;
  overflow: hidden;
  border-block: 1px solid var(--monthly-border);
  background: #dfe8ed;
}

.monthly-map {
  position: relative;
  z-index: 0;
  width: 100%;
  height: clamp(390px, 62vh, 660px);
}

.monthly-map:focus {
  outline: 3px solid var(--monthly-blue);
  outline-offset: -3px;
}

.monthly-map-message {
  position: absolute;
  z-index: 500;
  inset: auto 16px 16px;
  margin: 0;
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.monthly-status {
  min-height: 48px;
  margin: 0;
  padding: 14px 20px;
  color: #405765;
  font-size: 0.92rem;
}

.monthly-status[data-state="empty"] {
  color: #745b1d;
  background: #fffaf0;
}

.monthly-status[data-state="error"] {
  color: #8a2930;
  background: #fff3f4;
}

.monthly-education {
  padding: clamp(22px, 5vw, 38px);
  line-height: 1.7;
}

.monthly-education > p {
  max-width: 900px;
}

.monthly-explanations {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.monthly-explanations section {
  border-radius: 12px;
  padding: 18px;
  background: #f3f8fb;
}

.monthly-explanations h3,
.monthly-method-note h3 {
  margin: 0 0 8px;
  color: var(--monthly-navy);
}

.monthly-explanations p,
.monthly-method-note p {
  margin: 0;
}

.monthly-method-note {
  margin-top: 20px;
  border-left: 5px solid #dc8c27;
  border-radius: 8px;
  padding: 18px;
  background: #fff8eb;
}

.monthly-more {
  margin-top: 30px;
  border-top: 1px solid var(--monthly-border);
  padding-top: 24px;
}

.monthly-more h2 {
  font-size: 1.35rem;
}

.monthly-education a {
  color: #076a98;
  font-weight: 750;
  text-underline-offset: 2px;
}

.monthly-education code {
  border-radius: 4px;
  padding: 2px 5px;
  background: #e9f0f4;
  color: #25455b;
}

.monthly-trajectories .leaflet-container {
  z-index: 0;
  background: #e3eaee;
  font-family: inherit;
}

.monthly-trajectory-line {
  cursor: pointer;
}

.monthly-trajectory-popup .leaflet-popup-content-wrapper {
  border-radius: 10px;
  color: #17384f;
}

.monthly-trajectory-popup .leaflet-popup-content {
  margin: 13px 16px;
}

.monthly-trajectory-popup-content p {
  margin: 4px 0;
  line-height: 1.45;
}

.monthly-trajectory-popup-content .monthly-trajectory-popup-title {
  margin-bottom: 8px;
  color: var(--monthly-navy);
  font-weight: 800;
}

.monthly-map-watermark {
  max-width: min(330px, calc(100vw - 120px));
  margin: 10px !important;
  border-radius: 10px;
  padding: 8px 11px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.24);
  color: #17384f;
  font-family: system-ui, sans-serif;
  font-size: 0.84rem;
  font-weight: 750;
  line-height: 1.3;
  pointer-events: none;
}

.monthly-map-brand {
  position: absolute !important;
  z-index: 700;
  top: 12px;
  left: 50%;
  margin: 0 !important;
  transform: translateX(-50%);
  background: transparent;
  color: #fff;
  font-family: system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
  pointer-events: none;
}

@media (min-width: 700px) {
  .monthly-container {
    width: min(1120px, calc(100% - 48px));
  }

  .monthly-controls-heading,
  .monthly-map-heading {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
  }

  .monthly-controls {
    grid-template-columns: 1.35fr repeat(3, minmax(0, 1fr));
  }

  .monthly-explanations {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 769px) {
  .monthly-map-actions {
    align-items: flex-end;
  }
}

@media (max-width: 768px) {
  .monthly-map-size-controls {
    display: none;
  }

  .monthly-map-watermark {
    max-width: 230px;
    padding: 6px 8px;
    font-size: 0.72rem;
  }

  .monthly-map-brand {
    top: 48px;
    left: auto;
    right: 12px;
    transform: none;
    font-size: 0.82rem;
  }
}

@media (max-width: 480px) {
  .monthly-container {
    width: min(100% - 20px, 1120px);
  }

  .monthly-hero {
    padding: 32px 0 36px;
  }

  .monthly-main {
    padding-top: 14px;
  }

  .monthly-controls-card,
  .monthly-map-section,
  .monthly-education {
    border-radius: 12px;
  }

  .monthly-controls-card,
  .monthly-map-heading {
    padding: 16px;
  }

  .monthly-navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .monthly-secondary-button {
    padding-inline: 8px;
    font-size: 0.86rem;
  }

  .monthly-map {
    height: 430px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .monthly-spinner {
    animation-duration: 1.8s;
  }
}
