:root {
  color-scheme: light;
  --bg: #eef3f9;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --border: #d2dceb;
  --accent: #1d4f91;
  --accent-strong: #0f2f5b;
  --canada-red: #c8102e;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.app-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  height: 100%;
}

.mobile-splitter {
  display: none;
}

.sidebar {
  border-right: 1px solid #163d73;
  background: linear-gradient(180deg, #0b2f5b 0%, #0a274a 100%);
  padding: 0.62rem;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  color: #eef5ff;
}

.sidebar::before {
  content: '';
  position: sticky;
  top: 0;
  display: block;
  height: 0;
}


.sidebar {
  scrollbar-width: thin;
  scrollbar-color: rgba(157, 196, 242, 0.75) rgba(8, 34, 67, 0.55);
}

.sidebar::-webkit-scrollbar {
  width: 9px;
}

.sidebar::-webkit-scrollbar-track {
  background: rgba(8, 34, 67, 0.55);
  border-radius: 999px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(168, 203, 246, 0.9), rgba(95, 149, 214, 0.92));
  border-radius: 999px;
  border: 2px solid rgba(8, 34, 67, 0.65);
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(189, 218, 252, 0.98), rgba(120, 171, 231, 0.98));
}

.sidebar-header {
  background: linear-gradient(145deg, #102f59 0%, #1a4f8f 100%);
  border-radius: 0.75rem;
  color: #ffffff;
  padding: 0.62rem 0.68rem;
  margin-bottom: 0.56rem;
  box-shadow: 0 8px 18px rgba(8, 44, 92, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.sidebar-header h1 {
  margin: 0 0 0.3rem;
  font-size: 1.08rem;
  line-height: 1.1;
  letter-spacing: 0.01em;
}

.sidebar-header p {
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.75rem;
  line-height: 1.25;
  font-weight: 600;
}



.sidebar-header {
  position: static;
}

.toolbar {
  position: static;
  z-index: 3;
  background: #123665;
  backdrop-filter: none;
  padding: 0.32rem;
  border: 1px solid #2e5e9a;
  border-radius: 0.65rem;
  isolation: isolate;
}

.toolbar,
.tour-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.38rem;
  margin: 0.45rem 0 0;
}

.toolbar {
  grid-template-columns: 1fr;
}

button,
select {
  border: 1px solid #4f79ad;
  border-radius: 0.55rem;
  padding: 0.36rem 0.5rem;
  font: inherit;
  font-size: 0.8rem;
  background: #103761;
  color: #eef5ff;
}

button {
  cursor: pointer;
  font-weight: 650;
}

#prevStopBtn,
#nextStopBtn {
  padding: 0.28rem 0.48rem;
  font-size: 0.75rem;
  line-height: 1.1;
}

#languageSelect,
#tourModeSelect {
  min-height: 1.9rem;
  padding-top: 0.28rem;
  padding-bottom: 0.28rem;
  font-size: 0.75rem;
}

button:hover,
button:focus-visible,
select:focus-visible {
  border-color: #89b5ef;
  box-shadow: 0 0 0 3px rgba(136, 181, 239, 0.24);
  outline: none;
}

#nextStopBtn {
  background: #0b5cab;
  color: #ffffff;
  border-color: #0b5cab;
}

#nextStopBtn:hover {
  background: #084f95;
}

nav {
  margin-top: 0.3rem;
  position: relative;
  z-index: 1;
}

.stop-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}

.stop-item {
  border: 1px solid #9fc3f0;
  border-radius: 0.62rem;
  padding: 0.34rem 0.46rem;
  background: #d3e3fd;
  box-shadow: 0 4px 10px rgba(6, 20, 40, 0.18);
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.stop-item:hover {
  transform: translateY(-1px);
  border-color: #6fa5e8;
  background: #f5f9ff;
  box-shadow: 0 10px 22px rgba(6, 20, 40, 0.26);
}

.stop-item.active {
  border-color: #2d69b0;
  box-shadow: 0 0 0 2px rgba(45, 105, 176, 0.2);
  background: #e9f2ff;
}

.stop-item button {
  all: unset;
  cursor: pointer;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.55rem;
  align-items: center;
  width: 100%;
}

.stop-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.6rem;
  height: 1.6rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #f1f7ff;
  background: #20589a;
  border: 1px solid #7eaeea;
}

.stop-content {
  min-width: 0;
}

.stop-title {
  display: block;
  font-weight: 700;
  color: #0d4e95;
  font-size: 0.82rem;
  line-height: 1.2;
}


.stop-item.active .stop-number {
  background: #0b5cab;
  color: #ffffff;
  border-color: #0b5cab;
}


.discover-section-title {
  list-style: none;
  color: #d8e9ff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin: 0.25rem 0 0.1rem;
}

.discover-item {
  list-style: none;
  border: 1px solid #9fc3f0;
  border-radius: 0.62rem;
  padding: 0.34rem 0.46rem;
  background: #d3e3fd;
  box-shadow: 0 4px 10px rgba(6, 20, 40, 0.18);
}

.discover-item.active {
  border-color: #2d69b0;
  box-shadow: 0 0 0 2px rgba(45, 105, 176, 0.2);
  background: #e9f2ff;
}

.discover-item > button {
  all: unset;
  cursor: pointer;
  display: block;
  width: 100%;
  color: #0d4e95;
  font-size: 0.8rem;
  line-height: 1.25;
  font-weight: 650;
}

