#rs-wrapper,
#rs-wrapper * {
  box-sizing: border-box;
}

#rs-wrapper {
  --rs-bg: #f6f8fb;
  --rs-panel: #ffffff;
  --rs-text: #152033;
  --rs-muted: #647084;
  --rs-line: #dce3ee;
  --rs-primary: #176b87;
  --rs-primary-dark: #0f5268;
  --rs-accent: #d8563f;
  --rs-soft: #edf7fa;
  width: 100%;
  margin: 0 auto;
  padding: clamp(16px, 3vw, 30px);
  color: var(--rs-text);
  background: var(--rs-bg);
  border: 1px solid var(--rs-line);
  border-radius: 8px;
  font-family: inherit;
}

.rs-course-map__header {
  margin-bottom: 18px;
}

.rs-course-map__eyebrow {
  margin: 0 0 4px;
  color: var(--rs-primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rs-course-map__header h2 {
  margin: 0;
  color: var(--rs-text);
  font-size: clamp(24px, 3vw, 38px);
  font-weight: 750;
  line-height: 1.08;
}

.rs-filters {
  display: grid;
  grid-template-columns:
    minmax(220px, 1fr) minmax(170px, 230px) minmax(170px, 230px)
    auto;
  align-items: end;
  gap: 12px;
  padding: 14px;
  margin-bottom: 14px;
  background: var(--rs-panel);
  border: 1px solid var(--rs-line);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(21, 32, 51, 0.06);
}

.rs-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.rs-field--wide {
  grid-column: auto;
}

.rs-field span {
  color: var(--rs-muted);
  font-size: 12px;
  font-weight: 700;
}

.rs-field input,
.rs-field select {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  color: var(--rs-text);
  background: #fbfcfe;
  border: 1px solid var(--rs-line);
  border-radius: 6px;
  font: inherit;
  outline: none;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.rs-field input:focus,
.rs-field select:focus {
  background: #ffffff;
  border-color: var(--rs-primary);
  box-shadow: 0 0 0 3px rgba(23, 107, 135, 0.14);
}

.rs-filter-actions {
  display: flex;
  align-items: end;
  gap: 10px;
}

.rs-btn {
  min-height: 44px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 6px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.rs-btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.rs-btn:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.rs-btn--primary {
  color: #ffffff;
  background: var(--rs-primary);
  border-color: var(--rs-primary);
  box-shadow: 0 8px 18px rgba(23, 107, 135, 0.22);
}

.rs-btn--primary:hover:not(:disabled) {
  background: var(--rs-primary-dark);
}

.rs-btn--ghost {
  color: var(--rs-primary);
  background: var(--rs-soft);
  border-color: #cde8ef;
}

.rs-status {
  min-height: 20px;
  margin: 0 0 10px;
  color: var(--rs-muted);
  font-size: 14px;
}

.rs-status--error {
  color: var(--rs-accent);
  font-weight: 700;
}

.rs-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  gap: 16px;
  align-items: start;
}

.rs-map-panel,
.rs-list-panel {
  min-width: 0;
  background: var(--rs-panel);
  border: 1px solid var(--rs-line);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(21, 32, 51, 0.06);
}

.rs-map-panel {
  position: sticky;
  top: 20px;
  overflow: hidden;
}

#rs-map {
  width: 100%;
  min-height: 620px;
  background: #e8eef4;
}

#rs-map img {
  max-width: none;
}

.rs-list-panel {
  padding: 14px;
}

.rs-list-panel__top {
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--rs-line);
}

.rs-list-panel__top h3 {
  margin: 0;
  font-size: 17px;
}

#rs-list {
  display: grid;
  gap: 12px;
  max-height: 558px;
  overflow: auto;
  padding-right: 4px;
}

