:root {
  color-scheme: light; font-family: Inter, "Segoe UI", sans-serif;
  --ink: #192a30; --muted: #526269; --paper: #f5f4ef;
  --panel: #fffefa; --border: #dcded6; --route: #f7894c; --accent: #9b3917;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); }
button { font: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible, summary:focus-visible, .viewport:focus-visible { outline: 2px solid #cd5c2e; outline-offset: 3px; }
.hero, main { width: min(100% - 64px, 1512px); margin-inline: auto; }
.hero { display: flex; justify-content: space-between; align-items: end; padding: 30px 3px 24px; gap: 16px; }
.location { display: flex; align-items: center; gap: 8px; margin: 0 0 7px; font-size: .79rem; font-weight: 700; text-transform: uppercase; letter-spacing: .16em; }
.location span { width: 8px; height: 8px; background: #c45b36; transform: rotate(45deg); }
h1, h2, p { margin: 0; }
h1 { font-family: Georgia, serif; font-size: clamp(2.8rem, 7vw, 5rem); line-height: 1; font-weight: 500; letter-spacing: -.065em; }
.subtitle { margin-top: 10px; color: var(--muted); font-size: 1rem; }
.subtitle span { margin-inline: 6px; color: #9b3917; }
.summit-stat { display: grid; gap: 4px; padding-bottom: 1px; text-align: right; white-space: nowrap; }
.summit-stat strong { font-family: Georgia, serif; font-weight: 500; font-size: clamp(1.6rem, 4vw, 2.8rem); line-height: 1; font-variant-numeric: lining-nums tabular-nums; }
.summit-stat strong span { font-size: .56em; }
.summit-stat > span { color: var(--muted); font-size: .8rem; }
.atlas { display: grid; grid-template-columns: minmax(0, 1fr) 342px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.map-panel { min-width: 0; }
.map-toolbar { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 9px 13px; background: #202d32; color: #fff; }
.views, .layers { display: flex; gap: 3px; padding: 2px; border-radius: 6px; }
.layers { background: #101c20; }
.map-toolbar button { border: 0; border-radius: 5px; background: transparent; color: #d9e0e0; padding: 8px 10px; font-size: .84rem; }
.map-toolbar button:hover { background: #34484f; }
.map-toolbar button[aria-pressed="true"] { background: #e9e9df; color: #203139; }
.viewport {
  position: relative; height: clamp(400px, 56vh, 760px); overflow: hidden;
  background: radial-gradient(ellipse at 50% 40%, #526a75 0%, #293e49 56%, #172730 100%);
  cursor: grab; touch-action: none;
}
.viewport.dragging { cursor: grabbing; }
.viewport:fullscreen { height: 100%; }
.scene, .markers { position: absolute; inset: 0; }
.scene canvas { display: block; width: 100%; height: 100%; }
.markers { pointer-events: none; }
.marker { --dot: #ffe1a6; position: absolute; transform: translate(-50%, -50%); display: grid; place-items: center; padding: 0; width: 29px; height: 29px; border: 0; color: white; background: none; pointer-events: auto; }
.marker[hidden] { display: none; }
.marker::before { content: ""; display: block; width: 9px; height: 9px; border-radius: 50%; background: var(--dot); box-shadow: 0 0 0 2px #192a30, 0 0 0 3px #fff7; }
.marker.landmark::before { width: 7px; height: 7px; border-radius: 1px; transform: rotate(45deg); }
.marker.summit::before, .marker.selected::before { width: 12px; height: 12px; background: #fc8456; }
.marker.selected { z-index: 3; }
.marker-label {
  position: absolute; left: 19px; top: 12px; transform: translateY(-100%); white-space: nowrap;
  padding: 4px 7px; border-radius: 3px; background: #192a30ee; color: #fff; font-size: .74rem; font-weight: 650; box-shadow: 0 2px 8px #0004; pointer-events: none;
}
.marker.label-hidden .marker-label { visibility: hidden; }
.marker:hover .marker-label, .marker:focus-visible .marker-label, .marker.selected .marker-label { visibility: visible; }
.marker.label-left .marker-label { right: 18px; left: auto; }
/* Keep the watermark in the viewport when the terrain or camera changes. */
.map-watermark {
  position: absolute;
  inset: 15px auto auto 15px;
  z-index: 2;
  display: block;
  width: clamp(68px, 10vw, 88px);
  height: auto;
  aspect-ratio: 867 / 357;
  object-fit: fill;
  opacity: .76;
  filter: brightness(0) invert(1) drop-shadow(0 1px 2px #14252c);
  pointer-events: none;
  user-select: none;
}
.orientation { position: absolute; inset: 15px 15px auto auto; display: grid; justify-items: center; gap: 4px; font-size: .76rem; font-weight: 700; color: #fff; pointer-events: none; }
.compass { display: grid; place-items: center; width: 37px; height: 37px; border-radius: 50%; border: 1px solid #ffffff60; background: #172730d9; }
.compass span { width: 12px; height: 24px; background: linear-gradient(#ff9a68 50%, #e5ecec 50%); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.map-actions { position: absolute; right: 14px; bottom: calc(var(--map-note-height, 28px) + 9px); display: grid; background: #172730eb; border: 1px solid #ffffff60; border-radius: 6px; overflow: hidden; }
.map-actions button { width: 38px; height: 36px; color: white; background: transparent; border: 0; font-size: 1.22rem; line-height: 1; }
.map-actions button + button { border-top: 1px solid #ffffff42; }
.map-actions button:hover { background: #405860; }
.map-actions button:focus-visible { outline-offset: -3px; }
.map-note { position: absolute; bottom: 0; inset-inline: 0; display: flex; justify-content: space-between; gap: 4px 12px; flex-wrap: wrap; padding: 7px 13px; background: #15252de8; color: #e4ecec; font-size: .72rem; pointer-events: none; }
.map-status { position: absolute; top: 48%; left: 50%; transform: translate(-50%,-50%); width: min(90%, 340px); text-align: center; color: white; background: #16262dea; padding: 14px; border-radius: 7px; cursor: auto; }
.route-panel { border-left: 1px solid var(--border); padding: 21px 19px; min-width: 0; }
.route-header { padding: 0 6px 11px; }
.route-header h2 { font-family: Georgia, serif; font-size: 1.58rem; font-weight: 500; letter-spacing: -.025em; }
.route-header p { margin-top: 4px; color: var(--muted); font-size: .86rem; }
.landmarks { list-style: none; margin: 0; padding: 0; }
.landmarks li { position: relative; }
.landmarks li:not(:last-child)::after { content: ""; position: absolute; left: 13px; top: 26px; width: 1px; height: calc(100% - 14px); background: #d4c8bb; pointer-events: none; }
.landmark-row {
  width: 100%; display: grid; grid-template-columns: 15px minmax(0, 1fr) auto; gap: 8px; align-items: center;
  color: var(--ink); background: none; border: 0; border-radius: 5px; text-align: left; padding: 8px 8px 8px 7px; min-height: 36px; font-size: .9rem;
}
.landmark-row:hover, .landmark-row[aria-pressed="true"] { background: #f9e9dd; }
.landmark-row[aria-pressed="true"] { color: #863716; }
.landmark-row .symbol { width: 9px; height: 9px; z-index: 1; margin-left: 2px; border: 2px solid #ab532f; background: var(--panel); border-radius: 50%; }
.landmark-row.landmark .symbol { width: 7px; height: 7px; margin-left: 3px; border-radius: 1px; transform: rotate(45deg); }
.landmark-row.summit .symbol, .landmark-row[aria-pressed="true"] .symbol { background: #ab532f; }
.landmark-row .elevation { color: var(--muted); font-size: .81rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.detail { border-top: 1px solid var(--border); margin-top: 13px; padding: 13px 6px 0; }
.detail h3 { font-size: .98rem; margin: 0 0 5px; }
.detail p { font-size: .87rem; line-height: 1.45; color: var(--muted); }
.detail .detail-source { color: var(--accent); font-size: .77rem; margin-top: 6px; }
.profile-section { padding: 14px 16px 12px; }
.profile-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; }
.profile-head h2 { font-size: 1rem; font-weight: 650; }
.profile-head span { color: var(--muted); font-size: .78rem; }
.profile { position: relative; height: 112px; margin-top: 9px; }
.profile svg { display: block; width: 100%; height: 100%; overflow: visible; }
.profile .gridline { stroke: #dfdfd8; stroke-width: 1; }
.profile text { font: 11px "Segoe UI", sans-serif; fill: #526269; }
.profile .trace { stroke: #ad4d28; stroke-width: 2; fill: none; }
.profile .area { fill: #f2dfd0; }
.profile .profile-point { position: absolute; transform: translate(-50%,-50%); border: 0; width: 18px; height: 18px; background: transparent; border-radius: 50%; display: grid; place-items: center; padding: 0; }
.profile-point::before { content: ""; border: 1px solid #9b3917; background: #fffefa; height: 7px; width: 7px; border-radius: 50%; }
.profile-point[aria-pressed="true"], .profile-point:hover, .profile-point:focus-visible { z-index: 2; }
.profile-point[aria-pressed="true"]::before, .profile-point:hover::before { background: #ac4e27; width: 11px; height: 11px; box-shadow: 0 0 0 2px white; }
.sources { margin: 13px 2px 24px; color: var(--muted); font-size: .87rem; }
.sources summary { cursor: pointer; color: var(--ink); width: fit-content; }
.source-copy { max-width: 80ch; margin-top: 10px; line-height: 1.55; }
.source-copy ul { margin: 6px 0; padding-left: 22px; }
a { color: #8e391d; text-underline-offset: 3px; }
@media (max-width: 960px) {
  .hero, main { width: min(100% - 32px, 1512px); }
  .atlas { grid-template-columns: minmax(0, 1fr) 292px; }
  .route-panel { padding-inline: 12px; }
}
@media (max-width: 720px) {
  .hero, main { width: calc(100% - 24px); }
  .hero { padding-top: 21px; padding-bottom: 17px; }
  .atlas { grid-template-columns: minmax(0, 1fr); }
  .route-panel { border-left: 0; border-top: 1px solid var(--border); padding-inline: 15px; }
  .viewport { height: clamp(340px, 61vh, 590px); }
  .map-toolbar { padding-inline: 6px; gap: 4px; }
  .map-toolbar button { padding-inline: 7px; }
}
@media (max-width: 400px) {
  .hero .subtitle { font-size: .86rem; }
  .hero .summit-stat > span { font-size: .68rem; }
  .map-toolbar button { font-size: .78rem; }
}
@media (pointer: coarse) {
  .map-toolbar button { min-height: 40px; }
  .map-actions button { width: 43px; height: 41px; }
  .marker { width: 38px; height: 38px; }
  .landmark-row { min-height: 43px; }
}

#imagery-settings {
  width: min(430px, calc(100% - 28px));
  max-width: none;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--ink);
  background: var(--panel);
  box-shadow: 0 12px 52px #101c2066;
}
#imagery-settings::backdrop { background: #14242bc0; }
#imagery-settings form { display: grid; gap: 12px; }
#imagery-settings h2 { font-family: Georgia, serif; font-size: 1.62rem; font-weight: 500; }
#imagery-settings p { color: var(--muted); line-height: 1.45; }
#imagery-settings label { font-size: .92rem; font-weight: 650; }
#imagery-settings input {
  padding: 10px 11px;
  width: 100%;
  border: 1px solid #a4a9a6;
  border-radius: 5px;
  color: var(--ink);
  background: white;
  font: inherit;
}
#imagery-status { min-height: 1.4em; font-size: .9rem; }
.imagery-actions { display: flex; flex-wrap: wrap; justify-content: end; gap: 7px; }
.imagery-actions button, .imagery-manage {
  padding: 8px 11px;
  border: 1px solid #a4a9a6;
  border-radius: 5px;
  background: white;
  color: var(--ink);
}
#imagery-connect { background: #283c44; border-color: #283c44; color: white; }
#imagery-connect:disabled { opacity: .55; }
#imagery-disconnect { margin-right: auto; }
.imagery-notice { padding: 7px 13px; font-size: .86rem; }

.viewport.panning { cursor: move; }
.viewport.dragging { cursor: grabbing; }
#pan-mode { font-size: .76rem; }
.map-actions button[aria-pressed="true"] { background: #4b6268; }
.route-tip {
  position: absolute; z-index: 4; transform: translate(-50%, -100%); pointer-events: none;
  max-width: calc(100% - 16px); white-space: nowrap; padding: 4px 7px; border-radius: 4px;
  background: #15252df2; color: #fff4cf; font-size: .76rem; font-weight: 650;
}
.profile-cursor-line { stroke: #8e5433; stroke-width: 1; stroke-dasharray: 3 2; }
.profile-cursor-dot { fill: #ffe1a6; stroke: #824327; stroke-width: 1.5; }
.route-scrubber { display: grid; grid-template-columns: auto minmax(70px, 1fr) auto; gap: 8px; align-items: center; margin-top: 2px; }
.route-scrubber[hidden] { display: none; }
.route-scrubber label { font-size: .81rem; font-weight: 650; }
.route-scrubber input { width: 100%; margin: 0; accent-color: var(--accent); }
.route-scrubber output { color: var(--muted); font-size: .79rem; font-variant-numeric: tabular-nums; }
@media (max-width: 530px) {
  .route-scrubber { grid-template-columns: auto 1fr; }
  .route-scrubber output { grid-column: 1 / -1; }
}
