@font-face {
  font-family: "Roboto Map";
  src: url("fonts/roboto-400.woff") format("woff");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Roboto Map";
  src: url("fonts/roboto-700.woff") format("woff");
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --forest: #026b3a;
  --deep: #063c28;
  --yellow: #ffd613;
  --ink: #163229;
}

* { box-sizing: border-box; }

html,
body { background: var(--deep); }

body {
  margin: 0;
  min-width: 320px;
  color: #eef7f2;
  font-family: "Roboto Map", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body::selection {
  color: var(--deep);
  background: var(--yellow);
}

button,
svg { font-family: inherit; }

.workspace {
  width: min(100%, 1720px);
  margin: auto;
  padding: 24px clamp(16px, 3vw, 48px) 48px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 10px;
}

.toolbar-copy { display: grid; gap: 3px; }
.toolbar-copy strong { color: #fff; font-size: 16px; }
.toolbar-copy span,
.status { color: #d8eee4; font-size: 12.5px; }

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.export-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 10px 15px;
  border: 1px solid rgb(255 255 255 / 42%);
  border-radius: 7px;
  color: #fff;
  background: transparent;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background .18s ease-out, color .18s ease-out, border-color .18s ease-out, transform .18s ease-out;
}

.export-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentcolor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.export-button--primary {
  color: var(--deep);
  border-color: var(--yellow);
  background: var(--yellow);
}

.export-button:hover:not(:disabled) {
  color: var(--deep);
  border-color: #fff;
  background: #fff;
  transform: translateY(-1px);
}

.export-button:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
}

.export-button:disabled { cursor: wait; opacity: .5; }

.status {
  min-height: 17px;
  margin: 0 0 10px;
  text-align: right;
}

.canvas-frame {
  aspect-ratio: 4 / 3;
  width: 100%;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 70%);
  background: #fff;
  color: var(--ink);
  box-shadow: 0 18px 52px rgb(0 20 13 / 28%);
}

#tourMap { display: block; width: 100%; height: 100%; }

#tourMap text {
  font-family: "Roboto Map", Roboto, Arial, sans-serif;
  font-variant-numeric: tabular-nums;
  text-rendering: geometricprecision;
}

#tourMap .visit-target,
#tourMap .visit-row,
#tourMap .profile-target { cursor: pointer; }

#tourMap .row-ground,
#tourMap .target-ring,
#tourMap .photo-badge,
#tourMap .photo-badge-text,
#tourMap .photo-leader,
#tourMap .route-center {
  transition: fill .18s ease-out, stroke .18s ease-out, stroke-width .18s ease-out, opacity .18s ease-out;
}

#tourMap .visit-row:hover .row-ground,
#tourMap .visit-row:focus .row-ground,
#tourMap .visit-row.is-active .row-ground {
  fill: #fff9d8;
  stroke: #e5c000;
}

#tourMap .visit-target:hover .target-ring,
#tourMap .visit-target:focus .target-ring,
#tourMap .visit-target.is-active .target-ring,
#tourMap .profile-target:hover .profile-ring,
#tourMap .profile-target:focus-visible .profile-ring,
#tourMap .profile-target.is-active .profile-ring {
  fill: var(--yellow);
  stroke: var(--deep);
  stroke-width: 4px;
}

#tourMap .visit-target:hover .photo-badge,
#tourMap .visit-target:focus .photo-badge,
#tourMap .visit-target.is-active .photo-badge { fill: var(--yellow); }

#tourMap .visit-target:hover .photo-badge-text,
#tourMap .visit-target:focus .photo-badge-text,
#tourMap .visit-target.is-active .photo-badge-text { fill: var(--deep); }

#tourMap .photo-leader.is-active {
  stroke: var(--yellow);
  stroke-width: 3px;
  opacity: 1;
}

#tourMap .route-leg.is-active .route-center {
  stroke: var(--yellow);
  stroke-width: 7px;
  stroke-dasharray: 11 10;
  animation: route-pulse .8s linear infinite;
}

@keyframes route-pulse { to { stroke-dashoffset: -21; } }

.mobile-view-button { display: none; }

::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--deep); }
::-webkit-scrollbar-thumb {
  border: 3px solid var(--deep);
  border-radius: 12px;
  background: var(--yellow);
}

@media (max-width: 820px) {
  .workspace { padding: 14px 10px 24px; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .toolbar-actions { justify-content: stretch; }
  .export-button { flex: 1 1 240px; }
  .mobile-view-button { display: inline-flex; }
  .status { text-align: left; }
  .canvas-frame { box-shadow: 0 10px 28px rgb(0 20 13 / 22%); }
  .canvas-frame.is-exploring {
    height: min(68vh, 680px);
    aspect-ratio: auto;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-color: var(--yellow) var(--deep);
  }
  .canvas-frame.is-exploring #tourMap {
    width: 900px;
    height: 675px;
    max-width: none;
  }
}

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