.rs-item {
  display: grid;
  gap: 10px;
  padding: 14px;
  background: #ffffff;
  border: 1px solid var(--rs-line);
  border-radius: 8px;
  cursor: pointer;
  outline: none;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.rs-item:hover,
.rs-item:focus {
  border-color: rgba(23, 107, 135, 0.5);
  box-shadow: 0 12px 24px rgba(21, 32, 51, 0.1);
  transform: translateY(-2px);
}

.rs-item__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.rs-badge,
.rs-time {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.1;
}

.rs-badge {
  color: var(--rs-primary-dark);
  background: var(--rs-soft);
}

.rs-time {
  color: #7a3327;
  background: #fff0ed;
}

.rs-item h4 {
  margin: 0;
  color: var(--rs-text);
  font-size: 18px;
  line-height: 1.25;
}

.rs-location {
  margin: 4px 0 0;
}

.rs-class-day {
  margin: 4px 0 0;
  color: var(--rs-text);
  font-size: 13px;
  text-transform: lowercase !important;
}

.rs-class-day + .rs-class-day {
  display: inline-block;
  margin: 0 0 0;
}

.rs-class-day span {
  color: var(--rs-muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.45;
  text-transform: capitalize !important;
}

.rs-item dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.rs-item dl div {
  min-width: 0;
}

.rs-item dt {
  color: var(--rs-muted);
  font-size: 11px;
  font-weight: 750;
}

.rs-item dd {
  margin: 2px 0 0;
  color: var(--rs-text);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.rs-empty {
  display: grid;
  gap: 6px;
  padding: 24px;
  text-align: center;
  background: #fbfcfe;
  border: 1px dashed var(--rs-line);
  border-radius: 8px;
}

.rs-empty strong {
  color: var(--rs-text);
}

.rs-empty span {
  color: var(--rs-muted);
  font-size: 14px;
}

.rs-map-marker {
  display: grid;
  place-items: center;
}

.rs-map-marker span {
  width: 20px;
  height: 20px;
  background: var(--rs-primary);
  border: 3px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 4px 16px rgba(15, 82, 104, 0.35);
}

.gm-style .gm-style-iw-c {
  padding: 0;
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(21, 32, 51, 0.22);
}

.gm-style .gm-style-iw-chr {
  position: absolute !important;
  top: 0 !important;
  right: 0 !important;
  z-index: 10;
  min-height: 0 !important;
}

.gm-style .gm-style-iw-d {
  overflow: auto !important;
}

.gm-style .gm-ui-hover-effect {
  position: absolute !important;
  top: 6px !important;
  right: 6px !important;
  width: 28px !important;
  height: 28px !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  background: var(--rs-primary-dark) !important;
  border-radius: 50% !important;
  box-shadow: 0 4px 14px rgba(21, 32, 51, 0.14);
  opacity: 1;
  z-index: 11;
}

.gm-style .gm-ui-hover-effect span {
  display: none !important;
}

.gm-style .gm-ui-hover-effect::before {
  content: "\f00d";
  color: #fff;
  font-family: FontAwesome;
  font-size: 14px;
  line-height: 1;
}

.rs-popup {
  width: min(280px, 68vw);
  max-width: calc(100vw - 76px);
  padding: 16px;
  padding-top: 20px;
  background: #ffffff;
  border-top: 4px solid var(--rs-primary);
  font-family: inherit;
  overflow: hidden;
}

.rs-popup__head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  padding-right: 30px;
}

.rs-popup__badge,
.rs-popup__time {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.1;
  white-space: normal;
}

.rs-popup__badge {
  color: var(--rs-primary-dark);
  background: var(--rs-soft);
}

.rs-popup__time {
  color: #7a3327;
  background: #fff0ed;
}

.rs-popup h5 {
  margin: 0 0 8px;
  color: var(--rs-text);
  font-size: 17px;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.rs-popup__location {
  margin: 0 0 12px;
  color: var(--rs-muted);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.rs-popup__class_day {
  margin: 0 0 0;
  color: var(--rs-text);
  font-size: 12px;
  text-transform: lowercase !important;
}

.rs-popup__class_day + .rs-popup__class_day {
  display: inline-block;
  margin: 0 0 12px;
}

.rs-popup__class_day span {
  color: var(--rs-muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.45;
  text-transform: capitalize !important;
}

.rs-popup__meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--rs-line);
}

.rs-popup__meta span {
  min-width: 0;
  color: var(--rs-text);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.rs-popup__meta b {
  display: block;
  margin-bottom: 2px;
  color: var(--rs-muted);
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 700;
}

#rs-wrapper.is-loading .rs-layout {
  opacity: 0.72;
}

@media (max-width: 1024px) {
  .rs-filters {
    grid-template-columns:
      minmax(0, 1fr) minmax(170px, 230px) minmax(170px, 230px)
      auto;
  }

  .rs-layout {
    grid-template-columns: 1fr;
  }

  .rs-map-panel {
    position: relative;
    top: auto;
  }

  #rs-map {
    min-height: 460px;
  }

  #rs-list {
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 640px) {
  #rs-wrapper {
    padding: 14px;
    border-radius: 0;
    border-right: 0;
    border-left: 0;
  }

  .rs-course-map__header {
    margin-bottom: 14px;
  }

  .rs-filters {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .rs-filter-actions {
    display: block;
  }

  .rs-filter-actions .rs-btn {
    width: 100%;
  }

  #rs-map {
    min-height: 360px;
  }

  .rs-list-panel {
    padding: 12px;
  }

  .rs-item__top {
    align-items: flex-start;
    flex-direction: column;
  }

  .rs-time {
    align-self: flex-start;
  }

  .rs-item dl {
    grid-template-columns: 1fr;
  }

  .rs-popup {
    width: min(230px, calc(100vw - 92px));
    padding: 14px;
    padding-top: 18px;
  }

  .rs-popup h5 {
    font-size: 15px;
  }

  .rs-popup__head {
    gap: 6px;
    padding-right: 28px;
  }

  .rs-popup__badge,
  .rs-popup__time {
    max-width: 100%;
    font-size: 10px;
  }

  .rs-popup__meta {
    grid-template-columns: 1fr;
  }
}