.discover-question {
  margin: 0 0 0.28rem;
  color: #0d4e95;
  font-size: 0.79rem;
  line-height: 1.25;
  font-weight: 650;
}

.discover-actions {
  display: grid;
  gap: 0.14rem;
}

.discover-link {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border: 1px solid #3f76b5;
  border-radius: 0.45rem;
  padding: 0.24rem 0.38rem;
  background: #f7fbff;
  color: #0b4e96;
  font-size: 0.72rem;
  line-height: 1.15;
  font-weight: 650;
  text-decoration: none;
}

.discover-link:hover,
.discover-link:focus-visible {
  background: #e9f2ff;
  border-color: #2d69b0;
  box-shadow: 0 0 0 2px rgba(45, 105, 176, 0.18);
  outline: none;
}

.map-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: #e9eef7;
  position: relative;
}

.details-panel {
  background: linear-gradient(145deg, #0f3767 0%, #0a4e95 66%, #0f3767 100%);
  border-bottom: 1px solid #0c3f77;
  padding: 0.42rem 0.95rem 0.46rem;
  color: #f8fbff;
  position: relative;
  overflow: hidden;
}

.details-panel::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 4px;
  width: 100%;
  background: transparent;
}


.details-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.open-stop-modal {
  width: 1.7rem;
  height: 1.7rem;
  padding: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #f8fbff;
  border-color: rgba(255, 255, 255, 0.36);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
}

.open-stop-modal:hover,
.open-stop-modal:focus-visible {
  background: rgba(255, 255, 255, 0.26);
  border-color: rgba(255, 255, 255, 0.72);
}

.details-panel h2 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0.01em;
}

.stop-modal {
  position: fixed;
  right: 1rem;
  top: 4.2rem;
  width: min(260px, calc(100% - 2rem));
  max-height: calc(100vh - 5rem);
  z-index: 1200;
  background: rgba(10, 40, 78, 0.97);
  border: 1px solid rgba(145, 191, 241, 0.46);
  border-radius: 0.8rem;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.35);
  padding: 0.5rem 0.6rem 0.6rem;
}

.close-stop-modal {
  margin-left: auto;
  display: block;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 999px;
  line-height: 1;
  font-size: 1.1rem;
  padding: 0;
  background: rgba(255, 255, 255, 0.12);
  color: #f8fbff;
  border-color: rgba(255, 255, 255, 0.4);
}

.details-description {
  width: 100%;
  padding: 0.45rem 0.55rem;
  border-radius: 0.58rem;
  background: rgba(4, 21, 43, 0.42);
  border: 1px solid rgba(176, 211, 247, 0.32);
  max-height: calc(100vh - 8.5rem);
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(166, 204, 249, 0.82) rgba(5, 27, 54, 0.5);
}

.details-description::-webkit-scrollbar {
  width: 8px;
}

.details-description::-webkit-scrollbar-track {
  background: rgba(5, 27, 54, 0.5);
  border-radius: 999px;
}

.details-description::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(183, 216, 252, 0.96), rgba(115, 168, 232, 0.96));
  border-radius: 999px;
  border: 1px solid rgba(5, 27, 54, 0.62);
}

.details-description::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(204, 229, 255, 0.98), rgba(134, 184, 241, 0.98));
}

.details-description p {
  margin: 0;
  line-height: 1.35;
  white-space: pre-line;
  font-size: 0.88rem;
  color: rgba(243, 248, 255, 0.95);
}


#map {
  width: 100%;
  height: 100%;
  min-height: 420px;
}

.map-error {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  max-width: 340px;
  background: #fff4f4;
  border: 1px solid #f3b5b5;
  border-radius: 0.75rem;
  padding: 0.75rem 0.9rem;
  color: #5f1515;
}

.hidden {
  display: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 940px) {
  .app-layout {
    grid-template-columns: 1fr;
    grid-template-rows: var(--mobile-sidebar-size, 46vh) 0.85rem minmax(0, 1fr);
  }

  .sidebar {
    max-height: none;
    min-height: 12rem;
  }

  .mobile-splitter {
    display: block;
    position: relative;
    cursor: row-resize;
    touch-action: none;
    background: linear-gradient(180deg, #9ab6dd 0%, #c4d8f2 100%);
    border-top: 1px solid #6f8eb6;
    border-bottom: 1px solid #6f8eb6;
  }

  .mobile-splitter::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 3.2rem;
    height: 0.24rem;
    border-radius: 999px;
    background: rgba(16, 47, 89, 0.62);
  }

  .sidebar-header h1 {
    font-size: 1.25rem;
  }


  .stop-modal {
    top: 3.7rem;
    right: 0.65rem;
    width: calc(100% - 1.3rem);
    max-height: calc(100vh - 4.5rem);
  }

  .details-description {
    max-height: calc(100vh - 4.5rem);
  }
}


.sidebar-copyright {
  margin-top: 0.7rem;
  padding: 0.55rem 0.6rem;
  border-top: 1px solid rgba(185, 214, 248, 0.35);
  color: rgba(230, 242, 255, 0.9);
  font-size: 0.72rem;
  line-height: 1.35;
}

.sidebar-copyright p {
  margin: 0;
}

.sidebar-copyright p + p {
  margin-top: 0.2rem;
}

.sidebar-copyright a {
  color: #b9d7ff;
  text-decoration: none;
}

.sidebar-copyright a:hover,
.sidebar-copyright a:focus-visible {
  text-decoration: underline;
}
