* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; font-family: system-ui, -apple-system, sans-serif; }
body { display: flex; flex-direction: column; }

header {
  padding: .5rem 1rem; background: #2c3e50; color: #fff;
  display: flex; gap: 1rem; align-items: baseline; flex-wrap: wrap;
}
header h1 { font-size: 1rem; margin: 0; font-weight: 600; }
#status { font-size: .85rem; opacity: .9; }

#main { flex: 1; min-height: 0; display: flex; }
#map { flex: 1; min-width: 0; }

#sidebar {
  width: 300px; overflow-y: auto; padding: .75rem 1rem;
  background: #f7f7f8; border-left: 1px solid #ddd; font-size: .85rem;
}
#sidebar h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: #666; margin: .75rem 0 .4rem; }
#sidebar h2:first-child { margin-top: 0; }
#sidebar .hint { color: #888; }
#sidebar .prof { font-family: ui-monospace, monospace; font-size: .72rem; color: #888; margin-bottom: .5rem; }

#controls label { font-size: .8rem; color: #666; display: block; margin: .5rem 0 .25rem; }
#controls label:first-child { margin-top: 0; }
#controls select, #controls input[type=range] { width: 100%; }
#controls select { padding: .35rem; border: 1px solid #ccc; border-radius: 4px; }
#controls label.chk { display: flex; align-items: center; gap: .4rem; margin: .6rem 0 .25rem; cursor: pointer; }
#controls label.chk input { width: auto; margin: 0; }
#controls .sub { font-size: .72rem; margin: .5rem 0 0; }

#chart svg, #elev svg { display: block; }

#options .opt {
  padding: .4rem .55rem; border: 1px solid #e3e3e3; border-radius: 5px;
  margin: .35rem 0; cursor: pointer; background: #fff;
}
#options .opt:hover { border-color: #aaa; }
#options .opt.pick { background: #eef6ff; }
#options .opt.sel  { outline: 2px solid #2980b9; }
#options .opt-h { font-weight: 600; }
#options .opt-m { font-size: .76rem; color: #555; }
#options .opt-s { font-family: ui-monospace, monospace; font-size: .68rem; color: #aaa; margin-top: .1rem; }

#metrics table { width: 100%; border-collapse: collapse; margin-bottom: .5rem; }
#metrics td { padding: .2rem 0; border-bottom: 1px solid #eee; }
#metrics td:last-child { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
#metrics .warn { color: #c0392b; }

#export { display: flex; gap: .5rem; margin: 0 0 .5rem; }
#export button {
  flex: 1; padding: .4rem; border: 1px solid #ccc; background: #fff;
  border-radius: 4px; cursor: pointer; font-size: .8rem;
}
#export button:disabled { opacity: .5; cursor: default; }
#export button:not(:disabled):hover { border-color: #2980b9; }

#legend .row { display: flex; align-items: center; gap: .5rem; margin: .3rem 0; }
#legend .sw { width: 1.1rem; height: .35rem; border-radius: 2px; display: inline-block; flex: none; }

#photos { margin: 0 0 .5rem; }
#photos button {
  width: 100%; padding: .4rem; border: 1px solid #ccc; background: #fff;
  border-radius: 4px; cursor: pointer; font-size: .8rem;
}
#photos button:disabled { opacity: .5; cursor: default; }
#photos button:not(:disabled):hover { border-color: #2980b9; }

/* camera markers on the route */
.photo-pin {
  font-size: 15px; line-height: 22px; text-align: center;
  background: #fff; border: 1px solid #d35400; border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,.4); cursor: pointer;
}
.photo-pin:hover { background: #ffe9d6; }

/* photo popup */
.photo-pop { width: 100%; }
.photo-pop .photo-load, .photo-pop .photo-err { font-size: .8rem; color: #666; padding: .5rem 0; }
.photo-img { width: 100%; height: auto; display: block; border-radius: 4px; }
.photo-credit { font-size: .72rem; color: #555; margin-top: .35rem; line-height: 1.35; }
.photo-credit a { color: #2980b9; }
